From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 10:26:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44BB5106564A; Wed, 12 Aug 2009 10:26:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3409A8FC6D; Wed, 12 Aug 2009 10:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CAQ4lD058695; Wed, 12 Aug 2009 10:26:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CAQ4Me058692; Wed, 12 Aug 2009 10:26:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908121026.n7CAQ4Me058692@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Aug 2009 10:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196118 - in head/sys: net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 10:26:04 -0000 Author: bz Date: Wed Aug 12 10:26:03 2009 New Revision: 196118 URL: http://svn.freebsd.org/changeset/base/196118 Log: Put minimum alignment on the dpcpu and vnet section so that ld when adding the __start_ symbol knows the expected section alignment and can place the __start_ symbol correctly. These sections will not support symbols with super-cache line alignment requirements. For full details, see posting to freebsd-current, 2009-08-10, Message-ID: <20090810133111.C93661@maildrop.int.zabbadoz.net>. Debugging and testing patches by: Kamigishi Rei (spambox haruhiism.net), np, lstewart, jhb, kib, rwatson Tested by: Kamigishi Rei, lstewart Reviewed by: kib Approved by: re Modified: head/sys/net/vnet.h head/sys/sys/pcpu.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Aug 12 08:07:24 2009 (r196117) +++ head/sys/net/vnet.h Wed Aug 12 10:26:03 2009 (r196118) @@ -185,12 +185,14 @@ extern struct sx vnet_sxlock; * Virtual network stack memory allocator, which allows global variables to * be automatically instantiated for each network stack instance. */ +__asm__( #if defined(__arm__) -__asm__(".section " VNET_SETNAME ", \"aw\", %progbits"); + ".section " VNET_SETNAME ", \"aw\", %progbits\n" #else -__asm__(".section " VNET_SETNAME ", \"aw\", @progbits"); + ".section " VNET_SETNAME ", \"aw\", @progbits\n" #endif -__asm__(".previous"); + "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" + "\t.previous"); #define VNET_NAME(n) vnet_entry_##n #define VNET_DECLARE(t, n) extern t VNET_NAME(n) Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Wed Aug 12 08:07:24 2009 (r196117) +++ head/sys/sys/pcpu.h Wed Aug 12 10:26:03 2009 (r196118) @@ -56,12 +56,14 @@ struct thread; extern uintptr_t *__start_set_pcpu; extern uintptr_t *__stop_set_pcpu; +__asm__( #if defined(__arm__) -__asm__(".section set_pcpu, \"aw\", %progbits"); + ".section set_pcpu, \"aw\", %progbits\n" #else -__asm__(".section set_pcpu, \"aw\", @progbits"); + ".section set_pcpu, \"aw\", @progbits\n" #endif -__asm__(".previous"); + "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" + "\t.previous"); /* * Array of dynamic pcpu base offsets. Indexed by id. From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 10:41:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91365106564A; Wed, 12 Aug 2009 10:41:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80B328FC41; Wed, 12 Aug 2009 10:41:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CAfbKq059086; Wed, 12 Aug 2009 10:41:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CAfbrB059084; Wed, 12 Aug 2009 10:41:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908121041.n7CAfbrB059084@svn.freebsd.org> From: Robert Watson Date: Wed, 12 Aug 2009 10:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196120 - head/usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 10:41:38 -0000 Author: rwatson Date: Wed Aug 12 10:41:37 2009 New Revision: 196120 URL: http://svn.freebsd.org/changeset/base/196120 Log: Update procstat(1) for the fact that devfs paths are no longer unsupported. Approved by: re (kib) Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Wed Aug 12 10:32:20 2009 (r196119) +++ head/usr.bin/procstat/procstat.1 Wed Aug 12 10:41:37 2009 (r196120) @@ -351,10 +351,8 @@ may be mechanically parsed. .Pp The display of open file or memory mapping pathnames is implemented using the kernel's name cache. -It therefore does not work for file systems -that do not use the name cache, such as -.Xr devfs 4 , -or if the name is not present in the cache due to removal. +If a file system does not use the name cache, or the path to a file is not in +the cache, a path will not be displayed. .Pp .Nm currently supports extracting data only from a live kernel, and not from From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 10:44:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D6EC106566B; Wed, 12 Aug 2009 10:44:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D22D8FC16; Wed, 12 Aug 2009 10:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CAiEhk059177; Wed, 12 Aug 2009 10:44:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CAiDxP059175; Wed, 12 Aug 2009 10:44:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908121044.n7CAiDxP059175@svn.freebsd.org> From: Robert Watson Date: Wed, 12 Aug 2009 10:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196121 - head/sys/netatalk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 10:44:14 -0000 Author: rwatson Date: Wed Aug 12 10:44:13 2009 New Revision: 196121 URL: http://svn.freebsd.org/changeset/base/196121 Log: Reverse misordered unlock and lock in at_control for netatalk phase I addresses. Submitted by: Russell Cattelan Approved by: re (kib) Modified: head/sys/netatalk/at_control.c Modified: head/sys/netatalk/at_control.c ============================================================================== --- head/sys/netatalk/at_control.c Wed Aug 12 10:41:37 2009 (r196120) +++ head/sys/netatalk/at_control.c Wed Aug 12 10:44:13 2009 (r196121) @@ -276,7 +276,7 @@ at_control(struct socket *so, u_long cmd * If the request is specifying phase 1, then * only look at a phase one address */ - AT_IFADDR_RUNLOCK(); + AT_IFADDR_RLOCK(); for (oaa = aa; aa; aa = TAILQ_NEXT(aa, aa_link)) { if (aa->aa_ifp == ifp && (aa->aa_flags & AFA_PHASE2) == 0) @@ -286,7 +286,7 @@ at_control(struct socket *so, u_long cmd ifa_free(&oaa->aa_ifa); if (aa != NULL && oaa != aa) ifa_ref(&aa->aa_ifa); - AT_IFADDR_RLOCK(); + AT_IFADDR_RUNLOCK(); } else { struct at_ifaddr *oaa; From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 10:45:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04F011065670; Wed, 12 Aug 2009 10:45:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E86A48FC44; Wed, 12 Aug 2009 10:45:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CAjjwa059247; Wed, 12 Aug 2009 10:45:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CAjjQi059245; Wed, 12 Aug 2009 10:45:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908121045.n7CAjjQi059245@svn.freebsd.org> From: Robert Watson Date: Wed, 12 Aug 2009 10:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196122 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 10:45:46 -0000 Author: rwatson Date: Wed Aug 12 10:45:45 2009 New Revision: 196122 URL: http://svn.freebsd.org/changeset/base/196122 Log: Correctly audit real gids following changes to the audit record argument interface. Approved by: re (kib) Modified: head/sys/security/audit/audit.h Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Wed Aug 12 10:44:13 2009 (r196121) +++ head/sys/security/audit/audit.h Wed Aug 12 10:45:45 2009 (r196122) @@ -232,7 +232,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_RGID(rgid) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_gid((rgid)); \ + audit_arg_rgid((rgid)); \ } while (0) #define AUDIT_ARG_RUID(ruid) do { \ From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 10:46:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 892B51065674; Wed, 12 Aug 2009 10:46:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76F8B8FC4A; Wed, 12 Aug 2009 10:46:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CAkmDd059306; Wed, 12 Aug 2009 10:46:48 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CAkmAw059298; Wed, 12 Aug 2009 10:46:48 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908121046.n7CAkmAw059298@svn.freebsd.org> From: Robert Watson Date: Wed, 12 Aug 2009 10:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196123 - head/lib/libc/posix1e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 10:46:49 -0000 Author: rwatson Date: Wed Aug 12 10:46:48 2009 New Revision: 196123 URL: http://svn.freebsd.org/changeset/base/196123 Log: Update posix1e-related man pages, especially as relates to MAC, to more accurately reflect the last ten years of work. Approved by: re (kib) Modified: head/lib/libc/posix1e/Makefile.inc head/lib/libc/posix1e/mac.3 head/lib/libc/posix1e/mac_free.3 head/lib/libc/posix1e/mac_get.3 head/lib/libc/posix1e/mac_set.3 head/lib/libc/posix1e/mac_text.3 head/lib/libc/posix1e/posix1e.3 Modified: head/lib/libc/posix1e/Makefile.inc ============================================================================== --- head/lib/libc/posix1e/Makefile.inc Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/Makefile.inc Wed Aug 12 10:46:48 2009 (r196123) @@ -106,14 +106,16 @@ MLINKS+=acl_create_entry.3 acl_create_en mac_get.3 mac_get_fd.3 \ mac_get.3 mac_get_file.3 \ mac_get.3 mac_get_link.3 \ + mac_get.3 mac_get_peer.3 \ mac_get.3 mac_get_pid.3 \ mac_get.3 mac_get_proc.3 \ mac_prepare.3 mac_prepare_file_label.3 \ mac_prepare.3 mac_prepare_ifnet_label.3 \ mac_prepare.3 mac_prepare_process_label.3 \ - mac_set.3 mac_set_link.3 \ + mac_prepare.3 mac_prepare_type.3 \ mac_set.3 mac_set_fd.3 \ mac_set.3 mac_set_file.3 \ + mac_set.3 mac_set_link.3 \ mac_set.3 mac_set_proc.3 \ mac_text.3 mac_from_text.3 \ mac_text.3 mac_to_text.3 Modified: head/lib/libc/posix1e/mac.3 ============================================================================== --- head/lib/libc/posix1e/mac.3 Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/mac.3 Wed Aug 12 10:46:48 2009 (r196123) @@ -1,4 +1,5 @@ .\" Copyright (c) 2001, 2003 Networks Associates Technology, Inc. +.\" Copyright (c) 2009 Robert N. M. Watson .\" All rights reserved. .\" .\" This software was developed for the FreeBSD Project by Chris @@ -30,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2003 +.Dd August 7, 2009 .Dt MAC 3 .Os .Sh NAME @@ -44,81 +45,82 @@ In the kernel configuration file: .Cd "options MAC" .Sh DESCRIPTION -.Fx -permits administrators to define Mandatory Access Control labels -defining levels for the privacy and integrity of data, -overriding discretionary policies -for those objects. -Not all objects currently provide support for MAC labels, -and MAC support must be explicitly enabled by the administrator. -The library calls include routines to retrieve, duplicate, -and set MAC labels associated with files and processes. -.Pp -POSIX.1e describes a set of MAC manipulation routines -to manage the contents of MAC labels, -as well as their relationships with -files and processes; -almost all of these support routines -are implemented in -.Fx . +Mandatory Access Control labels describe confidentiality, integrity, and +other security attributes of operating system objects, overriding +discretionary access control. +Not all system objects support MAC labeling, and MAC policies must be +explicitly enabled by the administrator. +This API, based on POSIX.1e, includes routines to retrieve, manipulate, set, +and convert to and from text the MAC labels on files and processes. +.Pp +MAC labels consist of a set of (name, value) tuples, representing security +attributes from MAC policies. +For example, this label contains security labels defined by two policies, +.Xr mac_biba 4 +and +.Xr mac_mls 4 : +.Bd -literal -offset indent +biba/low,mls/low +.Ed +.Pp +Further syntax and semantics of MAC labels may be found in +.Xr maclabel 7 . +.Pp +Applications operate on labels stored in +.Vt mac_t , +but can convert between this internal format and a text format for the +purposes of presentation to uses or external storage. +When querying a label on an object, a +.Vt mac_t +must first be prepared using the interfaces described in +.Xr mac_prepare 3 , +allowing the application to declare which policies it wishes to interogate. +The application writer can also rely on default label names declared in +.Xr mac.conf 5 . +.Pp +When finished with a +.Vt mac_t , +the application must call +.Xr mac_free 3 +to release its storage. .Pp -Available functions, sorted by behavior, include: +The following functions are defined: .Bl -tag -width indent -.It Fn mac_get_fd -This function is described in +.It Fn mac_is_present +This function, described in +.Xr mac_is_present 3 , +allows applications to test whether MAC is configured, as well as whether +specific policies are configured. +.It Fn mac_get_fd , Fn mac_get_file , Fn mac_get_link , Fn mac_get_peer +These functions, described in .Xr mac_get 3 , -and may be used to retrieve the -MAC label associated with -a specific file descriptor. -.It Fn mac_get_file -This function is described in +retrieve the MAC labels associated with file descriptors, files, and socket +peers. +.It Fn mac_get_pid , Fn mac_get_proc +These functions, described in .Xr mac_get 3 , -and may be used to retrieve the -MAC label associated with -a named file. -.It Fn mac_get_proc -This function is described in -.Xr mac_get 3 , -and may be used to retrieve the -MAC label associated with -the calling process. -.It Fn mac_set_fd -This function is described in -.Xr mac_set 3 , -and may be used to set the -MAC label associated with -a specific file descriptor. -.It Fn mac_set_file -This function is described in +retrieve the MAC labels associated with processes. +.It Fn mac_set_fd , Fn mac_set_file , Fn mac_set_link +These functions, described in .Xr mac_set 3 , -and may be used to set the -MAC label associated with -a named file. +set the MAC labels associated with file descriptors and files. .It Fn mac_set_proc -This function is described in +This function, described in .Xr mac_set 3 , -and may be used to set the -MAC label associated with -the calling process. +sets the MAC label associated with the current process. .It Fn mac_free -This function is described in +This function, desribed in .Xr mac_free 3 , -and may be used to free -userland working MAC label storage. +frees working MAC label storage. .It Fn mac_from_text -This function is described in +This function, described in .Xr mac_text 3 , -and may be used to convert -a text-form MAC label -into a working +converts a text-form MAC label into working MAC label storage, .Vt mac_t . -.It Fn mac_prepare -.It Fn mac_prepare_file_label -.It Fn mac_prepare_ifnet_label -.It Fn mac_prepare_process_label -These functions are described in +.It Fn mac_prepare , Fn mac_prepare_file_label , Fn mac_prepare_ifnet_label , Fn mac_prepare_process_label , Fn mac_prepare_type +These functions, described in .Xr mac_prepare 3 , -and may be used to preallocate storage for MAC label retrieval. +allocate working storage for MAC label operations. .Xr mac_prepare 3 prepares a label based on caller-specified label names; the other calls rely on the default configuration specified in @@ -130,15 +132,6 @@ and may be used to convert a .Vt mac_t into a text-form MAC label. .El -The behavior of some of these calls is influenced by the configuration -settings found in -.Xr mac.conf 5 , -the MAC library run-time configuration file. -.Sh IMPLEMENTATION NOTES -.Fx Ns 's -support for POSIX.1e interfaces and features -is -.Ud . .Sh FILES .Bl -tag -width ".Pa /etc/mac.conf" -compact .It Pa /etc/mac.conf @@ -150,24 +143,20 @@ system objects, but without policy-speci .Sh SEE ALSO .Xr mac_free 3 , .Xr mac_get 3 , +.Xr mac_is_present 3 , .Xr mac_prepare 3 , .Xr mac_set 3 , .Xr mac_text 3 , +.Xr posix1e 3 , .Xr mac 4 , .Xr mac.conf 5 , .Xr mac 9 .Sh STANDARDS -These APIs are loosely based on the APIs described in POSIX.1e. -POSIX.1e is described in IEEE POSIX.1e draft 17. -Discussion of the draft -continues on the cross-platform POSIX.1e implementation mailing list. -To join this list, see the -.Fx -POSIX.1e implementation page -for more information. -However, the resemblance of these APIs to the POSIX APIs is only loose, -as the POSIX APIs were unable to express many notions required for -flexible and extensible access control. +These APIs are loosely based on the APIs described in POSIX.1e, as described +in IEEE POSIX.1e draft 17. +However, the resemblence of these APIS to the POSIX APIs is loose, as the +PSOXI APIS were unable to express some notinos required for flexible and +extensible access control. .Sh HISTORY Support for Mandatory Access Control was introduced in .Fx 5.0 Modified: head/lib/libc/posix1e/mac_free.3 ============================================================================== --- head/lib/libc/posix1e/mac_free.3 Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/mac_free.3 Wed Aug 12 10:46:48 2009 (r196123) @@ -64,6 +64,7 @@ function. .Xr mac_prepare 3 , .Xr mac_set 3 , .Xr mac_text 3 , +.Xr posix1e 3 , .Xr mac 4 , .Xr mac 9 .Sh STANDARDS @@ -91,8 +92,8 @@ is a complex structure in the .Tn TrustedBSD implementation, .Fn mac_free -is specific to that type, and must not be used to free the character -strings returned from +is specific to +.Vt mac_3 , +and must not be used to free the character strings returned from .Fn mac_to_text . -Doing so may result in undefined behavior, -including application failure. +Doing so may result in undefined behavior. Modified: head/lib/libc/posix1e/mac_get.3 ============================================================================== --- head/lib/libc/posix1e/mac_get.3 Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/mac_get.3 Wed Aug 12 10:46:48 2009 (r196123) @@ -133,6 +133,7 @@ is not a directory. .Xr mac_prepare 3 , .Xr mac_set 3 , .Xr mac_text 3 , +.Xr posix1e 3 , .Xr mac 4 , .Xr mac 9 .Sh STANDARDS Modified: head/lib/libc/posix1e/mac_set.3 ============================================================================== --- head/lib/libc/posix1e/mac_set.3 Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/mac_set.3 Wed Aug 12 10:46:48 2009 (r196123) @@ -138,6 +138,7 @@ is not a directory. .Xr mac_is_present 3 , .Xr mac_prepare 3 , .Xr mac_text 3 , +.Xr posix1e 3 , .Xr mac 4 , .Xr mac 9 .Sh HISTORY Modified: head/lib/libc/posix1e/mac_text.3 ============================================================================== --- head/lib/libc/posix1e/mac_text.3 Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/mac_text.3 Wed Aug 12 10:46:48 2009 (r196123) @@ -98,6 +98,7 @@ to allocate internal storage. .Xr mac_is_present 3 , .Xr mac_prepare 3 , .Xr mac_set 3 , +.Xr posix1e 3 , .Xr mac 4 , .Xr maclabel 7 .Sh STANDARDS Modified: head/lib/libc/posix1e/posix1e.3 ============================================================================== --- head/lib/libc/posix1e/posix1e.3 Wed Aug 12 10:45:45 2009 (r196122) +++ head/lib/libc/posix1e/posix1e.3 Wed Aug 12 10:46:48 2009 (r196123) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000 Robert N. M. Watson +.\" Copyright (c) 2000, 2009 Robert N. M. Watson .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2009 +.Dd August 7, 2009 .Dt POSIX1E 3 .Os .Sh NAME @@ -36,99 +36,77 @@ .Sh SYNOPSIS .In sys/types.h .In sys/acl.h -.\" .In sys/capability.h .In sys/mac.h .Sh DESCRIPTION -The IEEE POSIX.1e specification never left draft form, but the interfaces -it describes are now widely used despite inherent limitations. -Currently, only a few of the interfaces and features are implemented in -.Fx , -although efforts are underway to complete the integration at this time. +POSIX.1e describes five security extensions to the POSIX.1 API: Access +Control Lists (ACLs), Auditing, Capabilities, Mandatory Access Control, and +Information Flow Labels. +While IEEE POSIX.1e D17 specification has not been standardized, several of +its interfaces are widely used. .Pp -POSIX.1e describes five security extensions to the base POSIX.1 API: -Access Control Lists (ACLs), Auditing, Capabilities, Mandatory Access -Control, and Information Flow Labels. .Fx -supports POSIX.1e ACL interfaces, as well as POSIX.1e-like MAC -interfaces. -The TrustedBSD Project has produced but not integrated an implementation -of POSIX.1e Capabilities. -.Pp -POSIX.1e defines both syntax and semantics for these features, but fairly -substantial changes are required to implement these features in the -operating system. -.Pp -As shipped, -.Fx 4.0 -provides API and VFS support for ACLs, but not an implementation on any -native file system. -.Fx 5.0 -includes support for ACLs as part of UFS1 and UFS2, as well as necessary -VFS support for additional file systems to export ACLs as appropriate. -Available API calls relating to ACLs are described in detail in -.Xr acl 3 . -.Pp -As shipped, -.Fx 5.0 -includes support for Mandatory Access Control as well as POSIX.1e-like -APIs for label management. -More information on API calls relating to MAC is available in -.Xr mac 3 . +implements POSIX.1e interface for access control lists, described in +.Xr acl 3 , +and supports ACLs on the +.Xr ffs 7 +file system; ACLs must be administratively enabled using +.Xr tunefs 8 . .Pp -Additional patches supporting POSIX.1e features are provided by the -TrustedBSD project: +.Fx +implements a POSIX.1e-like mandatory access control interface, described in +.Xr mac 3 , +although with a number of extensions and important semantic differences. .Pp -http://www.TrustedBSD.org/ -.Sh IMPLEMENTATION NOTES -.Fx Ns 's -support for POSIX.1e interfaces and features is still under -development at this time, and many of these features are considered new -or experimental. +.Fx +does not implement the POSIX.1e audit, privilege (capability), or information +flow label APIs. +However, +.Fx +does implement the +.Xr libbsm +audit API. .Sh ENVIRONMENT -POSIX.1e assigns security labels to all objects, extending the security +POSIX.1e assigns security attributes to all objects, extending the security functionality described in POSIX.1. -These additional labels provide -fine-grained discretionary access control, fine-grained capabilities, -and labels necessary for mandatory access control. -POSIX.2c describes -a set of userland utilities for manipulating these labels. +These additional attributes store fine-grained discretionary access control +information and mandatory access control labels; for files, they are stored +in extended attributes, described in +.Xr extattr 3 . .Pp -Many of these services are supported by extended attributes, documented -in -.Xr extattr 2 +POSIX.2c describes +a set of userland utilities for manipulating these attributes, including +.Xr getfacl 1 +and +.Xr setfacl 1 +for access control lists, and +.Xr getfmac 8 and -.Xr extattr 9 . -While these APIs are not documented in POSIX.1e, they are similar in -structure. +.Xr setfmac 8 +for mandatory access control labels. .Sh SEE ALSO +.Xr getfacl 1 , +.Xr setfacl 1 , .Xr extattr 2 , .Xr acl 3 , +.Xr extattr 3 , .Xr libbsm 3 , .Xr mac 3 , +.Xr ffs 7 , +.Xr getfmac 8 , +.Xr setfmac 8 , +.Xr tunefs 8 , .Xr acl 9 , .Xr extattr 9 , .Xr mac 9 .Sh STANDARDS POSIX.1e is described in IEEE POSIX.1e draft 17. -Discussion of the draft continues -on the cross-platform POSIX.1e implementation -mailing list. -To join this list, see the -.Fx -POSIX.1e implementation -page for more information. .Sh HISTORY POSIX.1e support was introduced in .Fx 4.0 ; -most of the features are available as of +most features were available as of .Fx 5.0 . -Development continues. .Sh AUTHORS .An Robert N M Watson .An Chris D. Faulhaber .An Thomas Moestl .An Ilmar S Habibulin -.Sh BUGS -Many of these features are considered new or experimental in -.Fx 5.0 -and should be deployed with appropriate caution. From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 11:55:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 483A11065677; Wed, 12 Aug 2009 11:55:27 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3789C8FC56; Wed, 12 Aug 2009 11:55:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CBtQ5s063219; Wed, 12 Aug 2009 11:55:26 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CBtQUD063217; Wed, 12 Aug 2009 11:55:26 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200908121155.n7CBtQUD063217@svn.freebsd.org> From: Colin Percival Date: Wed, 12 Aug 2009 11:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196128 - head/usr.sbin/ntp/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 11:55:27 -0000 Author: cperciva Date: Wed Aug 12 11:55:26 2009 New Revision: 196128 URL: http://svn.freebsd.org/changeset/base/196128 Log: Apply the ntp-related part of r195626 to the correct part of the tree -- the mkver which is used in builds is the one in usr.sbin/ntp/scripts, not the one in contrib/ntp/scripts. Pointy hat to: cperciva Approved by: re (rwatson) Modified: head/usr.sbin/ntp/scripts/mkver Modified: head/usr.sbin/ntp/scripts/mkver ============================================================================== --- head/usr.sbin/ntp/scripts/mkver Wed Aug 12 11:43:45 2009 (r196127) +++ head/usr.sbin/ntp/scripts/mkver Wed Aug 12 11:55:26 2009 (r196128) @@ -23,8 +23,6 @@ case "" in *) ConfStr="${ConfStr}-r" ;; esac -ConfStr="$ConfStr `LC_ALL=C date`" - if [ ! -f .version ]; then echo 0 > .version fi From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:00:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D788F106567E; Wed, 12 Aug 2009 12:00:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AFAE8FC4B; Wed, 12 Aug 2009 12:00:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CC0Lli063409; Wed, 12 Aug 2009 12:00:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CC0LJr063407; Wed, 12 Aug 2009 12:00:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908121200.n7CC0LJr063407@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Aug 2009 12:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196129 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:00:23 -0000 Author: bz Date: Wed Aug 12 12:00:21 2009 New Revision: 196129 URL: http://svn.freebsd.org/changeset/base/196129 Log: Update DDB show vnet command to print all used and available information. Reviewed by: rwatson, zec Approved by: re Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed Aug 12 11:55:26 2009 (r196128) +++ head/sys/net/vnet.c Wed Aug 12 12:00:21 2009 (r196129) @@ -615,14 +615,20 @@ DB_SHOW_COMMAND(vnets, db_show_vnets) { VNET_ITERATOR_DECL(vnet_iter); -#if SIZE_MAX == UINT32_MAX /* 32-bit arch */ - db_printf(" vnet ifs socks\n"); -#else /* 64-bit arch, most probaly... */ - db_printf(" vnet ifs socks\n"); -#endif VNET_FOREACH(vnet_iter) { - db_printf("%p %3d %5d\n", vnet_iter, vnet_iter->vnet_ifcnt, - vnet_iter->vnet_sockcnt); + db_printf("vnet = %p\n", vnet_iter); + db_printf(" vnet_magic_n = 0x%x (%s, orig 0x%x)\n", + vnet_iter->vnet_magic_n, + (vnet_iter->vnet_magic_n == VNET_MAGIC_N) ? + "ok" : "mismatch", VNET_MAGIC_N); + db_printf(" vnet_ifcnt = %u\n", vnet_iter->vnet_ifcnt); + db_printf(" vnet_sockcnt = %u\n", vnet_iter->vnet_sockcnt); + db_printf(" vnet_data_mem = %p\n", vnet_iter->vnet_data_mem); + db_printf(" vnet_data_base = 0x%jx\n", + (uintmax_t)vnet_iter->vnet_data_base); + db_printf("\n"); + if (db_pager_quit) + break; } } #endif From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:06:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8EE91065874; Wed, 12 Aug 2009 12:06:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BC18FC45; Wed, 12 Aug 2009 12:06:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CC6GZX063641; Wed, 12 Aug 2009 12:06:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CC6Gpn063639; Wed, 12 Aug 2009 12:06:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908121206.n7CC6Gpn063639@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Aug 2009 12:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196132 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:06:41 -0000 Author: bz Date: Wed Aug 12 12:06:16 2009 New Revision: 196132 URL: http://svn.freebsd.org/changeset/base/196132 Log: Add ddb show dpcpu_off command to ease dpcpu memory debugging. While show pcpu prints pc_dynamic this also prints the original memory address as well as the maths. Once dpcpu goes NUMA this is considered to help debugging as well. Reviewed by: rwatson Approved by: re Modified: head/sys/kern/subr_pcpu.c Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Wed Aug 12 12:05:07 2009 (r196131) +++ head/sys/kern/subr_pcpu.c Wed Aug 12 12:06:16 2009 (r196132) @@ -313,6 +313,18 @@ sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS) } #ifdef DDB +DB_SHOW_COMMAND(dpcpu_off, db_show_dpcpu_off) +{ + int id; + + for (id = 0; id <= mp_maxid; id++) { + if (CPU_ABSENT(id)) + continue; + db_printf("dpcpu_off[%2d] = 0x%jx (+ DPCPU_START = %p)\n", + id, (uintmax_t)dpcpu_off[id], + (void *)(uintptr_t)(dpcpu_off[id] + DPCPU_START)); + } +} static void show_pcpu(struct pcpu *pc) From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:10:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 977121065708; Wed, 12 Aug 2009 12:10:08 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677458FC49; Wed, 12 Aug 2009 12:10:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CCA0s7063786; Wed, 12 Aug 2009 12:10:00 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CCA0Op063785; Wed, 12 Aug 2009 12:10:00 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200908121210.n7CCA0Op063785@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 12 Aug 2009 12:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196133 - in head/crypto/openssl: apps test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:10:11 -0000 Author: simon Date: Wed Aug 12 12:10:00 2009 New Revision: 196133 URL: http://svn.freebsd.org/changeset/base/196133 Log: Remove symlinks in OpenSSL's testing framework. These are not required for normal build, and doesn't export well to CVS. If they are needed later a script will be added to recreate the symlinks when needed at build time. Approved by: re (rwatson) Deleted: head/crypto/openssl/apps/md4.c head/crypto/openssl/test/bftest.c head/crypto/openssl/test/bntest.c head/crypto/openssl/test/casttest.c head/crypto/openssl/test/destest.c head/crypto/openssl/test/dhtest.c head/crypto/openssl/test/dsatest.c head/crypto/openssl/test/ecdhtest.c head/crypto/openssl/test/ecdsatest.c head/crypto/openssl/test/ectest.c head/crypto/openssl/test/enginetest.c head/crypto/openssl/test/evp_test.c head/crypto/openssl/test/exptest.c head/crypto/openssl/test/fips_aesavs.c head/crypto/openssl/test/fips_desmovs.c head/crypto/openssl/test/fips_dsatest.c head/crypto/openssl/test/fips_dssvs.c head/crypto/openssl/test/fips_hmactest.c head/crypto/openssl/test/fips_randtest.c head/crypto/openssl/test/fips_rngvs.c head/crypto/openssl/test/fips_rsagtest.c head/crypto/openssl/test/fips_rsastest.c head/crypto/openssl/test/fips_rsavtest.c head/crypto/openssl/test/fips_shatest.c head/crypto/openssl/test/fips_test_suite.c head/crypto/openssl/test/hmactest.c head/crypto/openssl/test/ideatest.c head/crypto/openssl/test/jpaketest.c head/crypto/openssl/test/md2test.c head/crypto/openssl/test/md4test.c head/crypto/openssl/test/md5test.c head/crypto/openssl/test/mdc2test.c head/crypto/openssl/test/randtest.c head/crypto/openssl/test/rc2test.c head/crypto/openssl/test/rc4test.c head/crypto/openssl/test/rc5test.c head/crypto/openssl/test/rmdtest.c head/crypto/openssl/test/rsa_test.c head/crypto/openssl/test/sha1test.c head/crypto/openssl/test/sha256t.c head/crypto/openssl/test/sha512t.c head/crypto/openssl/test/shatest.c head/crypto/openssl/test/ssltest.c From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:12:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B4001065713; Wed, 12 Aug 2009 12:12:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09E158FC16; Wed, 12 Aug 2009 12:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CCCNqo063926; Wed, 12 Aug 2009 12:12:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CCCN85063924; Wed, 12 Aug 2009 12:12:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908121212.n7CCCN85063924@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Aug 2009 12:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196135 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:12:26 -0000 Author: bz Date: Wed Aug 12 12:12:23 2009 New Revision: 196135 URL: http://svn.freebsd.org/changeset/base/196135 Log: Make the kernel compile without IP networking by moving a variable under a proper #ifdef. Approved by: re (rwatson) Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Aug 12 12:10:28 2009 (r196134) +++ head/sys/kern/kern_jail.c Wed Aug 12 12:12:23 2009 (r196135) @@ -472,10 +472,11 @@ kern_jail_set(struct thread *td, struct #endif struct vfsopt *opt; struct vfsoptlist *opts; - struct prison *pr, *deadpr, *mypr, *ppr, *tpr, *tppr; + struct prison *pr, *deadpr, *mypr, *ppr, *tpr; struct vnode *root; char *domain, *errmsg, *host, *name, *p, *path, *uuid; #if defined(INET) || defined(INET6) + struct prison *tppr; void *op; #endif unsigned long hid; From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:29:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2F921065678; Wed, 12 Aug 2009 12:29:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1CB28FC4A; Wed, 12 Aug 2009 12:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CCT7YP064396; Wed, 12 Aug 2009 12:29:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CCT7Bw064394; Wed, 12 Aug 2009 12:29:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908121229.n7CCT7Bw064394@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Aug 2009 12:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196137 - head/usr.sbin/jls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:29:18 -0000 Author: bz Date: Wed Aug 12 12:29:07 2009 New Revision: 196137 URL: http://svn.freebsd.org/changeset/base/196137 Log: Do not truncate IPv6 addresses when printing them in the jls -av 7.x multi-IP jail backward compat output. Reported by: ed Tested by: ed Reviewed by: rwatson Approved by: re Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Wed Aug 12 12:14:30 2009 (r196136) +++ head/usr.sbin/jls/jls.c Wed Aug 12 12:29:07 2009 (r196137) @@ -359,7 +359,7 @@ print_jail(int pflags, int jflags) ipbuf, sizeof(ipbuf)) == NULL) err(1, "inet_ntop"); else - printf("%6s %-15.15s\n", "", ipbuf); + printf("%6s %s\n", "", ipbuf); } } else if (pflags & PRINT_DEFAULT) printf("%6d %-15.15s %-29.29s %.74s\n", From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:50:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C99971065670; Wed, 12 Aug 2009 12:50:15 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF858FC44; Wed, 12 Aug 2009 12:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CCoFp3064981; Wed, 12 Aug 2009 12:50:15 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CCoFNJ064979; Wed, 12 Aug 2009 12:50:15 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200908121250.n7CCoFNJ064979@svn.freebsd.org> From: Robert Noland Date: Wed, 12 Aug 2009 12:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196141 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:50:16 -0000 Author: rnoland Date: Wed Aug 12 12:50:15 2009 New Revision: 196141 URL: http://svn.freebsd.org/changeset/base/196141 Log: Add some additional radeon pci ids to drm. Approved by: re (kib) MFC after: 0 days Modified: head/sys/dev/drm/drm_pciids.h Modified: head/sys/dev/drm/drm_pciids.h ============================================================================== --- head/sys/dev/drm/drm_pciids.h Wed Aug 12 12:49:52 2009 (r196140) +++ head/sys/dev/drm/drm_pciids.h Wed Aug 12 12:50:15 2009 (r196141) @@ -259,9 +259,12 @@ {0x1002, 0x940F, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V7600"}, \ {0x1002, 0x94A0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4830"}, \ {0x1002, 0x94A1, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4850"}, \ + {0x1002, 0x94A3, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI FirePro M7740"}, \ {0x1002, 0x94B1, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI RV740"}, \ {0x1002, 0x94B3, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI Radeon HD 4770"}, \ + {0x1002, 0x94B4, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI Radeon HD 4700 Series"}, \ {0x1002, 0x94B5, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI Radeon HD 4770"}, \ + {0x1002, 0x94B9, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI FirePro M5750"}, \ {0x1002, 0x94C0, CHIP_RV610|RADEON_NEW_MEMMAP, "RV610"}, \ {0x1002, 0x94C1, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 XT"}, \ {0x1002, 0x94C3, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 Pro"}, \ @@ -350,6 +353,7 @@ {0x1002, 0x9487, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon RV730 (AGP)"}, \ {0x1002, 0x948F, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon RV730 (AGP)"}, \ {0x1002, 0x9490, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon HD 4670"}, \ + {0x1002, 0x9495, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon HD 4600 Series"}, \ {0x1002, 0x9498, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon HD 4650"}, \ {0x1002, 0x9480, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4650"}, \ {0x1002, 0x9488, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4670"}, \ @@ -366,6 +370,7 @@ {0x1002, 0x9552, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon 4300 Series"}, \ {0x1002, 0x9553, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon 4500 Series"}, \ {0x1002, 0x9555, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon 4500 Series"}, \ + {0x1002, 0x9557, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI FirePro RG220"}, \ {0, 0, 0, NULL} #define r128_PCI_IDS \ From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 12:57:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D992106564A; Wed, 12 Aug 2009 12:57:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4518FC4E; Wed, 12 Aug 2009 12:57:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CCv3a4065150; Wed, 12 Aug 2009 12:57:03 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CCv37U065146; Wed, 12 Aug 2009 12:57:03 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200908121257.n7CCv37U065146@svn.freebsd.org> From: Robert Noland Date: Wed, 12 Aug 2009 12:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196142 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 12:57:03 -0000 Author: rnoland Date: Wed Aug 12 12:57:02 2009 New Revision: 196142 URL: http://svn.freebsd.org/changeset/base/196142 Log: Add support for radeon RS880 IGP chips to drm. Approved by: re (kib) MFC after: 0 days Modified: head/sys/dev/drm/drm_pciids.h head/sys/dev/drm/r600_cp.c head/sys/dev/drm/radeon_drv.h Modified: head/sys/dev/drm/drm_pciids.h ============================================================================== --- head/sys/dev/drm/drm_pciids.h Wed Aug 12 12:50:15 2009 (r196141) +++ head/sys/dev/drm/drm_pciids.h Wed Aug 12 12:57:02 2009 (r196142) @@ -330,6 +330,11 @@ {0x1002, 0x9614, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3300 Graphics"}, \ {0x1002, 0x9615, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3200 Graphics"}, \ {0x1002, 0x9616, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3000 Graphics"}, \ + {0x1002, 0x9710, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon HD 4200"}, \ + {0x1002, 0x9711, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 4100"}, \ + {0x1002, 0x9712, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Mobility Radeon HD 4200"}, \ + {0x1002, 0x9713, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Mobility Radeon 4100"}, \ + {0x1002, 0x9714, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI RS880"}, \ {0x1002, 0x9440, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ {0x1002, 0x9441, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4870 X2"}, \ {0x1002, 0x9442, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ Modified: head/sys/dev/drm/r600_cp.c ============================================================================== --- head/sys/dev/drm/r600_cp.c Wed Aug 12 12:50:15 2009 (r196141) +++ head/sys/dev/drm/r600_cp.c Wed Aug 12 12:57:02 2009 (r196142) @@ -318,7 +318,8 @@ static void r600_cp_load_microcode(drm_r pfp = RV670_pfp_microcode; break; case CHIP_RS780: - DRM_INFO("Loading RS780 Microcode\n"); + case CHIP_RS880: + DRM_INFO("Loading RS780/RS880 Microcode\n"); cp = RS780_cp_microcode; pfp = RS780_pfp_microcode; break; @@ -722,6 +723,7 @@ static void r600_gfx_init(struct drm_dev break; case CHIP_RV610: case CHIP_RS780: + case CHIP_RS880: case CHIP_RV620: dev_priv->r600_max_pipes = 1; dev_priv->r600_max_tile_pipes = 1; @@ -856,7 +858,8 @@ static void r600_gfx_init(struct drm_dev ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV630) || ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) || + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) RADEON_WRITE(R600_DB_DEBUG, R600_PREZ_MUST_WAIT_FOR_POSTZ_DONE); else RADEON_WRITE(R600_DB_DEBUG, 0); @@ -874,7 +877,8 @@ static void r600_gfx_init(struct drm_dev sq_ms_fifo_sizes = RADEON_READ(R600_SQ_MS_FIFO_SIZES); if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) || + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) { sq_ms_fifo_sizes = (R600_CACHE_FIFO_SIZE(0xa) | R600_FETCH_FIFO_HIWATER(0xa) | R600_DONE_FIFO_HIWATER(0xe0) | @@ -917,7 +921,8 @@ static void r600_gfx_init(struct drm_dev R600_NUM_ES_STACK_ENTRIES(0)); } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) || + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) { /* no vertex cache */ sq_config &= ~R600_VC_ENABLE; @@ -974,7 +979,8 @@ static void r600_gfx_init(struct drm_dev if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) || + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) RADEON_WRITE(R600_VGT_CACHE_INVALIDATION, R600_CACHE_INVALIDATION(R600_TC_ONLY)); else RADEON_WRITE(R600_VGT_CACHE_INVALIDATION, R600_CACHE_INVALIDATION(R600_VC_AND_TC)); @@ -1017,6 +1023,7 @@ static void r600_gfx_init(struct drm_dev break; case CHIP_RV610: case CHIP_RS780: + case CHIP_RS880: case CHIP_RV620: gs_prim_buffer_depth = 32; break; @@ -1062,6 +1069,7 @@ static void r600_gfx_init(struct drm_dev switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_RV610: case CHIP_RS780: + case CHIP_RS880: case CHIP_RV620: tc_cntl = R600_TC_L2_SIZE(8); break; Modified: head/sys/dev/drm/radeon_drv.h ============================================================================== --- head/sys/dev/drm/radeon_drv.h Wed Aug 12 12:50:15 2009 (r196141) +++ head/sys/dev/drm/radeon_drv.h Wed Aug 12 12:57:02 2009 (r196142) @@ -145,6 +145,7 @@ enum radeon_family { CHIP_RV635, CHIP_RV670, CHIP_RS780, + CHIP_RS880, CHIP_RV770, CHIP_RV740, CHIP_RV730, From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 14:37:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D714106564A; Wed, 12 Aug 2009 14:37:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7878FC48; Wed, 12 Aug 2009 14:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CEbwN3067714; Wed, 12 Aug 2009 14:37:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CEbwMK067711; Wed, 12 Aug 2009 14:37:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908121437.n7CEbwMK067711@svn.freebsd.org> From: John Baldwin Date: Wed, 12 Aug 2009 14:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196147 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 14:37:58 -0000 Author: jhb Date: Wed Aug 12 14:37:57 2009 New Revision: 196147 URL: http://svn.freebsd.org/changeset/base/196147 Log: Fix references to the kernel distributions to use the correct names (uppercase). PR: docs/137415 Submitted by: Yuri Gorchakov Approved by: re (rwatson, kib) MFC after: 3 days Modified: head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/sysinstall.8 Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Wed Aug 12 13:20:42 2009 (r196146) +++ head/usr.sbin/sysinstall/install.c Wed Aug 12 14:37:57 2009 (r196147) @@ -939,7 +939,7 @@ installFixupKernel(dialogMenuItem *self, if (RunningAsInit) { /* * Install something as /boot/kernel. Prefer SMP - * over generic--this should handle the case where + * over GENERIC--this should handle the case where * both SMP and GENERIC are installed (otherwise we * select the one kernel that was installed). * Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Wed Aug 12 13:20:42 2009 (r196146) +++ head/usr.sbin/sysinstall/sysinstall.8 Wed Aug 12 14:37:57 2009 (r196147) @@ -411,9 +411,9 @@ Possible distribution values are: .Bl -tag -width indentxx .It Li base The base binary distribution. -.It Li generic +.It Li GENERIC The GENERIC kernel. -.It Li smp +.It Li SMP A kernel suitable for multiple processor systems. .It Li doc Miscellaneous documentation From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 16:27:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6B11065673; Wed, 12 Aug 2009 16:27:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79E808FC1F; Wed, 12 Aug 2009 16:27:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CGRpA2070194; Wed, 12 Aug 2009 16:27:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CGRpam070192; Wed, 12 Aug 2009 16:27:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200908121627.n7CGRpam070192@svn.freebsd.org> From: Rick Macklem Date: Wed, 12 Aug 2009 16:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196149 - head/sys/xdr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 16:27:52 -0000 Author: rmacklem Date: Wed Aug 12 16:27:51 2009 New Revision: 196149 URL: http://svn.freebsd.org/changeset/base/196149 Log: Add a check for a NULL mbuf ptr at the beginning of xdrmbuf_inline() so that it returns failure instead of crashing when "m->m_len" is executed and m == NULL. The mbuf ptr can be NULL when a call to xdrmbuf_getbytes() gets the bytes it needs, but they are at the end of a short RPC reply. When this happens, xdrmbuf_getbytes() returns success, but advances the mbuf ptr (xdrs->x_private) to m_next, which is NULL. If this is followed by a call to xdrmbuf_getlong(), it calls xdrmbuf_inline(), which would cause a crash by accessing "m->m_len". Tested by: pho, serenity at exscape dot org Approved by: re (rwatson), kib (mentor) Modified: head/sys/xdr/xdr_mbuf.c Modified: head/sys/xdr/xdr_mbuf.c ============================================================================== --- head/sys/xdr/xdr_mbuf.c Wed Aug 12 14:40:21 2009 (r196148) +++ head/sys/xdr/xdr_mbuf.c Wed Aug 12 16:27:51 2009 (r196149) @@ -282,6 +282,8 @@ xdrmbuf_inline(XDR *xdrs, u_int len) size_t available; char *p; + if (!m) + return (0); if (xdrs->x_op == XDR_ENCODE) { available = M_TRAILINGSPACE(m) + (m->m_len - xdrs->x_handy); } else { From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 17:28:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA4CA1065693; Wed, 12 Aug 2009 17:28:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8BD88FC58; Wed, 12 Aug 2009 17:28:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CHSrTm071528; Wed, 12 Aug 2009 17:28:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CHSrxF071523; Wed, 12 Aug 2009 17:28:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200908121728.n7CHSrxF071523@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 12 Aug 2009 17:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196150 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 17:28:54 -0000 Author: jkim Date: Wed Aug 12 17:28:53 2009 New Revision: 196150 URL: http://svn.freebsd.org/changeset/base/196150 Log: Always embed pointer to BPF JIT function in BPF descriptor to avoid inconsistency when opt_bpf.h is not included. Reviewed by: rwatson Approved by: re (rwatson) Modified: head/sys/net/bpf.c head/sys/net/bpf_buffer.c head/sys/net/bpf_zerocopy.c head/sys/net/bpfdesc.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Aug 12 16:27:51 2009 (r196149) +++ head/sys/net/bpf.c Wed Aug 12 17:28:53 2009 (r196150) @@ -1585,6 +1585,9 @@ void bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) { struct bpf_d *d; +#ifdef BPF_JITTER + bpf_jit_filter *bf; +#endif u_int slen; int gottime; struct timeval tv; @@ -1601,8 +1604,9 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, * the interface pointers on the mbuf to figure it out. */ #ifdef BPF_JITTER - if (bpf_jitter_enable != 0 && d->bd_bfilter != NULL) - slen = (*(d->bd_bfilter->func))(pkt, pktlen, pktlen); + bf = bpf_jitter_enable != 0 ? d->bd_bfilter : NULL; + if (bf != NULL) + slen = (*(bf->func))(pkt, pktlen, pktlen); else #endif slen = bpf_filter(d->bd_rfilter, pkt, pktlen, pktlen); @@ -1634,6 +1638,9 @@ void bpf_mtap(struct bpf_if *bp, struct mbuf *m) { struct bpf_d *d; +#ifdef BPF_JITTER + bpf_jit_filter *bf; +#endif u_int pktlen, slen; int gottime; struct timeval tv; @@ -1655,11 +1662,10 @@ bpf_mtap(struct bpf_if *bp, struct mbuf BPFD_LOCK(d); ++d->bd_rcount; #ifdef BPF_JITTER + bf = bpf_jitter_enable != 0 ? d->bd_bfilter : NULL; /* XXX We cannot handle multiple mbufs. */ - if (bpf_jitter_enable != 0 && d->bd_bfilter != NULL && - m->m_next == NULL) - slen = (*(d->bd_bfilter->func))(mtod(m, u_char *), - pktlen, pktlen); + if (bf != NULL && m->m_next == NULL) + slen = (*(bf->func))(mtod(m, u_char *), pktlen, pktlen); else #endif slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0); Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Wed Aug 12 16:27:51 2009 (r196149) +++ head/sys/net/bpf_buffer.c Wed Aug 12 17:28:53 2009 (r196150) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Wed Aug 12 16:27:51 2009 (r196149) +++ head/sys/net/bpf_zerocopy.c Wed Aug 12 17:28:53 2009 (r196150) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Wed Aug 12 16:27:51 2009 (r196149) +++ head/sys/net/bpfdesc.h Wed Aug 12 17:28:53 2009 (r196150) @@ -72,9 +72,7 @@ struct bpf_d { u_long bd_rtout; /* Read timeout in 'ticks' */ struct bpf_insn *bd_rfilter; /* read filter code */ struct bpf_insn *bd_wfilter; /* write filter code */ -#ifdef BPF_JITTER - bpf_jit_filter *bd_bfilter; /* binary filter code */ -#endif + void *bd_bfilter; /* binary filter code */ u_int64_t bd_rcount; /* number of packets received */ u_int64_t bd_dcount; /* number of packets dropped */ From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 19:15:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC536106566B; Wed, 12 Aug 2009 19:15:27 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B57F8FC16; Wed, 12 Aug 2009 19:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CJFRsV073947; Wed, 12 Aug 2009 19:15:27 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CJFRRu073946; Wed, 12 Aug 2009 19:15:27 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200908121915.n7CJFRRu073946@svn.freebsd.org> From: Qing Li Date: Wed, 12 Aug 2009 19:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196152 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 19:15:28 -0000 Author: qingli Date: Wed Aug 12 19:15:26 2009 New Revision: 196152 URL: http://svn.freebsd.org/changeset/base/196152 Log: A piece of code was added to install a host route when an IPv6 interface address is configured with a /128 prefix. This is no longer necessary due to r192011. In fact that code conflicts with r192011. This patch removes the host route installation when detecting the /128 prefix, and instead let the code added by r192011 to install the loopback route for that IPv6 interface address. Reviewed by: bz Approved by: re Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Aug 12 17:45:55 2009 (r196151) +++ head/sys/netinet6/in6.c Wed Aug 12 19:15:26 2009 (r196152) @@ -1750,21 +1750,12 @@ in6_ifinit(struct ifnet *ifp, struct in6 * interface that share the same destination. */ plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ - if (!(ia->ia_flags & IFA_ROUTE) && plen == 128) { - struct sockaddr *dstaddr; + if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 && + ia->ia_dstaddr.sin6_family == AF_INET6) { int rtflags = RTF_UP | RTF_HOST; - /* - * use the interface address if configuring an - * interface address with a /128 prefix len - */ - if (ia->ia_dstaddr.sin6_family == AF_INET6) - dstaddr = (struct sockaddr *)&ia->ia_dstaddr; - else - dstaddr = (struct sockaddr *)&ia->ia_addr; - error = rtrequest(RTM_ADD, - (struct sockaddr *)dstaddr, + (struct sockaddr *)&ia->ia_dstaddr, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&ia->ia_prefixmask, ia->ia_flags | rtflags, NULL); From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 19:48:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C98106566B; Wed, 12 Aug 2009 19:48:26 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 51B158FC44; Wed, 12 Aug 2009 19:48:26 +0000 (UTC) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id 63B9C8FC2E; Wed, 12 Aug 2009 23:48:24 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 10CE139C4F; Wed, 12 Aug 2009 23:49:45 +0400 (MSD) Date: Wed, 12 Aug 2009 23:49:35 +0400 From: Stanislav Sedov To: Tom Judge Message-Id: <20090812234935.84e5ac74.stas@FreeBSD.org> In-Reply-To: <4A7AFFC4.5050607@tomjudge.com> References: <200902271925.n1RJP699080658@svn.freebsd.org> <20090721145559.d2cf3f0b.stas@FreeBSD.org> <4A7AFFC4.5050607@tomjudge.com> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Wed__12_Aug_2009_23_49_35_+0400_GA3.EGZtxjQkv.WZ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Christensen Subject: Re: svn commit: r189117 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 19:48:27 -0000 --Signature=_Wed__12_Aug_2009_23_49_35_+0400_GA3.EGZtxjQkv.WZ Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 06 Aug 2009 11:07:32 -0500 Tom Judge mentioned: >=20 > I can confirm that we are also seeing this problem on a number of Dell=20 > PE2950 systems running the bce driver from 7.2, the bug is more=20 > visible/producible on systems that are using Jumbo Frames (in our case 8K= b). >=20 > The symptoms of this are an increase in the requests for jumbo clusters=20 > denied counter at 9k, and then random network stalls which sometimes=20 > recover on there own and others require a reboot. >=20 > We have backed this change and so far it seems to have fixed the issue. >=20 David, are you OK with reverting this patch? I submitted the patch to re@ for review, and I can commit it if you don't mind doing so. :-) --=20 Stanislav Sedov ST4096-RIPE --Signature=_Wed__12_Aug_2009_23_49_35_+0400_GA3.EGZtxjQkv.WZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKgxzYAAoJEKN82nOYvCd0PLAP/06x59NY+t+tHTRaAmn1xkbY uzWkHet1lPy/2cfDOqZ6Z8H+nHKG138vvn9gdxxrgtp3UOdlWG/A7Sac7CmA5Vh8 3fg7oJpmwvjqnvMIT6Dhaba9JV18s8u7a7Re5nYDJ/ddjL4i+DVx/20g0BIu0rax DBx3qnFILOa+sNcALdD0nfwe+J13HPPC3wAj5+eHDedvDHkQjpS/ocZViReLbCHP ve8lRwL8HwVYNBaw45LMb+/yVEyZ6I+j1LGlhyIHZ83fMWJTs5Faj2vo0oJqXQhd qCJAs6CvvybcVB2c7rt1efsDcvnSVB40bxs/AOa3QSqTojTnXWfSqSLS+kYkeW+0 DRlo1LIiV2jeXnvnjYAg38nfCYsmzv45fby4XVoxFcFLSAa8MOqJ7Hmzt+3/ckuP 17C4AhqykmqvjuOcvnJRE4TVTC/G/6j4FX9pBckRwtzZy+c7s3fu26b9cJn91Y9o Z/+6N1DiYmw/JJ3GiWvgzncStz/DJSxL+cHp2mJwhvzF0kqLisNDI7sXAZTAFtYl +6y7OZxGw7MnmyMGBpbzlenmM/wS4sQy3sQk5f0kfOX1D1niulSXdb42Kv2+LybC tjWS2RxpAwBB8zVUdC8TKBJ+vSZv/K17ovy3MU6VdWCdcYktkNGrVALwzVHG94YP u59dwwnrOhW+sNzKv3BP =/FQ9 -----END PGP SIGNATURE----- --Signature=_Wed__12_Aug_2009_23_49_35_+0400_GA3.EGZtxjQkv.WZ-- From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 21:03:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D9D1065784; Wed, 12 Aug 2009 21:03:17 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD5538FC48; Wed, 12 Aug 2009 21:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CL3HEh076550; Wed, 12 Aug 2009 21:03:17 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CL3Hpw076548; Wed, 12 Aug 2009 21:03:17 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200908122103.n7CL3Hpw076548@svn.freebsd.org> From: Sam Leffler Date: Wed, 12 Aug 2009 21:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196155 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 21:03:21 -0000 Author: sam Date: Wed Aug 12 21:03:16 2009 New Revision: 196155 URL: http://svn.freebsd.org/changeset/base/196155 Log: First (early) draft of net80211 documentation. Note this is focused on driver writers (as opposed to folks adding to net80211). Reviewed by: wkoszek Approved by: re (rwatson) Added: head/share/man/man9/ieee80211_amrr.9 (contents, props changed) head/share/man/man9/ieee80211_beacon.9 (contents, props changed) head/share/man/man9/ieee80211_bmiss.9 (contents, props changed) head/share/man/man9/ieee80211_ddb.9 (contents, props changed) head/share/man/man9/ieee80211_regdomain.9 (contents, props changed) head/share/man/man9/ieee80211_scan.9 (contents, props changed) head/share/man/man9/ieee80211_vap.9 (contents, props changed) Deleted: head/share/man/man9/ieee80211_ioctl.9 Modified: head/share/man/man9/Makefile head/share/man/man9/ieee80211.9 head/share/man/man9/ieee80211_crypto.9 head/share/man/man9/ieee80211_input.9 head/share/man/man9/ieee80211_node.9 head/share/man/man9/ieee80211_output.9 head/share/man/man9/ieee80211_proto.9 head/share/man/man9/ieee80211_radiotap.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Aug 12 20:48:50 2009 (r196154) +++ head/share/man/man9/Makefile Wed Aug 12 21:03:16 2009 (r196155) @@ -121,13 +121,19 @@ MAN= accept_filter.9 \ hashinit.9 \ hexdump.9 \ ieee80211.9 \ + ieee80211_amrr.9 \ + ieee80211_beacon.9 \ + ieee80211_bmiss.9 \ ieee80211_crypto.9 \ + ieee80211_ddb.9 \ ieee80211_input.9 \ - ieee80211_ioctl.9 \ ieee80211_node.9 \ ieee80211_output.9 \ ieee80211_proto.9 \ ieee80211_radiotap.9 \ + ieee80211_regdomain.9 \ + ieee80211_scan.9 \ + ieee80211_vap.9 \ ifnet.9 \ inittodr.9 \ insmntque.9 \ @@ -627,52 +633,62 @@ MLINKS+=hash.9 hash32.9 \ MLINKS+=hashinit.9 hashdestroy.9 \ hashinit.9 hashinit_flags.9 \ hashinit.9 phashinit.9 -MLINKS+=ieee80211.9 ieee80211_attach.9 \ - ieee80211.9 ieee80211_chan2ieee.9 \ - ieee80211.9 ieee80211_chan2mode.9 \ - ieee80211.9 ieee80211_ieee2mhz.9 \ - ieee80211.9 ieee80211_ifattach.9 \ - ieee80211.9 ieee80211_ifdetach.9 \ - ieee80211.9 ieee80211_media2rate.9 \ - ieee80211.9 ieee80211_media_change.9 \ - ieee80211.9 ieee80211_media_init.9 \ - ieee80211.9 ieee80211_media_status.9 \ - ieee80211.9 ieee80211_mhz2ieee.9 \ - ieee80211.9 ieee80211_rate2media.9 \ - ieee80211.9 ieee80211_setmode.9 \ - ieee80211.9 ieee80211_watchdog.9 -MLINKS+=ieee80211_crypto.9 ieee80211_crypto_attach.9 \ - ieee80211_crypto.9 ieee80211_crypto_detach.9 \ - ieee80211_crypto.9 ieee80211_wep_crypt.9 -MLINKS+=ieee80211_input.9 ieee80211_decap.9 \ - ieee80211_input.9 ieee80211_recv_mgmt.9 -MLINKS+=ieee80211_ioctl.9 ieee80211_cfgget.9 \ - ieee80211_ioctl.9 ieee80211_cfgset.9 -MLINKS+=ieee80211_node.9 ieee80211_alloc_node.9 \ - ieee80211_node.9 ieee80211_begin_scan.9 \ - ieee80211_node.9 ieee80211_create_ibss.9 \ - ieee80211_node.9 ieee80211_dup_bss.9 \ - ieee80211_node.9 ieee80211_end_scan.9 \ - ieee80211_node.9 ieee80211_find_node.9 \ - ieee80211_node.9 ieee80211_free_allnodes.9 \ +MLINKS+=ieee80211.9 ieee80211_ifattach.9 \ + ieee80211.9 ieee80211_ifdetach.9 +MLINKS+=ieee80211_amrr.9 ieee80211_amrr_init.9 \ + ieee80211_amrr.9 ieee80211_amrr_cleanup.9 \ + ieee80211_amrr.9 ieee80211_amrr_setinterval.9 \ + ieee80211_amrr.9 ieee80211_amrr_node_init.9 \ + ieee80211_amrr.9 ieee80211_amrr_tx_complete.9 \ + ieee80211_amrr.9 ieee80211_amrr_tx_update.9 +MLINKS+=ieee80211_beacon.9 ieee80211_beacon_alloc.9 \ + ieee80211_beacon.9 ieee80211_beacon_update.9 \ + ieee80211_beacon.9 ieee80211_beacon_notify.9 +MLINKS+=ieee80211_bmiss.9 ieee80211_beacon_miss.9 +MLINKS+=ieee80211_crypto.9 ieee80211_key_update_begin.9 \ + ieee80211_crypto.9 ieee80211_key_update_end.9 \ + ieee80211_crypto.9 ieee80211_crypto_newkey.9 \ + ieee80211_crypto.9 ieee80211_crypto_setkey.9 \ + ieee80211_crypto.9 ieee80211_crypto_delglobalkeys.9 \ + ieee80211_crypto.9 ieee80211_crypto_reload_keys.9 \ + ieee80211_crypto.9 ieee80211_crypto_decap.9 \ + ieee80211_crypto.9 ieee80211_crypto_encap.9 \ + ieee80211_crypto.9 ieee80211_crypto_demic.9 \ + ieee80211_crypto.9 ieee80211_crypto_enmic.9 \ + ieee80211_crypto.9 ieee80211_notify_michael_failure.9 \ + ieee80211_crypto.9 ieee80211_notify_replay_failure.9 \ + ieee80211_crypto.9 ieee80211_crypto_register.9 \ + ieee80211_crypto.9 ieee80211_crypto_unregister.9 \ + ieee80211_crypto.9 ieee80211_crypto_available.9 +MLINKS+=ieee80211_input.9 ieee80211_input_all.9 +MLINKS+=ieee80211_node.9 ieee80211_find_rxnode.9 \ + ieee80211_node.9 ieee80211_find_rxnode_withkey.9 \ + ieee80211_node.9 ieee80211_ref_node.9 \ + ieee80211_node.9 ieee80211_unref_node.9 \ ieee80211_node.9 ieee80211_free_node.9 \ ieee80211_node.9 ieee80211_iterate_nodes.9 \ - ieee80211_node.9 ieee80211_lookup_node.9 \ - ieee80211_node.9 ieee80211_next_scan.9 \ - ieee80211_node.9 ieee80211_node_attach.9 \ - ieee80211_node.9 ieee80211_node_detach.9 \ - ieee80211_node.9 ieee80211_node_lateattach.9 \ - ieee80211_node.9 ieee80211_timeout_nodes.9 -MLINKS+=ieee80211_output.9 ieee80211_add_rates.9 \ - ieee80211_output.9 ieee80211_add_xrates.9 \ - ieee80211_output.9 ieee80211_encap.9 \ - ieee80211_output.9 ieee80211_send_mgmt.9 -MLINKS+=ieee80211_proto.9 ieee80211_dump_pkt.9 \ - ieee80211_proto.9 ieee80211_fix_rate.9 \ - ieee80211_proto.9 ieee80211_print_essid.9 \ - ieee80211_proto.9 ieee80211_proto_attach.9 \ - ieee80211_proto.9 ieee80211_proto_detach.9 -MLINKS+=ieee80211_radiotap.9 radiotap.9 + ieee80211_node.9 ieee80211_dump_node.9 \ + ieee80211_node.9 ieee80211_dump_nodes.9 +MLINKS+=ieee80211_output.9 M_WME_GETAC.9 \ + ieee80211_output.9 M_SEQNO_GET.9 \ + ieee80211_output.9 ieee80211_process_callback.9 +MLINKS+=ieee80211_proto.9 ieee80211_new_state.9 \ + ieee80211_proto.9 ieee80211_start_all.9 \ + ieee80211_proto.9 ieee80211_stop_all.9 \ + ieee80211_proto.9 ieee80211_suspend_all.9 \ + ieee80211_proto.9 ieee80211_resume_all.9 \ + ieee80211_proto.9 ieee80211_waitfor_parent.9 +MLINKS+=ieee80211_radiotap.9 radiotap.9 \ + ieee80211_radiotap.9 ieee80211_radiotap_attach.9 \ + ieee80211_radiotap.9 ieee80211_radiotap_active_vap.9 \ + ieee80211_radiotap.9 ieee80211_radiotap_active.9 \ + ieee80211_radiotap.9 ieee80211_radiotap_tx.9 +MLINKS+=ieee80211_regdomain.9 ieee80211_init_channels.9 \ + ieee80211_regdomain.9 ieee80211_sort_channels.9 \ + ieee80211_regdomain.9 ieee80211_alloc_countryie.9 +MLINKS+=ieee80211_vap.9 ieee80211_vap_setup.9 \ + ieee80211_vap.9 ieee80211_vap_attach.9 \ + ieee80211_vap.9 ieee80211_vap_detach.9 MLINKS+=ifnet.9 ifaddr.9 \ ifnet.9 if_data.9 \ ifnet.9 ifqueue.9 Modified: head/share/man/man9/ieee80211.9 ============================================================================== --- head/share/man/man9/ieee80211.9 Wed Aug 12 20:48:50 2009 (r196154) +++ head/share/man/man9/ieee80211.9 Wed Aug 12 21:03:16 2009 (r196155) @@ -1,6 +1,5 @@ .\" -.\" Copyright (c) 2004 Bruce M. Simpson -.\" Copyright (c) 2004 Darron Broad +.\" Copyright (c) 2009 Sam Leffler, Errno Consulting .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,236 +24,538 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.\" $Id: ieee80211.9,v 1.5 2004/03/04 12:33:27 bruce Exp $ .\" -.Dd March 2, 2004 -.Dt IEEE80211 9 +.Dd August 4, 2009 +.Dt NET80211 9 .Os .Sh NAME -.Nm ieee80211_ifattach , ieee80211_ifdetach , -.Nm ieee80211_mhz2ieee , ieee80211_chan2ieee , ieee80211_ieee2mhz , -.Nm ieee80211_media_init , ieee80211_media_change , ieee80211_media_status , -.Nm ieee80211_watchdog , -.Nm ieee80211_setmode , ieee80211_chan2mode , -.Nm ieee80211_rate2media , ieee80211_media2rate -.Nd core 802.11 network stack functions +.Nm net80211 +.Nd 802.11 network layer .Sh SYNOPSIS .In net80211/ieee80211_var.h -.In net80211/ieee80211_proto.h .Ft void -.Fn ieee80211_ifattach "struct ifnet *ifp" +.Fn ieee80211_ifattach "struct ieee80211com *ic" "const uint8_t macaddr[IEEE80211_ADDR_LEN]" .Ft void -.Fn ieee80211_ifdetach "struct ifnet *ifp" -.Ft u_int -.Fn ieee80211_mhz2ieee "u_int freq" "u_int flags" -.Ft u_int -.Fn ieee80211_chan2ieee "struct ieee80211com *ic" "struct ieee80211_channel *c" -.Ft u_int -.Fn ieee80211_ieee2mhz "u_int chan" "u_int flags" -.Ft void -.Fo ieee80211_media_init -.Fa "struct ifnet *ifp" "ifm_change_cb_t media_change" -.Fa "ifm_stat_cb_t media_stat" -.Fc -.Fa int -.Fn ieee80211_media_change "struct ifnet *ifp" -.Fa void -.Fn ieee80211_media_status "struct ifnet *ifp" "struct ifmediareq *imr" -.Ft void -.Fn ieee80211_watchdog "struct ifnet *ifp" -.Ft int -.Fn ieee80211_setmode "struct ieee80211com *ic" "enum ieee80211_phymode mode" -.Ft enum ieee80211_phymode -.Fo ieee80211_chan2mode -.Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan" -.Fc -.Ft int -.Fo ieee80211_rate2media -.Fa "struct ieee80211com *ic" "int rate" "enum ieee80211_phymode mode" -.Fc -.Ft int -.Fn ieee80211_media2rate "int mword" +.Fn ieee80211_ifdetach "struct ieee80211com *ic" .Sh DESCRIPTION -The -.Nm ieee80211 -collection of functions are used to manage wireless network interfaces in the -system which use the system's software 802.11 network stack. -Most of these functions require that attachment to the stack is performed -before calling. -Several utility functions are also provided; these are safe to call from -any driver without prior initialization. +IEEE 802.11 device drivers are written to use the infrastructure provided +by the +.Nm +software layer. +This software provides a support framework for drivers that includes +ifnet cloning, state management, and a user management API by which +applications interact with 802.11 devices. +Most drivers depend on the +.Nm +layer for protocol services but devices that off-load functionality +may bypass the layer to connect directly to the device +(e.g. the +.Xr ndis 4 +emulation support does this). +.Pp +A +.Nm +device driver implements a virtual radio API that is exported to +users through network interfaces (aka vaps) that are cloned from the +underlying device. +These interfaces have an operating mode +(station, adhoc, hostap, wds, monitor, etc.) +that is fixed for the lifetime of the interface. +Devices that can support multiple concurrent interfaces allow +multiple vaps to be cloned. +This enables construction of interesting applications such as +an AP vap and one or more WDS vaps +or multiple AP vaps, each with a different security model. +The +.Nm +layer virtualizes most 802.11 state +and coordinates vap state changes including scheduling multiple vaps. +State that is not virtualized includes the current channel and +WME/WMM parameters. +Protocol processing is typically handled entirely in the +.Nm +layer with drivers responsible purely for moving data between the host +and device. +Similarly, +.Nm +handles most +.Xr ioctl 2 +requests without entering the driver; +instead drivers are notified of state changes that +require their involvement. +.Pp +The virtual radio interface defined by the +.Nm +layer means that drivers must be structured to follow specific rules. +Drivers that support only a single interface at any time must still +follow these rules. +.Sh DATA STRUCTURES +The virtual radio architecture splits state between a single per-device +.Vt ieee80211com +structure and one or more +.Vt ieee80211vap +structures. +Drivers are expected to setup various shared state in these structures +at device attach and during vap creation but otherwise should treat them +as read-only. +The +.Vt ieee80211com +structure is allocated by the +.Nm +layer as adjunct data to a device's +.Vt ifnet ; +it is accessed through the +.Vt if_l2com +structure member. +The +.Vt ieee80211vap +structure is allocated by the driver in the +.Dq vap create +method +and should be extended with any driver-private state. +This technique of giving the driver control to allocate data structures +is used for other +.Nm +data structures and should be exploited to maintain driver-private state +together with public +.Nm +state. +.Pp +The other main data structures are the station, or node, table +that tracks peers in the local BSS, and the channel table that defines +the current set of available radio channels. +Both tables are bound to the +.Vt ieee80211com +structure and shared by all vaps. +Long-lasting references to a node are counted to guard against +premature reclamation. +In particular every packet sent/received holds a node reference +(either explicitly for transmit or implicitly on receive). .Pp -.\" -The -.Fn ieee80211_ifattach -function attaches the network interface -.Fa ifp -to the 802.11 network stack layer. -This function must be called before using any of the -.Nm ieee80211 -functions which need to store driver state across invocations; The -.Vt struct ifnet -instance pointed to by -.Fa ifp -MUST be an instance of -.Vt struct ieee80211com , -with various fields initialized to tell -.Nm ieee80211 -about its capabilities. -This function performs Ethernet and BPF attachment (by calling -.Fn ether_ifattach +.Vt ieee80211com and -.Fn bpfattach2 ) -on behalf of the caller. -It also implements the -.Vt ifmedia -interface. +.Vt ieee80211vap +structures also hold a collection of method pointers that drivers +fill-in and/or override to take control of certain operations. +These methods are the primary way drivers are bound to the +.Nm +layer and are described below. +.Sh DRIVER ATTACH/DETACH +Drivers attach to the +.Nm +layer with the +.Fn ieee80211_ifattach +function. +The driver is expected to allocate and setup any device-private +data structures before passing control. +The +.Vt ieee80211com +structure must be pre-initialized with state required to setup the +.Nm +layer: +.Bl -tag -width ic_channels +.It Dv ic_ifp +Backpointer to the physical device's ifnet. +.It Dv ic_caps +Device/driver capabilities; see below for a complete description. +.It Dv ic_channels +Table of channels the device is capable of operating on. +This is initially provided by the driver but may be changed +through calls that change the regulatory state. +.It Dv ic_nchan +Number of entries in +.Dv ic_channels . +.El .Pp -.\" -The +On return from +.Fn ieee80211_ifattach +the driver is expected to override default callback functions in the +.Vt ieee80211com +structure to register it's private routines. +Methods marked with a +.Dq * +must be provided by the driver. +.Bl -tag -width ic_channels +.It Dv ic_vap_create* +Create a vap instance of the specified type (operating mode). +Any fixed BSSID and/or MAC address is provided. +Drivers that support multi-bssid operation may honor the requested BSSID +or assign their own. +.It Dv ic_vap_delete* +Destroy a vap instance created with +.Dv ic_vap_create . +.It Dv ic_getradiocaps +Return the list of calibrated channels for the radio. +The default method returns the current list of channels +(space permitting). +.It Dv ic_setregdomain +Process a request to change regulatory state. +The routine may reject a request or constrain changes (e.g. reduce +transmit power caps). +The default method accepts all proposed changes. +.It Dv ic_send_mgmt +Send an 802.11 management frame. +The default method fabricates the frame using +.Nm +state and passes it to the driver through the +.Dv ic_raw_xmit +method. +.It Dv ic_raw_xmit +Transmit a raw 802.11 frame. +The default method drops the frame and generates a message on the console. +.It Dv ic_updateslot +Update hardware state after an 802.11 IFS slot time change, +There is no default method; the pointer may be NULL in which case +it will not be used. +.It Dv ic_update_mcast +Update hardware for a change in the multicast packet filter, +The default method prints a console message. +.It Dv ic_update_promisc +Update hardware for a change in the promiscuous mode setting. +The default method prints a console message. +.It Dv ic_newassoc +Update driver/device state for association to a new AP (in station mode) +or when a new station associates (e.g. in AP mode). +There is no default method; the pointer may be NULL in which case +it will not be used. +.It Dv ic_node_alloc +Allocate and initialize a +.Vt ieee80211_node +structure. +This method cannot sleep. +The default method allocates zero'd memory using +.Xr malloc 9. +Drivers should override this method to allocate extended storage +for their own needs. +Memory allocated by the driver must be tagged with +.Dv M_80211_NODE +to balance the memory allocation statistics. +.It Dv ic_node_free +Reclaim storage of a node allocated by +.Dv ic_node_alloc . +Drivers are expected to +.Em interpose +their own method to cleanup private state but must call through +this method to allow +.Nm +to reclaim it's private state. +.It Dv ic_node_cleanup +Cleanup state in a +.Vt ieee80211_node +created by +.Dv ic_node_alloc . +This operation is distinguished from +.Dv ic_node_free +in that it may be called long before the node is actually reclaimed +to cleanup adjunct state. +This can happen, for example, when a node must not be reclaimed +due to references held by packets in the transmit queue. +Drivers typically interpose +.Dv ic_node_cleanup +instead of +.Dv ic_node_free . +.It Dv ic_node_age +Age, and potentially reclaim, resources associated with a node. +The default method ages frames on the power-save queue (in AP mode) +and pending frames in the receive reorder queues (for stations using A-MPDU). +.It Dv ic_node_drain +Reclaim all optional resources associated with a node. +This call is used to free up resources when they are in short supply, +.It Dv ic_node_getrssi +Return the Receive Signal Strength Indication (RSSI) in .5 dBm units for +the specified node. +This interface returns a subset of the information +returned by +.Dv ic_node_getsignal , +The default method calculates a filtered average over the last ten +samples passed in to +.Xr ieee80211_input 9 +or +.Xr ieee80211_input_all 9 . +.It Dv ic_node_getsignal +Return the RSSI and noise floor (in .5 dBm units) for a station. +The default method calculates RSSI as described above; +the noise floor returned is the last value supplied to +.Xr ieee80211_input 9 +or +.Xr ieee80211_input_all 9 . +.It Dv ic_node_getmimoinfo +Return MIMO radio state for a station in support of the +.Dv IEEE80211_IOC_STA_INFO +ioctl request. +The default method returns nothing. +.It Dv ic_scan_start* +Prepare driver/hardware state for scanning. +This callback is done in a sleepable context. +.It Dv ic_scan_end* +Restore driver/hardware state after scanning completes. +This callback is done in a sleepable context. +.It Dv ic_set_channel* +Set the current radio channel using +.Vt ic_curchan . +This callback is done in a sleepable context. +.It Dv ic_scan_curchan +Start scanning on a channel. +This method is called immediately after each channel change +and must initiate the work to scan a channel and schedule a timer +to advance to the next channel in the scan list. +This callback is done in a sleepable context. +The default method handles active scan work (e.g. sending ProbRequest +frames), and schedules a call to +.Xr ieee80211_scan_next 9 +according to the maximum dwell time for the channel. +Drivers that off-load scan work to firmware typically use this method +to trigger per-channel scan activity. +.It Dv ic_scan_mindwell +Handle reaching the minimum dwell time on a channel when scanning. +This event is triggered when one or more stations have been found on +a channel and the minimum dwell time has been reached. +This callback is done in a sleepable context. +The default method signals the scan machinery to advance +to the next channel as soon as possible. +Drivers can use this method to preempt further work (e.g. if scanning +is handled by firmware) or ignore the request to force maximum dwell time +on a channel. +.It Dv ic_recv_action +Process a received Action frame. +The default method points to +.Xr ieee80211_recv_action 9 +which provides a mechanism for setting up handlers for each Action frame class. +.It Dv ic_send_action +Transmit an Action frame. +The default method points to +.Xr ieee80211_send_action 9 +which provides a mechanism for setting up handlers for each Action frame class. +.It Dv ic_ampdu_enable +Check if transmit A-MPDU should be enabled for the specified station and AC. +The default method checks a per-AC traffic rate against a per-vap +threshold to decide if A-MPDU should be enabled. +This method also rate-limits ADDBA requests so that requests are not +made too frequently when a receiver has limited resources. +.It Dv ic_addba_request +Request A-MPDU transmit aggregation. +The default method sets up local state and issues an +ADDBA Request Action frame. +Drivers may interpose this method if they need to setup private state +for handling transmit A-MPDU. +.It Dv ic_addb_response +Process a received ADDBA Response Action frame and setup resources as +needed for doing transmit A-MPDU, +.It Dv ic_addb_stop +Shutdown an A-MPDU transmit stream for the specified station and AC. +The default method reclaims local state after sending a DelBA Action frame. +.It Dv ic_bar_response +Process a response to a transmitted BAR control frame. +.It Dv ic_ampdu_rx_start +Prepare to receive A-MPDU data from the specified station for the TID. +.It Dv ic_ampdu_rx_stop +Terminate receipt of A-MPDU data from the specified station for the TID. +.El +.Pp +Once the +.Nm +layer is attached to a driver there are two more steps typically done +to complete the work: +.Bl -enum +.It +Setup +.Dq radiotap support +for capturing raw 802.11 packets that pass through the device. +This is done with a call to +.Xr ieee80211_radiotap_attach 9 . +.It +Do any final device setup like enabling interrupts. +.El +.Pp +State is torn down and reclaimed with a call to +.Fn ieee80211_ifdetach . +Note this call may result in multiple callbacks into the driver +so it should be done before any critical driver state is reclaimed. +On return from .Fn ieee80211_ifdetach -function frees any -.Nm ieee80211 -structures associated with the driver, and performs Ethernet and BPF -detachment on behalf of the caller. -.Pp -.\" -The -.Fn ieee80211_mhz2ieee -utility function converts the frequency -.Fa freq -(specified in MHz) to an IEEE 802.11 channel number. -The -.Fa flags -argument is a hint which specifies whether the frequency is in -the 2GHz ISM band -.Pq Vt IEEE80211_CHAN_2GHZ -or the 5GHz band -.Pq Vt IEEE80211_CHAN_5GHZ ; -appropriate clipping of the result is then performed. -.Pp -.\" -The -.Fn ieee80211_chan2ieee -function converts the channel specified in -.Fa *c -to an IEEE channel number for the driver -.Fa ic . -If the conversion would be invalid, an error message is printed to the -system console. -This function REQUIRES that the driver is hooked up to the -.Nm ieee80211 -subsystem. -.Pp -.\" -The -.Fn ieee80211_ieee2mhz -utility function converts the IEEE channel number -.Ft chan -to a frequency (in MHz). -The -.Fa flags -argument is a hint which specifies whether the frequency is in -the 2GHz ISM band -.Pq Vt IEEE80211_CHAN_2GHZ -or the 5GHz band -.Pq Vt IEEE80211_CHAN_5GHZ ; -appropriate clipping of the result is then performed. -.Pp -.\" -The -.Fn ieee80211_media_init -function initializes media data structures used by the -.Vt ifmedia -interface, for the driver -.Fa ifp . -It must be called by the driver after calling -.Fn ieee80211_attach -and before calling most -.Nm ieee80211 -functions. -The -.Fa media_change -and -.Fa media_stat -arguments specify helper functions which will be invoked by the -.Vt ifmedia -framework when the user changes or queries media options, -using a command such as -.Xr ifconfig 8 . -.Pp -.\" -The -.Fn ieee80211_media_status +all associated vaps and ifnet structures are reclaimed or inaccessible +to user applications so it is safe to teardown driver state without +worry about being re-entered. +The driver is responsible for calling +.Xr if_free 9 +on the ifnet it allocated for the physical device. +.Sh DRIVER CAPABILITIES +Driver/device capabilities are specified using several sets of flags +in the +.Vt ieee80211com +structure. +General capabilities are specified by +.Vt ic_caps . +Hardware cryptographic capabilities are specified by +.Vt ic_cryptocaps . +802.11n capabilities, if any, are specified by +.Vt ic_htcaps . +The +.Nm +layer propagates a subset of these capabilities to each vap through +the equivalent fields: +.Vt iv_caps , +.Vt iv_cryptocaps , and -.Fn ieee80211_media_change -functions are device-independent handlers for -.Vt ifmedia -commands and are not intended to be called directly. -.Pp -.\" -The -.Fn ieee80211_watchdog -function is intended to be called from a driver's -.Va if_watchdog -routine. -It is used to perform periodic cleanup of state within the software 802.11 -stack, as well as timing out scans. -.Pp -.\" -The -.Fn ieee80211_setmode -function is called from within the 802.11 stack to change the mode -of the driver's PHY; it is not intended to be called directly. -.Pp -.\" -The -.Fn ieee80211_chan2mode -function returns the PHY mode required for use with the channel -.Fa chan -on the device -.Fa ic . -This is typically used when selecting a rate set, to be advertised in -beacons, for example. -.Pp -.\" -The -.Fn ieee80211_rate2media -function converts the bit rate -.Fa rate -(measured in units of 0.5Mbps) to an -.Vt ifmedia -sub-type, for the device -.Fa ic -running in PHY mode -.Fa mode . -The -.Fn ieee80211_media2rate -performs the reverse of this conversion, returning the bit rate (in 0.5Mbps -units) corresponding to an -.Vt ifmedia -sub-type. -.\" +.Vt iv_htcaps . +The following general capabilities are defined: +.Bl -tag -width IEEE80211_C_8023ENCAP +.It Dv IEEE80211_C_STA +Device is capable of operating in station (aka Infrastructure) mode. +.It Dv IEEE80211_C_8023ENCAP +Device requires 802.3-encapsulated frames be passed for transmit. +By default +.Nm +will encapsulate all outbound frames as 802.11 frames (without a PLCP header). +.It Dv IEEE80211_C_FF +Device supports Atheros Fast-Frames. +.It Dv IEEE80211_C_TURBOP +Device supports Atheros Dynamic Turbo mode. +.It Dv IEEE80211_C_IBSS +Device is capable of operating in adhoc/IBSS mode. +.It Dv IEEE80211_C_PMGT +Device supports dynamic power-management (aka power save) in station mode. +.It Dv IEEE80211_C_HOSTAP +Device is capable of operating as an Access Point in Infrastructure mode. +.It Dv IEEE80211_C_AHDEMO +Device is capable of operating in Adhoc Demo mode. +In this mode the device is used purely to send/receive raw 802.11 frames. +.It Dv IEEE80211_C_SWRETRY +Device supports software retry of transmitted frames. +.It Dv IEEE80211_C_TXPMGT +Device support dynamic transmit power changes on transmitted frames; +also known as Transmit Power Control (TPC). +.It Dv IEEE80211_C_SHSLOT +Device supports short slot time operation (for 802.11g). +.It Dv IEEE80211_C_SHPREAMBLE +Device supports short preamble operation (for 802.11g). +.It Dv IEEE80211_C_MONITOR +Device is capable of operating in monitor mode. +.It Dv IEEE80211_C_DFS +Device supports radar detection and/or DFS. +DFS protocol support can be handled by +.Nm +but the device must be capable of detecting radar events. +.It Dv IEEE80211_C_MBSS +Device is capable of operating in MeshBSS (MBSS) mode +(as defined by 802.11s Draft 3.0). +.It Dv IEEE80211_C_WPA1 +Device supports WPA1 operation. +.It Dv IEEE80211_C_WPA2 +Device supports WPA2/802.11i operation. +.It Dv IEEE80211_C_BURST +Device supports frame bursting. +.It Dv IEEE80211_C_WME +Device supports WME/WMM operation +(at the moment this is mostly support for sending and receiving +QoS frames with EDCF). +.It Dv IEEE80211_C_WDS +Device supports transmit/receive of 4-address frames. +.It Dv IEEE80211_C_BGSCAN +Device supports background scanning. +.It Dv IEEE80211_C_TXFRAG +Device supports transmit of fragmented 802.11 frames. +.It Dv IEEE80211_C_TDMA +Device is capable of operating in TDMA mode. +.El +.Pp +The follow general crypto capabilities are defined. +In general +.Nm +will fall-back to software support when a device is not capable +of hardware acceleration of a cipher. +This can be done on a per-key basis. +.Nm +can also handle software +.Dv Michael +calculation combined with hardware +.Dv AES +acceleration. +.Bl -tag -width IEEE80211_C_8023ENCAP +.It Dv IEEE80211_CRYPTO_WEP +Device supports hardware WEP cipher. +.It Dv IEEE80211_CRYPTO_TKIP +Device supports hardware TKIP cipher. +.It Dv IEEE80211_CRYPTO_AES_OCB +Device supports hardware AES-OCB cipher. +.It Dv IEEE80211_CRYPTO_AES_CCM +Device supports hardware AES-CCM cipher. +.It Dv IEEE80211_CRYPTO_TKIPMIC +Device supports hardware Michael for use with TKIP. +.It Dv IEEE80211_CRYPTO_CKIP +Devices supports hardware CKIP cipher. +.El +.Pp +The follow general 802.11n capabilities are defined. +The first capabilities are defined exactly as they appear in the +802.11n specification. +Capabilities beginning with IEEE80211_HTC_AMPDU are used soley by the +.Nm +layer. +.Bl -tag -width IEEE80211_C_8023ENCAP +.It Dv IEEE80211_HTCAP_CHWIDTH40 +Device supports 20/40 channel width operation. +.It Dv IEEE80211_HTCAP_SMPS_DYNAMIC +Device supports dynamic SM power save operation. +.It Dv IEEE80211_HTCAP_SMPS_ENA +Device supports static SM power save operation. +.It Dv IEEE80211_HTCAP_GREENFIELD +Device supports Greenfield preamble. +.It Dv IEEE80211_HTCAP_SHORTGI20 +Device supports Short Guard Interval on 20MHz channels. +.It Dv IEEE80211_HTCAP_SHORTGI40 +Device supports Short Guard Interval on 40MHz channels. +.It Dv IEEE80211_HTCAP_TXSTBC +Device supports Space Time Block Convolution (STBC) for transmit. +.It Dv IEEE80211_HTCAP_RXSTBC_1STREAM +Device supports 1 spatial stream for STBC receive. +.It Dv IEEE80211_HTCAP_RXSTBC_2STREAM +Device supports 1-2 spatial streams for STBC receive. +.It Dv IEEE80211_HTCAP_RXSTBC_3STREAM +Device supports 1-3 spatial streams for STBC receive. +.It Dv IEEE80211_HTCAP_MAXAMSDU_7935 +Device supports A-MSDU frames up to 7935 octets. +.It Dv IEEE80211_HTCAP_MAXAMSDU_3839 +Device supports A-MSDU frames up to 3839 octets. +.It Dv IEEE80211_HTCAP_DSSSCCK40 +Device supports use of DSSS/CCK on 40MHz channels. +.It Dv IEEE80211_HTCAP_PSMP +Device supports PSMP. +.It Dv IEEE80211_HTCAP_40INTOLERANT +Device is intolerant of 40MHz wide channel use. +.It Dv IEEE80211_HTCAP_LSIGTXOPPROT +Device supports L-SIG TXOP protection. +.It Dv IEEE80211_HTC_AMPDU +Device supports A-MPDU aggregation. +Note that any 802.11n compliant device must support A-MPDU receive +so this implicitly means support for +.Em transmit +of A-MPDU frames. +.It Dv IEEE80211_HTC_AMSDU +Device supports A-MSDU aggregation. +Note that any 802.11n compliant device must support A-MSDU receive +so this implicitly means support for +.Em transmit +of A-MSDU frames. +.It Dv IEEE80211_HTC_HT +Device supports High Throughput (HT) operation. +This capability must be set to enable 802.11n functionality +in +.Nm . +.It Dv IEEE80211_HTC_SMPS +Device supports MIMO Power Save operation. +.It Dv IEEE80211_HTC_RIFS +Device supports Reduced Inter Frame Spacing (RIFS). +.El .Sh SEE ALSO -.Xr ieee80211_crypto 9 , +.Xr ioctl 2 , +.Xr ndis 4 , .Xr ieee80211_input 9 , -.Xr ieee80211_ioctl 9 , -.Xr ieee80211_node 9 , -.Xr ieee80211_output 9 , -.Xr ieee80211_proto 9 , -.Xr ieee80211_radiotap 9 , -.Xr ifnet 9 -.Sh HISTORY -The -.Nm ieee80211 -series of functions first appeared in -.Nx 1.5 , -and were later ported to -.Fx 4.6 . -.Sh AUTHORS -.An -nosplit -This manual page was written by -.An Bruce M. Simpson Aq bms@FreeBSD.org -and -.An Darron Broad Aq darron@kewl.org . +.Xr ieee80211_input_all 9 , +.Xr ieee80211_scan_next 9 , +.Xr ieee80211_recv_action 9 , +.Xr ieee80211_send_action 9 , +.Xr ieee80211_radiotap_attach 9 , +.Xr ifnet 9 , +.Xr malloc 9 . Added: head/share/man/man9/ieee80211_amrr.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/ieee80211_amrr.9 Wed Aug 12 21:03:16 2009 (r196155) @@ -0,0 +1,194 @@ +.\" +.\" Copyright (c) 2009 Sam Leffler, Errno Consulting +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 4, 2009 +.Dt IEEE8021_AMRR 9 +.Os +.Sh NAME +.Nm ieee80211_amrr +.Nd 802.11 network driver transmit rate control support +.Sh SYNOPSIS +.In net80211/ieee80211_amrr.h +.Ft void +.Fo ieee80211_amrr_init +.Fa "struct ieee80211_amrr *" +.Fa "struct ieee80211vap *" +.Fa "int amin" +.Fa "int amax" +.Fa "int interval" +.Fc +.\" +.Ft void +.Fn ieee80211_amrr_cleanup "struct ieee80211_amrr *" +.\" +.Ft void +.Fn ieee80211_amrr_setinterval "struct ieee80211_amrr *" "int interval" +.\" +.Ft void +.Fo ieee80211_amrr_node_init +.Fa "struct ieee80211_amrr *" +.Fa "struct ieee80211_amrr_node *" +.Fa "struct ieee80211_node *" +.Fc +.\" +.Ft int +.Fo ieee80211_amrr_choose +.Fa "struct ieee80211_node *" +.Fa "struct ieee80211_amrr_node *" +.Fc +.\" +.Ft void +.Fo ieee80211_amrr_tx_complete +.Fa "struct ieee80211_amrr_node *" +.Fa "int ok" +.Fa "int retries" +.Fc +.\" +.Ft void +.Fo ieee80211_amrr_tx_update +.Fa "struct ieee80211_amrr_node *" +.Fa "int txnct" +.Fa "int success" +.Fa "int retrycnt" +.Fc +.Sh DESCRIPTION +.Nm +is an implementation of the AMRR transmit rate control algorithm +for drivers that use the +.Nm net80211 +software layer. +A rate control algorithm is responsible for choosing the transmit +rate for each frame. +To maximize throughput algorithms try to use the highest rate that +is appropriate for the operating conditions. +The rate will vary as conditions change; the distance between two stations +may change, transient noise may be present that affects signal quality, +etc. +.Nm +uses very simple information from a driver to do it's job: +whether a frame was successfully delivered and how many transmit +attempts were made. +While this enables its use with virtually any wireless device it +limits it's effectiveness--do not expect it to function well in +difficult environments and/or respond quickly to changing conditions. +.Pp +.Nm +requires per-vap state and per-node state for each station it is to +select rates for. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 21:19:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A1341065678; Wed, 12 Aug 2009 21:19:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BEAC8FC4F; Wed, 12 Aug 2009 21:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CLJJmr077113; Wed, 12 Aug 2009 21:19:20 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7CLJJlk077111; Wed, 12 Aug 2009 21:19:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200908122119.n7CLJJlk077111@svn.freebsd.org> From: Sam Leffler Date: Wed, 12 Aug 2009 21:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196159 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 21:19:21 -0000 Author: sam Date: Wed Aug 12 21:19:19 2009 New Revision: 196159 URL: http://svn.freebsd.org/changeset/base/196159 Log: Drain link state event changes posted during vap destroy. This is a band-aid for the general problem that if_link_state_change can be called between if_detach and if_free leaving a task queued that has been free'd. Spotted by: thompsa Reviewed by: rwatson Approved by: re (rwatson) Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Wed Aug 12 21:06:43 2009 (r196158) +++ head/sys/net80211/ieee80211.c Wed Aug 12 21:19:19 2009 (r196159) @@ -573,11 +573,13 @@ ieee80211_vap_detach(struct ieee80211vap /* * Flush any deferred vap tasks. - * NB: must be before ether_ifdetach() and removal from ic_vaps list */ ieee80211_draintask(ic, &vap->iv_nstate_task); ieee80211_draintask(ic, &vap->iv_swbmiss_task); + /* XXX band-aid until ifnet handles this for us */ + taskqueue_drain(taskqueue_swi, &ifp->if_linktask); + IEEE80211_LOCK(ic); KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running")); TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 21:45:49 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE36F1065675; Wed, 12 Aug 2009 21:45:49 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5EB158FC4E; Wed, 12 Aug 2009 21:45:49 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id A39ED5C025; Thu, 13 Aug 2009 05:45:48 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 66F1255CDC2A; Thu, 13 Aug 2009 05:45:48 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id FftGxEKzL56N; Thu, 13 Aug 2009 05:44:54 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 959DC55CDC1F; Thu, 13 Aug 2009 05:44:47 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=N703mPS20uIA7FsT4U5TLNU+sPz0iPcmpTSdeI6Age7Txo+w0zPDoyjPOWv3qEFcJ 7hm28Mtwe2SnEJuBQ5rEw== Message-ID: <4A8337BD.3010700@delphij.net> Date: Wed, 12 Aug 2009 14:44:29 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Stanislav Sedov References: <200902271925.n1RJP699080658@svn.freebsd.org> <20090721145559.d2cf3f0b.stas@FreeBSD.org> <4A7AFFC4.5050607@tomjudge.com> <20090812234935.84e5ac74.stas@FreeBSD.org> In-Reply-To: <20090812234935.84e5ac74.stas@FreeBSD.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Tom Judge , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, David Christensen Subject: Re: svn commit: r189117 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 21:45:50 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Stanislav, Stanislav Sedov wrote: > On Thu, 06 Aug 2009 11:07:32 -0500 > Tom Judge mentioned: > >> I can confirm that we are also seeing this problem on a number of Dell >> PE2950 systems running the bce driver from 7.2, the bug is more >> visible/producible on systems that are using Jumbo Frames (in our case 8Kb). >> >> The symptoms of this are an increase in the requests for jumbo clusters >> denied counter at 9k, and then random network stalls which sometimes >> recover on there own and others require a reboot. >> >> We have backed this change and so far it seems to have fixed the issue. >> > > David, > > are you OK with reverting this patch? I submitted the patch to re@ for > review, and I can commit it if you don't mind doing so. :-) I think there was some motivation supporting the SPLIT_HEADER disable in the past (IIRC it was for reliability or data corruption), but I think I have lost the mail archive (at least I couldn't find it at this moment :-/ I'm not very sure if that was fixed by my busdma_sync fix, though, can anyone confirm that? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqDN70ACgkQi+vbBBjt66CfiwCeIpYBDxMXZPhW6gLhdXdBYgj4 uIIAoIRnUkEs0n1xTRJb0JzryxR6poD+ =Iuis -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 21:55:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77BAD106566C; Wed, 12 Aug 2009 21:55:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 534F38FC4A; Wed, 12 Aug 2009 21:55:47 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id E762A46B37; Wed, 12 Aug 2009 17:55:46 -0400 (EDT) Date: Wed, 12 Aug 2009 22:55:46 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Sam Leffler In-Reply-To: <200908122119.n7CLJJlk077111@svn.freebsd.org> Message-ID: References: <200908122119.n7CLJJlk077111@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196159 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 21:55:47 -0000 On Wed, 12 Aug 2009, Sam Leffler wrote: > Drain link state event changes posted during vap destroy. This is a > band-aid for the general problem that if_link_state_change can be > called between if_detach and if_free leaving a task queued that has > been free'd. FYI to others -- we believe the proper fix should be in the ifnet framework, but this change was the lowest-risk way to resolve the problem for 8.0. Following the release we'll investigate having the ifnet framework provide this protection automatically for drivers. Robert N M Watson Computer Laboratory University of Cambridge > Spotted by: thompsa > Reviewed by: rwatson > Approved by: re (rwatson) > > Modified: > head/sys/net80211/ieee80211.c > > Modified: head/sys/net80211/ieee80211.c > ============================================================================== > --- head/sys/net80211/ieee80211.c Wed Aug 12 21:06:43 2009 (r196158) > +++ head/sys/net80211/ieee80211.c Wed Aug 12 21:19:19 2009 (r196159) > @@ -573,11 +573,13 @@ ieee80211_vap_detach(struct ieee80211vap > > /* > * Flush any deferred vap tasks. > - * NB: must be before ether_ifdetach() and removal from ic_vaps list > */ > ieee80211_draintask(ic, &vap->iv_nstate_task); > ieee80211_draintask(ic, &vap->iv_swbmiss_task); > > + /* XXX band-aid until ifnet handles this for us */ > + taskqueue_drain(taskqueue_swi, &ifp->if_linktask); > + > IEEE80211_LOCK(ic); > KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running")); > TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); > From owner-svn-src-head@FreeBSD.ORG Wed Aug 12 22:58:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64955106566B; Wed, 12 Aug 2009 22:58:32 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id B11788FC52; Wed, 12 Aug 2009 22:58:31 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 3so138994qwe.7 for ; Wed, 12 Aug 2009 15:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=KrmsiKZLV5AeyOhKwbI75MLSNr5YG9va+s/w2KKG5Q8=; b=KbjVdWd5NdIR60AMAxBETD//coFLX2xhtqhKbmE4X6t8niB7VahwtnAXJwJqe3YwZD /Mj/IezTqBvJ3eI8xC+qt2cIN0KBOCIh+rfxpWFVKZ7Wfql6DYGt76YcCqXe7yUo/OdL UcfDEKI+3s0vEbUy4QitcPLcha5XsYCsXkoVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=qGl4OqG6VlU+/fVXgwFvU3LLpi5ozdxVqeFzRm3TFgzTVRbMEqOnREo/B8VX8DXlrp 34vOeSO+T+FJ+275FJSepYURTbgZFnX7vzBtWEyXQBNUhlbDLVuG60t1Jmh/gBYKDtHs DpCHPh6ItfGYqVAP1YaNwBh8v7+8cCG/0QGSM= Received: by 10.224.32.7 with SMTP id a7mr704517qad.308.1250117910896; Wed, 12 Aug 2009 15:58:30 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 2sm3248650qwi.33.2009.08.12.15.58.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Aug 2009 15:58:30 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 12 Aug 2009 15:57:26 -0700 From: Pyun YongHyeon Date: Wed, 12 Aug 2009 15:57:26 -0700 To: Xin LI Message-ID: <20090812225726.GI55129@michelle.cdnetworks.com> References: <200902271925.n1RJP699080658@svn.freebsd.org> <20090721145559.d2cf3f0b.stas@FreeBSD.org> <4A7AFFC4.5050607@tomjudge.com> <20090812234935.84e5ac74.stas@FreeBSD.org> <4A8337BD.3010700@delphij.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8337BD.3010700@delphij.net> User-Agent: Mutt/1.4.2.3i Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, David Christensen , Stanislav Sedov , svn-src-head@freebsd.org, Tom Judge Subject: Re: svn commit: r189117 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 22:58:32 -0000 On Wed, Aug 12, 2009 at 02:44:29PM -0700, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, Stanislav, > > Stanislav Sedov wrote: > > On Thu, 06 Aug 2009 11:07:32 -0500 > > Tom Judge mentioned: > > > >> I can confirm that we are also seeing this problem on a number of Dell > >> PE2950 systems running the bce driver from 7.2, the bug is more > >> visible/producible on systems that are using Jumbo Frames (in our case 8Kb). > >> > >> The symptoms of this are an increase in the requests for jumbo clusters > >> denied counter at 9k, and then random network stalls which sometimes > >> recover on there own and others require a reboot. > >> > >> We have backed this change and so far it seems to have fixed the issue. > >> > > > > David, > > > > are you OK with reverting this patch? I submitted the patch to re@ for > > review, and I can commit it if you don't mind doing so. :-) > > I think there was some motivation supporting the SPLIT_HEADER disable in > the past (IIRC it was for reliability or data corruption), but I think I > have lost the mail archive (at least I couldn't find it at this moment > :-/ I'm not very sure if that was fixed by my busdma_sync fix, though, > can anyone confirm that? > Since I don't have bce(4) hardwares I can't confirm it. I think the busdma_sync fix would be prerequisite condition to fix data corruption problem but I think it would not necessarily fix previous data corruption issue. From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 01:17:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6994C1065670; Thu, 13 Aug 2009 01:17:27 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 584C08FC3F; Thu, 13 Aug 2009 01:17:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7D1HROm082172; Thu, 13 Aug 2009 01:17:27 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7D1HR7E082170; Thu, 13 Aug 2009 01:17:27 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200908130117.n7D1HR7E082170@svn.freebsd.org> From: Matt Jacob Date: Thu, 13 Aug 2009 01:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196162 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 01:17:27 -0000 Author: mjacob Date: Thu Aug 13 01:17:26 2009 New Revision: 196162 URL: http://svn.freebsd.org/changeset/base/196162 Log: Have at least *some* default WWN to fall back on, otherwise Sun branded FC cards won't configure. Reviewed by: Ken, Scott Approved by: re Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Aug 12 21:34:57 2009 (r196161) +++ head/sys/dev/isp/isp_freebsd.c Thu Aug 13 01:17:26 2009 (r196162) @@ -5280,6 +5280,10 @@ isp_default_wwn(ispsoftc_t * isp, int ch return (seed); } seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram : FCPARAM(isp, chan)->isp_wwpn_nvram; + if (seed) { + return (seed); + } + return (0x400000007F000009ull); } else { seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; } From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 06:07:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEEC7106566C; Thu, 13 Aug 2009 06:07:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83D1D8FC49; Thu, 13 Aug 2009 06:07:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7D67dup089198; Thu, 13 Aug 2009 06:07:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7D67dfm089197; Thu, 13 Aug 2009 06:07:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200908130607.n7D67dfm089197@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 13 Aug 2009 06:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196164 - in head: contrib/bzip2 contrib/netcat contrib/openpam crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 06:07:40 -0000 Author: des Date: Thu Aug 13 06:07:38 2009 New Revision: 196164 URL: http://svn.freebsd.org/changeset/base/196164 Log: Update and remove CVS-specific items Approved by: re (kib) Modified: head/contrib/bzip2/FREEBSD-vendor head/contrib/netcat/FREEBSD-vendor head/contrib/openpam/FREEBSD-vendor head/crypto/openssh/FREEBSD-vendor Modified: head/contrib/bzip2/FREEBSD-vendor ============================================================================== --- head/contrib/bzip2/FREEBSD-vendor Thu Aug 13 01:45:26 2009 (r196163) +++ head/contrib/bzip2/FREEBSD-vendor Thu Aug 13 06:07:38 2009 (r196164) @@ -2,6 +2,4 @@ Project: bzip2 ProjectURL: http://www.bzip.org/ Version: 1.0.5 -VendorTag: BZIP2 -VersionTag: v1_0_5 License: BSD Modified: head/contrib/netcat/FREEBSD-vendor ============================================================================== --- head/contrib/netcat/FREEBSD-vendor Thu Aug 13 01:45:26 2009 (r196163) +++ head/contrib/netcat/FREEBSD-vendor Thu Aug 13 06:07:38 2009 (r196164) @@ -2,6 +2,4 @@ Project: netcat (aka src/usr.bin/nc in OpenBSD) ProjectURL: http://www.openbsd.org/ Version: 4.4 -VendorTag: OPENBSD -VersionTag: OPENBSD_4_4 License: BSD Modified: head/contrib/openpam/FREEBSD-vendor ============================================================================== --- head/contrib/openpam/FREEBSD-vendor Thu Aug 13 01:45:26 2009 (r196163) +++ head/contrib/openpam/FREEBSD-vendor Thu Aug 13 06:07:38 2009 (r196164) @@ -2,7 +2,5 @@ Project: OpenPAM ProjectURL: http://www.openpam.org/ Version: Hydrangea (20071221) -VendorTag: OPENPAM -VersionTag: OPENPAM_HYDRANGEA License: BSD Maintainer: des Modified: head/crypto/openssh/FREEBSD-vendor ============================================================================== --- head/crypto/openssh/FREEBSD-vendor Thu Aug 13 01:45:26 2009 (r196163) +++ head/crypto/openssh/FREEBSD-vendor Thu Aug 13 06:07:38 2009 (r196164) @@ -1,8 +1,6 @@ # $FreeBSD$ Project: Portable OpenSSH ProjectURL: http://www.openssh.com/portable.html -Version: 5.1p1 -VendorTag: OPENSSH -VersionTag: OpenSSH_5_1p1 +Version: 5.2p1 License: BSD Maintainer: des From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 09:11:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A6001065675; Thu, 13 Aug 2009 09:11:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 295128FC3F; Thu, 13 Aug 2009 09:11:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7D9BmFT094790; Thu, 13 Aug 2009 09:11:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7D9BmsI094785; Thu, 13 Aug 2009 09:11:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908130911.n7D9BmsI094785@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 13 Aug 2009 09:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196172 - head/tools/regression/priv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 09:11:48 -0000 Author: bz Date: Thu Aug 13 09:11:47 2009 New Revision: 196172 URL: http://svn.freebsd.org/changeset/base/196172 Log: Start respecting WITHOUT_INET6. Make regression/priv compile again after the multi-IP jail changes. Note that we are still using the legacy jail(2) rather than the jail_set(2)/jail(3) syscall. Add an IPv4, and an IPv6 loopback address in case we compile with INET6 enabled. Make the priv_vfs_extattr_system compile on amd64 as well using the proper length modifier to printf(3) for ssize_t. Reviewed by: rwatson Approved by: re (kib) Modified: head/tools/regression/priv/Makefile head/tools/regression/priv/main.c head/tools/regression/priv/priv_netinet_ipsec.c head/tools/regression/priv/priv_vfs_extattr_system.c Modified: head/tools/regression/priv/Makefile ============================================================================== --- head/tools/regression/priv/Makefile Thu Aug 13 08:31:15 2009 (r196171) +++ head/tools/regression/priv/Makefile Thu Aug 13 09:11:47 2009 (r196172) @@ -2,6 +2,8 @@ # $FreeBSD$ # +.include + PROG= priv SRCS= main.c \ priv_acct.c \ @@ -49,4 +51,8 @@ WARNS= 3 DPADD+= ${LIBIPSEC} LDADD+= -lipsec +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif + .include Modified: head/tools/regression/priv/main.c ============================================================================== --- head/tools/regression/priv/main.c Thu Aug 13 08:31:15 2009 (r196171) +++ head/tools/regression/priv/main.c Thu Aug 13 09:11:47 2009 (r196172) @@ -142,20 +142,24 @@ static struct test tests[] = { priv_netinet_ipsec_policy4_bypass, priv_netinet_ipsec_policy_bypass_cleanup }, +#ifdef INET6 { "priv_netinet_ipsec_policy6_bypass", priv_netinet_ipsec_policy6_bypass_setup, priv_netinet_ipsec_policy6_bypass, priv_netinet_ipsec_policy_bypass_cleanup }, +#endif { "priv_netinet_ipsec_policy4_entrust", priv_netinet_ipsec_policy4_entrust_setup, priv_netinet_ipsec_policy4_entrust, priv_netinet_ipsec_policy_entrust_cleanup }, +#ifdef INET6 { "priv_netinet_ipsec_policy6_entrust", priv_netinet_ipsec_policy6_entrust_setup, priv_netinet_ipsec_policy6_entrust, priv_netinet_ipsec_policy_entrust_cleanup }, +#endif { "priv_netinet_raw", priv_netinet_raw_setup, priv_netinet_raw, priv_netinet_raw_cleanup }, @@ -420,12 +424,23 @@ static void enter_jail(const char *test) { struct jail j; + struct in_addr ia4; +#ifdef INET6 + struct in6_addr ia6 = IN6ADDR_LOOPBACK_INIT; +#endif bzero(&j, sizeof(j)); - j.version = 0; + j.version = JAIL_API_VERSION; j.path = "/"; j.hostname = "test"; - j.ip_number = htonl(INADDR_LOOPBACK); + j.jailname = "regressions/priv"; + ia4.s_addr = htonl(INADDR_LOOPBACK); + j.ip4s = 1; + j.ip4 = &ia4; +#ifdef INET6 + j.ip6s = 1; + j.ip6 = &ia6; +#endif if (jail(&j) < 0) err(-1, "test %s: jail", test); } Modified: head/tools/regression/priv/priv_netinet_ipsec.c ============================================================================== --- head/tools/regression/priv/priv_netinet_ipsec.c Thu Aug 13 08:31:15 2009 (r196171) +++ head/tools/regression/priv/priv_netinet_ipsec.c Thu Aug 13 09:11:47 2009 (r196172) @@ -69,6 +69,7 @@ priv_netinet_ipsec_policy_bypass_setup_a return (-1); } break; +#ifdef INET6 case AF_INET6: sd = socket(AF_INET6, SOCK_DGRAM, 0); if (sd < 0) { @@ -76,6 +77,7 @@ priv_netinet_ipsec_policy_bypass_setup_a return (-1); } break; +#endif default: warnx("%s: unexpected address family", __func__); return (-1); @@ -92,6 +94,7 @@ priv_netinet_ipsec_policy4_bypass_setup( AF_INET)); } +#ifdef INET6 int priv_netinet_ipsec_policy6_bypass_setup(int asroot, int injail, struct test *test) @@ -100,7 +103,7 @@ priv_netinet_ipsec_policy6_bypass_setup( return (priv_netinet_ipsec_policy_bypass_setup_af(asroot, injail, test, AF_INET6)); } - +#endif static int @@ -121,6 +124,7 @@ priv_netinet_ipsec_policy_entrust_setup_ return (-1); } break; +#ifdef INET6 case AF_INET6: sd = socket(AF_INET6, SOCK_DGRAM, 0); if (sd < 0) { @@ -128,6 +132,7 @@ priv_netinet_ipsec_policy_entrust_setup_ return (-1); } break; +#endif default: warnx("%s: unexpected address family", __func__); return (-1); @@ -144,6 +149,7 @@ priv_netinet_ipsec_policy4_entrust_setup AF_INET)); } +#ifdef INET6 int priv_netinet_ipsec_policy6_entrust_setup(int asroot, int injail, struct test *test) @@ -152,7 +158,7 @@ priv_netinet_ipsec_policy6_entrust_setup return (priv_netinet_ipsec_policy_entrust_setup_af(asroot, injail, test, AF_INET6)); } - +#endif void priv_netinet_ipsec_pfkey(int asroot, int injail, struct test *test) @@ -196,10 +202,12 @@ priv_netinet_ipsec_policy_bypass_af(int level = IPPROTO_IP; optname = IP_IPSEC_POLICY; break; +#ifdef INET6 case AF_INET6: level = IPPROTO_IPV6; optname = IPV6_IPSEC_POLICY; break; +#endif default: warnx("%s: unexpected address family", __func__); return; @@ -227,13 +235,14 @@ priv_netinet_ipsec_policy4_bypass(int as priv_netinet_ipsec_policy_bypass_af(asroot, injail, test, AF_INET); } +#ifdef INET6 void priv_netinet_ipsec_policy6_bypass(int asroot, int injail, struct test *test) { priv_netinet_ipsec_policy_bypass_af(asroot, injail, test, AF_INET6); } - +#endif static void priv_netinet_ipsec_policy_entrust_af(int asroot, int injail, struct test *test, @@ -246,10 +255,12 @@ priv_netinet_ipsec_policy_entrust_af(int level = IPPROTO_IP; optname = IP_IPSEC_POLICY; break; +#ifdef INET6 case AF_INET6: level = IPPROTO_IPV6; optname = IPV6_IPSEC_POLICY; break; +#endif default: warnx("%s: unexpected address family", __func__); return; @@ -277,13 +288,14 @@ priv_netinet_ipsec_policy4_entrust(int a priv_netinet_ipsec_policy_entrust_af(asroot, injail, test, AF_INET); } +#ifdef INET6 void priv_netinet_ipsec_policy6_entrust(int asroot, int injail, struct test *test) { priv_netinet_ipsec_policy_entrust_af(asroot, injail, test, AF_INET6); } - +#endif void priv_netinet_ipsec_policy_bypass_cleanup(int asroot, int injail, Modified: head/tools/regression/priv/priv_vfs_extattr_system.c ============================================================================== --- head/tools/regression/priv/priv_vfs_extattr_system.c Thu Aug 13 08:31:15 2009 (r196171) +++ head/tools/regression/priv/priv_vfs_extattr_system.c Thu Aug 13 09:11:47 2009 (r196172) @@ -80,7 +80,7 @@ priv_vfs_extattr_system(int asroot, int else if (ret == EA_SIZE) error = 0; else - err(-1, "priv_vfs_extattr_system: set returned %d", ret); + err(-1, "priv_vfs_extattr_system: set returned %zd", ret); if (asroot && injail) expect("priv_vfs_extattr_system(asroot, injail)", error, -1, EPERM); From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 09:29:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7B01065674; Thu, 13 Aug 2009 09:29:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44DC98FC52; Thu, 13 Aug 2009 09:29:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7D9TrBB095298; Thu, 13 Aug 2009 09:29:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7D9TrGh095296; Thu, 13 Aug 2009 09:29:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908130929.n7D9TrGh095296@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 13 Aug 2009 09:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196174 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 09:29:54 -0000 Author: bz Date: Thu Aug 13 09:29:52 2009 New Revision: 196174 URL: http://svn.freebsd.org/changeset/base/196174 Log: Put multiple instructions into a block when iterating; unbreaks NET_RT_DUMP, which otherwise only returned information of AF_MAX. This was broken in r193232 (save your time - my bug, my fix). PR: kern/137700 Reported by: Larry Baird (lab gta.com) Tested by: Larry Baird (lab gta.com) Reviewed by: zec, lstewart, qing Approved by: re (kib) Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Aug 13 09:17:07 2009 (r196173) +++ head/sys/net/rtsock.c Thu Aug 13 09:29:52 2009 (r196174) @@ -1473,7 +1473,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) /* * take care of routing entries */ - for (error = 0; error == 0 && i <= lim; i++) + for (error = 0; error == 0 && i <= lim; i++) { rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i); if (rnh != NULL) { RADIX_NODE_HEAD_LOCK(rnh); @@ -1482,6 +1482,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) RADIX_NODE_HEAD_UNLOCK(rnh); } else if (af != 0) error = EAFNOSUPPORT; + } break; case NET_RT_IFLIST: From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 10:26:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87BC9106564A; Thu, 13 Aug 2009 10:26:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76C578FC57; Thu, 13 Aug 2009 10:26:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DAQYYu097680; Thu, 13 Aug 2009 10:26:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7DAQYN1097674; Thu, 13 Aug 2009 10:26:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908131026.n7DAQYN1097674@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 13 Aug 2009 10:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196176 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 10:26:35 -0000 Author: bz Date: Thu Aug 13 10:26:34 2009 New Revision: 196176 URL: http://svn.freebsd.org/changeset/base/196176 Log: Make it possible to change the vnet sysctl variables on jails with their own virtual network stack. Jails only inheriting a network stack cannot change anything that cannot be changed from within a prison. Reviewed by: rwatson, zec Approved by: re (kib) Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_sysctl.c head/sys/net/vnet.h head/sys/sys/jail.h head/sys/sys/sysctl.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Aug 13 09:32:15 2009 (r196175) +++ head/sys/kern/kern_jail.c Thu Aug 13 10:26:34 2009 (r196176) @@ -88,7 +88,11 @@ struct prison prison0 = { .pr_childmax = JAIL_MAX, .pr_hostuuid = DEFAULT_HOSTUUID, .pr_children = LIST_HEAD_INITIALIZER(&prison0.pr_children), +#ifdef VIMAGE + .pr_flags = PR_HOST|PR_VNET, +#else .pr_flags = PR_HOST, +#endif .pr_allow = PR_ALLOW_ALL, }; MTX_SYSINIT(prison0, &prison0.pr_mtx, "jail mutex", MTX_DEF); @@ -3308,6 +3312,25 @@ getcredhostid(struct ucred *cred, unsign mtx_unlock(&cred->cr_prison->pr_mtx); } +#ifdef VIMAGE +/* + * Determine whether the prison represented by cred owns + * its vnet rather than having it inherited. + * + * Returns 1 in case the prison owns the vnet, 0 otherwise. + */ +int +prison_owns_vnet(struct ucred *cred) +{ + + /* + * vnets cannot be added/removed after jail creation, + * so no need to lock here. + */ + return (cred->cr_prison->pr_flags & PR_VNET ? 1 : 0); +} +#endif + /* * Determine whether the subject represented by cred can "see" * status of a mount point. Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Aug 13 09:32:15 2009 (r196175) +++ head/sys/kern/kern_sysctl.c Thu Aug 13 10:26:34 2009 (r196176) @@ -1381,10 +1381,18 @@ sysctl_root(SYSCTL_HANDLER_ARGS) /* Is this sysctl writable by only privileged users? */ if (req->newptr && !(oid->oid_kind & CTLFLAG_ANYBODY)) { + int priv; + if (oid->oid_kind & CTLFLAG_PRISON) - error = priv_check(req->td, PRIV_SYSCTL_WRITEJAIL); + priv = PRIV_SYSCTL_WRITEJAIL; +#ifdef VIMAGE + else if ((oid->oid_kind & CTLFLAG_VNET) && + prison_owns_vnet(req->td->td_ucred)) + priv = PRIV_SYSCTL_WRITEJAIL; +#endif else - error = priv_check(req->td, PRIV_SYSCTL_WRITE); + priv = PRIV_SYSCTL_WRITE; + error = priv_check(req->td, priv); if (error) return (error); } Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Thu Aug 13 09:32:15 2009 (r196175) +++ head/sys/net/vnet.h Thu Aug 13 10:26:34 2009 (r196176) @@ -232,21 +232,25 @@ int vnet_sysctl_handle_string(SYSCTL_HAN int vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS); #define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ ptr, val, vnet_sysctl_handle_int, "I", descr) #define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ fmt, descr) \ - SYSCTL_OID(parent, nbr, name, access, ptr, arg, handler, fmt, \ - descr) + SYSCTL_OID(parent, nbr, name, CTLFLAG_VNET|(access), ptr, arg, \ + handler, fmt, descr) #define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), arg, \ - len, vnet_sysctl_handle_string, "A", descr) + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_STRING|CTLFLAG_VNET|(access), \ + arg, len, vnet_sysctl_handle_string, "A", descr) #define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), ptr, \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, \ sizeof(struct type), vnet_sysctl_handle_opaque, "S," #type, \ descr) #define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ ptr, val, vnet_sysctl_handle_uint, "IU", descr) #define VNET_SYSCTL_ARG(req, arg1) do { \ if (arg1 != NULL) \ Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Thu Aug 13 09:32:15 2009 (r196175) +++ head/sys/sys/jail.h Thu Aug 13 10:26:34 2009 (r196176) @@ -341,6 +341,7 @@ void getcredhostuuid(struct ucred *, cha void getcredhostid(struct ucred *, unsigned long *); int prison_allow(struct ucred *, unsigned); int prison_check(struct ucred *cred1, struct ucred *cred2); +int prison_owns_vnet(struct ucred *); int prison_canseemount(struct ucred *cred, struct mount *mp); void prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Aug 13 09:32:15 2009 (r196175) +++ head/sys/sys/sysctl.h Thu Aug 13 10:26:34 2009 (r196176) @@ -85,6 +85,7 @@ struct ctlname { #define CTLMASK_SECURE 0x00F00000 /* Secure level */ #define CTLFLAG_TUN 0x00080000 /* Tunable variable */ #define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */ +#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */ #define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) /* From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 12:28:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C8281065672; Thu, 13 Aug 2009 12:28:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0438FC60; Thu, 13 Aug 2009 12:28:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DCSUuZ000651; Thu, 13 Aug 2009 12:28:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7DCSU1o000650; Thu, 13 Aug 2009 12:28:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200908131228.n7DCSU1o000650@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 13 Aug 2009 12:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196179 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 12:28:32 -0000 Author: trasz Date: Thu Aug 13 12:28:30 2009 New Revision: 196179 URL: http://svn.freebsd.org/changeset/base/196179 Log: Remove CDDL warning. Approved by: re (kib), core Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris.c Thu Aug 13 10:31:02 2009 (r196178) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris.c Thu Aug 13 12:28:30 2009 (r196179) @@ -49,10 +49,6 @@ opensolaris_load(void *dummy) { int i; - printf("This module (opensolaris) contains code covered by the\n"); - printf("Common Development and Distribution License (CDDL)\n"); - printf("see http://opensolaris.org/os/licensing/opensolaris_license/\n"); - /* * "Enable" all CPUs even though they may not exist just so * that the asserts work. On FreeBSD, if a CPU exists, it is From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 14:59:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED40106564A; Thu, 13 Aug 2009 14:59:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1BCB8FC4D; Thu, 13 Aug 2009 14:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DEx480004281; Thu, 13 Aug 2009 14:59:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7DEx4hf004279; Thu, 13 Aug 2009 14:59:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908131459.n7DEx4hf004279@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 13 Aug 2009 14:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196185 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 14:59:05 -0000 Author: bz Date: Thu Aug 13 14:59:04 2009 New Revision: 196185 URL: http://svn.freebsd.org/changeset/base/196185 Log: Rather than replicating the maths from the kernel, use the value the kernel calculated directly as we already read it with struct vnet. This will make kvm_vnet.c more resilent in case of possible kernel changes. Reviewed by: rwatson Approved by: re (kib) Modified: head/lib/libkvm/kvm_vnet.c Modified: head/lib/libkvm/kvm_vnet.c ============================================================================== --- head/lib/libkvm/kvm_vnet.c Thu Aug 13 14:50:39 2009 (r196184) +++ head/lib/libkvm/kvm_vnet.c Thu Aug 13 14:59:04 2009 (r196185) @@ -195,7 +195,7 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid kd->vnet_start = nl[NLIST_START_VNET].n_value; kd->vnet_stop = nl[NLIST_STOP_VNET].n_value; kd->vnet_current = (uintptr_t)prison.pr_vnet; - kd->vnet_base = (uintptr_t)vnet.vnet_data_mem - kd->vnet_start; + kd->vnet_base = vnet.vnet_data_base; return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 15:56:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05A37106566B; Thu, 13 Aug 2009 15:56:10 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B7A8FC57; Thu, 13 Aug 2009 15:56:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DFu9qq005967; Thu, 13 Aug 2009 15:56:09 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7DFu9dE005965; Thu, 13 Aug 2009 15:56:09 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200908131556.n7DFu9dE005965@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 13 Aug 2009 15:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196193 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 15:56:10 -0000 Author: raj Date: Thu Aug 13 15:56:09 2009 New Revision: 196193 URL: http://svn.freebsd.org/changeset/base/196193 Log: Use correct wbinv operation in pmap_l2cache_wbinv_range(). Submitted by: Michal Hajduk Reviewed by: stas Approved by: re (kib) Obtained from: Semihalf Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Aug 13 15:16:30 2009 (r196192) +++ head/sys/arm/arm/pmap.c Thu Aug 13 15:56:09 2009 (r196193) @@ -1212,7 +1212,7 @@ pmap_l2cache_wbinv_range(pmap_t pm, vm_o CTR4(KTR_PMAP, "pmap_l2cache_wbinv_range: pmap %p is_kernel %d " "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wb_range(va, rest); + cpu_l2cache_wbinv_range(va, rest); len -= rest; va += rest; From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 17:09:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B856B1065670; Thu, 13 Aug 2009 17:09:46 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2A5E8FC3A; Thu, 13 Aug 2009 17:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DH9kjU007673; Thu, 13 Aug 2009 17:09:46 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7DH9jpC007642; Thu, 13 Aug 2009 17:09:45 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200908131709.n7DH9jpC007642@svn.freebsd.org> From: Attilio Rao Date: Thu, 13 Aug 2009 17:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196196 - in head: . sys/amd64/amd64 sys/amd64/conf sys/amd64/include sys/conf sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/xen sys/ia64/ia64 sys/ia64/include sys/kern sys/mips... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 17:09:47 -0000 Author: attilio Date: Thu Aug 13 17:09:45 2009 New Revision: 196196 URL: http://svn.freebsd.org/changeset/base/196196 Log: * Completely Remove the option STOP_NMI from the kernel. This option has proven to have a good effect when entering KDB by using a NMI, but it completely violates all the good rules about interrupts disabled while holding a spinlock in other occasions. This can be the cause of deadlocks on events where a normal IPI_STOP is expected. * Adds an new IPI called IPI_STOP_HARD on all the supported architectures. This IPI is responsible for sending a stop message among CPUs using a privileged channel when disponible. In other cases it just does match a normal IPI_STOP. Right now the IPI_STOP_HARD functionality uses a NMI on ia32 and amd64 architectures, while on the other has a normal IPI_STOP effect. It is responsibility of maintainers to eventually implement an hard stop when necessary and possible. * Use the new IPI facility in order to implement a new userend SMP kernel function called stop_cpus_hard(). That is specular to stop_cpu() but it does use the privileged channel for the stopping facility. * Let KDB use the newly introduced function stop_cpus_hard() and leave stop_cpus() for all the other cases * Disable interrupts on CPU0 when starting the process of APs suspension. * Style cleanup and comments adding This patch should fix the reboot/shutdown deadlocks many users are constantly reporting on mailing lists. Please don't forget to update your config file with the STOP_NMI option removal Reviewed by: jhb Tested by: pho, bz, rink Approved by: re (kib) Modified: head/UPDATING head/sys/amd64/amd64/local_apic.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/amd64/conf/XENHVM head/sys/amd64/include/apicvar.h head/sys/amd64/include/smp.h head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/conf/options.pc98 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/i386/i386/local_apic.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/trap.c head/sys/i386/include/apicvar.h head/sys/i386/include/smp.h head/sys/i386/xen/mp_machdep.c head/sys/ia64/ia64/interrupt.c head/sys/ia64/include/smp.h head/sys/kern/kern_shutdown.c head/sys/kern/subr_kdb.c head/sys/kern/subr_smp.c head/sys/mips/include/smp.h head/sys/mips/mips/mp_machdep.c head/sys/pc98/conf/NOTES head/sys/powerpc/include/smp.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/sparc64/include/smp.h head/sys/sun4v/include/smp.h head/sys/sys/smp.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 13 16:08:35 2009 (r196195) +++ head/UPDATING Thu Aug 13 17:09:45 2009 (r196196) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090813: + Remove the option STOP_NMI. The default action is now to use NMI + only for KDB via the newly introduced function stop_cpus_hard() + and maintain stop_cpus() to just use a normal IPI_STOP on ia32 + and amd64. + 20090719: Bump the shared library version numbers for all libraries that do not use symbol versioning as part of the 8.0-RELEASE cycle. Modified: head/sys/amd64/amd64/local_apic.c ============================================================================== --- head/sys/amd64/amd64/local_apic.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/amd64/local_apic.c Thu Aug 13 17:09:45 2009 (r196196) @@ -1238,8 +1238,17 @@ lapic_ipi_vectored(u_int vector, int des KASSERT((vector & ~APIC_VECTOR_MASK) == 0, ("%s: invalid vector %d", __func__, vector)); - icrlo = vector | APIC_DELMODE_FIXED | APIC_DESTMODE_PHY | - APIC_LEVEL_DEASSERT | APIC_TRIGMOD_EDGE; + icrlo = APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE; + + /* + * IPI_STOP_HARD is just a "fake" vector used to send a NMI. + * Use special rules regard NMI if passed, otherwise specify + * the vector. + */ + if (vector == IPI_STOP_HARD) + icrlo |= APIC_DELMODE_NMI | APIC_LEVEL_ASSERT; + else + icrlo |= vector | APIC_DELMODE_FIXED | APIC_LEVEL_DEASSERT; destfield = 0; switch (dest) { case APIC_IPI_DEST_SELF: Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/amd64/mp_machdep.c Thu Aug 13 17:09:45 2009 (r196196) @@ -114,31 +114,12 @@ volatile int smp_tlb_wait; extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32); -#ifdef STOP_NMI -static volatile cpumask_t ipi_nmi_pending; - -static void ipi_nmi_selected(cpumask_t cpus); -#endif - /* * Local data and functions. */ -#ifdef STOP_NMI -/* - * Provide an alternate method of stopping other CPUs. If another CPU has - * disabled interrupts the conventional STOP IPI will be blocked. This - * NMI-based stop should get through in that case. - */ -static int stop_cpus_with_nmi = 1; -SYSCTL_INT(_debug, OID_AUTO, stop_cpus_with_nmi, CTLTYPE_INT | CTLFLAG_RW, - &stop_cpus_with_nmi, 0, ""); -TUNABLE_INT("debug.stop_cpus_with_nmi", &stop_cpus_with_nmi); -#else -#define stop_cpus_with_nmi 0 -#endif - static u_int logical_cpus; +static volatile cpumask_t ipi_nmi_pending; /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; @@ -1158,12 +1139,14 @@ ipi_selected(cpumask_t cpus, u_int ipi) ipi = IPI_BITMAP_VECTOR; } -#ifdef STOP_NMI - if (ipi == IPI_STOP && stop_cpus_with_nmi) { - ipi_nmi_selected(cpus); - return; - } -#endif + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, cpus); + CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi); while ((cpu = ffs(cpus)) != 0) { cpu--; @@ -1194,64 +1177,43 @@ void ipi_all_but_self(u_int ipi) { - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { + if (IPI_IS_BITMAPED(ipi)) { ipi_selected(PCPU_GET(other_cpus), ipi); return; } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); -} -#ifdef STOP_NMI -/* - * send NMI IPI to selected CPUs - */ - -#define BEFORE_SPIN 1000000 - -static void -ipi_nmi_selected(cpumask_t cpus) -{ - int cpu; - register_t icrlo; - - icrlo = APIC_DELMODE_NMI | APIC_DESTMODE_PHY | APIC_LEVEL_ASSERT - | APIC_TRIGMOD_EDGE; - - CTR2(KTR_SMP, "%s: cpus: %x nmi", __func__, cpus); - - atomic_set_int(&ipi_nmi_pending, cpus); - - while ((cpu = ffs(cpus)) != 0) { - cpu--; - cpus &= ~(1 << cpu); - - KASSERT(cpu_apic_ids[cpu] != -1, - ("IPI NMI to non-existent CPU %d", cpu)); - - /* Wait for an earlier IPI to finish. */ - if (!lapic_ipi_wait(BEFORE_SPIN)) - panic("ipi_nmi_selected: previous IPI has not cleared"); + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus)); - lapic_ipi_raw(icrlo, cpu_apic_ids[cpu]); - } + CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); + lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); } int -ipi_nmi_handler(void) +ipi_nmi_handler() { - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; - if (!(ipi_nmi_pending & cpumask)) - return 1; + /* + * As long as there is not a simple way to know about a NMI's + * source, if the bitmask for the current CPU is present in + * the global pending bitword an IPI_STOP_HARD has been issued + * and should be handled. + */ + cpumask = PCPU_GET(cpumask); + if ((ipi_nmi_pending & cpumask) == 0) + return (1); atomic_clear_int(&ipi_nmi_pending, cpumask); cpustop_handler(); - return 0; + return (0); } -#endif /* STOP_NMI */ - /* * Handle an IPI_STOP by saving our current context and spinning until we * are resumed. Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/amd64/trap.c Thu Aug 13 17:09:45 2009 (r196196) @@ -239,13 +239,11 @@ trap(struct trapframe *frame) type = frame->tf_trapno; #ifdef SMP -#ifdef STOP_NMI /* Handler for NMI IPIs used for stopping CPUs. */ if (type == T_NMI) { if (ipi_nmi_handler() == 0) goto out; } -#endif /* STOP_NMI */ #endif /* SMP */ #ifdef KDB Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/conf/GENERIC Thu Aug 13 17:09:45 2009 (r196196) @@ -69,7 +69,6 @@ options P1003_1B_SEMAPHORES # POSIX-sty options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/conf/NOTES Thu Aug 13 17:09:45 2009 (r196196) @@ -30,11 +30,6 @@ device mptable # Optional MPSPEC mpta # options MP_WATCHDOG -# -# Debugging options. -# -options STOP_NMI # Stop CPUS using NMI instead of IPI - ##################################################################### Modified: head/sys/amd64/conf/XENHVM ============================================================================== --- head/sys/amd64/conf/XENHVM Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/conf/XENHVM Thu Aug 13 17:09:45 2009 (r196196) @@ -68,7 +68,6 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing #options KDTRACE_FRAME # Ensure frames are compiled in Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/include/apicvar.h Thu Aug 13 17:09:45 2009 (r196196) @@ -102,11 +102,6 @@ * smp_ipi_mtx and waits for the completion of the IPI (Only one IPI user * at a time) The second group uses a single interrupt and a bitmap to avoid * redundant IPI interrupts. - * - * Right now IPI_STOP used by kdb shares the interrupt priority class with - * the two IPI groups mentioned above. As such IPI_STOP may cause a deadlock. - * Eventually IPI_STOP should use NMI IPIs - this would eliminate this and - * other deadlocks caused by IPI_STOP. */ /* Interrupts for local APIC LVT entries other than the timer. */ @@ -134,6 +129,7 @@ #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ #define IPI_SUSPEND (APIC_IPI_INTS + 8) /* Suspend CPU until restarted. */ +#define IPI_STOP_HARD (APIC_IPI_INTS + 9) /* Stop CPU with a NMI. */ /* * The spurious interrupt can share the priority class with the IPIs since Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/amd64/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -52,6 +52,7 @@ void cpu_add(u_int apic_id, char boot_cp void cpustop_handler(void); void cpususpend_handler(void); void init_secondary(void); +int ipi_nmi_handler(void); void ipi_selected(cpumask_t cpus, u_int ipi); void ipi_all_but_self(u_int ipi); void ipi_bitmap_handler(struct trapframe frame); @@ -66,10 +67,6 @@ void smp_masked_invlpg_range(cpumask_t m void smp_invltlb(void); void smp_masked_invltlb(cpumask_t mask); -#ifdef STOP_NMI -int ipi_nmi_handler(void); -#endif - #endif /* !LOCORE */ #endif /* SMP */ Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/conf/options.amd64 Thu Aug 13 17:09:45 2009 (r196196) @@ -52,7 +52,6 @@ PSM_DEBUG opt_psm.h DEV_ATPIC opt_atpic.h # Debugging -STOP_NMI opt_cpu.h KDTRACE_FRAME opt_kdtrace.h # BPF just-in-time compiler Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/conf/options.i386 Thu Aug 13 17:09:45 2009 (r196196) @@ -110,7 +110,6 @@ ASR_COMPAT opt_asr.h # Debugging NPX_DEBUG opt_npx.h -STOP_NMI opt_cpu.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h Modified: head/sys/conf/options.pc98 ============================================================================== --- head/sys/conf/options.pc98 Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/conf/options.pc98 Thu Aug 13 17:09:45 2009 (r196196) @@ -95,7 +95,6 @@ DEV_NPX opt_npx.h # Debugging NPX_DEBUG opt_npx.h -STOP_NMI opt_cpu.h AGP_DEBUG opt_agp.h # BPF just-in-time compiler Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/conf/GENERIC Thu Aug 13 17:09:45 2009 (r196196) @@ -70,7 +70,6 @@ options P1003_1B_SEMAPHORES # POSIX-sty options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/conf/NOTES Thu Aug 13 17:09:45 2009 (r196196) @@ -49,7 +49,6 @@ options MP_WATCHDOG # Debugging options. # -options STOP_NMI # Stop CPUS using NMI instead of IPI options COUNT_XINVLTLB_HITS # Counters for TLB events options COUNT_IPIS # Per-CPU IPI interrupt counters Modified: head/sys/i386/i386/local_apic.c ============================================================================== --- head/sys/i386/i386/local_apic.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/i386/local_apic.c Thu Aug 13 17:09:45 2009 (r196196) @@ -1248,8 +1248,17 @@ lapic_ipi_vectored(u_int vector, int des KASSERT((vector & ~APIC_VECTOR_MASK) == 0, ("%s: invalid vector %d", __func__, vector)); - icrlo = vector | APIC_DELMODE_FIXED | APIC_DESTMODE_PHY | - APIC_LEVEL_DEASSERT | APIC_TRIGMOD_EDGE; + icrlo = APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE; + + /* + * IPI_STOP_HARD is just a "fake" vector used to send a NMI. + * Use special rules regard NMI if passed, otherwise specify + * the vector. + */ + if (vector == IPI_STOP_HARD) + icrlo |= APIC_DELMODE_NMI | APIC_LEVEL_ASSERT; + else + icrlo |= vector | APIC_DELMODE_FIXED | APIC_LEVEL_DEASSERT; destfield = 0; switch (dest) { case APIC_IPI_DEST_SELF: Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/i386/mp_machdep.c Thu Aug 13 17:09:45 2009 (r196196) @@ -155,12 +155,6 @@ vm_offset_t smp_tlb_addr1; vm_offset_t smp_tlb_addr2; volatile int smp_tlb_wait; -#ifdef STOP_NMI -static volatile cpumask_t ipi_nmi_pending; - -static void ipi_nmi_selected(cpumask_t cpus); -#endif - #ifdef COUNT_IPIS /* Interrupt counts. */ static u_long *ipi_preempt_counts[MAXCPU]; @@ -177,21 +171,8 @@ u_long *ipi_lazypmap_counts[MAXCPU]; * Local data and functions. */ -#ifdef STOP_NMI -/* - * Provide an alternate method of stopping other CPUs. If another CPU has - * disabled interrupts the conventional STOP IPI will be blocked. This - * NMI-based stop should get through in that case. - */ -static int stop_cpus_with_nmi = 1; -SYSCTL_INT(_debug, OID_AUTO, stop_cpus_with_nmi, CTLTYPE_INT | CTLFLAG_RW, - &stop_cpus_with_nmi, 0, ""); -TUNABLE_INT("debug.stop_cpus_with_nmi", &stop_cpus_with_nmi); -#else -#define stop_cpus_with_nmi 0 -#endif - static u_int logical_cpus; +static volatile cpumask_t ipi_nmi_pending; /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; @@ -1318,12 +1299,14 @@ ipi_selected(cpumask_t cpus, u_int ipi) ipi = IPI_BITMAP_VECTOR; } -#ifdef STOP_NMI - if (ipi == IPI_STOP && stop_cpus_with_nmi) { - ipi_nmi_selected(cpus); - return; - } -#endif + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, cpus); + CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi); while ((cpu = ffs(cpus)) != 0) { cpu--; @@ -1354,64 +1337,42 @@ void ipi_all_but_self(u_int ipi) { - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { + if (IPI_IS_BITMAPED(ipi)) { ipi_selected(PCPU_GET(other_cpus), ipi); return; } + + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus)); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); } -#ifdef STOP_NMI -/* - * send NMI IPI to selected CPUs - */ - -#define BEFORE_SPIN 1000000 - -void -ipi_nmi_selected(cpumask_t cpus) -{ - int cpu; - register_t icrlo; - - icrlo = APIC_DELMODE_NMI | APIC_DESTMODE_PHY | APIC_LEVEL_ASSERT - | APIC_TRIGMOD_EDGE; - - CTR2(KTR_SMP, "%s: cpus: %x nmi", __func__, cpus); - - atomic_set_int(&ipi_nmi_pending, cpus); - - while ((cpu = ffs(cpus)) != 0) { - cpu--; - cpus &= ~(1 << cpu); - - KASSERT(cpu_apic_ids[cpu] != -1, - ("IPI NMI to non-existent CPU %d", cpu)); - - /* Wait for an earlier IPI to finish. */ - if (!lapic_ipi_wait(BEFORE_SPIN)) - panic("ipi_nmi_selected: previous IPI has not cleared"); - - lapic_ipi_raw(icrlo, cpu_apic_ids[cpu]); - } -} - int -ipi_nmi_handler(void) +ipi_nmi_handler() { - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; - if (!(ipi_nmi_pending & cpumask)) - return 1; + /* + * As long as there is not a simple way to know about a NMI's + * source, if the bitmask for the current CPU is present in + * the global pending bitword an IPI_STOP_HARD has been issued + * and should be handled. + */ + cpumask = PCPU_GET(cpumask); + if ((ipi_nmi_pending & cpumask) == 0) + return (1); atomic_clear_int(&ipi_nmi_pending, cpumask); cpustop_handler(); - return 0; + return (0); } -#endif /* STOP_NMI */ - /* * Handle an IPI_STOP by saving our current context and spinning until we * are resumed. Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/i386/trap.c Thu Aug 13 17:09:45 2009 (r196196) @@ -211,13 +211,11 @@ trap(struct trapframe *frame) type = frame->tf_trapno; #ifdef SMP -#ifdef STOP_NMI /* Handler for NMI IPIs used for stopping CPUs. */ if (type == T_NMI) { if (ipi_nmi_handler() == 0) goto out; } -#endif /* STOP_NMI */ #endif /* SMP */ #ifdef KDB Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/include/apicvar.h Thu Aug 13 17:09:45 2009 (r196196) @@ -100,11 +100,6 @@ * smp_ipi_mtx and waits for the completion of the IPI (Only one IPI user * at a time) The second group uses a single interrupt and a bitmap to avoid * redundant IPI interrupts. - * - * Right now IPI_STOP used by kdb shares the interrupt priority class with - * the two IPI groups mentioned above. As such IPI_STOP may cause a deadlock. - * Eventually IPI_STOP should use NMI IPIs - this would eliminate this and - * other deadlocks caused by IPI_STOP. */ /* Interrupts for local APIC LVT entries other than the timer. */ @@ -134,6 +129,7 @@ #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ +#define IPI_STOP_HARD (APIC_IPI_INTS + 8) /* Stop CPU with a NMI. */ #else /* XEN */ /* These are the normal i386 APIC definitions */ @@ -161,6 +157,7 @@ #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ +#define IPI_STOP_HARD (APIC_IPI_INTS + 8) /* Stop CPU with a NMI. */ #endif /* XEN */ /* Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -60,7 +60,8 @@ inthand_t void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void init_secondary(void); -void ipi_selected(u_int cpus, u_int ipi); +int ipi_nmi_handler(void); +void ipi_selected(cpumask_t cpus, u_int ipi); void ipi_all_but_self(u_int ipi); #ifndef XEN void ipi_bitmap_handler(struct trapframe frame); @@ -76,9 +77,6 @@ void smp_masked_invlpg_range(cpumask_t m void smp_invltlb(void); void smp_masked_invltlb(cpumask_t mask); -#ifdef STOP_NMI -int ipi_nmi_handler(void); -#endif #ifdef XEN void ipi_to_irq_init(void); Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/i386/xen/mp_machdep.c Thu Aug 13 17:09:45 2009 (r196196) @@ -90,8 +90,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define stop_cpus_with_nmi 0 - int mp_naps; /* # of Applications processors */ int boot_cpu_id = -1; /* designated BSP */ Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/ia64/ia64/interrupt.c Thu Aug 13 17:09:45 2009 (r196196) @@ -145,6 +145,8 @@ interrupt(struct trapframe *tf) /* * Handle ExtINT interrupts by generating an INTA cycle to * read the vector. + * IPI_STOP_HARD is mapped to IPI_STOP so it is not necessary + * to add it to this switch-like construct. */ if (vector == 0) { inta = ib->ib_inta; Modified: head/sys/ia64/include/smp.h ============================================================================== --- head/sys/ia64/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/ia64/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -21,6 +21,7 @@ #define IPI_AST 4 #define IPI_RENDEZVOUS 5 #define IPI_STOP 6 +#define IPI_STOP_HARD 6 #define IPI_PREEMPT 7 #define IPI_COUNT 8 Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/kern/kern_shutdown.c Thu Aug 13 17:09:45 2009 (r196196) @@ -412,9 +412,6 @@ boot(int howto) */ EVENTHANDLER_INVOKE(shutdown_post_sync, howto); - /* XXX This doesn't disable interrupts any more. Reconsider? */ - splhigh(); - if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold && !dumping) doadump(); @@ -488,6 +485,13 @@ static void shutdown_reset(void *junk, int howto) { + /* + * Disable interrupts on CPU0 in order to avoid fast handlers + * to preempt the stopping process and to deadlock against other + * CPUs. + */ + spinlock_enter(); + printf("Rebooting...\n"); DELAY(1000000); /* wait 1 sec for printf's to complete and be read */ /* cpu_boot(howto); */ /* doesn't do anything at the moment */ Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/kern/subr_kdb.c Thu Aug 13 17:09:45 2009 (r196196) @@ -88,7 +88,8 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_c * Flag indicating whether or not to IPI the other CPUs to stop them on * entering the debugger. Sometimes, this will result in a deadlock as * stop_cpus() waits for the other cpus to stop, so we allow it to be - * disabled. + * disabled. In order to maximize the chances of success, use a hard + * stop for that. */ #ifdef SMP static int kdb_stop_cpus = 1; @@ -226,7 +227,7 @@ kdb_panic(const char *msg) { #ifdef SMP - stop_cpus(PCPU_GET(other_cpus)); + stop_cpus_hard(PCPU_GET(other_cpus)); #endif printf("KDB: panic\n"); panic(msg); @@ -518,7 +519,7 @@ kdb_trap(int type, int code, struct trap #ifdef SMP if ((did_stop_cpus = kdb_stop_cpus) != 0) - stop_cpus(PCPU_GET(other_cpus)); + stop_cpus_hard(PCPU_GET(other_cpus)); #endif kdb_active++; Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/kern/subr_smp.c Thu Aug 13 17:09:45 2009 (r196196) @@ -233,18 +233,21 @@ forward_roundrobin(void) * XXX FIXME: this is not MP-safe, needs a lock to prevent multiple CPUs * from executing at same time. */ -int -stop_cpus(cpumask_t map) +static int +generic_stop_cpus(cpumask_t map, u_int type) { int i; + KASSERT(type == IPI_STOP || type == IPI_STOP_HARD, + ("%s: invalid stop type", __func__)); + if (!smp_started) return 0; - CTR1(KTR_SMP, "stop_cpus(%x)", map); + CTR2(KTR_SMP, "stop_cpus(%x) with %u type", map, type); /* send the stop IPI to all CPUs in map */ - ipi_selected(map, IPI_STOP); + ipi_selected(map, type); i = 0; while ((stopped_cpus & map) != map) { @@ -262,6 +265,20 @@ stop_cpus(cpumask_t map) return 1; } +int +stop_cpus(cpumask_t map) +{ + + return (generic_stop_cpus(map, IPI_STOP)); +} + +int +stop_cpus_hard(cpumask_t map) +{ + + return (generic_stop_cpus(map, IPI_STOP_HARD)); +} + #if defined(__amd64__) /* * When called the executing CPU will send an IPI to all other CPUs Modified: head/sys/mips/include/smp.h ============================================================================== --- head/sys/mips/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/mips/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -24,6 +24,7 @@ #define IPI_RENDEZVOUS 0x0002 #define IPI_AST 0x0004 #define IPI_STOP 0x0008 +#define IPI_STOP_HARD 0x0008 #ifndef LOCORE Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/mips/mips/mp_machdep.c Thu Aug 13 17:09:45 2009 (r196196) @@ -129,7 +129,12 @@ smp_handle_ipi(struct trapframe *frame) break; case IPI_STOP: - CTR0(KTR_SMP, "IPI_STOP"); + + /* + * IPI_STOP_HARD is mapped to IPI_STOP so it is not + * necessary to add it in the switch. + */ + CTR0(KTR_SMP, "IPI_STOP or IPI_STOP_HARD"); atomic_set_int(&stopped_cpus, cpumask); while ((started_cpus & cpumask) == 0) Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/pc98/conf/NOTES Thu Aug 13 17:09:45 2009 (r196196) @@ -29,10 +29,6 @@ device apic # I/O apic # options MP_WATCHDOG -# Debugging options. -# -options STOP_NMI # Stop CPUS using NMI instead of IPI - ##################################################################### Modified: head/sys/powerpc/include/smp.h ============================================================================== --- head/sys/powerpc/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/powerpc/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -35,6 +35,7 @@ #define IPI_PREEMPT 1 #define IPI_RENDEZVOUS 2 #define IPI_STOP 3 +#define IPI_STOP_HARD 3 #ifndef LOCORE Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/powerpc/powerpc/mp_machdep.c Thu Aug 13 17:09:45 2009 (r196196) @@ -281,7 +281,13 @@ powerpc_ipi_handler(void *arg) smp_rendezvous_action(); break; case IPI_STOP: - CTR1(KTR_SMP, "%s: IPI_STOP (stop)", __func__); + + /* + * IPI_STOP_HARD is mapped to IPI_STOP so it is not + * necessary to add such case in the switch. + */ + CTR1(KTR_SMP, "%s: IPI_STOP or IPI_STOP_HARD (stop)", + __func__); self = PCPU_GET(cpumask); savectx(PCPU_GET(curpcb)); atomic_set_int(&stopped_cpus, self); Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/sparc64/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -56,6 +56,7 @@ #define IPI_RENDEZVOUS PIL_RENDEZVOUS #define IPI_PREEMPT PIL_PREEMPT #define IPI_STOP PIL_STOP +#define IPI_STOP_HARD PIL_STOP #define IPI_RETRIES 5000 Modified: head/sys/sun4v/include/smp.h ============================================================================== --- head/sys/sun4v/include/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/sun4v/include/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -44,6 +44,7 @@ #define IPI_AST PIL_AST #define IPI_RENDEZVOUS PIL_RENDEZVOUS #define IPI_STOP PIL_STOP +#define IPI_STOP_HARD PIL_STOP #define IPI_PREEMPT PIL_PREEMPT Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Thu Aug 13 16:08:35 2009 (r196195) +++ head/sys/sys/smp.h Thu Aug 13 17:09:45 2009 (r196196) @@ -123,6 +123,7 @@ void forward_signal(struct thread *); void forward_roundrobin(void); int restart_cpus(cpumask_t); int stop_cpus(cpumask_t); +int stop_cpus_hard(cpumask_t); #if defined(__amd64__) int suspend_cpus(cpumask_t); #endif From owner-svn-src-head@FreeBSD.ORG Thu Aug 13 23:18:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A211106568B; Thu, 13 Aug 2009 23:18:46 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 075288FC5D; Thu, 13 Aug 2009 23:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DNIk3a015605; Thu, 13 Aug 2009 23:18:46 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7DNIjvO015601; Thu, 13 Aug 2009 23:18:45 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908132318.n7DNIjvO015601@svn.freebsd.org> From: Scott Long Date: Thu, 13 Aug 2009 23:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196200 - in head: etc/mtree include sys/dev/mfi usr.sbin usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 23:18:46 -0000 Author: scottl Date: Thu Aug 13 23:18:45 2009 New Revision: 196200 URL: http://svn.freebsd.org/changeset/base/196200 Log: ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell PERC5/6 controllers. Controller, array, and drive status can be checked, basic attributes can be changed, and arrays and spares can be created and deleted. Controller firmware can also be flashed. This does not replace MegaCLI, found in ports, as that is officially sanctioned and supported by LSI and includes vastly more functionality. However, mfiutil is open source and guaranteed to provide basic functionality, which can be especially useful if you have a problem and can't get MegaCLI to work. Approved by: re Obtained from: Yahoo! Inc. Added: head/usr.sbin/mfiutil/ head/usr.sbin/mfiutil/Makefile (contents, props changed) head/usr.sbin/mfiutil/README (contents, props changed) head/usr.sbin/mfiutil/mfi_cmd.c (contents, props changed) head/usr.sbin/mfiutil/mfi_config.c (contents, props changed) head/usr.sbin/mfiutil/mfi_drive.c (contents, props changed) head/usr.sbin/mfiutil/mfi_evt.c (contents, props changed) head/usr.sbin/mfiutil/mfi_flash.c (contents, props changed) head/usr.sbin/mfiutil/mfi_patrol.c (contents, props changed) head/usr.sbin/mfiutil/mfi_show.c (contents, props changed) head/usr.sbin/mfiutil/mfi_volume.c (contents, props changed) head/usr.sbin/mfiutil/mfiutil.1 (contents, props changed) head/usr.sbin/mfiutil/mfiutil.c (contents, props changed) head/usr.sbin/mfiutil/mfiutil.h (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/dev/mfi/mfi_ioctl.h head/sys/dev/mfi/mfireg.h head/usr.sbin/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Aug 13 19:47:13 2009 (r196199) +++ head/etc/mtree/BSD.include.dist Thu Aug 13 23:18:45 2009 (r196200) @@ -104,6 +104,8 @@ .. lmc .. + mfi + .. mpt mpilib .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Thu Aug 13 19:47:13 2009 (r196199) +++ head/include/Makefile Thu Aug 13 23:18:45 2009 (r196200) @@ -40,7 +40,7 @@ LDIRS= bsm cam geom net net80211 netatal LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ - dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/ofw \ + dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ Modified: head/sys/dev/mfi/mfi_ioctl.h ============================================================================== --- head/sys/dev/mfi/mfi_ioctl.h Thu Aug 13 19:47:13 2009 (r196199) +++ head/sys/dev/mfi/mfi_ioctl.h Thu Aug 13 23:18:45 2009 (r196200) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #if defined(__amd64__) /* Assume amd64 wants 32 bit Linux */ struct iovec32 { u_int32_t iov_base; Modified: head/sys/dev/mfi/mfireg.h ============================================================================== --- head/sys/dev/mfi/mfireg.h Thu Aug 13 19:47:13 2009 (r196199) +++ head/sys/dev/mfi/mfireg.h Thu Aug 13 23:18:45 2009 (r196200) @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); #define MFI_ODCR0 0xa0 /* outbound doorbell clear register0 */ #define MFI_OSP0 0xb0 /* outbound scratch pad0 */ #define MFI_1078_EIM 0x80000004 /* 1078 enable intrrupt mask */ -#define MFI_RMI 0x2 /* reply message interrupt */ +#define MFI_RMI 0x2 /* reply message interrupt */ #define MFI_1078_RM 0x80000000 /* reply 1078 message interrupt */ #define MFI_ODC 0x4 /* outbound doorbell change interrupt */ @@ -151,15 +151,41 @@ typedef enum { MFI_DCMD_CTRL_EVENT_GETINFO = 0x01040100, MFI_DCMD_CTRL_EVENT_GET = 0x01040300, MFI_DCMD_CTRL_EVENT_WAIT = 0x01040500, + MFI_DCMD_PR_GET_STATUS = 0x01070100, + MFI_DCMD_PR_GET_PROPERTIES = 0x01070200, + MFI_DCMD_PR_SET_PROPERTIES = 0x01070300, + MFI_DCMD_PR_START = 0x01070400, + MFI_DCMD_PR_STOP = 0x01070500, + MFI_DCMD_TIME_SECS_GET = 0x01080201, + MFI_DCMD_FLASH_FW_OPEN = 0x010f0100, + MFI_DCMD_FLASH_FW_DOWNLOAD = 0x010f0200, + MFI_DCMD_FLASH_FW_FLASH = 0x010f0300, + MFI_DCMD_FLASH_FW_CLOSE = 0x010f0400, + MFI_DCMD_PD_GET_LIST = 0x02010000, + MFI_DCMD_PD_GET_INFO = 0x02020000, + MFI_DCMD_PD_STATE_SET = 0x02030100, + MFI_DCMD_PD_REBUILD_START = 0x02040100, + MFI_DCMD_PD_REBUILD_ABORT = 0x02040200, + MFI_DCMD_PD_CLEAR_START = 0x02050100, + MFI_DCMD_PD_CLEAR_ABORT = 0x02050200, + MFI_DCMD_PD_GET_PROGRESS = 0x02060000, + MFI_DCMD_PD_LOCATE_START = 0x02070100, + MFI_DCMD_PD_LOCATE_STOP = 0x02070200, MFI_DCMD_LD_GET_LIST = 0x03010000, MFI_DCMD_LD_GET_INFO = 0x03020000, MFI_DCMD_LD_GET_PROP = 0x03030000, MFI_DCMD_LD_SET_PROP = 0x03040000, + MFI_DCMD_LD_INIT_START = 0x03060100, MFI_DCMD_LD_DELETE = 0x03090000, MFI_DCMD_CFG_READ = 0x04010000, MFI_DCMD_CFG_ADD = 0x04020000, MFI_DCMD_CFG_CLEAR = 0x04030000, + MFI_DCMD_CFG_MAKE_SPARE = 0x04040000, + MFI_DCMD_CFG_REMOVE_SPARE = 0x04050000, MFI_DCMD_CFG_FOREIGN_IMPORT = 0x04060400, + MFI_DCMD_BBU_GET_STATUS = 0x05010000, + MFI_DCMD_BBU_GET_CAPACITY_INFO =0x05020000, + MFI_DCMD_BBU_GET_DESIGN_INFO = 0x05030000, MFI_DCMD_CLUSTER = 0x08000000, MFI_DCMD_CLUSTER_RESET_ALL = 0x08010100, MFI_DCMD_CLUSTER_RESET_LD = 0x08010200 @@ -245,6 +271,9 @@ typedef enum { MFI_STAT_RESERVATION_IN_PROGRESS, MFI_STAT_I2C_ERRORS_DETECTED, MFI_STAT_PCI_ERRORS_DETECTED, + MFI_STAT_DIAG_FAILED, + MFI_STAT_BOOT_MSG_PENDING, + MFI_STAT_FOREIGN_CONFIG_INCOMPLETE, MFI_STAT_INVALID_STATUS = 0xFF } mfi_status_t; @@ -303,6 +332,17 @@ typedef enum { MR_LD_CACHE_ALLOW_WRITE_CACHE = 0x20, MR_LD_CACHE_ALLOW_READ_CACHE = 0x40 } mfi_ld_cache; +#define MR_LD_CACHE_MASK 0x7f + +#define MR_LD_CACHE_POLICY_READ_AHEAD_NONE 0 +#define MR_LD_CACHE_POLICY_READ_AHEAD_ALWAYS MR_LD_CACHE_READ_AHEAD +#define MR_LD_CACHE_POLICY_READ_AHEAD_ADAPTIVE \ + (MR_LD_CACHE_READ_AHEAD | MR_LD_CACHE_READ_ADAPTIVE) +#define MR_LD_CACHE_POLICY_WRITE_THROUGH 0 +#define MR_LD_CACHE_POLICY_WRITE_BACK MR_LD_CACHE_WRITE_BACK +#define MR_LD_CACHE_POLICY_IO_CACHED \ + (MR_LD_CACHE_ALLOW_WRITE_CACHE | MR_LD_CACHE_ALLOW_READ_CACHE) +#define MR_LD_CACHE_POLICY_IO_DIRECT 0 typedef enum { MR_PD_CACHE_UNCHANGED = 0, @@ -320,6 +360,7 @@ typedef enum { #define MFI_DEFAULT_ID -1 #define MFI_MAX_LUN 8 #define MFI_MAX_LD 64 +#define MFI_MAX_PD 256 #define MFI_FRAME_SIZE 64 #define MFI_MBOX_SIZE 12 @@ -866,12 +907,10 @@ union mfi_pd_ddf_type { } __packed; struct mfi_pd_progress { - struct { - uint32_t rbld : 1; - uint32_t patrol : 1; - uint32_t clear : 1; - uint32_t reserved: 29; - } active; + uint32_t active; +#define MFI_PD_PROGRESS_REBUILD (1<<0) +#define MFI_PD_PROGRESS_PATROL (1<<1) +#define MFI_PD_PROGRESS_CLEAR (1<<2) struct mfi_progress rbld; struct mfi_progress patrol; struct mfi_progress clear; @@ -890,8 +929,8 @@ struct mfi_pd_info { uint32_t other_err_count; uint32_t pred_fail_count; uint32_t last_pred_fail_event_seq_num; - uint16_t fw_state; - uint8_t disable_for_removal; + uint16_t fw_state; /* MFI_PD_STATE_* */ + uint8_t disabled_for_removal; uint8_t link_speed; union mfi_pd_ddf_type state; struct { @@ -918,7 +957,7 @@ struct mfi_pd_address { uint16_t encl_device_id; uint8_t encl_index; uint8_t slot_number; - uint8_t scsi_dev_type; + uint8_t scsi_dev_type; /* 0 = disk */ uint8_t connect_port_bitmap; uint64_t sas_addr[2]; } __packed; @@ -926,12 +965,19 @@ struct mfi_pd_address { struct mfi_pd_list { uint32_t size; uint32_t count; - uint8_t data; - /* - struct mfi_pd_address addr[]; - */ + struct mfi_pd_address addr[0]; } __packed; +enum mfi_pd_state { + MFI_PD_STATE_UNCONFIGURED_GOOD = 0x00, + MFI_PD_STATE_UNCONFIGURED_BAD = 0x01, + MFI_PD_STATE_HOT_SPARE = 0x02, + MFI_PD_STATE_OFFLINE = 0x10, + MFI_PD_STATE_FAILED = 0x11, + MFI_PD_STATE_REBUILD = 0x14, + MFI_PD_STATE_ONLINE = 0x18 +}; + union mfi_ld_ref { struct { uint8_t target_id; @@ -986,6 +1032,9 @@ struct mfi_ld_params { uint8_t span_depth; uint8_t state; uint8_t init_state; +#define MFI_LD_PARAMS_INIT_NO 0 +#define MFI_LD_PARAMS_INIT_QUICK 1 +#define MFI_LD_PARAMS_INIT_FULL 2 uint8_t is_consistent; uint8_t reserved[23]; } __packed; @@ -995,7 +1044,7 @@ struct mfi_ld_progress { #define MFI_LD_PROGRESS_CC (1<<0) #define MFI_LD_PROGRESS_BGI (1<<1) #define MFI_LD_PROGRESS_FGI (1<<2) -#define MFI_LD_PORGRESS_RECON (1<<3) +#define MFI_LD_PROGRESS_RECON (1<<3) struct mfi_progress cc; struct mfi_progress bgi; struct mfi_progress fgi; @@ -1028,26 +1077,18 @@ struct mfi_ld_info { uint8_t reserved2[16]; } __packed; -union mfi_spare_type { - struct { - uint8_t is_dedicate :1; - uint8_t is_revertable :1; - uint8_t is_encl_affinity :1; - uint8_t reserved :5; - } v; - uint8_t type; -} __packed; - #define MAX_ARRAYS 16 struct mfi_spare { union mfi_pd_ref ref; - union mfi_spare_type spare_type; + uint8_t spare_type; +#define MFI_SPARE_DEDICATED (1 << 0) +#define MFI_SPARE_REVERTIBLE (1 << 1) +#define MFI_SPARE_ENCL_AFFINITY (1 << 2) uint8_t reserved[2]; uint8_t array_count; - uint16_t array_refd[MAX_ARRAYS]; + uint16_t array_ref[MAX_ARRAYS]; } __packed; -#define MAX_ROW_SIZE 32 struct mfi_array { uint64_t size; uint8_t num_drives; @@ -1055,13 +1096,13 @@ struct mfi_array { uint16_t array_ref; uint8_t pad[20]; struct { - union mfi_pd_ref ref; - uint16_t fw_state; + union mfi_pd_ref ref; /* 0xffff == missing drive */ + uint16_t fw_state; /* MFI_PD_STATE_* */ struct { uint8_t pd; uint8_t slot; } encl; - } pd[MAX_ROW_SIZE]; + } pd[0]; } __packed; struct mfi_config_data { @@ -1073,13 +1114,117 @@ struct mfi_config_data { uint16_t spares_count; uint16_t spares_size; uint8_t reserved[16]; - uint8_t data; - /* - struct mfi_array array[]; - struct mfi_ld_config ld[]; - struct mfi_spare spare[]; - */ -} __packed; + struct mfi_array array[0]; + struct mfi_ld_config ld[0]; + struct mfi_spare spare[0]; +} __packed; + +struct mfi_bbu_capacity_info { + uint16_t relative_charge; + uint16_t absolute_charge; + uint16_t remaining_capacity; + uint16_t full_charge_capacity; + uint16_t run_time_to_empty; + uint16_t average_time_to_empty; + uint16_t average_time_to_full; + uint16_t cycle_count; + uint16_t max_error; + uint16_t remaining_capacity_alarm; + uint16_t remaining_time_alarm; + uint8_t reserved[26]; +} __packed; + +struct mfi_bbu_design_info { + uint32_t mfg_date; + uint16_t design_capacity; + uint16_t design_voltage; + uint16_t spec_info; + uint16_t serial_number; + uint16_t pack_stat_config; + uint8_t mfg_name[12]; + uint8_t device_name[8]; + uint8_t device_chemistry[8]; + uint8_t mfg_data[8]; + uint8_t reserved[17]; +} __packed; + +struct mfi_ibbu_state { + uint16_t gas_guage_status; + uint16_t relative_charge; + uint16_t charger_system_state; + uint16_t charger_system_ctrl; + uint16_t charging_current; + uint16_t absolute_charge; + uint16_t max_error; + uint8_t reserved[18]; +} __packed; + +struct mfi_bbu_state { + uint16_t gas_guage_status; + uint16_t relative_charge; + uint16_t charger_status; + uint16_t remaining_capacity; + uint16_t full_charge_capacity; + uint8_t is_SOH_good; + uint8_t reserved[21]; +} __packed; + +union mfi_bbu_status_detail { + struct mfi_ibbu_state ibbu; + struct mfi_bbu_state bbu; +}; + +struct mfi_bbu_status { + uint8_t battery_type; +#define MFI_BBU_TYPE_NONE 0 +#define MFI_BBU_TYPE_IBBU 1 +#define MFI_BBU_TYPE_BBU 2 + uint8_t reserved; + uint16_t voltage; + int16_t current; + uint16_t temperature; + uint32_t fw_status; +#define MFI_BBU_STATE_PACK_MISSING (1 << 0) +#define MFI_BBU_STATE_VOLTAGE_LOW (1 << 1) +#define MFI_BBU_STATE_TEMPERATURE_HIGH (1 << 2) +#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 0) +#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 0) + uint8_t pad[20]; + union mfi_bbu_status_detail detail; +} __packed; + +enum mfi_pr_state { + MFI_PR_STATE_STOPPED = 0, + MFI_PR_STATE_READY = 1, + MFI_PR_STATE_ACTIVE = 2, + MFI_PR_STATE_ABORTED = 0xff +}; + +struct mfi_pr_status { + uint32_t num_iteration; + uint8_t state; + uint8_t num_pd_done; + uint8_t reserved[10]; +}; + +enum mfi_pr_opmode { + MFI_PR_OPMODE_AUTO = 0, + MFI_PR_OPMODE_MANUAL = 1, + MFI_PR_OPMODE_DISABLED = 2 +}; + +struct mfi_pr_properties { + uint8_t op_mode; + uint8_t max_pd; + uint8_t reserved; + uint8_t exclude_ld_count; + uint16_t excluded_ld[MFI_MAX_LD]; + uint8_t cur_pd_map[MFI_MAX_PD / 8]; + uint8_t last_pd_map[MFI_MAX_PD / 8]; + uint32_t next_exec; + uint32_t exec_freq; + uint32_t clear_freq; +}; #define MFI_SCSI_MAX_TARGETS 128 #define MFI_SCSI_MAX_LUNS 8 Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Aug 13 19:47:13 2009 (r196199) +++ head/usr.sbin/Makefile Thu Aug 13 23:18:45 2009 (r196200) @@ -94,6 +94,7 @@ SUBDIR= ${_ac} \ manctl \ memcontrol \ mergemaster \ + mfiutil \ mixer \ ${_mld6query} \ mlxcontrol \ Added: head/usr.sbin/mfiutil/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mfiutil/Makefile Thu Aug 13 23:18:45 2009 (r196200) @@ -0,0 +1,17 @@ +# $FreeBSD$ +PROG= mfiutil + +SRCS= mfiutil.c mfi_cmd.c mfi_config.c mfi_drive.c mfi_evt.c mfi_flash.c \ + mfi_patrol.c mfi_show.c mfi_volume.c + +CFLAGS+= -fno-builtin-strftime +WARNS?=3 + +LDADD= -lutil + +# Here be dragons +.ifdef DEBUG +CFLAGS+= -DDEBUG +.endif + +.include Added: head/usr.sbin/mfiutil/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mfiutil/README Thu Aug 13 23:18:45 2009 (r196200) @@ -0,0 +1,104 @@ +# $FreeBSD$ + +This package includes a mfiutil command for administering mfi(4) controllers +on FreeBSD. + +Version 1.0.13 + * Cleaned up warnings in preparation for integration with FreeBSD + +Version 1.0.12 + * Add 'drive clear' command to wipe drives with all 0x00 characters + +Version 1.0.11 + * Display serial number for drives + * Display location info for drives with 'show config' + +Version 1.0.10 + * Display min and max stripe size supported by adapters. + * Added support for examining the controller event log. + +Version 1.0.9 + * Display stripe size for volumes. + * Added support for setting the stripe size for new volumes. + * Fix a regression in 1.0.8 that broke creation of RAID-5 and RAID-50 + arrays. + +Version 1.0.8 + * Added support for RAID-60 arrays. + * Added 'flash' command to support firmware flashing. + +Version 1.0.7 + * Renamed 'clear config' to 'clear, 'create volume' to 'create', + 'delete volume' to 'delete', 'create spare' to 'add', and + 'delete spare' to 'remove'. The old names still work. + * Added support for RAID-6 arrays. + +Version 1.0.6 + * Added 'show patrol', 'patrol', 'start patrol', and 'stop patrol' + commands to manage patrol reads. + +Version 1.0.5 + * Added 'create volume' and 'delete volume' commands to manage volumes. + * Added 'clear config' command to clear entire configuration. + * Added more detailed error reporting based on firmware status codes. + * Renamed 'progress' command to 'drive progress'. + * Added 'volume progress' command to display progress of volume-level + activites such as background inits. + * Fixed 'create spare' to properly add global spares. + +Version 1.0.4 + * Added 'create spare' and 'delete spare' commands to manage hot spares. + * Added 'good' command to mark unconfigured bad drives as good. + * Display more information about hot spares in 'show config' + * Allow physical drives to be specified via Exx:Syy similar to megacli + * Display onboard memory size in 'show adapter' + +Version 1.0.3 + * Added 'cache' command to manage cache settings for volumes. + * Added 'name' command to name volumes. + * Added manpage. + +Version 1.0.2 + * Added 'show adapter' and 'show battery' commands. + * Added RAID level of volumes to 'show config' and 'show volumes'. + * Added drive model info to 'show config' and 'show drives'. + * Added package firmware version to 'show firmware'. + * Added read and write cache status to 'show volumes'. + * Map volume IDs to mfidX device names on newer kernels. + +Version 1.0.1 + * Added 'show firmware' command + +Version 1.0.0 + * Initial release + +usage: mfiutil [-u unit] ... + +Commands include: + version + show adapter - display controller information + show battery - display battery information + show config - display RAID configuration + show drives - list physical drives + show firmware - list firmware images + show volumes - list logical volumes + show patrol - display patrol read status + fail - fail a physical drive + good - mark a bad physical drive as good + rebuild - mark failed drive ready for rebuild + drive progress - display status of active operations + start rebuild + abort rebuild + locate - toggle drive LED + cache [command [setting]] + name + volume progress - display status of active operations + clear - clear volume configuration + create [-v] [,[,...]] [[,[,...]] + delete + add [volume] - add a hot spare + remove - remove a hot spare + patrol [interval [start]] + start patrol - start a patrol read + stop patrol - stop a patrol read + flash Added: head/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mfiutil/mfi_cmd.c Thu Aug 13 23:18:45 2009 (r196200) @@ -0,0 +1,351 @@ +/*- + * Copyright (c) 2008, 2009 Yahoo!, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * 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 + +#include "mfiutil.h" +#include + +static const char *mfi_status_codes[] = { + "Command completed succesfully", + "Invalid command", + "Invalid DMCD opcode", + "Invalid parameter", + "Invalid Sequence Number", + "Abort isn't possible for the requested command", + "Application 'host' code not found", + "Application in use", + "Application not initialized", + "Array index invalid", + "Array row not empty", + "Configuration resource conflict", + "Device not found", + "Drive too small", + "Flash memory allocation failed", + "Flash download already in progress", + "Flash operation failed", + "Bad flash image", + "Incomplete flash image", + "Flash not open", + "Flash not started", + "Flush failed", + "Specified application doesn't have host-resident code", + "Volume consistency check in progress", + "Volume initialization in progress", + "Volume LBA out of range", + "Maximum number of volumes are already configured", + "Volume is not OPTIMAL", + "Volume rebuild in progress", + "Volume reconstruction in progress", + "Volume RAID level is wrong for requested operation", + "Too many spares assigned", + "Scratch memory not available", + "Error writing MFC data to SEEPROM", + "Required hardware is missing", + "Item not found", + "Volume drives are not within an enclosure", + "Drive clear in progress", + "Drive type mismatch (SATA vs SAS)", + "Patrol read disabled", + "Invalid row index", + "SAS Config - Invalid action", + "SAS Config - Invalid data", + "SAS Config - Invalid page", + "SAS Config - Invalid type", + "SCSI command completed with error", + "SCSI I/O request failed", + "SCSI RESERVATION_CONFLICT", + "One or more flush operations during shutdown failed", + "Firmware time is not set", + "Wrong firmware or drive state", + "Volume is offline", + "Peer controller rejected request", + "Unable to inform peer of communication changes", + "Volume reservation already in progress", + "I2C errors were detected", + "PCI errors occurred during XOR/DMA operation", + "Diagnostics failed", + "Unable to process command as boot messages are pending", + "Foreign configuration is incomplete" +}; + +const char * +mfi_status(u_int status_code) +{ + static char buffer[16]; + + if (status_code == MFI_STAT_INVALID_STATUS) + return ("Invalid status"); + if (status_code < sizeof(mfi_status_codes) / sizeof(char *)) + return (mfi_status_codes[status_code]); + snprintf(buffer, sizeof(buffer), "Status: 0x%02x", status_code); + return (buffer); +} + +const char * +mfi_raid_level(uint8_t primary_level, uint8_t secondary_level) +{ + static char buf[16]; + + switch (primary_level) { + case DDF_RAID0: + return ("RAID-0"); + case DDF_RAID1: + if (secondary_level != 0) + return ("RAID-10"); + else + return ("RAID-1"); + case DDF_RAID1E: + return ("RAID-1E"); + case DDF_RAID3: + return ("RAID-3"); + case DDF_RAID5: + if (secondary_level != 0) + return ("RAID-50"); + else + return ("RAID-5"); + case DDF_RAID5E: + return ("RAID-5E"); + case DDF_RAID5EE: + return ("RAID-5EE"); + case DDF_RAID6: + if (secondary_level != 0) + return ("RAID-60"); + else + return ("RAID-6"); + case DDF_JBOD: + return ("JBOD"); + case DDF_CONCAT: + return ("CONCAT"); + default: + sprintf(buf, "LVL 0x%02x", primary_level); + return (buf); + } +} + +static int +mfi_query_disk(int fd, uint8_t target_id, struct mfi_query_disk *info) +{ + + bzero(info, sizeof(*info)); + info->array_id = target_id; + if (ioctl(fd, MFIIO_QUERY_DISK, info) < 0) + return (-1); + if (!info->present) { + errno = ENXIO; + return (-1); + } + return (0); +} + +const char * +mfi_volume_name(int fd, uint8_t target_id) +{ + static struct mfi_query_disk info; + static char buf[4]; + + if (mfi_query_disk(fd, target_id, &info) < 0) { + snprintf(buf, sizeof(buf), "%d", target_id); + return (buf); + } + return (info.devname); +} + +int +mfi_volume_busy(int fd, uint8_t target_id) +{ + struct mfi_query_disk info; + + /* Assume it isn't mounted if we can't get information. */ + if (mfi_query_disk(fd, target_id, &info) < 0) + return (0); + return (info.open != 0); +} + +/* + * Check if the running kernel supports changing the RAID + * configuration of the mfi controller. + */ +int +mfi_reconfig_supported(void) +{ + char mibname[64]; + size_t len; + int dummy; + + len = sizeof(dummy); + snprintf(mibname, sizeof(mibname), "dev.mfi.%d.delete_busy_volumes", + mfi_unit); + return (sysctlbyname(mibname, &dummy, &len, NULL, 0) == 0); +} + +int +mfi_lookup_volume(int fd, const char *name, uint8_t *target_id) +{ + struct mfi_query_disk info; + struct mfi_ld_list list; + char *cp; + long val; + u_int i; + + /* If it's a valid number, treat it as a raw target ID. */ + val = strtol(name, &cp, 0); + if (*cp == '\0') { + *target_id = val; + return (0); + } + + if (mfi_dcmd_command(fd, MFI_DCMD_LD_GET_LIST, &list, sizeof(list), + NULL, 0, NULL) < 0) + return (-1); + + for (i = 0; i < list.ld_count; i++) { + if (mfi_query_disk(fd, list.ld_list[i].ld.v.target_id, + &info) < 0) + continue; + if (strcmp(name, info.devname) == 0) { + *target_id = list.ld_list[i].ld.v.target_id; + return (0); + } + } + errno = EINVAL; + return (-1); +} + +int +mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize, + uint8_t *mbox, size_t mboxlen, uint8_t *statusp) +{ + struct mfi_ioc_passthru ioc; + struct mfi_dcmd_frame *dcmd; + int r; + + if ((mbox != NULL && (mboxlen == 0 || mboxlen > MFI_MBOX_SIZE)) || + (mbox == NULL && mboxlen != 0)) { + errno = EINVAL; + return (-1); + } + + bzero(&ioc, sizeof(ioc)); + dcmd = &ioc.ioc_frame; + if (mbox) + bcopy(mbox, dcmd->mbox, mboxlen); + dcmd->header.cmd = MFI_CMD_DCMD; + dcmd->header.timeout = 0; + dcmd->header.flags = 0; + dcmd->header.data_len = bufsize; + dcmd->opcode = opcode; + + ioc.buf = buf; + ioc.buf_size = bufsize; + r = ioctl(fd, MFIIO_PASSTHRU, &ioc); + if (r < 0) + return (r); + + if (statusp != NULL) + *statusp = dcmd->header.cmd_status; + else if (dcmd->header.cmd_status != MFI_STAT_OK) { + warnx("Command failed: %s", + mfi_status(dcmd->header.cmd_status)); + errno = EIO; + return (-1); + } + return (0); +} + +int +mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp) +{ + + return (mfi_dcmd_command(fd, MFI_DCMD_CTRL_GETINFO, info, + sizeof(struct mfi_ctrl_info), NULL, 0, statusp)); +} + +int +mfi_open(int unit) +{ + char path[MAXPATHLEN]; + + snprintf(path, sizeof(path), "/dev/mfi%d", unit); + return (open(path, O_RDWR)); +} + +void +mfi_display_progress(const char *label, struct mfi_progress *prog) +{ + uint seconds; + + printf("%s: %.2f%% complete, after %ds", label, + (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds); + if (prog->elapsed_seconds > 10) { + printf(" finished in "); + seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) / + prog->progress - prog->elapsed_seconds; + if (seconds > 3600) + printf("%u:", seconds / 3600); + if (seconds > 60) { + seconds %= 3600; + printf("%02u:%02u", seconds / 60, seconds % 60); + } else + printf("%us", seconds); + } + printf("\n"); +} + +int +mfi_table_handler(struct mfiutil_command **start, struct mfiutil_command **end, + int ac, char **av) +{ + struct mfiutil_command **cmd; + + if (ac < 2) { + warnx("The %s command requires a sub-command.", av[0]); + return (EINVAL); + } + for (cmd = start; cmd < end; cmd++) { + if (strcmp((*cmd)->name, av[1]) == 0) + return ((*cmd)->handler(ac - 1, av + 1)); + } + + warnx("%s is not a valid sub-command of %s.", av[1], av[0]); + return (ENOENT); +} Added: head/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mfiutil/mfi_config.c Thu Aug 13 23:18:45 2009 (r196200) @@ -0,0 +1,1164 @@ +/*- + * Copyright (c) 2008, 2009 Yahoo!, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * 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 +#ifdef DEBUG +#include +#endif +#include +#include +#include +#ifdef DEBUG +#include +#endif +#include +#include +#include +#include +#include "mfiutil.h" + +#ifdef DEBUG +static void dump_config(int fd, struct mfi_config_data *config); +#endif + +static int add_spare(int ac, char **av); +static int remove_spare(int ac, char **av); + +#define powerof2(x) ((((x)-1)&(x))==0) + +static long +dehumanize(const char *value) +{ + char *vtp; + long iv; + + if (value == NULL) + return (0); + iv = strtoq(value, &vtp, 0); + if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { + return (0); + } + switch (vtp[0]) { + case 't': case 'T': + iv *= 1024; + case 'g': case 'G': + iv *= 1024; + case 'm': case 'M': + iv *= 1024; + case 'k': case 'K': + iv *= 1024; + case '\0': + break; + default: + return (0); + } + return (iv); +} +int +mfi_config_read(int fd, struct mfi_config_data **configp) +{ + struct mfi_config_data *config; + uint32_t config_size; + + /* + * Keep fetching the config in a loop until we have a large enough + * buffer to hold the entire configuration. + */ + config = NULL; + config_size = 1024; +fetch: + config = reallocf(config, config_size); + if (config == NULL) + return (-1); + if (mfi_dcmd_command(fd, MFI_DCMD_CFG_READ, config, + config_size, NULL, 0, NULL) < 0) + return (-1); + + if (config->size > config_size) { + config_size = config->size; + goto fetch; + } + + *configp = config; + return (0); +} + +static struct mfi_array * +mfi_config_lookup_array(struct mfi_config_data *config, uint16_t array_ref) +{ + struct mfi_array *ar; + char *p; + int i; + + p = (char *)config->array; + for (i = 0; i < config->array_count; i++) { + ar = (struct mfi_array *)p; + if (ar->array_ref == array_ref) + return (ar); + p += config->array_size; + } + + return (NULL); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 06:00:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFCB106568D; Fri, 14 Aug 2009 06:00:05 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from websrv01.jr-hosting.nl (websrv01.jr-hosting.nl [78.47.69.233]) by mx1.freebsd.org (Postfix) with ESMTP id 2E8A98FC62; Fri, 14 Aug 2009 06:00:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=www.jr-hosting.nl) by websrv01.jr-hosting.nl with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MbpQj-000LSC-0T; Fri, 14 Aug 2009 07:34:21 +0200 Received: from 145.7.91.133 (SquirrelMail authenticated user remko) by www.jr-hosting.nl with HTTP; Fri, 14 Aug 2009 07:34:21 +0200 Message-ID: In-Reply-To: <200908132318.n7DNIjvO015601@svn.freebsd.org> References: <200908132318.n7DNIjvO015601@svn.freebsd.org> Date: Fri, 14 Aug 2009 07:34:21 +0200 From: "Remko Lodder" To: "Scott Long" User-Agent: SquirrelMail/1.4.19 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196200 - in head: etc/mtree include sys/dev/mfi usr.sbin usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: remko@elvandar.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 06:00:05 -0000 On Fri, August 14, 2009 1:18 am, Scott Long wrote: > Author: scottl > Date: Thu Aug 13 23:18:45 2009 > New Revision: 196200 > URL: http://svn.freebsd.org/changeset/base/196200 > > Log: > ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell > PERC5/6 > controllers. Controller, array, and drive status can be checked, basic > attributes can be changed, and arrays and spares can be created and > deleted. > Controller firmware can also be flashed. > > This does not replace MegaCLI, found in ports, as that is officially > sanctioned > and supported by LSI and includes vastly more functionality. However, > mfiutil > is open source and guaranteed to provide basic functionality, which can > be > especially useful if you have a problem and can't get MegaCLI to work. > > Approved by: re > Obtained from: Yahoo! Inc. > Great work! Thanks! Also thanks to Yahoo! Inc.! Cheers, Remko -- /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 09:53:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3BD1106568D; Fri, 14 Aug 2009 09:53:21 +0000 (UTC) (envelope-from danger@rulez.sk) Received: from services.rulez.sk (services.rulez.sk [92.240.234.125]) by mx1.freebsd.org (Postfix) with ESMTP id 68BC98FC41; Fri, 14 Aug 2009 09:53:21 +0000 (UTC) Received: from localhost (services.rulez.sk [92.240.234.125]) by services.rulez.sk (Postfix) with ESMTP id E30F5133446C; Fri, 14 Aug 2009 11:35:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.rulez.sk ([92.240.234.125]) by localhost (services.rulez.sk [92.240.234.125]) (amavisd-new, port 10024) with ESMTP id d4cDsm25U5zN; Fri, 14 Aug 2009 11:35:39 +0200 (CEST) Received: from danger-mbp.local (adsl-dyn219.78-99-59.t-com.sk [78.99.59.219]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: danger@rulez.sk) by services.rulez.sk (Postfix) with ESMTPSA id 1E47A1334445; Fri, 14 Aug 2009 11:35:39 +0200 (CEST) Message-ID: <4A852FDF.5060709@rulez.sk> Date: Fri, 14 Aug 2009 11:35:27 +0200 From: =?UTF-8?B?RGFuaWVsIEdlcsW+bw==?= User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Scott Long References: <200908132318.n7DNIjvO015601@svn.freebsd.org> In-Reply-To: <200908132318.n7DNIjvO015601@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196200 - in head: etc/mtree include sys/dev/mfi usr.sbin usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 09:53:21 -0000 Scott Long wrote: > Author: scottl > Date: Thu Aug 13 23:18:45 2009 > New Revision: 196200 > URL: http://svn.freebsd.org/changeset/base/196200 > > Log: > ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell PERC5/6 > controllers. Controller, array, and drive status can be checked, basic > attributes can be changed, and arrays and spares can be created and deleted. > Controller firmware can also be flashed. > > This does not replace MegaCLI, found in ports, as that is officially sanctioned > and supported by LSI and includes vastly more functionality. However, mfiutil > is open source and guaranteed to provide basic functionality, which can be > especially useful if you have a problem and can't get MegaCLI to work. Is this MFC-able to stable/7 and stable/8? From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 10:09:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906511065690; Fri, 14 Aug 2009 10:09:46 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBDD8FC55; Fri, 14 Aug 2009 10:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EA9k5G028515; Fri, 14 Aug 2009 10:09:46 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EA9k1m028514; Fri, 14 Aug 2009 10:09:46 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200908141009.n7EA9k1m028514@svn.freebsd.org> From: Julian Elischer Date: Fri, 14 Aug 2009 10:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196201 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 10:09:46 -0000 Author: julian Date: Fri Aug 14 10:09:45 2009 New Revision: 196201 URL: http://svn.freebsd.org/changeset/base/196201 Log: Fix ipfw crash on uid or gid check. Receiving any ip packet for which there is no existing socket will crash if ipfw has a uid or gid test rule, as the uid/gid of the non existent owner of said non existent socket is tested. Brooks introduced this error as part of his >16 gids patch. It appears to be a cut-n-paste error from similar code a few lines before. The old code used the 'pcb' variable here, but in the new code that switched the 'inp' variable, which is often NULL and what is tested in the code further up. The rest of the multi-gid patch for ipfw seems solid (and cleaner than previous code). Reviewed by: brooks Approved by: re (rwatson) Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Aug 13 23:18:45 2009 (r196200) +++ head/sys/netinet/ipfw/ip_fw2.c Fri Aug 14 10:09:45 2009 (r196201) @@ -2057,7 +2057,7 @@ check_uidgid(ipfw_insn_u32 *insn, int pr dst_ip, htons(dst_port), wildcard, NULL); if (pcb != NULL) { - *uc = crhold(inp->inp_cred); + *uc = crhold(pcb->inp_cred); *ugid_lookupp = 1; } INP_INFO_RUNLOCK(pi); From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 10:20:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E3BC1065692; Fri, 14 Aug 2009 10:20:34 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id C961B8FC57; Fri, 14 Aug 2009 10:20:33 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id B383F41C6FC; Fri, 14 Aug 2009 12:05:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id J9m6UkKWDJXU; Fri, 14 Aug 2009 12:05:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id B31B941C6F2; Fri, 14 Aug 2009 12:05:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 24E024448EC; Fri, 14 Aug 2009 10:02:15 +0000 (UTC) Date: Fri, 14 Aug 2009 10:02:15 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Scott Long In-Reply-To: <200908132318.n7DNIjvO015601@svn.freebsd.org> Message-ID: <20090814095726.A93661@maildrop.int.zabbadoz.net> References: <200908132318.n7DNIjvO015601@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196200 - in head: etc/mtree include sys/dev/mfi usr.sbin usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 10:20:34 -0000 On Thu, 13 Aug 2009, Scott Long wrote: > Author: scottl > Date: Thu Aug 13 23:18:45 2009 > New Revision: 196200 > URL: http://svn.freebsd.org/changeset/base/196200 > > Log: > ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell PERC5/6 > controllers. Controller, array, and drive status can be checked, basic > attributes can be changed, and arrays and spares can be created and deleted. > Controller firmware can also be flashed. > > This does not replace MegaCLI, found in ports, as that is officially sanctioned > and supported by LSI and includes vastly more functionality. However, mfiutil > is open source and guaranteed to provide basic functionality, which can be > especially useful if you have a problem and can't get MegaCLI to work. > > Approved by: re > Obtained from: Yahoo! Inc. as you noticed already it breaks here on 32bit platforms: /src/usr.sbin/mfiutil/mfi_drive.c: In function 'mfi_lookup_drive': /src/usr.sbin/mfiutil/mfi_drive.c:120: warning: comparison between signed and unsigned struct mfi_pd_list { uint32_t size; uint32_t count; struct mfi_pd_address addr[0]; } __packed; long val; struct mfi_pd_list *list 120 for (val = 0; val < list->count; val++) { long vs uint32_t. -- Bjoern A. Zeeb What was I talking about and who are you again? From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 10:57:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16E67106568C; Fri, 14 Aug 2009 10:57:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 065A68FC43; Fri, 14 Aug 2009 10:57:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EAvSRn029584; Fri, 14 Aug 2009 10:57:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EAvS1P029582; Fri, 14 Aug 2009 10:57:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200908141057.n7EAvS1P029582@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 14 Aug 2009 10:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196203 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 10:57:29 -0000 Author: kib Date: Fri Aug 14 10:57:28 2009 New Revision: 196203 URL: http://svn.freebsd.org/changeset/base/196203 Log: Correctly handle unlock for !MAKEENTRY case, after successfull attempt of lock upgrade cache shall be unlocked from write. Reported by: Lucius Windschuh Reviewed by: kan Approved by: re (rwatson) Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Aug 14 10:25:14 2009 (r196202) +++ head/sys/kern/vfs_cache.c Fri Aug 14 10:57:28 2009 (r196203) @@ -416,7 +416,8 @@ retry_wlocked: if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) cache_zap(dvp->v_cache_dd); dvp->v_cache_dd = NULL; - goto unlock; + CACHE_WUNLOCK(); + return (0); } if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) *vpp = dvp->v_cache_dd->nc_vp; From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 10:57:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D68106568D; Fri, 14 Aug 2009 10:57:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C473D8FC43; Fri, 14 Aug 2009 10:57:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EAvvFq029628; Fri, 14 Aug 2009 10:57:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EAvveO029626; Fri, 14 Aug 2009 10:57:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200908141057.n7EAvveO029626@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 14 Aug 2009 10:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196204 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 10:57:57 -0000 Author: kib Date: Fri Aug 14 10:57:57 2009 New Revision: 196204 URL: http://svn.freebsd.org/changeset/base/196204 Log: Add the address of the lock to the KTR_LOCK trace. Tested by: pho Approved by: re (rwatson) Modified: head/sys/sys/lock.h Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Fri Aug 14 10:57:28 2009 (r196203) +++ head/sys/sys/lock.h Fri Aug 14 10:57:57 2009 (r196204) @@ -155,16 +155,16 @@ struct lock_class { #define LOCK_LOG_LOCK(opname, lo, flags, recurse, file, line) do { \ if (LOCK_LOG_TEST((lo), (flags))) \ - CTR5(KTR_LOCK, opname " (%s) %s r = %d at %s:%d", \ + CTR6(KTR_LOCK, opname " (%s) %s %p r = %d at %s:%d", \ LOCK_CLASS(lo)->lc_name, (lo)->lo_name, \ - (u_int)(recurse), (file), (line)); \ + (lo), (u_int)(recurse), (file), (line)); \ } while (0) #define LOCK_LOG_TRY(opname, lo, flags, result, file, line) do { \ if (LOCK_LOG_TEST((lo), (flags))) \ - CTR5(KTR_LOCK, "TRY_" opname " (%s) %s result=%d at %s:%d",\ + CTR6(KTR_LOCK, "TRY_" opname " (%s) %s %p result=%d at %s:%d",\ LOCK_CLASS(lo)->lc_name, (lo)->lo_name, \ - (u_int)(result), (file), (line)); \ + (lo), (u_int)(result), (file), (line)); \ } while (0) #define LOCK_LOG_INIT(lo, flags) do { \ From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 10:59:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 250B8106568B; Fri, 14 Aug 2009 10:59:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 144E18FC59; Fri, 14 Aug 2009 10:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EAxHtE032023; Fri, 14 Aug 2009 10:59:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EAxHUF032021; Fri, 14 Aug 2009 10:59:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200908141059.n7EAxHUF032021@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 14 Aug 2009 10:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196205 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 10:59:18 -0000 Author: kib Date: Fri Aug 14 10:59:17 2009 New Revision: 196205 URL: http://svn.freebsd.org/changeset/base/196205 Log: In nfs_upgrade_vnlock(), assert that the vnode is locked. It is for all pathes, as far as I see and testing seems to confirm it. Comparision of old_lock with LK_SHARED make sense only if vnode is locked by current thread. When downgrading, pass LK_RETRY to the vn_lock(), since otherwise vn_lock() unlocks the doomed vnode, causing extra unlock. Reported and tested by: pho Approved by: re (rwatson) MFC after: 3 weeks Modified: head/sys/nfsclient/nfs_subs.c Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Fri Aug 14 10:57:57 2009 (r196204) +++ head/sys/nfsclient/nfs_subs.c Fri Aug 14 10:59:17 2009 (r196205) @@ -409,28 +409,25 @@ int nfs_upgrade_vnlock(struct vnode *vp) { int old_lock; - - if ((old_lock = VOP_ISLOCKED(vp)) != LK_EXCLUSIVE) { - if (old_lock == LK_SHARED) { - /* Upgrade to exclusive lock, this might block */ - vn_lock(vp, LK_UPGRADE | LK_RETRY); - } else { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - } + + ASSERT_VOP_LOCKED(vp, "nfs_upgrade_vnlock"); + old_lock = VOP_ISLOCKED(vp); + if (old_lock != LK_EXCLUSIVE) { + KASSERT(old_lock == LK_SHARED, + ("nfs_upgrade_vnlock: wrong old_lock %d", old_lock)); + /* Upgrade to exclusive lock, this might block */ + vn_lock(vp, LK_UPGRADE | LK_RETRY); } - return old_lock; + return (old_lock); } void nfs_downgrade_vnlock(struct vnode *vp, int old_lock) { if (old_lock != LK_EXCLUSIVE) { - if (old_lock == LK_SHARED) { - /* Downgrade from exclusive lock, this might block */ - vn_lock(vp, LK_DOWNGRADE); - } else { - VOP_UNLOCK(vp, 0); - } + KASSERT(old_lock == LK_SHARED, ("wrong old_lock %d", old_lock)); + /* Downgrade from exclusive lock. */ + vn_lock(vp, LK_DOWNGRADE | LK_RETRY); } } From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 11:00:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A6EE106568D; Fri, 14 Aug 2009 11:00:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 600188FC45; Fri, 14 Aug 2009 11:00:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EB0cuF032111; Fri, 14 Aug 2009 11:00:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EB0cnM032109; Fri, 14 Aug 2009 11:00:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200908141100.n7EB0cnM032109@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 14 Aug 2009 11:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196206 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 11:00:38 -0000 Author: kib Date: Fri Aug 14 11:00:38 2009 New Revision: 196206 URL: http://svn.freebsd.org/changeset/base/196206 Log: When a UFS node is truncated to the zero length, e.g. by explicit truncate(2) call, or by being removed or truncated on open, either new softupdate freeblks structure is allocated to track the freed blocks of the node, or truncation is done syncronously when too many SU dependencies are accumulated. The decision does not take into account the allocated freeblks dependencies, allowing workloads that do huge amount of truncations to exhaust the kernel memory. Take the number of allocated freeblks into consideration for softdep_slowdown(). Reported by: pluknet gmail com Diagnosed and tested by: pho Approved by: re (rwatson) MFC after: 1 month Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Aug 14 10:59:17 2009 (r196205) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Aug 14 11:00:38 2009 (r196206) @@ -663,6 +663,8 @@ static int req_clear_inodedeps; /* synce static int req_clear_remove; /* syncer process flush some freeblks */ #define FLUSH_REMOVE 2 #define FLUSH_REMOVE_WAIT 3 +static long num_freeblkdep; /* number of freeblks workitems allocated */ + /* * runtime statistics */ @@ -2223,6 +2225,9 @@ softdep_setup_freeblocks(ip, length, fla freeblks->fb_uid = ip->i_uid; freeblks->fb_previousinum = ip->i_number; freeblks->fb_devvp = ip->i_devvp; + ACQUIRE_LOCK(&lk); + num_freeblkdep++; + FREE_LOCK(&lk); extblocks = 0; if (fs->fs_magic == FS_UFS2_MAGIC) extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); @@ -2815,6 +2820,7 @@ handle_workitem_freeblocks(freeblks, fla ACQUIRE_LOCK(&lk); WORKITEM_FREE(freeblks, D_FREEBLKS); + num_freeblkdep--; FREE_LOCK(&lk); } @@ -5768,7 +5774,8 @@ softdep_slowdown(vp) max_softdeps_hard = max_softdeps * 11 / 10; if (num_dirrem < max_softdeps_hard / 2 && num_inodedep < max_softdeps_hard && - VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps) { + VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps && + num_freeblkdep < max_softdeps_hard) { FREE_LOCK(&lk); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 12:30:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0B0106568E; Fri, 14 Aug 2009 12:30:10 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF338FC67; Fri, 14 Aug 2009 12:30:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7ECUAde034048; Fri, 14 Aug 2009 12:30:10 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7ECUA9I034046; Fri, 14 Aug 2009 12:30:10 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908141230.n7ECUA9I034046@svn.freebsd.org> From: Scott Long Date: Fri, 14 Aug 2009 12:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196211 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 12:30:10 -0000 Author: scottl Date: Fri Aug 14 12:30:10 2009 New Revision: 196211 URL: http://svn.freebsd.org/changeset/base/196211 Log: Fix is 32bit bug missed in testing. Approved by: re Modified: head/usr.sbin/mfiutil/mfi_drive.c Modified: head/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_drive.c Fri Aug 14 11:22:09 2009 (r196210) +++ head/usr.sbin/mfiutil/mfi_drive.c Fri Aug 14 12:30:10 2009 (r196211) @@ -75,8 +75,9 @@ int mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) { struct mfi_pd_list *list; - long val; uint8_t encl, slot; + long val; + u_int i; char *cp; /* Look for a raw device id first. */ @@ -117,15 +118,15 @@ mfi_lookup_drive(int fd, char *drive, ui return (errno); } - for (val = 0; val < list->count; val++) { - if (list->addr[val].scsi_dev_type != 0) + for (i = 0; i < list->count; i++) { + if (list->addr[i].scsi_dev_type != 0) continue; if (((encl == 0xff && - list->addr[val].encl_device_id == 0xffff) || - list->addr[val].encl_index == encl) && - list->addr[val].slot_number == slot) { - *device_id = list->addr[val].device_id; + list->addr[i].encl_device_id == 0xffff) || + list->addr[i].encl_index == encl) && + list->addr[i].slot_number == slot) { + *device_id = list->addr[i].device_id; free(list); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 13:13:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57BD2106568D; Fri, 14 Aug 2009 13:13:13 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 446C98FC57; Fri, 14 Aug 2009 13:13:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EDDDwe034949; Fri, 14 Aug 2009 13:13:13 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EDDDC5034943; Fri, 14 Aug 2009 13:13:13 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200908141313.n7EDDDC5034943@svn.freebsd.org> From: Scott Long Date: Fri, 14 Aug 2009 13:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196212 - in head/usr.sbin: . mptutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 13:13:13 -0000 Author: scottl Date: Fri Aug 14 13:13:12 2009 New Revision: 196212 URL: http://svn.freebsd.org/changeset/base/196212 Log: Add mptutil, a basic utility for managing MPT SCSI/SATA/SAS controllers. Drive and controller status can be reported, basic attributes changed, and arrays and spares can be created and deleted. Approved by: re Obtained from: Yahoo! Inc. Added: head/usr.sbin/mptutil/ head/usr.sbin/mptutil/Makefile (contents, props changed) head/usr.sbin/mptutil/mpt_cam.c (contents, props changed) head/usr.sbin/mptutil/mpt_cmd.c (contents, props changed) head/usr.sbin/mptutil/mpt_config.c (contents, props changed) head/usr.sbin/mptutil/mpt_drive.c (contents, props changed) head/usr.sbin/mptutil/mpt_evt.c (contents, props changed) head/usr.sbin/mptutil/mpt_show.c (contents, props changed) head/usr.sbin/mptutil/mpt_volume.c (contents, props changed) head/usr.sbin/mptutil/mptutil.8 (contents, props changed) head/usr.sbin/mptutil/mptutil.c (contents, props changed) head/usr.sbin/mptutil/mptutil.h (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Aug 14 12:30:10 2009 (r196211) +++ head/usr.sbin/Makefile Fri Aug 14 13:13:12 2009 (r196212) @@ -104,6 +104,7 @@ SUBDIR= ${_ac} \ ${_mount_smbfs} \ ${_moused} \ ${_mptable} \ + mptutil \ mtest \ mtree \ ${_named} \ Added: head/usr.sbin/mptutil/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mptutil/Makefile Fri Aug 14 13:13:12 2009 (r196212) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +PROG= mptutil +SRCS= mptutil.c mpt_cam.c mpt_cmd.c mpt_config.c mpt_drive.c mpt_evt.c \ + mpt_show.c mpt_volume.c +# mpt_flash.c +MAN= mptutil.8 + +WARNS?= 3 + +DPADD+= ${LIBCAM} ${LIBUTIL} +LDADD+= -lcam -lutil + +# Here be dragons +.ifdef DEBUG +CFLAGS+= -DDEBUG +.endif + +.include Added: head/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mptutil/mpt_cam.c Fri Aug 14 13:13:12 2009 (r196212) @@ -0,0 +1,569 @@ +/*- + * Copyright (c) 2008 Yahoo!, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__RCSID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "mptutil.h" + +static int xptfd; + +static int +xpt_open(void) +{ + + if (xptfd == 0) + xptfd = open(XPT_DEVICE, O_RDWR); + return (xptfd); +} + +int +mpt_query_disk(U8 VolumeBus, U8 VolumeID, struct mpt_query_disk *qd) +{ + struct bus_match_pattern *b; + struct periph_match_pattern *p; + struct periph_match_result *r; + union ccb ccb; + size_t bufsize; + int i; + + /* mpt(4) only handles devices on bus 0. */ + if (VolumeBus != 0) + return (ENXIO); + + if (xpt_open() < 0) + return (ENXIO); + + bzero(&ccb, sizeof(ccb)); + + ccb.ccb_h.func_code = XPT_DEV_MATCH; + ccb.ccb_h.path_id = CAM_XPT_PATH_ID; + ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; + + bufsize = sizeof(struct dev_match_result) * 5; + ccb.cdm.num_matches = 0; + ccb.cdm.match_buf_len = bufsize; + ccb.cdm.matches = calloc(1, bufsize); + + bufsize = sizeof(struct dev_match_pattern) * 2; + ccb.cdm.num_patterns = 2; + ccb.cdm.pattern_buf_len = bufsize; + ccb.cdm.patterns = calloc(1, bufsize); + + /* Match mptX bus 0. */ + ccb.cdm.patterns[0].type = DEV_MATCH_BUS; + b = &ccb.cdm.patterns[0].pattern.bus_pattern; + snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); + b->unit_number = mpt_unit; + b->bus_id = 0; + b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; + + /* Look for a "da" device at the specified target and lun. */ + ccb.cdm.patterns[1].type = DEV_MATCH_PERIPH; + p = &ccb.cdm.patterns[1].pattern.periph_pattern; + snprintf(p->periph_name, sizeof(p->periph_name), "da"); + p->target_id = VolumeID; + p->flags = PERIPH_MATCH_NAME | PERIPH_MATCH_TARGET; + + if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { + i = errno; + free(ccb.cdm.matches); + free(ccb.cdm.patterns); + return (i); + } + free(ccb.cdm.patterns); + + if (((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) || + (ccb.cdm.status != CAM_DEV_MATCH_LAST)) { + warnx("mpt_query_disk got CAM error %#x, CDM error %d\n", + ccb.ccb_h.status, ccb.cdm.status); + free(ccb.cdm.matches); + return (EIO); + } + + /* + * We should have exactly 2 matches, 1 for the bus and 1 for + * the peripheral. However, if we only have 1 match and it is + * for the bus, don't print an error message and return + * ENOENT. + */ + if (ccb.cdm.num_matches == 1 && + ccb.cdm.matches[0].type == DEV_MATCH_BUS) { + free(ccb.cdm.matches); + return (ENOENT); + } + if (ccb.cdm.num_matches != 2) { + warnx("mpt_query_disk got %d matches, expected 2", + ccb.cdm.num_matches); + free(ccb.cdm.matches); + return (EIO); + } + if (ccb.cdm.matches[0].type != DEV_MATCH_BUS || + ccb.cdm.matches[1].type != DEV_MATCH_PERIPH) { + warnx("mpt_query_disk got wrong CAM matches"); + free(ccb.cdm.matches); + return (EIO); + } + + /* Copy out the data. */ + r = &ccb.cdm.matches[1].result.periph_result; + snprintf(qd->devname, sizeof(qd->devname), "%s%d", r->periph_name, + r->unit_number); + free(ccb.cdm.matches); + + return (0); +} + +static int +periph_is_volume(CONFIG_PAGE_IOC_2 *ioc2, struct periph_match_result *r) +{ + CONFIG_PAGE_IOC_2_RAID_VOL *vol; + int i; + + if (ioc2 == NULL) + return (0); + vol = ioc2->RaidVolume; + for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { + if (vol->VolumeBus == 0 && vol->VolumeID == r->target_id) + return (1); + } + return (0); +} + +/* Much borrowed from scsireadcapacity() in src/sbin/camcontrol/camcontrol.c. */ +static int +fetch_scsi_capacity(struct cam_device *dev, struct mpt_standalone_disk *disk) +{ + struct scsi_read_capacity_data rcap; + struct scsi_read_capacity_data_long rcaplong; + union ccb *ccb; + int error; + + ccb = cam_getccb(dev); + if (ccb == NULL) + return (ENOMEM); + + /* Zero the rest of the ccb. */ + bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - + sizeof(struct ccb_hdr)); + + scsi_read_capacity(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, &rcap, + SSD_FULL_SIZE, 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (cam_send_ccb(dev, ccb) < 0) { + error = errno; + cam_freeccb(ccb); + return (error); + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_freeccb(ccb); + return (EIO); + } + cam_freeccb(ccb); + + /* + * A last block of 2^32-1 means that the true capacity is over 2TB, + * and we need to issue the long READ CAPACITY to get the real + * capacity. Otherwise, we're all set. + */ + if (scsi_4btoul(rcap.addr) != 0xffffffff) { + disk->maxlba = scsi_4btoul(rcap.addr); + return (0); + } + + /* Zero the rest of the ccb. */ + bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - + sizeof(struct ccb_hdr)); + + scsi_read_capacity_16(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, 0, 0, 0, + &rcaplong, SSD_FULL_SIZE, 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (cam_send_ccb(dev, ccb) < 0) { + error = errno; + cam_freeccb(ccb); + return (error); + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_freeccb(ccb); + return (EIO); + } + cam_freeccb(ccb); + + disk->maxlba = scsi_8btou64(rcaplong.addr); + return (0); +} + +/* Borrowed heavily from scsi_all.c:scsi_print_inquiry(). */ +static void +format_scsi_inquiry(struct mpt_standalone_disk *disk, + struct scsi_inquiry_data *inq_data) +{ + char vendor[16], product[48], revision[16], rstr[12]; + + if (SID_QUAL_IS_VENDOR_UNIQUE(inq_data)) + return; + if (SID_TYPE(inq_data) != T_DIRECT) + return; + if (SID_QUAL(inq_data) != SID_QUAL_LU_CONNECTED) + return; + + cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), + sizeof(vendor)); + cam_strvis(product, inq_data->product, sizeof(inq_data->product), + sizeof(product)); + cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), + sizeof(revision)); + + /* Hack for SATA disks, no idea how to tell speed. */ + if (strcmp(vendor, "ATA") == 0) { + snprintf(disk->inqstring, sizeof(disk->inqstring), + "<%s %s> SATA", product, revision); + return; + } + + switch (SID_ANSI_REV(inq_data)) { + case SCSI_REV_CCS: + strcpy(rstr, "SCSI-CCS"); + break; + case 5: + strcpy(rstr, "SAS"); + break; + default: + snprintf(rstr, sizeof (rstr), "SCSI-%d", + SID_ANSI_REV(inq_data)); + break; + } + snprintf(disk->inqstring, sizeof(disk->inqstring), "<%s %s %s> %s", + vendor, product, revision, rstr); +} + +/* Much borrowed from scsiinquiry() in src/sbin/camcontrol/camcontrol.c. */ +static int +fetch_scsi_inquiry(struct cam_device *dev, struct mpt_standalone_disk *disk) +{ + struct scsi_inquiry_data *inq_buf; + union ccb *ccb; + int error; + + ccb = cam_getccb(dev); + if (ccb == NULL) + return (ENOMEM); + + /* Zero the rest of the ccb. */ + bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - + sizeof(struct ccb_hdr)); + + inq_buf = calloc(1, sizeof(*inq_buf)); + if (inq_buf == NULL) { + cam_freeccb(ccb); + return (ENOMEM); + } + scsi_inquiry(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, (void *)inq_buf, + SHORT_INQUIRY_LENGTH, 0, 0, SSD_FULL_SIZE, 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (cam_send_ccb(dev, ccb) < 0) { + error = errno; + free(inq_buf); + cam_freeccb(ccb); + return (error); + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + free(inq_buf); + cam_freeccb(ccb); + return (EIO); + } + + cam_freeccb(ccb); + format_scsi_inquiry(disk, inq_buf); + free(inq_buf); + return (0); +} + +int +mpt_fetch_disks(int fd, int *ndisks, struct mpt_standalone_disk **disksp) +{ + CONFIG_PAGE_IOC_2 *ioc2; + struct mpt_standalone_disk *disks; + struct bus_match_pattern *b; + struct periph_match_pattern *p; + struct periph_match_result *r; + struct cam_device *dev; + union ccb ccb; + size_t bufsize; + u_int i; + int count; + + if (xpt_open() < 0) + return (ENXIO); + + for (count = 100;; count+= 100) { + /* Try to fetch 'count' disks in one go. */ + bzero(&ccb, sizeof(ccb)); + + ccb.ccb_h.func_code = XPT_DEV_MATCH; + + bufsize = sizeof(struct dev_match_result) * (count + 2); + ccb.cdm.num_matches = 0; + ccb.cdm.match_buf_len = bufsize; + ccb.cdm.matches = calloc(1, bufsize); + + bufsize = sizeof(struct dev_match_pattern) * 2; + ccb.cdm.num_patterns = 2; + ccb.cdm.pattern_buf_len = bufsize; + ccb.cdm.patterns = calloc(1, bufsize); + + /* Match mptX bus 0. */ + ccb.cdm.patterns[0].type = DEV_MATCH_BUS; + b = &ccb.cdm.patterns[0].pattern.bus_pattern; + snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); + b->unit_number = mpt_unit; + b->bus_id = 0; + b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; + + /* Match any "da" peripherals. */ + ccb.cdm.patterns[1].type = DEV_MATCH_PERIPH; + p = &ccb.cdm.patterns[1].pattern.periph_pattern; + snprintf(p->periph_name, sizeof(p->periph_name), "da"); + p->flags = PERIPH_MATCH_NAME; + + if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { + i = errno; + free(ccb.cdm.matches); + free(ccb.cdm.patterns); + return (i); + } + free(ccb.cdm.patterns); + + /* Check for CCB errors. */ + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + free(ccb.cdm.matches); + return (EIO); + } + + /* If we need a longer list, try again. */ + if (ccb.cdm.status == CAM_DEV_MATCH_MORE) { + free(ccb.cdm.matches); + continue; + } + + /* If we got an error, abort. */ + if (ccb.cdm.status != CAM_DEV_MATCH_LAST) { + free(ccb.cdm.matches); + return (EIO); + } + break; + } + + /* + * We should have N + 1 matches, 1 for the bus and 1 for each + * "da" device. + */ + if (ccb.cdm.num_matches < 1) { + warnx("mpt_fetch_disks didn't get any matches"); + free(ccb.cdm.matches); + return (EIO); + } + if (ccb.cdm.matches[0].type != DEV_MATCH_BUS) { + warnx("mpt_fetch_disks got wrong CAM matches"); + free(ccb.cdm.matches); + return (EIO); + } + for (i = 1; i < ccb.cdm.num_matches; i++) { + if (ccb.cdm.matches[i].type != DEV_MATCH_PERIPH) { + warnx("mpt_fetch_disks got wrong CAM matches"); + free(ccb.cdm.matches); + return (EIO); + } + } + + /* Shortcut if we don't have any "da" devices. */ + if (ccb.cdm.num_matches == 1) { + free(ccb.cdm.matches); + *ndisks = 0; + *disksp = NULL; + return (0); + } + + /* + * Some of the "da" peripherals may be for RAID volumes, so + * fetch the IOC 2 page (list of RAID volumes) so we can + * exclude them from the list. + */ + ioc2 = mpt_read_ioc_page(fd, 2, NULL); + disks = calloc(ccb.cdm.num_matches, sizeof(*disks)); + count = 0; + for (i = 1; i < ccb.cdm.num_matches; i++) { + r = &ccb.cdm.matches[i].result.periph_result; + if (periph_is_volume(ioc2, r)) + continue; + disks[count].bus = 0; + disks[count].target = r->target_id; + snprintf(disks[count].devname, sizeof(disks[count].devname), + "%s%d", r->periph_name, r->unit_number); + + dev = cam_open_device(disks[count].devname, O_RDWR); + if (dev != NULL) { + fetch_scsi_capacity(dev, &disks[count]); + fetch_scsi_inquiry(dev, &disks[count]); + cam_close_device(dev); + } + count++; + } + free(ccb.cdm.matches); + free(ioc2); + + *ndisks = count; + *disksp = disks; + return (0); +} + +/* + * Instruct the mpt(4) device to rescan its busses to find new devices + * such as disks whose RAID physdisk page was removed or volumes that + * were created. If id is -1, the entire bus is rescanned. + * Otherwise, only devices at the specified ID are rescanned. If bus + * is -1, then all busses are scanned instead of the specified bus. + * Note that currently, only bus 0 is supported. + */ +int +mpt_rescan_bus(int bus, int id) +{ + struct bus_match_pattern *b; + union ccb ccb; + path_id_t path_id; + size_t bufsize; + + /* mpt(4) only handles devices on bus 0. */ + if (bus != -1 && bus != 0) + return (EINVAL); + + if (xpt_open() < 0) + return (ENXIO); + + /* First, find the path id of bus 0 for this mpt controller. */ + bzero(&ccb, sizeof(ccb)); + + ccb.ccb_h.func_code = XPT_DEV_MATCH; + + bufsize = sizeof(struct dev_match_result) * 1; + ccb.cdm.num_matches = 0; + ccb.cdm.match_buf_len = bufsize; + ccb.cdm.matches = calloc(1, bufsize); + + bufsize = sizeof(struct dev_match_pattern) * 1; + ccb.cdm.num_patterns = 1; + ccb.cdm.pattern_buf_len = bufsize; + ccb.cdm.patterns = calloc(1, bufsize); + + /* Match mptX bus 0. */ + ccb.cdm.patterns[0].type = DEV_MATCH_BUS; + b = &ccb.cdm.patterns[0].pattern.bus_pattern; + snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); + b->unit_number = mpt_unit; + b->bus_id = 0; + b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; + + if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { + free(ccb.cdm.matches); + free(ccb.cdm.patterns); + return (errno); + } + free(ccb.cdm.patterns); + + if (((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) || + (ccb.cdm.status != CAM_DEV_MATCH_LAST)) { + warnx("mpt_rescan_bus got CAM error %#x, CDM error %d\n", + ccb.ccb_h.status, ccb.cdm.status); + free(ccb.cdm.matches); + return (EIO); + } + + /* We should have exactly 1 match for the bus. */ + if (ccb.cdm.num_matches != 1 || + ccb.cdm.matches[0].type != DEV_MATCH_BUS) { + free(ccb.cdm.matches); + return (ENOENT); + } + path_id = ccb.cdm.matches[0].result.bus_result.path_id; + free(ccb.cdm.matches); + + /* Now perform the actual rescan. */ + ccb.ccb_h.path_id = path_id; + if (id == -1) { + ccb.ccb_h.func_code = XPT_SCAN_BUS; + ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; + ccb.ccb_h.timeout = 5000; + } else { + ccb.ccb_h.func_code = XPT_SCAN_LUN; + ccb.ccb_h.target_id = id; + ccb.ccb_h.target_lun = 0; + } + ccb.crcn.flags = CAM_FLAG_NONE; + + /* Run this at a low priority. */ + ccb.ccb_h.pinfo.priority = 5; + + if (ioctl(xptfd, CAMIOCOMMAND, &ccb) == -1) + return (errno); + + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + warnx("mpt_rescan_bus rescan got CAM error %#x\n", + ccb.ccb_h.status & CAM_STATUS_MASK); + return (EIO); + } + + return (0); +} Added: head/usr.sbin/mptutil/mpt_cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mptutil/mpt_cmd.c Fri Aug 14 13:13:12 2009 (r196212) @@ -0,0 +1,639 @@ +/*- + * Copyright (c) 2008 Yahoo!, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__RCSID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "mptutil.h" + +static const char *mpt_ioc_status_codes[] = { + "Success", /* 0x0000 */ + "Invalid function", + "Busy", + "Invalid scatter-gather list", + "Internal error", + "Reserved", + "Insufficient resources", + "Invalid field", + "Invalid state", /* 0x0008 */ + "Operation state not supported", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, /* 0x0010 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, /* 0x0018 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "Invalid configuration action", /* 0x0020 */ + "Invalid configuration type", + "Invalid configuration page", + "Invalid configuration data", + "No configuration defaults", + "Unable to commit configuration change", + NULL, + NULL, + NULL, /* 0x0028 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, /* 0x0030 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, /* 0x0038 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "Recovered SCSI error", /* 0x0040 */ + "Invalid SCSI bus", + "Invalid SCSI target ID", + "SCSI device not there", + "SCSI data overrun", + "SCSI data underrun", + "SCSI I/O error", + "SCSI protocol error", + "SCSI task terminated", /* 0x0048 */ + "SCSI residual mismatch", + "SCSI task management failed", + "SCSI I/O controller terminated", + "SCSI external controller terminated", + "EEDP guard error", + "EEDP reference tag error", + "EEDP application tag error", + NULL, /* 0x0050 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, /* 0x0058 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "SCSI target priority I/O", /* 0x0060 */ + "Invalid SCSI target port", + "Invalid SCSI target I/O index", + "SCSI target aborted", + "No connection retryable", + "No connection", + "FC aborted", + "Invalid FC receive ID", + "FC did invalid", /* 0x0068 */ + "FC node logged out", + "Transfer count mismatch", + "STS data not set", + "FC exchange canceled", + "Data offset error", + "Too much write data", + "IU too short", + "ACK NAK timeout", /* 0x0070 */ + "NAK received", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, /* 0x0078 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "LAN device not found", /* 0x0080 */ + "LAN device failure", + "LAN transmit error", + "LAN transmit aborted", + "LAN receive error", + "LAN receive aborted", + "LAN partial packet", + "LAN canceled", + NULL, /* 0x0088 */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "SAS SMP request failed", /* 0x0090 */ + "SAS SMP data overrun", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "Inband aborted", /* 0x0098 */ + "No inband connection", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "Diagnostic released", /* 0x00A0 */ +}; + +static const char *mpt_raid_action_status_codes[] = { + "Success", + "Invalid action", + "Failure", + "Operation in progress", +}; + +const char * +mpt_ioc_status(U16 IOCStatus) +{ + static char buffer[16]; + + IOCStatus &= MPI_IOCSTATUS_MASK; + if (IOCStatus < sizeof(mpt_ioc_status_codes) / sizeof(char *) && + mpt_ioc_status_codes[IOCStatus] != NULL) + return (mpt_ioc_status_codes[IOCStatus]); + snprintf(buffer, sizeof(buffer), "Status: 0x%04x", IOCStatus); + return (buffer); +} + +const char * +mpt_raid_status(U16 ActionStatus) +{ + static char buffer[16]; + + if (ActionStatus < sizeof(mpt_raid_action_status_codes) / + sizeof(char *)) + return (mpt_raid_action_status_codes[ActionStatus]); + snprintf(buffer, sizeof(buffer), "Status: 0x%04x", ActionStatus); + return (buffer); +} + +const char * +mpt_raid_level(U8 VolumeType) +{ + static char buf[16]; + + switch (VolumeType) { + case MPI_RAID_VOL_TYPE_IS: + return ("RAID-0"); + case MPI_RAID_VOL_TYPE_IM: + return ("RAID-1"); + case MPI_RAID_VOL_TYPE_IME: + return ("RAID-1E"); + case MPI_RAID_VOL_TYPE_RAID_5: + return ("RAID-5"); + case MPI_RAID_VOL_TYPE_RAID_6: + return ("RAID-6"); + case MPI_RAID_VOL_TYPE_RAID_10: + return ("RAID-10"); + case MPI_RAID_VOL_TYPE_RAID_50: + return ("RAID-50"); + default: + sprintf(buf, "LVL 0x%02x", VolumeType); + return (buf); + } +} + +const char * +mpt_volume_name(U8 VolumeBus, U8 VolumeID) +{ + static struct mpt_query_disk info; + static char buf[16]; + + if (mpt_query_disk(VolumeBus, VolumeID, &info) != 0) { + /* + * We only print out the bus number if it is non-zero + * since mpt(4) only supports devices on bus zero + * anyway. + */ + if (VolumeBus == 0) + snprintf(buf, sizeof(buf), "%d", VolumeID); + else + snprintf(buf, sizeof(buf), "%d:%d", VolumeBus, + VolumeID); + return (buf); + } + return (info.devname); +} + +int +mpt_lookup_volume(int fd, const char *name, U8 *VolumeBus, U8 *VolumeID) +{ + CONFIG_PAGE_IOC_2 *ioc2; + CONFIG_PAGE_IOC_2_RAID_VOL *vol; + struct mpt_query_disk info; + char *cp; + long bus, id; + int i; + + /* + * Check for a raw [:] string. If the bus is not + * specified, assume bus 0. + */ + bus = strtol(name, &cp, 0); + if (*cp == ':') { + id = strtol(cp + 1, &cp, 0); + if (*cp == '\0') { + if (bus < 0 || bus > 0xff || id < 0 || id > 0xff) { + errno = EINVAL; + return (-1); + } + *VolumeBus = bus; + *VolumeID = id; + return (0); + } + } else if (*cp == '\0') { + if (bus < 0 || bus > 0xff) { + errno = EINVAL; + return (-1); + } + *VolumeBus = 0; + *VolumeID = bus; + return (0); + } + + ioc2 = mpt_read_ioc_page(fd, 2, NULL); + if (ioc2 == NULL) + return (-1); + + vol = ioc2->RaidVolume; + for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { + if (mpt_query_disk(vol->VolumeBus, vol->VolumeID, &info) != 0) + continue; + if (strcmp(name, info.devname) == 0) { + *VolumeBus = vol->VolumeBus; + *VolumeID = vol->VolumeID; + free(ioc2); + return (0); + } + } + free(ioc2); + errno = EINVAL; + return (-1); +} + +int +mpt_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, + CONFIG_PAGE_HEADER *header, U16 *IOCStatus) +{ + struct mpt_cfg_page_req req; + + if (IOCStatus != NULL) + *IOCStatus = MPI_IOCSTATUS_SUCCESS; + bzero(&req, sizeof(req)); + req.header.PageType = PageType; + req.header.PageNumber = PageNumber; + req.page_address = PageAddress; + if (ioctl(fd, MPTIO_READ_CFG_HEADER, &req) < 0) + return (-1); + if (!IOC_STATUS_SUCCESS(req.ioc_status)) { + if (IOCStatus != NULL) + *IOCStatus = req.ioc_status; + else + warnx("Reading config page header failed: %s", + mpt_ioc_status(req.ioc_status)); + errno = EIO; + return (-1); + } + *header = req.header; + return (0); +} + +void * +mpt_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, + U16 *IOCStatus) +{ + struct mpt_cfg_page_req req; + void *buf; + int save_errno; + + if (IOCStatus != NULL) + *IOCStatus = MPI_IOCSTATUS_SUCCESS; + bzero(&req, sizeof(req)); + req.header.PageType = PageType; + req.header.PageNumber = PageNumber; + req.page_address = PageAddress; + if (ioctl(fd, MPTIO_READ_CFG_HEADER, &req) < 0) + return (NULL); + if (!IOC_STATUS_SUCCESS(req.ioc_status)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 13:13:44 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F54106568E; Fri, 14 Aug 2009 13:13:44 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 06DAC8FC3D; Fri, 14 Aug 2009 13:13:43 +0000 (UTC) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n7EDDdgU070476; Fri, 14 Aug 2009 07:13:39 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A856303.6050000@samsco.org> Date: Fri, 14 Aug 2009 07:13:39 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: =?UTF-8?B?RGFuaWVsIEdlcsW+bw==?= References: <200908132318.n7DNIjvO015601@svn.freebsd.org> <4A852FDF.5060709@rulez.sk> In-Reply-To: <4A852FDF.5060709@rulez.sk> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-65.4 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Scott Long Subject: Re: svn commit: r196200 - in head: etc/mtree include sys/dev/mfi usr.sbin usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 13:13:44 -0000 Daniel Geržo wrote: > Scott Long wrote: >> Author: scottl >> Date: Thu Aug 13 23:18:45 2009 >> New Revision: 196200 >> URL: http://svn.freebsd.org/changeset/base/196200 >> >> Log: >> ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell >> PERC5/6 >> controllers. Controller, array, and drive status can be checked, basic >> attributes can be changed, and arrays and spares can be created and >> deleted. >> Controller firmware can also be flashed. >> This does not replace MegaCLI, found in ports, as that is >> officially sanctioned >> and supported by LSI and includes vastly more functionality. >> However, mfiutil >> is open source and guaranteed to provide basic functionality, which >> can be >> especially useful if you have a problem and can't get MegaCLI to work. > > Is this MFC-able to stable/7 and stable/8? Yes. Scott From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 13:24:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B7DC106568B; Fri, 14 Aug 2009 13:24:44 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A02A8FC45; Fri, 14 Aug 2009 13:24:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EDOi70035236; Fri, 14 Aug 2009 13:24:44 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EDOi2r035234; Fri, 14 Aug 2009 13:24:44 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200908141324.n7EDOi2r035234@svn.freebsd.org> From: Colin Percival Date: Fri, 14 Aug 2009 13:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196213 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 13:24:44 -0000 Author: cperciva Date: Fri Aug 14 13:24:44 2009 New Revision: 196213 URL: http://svn.freebsd.org/changeset/base/196213 Log: Make sysinstall recognize /dev/ada* disk devices. The description string "SATA disk device" reflects the current state of /dev/ada*; this may be changed in the future if other drive types start appearing as /dev/ada*. Submitted by: randi Details about what disks can appear as /dev/ada* supplied by: scottl Approved by: re (rwatson) Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Fri Aug 14 13:13:12 2009 (r196212) +++ head/usr.sbin/sysinstall/devices.c Fri Aug 14 13:24:44 2009 (r196213) @@ -80,6 +80,7 @@ static struct _devname { CDROM("acd%d", "ATAPI/IDE CDROM", 4), DISK("da%d", "SCSI disk device", 16), DISK("ad%d", "ATA/IDE disk device", 16), + DISK("ada%d", "SATA disk device", 16), DISK("ar%d", "ATA/IDE RAID device", 16), DISK("afd%d", "ATAPI/IDE floppy device", 4), DISK("mlxd%d", "Mylex RAID disk", 4), From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 13:27:40 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84729106564A; Fri, 14 Aug 2009 13:27:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 264C28FC59; Fri, 14 Aug 2009 13:27:39 +0000 (UTC) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n7EDRZrN071485; Fri, 14 Aug 2009 07:27:35 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A856647.7030100@samsco.org> Date: Fri, 14 Aug 2009 07:27:35 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Colin Percival References: <200908141324.n7EDOi2r035234@svn.freebsd.org> In-Reply-To: <200908141324.n7EDOi2r035234@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-19.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r196213 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 13:27:40 -0000 Colin Percival wrote: > Author: cperciva > Date: Fri Aug 14 13:24:44 2009 > New Revision: 196213 > URL: http://svn.freebsd.org/changeset/base/196213 > > Log: > Make sysinstall recognize /dev/ada* disk devices. The description string > "SATA disk device" reflects the current state of /dev/ada*; this may be > changed in the future if other drive types start appearing as /dev/ada*. > > Submitted by: randi > Details about what disks can appear as /dev/ada* supplied by: scottl > Approved by: re (rwatson) > > Modified: > head/usr.sbin/sysinstall/devices.c > > Modified: head/usr.sbin/sysinstall/devices.c > ============================================================================== > --- head/usr.sbin/sysinstall/devices.c Fri Aug 14 13:13:12 2009 (r196212) > +++ head/usr.sbin/sysinstall/devices.c Fri Aug 14 13:24:44 2009 (r196213) > @@ -80,6 +80,7 @@ static struct _devname { > CDROM("acd%d", "ATAPI/IDE CDROM", 4), > DISK("da%d", "SCSI disk device", 16), > DISK("ad%d", "ATA/IDE disk device", 16), > + DISK("ada%d", "SATA disk device", 16), > DISK("ar%d", "ATA/IDE RAID device", 16), > DISK("afd%d", "ATAPI/IDE floppy device", 4), > DISK("mlxd%d", "Mylex RAID disk", 4), Note that there's still a possibility that 'ada' will go away in the future. Scott From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 13:34:07 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9F90F10656A4 for ; Fri, 14 Aug 2009 13:34:07 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 3CFCA161209 for ; Fri, 14 Aug 2009 13:34:07 +0000 (UTC) Received: (qmail 68915 invoked from network); 14 Aug 2009 13:34:06 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2009 13:34:06 -0000 Message-ID: <4A8567CE.4010400@freebsd.org> Date: Fri, 14 Aug 2009 06:34:06 -0700 From: Colin Percival User-Agent: Thunderbird 2.0.0.22 (X11/20090808) MIME-Version: 1.0 To: Scott Long References: <200908141324.n7EDOi2r035234@svn.freebsd.org> <4A856647.7030100@samsco.org> In-Reply-To: <4A856647.7030100@samsco.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r196213 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 13:34:07 -0000 Scott Long wrote: > Colin Percival wrote: >> Log: >> Make sysinstall recognize /dev/ada* disk devices. The description >> string >> "SATA disk device" reflects the current state of /dev/ada*; this may be >> changed in the future if other drive types start appearing as >> /dev/ada*. >> Submitted by: randi >> Details about what disks can appear as /dev/ada* supplied by: scottl >> Approved by: re (rwatson) > > Note that there's still a possibility that 'ada' will go away in the > future. Oops. Quite right, I intended to mention both the possibility of more devices appearing as /dev/ada* and also the possibility of fewer devices appearing as /dev/ada*, but I forgot about the second half of that when I sat down to write the commit log. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 18:18:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1932F106568B; Fri, 14 Aug 2009 18:18:52 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 087758FC16; Fri, 14 Aug 2009 18:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EIIphS043808; Fri, 14 Aug 2009 18:18:51 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EIIpxZ043806; Fri, 14 Aug 2009 18:18:51 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <200908141818.n7EIIpxZ043806@svn.freebsd.org> From: Remko Lodder Date: Fri, 14 Aug 2009 18:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196216 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 18:18:52 -0000 Author: remko Date: Fri Aug 14 18:18:51 2009 New Revision: 196216 URL: http://svn.freebsd.org/changeset/base/196216 Log: Remove bogus char cast. PR: 118014 Submitted by: Gardner Bell Approved by: re (rwatson), imp (mentor, implicit) MFC after: immediate Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Fri Aug 14 16:15:18 2009 (r196215) +++ head/usr.sbin/arp/arp.c Fri Aug 14 18:18:51 2009 (r196216) @@ -120,7 +120,7 @@ main(int argc, char *argv[]) int aflag = 0; /* do it for all entries */ while ((ch = getopt(argc, argv, "andfsSi:")) != -1) - switch((char)ch) { + switch(ch) { case 'a': aflag = 1; break; From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 20:03:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1FBC106568B; Fri, 14 Aug 2009 20:03:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DEF88FC51; Fri, 14 Aug 2009 20:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EK3rNv046081; Fri, 14 Aug 2009 20:03:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EK3r82046080; Fri, 14 Aug 2009 20:03:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908142003.n7EK3r82046080@svn.freebsd.org> From: John Baldwin Date: Fri, 14 Aug 2009 20:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196219 - in head/sys: dev/ata dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/quirk dev/usb/serial dev/usb/storage dev/usb/template dev/usb/wlan... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 20:03:53 -0000 Author: jhb Date: Fri Aug 14 20:03:53 2009 New Revision: 196219 URL: http://svn.freebsd.org/changeset/base/196219 Log: Purge mergeinfo from files that were temporarily renamed while USB2 was imported into the tree alongside USB. Approved by: re (mergeinfo blanket) Modified: head/sys/dev/ata/ata-usb.c (props changed) head/sys/dev/sound/usb/uaudio.c (props changed) head/sys/dev/sound/usb/uaudio.h (props changed) head/sys/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/dev/sound/usb/uaudioreg.h (props changed) head/sys/dev/usb/controller/at91dci.c (props changed) head/sys/dev/usb/controller/at91dci.h (props changed) head/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) head/sys/dev/usb/controller/atmegadci.c (props changed) head/sys/dev/usb/controller/atmegadci.h (props changed) head/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) head/sys/dev/usb/controller/ehci.c (props changed) head/sys/dev/usb/controller/ehci.h (props changed) head/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) head/sys/dev/usb/controller/ehci_mbus.c (props changed) head/sys/dev/usb/controller/ehci_pci.c (props changed) head/sys/dev/usb/controller/musb_otg.c (props changed) head/sys/dev/usb/controller/musb_otg.h (props changed) head/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci.c (props changed) head/sys/dev/usb/controller/ohci.h (props changed) head/sys/dev/usb/controller/ohci_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci_pci.c (props changed) head/sys/dev/usb/controller/uhci.c (props changed) head/sys/dev/usb/controller/uhci.h (props changed) head/sys/dev/usb/controller/uhci_pci.c (props changed) head/sys/dev/usb/controller/usb_controller.c (props changed) head/sys/dev/usb/controller/uss820dci.c (props changed) head/sys/dev/usb/controller/uss820dci.h (props changed) head/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) head/sys/dev/usb/input/uhid.c (props changed) head/sys/dev/usb/input/ukbd.c (props changed) head/sys/dev/usb/input/ums.c (props changed) head/sys/dev/usb/input/usb_rdesc.h (props changed) head/sys/dev/usb/misc/udbp.c (props changed) head/sys/dev/usb/misc/udbp.h (props changed) head/sys/dev/usb/misc/ufm.c (props changed) head/sys/dev/usb/net/if_aue.c (props changed) head/sys/dev/usb/net/if_auereg.h (props changed) head/sys/dev/usb/net/if_axe.c (props changed) head/sys/dev/usb/net/if_axereg.h (props changed) head/sys/dev/usb/net/if_cdce.c (props changed) head/sys/dev/usb/net/if_cdcereg.h (props changed) head/sys/dev/usb/net/if_cue.c (props changed) head/sys/dev/usb/net/if_cuereg.h (props changed) head/sys/dev/usb/net/if_kue.c (props changed) head/sys/dev/usb/net/if_kuefw.h (props changed) head/sys/dev/usb/net/if_kuereg.h (props changed) head/sys/dev/usb/net/if_rue.c (props changed) head/sys/dev/usb/net/if_ruereg.h (props changed) head/sys/dev/usb/net/if_udav.c (props changed) head/sys/dev/usb/net/if_udavreg.h (props changed) head/sys/dev/usb/net/usb_ethernet.c (props changed) head/sys/dev/usb/net/usb_ethernet.h (props changed) head/sys/dev/usb/quirk/usb_quirk.c (props changed) head/sys/dev/usb/quirk/usb_quirk.h (props changed) head/sys/dev/usb/serial/u3g.c (props changed) head/sys/dev/usb/serial/uark.c (props changed) head/sys/dev/usb/serial/ubsa.c (props changed) head/sys/dev/usb/serial/ubser.c (props changed) head/sys/dev/usb/serial/uchcom.c (props changed) head/sys/dev/usb/serial/ucycom.c (props changed) head/sys/dev/usb/serial/ufoma.c (props changed) head/sys/dev/usb/serial/uftdi.c (props changed) head/sys/dev/usb/serial/uftdi_reg.h (props changed) head/sys/dev/usb/serial/ugensa.c (props changed) head/sys/dev/usb/serial/uipaq.c (props changed) head/sys/dev/usb/serial/ulpt.c (props changed) head/sys/dev/usb/serial/umct.c (props changed) head/sys/dev/usb/serial/umodem.c (props changed) head/sys/dev/usb/serial/umoscom.c (props changed) head/sys/dev/usb/serial/uplcom.c (props changed) head/sys/dev/usb/serial/usb_serial.c (props changed) head/sys/dev/usb/serial/usb_serial.h (props changed) head/sys/dev/usb/serial/uslcom.c (props changed) head/sys/dev/usb/serial/uvisor.c (props changed) head/sys/dev/usb/serial/uvscom.c (props changed) head/sys/dev/usb/storage/rio500_usb.h (props changed) head/sys/dev/usb/storage/umass.c (props changed) head/sys/dev/usb/storage/urio.c (props changed) head/sys/dev/usb/storage/ustorage_fs.c (props changed) head/sys/dev/usb/template/usb_template.c (props changed) head/sys/dev/usb/template/usb_template.h (props changed) head/sys/dev/usb/template/usb_template_cdce.c (props changed) head/sys/dev/usb/template/usb_template_msc.c (props changed) head/sys/dev/usb/template/usb_template_mtp.c (props changed) head/sys/dev/usb/ufm_ioctl.h (props changed) head/sys/dev/usb/usb.h (props changed) head/sys/dev/usb/usb_bus.h (props changed) head/sys/dev/usb/usb_busdma.c (props changed) head/sys/dev/usb/usb_busdma.h (props changed) head/sys/dev/usb/usb_cdc.h (props changed) head/sys/dev/usb/usb_compat_linux.c (props changed) head/sys/dev/usb/usb_compat_linux.h (props changed) head/sys/dev/usb/usb_controller.h (props changed) head/sys/dev/usb/usb_core.c (props changed) head/sys/dev/usb/usb_core.h (props changed) head/sys/dev/usb/usb_debug.c (props changed) head/sys/dev/usb/usb_debug.h (props changed) head/sys/dev/usb/usb_dev.c (props changed) head/sys/dev/usb/usb_dev.h (props changed) head/sys/dev/usb/usb_device.c (props changed) head/sys/dev/usb/usb_device.h (props changed) head/sys/dev/usb/usb_dynamic.c (props changed) head/sys/dev/usb/usb_dynamic.h (props changed) head/sys/dev/usb/usb_endian.h (props changed) head/sys/dev/usb/usb_error.c (props changed) head/sys/dev/usb/usb_generic.c (props changed) head/sys/dev/usb/usb_generic.h (props changed) head/sys/dev/usb/usb_handle_request.c (props changed) head/sys/dev/usb/usb_hid.c (props changed) head/sys/dev/usb/usb_hub.c (props changed) head/sys/dev/usb/usb_hub.h (props changed) head/sys/dev/usb/usb_if.m (props changed) head/sys/dev/usb/usb_ioctl.h (props changed) head/sys/dev/usb/usb_lookup.c (props changed) head/sys/dev/usb/usb_mbuf.c (props changed) head/sys/dev/usb/usb_mbuf.h (props changed) head/sys/dev/usb/usb_msctest.c (props changed) head/sys/dev/usb/usb_msctest.h (props changed) head/sys/dev/usb/usb_parse.c (props changed) head/sys/dev/usb/usb_pci.h (props changed) head/sys/dev/usb/usb_process.c (props changed) head/sys/dev/usb/usb_process.h (props changed) head/sys/dev/usb/usb_request.c (props changed) head/sys/dev/usb/usb_request.h (props changed) head/sys/dev/usb/usb_transfer.c (props changed) head/sys/dev/usb/usb_transfer.h (props changed) head/sys/dev/usb/usb_util.c (props changed) head/sys/dev/usb/usb_util.h (props changed) head/sys/dev/usb/usbdevs (props changed) head/sys/dev/usb/usbhid.h (props changed) head/sys/dev/usb/wlan/if_rum.c (props changed) head/sys/dev/usb/wlan/if_rumfw.h (props changed) head/sys/dev/usb/wlan/if_rumreg.h (props changed) head/sys/dev/usb/wlan/if_rumvar.h (props changed) head/sys/dev/usb/wlan/if_ural.c (props changed) head/sys/dev/usb/wlan/if_uralreg.h (props changed) head/sys/dev/usb/wlan/if_uralvar.h (props changed) head/sys/dev/usb/wlan/if_zyd.c (props changed) head/sys/dev/usb/wlan/if_zydfw.h (props changed) head/sys/dev/usb/wlan/if_zydreg.h (props changed) head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (props changed) head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h (props changed) head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 20:35:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04DDE106568F; Fri, 14 Aug 2009 20:35:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E88398FC4D; Fri, 14 Aug 2009 20:35:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EKZgBD046899; Fri, 14 Aug 2009 20:35:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EKZgfS046896; Fri, 14 Aug 2009 20:35:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908142035.n7EKZgfS046896@svn.freebsd.org> From: John Baldwin Date: Fri, 14 Aug 2009 20:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196221 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 20:35:43 -0000 Author: jhb Date: Fri Aug 14 20:35:42 2009 New Revision: 196221 URL: http://svn.freebsd.org/changeset/base/196221 Log: Add the ability to build a release from an SVN checkout instead of a CVS checkout. If SVNROOT is specified, then the source tree will be checked out from that SVN repository instead of using CVS. ports and docs still use CVS. If SVNROOT is not specified, then the source tree will be checked out using CVS. An explicit SVN branch can be specified using SVNBRANCH (e.g. SVNBRANCH=stable/8). If SVNBRANCH is not set but RELEASETAG is set to a CVS branch (such as RELENG_8) the appropriate SVN branch will be inferred from the CVS branch using svnbranch.awk. Note that there are still several open questions about using SVN instead of CVS in the release process. However, this does enable one to build a release from an SVN repository if needed. Approved by: re (kensmith) Added: head/release/svnbranch.awk (contents, props changed) Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Fri Aug 14 20:09:31 2009 (r196220) +++ head/release/Makefile Fri Aug 14 20:35:42 2009 (r196221) @@ -1,7 +1,8 @@ # $FreeBSD$ # # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ -# [RELEASETAG=tag] +# [RELEASETAG=tag] [SVNROOT=svn://svn.freebsd.org/base] \ +# [SVNBRANCH=some/branch] # # Where "/some/dir" is the pathname of a directory on a some filesystem with # at least 1000MB of free space, "somename" is what you want the release to @@ -9,6 +10,11 @@ # which CVS "tag" name should be used when checking out the sources to build # the release (default is HEAD). # +# Please note the support for building from SVN is preliminary and there +# are still questions about things like how to handle updates of +# /usr/src on production systems (csup(1) replacement). It is a work +# in progress and may change as the other issues get worked out. +# # Please note: the md(4) driver must be present in the kernel # (either by being compiled in or available as a kld(4) module), # otherwise the target 'release.8' and possibly others will fail. @@ -49,12 +55,25 @@ BUILDNAME?=${BASE}-${DATE}-SNAP # To add other options to the CVS command, set #CVSARGS="-lfq" # -# To prefix the cvs command +# To prefix the CVS command #CVSPREFIX="/usr/bin/time" # # Where the CVS repository is #CVSROOT="/home/ncvs" # +# To add other options to the Subversion subcommands (co,up), set +#SVNCMDARGS="-r '{ 01/01/2002 00:00:00 UTC }'" +# +# To prefix the Subversion command +#SVNPREFIX="/usr/bin/time" +# +# Where the Subversion repository is +#SVNROOT=svn://svn.freebsd.org/base +# +# Subversion branch to build for src. If this is not set then it is +# automatically computed from RELEASETAG. +#SVNBRANCH=stable/7 +# # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we # are building an official release. Otherwise, we are building for # a branch. @@ -68,6 +87,16 @@ PORTSRELEASETAG?= ${AUXRELEASETAG} .endif .endif +# Determine the Subversion source branch that corresponds to the requested +# RELEASETAG. +.if !defined(SVNBRANCH) +.if defined(RELEASETAG) +SVNBRANCH!= echo "${RELEASETAG}" | awk -f ${.CURDIR}/svnbranch.awk +.else +SVNBRANCH= head +.endif +.endif + # If you want to pass flags to the world build such as -j X, use # WORLD_FLAGS. Similarly, you can specify make flags for kernel # builds via KERNEL_FLAGS. @@ -341,8 +370,17 @@ CVS_PORTSARGS+= -r ${PORTSRELEASETAG} WORLDDIR?= ${.CURDIR}/.. release rerelease: -.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT) - @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false +.if !defined(CHROOTDIR) || !defined(BUILDNAME) + @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false +.endif +.if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT) + @echo "Building ports requires CVSROOT or EXTPORTSDIR" && false +.endif +.if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT) + @echo "Building docs requires CVSROOT or EXTDOCDIR" && false +.endif +.if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT) + @echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false .endif .if defined(NOPORTSATALL) && !defined(NODOC) @echo "Ports are required for building the release docs. Either set NODOC or" @@ -387,6 +425,10 @@ release rerelease: .if defined(EXTSRCDIR) cd ${CHROOTDIR}/usr && \ cp -R -H ${EXTSRCDIR} src +.elif defined(SVNROOT) + cd ${CHROOTDIR}/usr && \ + ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \ + ${RELEASESRCMODULE} .else cd ${CHROOTDIR}/usr && \ ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ @@ -432,7 +474,10 @@ release rerelease: .endif .if make(rerelease) .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR) -.if !defined(RELEASETAG) +.if defined(SVNROOT) + cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \ + ${SVNROOT}/${SVNBRANCH} +.elif !defined(RELEASETAG) cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ update ${CVSCMDARGS} -P -d -A .else Added: head/release/svnbranch.awk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/svnbranch.awk Fri Aug 14 20:35:42 2009 (r196221) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +BEGIN { + FS = "_" +} + +/RELENG_.*_RELEASE/ { + if (NF == 5) { + printf "release/%s.%s.%s", $2, $3, $4 + exit + } +} + +/RELENG_.*/ { + if (NF == 3) { + printf "releng/%s.%s", $2, $3 + exit + } + + if (NF == 2) { + printf "stable/%s", $2 + exit + } +} + +// { + printf "unknown_branch" +} From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 21:05:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 377C2106568C; Fri, 14 Aug 2009 21:05:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 255DE8FC5B; Fri, 14 Aug 2009 21:05:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EL59uh047677; Fri, 14 Aug 2009 21:05:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EL58HV047671; Fri, 14 Aug 2009 21:05:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908142105.n7EL58HV047671@svn.freebsd.org> From: John Baldwin Date: Fri, 14 Aug 2009 21:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196224 - in head/sys: amd64/amd64 amd64/include dev/hwpmc i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 21:05:09 -0000 Author: jhb Date: Fri Aug 14 21:05:08 2009 New Revision: 196224 URL: http://svn.freebsd.org/changeset/base/196224 Log: Adjust the handling of the local APIC PMC interrupt vector: - Provide lapic_disable_pmc(), lapic_enable_pmc(), and lapic_reenable_pmc() routines in the local APIC code that the hwpmc(4) driver can use to manage the local APIC PMC interrupt vector. - Do not enable the local APIC PMC interrupt vector by default when HWPMC_HOOKS is enabled. Instead, the hwpmc(4) driver explicitly enables the interrupt when it is succesfully initialized and disables the interrupt when it is unloaded. This avoids enabling the interrupt on unsupported CPUs which may result in spurious NMIs. Reported by: rnoland Reviewed by: jkoshy Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/amd64/amd64/local_apic.c head/sys/amd64/include/apicvar.h head/sys/amd64/include/pmc_mdep.h head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_piv.c head/sys/dev/hwpmc/hwpmc_ppro.c head/sys/dev/hwpmc/hwpmc_x86.c head/sys/i386/i386/local_apic.c head/sys/i386/include/apicvar.h head/sys/i386/include/pmc_mdep.h Modified: head/sys/amd64/amd64/local_apic.c ============================================================================== --- head/sys/amd64/amd64/local_apic.c Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/amd64/amd64/local_apic.c Fri Aug 14 21:05:08 2009 (r196224) @@ -123,7 +123,7 @@ static struct lvt lvts[LVT_MAX + 1] = { { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* LINT1: NMI */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT }, /* Timer */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_ERROR_INT }, /* Error */ - { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* PMC */ + { 1, 1, 1, 1, APIC_LVT_DM_NMI, 0 }, /* PMC */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_THERMAL_INT }, /* Thermal */ }; @@ -305,11 +305,9 @@ lapic_setup(int boot) lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); -#ifdef HWPMC_HOOKS /* Program the PMC LVT entry if present. */ if (maxlvt >= LVT_PMC) lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); -#endif /* Program timer LVT and setup handler. */ lapic->lvt_timer = lvt_mode(la, LVT_TIMER, lapic->lvt_timer); @@ -332,6 +330,88 @@ lapic_setup(int boot) intr_restore(eflags); } +void +lapic_reenable_pmc(void) +{ +#ifdef HWPMC_HOOKS + uint32_t value; + + value = lapic->lvt_pcint; + value &= ~APIC_LVT_M; + lapic->lvt_pcint = value; +#endif +} + +#ifdef HWPMC_HOOKS +static void +lapic_update_pmc(void *dummy) +{ + struct lapic *la; + + la = &lapics[lapic_id()]; + lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); +} +#endif + +int +lapic_enable_pmc(void) +{ +#ifdef HWPMC_HOOKS + u_int32_t maxlvt; + + /* Fail if the local APIC is not present. */ + if (lapic == NULL) + return (0); + + /* Fail if the PMC LVT is not present. */ + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + if (maxlvt < LVT_PMC) + return (0); + + lvts[LVT_PMC].lvt_masked = 0; + +#ifdef SMP + /* + * If hwpmc was loaded at boot time then the APs may not be + * started yet. In that case, don't forward the request to + * them as they will program the lvt when they start. + */ + if (smp_started) + smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL); + else +#endif + lapic_update_pmc(NULL); + return (1); +#else + return (0); +#endif +} + +void +lapic_disable_pmc(void) +{ +#ifdef HWPMC_HOOKS + u_int32_t maxlvt; + + /* Fail if the local APIC is not present. */ + if (lapic == NULL) + return; + + /* Fail if the PMC LVT is not present. */ + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + if (maxlvt < LVT_PMC) + return; + + lvts[LVT_PMC].lvt_masked = 1; + +#ifdef SMP + /* The APs should always be started when hwpmc is unloaded. */ + KASSERT(mp_ncpus == 1 || smp_started, ("hwpmc unloaded too early")); +#endif + smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL); +#endif +} + /* * Called by cpu_initclocks() on the BSP to setup the local APIC timer so * that it can drive hardclock, statclock, and profclock. This function Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/amd64/include/apicvar.h Fri Aug 14 21:05:08 2009 (r196224) @@ -201,7 +201,9 @@ int ioapic_set_triggermode(void *cookie, int ioapic_set_smi(void *cookie, u_int pin); void lapic_create(u_int apic_id, int boot_cpu); void lapic_disable(void); +void lapic_disable_pmc(void); void lapic_dump(const char *str); +int lapic_enable_pmc(void); void lapic_eoi(void); u_int lapic_error(void); int lapic_id(void); @@ -212,6 +214,7 @@ void lapic_ipi_vectored(u_int vector, in int lapic_ipi_wait(int delay); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); +void lapic_reenable_pmc(void); void lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id); int lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked); int lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode); Modified: head/sys/amd64/include/pmc_mdep.h ============================================================================== --- head/sys/amd64/include/pmc_mdep.h Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/amd64/include/pmc_mdep.h Fri Aug 14 21:05:08 2009 (r196224) @@ -115,7 +115,6 @@ union pmc_md_pmc { */ void start_exceptions(void), end_exceptions(void); -void pmc_x86_lapic_enable_pmc_interrupt(void); struct pmc_mdep *pmc_amd_initialize(void); void pmc_amd_finalize(struct pmc_mdep *_md); Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Aug 14 21:05:08 2009 (r196224) @@ -32,10 +32,13 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include +#include #include #include #include @@ -1771,7 +1774,7 @@ core_intr(int cpu, struct trapframe *tf) } if (found_interrupt) - pmc_x86_lapic_enable_pmc_interrupt(); + lapic_reenable_pmc(); atomic_add_int(found_interrupt ? &pmc_stats.pm_intr_processed : &pmc_stats.pm_intr_ignored, 1); @@ -1895,7 +1898,7 @@ core2_intr(int cpu, struct trapframe *tf (uintmax_t) rdmsr(IA_GLOBAL_OVF_CTRL)); if (found_interrupt) - pmc_x86_lapic_enable_pmc_interrupt(); + lapic_reenable_pmc(); atomic_add_int(found_interrupt ? &pmc_stats.pm_intr_processed : &pmc_stats.pm_intr_ignored, 1); Modified: head/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_piv.c Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/dev/hwpmc/hwpmc_piv.c Fri Aug 14 21:05:08 2009 (r196224) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -39,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -1537,7 +1540,7 @@ p4_intr(int cpu, struct trapframe *tf) */ if (did_interrupt) - pmc_x86_lapic_enable_pmc_interrupt(); + lapic_reenable_pmc(); atomic_add_int(did_interrupt ? &pmc_stats.pm_intr_processed : &pmc_stats.pm_intr_ignored, 1); Modified: head/sys/dev/hwpmc/hwpmc_ppro.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_ppro.c Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/dev/hwpmc/hwpmc_ppro.c Fri Aug 14 21:05:08 2009 (r196224) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -39,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -718,7 +721,7 @@ p6_intr(int cpu, struct trapframe *tf) * unmasked after a PMC interrupt. */ if (retval) - pmc_x86_lapic_enable_pmc_interrupt(); + lapic_reenable_pmc(); atomic_add_int(retval ? &pmc_stats.pm_intr_processed : &pmc_stats.pm_intr_ignored, 1); Modified: head/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_x86.c Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/dev/hwpmc/hwpmc_x86.c Fri Aug 14 21:05:08 2009 (r196224) @@ -39,7 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include #include #include @@ -47,18 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -extern volatile lapic_t *lapic; - -void -pmc_x86_lapic_enable_pmc_interrupt(void) -{ - uint32_t value; - - value = lapic->lvt_pcint; - value &= ~APIC_LVT_M; - lapic->lvt_pcint = value; -} - /* * Attempt to walk a user call stack using a too-simple algorithm. * In the general case we need unwind information associated with @@ -252,16 +241,15 @@ pmc_md_initialize() struct pmc_mdep *md; /* determine the CPU kind */ - md = NULL; if (cpu_vendor_id == CPU_VENDOR_AMD) md = pmc_amd_initialize(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) md = pmc_intel_initialize(); else - KASSERT(0, ("[x86,%d] Unknown vendor", __LINE__)); + return (NULL); /* disallow sampling if we do not have an LAPIC */ - if (md != NULL && lapic == NULL) + if (!lapic_enable_pmc()) for (i = 1; i < md->pmd_nclass; i++) md->pmd_classdep[i].pcd_caps &= ~PMC_CAP_INTERRUPT; @@ -271,6 +259,8 @@ pmc_md_initialize() void pmc_md_finalize(struct pmc_mdep *md) { + + lapic_disable_pmc(); if (cpu_vendor_id == CPU_VENDOR_AMD) pmc_amd_finalize(md); else if (cpu_vendor_id == CPU_VENDOR_INTEL) Modified: head/sys/i386/i386/local_apic.c ============================================================================== --- head/sys/i386/i386/local_apic.c Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/i386/i386/local_apic.c Fri Aug 14 21:05:08 2009 (r196224) @@ -123,7 +123,7 @@ static struct lvt lvts[LVT_MAX + 1] = { { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* LINT1: NMI */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT }, /* Timer */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_ERROR_INT }, /* Error */ - { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* PMC */ + { 1, 1, 1, 1, APIC_LVT_DM_NMI, 0 }, /* PMC */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_THERMAL_INT }, /* Thermal */ }; @@ -307,11 +307,9 @@ lapic_setup(int boot) lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); -#ifdef HWPMC_HOOKS /* Program the PMC LVT entry if present. */ if (maxlvt >= LVT_PMC) lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); -#endif /* Program timer LVT and setup handler. */ lapic->lvt_timer = lvt_mode(la, LVT_TIMER, lapic->lvt_timer); @@ -334,6 +332,88 @@ lapic_setup(int boot) intr_restore(eflags); } +void +lapic_reenable_pmc(void) +{ +#ifdef HWPMC_HOOKS + uint32_t value; + + value = lapic->lvt_pcint; + value &= ~APIC_LVT_M; + lapic->lvt_pcint = value; +#endif +} + +#ifdef HWPMC_HOOKS +static void +lapic_update_pmc(void *dummy) +{ + struct lapic *la; + + la = &lapics[lapic_id()]; + lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); +} +#endif + +int +lapic_enable_pmc(void) +{ +#ifdef HWPMC_HOOKS + u_int32_t maxlvt; + + /* Fail if the local APIC is not present. */ + if (lapic == NULL) + return (0); + + /* Fail if the PMC LVT is not present. */ + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + if (maxlvt < LVT_PMC) + return (0); + + lvts[LVT_PMC].lvt_masked = 0; + +#ifdef SMP + /* + * If hwpmc was loaded at boot time then the APs may not be + * started yet. In that case, don't forward the request to + * them as they will program the lvt when they start. + */ + if (smp_started) + smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL); + else +#endif + lapic_update_pmc(NULL); + return (1); +#else + return (0); +#endif +} + +void +lapic_disable_pmc(void) +{ +#ifdef HWPMC_HOOKS + u_int32_t maxlvt; + + /* Fail if the local APIC is not present. */ + if (lapic == NULL) + return; + + /* Fail if the PMC LVT is not present. */ + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + if (maxlvt < LVT_PMC) + return; + + lvts[LVT_PMC].lvt_masked = 1; + +#ifdef SMP + /* The APs should always be started when hwpmc is unloaded. */ + KASSERT(mp_ncpus == 1 || smp_started, ("hwpmc unloaded too early")); +#endif + smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL); +#endif +} + /* * Called by cpu_initclocks() on the BSP to setup the local APIC timer so * that it can drive hardclock, statclock, and profclock. This function Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/i386/include/apicvar.h Fri Aug 14 21:05:08 2009 (r196224) @@ -230,7 +230,9 @@ int ioapic_set_triggermode(void *cookie, int ioapic_set_smi(void *cookie, u_int pin); void lapic_create(u_int apic_id, int boot_cpu); void lapic_disable(void); +void lapic_disable_pmc(void); void lapic_dump(const char *str); +int lapic_enable_pmc(void); void lapic_eoi(void); u_int lapic_error(void); int lapic_id(void); @@ -241,6 +243,7 @@ void lapic_ipi_vectored(u_int vector, in int lapic_ipi_wait(int delay); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); +void lapic_reenable_pmc(void); void lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id); int lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked); int lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode); Modified: head/sys/i386/include/pmc_mdep.h ============================================================================== --- head/sys/i386/include/pmc_mdep.h Fri Aug 14 20:57:21 2009 (r196223) +++ head/sys/i386/include/pmc_mdep.h Fri Aug 14 21:05:08 2009 (r196224) @@ -150,7 +150,6 @@ struct pmc_mdep; */ void start_exceptions(void), end_exceptions(void); -void pmc_x86_lapic_enable_pmc_interrupt(void); struct pmc_mdep *pmc_amd_initialize(void); void pmc_amd_finalize(struct pmc_mdep *_md); From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 21:46:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94BDF1065695; Fri, 14 Aug 2009 21:46:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A1078FC45; Fri, 14 Aug 2009 21:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7ELksSF048765; Fri, 14 Aug 2009 21:46:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7ELksKZ048760; Fri, 14 Aug 2009 21:46:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908142146.n7ELksKZ048760@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 14 Aug 2009 21:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196226 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 21:46:54 -0000 Author: bz Date: Fri Aug 14 21:46:54 2009 New Revision: 196226 URL: http://svn.freebsd.org/changeset/base/196226 Log: Add a new macro to test that a variable could be loaded atomically. Check that the given variable is at most uintptr_t in size and that it is aligned. Note: ASSERT_ATOMIC_LOAD() uses ALIGN() to check for adequate alignment -- however, the function of ALIGN() is to guarantee alignment, and therefore may lead to stronger alignment enforcement than necessary for types that are smaller than sizeof(uintptr_t). Add checks to mtx, rw and sx locks init functions to detect possible breakage. This was used during debugging of the problem fixed with r196118 where a pointer was on an un-aligned address in the dpcpu area. In collaboration with: rwatson Reviewed by: rwatson Approved by: re (kib) Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/systm.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Aug 14 21:07:41 2009 (r196225) +++ head/sys/kern/kern_mutex.c Fri Aug 14 21:46:54 2009 (r196226) @@ -783,6 +783,8 @@ mtx_init(struct mtx *m, const char *name MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE | MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0); + ASSERT_ATOMIC_LOAD(m->mtx_lock, ("%s: mtx_lock not aligned for %s: %p", + __func__, name, &m->mtx_lock)); #ifdef MUTEX_DEBUG /* Diagnostic and error correction */ Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Fri Aug 14 21:07:41 2009 (r196225) +++ head/sys/kern/kern_rwlock.c Fri Aug 14 21:46:54 2009 (r196226) @@ -174,6 +174,8 @@ rw_init_flags(struct rwlock *rw, const c MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); + ASSERT_ATOMIC_LOAD(rw->rw_lock, ("%s: rw_lock not aligned for %s: %p", + __func__, name, &rw->rw_lock)); flags = LO_UPGRADABLE; if (opts & RW_DUPOK) Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Aug 14 21:07:41 2009 (r196225) +++ head/sys/kern/kern_sx.c Fri Aug 14 21:46:54 2009 (r196226) @@ -205,6 +205,8 @@ sx_init_flags(struct sx *sx, const char MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK | SX_NOPROFILE | SX_NOADAPTIVE)) == 0); + ASSERT_ATOMIC_LOAD(sx->sx_lock, ("%s: sx_lock not aligned for %s: %p", + __func__, description, &sx->sx_lock)); flags = LO_SLEEPABLE | LO_UPGRADABLE; if (opts & SX_DUPOK) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Aug 14 21:07:41 2009 (r196225) +++ head/sys/sys/systm.h Fri Aug 14 21:46:54 2009 (r196226) @@ -89,6 +89,10 @@ extern int maxusers; /* system tune hin #define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] #endif +#define ASSERT_ATOMIC_LOAD(var,msg) \ + KASSERT(sizeof(var) <= sizeof(uintptr_t) && \ + ALIGN(&(var)) == (uintptr_t)&(var), msg) + /* * XXX the hints declarations are even more misplaced than most declarations * in this file, since they are needed in one file (per arch) and only used From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 22:41:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E6A61065672; Fri, 14 Aug 2009 22:41:39 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E14E8FC59; Fri, 14 Aug 2009 22:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EMfdsU050066; Fri, 14 Aug 2009 22:41:39 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EMfdw1050063; Fri, 14 Aug 2009 22:41:39 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908142241.n7EMfdw1050063@svn.freebsd.org> From: Marko Zec Date: Fri, 14 Aug 2009 22:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196228 - in head/sys: conf net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 22:41:39 -0000 Author: zec Date: Fri Aug 14 22:41:39 2009 New Revision: 196228 URL: http://svn.freebsd.org/changeset/base/196228 Log: Make VNET_DEBUG a standalone compile-time option, i.e. decouple it from INVARIANTS. Reviewed by: bz Approved by: re (rwatson), julian (mentor) Modified: head/sys/conf/options head/sys/net/vnet.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Aug 14 21:50:47 2009 (r196227) +++ head/sys/conf/options Fri Aug 14 22:41:39 2009 (r196228) @@ -821,8 +821,9 @@ TDMA_TXRATE_QUARTER_DEFAULT opt_tdma.h TDMA_TXRATE_11NA_DEFAULT opt_tdma.h TDMA_TXRATE_11NG_DEFAULT opt_tdma.h -# Virtualize the network stack +# Network stack virtualization options VIMAGE opt_global.h +VNET_DEBUG opt_global.h # Common Flash Interface (CFI) options CFI_SUPPORT_STRATAFLASH opt_cfi.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Fri Aug 14 21:50:47 2009 (r196227) +++ head/sys/net/vnet.h Fri Aug 14 22:41:39 2009 (r196228) @@ -107,9 +107,6 @@ void vnet_destroy(struct vnet *vnet); * Various macros -- get and set the current network stack, but also * assertions. */ -#ifdef INVARIANTS -#define VNET_DEBUG -#endif #ifdef VNET_DEBUG #define VNET_ASSERT(condition) \ if (!(condition)) { \ From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 22:43:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7F81065690; Fri, 14 Aug 2009 22:43:25 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3878FC59; Fri, 14 Aug 2009 22:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EMhPxc050132; Fri, 14 Aug 2009 22:43:25 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EMhPUQ050130; Fri, 14 Aug 2009 22:43:25 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908142243.n7EMhPUQ050130@svn.freebsd.org> From: Marko Zec Date: Fri, 14 Aug 2009 22:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196229 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 22:43:25 -0000 Author: zec Date: Fri Aug 14 22:43:25 2009 New Revision: 196229 URL: http://svn.freebsd.org/changeset/base/196229 Log: SCTP is not yet compatible with options VIMAGE kernels although it compiles with VIMAGE defined, so explicitly disallow building such kernels. Reviewed by: rrs Approved by: re (rwatson), julian (mentor) Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Fri Aug 14 22:41:39 2009 (r196228) +++ head/sys/netinet/sctp_os_bsd.h Fri Aug 14 22:43:25 2009 (r196229) @@ -78,6 +78,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef VIMAGE +#error "SCTP is not yet compatible with VIMAGE." +#endif + #ifdef IPSEC #include #include From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 22:46:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FF8106568C; Fri, 14 Aug 2009 22:46:45 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C102B8FC4D; Fri, 14 Aug 2009 22:46:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EMkjXr050247; Fri, 14 Aug 2009 22:46:45 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7EMkjgw050245; Fri, 14 Aug 2009 22:46:45 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908142246.n7EMkjgw050245@svn.freebsd.org> From: Marko Zec Date: Fri, 14 Aug 2009 22:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196230 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 22:46:45 -0000 Author: zec Date: Fri Aug 14 22:46:45 2009 New Revision: 196230 URL: http://svn.freebsd.org/changeset/base/196230 Log: Appease VNET_DEBUG - in if_vmove we temporarily switch i.e. recurse from one vnet to another which is OK, so no need to flood the console with warnings here. Approved by: re (rwatson), julian (mentor) Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Aug 14 22:43:25 2009 (r196229) +++ head/sys/net/if.c Fri Aug 14 22:46:45 2009 (r196230) @@ -920,7 +920,7 @@ if_vmove_loan(struct thread *td, struct /* Make sure the named iface does not exists in the dst. prison/vnet. */ /* XXX Lock interfaces to avoid races. */ - CURVNET_SET(pr->pr_vnet); + CURVNET_SET_QUIET(pr->pr_vnet); difp = ifunit(ifname); CURVNET_RESTORE(); if (difp != NULL) { From owner-svn-src-head@FreeBSD.ORG Fri Aug 14 23:44:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96AD2106568C; Fri, 14 Aug 2009 23:44:59 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 859EC8FC3D; Fri, 14 Aug 2009 23:44:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7ENix1U051746; Fri, 14 Aug 2009 23:44:59 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7ENixMN051744; Fri, 14 Aug 2009 23:44:59 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200908142344.n7ENixMN051744@svn.freebsd.org> From: Qing Li Date: Fri, 14 Aug 2009 23:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196234 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 23:44:59 -0000 Author: qingli Date: Fri Aug 14 23:44:59 2009 New Revision: 196234 URL: http://svn.freebsd.org/changeset/base/196234 Log: In function ip_output(), the cached route is flushed when there is a mismatch between the cached entry and the intended destination. The cached rtentry{} is flushed but the associated llentry{} is not. This causes the wrong destination MAC address being used in the output packets. The fix is to flush the llentry{} when rtentry{} is cleared. Reviewed by: kmacy, rwatson Approved by: re Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Aug 14 23:05:10 2009 (r196233) +++ head/sys/netinet/ip_output.c Fri Aug 14 23:44:59 2009 (r196234) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -201,9 +202,12 @@ again: if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { - if (!nortfree) + if (!nortfree) { RTFREE(ro->ro_rt); + LLE_FREE(ro->ro_lle); + } ro->ro_rt = (struct rtentry *)NULL; + ro->ro_lle = (struct llentry *)NULL; } #ifdef IPFIREWALL_FORWARD if (ro->ro_rt == NULL && fwd_tag == NULL) { From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 03:01:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0266E1065696; Sat, 15 Aug 2009 03:01:03 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f205.google.com (mail-fx0-f205.google.com [209.85.220.205]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE2F8FC41; Sat, 15 Aug 2009 03:01:02 +0000 (UTC) Received: by fxm1 with SMTP id 1so1410736fxm.7 for ; Fri, 14 Aug 2009 20:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=ZRonFAq3aRIdt/oYZLYaRuYzS1/HRtDfP32g0xr++AU=; b=RqY9xyccdlDQX+IYVRQzUcwy83D8uQZ5IaPupl0hzziAU5pCl15rnmT+hXuOzXehxY 20gHli3AYNAssLuSU2iGxoHcKMuytyOiwDgXvIA3EjD3mqg9jVV6lrRGMvdqx1sqoxOf 4XF/Cu4DGdLHw8xtcwwzmoh9vbhiROJVaHM2U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=I/+wtGQT4vJM5uIqLrG92e4wwjWClGyczz6hJn5/QB8EthDnZv9A1dLnSmoN02VUeE I/GHYiFl9RYQ8s6Yp49pcoKwXsczlsLAOrvAcUuEk+AxnHUOuR4g9IpmNoBpjlLlnpap KfZTE1HhgLKXw6owCNNs81K6llnJaJi5GOvuU= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.113.9 with SMTP id y9mr631359fap.61.1250303630020; Fri, 14 Aug 2009 19:33:50 -0700 (PDT) In-Reply-To: <200908142146.n7ELksKZ048760@svn.freebsd.org> References: <200908142146.n7ELksKZ048760@svn.freebsd.org> Date: Sat, 15 Aug 2009 04:33:49 +0200 X-Google-Sender-Auth: 62226973df3521b6 Message-ID: <3bbf2fe10908141933u91d0305jdc7301526adb69e2@mail.gmail.com> From: Attilio Rao To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196226 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 03:01:04 -0000 2009/8/14 Bjoern A. Zeeb : > Author: bz > Date: Fri Aug 14 21:46:54 2009 > New Revision: 196226 > URL: http://svn.freebsd.org/changeset/base/196226 > > Log: > Add a new macro to test that a variable could be loaded atomically. > Check that the given variable is at most uintptr_t in size and that > it is aligned. > > Note: ASSERT_ATOMIC_LOAD() uses ALIGN() to check for adequate > alignment -- however, the function of ALIGN() is to guarantee > alignment, and therefore may lead to stronger alignment > enforcement than necessary for types that are smaller than > sizeof(uintptr_t). > > Add checks to mtx, rw and sx locks init functions to detect possible > breakage. This was used during debugging of the problem fixed with > r196118 where a pointer was on an un-aligned address in the dpcpu area. > > In collaboration with: rwatson > Reviewed by: rwatson > Approved by: re (kib) > > Modified: > head/sys/kern/kern_mutex.c > head/sys/kern/kern_rwlock.c > head/sys/kern/kern_sx.c > head/sys/sys/systm.h I think you should cover the lockmgr case too. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 11:47:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BADF0106568B; Sat, 15 Aug 2009 11:47:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97B38FC43; Sat, 15 Aug 2009 11:47:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FBl5k7069287; Sat, 15 Aug 2009 11:47:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FBl5HS069284; Sat, 15 Aug 2009 11:47:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200908151147.n7FBl5HS069284@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 15 Aug 2009 11:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196242 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 11:47:05 -0000 Author: trasz Date: Sat Aug 15 11:47:05 2009 New Revision: 196242 URL: http://svn.freebsd.org/changeset/base/196242 Log: Add mptutil(8) and mfiutil(1) to 'SEE ALSO' sections in mpt(4) and mfi(4). Approved by: re (rwatson) Modified: head/share/man/man4/mfi.4 head/share/man/man4/mpt.4 Modified: head/share/man/man4/mfi.4 ============================================================================== --- head/share/man/man4/mfi.4 Sat Aug 15 08:39:54 2009 (r196241) +++ head/share/man/man4/mfi.4 Sat Aug 15 11:47:05 2009 (r196242) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2008 +.Dd August 15, 2009 .Dt MFI 4 .Os .Sh NAME @@ -102,6 +102,7 @@ management interface An attempt was made to remove a mounted volume. .El .Sh SEE ALSO +.Xr mfiutil 1 , .Xr amr 4 , .Xr pci 4 .Sh HISTORY Modified: head/share/man/man4/mpt.4 ============================================================================== --- head/share/man/man4/mpt.4 Sat Aug 15 08:39:54 2009 (r196241) +++ head/share/man/man4/mpt.4 Sat Aug 15 11:47:05 2009 (r196242) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 6, 2007 +.Dd August 15, 2009 .Dt MPT 4 .Os .Sh NAME @@ -155,6 +155,7 @@ can take on - no separate compilation is .Xr sa 4 , .Xr scsi 4 , .Xr targ 4 , +.Xr mptutil 8 , .Xr gmultipath 8 .Rs .%T "LSI Logic Website" From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 14:39:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF75B106568B; Sat, 15 Aug 2009 14:39:33 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE09A8FC16; Sat, 15 Aug 2009 14:39:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FEdXIe073319; Sat, 15 Aug 2009 14:39:33 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FEdXom073317; Sat, 15 Aug 2009 14:39:33 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200908151439.n7FEdXom073317@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 15 Aug 2009 14:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196244 - head/usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 14:39:33 -0000 Author: stas Date: Sat Aug 15 14:39:33 2009 New Revision: 196244 URL: http://svn.freebsd.org/changeset/base/196244 Log: - Avoid overflowing the swap size counters in human-readable mode by introducing the new CONVERT_BLOCKS macro which operates on sizes already converted to number of blocks. With this macro it is not longer needed to perform needless multiplication by blocksize just to divide on it later in CONVERT macro. Approved by: re (kib) MFC after: 1 week Modified: head/usr.sbin/pstat/pstat.c Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Sat Aug 15 11:52:40 2009 (r196243) +++ head/usr.sbin/pstat/pstat.c Sat Aug 15 14:39:33 2009 (r196244) @@ -460,6 +460,7 @@ getfiles(struct xfile **abuf, size_t *al */ #define CONVERT(v) ((int64_t)(v) * pagesize / blocksize) +#define CONVERT_BLOCKS(v) ((int64_t)(v) * pagesize) static struct kvm_swap swtot; static int nswdev; @@ -492,10 +493,10 @@ print_swap_line(const char *swdevname, i printf("%-15s %*jd ", swdevname, hlen, CONVERT(nblks)); if (humanflag) { humanize_number(usedbuf, sizeof(usedbuf), - CONVERT(blocksize * bused), "", + CONVERT_BLOCKS(bused), "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); humanize_number(availbuf, sizeof(availbuf), - CONVERT(blocksize * bavail), "", + CONVERT_BLOCKS(bavail), "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf("%8s %8s %5.0f%%\n", usedbuf, availbuf, bpercent); } else { From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 15:15:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9416106568C; Sat, 15 Aug 2009 15:15:20 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D81A78FC52; Sat, 15 Aug 2009 15:15:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FFFKmI074657; Sat, 15 Aug 2009 15:15:20 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FFFKEG074655; Sat, 15 Aug 2009 15:15:20 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200908151515.n7FFFKEG074655@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 15 Aug 2009 15:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196246 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 15:15:21 -0000 Author: stas Date: Sat Aug 15 15:15:20 2009 New Revision: 196246 URL: http://svn.freebsd.org/changeset/base/196246 Log: - Proprely intialize UART parameters at probe stage, so uart(4) will initialize the FIFO memory correctly on attach. Before that this values was intialized in only in at91_usart_bus_attach which is called after the uart(4) memory allocation happens. Approved by: re (kib) MFC after: 1 week Modified: head/sys/arm/at91/uart_dev_at91usart.c Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Sat Aug 15 15:12:46 2009 (r196245) +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Aug 15 15:15:20 2009 (r196246) @@ -307,6 +307,10 @@ static kobj_method_t at91_usart_methods[ int at91_usart_bus_probe(struct uart_softc *sc) { + + sc->sc_txfifosz = USART_BUFFER_SIZE; + sc->sc_rxfifosz = USART_BUFFER_SIZE; + sc->sc_hwiflow = 0; return (0); } @@ -344,10 +348,6 @@ at91_usart_bus_attach(struct uart_softc atsc->flags |= HAS_TIMEOUT; WR4(&sc->sc_bas, USART_IDR, 0xffffffff); - sc->sc_txfifosz = USART_BUFFER_SIZE; - sc->sc_rxfifosz = USART_BUFFER_SIZE; - sc->sc_hwiflow = 0; - #ifndef SKYEYE_WORKAROUNDS /* * Allocate DMA tags and maps From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 15:40:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EC07106568B; Sat, 15 Aug 2009 15:40:31 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1318FC61; Sat, 15 Aug 2009 15:40:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FFeVTn075797; Sat, 15 Aug 2009 15:40:31 GMT (envelope-from fluffy@svn.freebsd.org) Received: (from fluffy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FFeVCl075795; Sat, 15 Aug 2009 15:40:31 GMT (envelope-from fluffy@svn.freebsd.org) Message-Id: <200908151540.n7FFeVCl075795@svn.freebsd.org> From: Dima Panov Date: Sat, 15 Aug 2009 15:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196248 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 15:40:31 -0000 Author: fluffy (ports committer) Date: Sat Aug 15 15:40:30 2009 New Revision: 196248 URL: http://svn.freebsd.org/changeset/base/196248 Log: Add my birthday Approved by: re (rwatson) miwi (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Aug 15 15:18:29 2009 (r196247) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Aug 15 15:40:30 2009 (r196248) @@ -244,6 +244,7 @@ 09/10 Wesley R. Peters born in Hartford, Alabama, United States, 1961 09/12 Weongyo Jeong born in Haman, Korea, 1980 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 +09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 09/27 Neil Blakey-Milner born in Port Elizabeth, South Africa, 1978 From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 17:57:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE5AF106564A; Sat, 15 Aug 2009 17:57:21 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5A18FC45; Sat, 15 Aug 2009 17:57:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FHvLnw080914; Sat, 15 Aug 2009 17:57:21 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FHvLCa080913; Sat, 15 Aug 2009 17:57:21 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200908151757.n7FHvLCa080913@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 15 Aug 2009 17:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196254 - head/usr.sbin/iostat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 17:57:22 -0000 Author: keramida (doc committer) Date: Sat Aug 15 17:57:21 2009 New Revision: 196254 URL: http://svn.freebsd.org/changeset/base/196254 Log: iostat: add a bit of space between tty in/out columns The columns for tty input and output may bump against each other if the tty output needs more than 5 columns. Add a bit of space that pushes everything 1 column to the right, but also avoids the problem. Approved by: re (rwatson) Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Sat Aug 15 16:15:50 2009 (r196253) +++ head/usr.sbin/iostat/iostat.c Sat Aug 15 17:57:21 2009 (r196254) @@ -586,7 +586,7 @@ main(int argc, char **argv) } if (xflag == 0 && Tflag > 0) - printf("%4.0Lf%5.0Lf", cur.tk_nin / etime, + printf("%4.0Lf %5.0Lf", cur.tk_nin / etime, cur.tk_nout / etime); devstats(hflag, etime, havelast); @@ -674,7 +674,7 @@ phdr(void) return; if (Tflag > 0) - (void)printf(" tty"); + (void)printf(" tty"); for (i = 0, printed=0;(i < num_devices) && (printed < maxshowdevs);i++){ int di; if ((dev_select[i].selected != 0) @@ -696,7 +696,7 @@ phdr(void) (void)printf("\n"); if (Tflag > 0) - (void)printf(" tin tout"); + (void)printf(" tin tout"); for (i=0, printed = 0;(i < num_devices) && (printed < maxshowdevs);i++){ if ((dev_select[i].selected != 0) @@ -741,7 +741,7 @@ devstats(int perf_select, long double et if (xflag > 0) { printf(" extended device statistics "); if (Tflag > 0) - printf(" tty "); + printf(" tty "); if (Cflag > 0) printf(" cpu "); printf("\n"); @@ -754,7 +754,7 @@ devstats(int perf_select, long double et "device r/i w/i kr/i kw/i wait svc_t %%b " ); if (Tflag > 0) - printf("tin tout "); + printf("tin tout "); if (Cflag > 0) printf("us ni sy in id "); printf("\n"); @@ -895,7 +895,7 @@ devstats(int perf_select, long double et */ printf("%52s",""); if (Tflag > 0) - printf("%4.0Lf%5.0Lf", cur.tk_nin / etime, + printf("%4.0Lf %5.0Lf", cur.tk_nin / etime, cur.tk_nout / etime); if (Cflag > 0) cpustats(); From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 18:37:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BC54106568B; Sat, 15 Aug 2009 18:37:07 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120D58FC45; Sat, 15 Aug 2009 18:37:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FIb6CT081961; Sat, 15 Aug 2009 18:37:06 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FIb69r081959; Sat, 15 Aug 2009 18:37:06 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200908151837.n7FIb69r081959@svn.freebsd.org> From: Attilio Rao Date: Sat, 15 Aug 2009 18:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196256 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 18:37:07 -0000 Author: attilio Date: Sat Aug 15 18:37:06 2009 New Revision: 196256 URL: http://svn.freebsd.org/changeset/base/196256 Log: Port recent IPI enhachements to en: * Introduce the ipi_nmi_handler() function for the Xen infrastructure * Fixup adeguately the ipi sender functions Approved by: re (kib) Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Sat Aug 15 18:03:34 2009 (r196255) +++ head/sys/i386/xen/mp_machdep.c Sat Aug 15 18:37:06 2009 (r196256) @@ -118,6 +118,7 @@ volatile int smp_tlb_wait; typedef void call_data_func_t(uintptr_t , uintptr_t); static u_int logical_cpus; +static volatile cpumask_t ipi_nmi_pending; /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; @@ -1109,6 +1110,14 @@ ipi_selected(cpumask_t cpus, u_int ipi) ipi = IPI_BITMAP_VECTOR; } + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, cpus); + CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi); while ((cpu = ffs(cpus)) != 0) { cpu--; @@ -1140,10 +1149,39 @@ ipi_selected(cpumask_t cpus, u_int ipi) void ipi_all_but_self(u_int ipi) { + + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus)); + CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); ipi_selected(PCPU_GET(other_cpus), ipi); } +int +ipi_nmi_handler() +{ + cpumask_t cpumask; + + /* + * As long as there is not a simple way to know about a NMI's + * source, if the bitmask for the current CPU is present in + * the global pending bitword an IPI_STOP_HARD has been issued + * and should be handled. + */ + cpumask = PCPU_GET(cpumask); + if ((ipi_nmi_pending & cpumask) == 0) + return (1); + + atomic_clear_int(&ipi_nmi_pending, cpumask); + cpustop_handler(); + return (0); +} + /* * Handle an IPI_STOP by saving our current context and spinning until we * are resumed. From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 18:37:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40CCA1065694; Sat, 15 Aug 2009 18:37:50 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f206.google.com (mail-ew0-f206.google.com [209.85.219.206]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6998FC65; Sat, 15 Aug 2009 18:37:48 +0000 (UTC) Received: by ewy2 with SMTP id 2so178400ewy.43 for ; Sat, 15 Aug 2009 11:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=GqLsAUE/3YnPdJqyStUzcEx+pkxm09Onm0T73CSsgNc=; b=GqZhINZFg4X6R+l+4suFv1B1Be5MyfjO3ERrM7WU+xXY/lxOqOrqzY3NRrcvRDgNxI wV6czqcsyCM141GXDZsJ4jW1Fny3U2/HqmB9LhLlCzNdvMa1rsVAHQEr0mNECdvkfnR5 QN6aYfTeTge7HIjAJdtzTqqDYzldQjWNVSl6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=bb7S4V8g1p8tK2oOdR/QQ0a4ZVzpNp4YQuHhj6g4LDiQ+vG9R5mLdPLbHKId2sSs6q V3IHG83Wi0unal8wgTQlrLhwkv1L92fW4y5gZkN2u4Uyub2vGFzlnne3gPC4mxmcfnLK EzxNDsf2y6Dp8rj1mdCV02SDQXMtGv5HUbVbk= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.210.116.11 with SMTP id o11mr3675711ebc.99.1250361468139; Sat, 15 Aug 2009 11:37:48 -0700 (PDT) In-Reply-To: <200908151757.n7FHvLCa080913@svn.freebsd.org> References: <200908151757.n7FHvLCa080913@svn.freebsd.org> From: Ivan Voras Date: Sat, 15 Aug 2009 20:37:28 +0200 X-Google-Sender-Auth: b96eb44b14e332b6 Message-ID: <9bbcef730908151137h3c752f91j3ec9d93a8f860d66@mail.gmail.com> To: Giorgos Keramidas Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196254 - head/usr.sbin/iostat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 18:37:50 -0000 2009/8/15 Giorgos Keramidas : > Author: keramida (doc committer) > Date: Sat Aug 15 17:57:21 2009 > New Revision: 196254 > URL: http://svn.freebsd.org/changeset/base/196254 > > Log: > =C2=A0iostat: add a bit of space between tty in/out columns > > =C2=A0The columns for tty input and output may bump against each other > =C2=A0if the tty output needs more than 5 columns. =C2=A0Add a bit of spa= ce > =C2=A0that pushes everything 1 column to the right, but also avoids the > =C2=A0problem. I don't know if it would interfere with some use cases (OTOH I don't know why would someone need tty in/out counts at all) but why not aggressively humanize the numbers instead? From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 19:46:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99546106568C; Sat, 15 Aug 2009 19:46:39 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8A18FC15; Sat, 15 Aug 2009 19:46:38 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 2A9D6EB4FF7; Sat, 15 Aug 2009 22:21:02 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id F383145088; Sat, 15 Aug 2009 22:21:01 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qA82IaLicYAH; Sat, 15 Aug 2009 22:21:01 +0300 (EEST) Received: from kobe.laptop (adsl218-136.kln.forthnet.gr [79.103.31.136]) by mail.ceid.upatras.gr (Postfix) with ESMTP id B053E4503F; Sat, 15 Aug 2009 22:21:01 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n7FJL0Ze066914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Aug 2009 22:21:01 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n7FJL018066913; Sat, 15 Aug 2009 22:21:00 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Ivan Voras References: <200908151757.n7FHvLCa080913@svn.freebsd.org> <9bbcef730908151137h3c752f91j3ec9d93a8f860d66@mail.gmail.com> Date: Sat, 15 Aug 2009 22:21:00 +0300 In-Reply-To: <9bbcef730908151137h3c752f91j3ec9d93a8f860d66@mail.gmail.com> (Ivan Voras's message of "Sat, 15 Aug 2009 20:37:28 +0200") Message-ID: <87r5vcc28z.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196254 - head/usr.sbin/iostat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 19:46:39 -0000 On Sat, 15 Aug 2009 20:37:28 +0200, Ivan Voras wrote: >2009/8/15 Giorgos Keramidas : >> Author: keramida (doc committer) >> Date: Sat Aug 15 17:57:21 2009 >> New Revision: 196254 >> URL: http://svn.freebsd.org/changeset/base/196254 >> >> Log: >> =A0iostat: add a bit of space between tty in/out columns >> >> =A0The columns for tty input and output may bump against each other >> =A0if the tty output needs more than 5 columns. =A0Add a bit of space >> =A0that pushes everything 1 column to the right, but also avoids the >> =A0problem. > > I don't know if it would interfere with some use cases (OTOH I don't > know why would someone need tty in/out counts at all) but why not > aggressively humanize the numbers instead? It would probably interfere with scripts that people are using to parse iostat output. Even *this* change that slides everything to the right by one column may cause a bit of surprise, but I see that -H is not taken as an option. I'll try to grab it and add support for human readable numbers, but keep it non-default. Thanks! :) From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 21:10:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47034106568C; Sat, 15 Aug 2009 21:10:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3562A8FC41; Sat, 15 Aug 2009 21:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FLArBP088340; Sat, 15 Aug 2009 21:10:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FLArWj088332; Sat, 15 Aug 2009 21:10:53 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200908152110.n7FLArWj088332@svn.freebsd.org> From: Michael Tuexen Date: Sat, 15 Aug 2009 21:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196260 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 21:10:53 -0000 Author: tuexen Date: Sat Aug 15 21:10:52 2009 New Revision: 196260 URL: http://svn.freebsd.org/changeset/base/196260 Log: * Fix a bug where PR-SCTP settings are ignore when using implicit association setup. * Fix a bug where message with illegal stream ids are not deleted. * Fix a crash when reporting back unsent messages from the send_queue. * Fix a bug related to INIT retransmission when the socket is already closed. * Fix a bug where associations were stalled when partial delivery API was enabled. * Fix a bug where the receive buffer size was smaller than the partial_delivery_point. Approved by: re, rrs (mentor) MFC after: One day. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctp_indata.c Sat Aug 15 21:10:52 2009 (r196260) @@ -900,7 +900,7 @@ sctp_deliver_reasm_check(struct sctp_tcb { struct sctp_tmit_chunk *chk; uint16_t nxt_todel; - uint32_t tsize; + uint32_t tsize, pd_point; doit_again: chk = TAILQ_FIRST(&asoc->reasmqueue); @@ -920,8 +920,13 @@ doit_again: * Yep the first one is here and its ok to deliver * but should we? */ - if ((sctp_is_all_msg_on_reasm(asoc, &tsize) || - (tsize >= stcb->sctp_ep->partial_delivery_point))) { + if (stcb->sctp_socket) { + pd_point = min(SCTP_SB_LIMIT_RCV(stcb->sctp_socket) >> SCTP_PARTIAL_DELIVERY_SHIFT, + stcb->sctp_ep->partial_delivery_point); + } else { + pd_point = stcb->sctp_ep->partial_delivery_point; + } + if (sctp_is_all_msg_on_reasm(asoc, &tsize) || (tsize >= pd_point)) { /* * Yes, we setup to start reception, by @@ -2824,7 +2829,7 @@ void sctp_service_queues(struct sctp_tcb *stcb, struct sctp_association *asoc) { struct sctp_tmit_chunk *chk; - uint32_t tsize; + uint32_t tsize, pd_point; uint16_t nxt_todel; if (asoc->fragmented_delivery_inprogress) { @@ -2860,8 +2865,13 @@ doit_again: * be here or 1/4 the socket buffer max or nothing on the * delivery queue and something can be delivered. */ - if ((sctp_is_all_msg_on_reasm(asoc, &tsize) || - (tsize >= stcb->sctp_ep->partial_delivery_point))) { + if (stcb->sctp_socket) { + pd_point = min(SCTP_SB_LIMIT_RCV(stcb->sctp_socket) >> SCTP_PARTIAL_DELIVERY_SHIFT, + stcb->sctp_ep->partial_delivery_point); + } else { + pd_point = stcb->sctp_ep->partial_delivery_point; + } + if (sctp_is_all_msg_on_reasm(asoc, &tsize) || (tsize >= pd_point)) { asoc->fragmented_delivery_inprogress = 1; asoc->tsn_last_delivered = chk->rec.data.TSN_seq - 1; asoc->str_of_pdapi = chk->rec.data.stream_number; @@ -5192,7 +5202,7 @@ skip_segments: /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); - if (PR_SCTP_BUF_ENABLED(tp1->flags)) { + if (asoc->peer_supports_prsctp && PR_SCTP_BUF_ENABLED(tp1->flags)) { asoc->sent_queue_cnt_removeable--; } } @@ -6289,10 +6299,11 @@ sctp_handle_forward_tsn(struct sctp_tcb ctl->pdapi_aborted = 1; sv = stcb->asoc.control_pdapi; stcb->asoc.control_pdapi = ctl; - sctp_notify_partial_delivery_indication(stcb, + sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, + stcb, SCTP_PARTIAL_DELIVERY_ABORTED, - SCTP_HOLDS_LOCK, - str_seq); + (void *)&str_seq, + SCTP_SO_NOT_LOCKED); stcb->asoc.control_pdapi = sv; break; } else if ((ctl->sinfo_stream == stseq->stream) && @@ -7786,7 +7797,7 @@ skip_segments: /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); - if (PR_SCTP_BUF_ENABLED(tp1->flags)) { + if (asoc->peer_supports_prsctp && PR_SCTP_BUF_ENABLED(tp1->flags)) { asoc->sent_queue_cnt_removeable--; } } Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctp_input.c Sat Aug 15 21:10:52 2009 (r196260) @@ -278,18 +278,38 @@ sctp_process_init(struct sctp_init_chunk unsigned int newcnt; struct sctp_stream_out *outs; struct sctp_stream_queue_pending *sp; + struct sctp_tmit_chunk *chk, *chk_next; - /* cut back on number of streams */ + /* abandon the upper streams */ newcnt = ntohs(init->num_inbound_streams); - /* This if is probably not needed but I am cautious */ + if (!TAILQ_EMPTY(&asoc->send_queue)) { + chk = TAILQ_FIRST(&asoc->send_queue); + while (chk) { + chk_next = TAILQ_NEXT(chk, sctp_next); + if (chk->rec.data.stream_number >= newcnt) { + TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); + asoc->send_queue_cnt--; + if (chk->data != NULL) { + sctp_free_bufspace(stcb, asoc, chk, 1); + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } + } + sctp_free_a_chunk(stcb, chk); + /* sa_ignore FREED_MEMORY */ + } + chk = chk_next; + } + } if (asoc->strmout) { - /* First make sure no data chunks are trapped */ for (i = newcnt; i < asoc->pre_open_streams; i++) { outs = &asoc->strmout[i]; sp = TAILQ_FIRST(&outs->outqueue); while (sp) { - TAILQ_REMOVE(&outs->outqueue, sp, - next); + TAILQ_REMOVE(&outs->outqueue, sp, next); asoc->stream_queue_cnt--; sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, SCTP_NOTIFY_DATAGRAM_UNSENT, @@ -301,16 +321,13 @@ sctp_process_init(struct sctp_init_chunk sctp_free_remote_addr(sp->net); sp->net = NULL; /* Free the chunk */ - SCTP_PRINTF("sp:%p tcb:%p weird free case\n", - sp, stcb); - sctp_free_a_strmoq(stcb, sp); /* sa_ignore FREED_MEMORY */ sp = TAILQ_FIRST(&outs->outqueue); } } } - /* cut back the count and abandon the upper streams */ + /* cut back the count */ asoc->pre_open_streams = newcnt; } SCTP_TCB_SEND_UNLOCK(stcb); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctp_output.c Sat Aug 15 21:10:52 2009 (r196260) @@ -4200,7 +4200,7 @@ sctp_send_initiate(struct sctp_inpcb *in /* place in my tag */ init->init.initiate_tag = htonl(stcb->asoc.my_vtag); /* set up some of the credits. */ - init->init.a_rwnd = htonl(max(SCTP_SB_LIMIT_RCV(inp->sctp_socket), + init->init.a_rwnd = htonl(max(inp->sctp_socket ? SCTP_SB_LIMIT_RCV(inp->sctp_socket) : 0, SCTP_MINIMAL_RWND)); init->init.num_outbound_streams = htons(stcb->asoc.pre_open_streams); @@ -4411,7 +4411,6 @@ sctp_send_initiate(struct sctp_inpcb *in net->port, so_locked, NULL); SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); - sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); } @@ -5786,61 +5785,58 @@ sctp_get_frag_point(struct sctp_tcb *stc } static void -sctp_set_prsctp_policy(struct sctp_tcb *stcb, - struct sctp_stream_queue_pending *sp) +sctp_set_prsctp_policy(struct sctp_stream_queue_pending *sp) { sp->pr_sctp_on = 0; - if (stcb->asoc.peer_supports_prsctp) { + /* + * We assume that the user wants PR_SCTP_TTL if the user provides a + * positive lifetime but does not specify any PR_SCTP policy. This + * is a BAD assumption and causes problems at least with the + * U-Vancovers MPI folks. I will change this to be no policy means + * NO PR-SCTP. + */ + if (PR_SCTP_ENABLED(sp->sinfo_flags)) { + sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags); + sp->pr_sctp_on = 1; + } else { + return; + } + switch (PR_SCTP_POLICY(sp->sinfo_flags)) { + case CHUNK_FLAGS_PR_SCTP_BUF: /* - * We assume that the user wants PR_SCTP_TTL if the user - * provides a positive lifetime but does not specify any - * PR_SCTP policy. This is a BAD assumption and causes - * problems at least with the U-Vancovers MPI folks. I will - * change this to be no policy means NO PR-SCTP. - */ - if (PR_SCTP_ENABLED(sp->sinfo_flags)) { - sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags); - sp->pr_sctp_on = 1; - } else { - return; - } - switch (PR_SCTP_POLICY(sp->sinfo_flags)) { - case CHUNK_FLAGS_PR_SCTP_BUF: - /* - * Time to live is a priority stored in tv_sec when - * doing the buffer drop thing. - */ - sp->ts.tv_sec = sp->timetolive; - sp->ts.tv_usec = 0; - break; - case CHUNK_FLAGS_PR_SCTP_TTL: - { - struct timeval tv; - - (void)SCTP_GETTIME_TIMEVAL(&sp->ts); - tv.tv_sec = sp->timetolive / 1000; - tv.tv_usec = (sp->timetolive * 1000) % 1000000; - /* - * TODO sctp_constants.h needs alternative - * time macros when _KERNEL is undefined. - */ - timevaladd(&sp->ts, &tv); - } - break; - case CHUNK_FLAGS_PR_SCTP_RTX: + * Time to live is a priority stored in tv_sec when doing + * the buffer drop thing. + */ + sp->ts.tv_sec = sp->timetolive; + sp->ts.tv_usec = 0; + break; + case CHUNK_FLAGS_PR_SCTP_TTL: + { + struct timeval tv; + + (void)SCTP_GETTIME_TIMEVAL(&sp->ts); + tv.tv_sec = sp->timetolive / 1000; + tv.tv_usec = (sp->timetolive * 1000) % 1000000; /* - * Time to live is a the number or retransmissions - * stored in tv_sec. + * TODO sctp_constants.h needs alternative time + * macros when _KERNEL is undefined. */ - sp->ts.tv_sec = sp->timetolive; - sp->ts.tv_usec = 0; - break; - default: - SCTPDBG(SCTP_DEBUG_USRREQ1, - "Unknown PR_SCTP policy %u.\n", - PR_SCTP_POLICY(sp->sinfo_flags)); - break; + timevaladd(&sp->ts, &tv); } + break; + case CHUNK_FLAGS_PR_SCTP_RTX: + /* + * Time to live is a the number or retransmissions stored in + * tv_sec. + */ + sp->ts.tv_sec = sp->timetolive; + sp->ts.tv_usec = 0; + break; + default: + SCTPDBG(SCTP_DEBUG_USRREQ1, + "Unknown PR_SCTP policy %u.\n", + PR_SCTP_POLICY(sp->sinfo_flags)); + break; } } @@ -5911,7 +5907,7 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->tail_mbuf = NULL; sp->length = 0; at = m; - sctp_set_prsctp_policy(stcb, sp); + sctp_set_prsctp_policy(sp); /* * We could in theory (for sendall) sifa the length in, but we would * still have to hunt through the chain since we need to setup the @@ -7138,7 +7134,7 @@ dont_do_it: } /* We only re-set the policy if it is on */ if (sp->pr_sctp_on) { - sctp_set_prsctp_policy(stcb, sp); + sctp_set_prsctp_policy(sp); asoc->pr_sctp_cnt++; chk->pr_sctp_on = 1; } else { @@ -12285,7 +12281,7 @@ skip_copy: sp->addr_over = 0; } atomic_add_int(&sp->net->ref_count, 1); - sctp_set_prsctp_policy(stcb, sp); + sctp_set_prsctp_policy(sp); } out_now: return (sp); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctp_pcb.c Sat Aug 15 21:10:52 2009 (r196260) @@ -4547,8 +4547,11 @@ sctp_free_assoc(struct sctp_inpcb *inp, stcb->asoc.control_pdapi = sq; strseq = (sq->sinfo_stream << 16) | sq->sinfo_ssn; - sctp_notify_partial_delivery_indication(stcb, - SCTP_PARTIAL_DELIVERY_ABORTED, 1, strseq); + sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, + stcb, + SCTP_PARTIAL_DELIVERY_ABORTED, + (void *)&strseq, + SCTP_SO_LOCKED); stcb->asoc.control_pdapi = NULL; } } Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctp_timer.c Sat Aug 15 21:10:52 2009 (r196260) @@ -588,7 +588,7 @@ sctp_recover_sent_list(struct sctp_tcb * /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, chk, 1); sctp_m_freem(chk->data); - if (PR_SCTP_BUF_ENABLED(chk->flags)) { + if (asoc->peer_supports_prsctp && PR_SCTP_BUF_ENABLED(chk->flags)) { asoc->sent_queue_cnt_removeable--; } } @@ -757,7 +757,7 @@ start_again: continue; } } - if (PR_SCTP_TTL_ENABLED(chk->flags)) { + if (stcb->asoc.peer_supports_prsctp && PR_SCTP_TTL_ENABLED(chk->flags)) { /* Is it expired? */ if ((now.tv_sec > chk->rec.data.timetodrop.tv_sec) || ((chk->rec.data.timetodrop.tv_sec == now.tv_sec) && @@ -772,7 +772,7 @@ start_again: continue; } } - if (PR_SCTP_RTX_ENABLED(chk->flags)) { + if (stcb->asoc.peer_supports_prsctp && PR_SCTP_RTX_ENABLED(chk->flags)) { /* Has it been retransmitted tv_sec times? */ if (chk->snd_count > chk->rec.data.timetodrop.tv_sec) { if (chk->data) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctputil.c Sat Aug 15 21:10:52 2009 (r196260) @@ -1484,6 +1484,7 @@ sctp_timeout_handler(void *t) SCTP_INP_INCR_REF(inp); if ((inp->sctp_socket == 0) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && + (tmr->type != SCTP_TIMER_TYPE_INIT) && (tmr->type != SCTP_TIMER_TYPE_SEND) && (tmr->type != SCTP_TIMER_TYPE_RECV) && (tmr->type != SCTP_TIMER_TYPE_HEARTBEAT) && @@ -2984,8 +2985,6 @@ sctp_notify_send_failed(struct sctp_tcb ssf->ssf_info.sinfo_assoc_id = sctp_get_associd(stcb); ssf->ssf_assoc_id = sctp_get_associd(stcb); - SCTP_BUF_NEXT(m_notify) = chk->data; - SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed); if (chk->data) { /* * trim off the sctp chunk header(it should be there) @@ -2996,6 +2995,8 @@ sctp_notify_send_failed(struct sctp_tcb chk->send_size -= sizeof(struct sctp_data_chunk); } } + SCTP_BUF_NEXT(m_notify) = chk->data; + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed); /* Steal off the mbuf */ chk->data = NULL; /* @@ -3146,9 +3147,13 @@ sctp_notify_adaptation_layer(struct sctp } /* This always must be called with the read-queue LOCKED in the INP */ -void +static void sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, - int nolock, uint32_t val) + uint32_t val, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct mbuf *m_notify; struct sctp_pdapi_event *pdapi; @@ -3189,9 +3194,6 @@ sctp_notify_partial_delivery_indication( control->tail_mbuf = m_notify; control->held_length = 0; control->length = 0; - if (nolock == 0) { - SCTP_INP_READ_LOCK(stcb->sctp_ep); - } sb = &stcb->sctp_socket->so_rcv; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(m_notify)); @@ -3208,12 +3210,30 @@ sctp_notify_partial_delivery_indication( /* we really should not see this case */ TAILQ_INSERT_TAIL(&stcb->sctp_ep->read_queue, control, next); } - if (nolock == 0) { - SCTP_INP_READ_UNLOCK(stcb->sctp_ep); - } if (stcb->sctp_ep && stcb->sctp_socket) { /* This should always be the case */ +#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + struct socket *so; + + so = SCTP_INP_SO(stcb->sctp_ep); + if (!so_locked) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); + SCTP_SOCKET_LOCK(so, 1); + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { + SCTP_SOCKET_UNLOCK(so, 1); + return; + } + } +#endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); +#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + if (!so_locked) { + SCTP_SOCKET_UNLOCK(so, 1); + } +#endif } } @@ -3540,9 +3560,9 @@ sctp_ulp_notify(uint32_t notification, s val = *((uint32_t *) data); - sctp_notify_partial_delivery_indication(stcb, error, 0, val); + sctp_notify_partial_delivery_indication(stcb, error, val, so_locked); + break; } - break; case SCTP_NOTIFY_STRDATA_ERR: break; case SCTP_NOTIFY_ASSOC_ABORTED: @@ -3585,11 +3605,9 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_STR_RESET_FAILED_OUT: sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), (SCTP_STRRESET_OUTBOUND_STR | SCTP_STRRESET_FAILED)); break; - case SCTP_NOTIFY_STR_RESET_FAILED_IN: sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), (SCTP_STRRESET_INBOUND_STR | SCTP_STRRESET_FAILED)); break; - case SCTP_NOTIFY_ASCONF_ADD_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data, error); @@ -3671,8 +3689,10 @@ sctp_report_all_outbound(struct sctp_tcb sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, SCTP_NOTIFY_DATAGRAM_SENT, chk, so_locked); - sctp_m_freem(chk->data); - chk->data = NULL; + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } } sctp_free_a_chunk(stcb, chk); /* sa_ignore FREED_MEMORY */ @@ -3689,8 +3709,10 @@ sctp_report_all_outbound(struct sctp_tcb sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, SCTP_NOTIFY_DATAGRAM_UNSENT, chk, so_locked); - sctp_m_freem(chk->data); - chk->data = NULL; + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } } sctp_free_a_chunk(stcb, chk); /* sa_ignore FREED_MEMORY */ @@ -5346,6 +5368,38 @@ restart_nosblocks: } goto restart; } + if ((control->length == 0) && + (control->end_added == 1)) { + /* + * Do we also need to check for (control->pdapi_aborted == + * 1)? + */ + if (hold_rlock == 0) { + hold_rlock = 1; + SCTP_INP_READ_LOCK(inp); + } + TAILQ_REMOVE(&inp->read_queue, control, next); + if (control->data) { +#ifdef INVARIANTS + panic("control->data not null but control->length == 0"); +#else + SCTP_PRINTF("Strange, data left in the control buffer. Cleaning up.\n"); + sctp_m_freem(control->data); + control->data = NULL; +#endif + } + if (control->aux_data) { + sctp_m_free(control->aux_data); + control->aux_data = NULL; + } + sctp_free_remote_addr(control->whoFrom); + sctp_free_a_readq(stcb, control); + if (hold_rlock) { + hold_rlock = 0; + SCTP_INP_READ_UNLOCK(inp); + } + goto restart; + } if (control->length == 0) { if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE)) && (filling_sinfo)) { Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Aug 15 19:48:14 2009 (r196259) +++ head/sys/netinet/sctputil.h Sat Aug 15 21:10:52 2009 (r196260) @@ -234,10 +234,6 @@ int sctp_cmpaddr(struct sockaddr *, stru void sctp_print_address(struct sockaddr *); void sctp_print_address_pkt(struct ip *, struct sctphdr *); -void -sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, - uint32_t error, int no_lock, uint32_t strseq); - int sctp_release_pr_sctp_chunk(struct sctp_tcb *, struct sctp_tmit_chunk *, int, int From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 22:26:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 518E6106568D; Sat, 15 Aug 2009 22:26:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4139E8FC3D; Sat, 15 Aug 2009 22:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FMQRsE091855; Sat, 15 Aug 2009 22:26:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FMQRvQ091853; Sat, 15 Aug 2009 22:26:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908152226.n7FMQRvQ091853@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Aug 2009 22:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196263 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 22:26:27 -0000 Author: rwatson Date: Sat Aug 15 22:26:26 2009 New Revision: 196263 URL: http://svn.freebsd.org/changeset/base/196263 Log: Remove unused if_rawoutput() macro; it has been unused since at least FreeBSD 2. Approved by: re (kib) Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat Aug 15 21:42:04 2009 (r196262) +++ head/sys/net/if_var.h Sat Aug 15 22:26:26 2009 (r196263) @@ -235,7 +235,6 @@ typedef void if_init_f_t(void *); #define if_iqdrops if_data.ifi_iqdrops #define if_noproto if_data.ifi_noproto #define if_lastchange if_data.ifi_lastchange -#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)NULL) /* for compatibility with other BSDs */ #define if_addrlist if_addrhead From owner-svn-src-head@FreeBSD.ORG Sat Aug 15 23:07:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 457D71065690; Sat, 15 Aug 2009 23:07:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3333B8FC15; Sat, 15 Aug 2009 23:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7FN7iig092915; Sat, 15 Aug 2009 23:07:44 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7FN7ihE092912; Sat, 15 Aug 2009 23:07:44 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908152307.n7FN7ihE092912@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Aug 2009 23:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196267 - in head: share/man/man4 sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 23:07:44 -0000 Author: rwatson Date: Sat Aug 15 23:07:43 2009 New Revision: 196267 URL: http://svn.freebsd.org/changeset/base/196267 Log: Rather than fix questionable ifnet list locking in the implementation of the kern.polling.enable sysctl, remove the sysctl. It has been deprecated since FreeBSD 6 in favour of per-ifnet polling flags. Reviewed by: luigi Approved by: re (kib) Modified: head/share/man/man4/polling.4 head/sys/kern/kern_poll.c Modified: head/share/man/man4/polling.4 ============================================================================== --- head/share/man/man4/polling.4 Sat Aug 15 22:51:11 2009 (r196266) +++ head/share/man/man4/polling.4 Sat Aug 15 23:07:43 2009 (r196267) @@ -87,6 +87,16 @@ feature. It is turned on and off with help of .Xr ifconfig 8 command. +.Pp +The historic +.Va kern.polling.enable , +which enabled polling for all interfaces, can be replaced with the following +code: +.Bd -literal +for i in `ifconfig -l` ; + do ifconfig $i polling; # use -polling to disable +done +.Ed .Ss MIB Variables The operation of .Nm @@ -156,15 +166,6 @@ Default is 20. How many active devices have registered for .Nm . .Pp -.It Va kern.polling.enable -Legacy MIB, that was used to enable or disable polling globally. -Currently if set to 1, -.Nm -is enabled on all capable interfaces. -If set to 0, -.Nm -is disabled on all interfaces. -.Pp .It Va kern.polling.short_ticks .It Va kern.polling.lost_polls .It Va kern.polling.pending_polls Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Sat Aug 15 22:51:11 2009 (r196266) +++ head/sys/kern/kern_poll.c Sat Aug 15 23:07:43 2009 (r196267) @@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$"); #include /* for NETISR_POLL */ #include -static int poll_switch(SYSCTL_HANDLER_ARGS); - void hardclock_device_poll(void); /* hook from hardclock */ static struct mtx poll_mtx; @@ -230,10 +228,6 @@ static uint32_t poll_handlers; /* next f SYSCTL_UINT(_kern_polling, OID_AUTO, handlers, CTLFLAG_RD, &poll_handlers, 0, "Number of registered poll handlers"); -static int polling = 0; -SYSCTL_PROC(_kern_polling, OID_AUTO, enable, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(int), poll_switch, "I", "Switch polling for all interfaces"); - static uint32_t phase; SYSCTL_UINT(_kern_polling, OID_AUTO, phase, CTLFLAG_RD, &phase, 0, "Polling phase"); @@ -538,49 +532,6 @@ ether_poll_deregister(struct ifnet *ifp) return (0); } -/* - * Legacy interface for turning polling on all interfaces at one time. - */ -static int -poll_switch(SYSCTL_HANDLER_ARGS) -{ - struct ifnet *ifp; - int error; - int val = polling; - - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr ) - return (error); - - if (val == polling) - return (0); - - if (val < 0 || val > 1) - return (EINVAL); - - polling = val; - - IFNET_RLOCK(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_capabilities & IFCAP_POLLING) { - struct ifreq ifr; - - if (val == 1) - ifr.ifr_reqcap = - ifp->if_capenable | IFCAP_POLLING; - else - ifr.ifr_reqcap = - ifp->if_capenable & ~IFCAP_POLLING; - (void) (*ifp->if_ioctl)(ifp, SIOCSIFCAP, (caddr_t)&ifr); - } - } - IFNET_RUNLOCK(); - - log(LOG_ERR, "kern.polling.enable is deprecated. Use ifconfig(8)"); - - return (0); -} - static void poll_idle(void) {