From owner-svn-src-stable-8@FreeBSD.ORG Sun May 20 01:40:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B466106564A; Sun, 20 May 2012 01:40:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDFE38FC12; Sun, 20 May 2012 01:40:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K1eO6S058517; Sun, 20 May 2012 01:40:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K1eO2o058515; Sun, 20 May 2012 01:40:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205200140.q4K1eO2o058515@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 01:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235674 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 01:40:26 -0000 Author: gjb (doc committer) Date: Sun May 20 01:40:24 2012 New Revision: 235674 URL: http://svn.freebsd.org/changeset/base/235674 Log: MFC r235567: mdoc(7) style/formatting fixes. While here, fix a few nits igor(1) does not like. Modified: stable/8/share/man/man4/siftr.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/siftr.4 ============================================================================== --- stable/8/share/man/man4/siftr.4 Sun May 20 01:40:12 2012 (r235673) +++ stable/8/share/man/man4/siftr.4 Sun May 20 01:40:24 2012 (r235674) @@ -91,7 +91,7 @@ utilises the .Xr sysctl 8 interface to export its configuration variables to user-space. The following variables are available: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.enabled controls whether the module performs its measurements or not. @@ -104,7 +104,7 @@ packet filtering hooks are only inserted .Va net.inet.siftr.enabled is set to 1. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.ppl controls how many inbound/outbound packets for a given TCP connection will cause a log message to be generated for the connection. @@ -113,13 +113,13 @@ every packet of every TCP connection. The value can be set to any integer in the range [1,2^32], and can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.logfile controls the path to the file that the module writes its log messages to. By default, the file /var/log/siftr.log is used. The path can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.genhashes controls whether a hash is generated for each TCP packet seen by .Nm . @@ -150,36 +150,36 @@ sysname=FreeBSD sysver=604000 ipmo .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_secs time at which the module was enabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_usecs time at which the module was enabled, in microseconds since enable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va siftrver version of .Nm . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va hz tick rate of the kernel in ticks per second. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va tcp_rtt_scale smoothed RTT estimate scaling factor. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysname operating system name. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysver operating system version. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va ipmode IP mode as defined at compile time. An ipmode of "4" means IPv6 is not supported and IP addresses are logged in @@ -202,7 +202,7 @@ o,0xbec491a5,1238556193.463551,172.16.7. .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 1 Direction of packet that triggered the log message. Either @@ -211,77 +211,77 @@ for in, or .Qq o for out. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 2 Hash of the packet that triggered the log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 3 Time at which the packet that triggered the log message was processed by the .Xr pfil 9 hook function, in seconds and microseconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 4 The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 5 The TCP port that the local host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 6 The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 7 The TCP port that the foreign host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 8 The slow start threshold for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 9 The current congestion window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 10 The current bandwidth-controlled window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 11 The current sending window for the flow, in bytes. The post scaled value is reported, except during the initial handshake (first few packets), during which time the unscaled value is reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 12 The current receive window for the flow, in bytes. The post scaled value is always reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 13 The current window scaling factor for the sending window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 14 The current window scaling factor for the receiving window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 15 The current state of the TCP finite state machine, as defined in .Aq Pa netinet/tcp_fsm.h . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 16 The maximum segment size for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 17 The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick @@ -289,46 +289,46 @@ timer. Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 18 SACK enabled indicator. 1 if SACK enabled, 0 otherwise. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 19 The current state of the TCP flags for the flow. See .Aq Pa netinet/tcp_var.h for information about the various flags. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. Divide by HZ to get the timeout length in seconds. HZ is reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 21 The current size of the socket send buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 22 The current number of bytes in the socket send buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 23 The current size of the socket receive buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 24 The current number of bytes in the socket receive buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 25 The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 26 The current number of segments in the reassembly queue. .El @@ -350,82 +350,82 @@ flow_list=172.16.7.28;22-172.16.2.5;5593 .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_secs Time at which the module was disabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_usecs Time at which the module was disabled, in microseconds since disable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_tcp_pkts Number of TCP packets that traversed up the network stack. This only includes inbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_tcp_pkts Number of TCP packets that traversed down the network stack. This only includes outbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_tcp_pkts The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc Number of inbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc Number of outbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx Number of inbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_mtx Number of outbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_tcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_tcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_icb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_icb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_skipped_tcp_pkts The summation of all skipped packet counters. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va flow_list A CSV list of TCP flows that triggered data log messages to be generated since the module was loaded. Each flow entry in the CSV list is formatted as .Qq local_ip;local_port-foreign_ip;foreign_port . -If there are no entries in the list (i.e. no data log messages were generated), +If there are no entries in the list (i.e., no data log messages were generated), the value will be blank. If there is at least one entry in the list, a trailing comma will always be present. @@ -498,10 +498,10 @@ the system to trigger a dump of the stat flow. With the PPL set to 1, we are in effect sampling each TCP flow's control block state as frequently as flow packets enter/leave the system. -For example, setting PPL to 2 halves the sampling rate i.e. every second flow +For example, setting PPL to 2 halves the sampling rate i.e., every second flow packet (inbound OR outbound) causes a dump of the control block state. .Pp -The distinction between interrogating individual packets vs interrogating the +The distinction between interrogating individual packets versus interrogating the control block is important, because .Nm does not remove the need for packet capturing tools like @@ -543,7 +543,7 @@ If one thread holds the lock, the other This does introduce some additional bounded delay into the kernel's packet processing code path. .Pp -In some cases (e.g. low memory, connection termination), TCP packets that enter +In some cases (e.g., low memory, connection termination), TCP packets that enter the .Nm .Xr pfil 9 From owner-svn-src-stable-8@FreeBSD.ORG Sun May 20 20:25:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310351065674; Sun, 20 May 2012 20:25:58 +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 1BAC08FC1A; Sun, 20 May 2012 20:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KKPvx4014227; Sun, 20 May 2012 20:25:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KKPv7a014225; Sun, 20 May 2012 20:25:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202025.q4KKPv7a014225@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 20:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235697 - stable/8/lib/libipsec X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 20:25:58 -0000 Author: bz Date: Sun May 20 20:25:57 2012 New Revision: 235697 URL: http://svn.freebsd.org/changeset/base/235697 Log: MFC r231532: MFp4 204292: Ignore the NAT_T extension types so we can at least dump the SADB from the in-base libipsec/setkey without error when NAT_T support is present in the kernel, though not printing the additional information yet. However in case there is no NAT_T support in kernel still consider them to be an error. Modified: stable/8/lib/libipsec/pfkey.c Directory Properties: stable/8/lib/libipsec/ (props changed) Modified: stable/8/lib/libipsec/pfkey.c ============================================================================== --- stable/8/lib/libipsec/pfkey.c Sun May 20 20:25:22 2012 (r235696) +++ stable/8/lib/libipsec/pfkey.c Sun May 20 20:25:57 2012 (r235697) @@ -1778,6 +1778,18 @@ pfkey_align(msg, mhp) case SADB_X_EXT_SA2: mhp[ext->sadb_ext_type] = (caddr_t)ext; break; + case SADB_X_EXT_NAT_T_TYPE: + case SADB_X_EXT_NAT_T_SPORT: + case SADB_X_EXT_NAT_T_DPORT: + /* case SADB_X_EXT_NAT_T_OA: is OAI */ + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NAT_T_FRAG: + if (feature_present("ipsec_natt")) { + mhp[ext->sadb_ext_type] = (caddr_t)ext; + break; + } + /* FALLTHROUGH */ default: __ipsec_errcode = EIPSEC_INVAL_EXTTYPE; return -1; From owner-svn-src-stable-8@FreeBSD.ORG Sun May 20 22:23:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0286C106566C; Sun, 20 May 2012 22:23:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE67D8FC15; Sun, 20 May 2012 22:23:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KMNwTX020590; Sun, 20 May 2012 22:23:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KMNwcd020583; Sun, 20 May 2012 22:23:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201205202223.q4KMNwcd020583@svn.freebsd.org> From: Martin Matuska Date: Sun, 20 May 2012 22:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235702 - in stable/8/cddl/contrib/opensolaris: cmd/zdb cmd/zfs lib/libzfs/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:23:59 -0000 Author: mm Date: Sun May 20 22:23:58 2012 New Revision: 235702 URL: http://svn.freebsd.org/changeset/base/235702 Log: MFC r235212, r235216, r235217: MFC r325212 [1]: Import illumos changeset 13618:c6ae14a341e8 2088 zdb could use a reasonable manual page Rewrite new zdb manpage to mdoc(7) MFC r235216 [2]: Add support for force unmounting ZFS filesystems during "zfs rename" with the -f flag. Reimplementation of the illumos changeset 13677:a0cbef703c12 2635 'zfs rename -f' to perform force unmount MFC r235217 [3]: Remove unreachable break in zfs_main.c Partial import of illumos changeset 13622:e5889df1eaac 2077 lots of unreachable breaks in illumos gate References: https://www.illumos.org/issues/2088 [1] https://www.illumos.org/issues/2635 [2] https://www.illumos.org/issues/2077 [3] PR: 164447 [1], 164447 [2], 167370 [3] Suggested by: Marcelo Araujo Obtained from: illumos (issue #2088 [1], #2635 [2], #2077 [3]) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun May 20 22:23:58 2012 (r235702) @@ -1,61 +1,286 @@ '\" te -.\" Copyright (c) 2011, Martin Matuska . +.\" Copyright (c) 2012, Martin Matuska . .\" All Rights Reserved. .\" -.\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). -.\" You may not use this file except in compliance with the License. -.\" -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -.\" or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions -.\" and limitations under the License. -.\" -.\" When distributing Covered Code, include this CDDL HEADER in each -.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. -.\" If applicable, add the following below this CDDL HEADER, with the -.\" fields enclosed by brackets "[]" replaced with your own identifying -.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. .\" -.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2012, Richard Lowe. +.\" Copyright (c) 2012, Marcelo Araujo . +.\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd May 10, 2012 .Dt ZDB 8 .Os .Sh NAME .Nm zdb -.Nd ZFS debugger +.Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Ar pool +.Op Fl CumdibcsDvhLXFPA +.Op Fl e Op Fl p Ar path... +.Op Fl t Ar txg +.Ar poolname +.Op Ar object ... +.Nm +.Op Fl divPA +.Op Fl e Op Fl p Ar path... +.Ar dataset +.Op Ar object ... +.Nm +.Fl m Op Fl LXFPA +.Op Fl t Ar txg +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Nm +.Fl R Op Fl A +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Nm +.Fl S +.Op Fl AP +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Nm +.Fl l +.Op Fl uA +.Ar device +.Nm +.Fl C +.Op Fl A +.Op Fl U Ar cache .Sh DESCRIPTION The .Nm -command is used by support engineers to diagnose failures and -gather statistics. Since the -.Tn ZFS -file system is always consistent on disk and is self-repairing, -.Nm -should only be run under the direction by a support engineer. -.Pp -If no arguments are specified, -.Nm -performs basic consistency checks on the pool and associated datasets, and -report any problems detected. -.Nm -Any options supported by this command are internal to Sun and subject to change -at any time. -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -The pool is consistent. -.It 1 -An error was detected. -.It 2 -Invalid command line options were specified. +utility displays information about a ZFS pool useful for debugging and +performs some amount of consistency checking. +It is a not a general purpose tool and options (and facilities) may change. +This is neither a +.Xr fsck 8 +nor a +.Xr fsdb 8 +utility. +.Pp +The output of this command in general reflects the on-disk structure of a ZFS +pool, and is inherently unstable. +The precise output of most invocations is not documented, a knowledge of ZFS +internals is assumed. +.Pp +When operating on an imported and active pool it is possible, though unlikely, +that zdb may interpret inconsistent pool data and behave erratically. +.Sh OPTIONS +Display options: +.Bl -tag -width indent +.It Fl b +Display statistics regarding the number, size (logical, physical and +allocated) and deduplication of blocks. +.It Fl c +Verify the checksum of all metadata blocks while printing block statistics +(see +.Fl b Ns ). +.Pp +If specified multiple times, verify the checksums of all blocks. +.It Fl C +Display information about the configuration. If specified with no other +options, instead display information about the cache file +.Ns ( Pa /etc/zfs/zpool.cache Ns ). +To specify the cache file to display, see +.Fl U +.Pp +If specified multiple times, and a pool name is also specified display both +the cached configuration and the on-disk configuration. +If specified multiple times with +.FL e +also display the configuration that would be used were the pool to be +imported. +.It Fl d +Display information about datasets. Specified once, displays basic dataset +information: ID, create transaction, size, and object count. +.Pp +If specified multiple times provides greater and greater verbosity. +.Pp +If object IDs are specified, display information about those specific objects only. +.It Fl D +Display deduplication statistics, including the deduplication ratio (dedup), +compression ratio (compress), inflation due to the zfs copies property +(copies), and an overall effective ratio (dedup * compress / copies). +.Pp +If specified twice, display a histogram of deduplication statistics, showing +the allocated (physically present on disk) and referenced (logically +referenced in the pool) block counts and sizes by reference count. +.It Fl h +Display pool history similar to +.Cm zpool history , +but include internal changes, transaction, and dataset information. +.It Fl i +Display information about intent log (ZIL) entries relating to each +dataset. +If specified multiple times, display counts of each intent log transaction +type. +.It Fl l Ar device +Display the vdev labels from the specified device. +If the +.Fl u +option is also specified, also display the uberblocks on this device. +.It Fl L +Disable leak tracing and the loading of space maps. +By default, +.Nm +verifies that all non-free blocks are referenced, which can be very expensive. +.It Fl m +Display the offset, spacemap, and free space of each metaslab. +When specified twice, also display information about the maximum contiguous +free space and the percentage of free space in each space map. +When specified three times display every spacemap record. +.It Xo +.Fl R Ar poolname +.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Xc +Read and display a block from the specified device. By default the block is +displayed as a hex dump, but see the description of the +.Fl r +flag, below. +.Pp +The block is specified in terms of a colon-separated tuple +.Ar vdev +(an integer vdev identifier) +.Ar offset +(the offset within the vdev) +.Ar size +(the size of the block to read) and, optionally, +.Ar flags +(a set of flags, described below). +.Bl -tag -width indent +.It Sy b offset +Print block pointer +.It Sy d +Decompress the block +.It Sy e +Byte swap the block +.It Sy g +Dump gang block header +.It Sy i +Dump indirect block +.It Sy r +Dump raw uninterpreted block data +.El +.It Fl s +Report statistics on +.Nm Ns 's +I/O. +Display operation counts, bandwidth, and error counts of I/O to the pool from +.Nm . +.It Fl S +Simulate the effects of deduplication, constructing a DDT and then display +that DDT as with \fB-DD\fR. +.It Fl u +Display the current uberblock. +.El +.Pp +Other options: +.Bl -tag -width indent +.It Fl A +Do not abort should any assertion fail. +.It Fl AA +Enable panic recovery, certain errors which would otherwise be fatal are +demoted to warnings. +.It Fl AAA +Do not abort if asserts fail and also enable panic recovery. +.It Fl e Op Fl p Ar path... +Operate on an exported pool, not present in +.Pa /etc/zfs/zpool.cache . +The +.Fl p +flag specifies the path under which devices are to be searched. +.It Fl F +Attempt to make an unreadable pool readable by trying progressively older +transactions. +.It Fl P +Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather +than 1M. +.It Fl t Ar transaction +Specify the highest transaction to use when searching for uberblocks. +See also the +.Fl u +and +.Fl l +options for a means to see the available uberblocks and their associated +transaction numbers. +.It Fl U Ar cachefile +Use a cache file other than +.Pa /etc/zfs/zpool.cache . +This option is only valid with +.Fl C +.It Fl v +Enable verbosity. +Specify multiple times for increased verbosity. +.It Fl X +Attempt +.Ql extreme +transaction rewind, that is attempt the same recovery as +.Fl F +but read transactions otherwise deemed too old. +.El +.Pp +Specifying a display option more than once enables verbosity for only that +option, with more occurrences enabling more verbosity. +.Pp +If no options are specified, all information about the named pool will be +displayed at default verbosity. +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Example 1 Display the configuration of imported pool 'rpool' +.Bd -literal -offset 2n +.Li # Ic zdb -C rpool + +MOS Configuration: + version: 28 + name: 'rpool' + ... +.Ed +.It Sy Example 2 Display basic dataset information about 'rpool' +.Bd -literal -offset 2n +.Li # Ic zdb -d rpool +Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects +Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects +... +.Ed +.It Xo Sy Example 3 Display basic information about object 0 in +.Sy 'rpool/export/home' +.Xc +.Bd -literal -offset 2n +.Li # Ic zdb -d rpool/export/home 0 +Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects + + Object lvl iblk dblk dsize lsize %full type + 0 7 16K 16K 15.0K 16K 25.00 DMU dnode +.Ed +.It Xo Sy Example 4 Display the predicted effect of enabling deduplication on +.Sy 'rpool' +.Xc +.Bd -literal -offset 2n +.Li # Ic zdb -S rpool +Simulated DDT histogram: + +bucket allocated referenced +______ ______________________________ ______________________________ +refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE +------ ------ ----- ----- ----- ------ ----- ----- ----- + 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G + 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G + ... +dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00 +.Ed .El .Sh SEE ALSO .Xr zfs 8 , @@ -64,16 +289,18 @@ Invalid command line options were specif This manual page is a .Xr mdoc 7 reimplementation of the -.Tn OpenSolaris +.Tn illumos manual page .Em zdb(1M) , modified and customized for .Fx and licensed under the -.Tn Common Development and Distribution License +Common Development and Distribution License .Pq Tn CDDL . .Pp The .Xr mdoc 7 implementation of this manual page was initially written by -.An Martin Matuska Aq mm@FreeBSD.org . +.An Martin Matuska Aq mm@FreeBSD.org +and +.An Marcelo Araujo Aq araujo@FreeBSD.org . Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun May 20 22:23:58 2012 (r235702) @@ -102,13 +102,16 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhL] poolname [object...]\n" - " %s [-div] dataset [object...]\n" - " %s -m [-L] poolname [vdev [metaslab...]]\n" - " %s -R poolname vdev:offset:size[:flags]\n" - " %s -S poolname\n" - " %s -l [-u] device\n" - " %s -C\n\n", + "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]]" + "poolname [object...]\n" + " %s [-divPA] [-e -p path...] dataset [object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]]" + "poolname [vdev [metaslab...]]\n" + " %s -R [-A] [-e [-p path...]] poolname " + "vdev:offset:size[:flags]\n" + " %s -S [-PA] [-e [-p path...]] poolname\n" + " %s -l [-uA] device\n" + " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " Dataset name must include at least one " @@ -150,7 +153,7 @@ usage(void) "has altroot/not in a cachefile\n"); (void) fprintf(stderr, " -p -- use one or more with " "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -P print numbers parsable\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 20 22:23:58 2012 (r235702) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2011 by Delphix. All rights reserved. +.\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" @@ -77,10 +77,12 @@ .Ar clone-filesystem .Nm .Cm rename +.Op Fl f .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm rename +.Op Fl f .Fl p .Ar filesystem Ns | Ns Ar volume .Ar filesystem Ns | Ns Ar volume @@ -1638,12 +1640,14 @@ subcommand can be used to rename any con .It Xo .Nm .Cm rename +.Op Fl f .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm .Cm rename +.Op Fl f .Fl p .Ar filesystem Ns | Ns Ar volume .Ar filesystem Ns | Ns Ar volume @@ -1677,6 +1681,11 @@ property is set to or .Cm none , file system is not unmounted even if this option is not given. +.It Fl f +Force unmount any filesystems that need to be unmounted in the process. +This flag has no effect if used together with the +.Fl u +flag. .El .It Xo .Nm Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun May 20 22:23:58 2012 (r235702) @@ -22,10 +22,11 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2011 Martin Matuska . All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #include @@ -256,9 +257,10 @@ get_usage(zfs_help_t idx) "snapshot>\n" "\treceive [-vnFu] [-d | -e] \n")); case HELP_RENAME: - return (gettext("\trename " + return (gettext("\trename [-f] " "\n" - "\trename -p \n" + "\trename [-f] -p " + "\n" "\trename -r \n" "\trename -u [-p] ")); case HELP_ROLLBACK: @@ -758,7 +760,6 @@ zfs_do_create(int argc, char **argv) (void) fprintf(stderr, gettext("missing size " "argument\n")); goto badusage; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -3080,8 +3081,8 @@ zfs_do_list(int argc, char **argv) } /* - * zfs rename - * zfs rename -p + * zfs rename [-f] + * zfs rename [-f] -p * zfs rename -r * zfs rename -u [-p] * @@ -3101,7 +3102,7 @@ zfs_do_rename(int argc, char **argv) boolean_t parents = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, "pru")) != -1) { + while ((c = getopt(argc, argv, "fpru")) != -1) { switch (c) { case 'p': parents = B_TRUE; @@ -3112,6 +3113,9 @@ zfs_do_rename(int argc, char **argv) case 'u': flags.nounmount = B_TRUE; break; + case 'f': + flags.forceunmount = B_TRUE; + break; case '?': default: (void) fprintf(stderr, gettext("invalid option '%c'\n"), Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun May 20 22:23:58 2012 (r235702) @@ -26,6 +26,7 @@ * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #ifndef _LIBZFS_H @@ -541,6 +542,9 @@ typedef struct renameflags { /* don't unmount file systems */ int nounmount : 1; + + /* force unmount file systems */ + int forceunmount : 1; } renameflags_t; extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t flags); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun May 20 22:23:58 2012 (r235702) @@ -25,6 +25,7 @@ * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #include @@ -3721,7 +3722,8 @@ zfs_rename(zfs_handle_t *zhp, const char } else { if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, - flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, 0)) == NULL) { + flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, + flags.forceunmount ? MS_FORCE : 0)) == NULL) { return (-1); } From owner-svn-src-stable-8@FreeBSD.ORG Sun May 20 22:58:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DB0A106566B; Sun, 20 May 2012 22:58:38 +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 E0FD18FC0A; Sun, 20 May 2012 22:58:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KMwbJW022129; Sun, 20 May 2012 22:58:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KMwbd7022127; Sun, 20 May 2012 22:58:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202258.q4KMwbd7022127@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 22:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235704 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:58:38 -0000 Author: bz Date: Sun May 20 22:58:37 2012 New Revision: 235704 URL: http://svn.freebsd.org/changeset/base/235704 Log: MFC r232514: In nd6_options() ignore the RFC 6106 options completely rather than printing them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191 option as I am undecided so far. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Sun May 20 22:55:24 2012 (r235703) +++ stable/8/sys/netinet6/nd6.c Sun May 20 22:58:37 2012 (r235704) @@ -370,6 +370,14 @@ nd6_options(union nd_opts *ndopts) ndopts->nd_opts_pi_end = (struct nd_opt_prefix_info *)nd_opt; break; + /* What about ND_OPT_ROUTE_INFO? RFC 4191 */ + case ND_OPT_RDNSS: /* RFC 6106 */ + case ND_OPT_DNSSL: /* RFC 6106 */ + /* + * Silently ignore options we know and do not care about + * in the kernel. + */ + break; default: /* * Unknown options must be silently ignored, From owner-svn-src-stable-8@FreeBSD.ORG Mon May 21 00:03:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91E1106564A; Mon, 21 May 2012 00:03:13 +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 A35218FC17; Mon, 21 May 2012 00:03:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L03DIk025087; Mon, 21 May 2012 00:03:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L03DQ0025085; Mon, 21 May 2012 00:03:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205210003.q4L03DQ0025085@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 21 May 2012 00:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235706 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 00:03:13 -0000 Author: bz Date: Mon May 21 00:03:13 2012 New Revision: 235706 URL: http://svn.freebsd.org/changeset/base/235706 Log: MFC r232513: Correct typo in the RFC number for the constants based on IANA assignments for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement Options for DNS Configuration". It is RFC 6106. Modified: stable/8/sys/netinet/icmp6.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/icmp6.h ============================================================================== --- stable/8/sys/netinet/icmp6.h Sun May 20 23:33:10 2012 (r235705) +++ stable/8/sys/netinet/icmp6.h Mon May 21 00:03:13 2012 (r235706) @@ -298,8 +298,8 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ -#define ND_OPT_RDNSS 25 /* RFC 6016 */ -#define ND_OPT_DNSSL 31 /* RFC 6016 */ +#define ND_OPT_RDNSS 25 /* RFC 6106 */ +#define ND_OPT_DNSSL 31 /* RFC 6106 */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; From owner-svn-src-stable-8@FreeBSD.ORG Mon May 21 00:15:48 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 343B1106567E; Mon, 21 May 2012 00:15:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE028FC08; Mon, 21 May 2012 00:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L0FlSZ025735; Mon, 21 May 2012 00:15:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L0FlPQ025733; Mon, 21 May 2012 00:15:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205210015.q4L0FlPQ025733@svn.freebsd.org> From: Glen Barber Date: Mon, 21 May 2012 00:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235708 - stable/8/usr.bin/join X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 00:15:48 -0000 Author: gjb (doc committer) Date: Mon May 21 00:15:47 2012 New Revision: 235708 URL: http://svn.freebsd.org/changeset/base/235708 Log: MFC r235597: Fix a typo that crept in. Modified: stable/8/usr.bin/join/join.1 Directory Properties: stable/8/usr.bin/join/ (props changed) Modified: stable/8/usr.bin/join/join.1 ============================================================================== --- stable/8/usr.bin/join/join.1 Mon May 21 00:15:34 2012 (r235707) +++ stable/8/usr.bin/join/join.1 Mon May 21 00:15:47 2012 (r235708) @@ -113,7 +113,7 @@ representing the join field. The elements of list must be either comma .Pq Ql \&, or whitespace separated. -(The letter requires quoting to protect it from the shell, or, a simpler +(The latter requires quoting to protect it from the shell, or, a simpler approach is to use multiple .Fl o options.) From owner-svn-src-stable-8@FreeBSD.ORG Mon May 21 13:05:42 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B66DA106566B; Mon, 21 May 2012 13:05:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEF48FC12; Mon, 21 May 2012 13:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LD5g1R059222; Mon, 21 May 2012 13:05:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LD5g3M059208; Mon, 21 May 2012 13:05:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211305.q4LD5g3M059208@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 13:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235721 - in stable/8/usr.sbin/pkg_install: add delete lib updating version X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 13:05:42 -0000 Author: bapt Date: Mon May 21 13:05:41 2012 New Revision: 235721 URL: http://svn.freebsd.org/changeset/base/235721 Log: MFC: r201226, r202844, r206043, r206132, r206133, r212029, r225610, r226708, r228670 - Add support for UPDATING remote fetching. - Reorganize EXAMPLES section in pkg_updating(1). - Style fixes. - Replace hardcoded INDEX version. [1] - Fix a buffer overlap. [2] - Remove empty package when fetching fails and -K is used. [3] - Remove useless chmod2() after mkdtemp(3). [4] - Replace mkdir(1) call with mkdir(2). [5] - Get rid of some vsystem() calls. - Switch from lstat(2) to open(2) in fexists(). - Try rename(2) in move_file() first. - Fix pkg_delete, check if the file we're trying to delete is a symlink before complaining that it doesn't exist. Typical case would be a leftover library symlink that's left over after the actual library has been removed. - Print the package name on deletion errors. - Staticify elide_root() - In usr.sbin/pkg_install/updating/main.c, use the size of the destination buffer as size argument to strlcpy(), not the length of the source PR: bin/145101 [1], bin/139492 [2], bin/144919 [3] bin/144920 [4], bin/144921 [5] Submitted by: gcooper [1,2,3,4,5] Approved by: des (mentor) Modified: stable/8/usr.sbin/pkg_install/add/futil.c stable/8/usr.sbin/pkg_install/add/main.c stable/8/usr.sbin/pkg_install/add/perform.c stable/8/usr.sbin/pkg_install/delete/perform.c stable/8/usr.sbin/pkg_install/lib/file.c stable/8/usr.sbin/pkg_install/lib/lib.h stable/8/usr.sbin/pkg_install/lib/match.c stable/8/usr.sbin/pkg_install/lib/pen.c stable/8/usr.sbin/pkg_install/lib/plist.c stable/8/usr.sbin/pkg_install/lib/url.c stable/8/usr.sbin/pkg_install/updating/main.c stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 stable/8/usr.sbin/pkg_install/version/perform.c Directory Properties: stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/add/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) Modified: stable/8/usr.sbin/pkg_install/add/futil.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/futil.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/add/futil.c Mon May 21 13:05:41 2012 (r235721) @@ -50,7 +50,7 @@ make_hierarchy(char *dir) } } else { - if (vsystem("/bin/mkdir %s", dir)) { + if (mkdir(dir, 0777) < 0) { if (cp2) *cp2 = '/'; return FAIL; Modified: stable/8/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/main.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/add/main.c Mon May 21 13:05:41 2012 (r235721) @@ -22,7 +22,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include @@ -306,7 +306,9 @@ getpackagesite(void) { int reldate, i; static char sitepath[MAXPATHLEN]; - struct utsname u; + int archmib[] = { CTL_HW, HW_MACHINE_ARCH }; + char arch[64]; + size_t archlen = sizeof(arch); if (getenv("PACKAGESITE")) { if (strlcpy(sitepath, getenv("PACKAGESITE"), sizeof(sitepath)) @@ -329,8 +331,10 @@ getpackagesite(void) >= sizeof(sitepath)) return NULL; - uname(&u); - if (strlcat(sitepath, u.machine, sizeof(sitepath)) >= sizeof(sitepath)) + if (sysctl(archmib, 2, arch, &archlen, NULL, 0) == -1) + return NULL; + arch[archlen-1] = 0; + if (strlcat(sitepath, arch, sizeof(sitepath)) >= sizeof(sitepath)) return NULL; reldate = getosreldate(); Modified: stable/8/usr.sbin/pkg_install/add/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/perform.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/add/perform.c Mon May 21 13:05:41 2012 (r235721) @@ -78,6 +78,7 @@ pkg_do(char *pkg) char pre_arg[FILENAME_MAX], post_arg[FILENAME_MAX]; char *conflict[2]; char **matched; + int fd; conflictsfound = 0; code = 0; @@ -408,8 +409,10 @@ pkg_do(char *pkg) goto bomb; /* Look for the requirements file */ - if (fexists(REQUIRE_FNAME)) { - vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */ + if ((fd = open(REQUIRE_FNAME, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running requirements file first for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s INSTALL", REQUIRE_FNAME, Plist.name)) { @@ -441,8 +444,10 @@ pkg_do(char *pkg) } /* If we're really installing, and have an installation file, run it */ - if (!NoInstall && fexists(pre_script)) { - vsystem("/bin/chmod +x %s", pre_script); /* make sure */ + if (!NoInstall && (fd = open(pre_script, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running pre-install for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s %s", pre_script, Plist.name, pre_arg)) { @@ -470,8 +475,10 @@ pkg_do(char *pkg) } /* Run the installation script one last time? */ - if (!NoInstall && fexists(post_script)) { - vsystem("/bin/chmod +x %s", post_script); /* make sure */ + if (!NoInstall && (fd = open(post_script, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running post-install for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s %s", post_script, Plist.name, post_arg)) { @@ -503,7 +510,10 @@ pkg_do(char *pkg) goto success; /* close enough for government work */ } /* Make sure pkg_info can read the entry */ - vsystem("/bin/chmod a+rx %s", LogDir); + fd = open(LogDir, O_RDWR); + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IRALL | S_IXALL); /* be sure, chmod a+rx */ + close(fd); move_file(".", DESC_FNAME, LogDir); move_file(".", COMMENT_FNAME, LogDir); if (fexists(INSTALL_FNAME)) Modified: stable/8/usr.sbin/pkg_install/delete/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/delete/perform.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/delete/perform.c Mon May 21 13:05:41 2012 (r235721) @@ -132,6 +132,8 @@ pkg_do(char *pkg) const char *post_script, *pre_arg, *post_arg; struct reqr_by_entry *rb_entry; struct reqr_by_head *rb_list; + int fd; + struct stat sb; if (!pkg || !(len = strlen(pkg))) return 1; @@ -221,10 +223,12 @@ pkg_do(char *pkg) setenv(PKG_PREFIX_VNAME, p->name, 1); - if (fexists(REQUIRE_FNAME)) { + if ((fd = open(REQUIRE_FNAME, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Executing 'require' script.\n"); - vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */ if (vsystem("./%s %s DEINSTALL", REQUIRE_FNAME, pkg)) { warnx("package %s fails requirements %s", pkg, Force ? "" : "- not deleted"); @@ -250,11 +254,13 @@ pkg_do(char *pkg) post_script = pre_arg = post_arg = NULL; } - if (!NoDeInstall && pre_script != NULL && fexists(pre_script)) { + if (!NoDeInstall && pre_script != NULL && (fd = open(pre_script, O_RDWR)) != -1) { if (Fake) printf("Would execute de-install script at this point.\n"); else { - vsystem("/bin/chmod +x %s", pre_script); /* make sure */ + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (vsystem("./%s %s %s", pre_script, pkg, pre_arg)) { warnx("deinstall script returned error status"); if (!Force) @@ -326,11 +332,13 @@ pkg_do(char *pkg) return 1; } - if (!NoDeInstall && post_script != NULL && fexists(post_script)) { + if (!NoDeInstall && post_script != NULL && (fd = open(post_script, O_RDWR)) != -1) { if (Fake) printf("Would execute post-deinstall script at this point.\n"); else { - vsystem("/bin/chmod +x %s", post_script); /* make sure */ + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (vsystem("./%s %s %s", post_script, pkg, post_arg)) { warnx("post-deinstall script returned error status"); if (!Force) Modified: stable/8/usr.sbin/pkg_install/lib/file.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/file.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/file.c Mon May 21 13:05:41 2012 (r235721) @@ -31,10 +31,13 @@ __FBSDID("$FreeBSD$"); Boolean fexists(const char *fname) { - struct stat dummy; - if (!lstat(fname, &dummy)) - return TRUE; - return FALSE; + int fd; + + if ((fd = open(fname, O_RDONLY)) == -1) + return FALSE; + + close(fd); + return TRUE; } /* Quick check to see if something is a directory or symlink to a directory */ @@ -279,17 +282,23 @@ copy_file(const char *dir, const char *f } void -move_file(const char *dir, const char *fname, const char *to) +move_file(const char *dir, const char *fname, const char *tdir) { - char cmd[FILENAME_MAX]; + char from[FILENAME_MAX]; + char to[FILENAME_MAX]; if (fname[0] == '/') - snprintf(cmd, FILENAME_MAX, "/bin/mv %s %s", fname, to); + strncpy(from, fname, FILENAME_MAX); else - snprintf(cmd, FILENAME_MAX, "/bin/mv %s/%s %s", dir, fname, to); - if (vsystem(cmd)) { - cleanup(0); - errx(2, "%s: could not perform '%s'", __func__, cmd); + snprintf(from, FILENAME_MAX, "%s/%s", dir, fname); + + snprintf(to, FILENAME_MAX, "%s/%s", tdir, fname); + + if (rename(from, to) == -1) { + if (vsystem("/bin/mv %s %s", from, to)) { + cleanup(0); + errx(2, "%s: could not move '%s' to '%s'", __func__, from, to); + } } } Modified: stable/8/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/lib.h Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/lib.h Mon May 21 13:05:41 2012 (r235721) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,11 @@ #define YES 2 #define NO 1 +/* Some more stat macros. */ +#define S_IRALL 0000444 +#define S_IWALL 0000222 +#define S_IXALL 0000111 + /* Usually "rm", but often "echo" during debugging! */ #define REMOVE_CMD "/bin/rm" @@ -84,18 +90,6 @@ #define DISPLAY_FNAME "+DISPLAY" #define MTREE_FNAME "+MTREE_DIRS" -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 -#define INDEX_FNAME "INDEX-9" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 800000 -#define INDEX_FNAME "INDEX-8" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 700000 -#define INDEX_FNAME "INDEX-7" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 600000 -#define INDEX_FNAME "INDEX-6" -#else -#define INDEX_FNAME "INDEX" -#endif - #define CMD_CHAR '@' /* prefix for extended PLIST cmd */ /* The name of the "prefix" environment variable given to scripts */ @@ -105,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20101002 +#define PKG_INSTALL_VERSION 20100403 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: stable/8/usr.sbin/pkg_install/lib/match.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/match.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/match.c Mon May 21 13:05:41 2012 (r235721) @@ -267,7 +267,7 @@ matchallbyorigin(const char **origins, i */ if (isemptydir(tmp)) continue; - snprintf(tmp, PATH_MAX, "%s/%s", tmp, CONTENTS_FNAME); + strncat(tmp, "/" CONTENTS_FNAME, PATH_MAX); fp = fopen(tmp, "r"); if (fp == NULL) { warnx("the package info for package '%s' is corrupt", installed[i]); Modified: stable/8/usr.sbin/pkg_install/lib/pen.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/pen.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/pen.c Mon May 21 13:05:41 2012 (r235721) @@ -113,10 +113,6 @@ make_playpen(char *pen, off_t sz) cleanup(0); errx(2, "%s: can't mktemp '%s'", __func__, pen); } - if (chmod(pen, 0700) == FAIL) { - cleanup(0); - errx(2, "%s: can't mkdir '%s'", __func__, pen); - } if (Verbose) { if (sz) { Modified: stable/8/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/plist.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/plist.c Mon May 21 13:05:41 2012 (r235721) @@ -551,7 +551,7 @@ delete_hierarchy(const char *dir, Boolea char *cp1, *cp2; cp1 = cp2 = strdup(dir); - if (!fexists(dir)) { + if (!fexists(dir) && !issymlink(dir)) { if (!ign_err) warnx("%s '%s' doesn't exist", isdir(dir) ? "directory" : "file", dir); Modified: stable/8/usr.sbin/pkg_install/lib/url.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/url.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/url.c Mon May 21 13:05:41 2012 (r235721) @@ -108,6 +108,10 @@ fileGetURL(const char *base, const char if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) { printf("Error: Unable to get %s: %s\n", fname, fetchLastErrString); + /* If the fetch fails, yank the package. */ + if (keep_package && unlink(pkg) < 0 && Verbose) { + warnx("failed to remove partially fetched package: %s", pkg); + } return NULL; } Modified: stable/8/usr.sbin/pkg_install/updating/main.c ============================================================================== --- stable/8/usr.sbin/pkg_install/updating/main.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/updating/main.c Mon May 21 13:05:41 2012 (r235721) @@ -10,7 +10,11 @@ #include __FBSDID("$FreeBSD$"); + +#include +#include #include +#include #include #include #include @@ -115,10 +119,10 @@ main(int argc, char *argv[]) if (argc != 0) { pflag = 1; while (*argv) { - if((curr = (INSTALLEDPORT *) + if ((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); - strlcpy (curr->name, *argv, strlen(*argv) + 1); + strlcpy(curr->name, *argv, strlen(*argv) + 1); curr->next = head; head = curr; (void)*argv++; @@ -131,22 +135,22 @@ main(int argc, char *argv[]) */ if (pflag == 0) { /* Open /var/db/pkg and search for all installed ports. */ - if((dir = opendir(pkgdbpath)) != NULL) { + if ((dir = opendir(pkgdbpath)) != NULL) { while ((pkgdbdir = readdir(dir)) != NULL) { if (strcmp(pkgdbdir->d_name, ".") != 0 && - strcmp(pkgdbdir->d_name, "..") !=0) { + strcmp(pkgdbdir->d_name, "..") != 0) { /* Create path to +CONTENTS file for each installed port */ - n = strlcpy(tmp_file, pkgdbpath, strlen(pkgdbpath)+1); + n = strlcpy(tmp_file, pkgdbpath, sizeof(tmp_file)); n = strlcpy(tmp_file + n, "/", sizeof(tmp_file) - n); n = strlcat(tmp_file + n, pkgdbdir->d_name, sizeof(tmp_file) - n); - if(stat(tmp_file, &attribute) == -1) { + if (stat(tmp_file, &attribute) == -1) { fprintf(stderr, "can't open %s: %s\n", tmp_file, strerror(errno)); return EXIT_FAILURE; } - if(attribute.st_mode & S_IFREG) + if (attribute.st_mode & S_IFREG) continue; (void)strlcat(tmp_file + n, "/", sizeof(tmp_file) - n); @@ -155,7 +159,7 @@ main(int argc, char *argv[]) /* Open +CONTENT file */ fd = fopen(tmp_file, "r"); - if(fd == NULL) { + if (fd == NULL) { fprintf(stderr, "warning: can't open %s: %s\n", tmp_file, strerror(errno)); continue; @@ -165,25 +169,25 @@ main(int argc, char *argv[]) * Parses +CONTENT for ORIGIN line and * put element into linked list. */ - while(fgets(originline, maxcharperline, fd) != NULL) { + while (fgets(originline, maxcharperline, fd) != NULL) { tmpline1 = strstr(originline, origin); - if( tmpline1 != NULL ) { + if (tmpline1 != NULL) { /* Tmp variable to store port name. */ char *pname; pname = strrchr(originline, (int)':'); pname++; - if((curr = (INSTALLEDPORT *) + if ((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); if (pname[strlen(pname) - 1] == '\n') pname[strlen(pname) - 1] = '\0'; - strlcpy (curr->name, pname, strlen(pname)+1); + strlcpy (curr->name, pname, sizeof(curr->name)); curr->next = head; head = curr; } } - if(ferror(fd)) { + if (ferror(fd)) { fprintf(stderr, "error reading input\n"); exit(EX_IOERR); } @@ -195,32 +199,41 @@ main(int argc, char *argv[]) } } - /* Open UPDATING file */ - fd = fopen(updatingfile, "r"); - if(fd == NULL) { + /* Fetch UPDATING file if needed and open file */ + if (isURL(updatingfile)) { + if ((fd = fetchGetURL(updatingfile, "")) == NULL) { + fprintf(stderr, "Error: Unable to get %s: %s\n", + updatingfile, fetchLastErrString); + exit(EX_UNAVAILABLE); + } + } + else { + fd = fopen(updatingfile, "r"); + } + if (fd == NULL) { fprintf(stderr, "can't open %s: %s\n", - updatingfile, strerror(errno)); + updatingfile, strerror(errno)); exit(EX_UNAVAILABLE); } /* Parse opened UPDATING file. */ - while(fgets(updatingline, maxcharperline, fd) != NULL) { + while (fgets(updatingline, maxcharperline, fd) != NULL) { /* No entry is found so far */ if (found == 0) { /* Search for AFFECTS line to parse the portname. */ tmpline1 = strstr(updatingline, affects); - if( tmpline1 != NULL ) { + if (tmpline1 != NULL) { curr = head; - while(curr != NULL) { + while (curr != NULL) { tmpline2 = strstr(updatingline, curr->name); - if( tmpline2 != NULL ) + if (tmpline2 != NULL) break; curr = curr->next; } - if( tmpline2 != NULL ) { + if (tmpline2 != NULL) { /* If -d is set, check if entry is newer than the date. */ - if ( (dflag == 1) && (strncmp(dateline, date, 8) < 0)) + if ((dflag == 1) && (strncmp(dateline, date, 8) < 0)) continue; printf("%s", dateline); printf("%s", updatingline); @@ -231,7 +244,7 @@ main(int argc, char *argv[]) /* Search for the end of an entry, if not found print the line. */ else { tmpline1 = strstr(updatingline, end); - if( tmpline1 == NULL ) + if (tmpline1 == NULL) printf("%s", updatingline); else { linelength = strlen(updatingline); @@ -245,7 +258,7 @@ main(int argc, char *argv[]) dateline = strdup(updatingline); } - if(ferror(fd)) { + if (ferror(fd)) { fprintf(stderr, "error reading input\n"); exit(EX_IOERR); } Modified: stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 ============================================================================== --- stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 Mon May 21 13:05:41 2012 (r235721) @@ -45,26 +45,31 @@ Print help message. .El .Sh EXAMPLES .Bl -tag -width indent -.Dl pkg_updating +Shows all entries of all installed ports: .Pp -Shows all entries of all installed ports. +.Dl % pkg_updating .Pp -.Dl pkg_updating -d 20070101 +Shows all entries of all installed ports since 2007-01-01: .Pp -Shows all entries of all installed ports since 2007-01-01. +.Dl % pkg_updating -d 20070101 .Pp -.Dl pkg_updating apache mysql +Shows all entries for all apache and mysql ports: .Pp -Shows all entries for all apache and mysql ports. +.Dl % pkg_updating apache mysql .Pp -.Dl pkg_updating -d 20060101 apache +Shows all apache entries since 2006-01-01: .Pp -Shows all apache entries since 2006-01-01. -.Pp -.Dl pkg_updating -f /tmp/UPDATING +.Dl % pkg_updating -d 20060101 apache .Pp Defines that the UPDATING file is in /tmp and shows all entries of all -installed ports +installed ports: +.Pp +.Dl % pkg_updating -f /tmp/UPDATING +.Pp +Fetch UPDATING file from ftp mirror and show all entries of all +installed ports: +.Pp +.Dl % pkg_updating -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/UPDATING .Pp .El .Sh ENVIRONMENT Modified: stable/8/usr.sbin/pkg_install/version/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/version/perform.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/version/perform.c Mon May 21 13:05:41 2012 (r235721) @@ -35,28 +35,41 @@ static int pkg_do(char *); static void show_version(Package, const char *, const char *); /* - * This is the traditional pkg_perform, except that the argument is _not_ - * a list of packages. It is the index file from the command line. + * This is the traditional pkg_perform, except that the argument is _not_ a + * list of packages. It is the index file from the command line. * - * We loop over the installed packages, matching them with the -s flag - * if needed and calling pkg_do(). Before hand we set up a few things, - * and after we tear them down... + * We loop over the installed packages, matching them with the -s flag if + * needed and calling pkg_do(). Beforehand we set up a few things, and after + * we tear them down... + * + * Returns 0 on success, non-zero on failure, corresponding to the number of + * failed attempts to access the INDEX. */ int pkg_perform(char **indexarg) { char **pkgs, *pat[2], **patterns; struct index_entry *ie; - int i, err_cnt = 0; + int i, err_cnt = 0, rel_major_ver; int MatchType; + struct utsname u; + + if (uname(&u) == -1) { + warn("%s(): failed to determine uname information", __func__); + return 1; + } else if ((rel_major_ver = (int) strtol(u.release, NULL, 10)) <= 0) { + + } + /* * Try to find and open the INDEX. We only check IndexFile != NULL * later, if we actually need the INDEX. */ - if (*indexarg == NULL) - snprintf(IndexPath, sizeof(IndexPath), "%s/%s", PORTS_DIR, INDEX_FNAME); - else + if (*indexarg == NULL) { + snprintf(IndexPath, sizeof(IndexPath), "%s/INDEX-%d", PORTS_DIR, + rel_major_ver); + } else strlcpy(IndexPath, *indexarg, sizeof(IndexPath)); if (isURL(IndexPath)) IndexFile = fetchGetURL(IndexPath, ""); From owner-svn-src-stable-8@FreeBSD.ORG Mon May 21 21:16:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5D7D1065670; Mon, 21 May 2012 21:16:08 +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 AF2FD8FC1B; Mon, 21 May 2012 21:16:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LLG8OM073051; Mon, 21 May 2012 21:16:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LLG8V0073045; Mon, 21 May 2012 21:16:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205212116.q4LLG8V0073045@svn.freebsd.org> From: John Baldwin Date: Mon, 21 May 2012 21:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235742 - in stable/8/sys: ddb gdb kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:16:08 -0000 Author: jhb Date: Mon May 21 21:16:08 2012 New Revision: 235742 URL: http://svn.freebsd.org/changeset/base/235742 Log: MFC 234190,234196,234280: - Extend the KDB interface to add a per-debugger callback to print a backtrace for an arbitrary thread (rather than the calling thread). A kdb_backtrace_thread() wrapper function uses the configured debugger if possible, otherwise it falls back to using stack(9) if that is available. - Replace a direct call to db_trace_thread() in propagate_priority() with a call to kdb_backtrace_thread() instead. Modified: stable/8/sys/ddb/db_main.c stable/8/sys/gdb/gdb_main.c stable/8/sys/kern/subr_kdb.c stable/8/sys/kern/subr_turnstile.c stable/8/sys/sys/kdb.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/ddb/db_main.c ============================================================================== --- stable/8/sys/ddb/db_main.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/ddb/db_main.c Mon May 21 21:16:08 2012 (r235742) @@ -51,8 +51,10 @@ SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFL static dbbe_init_f db_init; static dbbe_trap_f db_trap; static dbbe_trace_f db_trace_self_wrapper; +static dbbe_trace_thread_f db_trace_thread_wrapper; -KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap); +KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper, + db_trap); vm_offset_t ksym_start, ksym_end; @@ -246,3 +248,15 @@ db_trace_self_wrapper(void) db_trace_self(); (void)kdb_jmpbuf(prev_jb); } + +static void +db_trace_thread_wrapper(struct thread *td) +{ + jmp_buf jb; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) == 0) + db_trace_thread(td, -1); + (void)kdb_jmpbuf(prev_jb); +} Modified: stable/8/sys/gdb/gdb_main.c ============================================================================== --- stable/8/sys/gdb/gdb_main.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/gdb/gdb_main.c Mon May 21 21:16:08 2012 (r235742) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); static dbbe_init_f gdb_init; static dbbe_trap_f gdb_trap; -KDB_BACKEND(gdb, gdb_init, NULL, gdb_trap); +KDB_BACKEND(gdb, gdb_init, NULL, NULL, gdb_trap); static struct gdb_dbgport null_gdb_dbgport; DATA_SET(gdb_dbgport_set, null_gdb_dbgport); Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/kern/subr_kdb.c Mon May 21 21:16:08 2012 (r235742) @@ -71,7 +71,7 @@ struct trapframe *kdb_frame = NULL; static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; -KDB_BACKEND(null, NULL, NULL, NULL); +KDB_BACKEND(null, NULL, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS); @@ -384,6 +384,7 @@ kdb_backtrace(void) struct stack st; printf("KDB: stack backtrace:\n"); + stack_zero(&st); stack_save(&st); stack_print_ddb(&st); } @@ -391,6 +392,30 @@ kdb_backtrace(void) } /* + * Similar to kdb_backtrace() except that it prints a backtrace of an + * arbitrary thread rather than the calling thread. + */ +void +kdb_backtrace_thread(struct thread *td) +{ + + if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace_thread != NULL) { + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + kdb_dbbe->dbbe_trace_thread(td); + } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + stack_zero(&st); + stack_save_td(&st, td); + stack_print_ddb(&st); + } +#endif +} + +/* * Set/change the current backend. */ Modified: stable/8/sys/kern/subr_turnstile.c ============================================================================== --- stable/8/sys/kern/subr_turnstile.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/kern/subr_turnstile.c Mon May 21 21:16:08 2012 (r235742) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB -#include #include #include #include @@ -216,9 +216,7 @@ propagate_priority(struct thread *td) printf( "Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n", td->td_tid, td->td_proc->p_pid); -#ifdef DDB - db_trace_thread(td, -1); -#endif + kdb_backtrace_thread(td); panic("sleeping thread"); } Modified: stable/8/sys/sys/kdb.h ============================================================================== --- stable/8/sys/sys/kdb.h Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/sys/kdb.h Mon May 21 21:16:08 2012 (r235742) @@ -31,31 +31,34 @@ #include +struct pcb; +struct thread; +struct trapframe; + typedef int dbbe_init_f(void); typedef void dbbe_trace_f(void); +typedef void dbbe_trace_thread_f(struct thread *); typedef int dbbe_trap_f(int, int); struct kdb_dbbe { const char *dbbe_name; dbbe_init_f *dbbe_init; dbbe_trace_f *dbbe_trace; + dbbe_trace_thread_f *dbbe_trace_thread; dbbe_trap_f *dbbe_trap; int dbbe_active; }; -#define KDB_BACKEND(name, init, trace, trap) \ +#define KDB_BACKEND(name, init, trace, trace_thread, trap) \ static struct kdb_dbbe name##_dbbe = { \ .dbbe_name = #name, \ .dbbe_init = init, \ .dbbe_trace = trace, \ + .dbbe_trace_thread = trace_thread, \ .dbbe_trap = trap \ }; \ DATA_SET(kdb_dbbe_set, name##_dbbe) -struct pcb; -struct thread; -struct trapframe; - extern int kdb_active; /* Non-zero while in debugger. */ extern int debugger_on_panic; /* enter the debugger on panic. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ @@ -67,6 +70,7 @@ int kdb_alt_break(int, int *); int kdb_alt_break_gdb(int, int *); int kdb_break(void); void kdb_backtrace(void); +void kdb_backtrace_thread(struct thread *); int kdb_dbbe_select(const char *); void kdb_enter(const char *, const char *); void kdb_init(void); From owner-svn-src-stable-8@FreeBSD.ORG Mon May 21 22:23:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 148AE106566B; Mon, 21 May 2012 22:23:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F13928FC1D; Mon, 21 May 2012 22:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMNLgh076235; Mon, 21 May 2012 22:23:21 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMNLDJ076233; Mon, 21 May 2012 22:23:21 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205212223.q4LMNLDJ076233@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 May 2012 22:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235748 - stable/8/sys/dev/mfi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:23:22 -0000 Author: sbruno Date: Mon May 21 22:23:21 2012 New Revision: 235748 URL: http://svn.freebsd.org/changeset/base/235748 Log: MFC r235634 Fix and update battery status bits according to linux driver Modified: stable/8/sys/dev/mfi/mfireg.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfireg.h ============================================================================== --- stable/8/sys/dev/mfi/mfireg.h Mon May 21 22:21:00 2012 (r235747) +++ stable/8/sys/dev/mfi/mfireg.h Mon May 21 22:23:21 2012 (r235748) @@ -1377,8 +1377,13 @@ struct mfi_bbu_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) +#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 3) +#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 4) +#define MFI_BBU_STATE_LEARN_CYC_REQ (1 << 5) +#define MFI_BBU_STATE_LEARN_CYC_ACTIVE (1 << 6) +#define MFI_BBU_STATE_LEARN_CYC_FAIL (1 << 7) +#define MFI_BBU_STATE_LEARN_CYC_TIMEOUT (1 << 8) +#define MFI_BBU_STATE_I2C_ERR_DETECT (1 << 9) uint8_t pad[20]; union mfi_bbu_status_detail detail; } __packed; From owner-svn-src-stable-8@FreeBSD.ORG Wed May 23 02:12:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D29A106564A; Wed, 23 May 2012 02:12:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E984F8FC17; Wed, 23 May 2012 02:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4N2C0jl042276; Wed, 23 May 2012 02:12:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N2C0dI042273; Wed, 23 May 2012 02:12:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230212.q4N2C0dI042273@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 02:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235819 - stable/8/sys/dev/bce X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 02:12:01 -0000 Author: yongari Date: Wed May 23 02:12:00 2012 New Revision: 235819 URL: http://svn.freebsd.org/changeset/base/235819 Log: MFC r235151: Implement basic remote PHY support. Remote PHY allows the controller to perform MDIO type accesses to a remote transceiver using message pages defined through MRBE(multirate backplane ethernet). It's used in blade systems(e.g Dell Blade m610) which are connected to pass-through blades rather than traditional switches. This change directly manipulates firmware's mailboxes to control remote PHY such that it does not use mii(4). Alternatively, as David said, it could be implemented in brgphy(4) by creating a fake PHY and let brgphy(4) do necessary mii accesses and bce(4) can implement mailbox accesses based on the type of brgphy(4)'s mii accesses. Personally, I think it would make brgphy(4) hard to maintain since it would have to access many bce(4) registers in brgphy(4). Given that there are users who are suffering from lack of remote PHY support, it would be better to get working system rather than waiting for complete/perfect implementation. Modified: stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bce/if_bcereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Wed May 23 02:02:29 2012 (r235818) +++ stable/8/sys/dev/bce/if_bce.c Wed May 23 02:12:00 2012 (r235819) @@ -364,6 +364,7 @@ static int bce_nvram_write (struct bce static void bce_get_rx_buffer_sizes(struct bce_softc *, int); static void bce_get_media (struct bce_softc *); static void bce_init_media (struct bce_softc *); +static u32 bce_get_rphy_link (struct bce_softc *); static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); static int bce_dma_alloc (device_t); static void bce_dma_free (struct bce_softc *); @@ -372,6 +373,7 @@ static void bce_release_resources (struc /****************************************************************************/ /* BCE Firmware Synchronization and Load */ /****************************************************************************/ +static void bce_fw_cap_init (struct bce_softc *); static int bce_fw_sync (struct bce_softc *, u32); static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); static void bce_load_cpu_fw (struct bce_softc *, @@ -418,6 +420,7 @@ static void bce_watchdog (struct bce_s static int bce_ifmedia_upd (struct ifnet *); static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); +static void bce_ifmedia_sts_rphy (struct bce_softc *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); @@ -757,6 +760,13 @@ bce_print_adapter_info(struct bce_softc printf("2.5G"); i++; } + if (sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) { + if (i > 0) printf("|"); + printf("Remote PHY(%s)", + sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG ? + "FIBER" : "TP"); i++; + } + if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { if (i > 0) printf("|"); printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); @@ -1297,6 +1307,9 @@ bce_attach(device_t dev) if (val & BCE_PCICFG_MISC_STATUS_32BIT_DET) sc->bce_flags |= BCE_PCI_32BIT_FLAG; + /* Find the media type for the adapter. */ + bce_get_media(sc); + /* Reset controller and announce to bootcode that driver is present. */ if (bce_reset(sc, BCE_DRV_MSG_CODE_RESET)) { BCE_PRINTF("%s(%d): Controller reset failed!\n", @@ -1344,9 +1357,6 @@ bce_attach(device_t dev) /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; - /* Find the media type for the adapter. */ - bce_get_media(sc); - /* Store data needed by PHY driver for backplane applications */ sc->bce_shared_hw_cfg = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); sc->bce_port_hw_cfg = bce_shmem_rd(sc, BCE_PORT_HW_CFG_CONFIG); @@ -1386,6 +1396,15 @@ bce_attach(device_t dev) ifp->if_capabilities = BCE_IF_CAPABILITIES; } +#if __FreeBSD_version >= 800505 + /* + * Introducing IFCAP_LINKSTATE didn't bump __FreeBSD_version + * so it's approximate value. + */ + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + ifp->if_capabilities |= IFCAP_LINKSTATE; +#endif + ifp->if_capenable = ifp->if_capabilities; /* @@ -1409,14 +1428,52 @@ bce_attach(device_t dev) /* Handle any special PHY initialization for SerDes PHYs. */ bce_init_media(sc); - /* MII child bus by attaching the PHY. */ - rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, - bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, - MII_OFFSET_ANY, MIIF_DOPAUSE | MIIF_FORCEPAUSE); - if (rc != 0) { - BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, - __LINE__); - goto bce_attach_fail; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + ifmedia_init(&sc->bce_ifmedia, IFM_IMASK, bce_ifmedia_upd, + bce_ifmedia_sts); + /* + * We can't manually override remote PHY's link and assume + * PHY port configuration(Fiber or TP) is not changed after + * device attach. This may not be correct though. + */ + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) { + if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_2500_SX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_2500_SX | IFM_FDX, 0, NULL); + } + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_SX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_SX | IFM_FDX, 0, NULL); + } else { + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_10_T, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_100_TX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_T, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); + } + ifmedia_add(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO); + sc->bce_ifmedia.ifm_media = sc->bce_ifmedia.ifm_cur->ifm_media; + } else { + /* MII child bus by attaching the PHY. */ + rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, + bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, + MII_OFFSET_ANY, MIIF_DOPAUSE | MIIF_FORCEPAUSE); + if (rc != 0) { + BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, + __LINE__); + goto bce_attach_fail; + } } /* Attach to the Ethernet interface list. */ @@ -1521,8 +1578,12 @@ bce_detach(device_t dev) ether_ifdetach(ifp); /* If we have a child device on the MII bus remove it too. */ - bus_generic_detach(dev); - device_delete_child(dev, sc->bce_miibus); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + ifmedia_removeall(&sc->bce_ifmedia); + else { + bus_generic_detach(dev); + device_delete_child(dev, sc->bce_miibus); + } /* Release all remaining resources. */ bce_release_resources(sc); @@ -1983,13 +2044,23 @@ bce_miibus_statchg(device_t dev) { struct bce_softc *sc; struct mii_data *mii; - int val; + struct ifmediareq ifmr; + int media_active, media_status, val; sc = device_get_softc(dev); DBENTER(BCE_VERBOSE_PHY); - mii = device_get_softc(sc->bce_miibus); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + bzero(&ifmr, sizeof(ifmr)); + bce_ifmedia_sts_rphy(sc, &ifmr); + media_active = ifmr.ifm_active; + media_status = ifmr.ifm_status; + } else { + mii = device_get_softc(sc->bce_miibus); + media_active = mii->mii_media_active; + media_status = mii->mii_media_status; + } val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | @@ -1997,7 +2068,7 @@ bce_miibus_statchg(device_t dev) BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - switch (IFM_SUBTYPE(mii->mii_media_active)) { + switch (IFM_SUBTYPE(media_active)) { case IFM_10_T: if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { DBPRINT(sc, BCE_INFO_PHY, @@ -2026,7 +2097,7 @@ bce_miibus_statchg(device_t dev) } /* Set half or full duplex based on PHY settings. */ - if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { + if ((IFM_OPTIONS(media_active) & IFM_FDX) == 0) { DBPRINT(sc, BCE_INFO_PHY, "Setting Half-Duplex interface.\n"); val |= BCE_EMAC_MODE_HALF_DUPLEX; @@ -2036,7 +2107,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((IFM_OPTIONS(media_active) & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2046,7 +2117,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -3130,7 +3201,8 @@ bce_get_media_exit: static void bce_init_media(struct bce_softc *sc) { - if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if ((sc->bce_phy_flags & (BCE_PHY_IEEE_CLAUSE_45_FLAG | + BCE_PHY_REMOTE_CAP_FLAG)) == BCE_PHY_IEEE_CLAUSE_45_FLAG) { /* * Configure 5709S/5716S PHYs to use traditional IEEE * Clause 22 method. Otherwise we have no way to attach @@ -5018,6 +5090,8 @@ bce_reset(struct bce_softc *sc, u32 rese if (rc) BCE_PRINTF("%s(%d): Firmware did not complete " "initialization!\n", __FILE__, __LINE__); + /* Get firmware capabilities. */ + bce_fw_cap_init(sc); bce_reset_exit: DBEXIT(BCE_VERBOSE_RESET); @@ -6081,6 +6155,55 @@ bce_free_pg_chain(struct bce_softc *sc) } +static u32 +bce_get_rphy_link(struct bce_softc *sc) +{ + u32 advertise, link; + int fdpx; + + advertise = 0; + fdpx = 0; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) + link = bce_shmem_rd(sc, BCE_RPHY_SERDES_LINK); + else + link = bce_shmem_rd(sc, BCE_RPHY_COPPER_LINK); + if (link & BCE_NETLINK_ANEG_ENB) + advertise |= BCE_NETLINK_ANEG_ENB; + if (link & BCE_NETLINK_SPEED_10HALF) + advertise |= BCE_NETLINK_SPEED_10HALF; + if (link & BCE_NETLINK_SPEED_10FULL) { + advertise |= BCE_NETLINK_SPEED_10FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_100HALF) + advertise |= BCE_NETLINK_SPEED_100HALF; + if (link & BCE_NETLINK_SPEED_100FULL) { + advertise |= BCE_NETLINK_SPEED_100FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_1000HALF) + advertise |= BCE_NETLINK_SPEED_1000HALF; + if (link & BCE_NETLINK_SPEED_1000FULL) { + advertise |= BCE_NETLINK_SPEED_1000FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_2500HALF) + advertise |= BCE_NETLINK_SPEED_2500HALF; + if (link & BCE_NETLINK_SPEED_2500FULL) { + advertise |= BCE_NETLINK_SPEED_2500FULL; + fdpx++; + } + if (fdpx) + advertise |= BCE_NETLINK_FC_PAUSE_SYM | + BCE_NETLINK_FC_PAUSE_ASYM; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + advertise |= BCE_NETLINK_PHY_APP_REMOTE | + BCE_NETLINK_ETH_AT_WIRESPEED; + + return (advertise); +} + + /****************************************************************************/ /* Set media options. */ /* */ @@ -6116,21 +6239,110 @@ bce_ifmedia_upd_locked(struct ifnet *ifp struct bce_softc *sc = ifp->if_softc; struct mii_data *mii; struct mii_softc *miisc; - int error; + struct ifmedia *ifm; + u32 link; + int error, fdx; DBENTER(BCE_VERBOSE_PHY); error = 0; BCE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->bce_miibus); + sc->bce_link_up = FALSE; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + ifm = &sc->bce_ifmedia; + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) + return (EINVAL); + link = 0; + fdx = IFM_OPTIONS(ifm->ifm_media) & IFM_FDX; + switch(IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_AUTO: + /* + * Check advertised link of remote PHY by reading + * BCE_RPHY_SERDES_LINK or BCE_RPHY_COPPER_LINK. + * Always use the same link type of remote PHY. + */ + link = bce_get_rphy_link(sc); + break; + case IFM_2500_SX: + if ((sc->bce_phy_flags & + (BCE_PHY_REMOTE_PORT_FIBER_FLAG | + BCE_PHY_2_5G_CAPABLE_FLAG)) == 0) + return (EINVAL); + /* + * XXX + * Have to enable forced 2.5Gbps configuration. + */ + if (fdx != 0) + link |= BCE_NETLINK_SPEED_2500FULL; + else + link |= BCE_NETLINK_SPEED_2500HALF; + break; + case IFM_1000_SX: + if ((sc->bce_phy_flags & + BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + return (EINVAL); + /* + * XXX + * Have to disable 2.5Gbps configuration. + */ + if (fdx != 0) + link = BCE_NETLINK_SPEED_1000FULL; + else + link = BCE_NETLINK_SPEED_1000HALF; + break; + case IFM_1000_T: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_1000FULL; + else + link = BCE_NETLINK_SPEED_1000HALF; + break; + case IFM_100_TX: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_100FULL; + else + link = BCE_NETLINK_SPEED_100HALF; + break; + case IFM_10_T: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_10FULL; + else + link = BCE_NETLINK_SPEED_10HALF; + break; + default: + return (EINVAL); + } + if (IFM_SUBTYPE(ifm->ifm_media) != IFM_AUTO) { + /* + * XXX + * Advertise pause capability for full-duplex media. + */ + if (fdx != 0) + link |= BCE_NETLINK_FC_PAUSE_SYM | + BCE_NETLINK_FC_PAUSE_ASYM; + if ((sc->bce_phy_flags & + BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + link |= BCE_NETLINK_PHY_APP_REMOTE | + BCE_NETLINK_ETH_AT_WIRESPEED; + } - /* Make sure the MII bus has been enumerated. */ - if (mii) { - sc->bce_link_up = FALSE; - LIST_FOREACH(miisc, &mii->mii_phys, mii_list) - mii_phy_reset(miisc); - error = mii_mediachg(mii); + bce_shmem_wr(sc, BCE_MB_ARGS_0, link); + error = bce_fw_sync(sc, BCE_DRV_MSG_CODE_CMD_SET_LINK); + } else { + mii = device_get_softc(sc->bce_miibus); + + /* Make sure the MII bus has been enumerated. */ + if (mii) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + error = mii_mediachg(mii); + } } DBEXIT(BCE_VERBOSE_PHY); @@ -6138,6 +6350,85 @@ bce_ifmedia_upd_locked(struct ifnet *ifp } +static void +bce_ifmedia_sts_rphy(struct bce_softc *sc, struct ifmediareq *ifmr) +{ + struct ifnet *ifp; + u32 link; + + ifp = sc->bce_ifp; + BCE_LOCK_ASSERT(sc); + + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER; + link = bce_shmem_rd(sc, BCE_LINK_STATUS); + /* XXX Handle heart beat status? */ + if ((link & BCE_LINK_STATUS_LINK_UP) != 0) + ifmr->ifm_status |= IFM_ACTIVE; + else { + ifmr->ifm_active |= IFM_NONE; + ifp->if_baudrate = 0; + return; + } + switch (link & BCE_LINK_STATUS_SPEED_MASK) { + case BCE_LINK_STATUS_10HALF: + ifmr->ifm_active |= IFM_10_T | IFM_HDX; + ifp->if_baudrate = IF_Mbps(10UL); + break; + case BCE_LINK_STATUS_10FULL: + ifmr->ifm_active |= IFM_10_T | IFM_FDX; + ifp->if_baudrate = IF_Mbps(10UL); + break; + case BCE_LINK_STATUS_100HALF: + ifmr->ifm_active |= IFM_100_TX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(100UL); + break; + case BCE_LINK_STATUS_100FULL: + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(100UL); + break; + case BCE_LINK_STATUS_1000HALF: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + ifmr->ifm_active |= IFM_1000_T | IFM_HDX; + else + ifmr->ifm_active |= IFM_1000_SX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(1000UL); + break; + case BCE_LINK_STATUS_1000FULL: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + else + ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(1000UL); + break; + case BCE_LINK_STATUS_2500HALF: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { + ifmr->ifm_active |= IFM_NONE; + return; + } else + ifmr->ifm_active |= IFM_2500_SX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(2500UL); + break; + case BCE_LINK_STATUS_2500FULL: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { + ifmr->ifm_active |= IFM_NONE; + return; + } else + ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(2500UL); + break; + default: + ifmr->ifm_active |= IFM_NONE; + return; + } + + if ((link & BCE_LINK_STATUS_RX_FC_ENABLED) != 0) + ifmr->ifm_active |= IFM_ETH_RXPAUSE; + if ((link & BCE_LINK_STATUS_TX_FC_ENABLED) != 0) + ifmr->ifm_active |= IFM_ETH_TXPAUSE; +} + + /****************************************************************************/ /* Reports current media status. */ /* */ @@ -6158,11 +6449,15 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_UNLOCK(sc); return; } - mii = device_get_softc(sc->bce_miibus); - mii_pollstat(mii); - ifmr->ifm_active = mii->mii_media_active; - ifmr->ifm_status = mii->mii_media_status; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + bce_ifmedia_sts_rphy(sc, ifmr); + else { + mii = device_get_softc(sc->bce_miibus); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + } BCE_UNLOCK(sc); @@ -6199,14 +6494,26 @@ bce_phy_intr(struct bce_softc *sc) STATUS_ATTN_BITS_LINK_STATE); DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now UP.\n", __FUNCTION__); - } - else { + } else { REG_WR(sc, BCE_PCICFG_STATUS_BIT_CLEAR_CMD, STATUS_ATTN_BITS_LINK_STATE); DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + if (new_link_state) { + if (bootverbose) + if_printf(sc->bce_ifp, "link UP\n"); + if_link_state_change(sc->bce_ifp, + LINK_STATE_UP); + } else { + if (bootverbose) + if_printf(sc->bce_ifp, "link DOWN\n"); + if_link_state_change(sc->bce_ifp, + LINK_STATE_DOWN); + } + } /* * Assume link is down and allow * tick routine to update the state @@ -7495,10 +7802,14 @@ bce_ioctl(struct ifnet *ifp, u_long comm case SIOCGIFMEDIA: DBPRINT(sc, BCE_VERBOSE_MISC, "Received SIOCSIFMEDIA/SIOCGIFMEDIA\n"); - - mii = device_get_softc(sc->bce_miibus); - error = ifmedia_ioctl(ifp, ifr, - &mii->mii_media, command); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + error = ifmedia_ioctl(ifp, ifr, &sc->bce_ifmedia, + command); + else { + mii = device_get_softc(sc->bce_miibus); + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, + command); + } break; /* Set interface capability */ @@ -8163,6 +8474,7 @@ bce_tick(void *xsc) struct bce_softc *sc = xsc; struct mii_data *mii; struct ifnet *ifp; + struct ifmediareq ifmr; ifp = sc->bce_ifp; @@ -8193,21 +8505,32 @@ bce_tick(void *xsc) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ - mii = device_get_softc(sc->bce_miibus); - mii_tick(mii); - - /* Check if the link has come up. */ - if ((mii->mii_media_status & IFM_ACTIVE) && - (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { - DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Link up!\n", __FUNCTION__); - sc->bce_link_up = TRUE; - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && - (bce_verbose || bootverbose)) - BCE_PRINTF("Gigabit link up!\n"); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + bzero(&ifmr, sizeof(ifmr)); + bce_ifmedia_sts_rphy(sc, &ifmr); + if ((ifmr.ifm_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + sc->bce_link_up = TRUE; + bce_miibus_statchg(sc->bce_dev); + } + } else { + mii = device_get_softc(sc->bce_miibus); + mii_tick(mii); + /* Check if the link has come up. */ + if ((mii->mii_media_status & IFM_ACTIVE) && + (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { + DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Link up!\n", + __FUNCTION__); + sc->bce_link_up = TRUE; + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || + IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && + (bce_verbose || bootverbose)) + BCE_PRINTF("Gigabit link up!\n"); + } + } + if (sc->bce_link_up == TRUE) { /* Now that link is up, handle any outstanding TX traffic. */ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " @@ -8221,6 +8544,36 @@ bce_tick_exit: return; } +static void +bce_fw_cap_init(struct bce_softc *sc) +{ + u32 ack, cap, link; + + ack = 0; + cap = bce_shmem_rd(sc, BCE_FW_CAP_MB); + if ((cap & BCE_FW_CAP_SIGNATURE_MAGIC_MASK) != + BCE_FW_CAP_SIGNATURE_MAGIC) + return; + if ((cap & (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) == + (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) + ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | + BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN; + if ((sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) != 0 && + (cap & BCE_FW_CAP_REMOTE_PHY_CAP) != 0) { + sc->bce_phy_flags &= ~BCE_PHY_REMOTE_PORT_FIBER_FLAG; + sc->bce_phy_flags |= BCE_PHY_REMOTE_CAP_FLAG; + link = bce_shmem_rd(sc, BCE_LINK_STATUS); + if ((link & BCE_LINK_STATUS_SERDES_LINK) != 0) + sc->bce_phy_flags |= BCE_PHY_REMOTE_PORT_FIBER_FLAG; + ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | + BCE_FW_CAP_REMOTE_PHY_CAP; + } + + if (ack != 0) + bce_shmem_wr(sc, BCE_DRV_ACK_CAP_MB, ack); +} + + #ifdef BCE_DEBUG /****************************************************************************/ /* Allows the driver state to be dumped through the sysctl interface. */ Modified: stable/8/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/8/sys/dev/bce/if_bcereg.h Wed May 23 02:02:29 2012 (r235818) +++ stable/8/sys/dev/bce/if_bcereg.h Wed May 23 02:12:00 2012 (r235819) @@ -814,6 +814,23 @@ struct flash_spec { #define BCE_DRV_PULSE_SEQ_MASK 0x00007fff #define BCE_MB_ARGS_0 0x00000014 +#define BCE_NETLINK_SPEED_10HALF (1<<0) +#define BCE_NETLINK_SPEED_10FULL (1<<1) +#define BCE_NETLINK_SPEED_100HALF (1<<2) +#define BCE_NETLINK_SPEED_100FULL (1<<3) +#define BCE_NETLINK_SPEED_1000HALF (1<<4) +#define BCE_NETLINK_SPEED_1000FULL (1<<5) +#define BCE_NETLINK_SPEED_2500HALF (1<<6) +#define BCE_NETLINK_SPEED_2500FULL (1<<7) +#define BCE_NETLINK_SPEED_10GHALF (1<<8) +#define BCE_NETLINK_SPEED_10GFULL (1<<9) +#define BCE_NETLINK_ANEG_ENB (1<<10) +#define BCE_NETLINK_PHY_APP_REMOTE (1<<11) +#define BCE_NETLINK_FC_PAUSE_SYM (1<<12) +#define BCE_NETLINK_FC_PAUSE_ASYM (1<<13) +#define BCE_NETLINK_ETH_AT_WIRESPEED (1<<14) +#define BCE_NETLINK_PHY_RESET (1<<15) + #define BCE_MB_ARGS_1 0x00000018 /* Indicate to the firmware not to go into the @@ -1079,6 +1096,26 @@ struct flash_spec { #define BCE_BC_STATE_BC_DBG_CMD_LOOP_CNT_MASK 0xffff #define BCE_BC_STATE_BC_DBG_CMD_LOOP_INFINITE 0xffff +#define BCE_FW_EVT_CODE_MB 0x00000354 +#define BCE_FW_EVT_CODE_SW_TIMER_EXPIRE_EVENT 0x00000000 +#define BCE_FW_EVT_CODE_LINK_EVENT 0x00000001 + +#define BCE_DRV_ACK_CAP_MB 0x00000364 +#define BCE_DRV_ACK_CAP_SIGNATURE_MAGIC 0x35450000 + +#define BCE_FW_CAP_MB 0x00000368 +#define BCE_FW_CAP_SIGNATURE_MAGIC 0xaa550000 +#define BCE_FW_ACK_SIGNATURE_MAGIC 0x52500000 +#define BCE_FW_CAP_SIGNATURE_MAGIC_MASK 0xffff0000 +#define BCE_FW_CAP_REMOTE_PHY_CAP 0x00000001 +#define BCE_FW_CAP_REMOTE_PHY_PRESENT 0x00000002 +#define BCE_FW_CAP_MFW_KEEP_VLAN 0x00000008 +#define BCE_FW_CAP_BC_KEEP_VLAN 0x00000010 + +#define BCE_RPHY_SERDES_LINK 0x00000374 + +#define BCE_RPHY_COPPER_LINK 0x00000378 + #define HOST_VIEW_SHMEM_BASE 0x167c00 /* @@ -6454,6 +6491,8 @@ struct bce_softc #define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG 0x00000100 #define BCE_PHY_INT_MODE_LINK_READY_FLAG 0x00000200 #define BCE_PHY_IEEE_CLAUSE_45_FLAG 0x00000400 +#define BCE_PHY_REMOTE_CAP_FLAG 0x00000800 +#define BCE_PHY_REMOTE_PORT_FIBER_FLAG 0x00001000 /* Values that need to be shared with the PHY driver. */ u32 bce_shared_hw_cfg; From owner-svn-src-stable-8@FreeBSD.ORG Wed May 23 15:47:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C6491065674; Wed, 23 May 2012 15:47:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D6808FC14; Wed, 23 May 2012 15:47:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NFl8Ui081740; Wed, 23 May 2012 15:47:08 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NFl7sN081737; Wed, 23 May 2012 15:47:07 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205231547.q4NFl7sN081737@svn.freebsd.org> From: Jamie Gritton Date: Wed, 23 May 2012 15:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235841 - stable/8/usr.sbin/jls X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:47:08 -0000 Author: jamie Date: Wed May 23 15:47:07 2012 New Revision: 235841 URL: http://svn.freebsd.org/changeset/base/235841 Log: MFC r222465, r223224, r224841, r232613: Check for IPv4 or IPv6 to be available by the kernel to not provoke errors trying to query options not available. Make it possible to compile out INET or INET6 only parts. PR: bin/161957 Modified: stable/8/usr.sbin/jls/Makefile stable/8/usr.sbin/jls/jls.c Directory Properties: stable/8/usr.sbin/jls/ (props changed) Modified: stable/8/usr.sbin/jls/Makefile ============================================================================== --- stable/8/usr.sbin/jls/Makefile Wed May 23 15:30:13 2012 (r235840) +++ stable/8/usr.sbin/jls/Makefile Wed May 23 15:47:07 2012 (r235841) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= jls MAN= jls.8 DPADD= ${LIBJAIL} @@ -7,4 +9,11 @@ LDADD= -ljail WARNS?= 6 +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif + .include Modified: stable/8/usr.sbin/jls/jls.c ============================================================================== --- stable/8/usr.sbin/jls/jls.c Wed May 23 15:30:13 2012 (r235840) +++ stable/8/usr.sbin/jls/jls.c Wed May 23 15:47:07 2012 (r235841) @@ -59,6 +59,12 @@ __FBSDID("$FreeBSD$"); static struct jailparam *params; static int *param_parent; static int nparams; +#ifdef INET6 +static int ip6_ok; +#endif +#ifdef INET +static int ip4_ok; +#endif static int add_param(const char *name, void *value, size_t valuelen, struct jailparam *source, unsigned flags); @@ -112,6 +118,13 @@ main(int argc, char **argv) errx(1, "usage: jls [-dhnqv] [-j jail] [param ...]"); } +#ifdef INET6 + ip6_ok = feature_present("inet6"); +#endif +#ifdef INET + ip4_ok = feature_present("inet"); +#endif + /* Add the parameters to print. */ if (optind == argc) { if (pflags & (PRINT_HEADER | PRINT_NAMEVAL)) @@ -124,13 +137,24 @@ main(int argc, char **argv) add_param("name", NULL, (size_t)0, NULL, JP_USER); add_param("dying", NULL, (size_t)0, NULL, JP_USER); add_param("cpuset.id", NULL, (size_t)0, NULL, JP_USER); - add_param("ip4.addr", NULL, (size_t)0, NULL, JP_USER); - add_param("ip6.addr", NULL, (size_t)0, NULL, - JP_USER | JP_OPT); +#ifdef INET + if (ip4_ok) + add_param("ip4.addr", NULL, (size_t)0, NULL, + JP_USER); +#endif +#ifdef INET6 + if (ip6_ok) + add_param("ip6.addr", NULL, (size_t)0, NULL, + JP_USER | JP_OPT); +#endif } else { pflags |= PRINT_DEFAULT; add_param("jid", NULL, (size_t)0, NULL, JP_USER); - add_param("ip4.addr", NULL, (size_t)0, NULL, JP_USER); +#ifdef INET + if (ip4_ok) + add_param("ip4.addr", NULL, (size_t)0, NULL, + JP_USER); +#endif add_param("host.hostname", NULL, (size_t)0, NULL, JP_USER); add_param("path", NULL, (size_t)0, NULL, JP_USER); @@ -327,7 +351,7 @@ print_jail(int pflags, int jflags) { char *nname; char **param_values; - int i, ai, jid, count, spc; + int i, ai, jid, count, n, spc; char ipbuf[INET6_ADDRSTRLEN]; jid = jailparam_get(params, nparams, jflags); @@ -345,31 +369,47 @@ print_jail(int pflags, int jflags) *(int *)params[4].jp_value ? "DYING" : "ACTIVE", "", *(int *)params[5].jp_value); - count = params[6].jp_valuelen / sizeof(struct in_addr); - for (ai = 0; ai < count; ai++) - if (inet_ntop(AF_INET, - &((struct in_addr *)params[6].jp_value)[ai], - ipbuf, sizeof(ipbuf)) == NULL) - err(1, "inet_ntop"); - else - printf("%6s %-15.15s\n", "", ipbuf); - if (!strcmp(params[7].jp_name, "ip6.addr")) { - count = params[7].jp_valuelen / sizeof(struct in6_addr); + n = 6; +#ifdef INET + if (ip4_ok && !strcmp(params[n].jp_name, "ip4.addr")) { + count = params[n].jp_valuelen / sizeof(struct in_addr); + for (ai = 0; ai < count; ai++) + if (inet_ntop(AF_INET, + &((struct in_addr *)params[n].jp_value)[ai], + ipbuf, sizeof(ipbuf)) == NULL) + err(1, "inet_ntop"); + else + printf("%6s %-15.15s\n", "", ipbuf); + n++; + } +#endif +#ifdef INET6 + if (ip6_ok && !strcmp(params[n].jp_name, "ip6.addr")) { + count = params[n].jp_valuelen / sizeof(struct in6_addr); for (ai = 0; ai < count; ai++) if (inet_ntop(AF_INET6, - &((struct in6_addr *)params[7].jp_value)[ai], + &((struct in6_addr *) + params[n].jp_value)[ai], ipbuf, sizeof(ipbuf)) == NULL) err(1, "inet_ntop"); else printf("%6s %s\n", "", ipbuf); + n++; } +#endif } else if (pflags & PRINT_DEFAULT) printf("%6d %-15.15s %-29.29s %.74s\n", *(int *)params[0].jp_value, - params[1].jp_valuelen == 0 ? "-" +#ifdef INET + (!ip4_ok || params[1].jp_valuelen == 0) ? "-" : inet_ntoa(*(struct in_addr *)params[1].jp_value), - (char *)params[2].jp_value, - (char *)params[3].jp_value); + (char *)params[2-!ip4_ok].jp_value, + (char *)params[3-!ip4_ok].jp_value); +#else + "-", + (char *)params[1].jp_value, + (char *)params[2].jp_value); +#endif else { param_values = alloca(nparams * sizeof(*param_values)); for (i = 0; i < nparams; i++) { From owner-svn-src-stable-8@FreeBSD.ORG Wed May 23 16:43:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED6710657DC; Wed, 23 May 2012 16:43:38 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4984B8FC08; Wed, 23 May 2012 16:43:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NGhcow084108; Wed, 23 May 2012 16:43:38 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NGhcxD084106; Wed, 23 May 2012 16:43:38 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205231643.q4NGhcxD084106@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 23 May 2012 16:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235844 - stable/8/sys/dev/iwn X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 16:43:38 -0000 Author: bschmidt Date: Wed May 23 16:43:37 2012 New Revision: 235844 URL: http://svn.freebsd.org/changeset/base/235844 Log: MFC r235684: Add some more 100/130 series device IDs. Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Wed May 23 16:43:16 2012 (r235843) +++ stable/8/sys/dev/iwn/if_iwn.c Wed May 23 16:43:37 2012 (r235844) @@ -92,6 +92,9 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, + { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" }, { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" }, { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" }, From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 01:24:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 668141065670; Thu, 24 May 2012 01:24:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 515428FC15; Thu, 24 May 2012 01:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O1Oo1i006533; Thu, 24 May 2012 01:24:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1OoOS006530; Thu, 24 May 2012 01:24:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240124.q4O1OoOS006530@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235867 - in stable/8: lib/libusbhid sys/dev/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:24:50 -0000 Author: mav Date: Thu May 24 01:24:49 2012 New Revision: 235867 URL: http://svn.freebsd.org/changeset/base/235867 Log: MFC r235510: HID Report ID is unsigned value, so clear the rest of bits from possible sign expansion. Modified: stable/8/lib/libusbhid/parse.c stable/8/sys/dev/usb/usb_hid.c Directory Properties: stable/8/lib/libusbhid/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/lib/libusbhid/parse.c ============================================================================== --- stable/8/lib/libusbhid/parse.c Thu May 24 01:23:30 2012 (r235866) +++ stable/8/lib/libusbhid/parse.c Thu May 24 01:24:49 2012 (r235867) @@ -392,7 +392,7 @@ hid_get_item(hid_data_t s, hid_item_t *h s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ Modified: stable/8/sys/dev/usb/usb_hid.c ============================================================================== --- stable/8/sys/dev/usb/usb_hid.c Thu May 24 01:23:30 2012 (r235866) +++ stable/8/sys/dev/usb/usb_hid.c Thu May 24 01:24:49 2012 (r235867) @@ -425,7 +425,7 @@ hid_get_item(struct hid_data *s, struct s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 01:30:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E450E106564A; Thu, 24 May 2012 01:30:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6C88FC19; Thu, 24 May 2012 01:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O1UHva006858; Thu, 24 May 2012 01:30:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1UHsm006855; Thu, 24 May 2012 01:30:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240130.q4O1UHsm006855@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235869 - stable/8/sys/dev/usb/input X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:30:18 -0000 Author: mav Date: Thu May 24 01:30:17 2012 New Revision: 235869 URL: http://svn.freebsd.org/changeset/base/235869 Log: MFC r235558, r235569: Add support for writing to HID devices through the interrupt output pipe. Supermicro LCD screen modules seem to not support accessing reports through the control pipes, but working fine with the interrupt pipes. Modified: stable/8/sys/dev/usb/input/uhid.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Thu May 24 01:28:58 2012 (r235868) +++ stable/8/sys/dev/usb/input/uhid.c Thu May 24 01:30:17 2012 (r235869) @@ -87,6 +87,7 @@ SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug #define UHID_FRAME_NUM 50 /* bytes, frame number */ enum { + UHID_INTR_DT_WR, UHID_INTR_DT_RD, UHID_CTRL_DT_WR, UHID_CTRL_DT_RD, @@ -128,7 +129,8 @@ static device_probe_t uhid_probe; static device_attach_t uhid_attach; static device_detach_t uhid_detach; -static usb_callback_t uhid_intr_callback; +static usb_callback_t uhid_intr_write_callback; +static usb_callback_t uhid_intr_read_callback; static usb_callback_t uhid_write_callback; static usb_callback_t uhid_read_callback; @@ -152,7 +154,36 @@ static struct usb_fifo_methods uhid_fifo }; static void -uhid_intr_callback(struct usb_xfer *xfer, usb_error_t error) +uhid_intr_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uhid_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int actlen; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + case USB_ST_SETUP: +tr_setup: + pc = usbd_xfer_get_frame(xfer, 0); + if (usb_fifo_get_data(sc->sc_fifo.fp[USB_FIFO_TX], pc, + 0, usbd_xfer_max_len(xfer), &actlen, 0)) { + usbd_xfer_set_frame_len(xfer, 0, actlen); + usbd_transfer_submit(xfer); + } + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +uhid_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) { struct uhid_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; @@ -327,13 +358,22 @@ uhid_read_callback(struct usb_xfer *xfer static const struct usb_config uhid_config[UHID_N_TRANSFER] = { + [UHID_INTR_DT_WR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = {.pipe_bof = 1,.no_pipe_ok = 1, }, + .bufsize = UHID_BSIZE, + .callback = &uhid_intr_write_callback, + }, + [UHID_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .bufsize = UHID_BSIZE, - .callback = &uhid_intr_callback, + .callback = &uhid_intr_read_callback, }, [UHID_CTRL_DT_WR] = { @@ -381,7 +421,12 @@ uhid_start_write(struct usb_fifo *fifo) { struct uhid_softc *sc = usb_fifo_softc(fifo); - usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + if ((sc->sc_flags & UHID_FLAG_IMMED) || + sc->sc_xfer[UHID_INTR_DT_WR] == NULL) { + usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + } else { + usbd_transfer_start(sc->sc_xfer[UHID_INTR_DT_WR]); + } } static void @@ -390,6 +435,7 @@ uhid_stop_write(struct usb_fifo *fifo) struct uhid_softc *sc = usb_fifo_softc(fifo); usbd_transfer_stop(sc->sc_xfer[UHID_CTRL_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[UHID_INTR_DT_WR]); } static int From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 01:43:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D88C1065674; Thu, 24 May 2012 01:43:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F396D8FC1B; Thu, 24 May 2012 01:43:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O1h8ED007633; Thu, 24 May 2012 01:43:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1h88L007630; Thu, 24 May 2012 01:43:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240143.q4O1h88L007630@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235872 - stable/8/sys/geom/raid X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:43:09 -0000 Author: mav Date: Thu May 24 01:43:08 2012 New Revision: 235872 URL: http://svn.freebsd.org/changeset/base/235872 Log: MFC r235270: - Prevent error status leak if write to some of the RAID1/1E volume disks failed while write to some other succeeded. Instead mark disk as failed. - Make RAID1E less aggressive in failing disks to avoid volume breakage. Modified: stable/8/sys/geom/raid/tr_raid1.c stable/8/sys/geom/raid/tr_raid1e.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1.c Thu May 24 01:41:54 2012 (r235871) +++ stable/8/sys/geom/raid/tr_raid1.c Thu May 24 01:43:08 2012 (r235872) @@ -893,7 +893,16 @@ rebuild_round_done: g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); } - error = bp->bio_error; + if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_inbed == 1 || pbp->bio_error != 0) + pbp->bio_error = bp->bio_error; + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); + g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + error = pbp->bio_error; + } else + error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; Modified: stable/8/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1e.c Thu May 24 01:41:54 2012 (r235871) +++ stable/8/sys/geom/raid/tr_raid1e.c Thu May 24 01:43:08 2012 (r235872) @@ -338,6 +338,9 @@ static void g_raid_tr_raid1e_fail_disk(struct g_raid_softc *sc, struct g_raid_subdisk *sd, struct g_raid_disk *disk) { + struct g_raid_volume *vol; + + vol = sd->sd_volume; /* * We don't fail the last disk in the pack, since it still has decent * data on it and that's better than failing the disk if it is the root @@ -347,8 +350,12 @@ g_raid_tr_raid1e_fail_disk(struct g_raid * the volume that has / on it. I can't think of a case where we'd * want the volume to go away on this kind of event. */ - if (g_raid_nsubdisks(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == 1 && - g_raid_get_subdisk(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == sd) + if ((g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_RESYNC) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_STALE) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_UNINITIALIZED) < + vol->v_disks_count) && + (sd->sd_state >= G_RAID_SUBDISK_S_UNINITIALIZED)) return; g_raid_fail_disk(sc, sd, disk); } @@ -1113,7 +1120,16 @@ rebuild_round_done: G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length); } - error = bp->bio_error; + if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_inbed == 1 || pbp->bio_error != 0) + pbp->bio_error = bp->bio_error; + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); + g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + error = pbp->bio_error; + } else + error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 02:46:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FAC3106564A; Thu, 24 May 2012 02:46:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 467D78FC08; Thu, 24 May 2012 02:46:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O2ka5B010634; Thu, 24 May 2012 02:46:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O2kaMZ010624; Thu, 24 May 2012 02:46:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240246.q4O2kaMZ010624@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 02:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235875 - in stable/8: sbin/geom/class/raid sys/conf sys/geom/raid sys/modules/geom/geom_raid X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 02:46:36 -0000 Author: mav Date: Thu May 24 02:46:35 2012 New Revision: 235875 URL: http://svn.freebsd.org/changeset/base/235875 Log: MFC r234458, r234603, r234610, r234727, r234816, r234848, r234868, r234869, r234899, r234940, r234993, r234994, r235071 -c r235076, r235080, r235096: - Add support for the DDF metadata format, as defined by the SNIA Common RAID Disk Data Format Specification v2.0; - Add support for reading non-degraded RAID4/5/5E/5EE/5R/6/MDF volumes. Sponsored by: iXsystems, Inc. Added: stable/8/sys/geom/raid/md_ddf.c - copied, changed from r234848, head/sys/geom/raid/md_ddf.c stable/8/sys/geom/raid/md_ddf.h - copied unchanged from r234848, head/sys/geom/raid/md_ddf.h stable/8/sys/geom/raid/tr_raid5.c - copied, changed from r234458, head/sys/geom/raid/tr_raid5.c Modified: stable/8/sbin/geom/class/raid/geom_raid.c stable/8/sbin/geom/class/raid/graid.8 stable/8/sys/conf/files stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/g_raid.h stable/8/sys/geom/raid/g_raid_ctl.c stable/8/sys/geom/raid/g_raid_md_if.m stable/8/sys/geom/raid/md_intel.c stable/8/sys/geom/raid/md_jmicron.c stable/8/sys/geom/raid/md_nvidia.c stable/8/sys/geom/raid/md_promise.c stable/8/sys/geom/raid/md_sii.c stable/8/sys/geom/raid/tr_raid1.c stable/8/sys/geom/raid/tr_raid1e.c stable/8/sys/modules/geom/geom_raid/Makefile Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/geom/class/raid/geom_raid.c ============================================================================== --- stable/8/sbin/geom/class/raid/geom_raid.c Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sbin/geom/class/raid/geom_raid.c Thu May 24 02:46:35 2012 (r235875) @@ -48,11 +48,12 @@ struct g_command class_commands[] = { { "label", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, + { 'o', "fmtopt", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'S', "size", G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 's', "strip", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-fv] [-S size] [-s stripsize] format label level prov ..." + NULL, "[-fv] [-o fmtopt] [-S size] [-s stripsize] format label level prov ..." }, { "add", G_FLAG_VERBOSE, NULL, { Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sbin/geom/class/raid/graid.8 Thu May 24 02:46:35 2012 (r235875) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2011 +.Dd May 6, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Cm label .Op Fl f +.Op Fl o Ar fmtopt .Op Fl S Ar size .Op Fl s Ar strip .Ar format @@ -119,6 +120,8 @@ Additional options include: .It Fl f Enforce specified configuration creation if it is officially unsupported, but technically can be created. +.It Fl o Ar fmtopt +Specifies metadata format options. .It Fl S Ar size Use .Ar size @@ -200,6 +203,23 @@ The GEOM RAID class follows a modular de formats to be used. Support is currently implemented for the following formats: .Bl -tag -width "Intel" +.It DDF +The format defined by the SNIA Common RAID Disk Data Format v2.0 specification. +Used by some Adaptec RAID BIOSes and some hardware RAID controllers. +Because of high format flexibility different implementations support +different set of features and have different on-disk metadata layouts. +To provide compatibility, the GEOM RAID class mimics capabilities +of the first detected DDF array. +Respecting that, it may support different number of disks per volume, +volumes per array, partitions per disk, etc. +The following configurations are supported: RAID0 (2+ disks), RAID1 (2+ disks), +RAID1E (3+ disks), RAID3 (3+ disks), RAID4 (3+ disks), RAID5 (3+ disks), +RAID5E (4+ disks), RAID5EE (4+ disks), RAID5R (3+ disks), RAID6 (4+ disks), +RAIDMDF (4+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks). +.Pp +Format supports two options "BE" and "LE", that mean big-endian byte order +defined by specification (default) and little-endian used by some Adaptec +controllers. .It Intel The format used by Intel RAID BIOS. Supports up to two volumes per array. @@ -241,8 +261,11 @@ own risk: RAID1 (3+ disks), RAID10 (6+ d .Sh SUPPORTED RAID LEVELS The GEOM RAID class follows a modular design, allowing different RAID levels to be used. -Support for the following RAID levels is currently implemented: RAID0, RAID1, -RAID1E, RAID10, SINGLE, CONCAT. +Full support for the following RAID levels is currently implemented: +RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. +The following RAID levels supported as read-only for volumes in optimal +state (without using redundancy): RAID4, RAID5, RAID5E, RAID5EE, RAID5R, +RAID6, RAIDMDF. .Sh RAID LEVEL MIGRATION The GEOM RAID class has no support for RAID level migration, allowed by some metadata formats. @@ -253,6 +276,33 @@ corruption! .Sh 2TiB BARRIERS Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variable can be used to control the behavior of the +.Nm RAID +GEOM class. +.Bl -tag -width indent +.It Va kern.geom.raid.aggressive_spare : No 0 +Use any disks without metadata connected to controllers of the vendor +matching to volume metadata format as spare. +Use it with much care to not lose data if connecting unrelated disk! +.It Va kern.geom.raid.clean_time : No 5 +Mark volume as clean when idle for the specified number of seconds. +.It Va kern.geom.raid.debug : No 0 +Debug level of the +.Nm RAID +GEOM class. +.It Va kern.geom.raid.idle_threshold : No 1000000 +Time in microseconds to consider a volume idle for rebuild puroses. +.It Va kern.geom.raid.name_format : No 0 +Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. +.It Va kern.geom.raid.read_err_thresh : No 10 +Number of read errors equated to disk failure. +Write errors are always considered as disk failures. +.It Va kern.geom.raid.start_timeout : No 30 +Time to wait for missing array components on startup. +.El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. .Sh SEE ALSO Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/conf/files Thu May 24 02:46:35 2012 (r235875) @@ -2064,6 +2064,7 @@ geom/raid/g_raid.c optional geom_raid geom/raid/g_raid_ctl.c optional geom_raid geom/raid/g_raid_md_if.m optional geom_raid geom/raid/g_raid_tr_if.m optional geom_raid +geom/raid/md_ddf.c optional geom_raid geom/raid/md_intel.c optional geom_raid geom/raid/md_jmicron.c optional geom_raid geom/raid/md_nvidia.c optional geom_raid @@ -2073,6 +2074,7 @@ geom/raid/tr_concat.c optional geom_rai geom/raid/tr_raid0.c optional geom_raid geom/raid/tr_raid1.c optional geom_raid geom/raid/tr_raid1e.c optional geom_raid +geom/raid/tr_raid5.c optional geom_raid geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid.c Thu May 24 02:46:35 2012 (r235875) @@ -276,23 +276,87 @@ g_raid_volume_level2str(int level, int q case G_RAID_VOLUME_RL_RAID1: return ("RAID1"); case G_RAID_VOLUME_RL_RAID3: + if (qual == G_RAID_VOLUME_RLQ_R3P0) + return ("RAID3-P0"); + if (qual == G_RAID_VOLUME_RLQ_R3PN) + return ("RAID3-PN"); return ("RAID3"); case G_RAID_VOLUME_RL_RAID4: + if (qual == G_RAID_VOLUME_RLQ_R4P0) + return ("RAID4-P0"); + if (qual == G_RAID_VOLUME_RLQ_R4PN) + return ("RAID4-PN"); return ("RAID4"); case G_RAID_VOLUME_RL_RAID5: + if (qual == G_RAID_VOLUME_RLQ_R5RA) + return ("RAID5-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5RS) + return ("RAID5-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5LA) + return ("RAID5-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5LS) + return ("RAID5-LS"); return ("RAID5"); case G_RAID_VOLUME_RL_RAID6: + if (qual == G_RAID_VOLUME_RLQ_R6RA) + return ("RAID6-RA"); + if (qual == G_RAID_VOLUME_RLQ_R6RS) + return ("RAID6-RS"); + if (qual == G_RAID_VOLUME_RLQ_R6LA) + return ("RAID6-LA"); + if (qual == G_RAID_VOLUME_RLQ_R6LS) + return ("RAID6-LS"); return ("RAID6"); + case G_RAID_VOLUME_RL_RAIDMDF: + if (qual == G_RAID_VOLUME_RLQ_RMDFRA) + return ("RAIDMDF-RA"); + if (qual == G_RAID_VOLUME_RLQ_RMDFRS) + return ("RAIDMDF-RS"); + if (qual == G_RAID_VOLUME_RLQ_RMDFLA) + return ("RAIDMDF-LA"); + if (qual == G_RAID_VOLUME_RLQ_RMDFLS) + return ("RAIDMDF-LS"); + return ("RAIDMDF"); case G_RAID_VOLUME_RL_RAID1E: + if (qual == G_RAID_VOLUME_RLQ_R1EA) + return ("RAID1E-A"); + if (qual == G_RAID_VOLUME_RLQ_R1EO) + return ("RAID1E-O"); return ("RAID1E"); case G_RAID_VOLUME_RL_SINGLE: return ("SINGLE"); case G_RAID_VOLUME_RL_CONCAT: return ("CONCAT"); case G_RAID_VOLUME_RL_RAID5E: + if (qual == G_RAID_VOLUME_RLQ_R5ERA) + return ("RAID5E-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5ERS) + return ("RAID5E-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5ELA) + return ("RAID5E-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5ELS) + return ("RAID5E-LS"); return ("RAID5E"); case G_RAID_VOLUME_RL_RAID5EE: + if (qual == G_RAID_VOLUME_RLQ_R5EERA) + return ("RAID5EE-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5EERS) + return ("RAID5EE-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5EELA) + return ("RAID5EE-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5EELS) + return ("RAID5EE-LS"); return ("RAID5EE"); + case G_RAID_VOLUME_RL_RAID5R: + if (qual == G_RAID_VOLUME_RLQ_R5RRA) + return ("RAID5R-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5RRS) + return ("RAID5R-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5RLA) + return ("RAID5R-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5RLS) + return ("RAID5R-LS"); + return ("RAID5E"); default: return ("UNKNOWN"); } @@ -308,26 +372,111 @@ g_raid_volume_str2level(const char *str, *level = G_RAID_VOLUME_RL_RAID0; else if (strcasecmp(str, "RAID1") == 0) *level = G_RAID_VOLUME_RL_RAID1; - else if (strcasecmp(str, "RAID3") == 0) + else if (strcasecmp(str, "RAID3-P0") == 0) { + *level = G_RAID_VOLUME_RL_RAID3; + *qual = G_RAID_VOLUME_RLQ_R3P0; + } else if (strcasecmp(str, "RAID3-PN") == 0 || + strcasecmp(str, "RAID3") == 0) { *level = G_RAID_VOLUME_RL_RAID3; - else if (strcasecmp(str, "RAID4") == 0) + *qual = G_RAID_VOLUME_RLQ_R3PN; + } else if (strcasecmp(str, "RAID4-P0") == 0) { + *level = G_RAID_VOLUME_RL_RAID4; + *qual = G_RAID_VOLUME_RLQ_R4P0; + } else if (strcasecmp(str, "RAID4-PN") == 0 || + strcasecmp(str, "RAID4") == 0) { *level = G_RAID_VOLUME_RL_RAID4; - else if (strcasecmp(str, "RAID5") == 0) + *qual = G_RAID_VOLUME_RLQ_R4PN; + } else if (strcasecmp(str, "RAID5-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5RA; + } else if (strcasecmp(str, "RAID5-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5RS; + } else if (strcasecmp(str, "RAID5") == 0 || + strcasecmp(str, "RAID5-LA") == 0) { *level = G_RAID_VOLUME_RL_RAID5; - else if (strcasecmp(str, "RAID6") == 0) + *qual = G_RAID_VOLUME_RLQ_R5LA; + } else if (strcasecmp(str, "RAID5-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5LS; + } else if (strcasecmp(str, "RAID6-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6RA; + } else if (strcasecmp(str, "RAID6-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6RS; + } else if (strcasecmp(str, "RAID6") == 0 || + strcasecmp(str, "RAID6-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6LA; + } else if (strcasecmp(str, "RAID6-LS") == 0) { *level = G_RAID_VOLUME_RL_RAID6; - else if (strcasecmp(str, "RAID10") == 0 || - strcasecmp(str, "RAID1E") == 0) + *qual = G_RAID_VOLUME_RLQ_R6LS; + } else if (strcasecmp(str, "RAIDMDF-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFRA; + } else if (strcasecmp(str, "RAIDMDF-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFRS; + } else if (strcasecmp(str, "RAIDMDF") == 0 || + strcasecmp(str, "RAIDMDF-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFLA; + } else if (strcasecmp(str, "RAIDMDF-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFLS; + } else if (strcasecmp(str, "RAID10") == 0 || + strcasecmp(str, "RAID1E") == 0 || + strcasecmp(str, "RAID1E-A") == 0) { *level = G_RAID_VOLUME_RL_RAID1E; - else if (strcasecmp(str, "SINGLE") == 0) + *qual = G_RAID_VOLUME_RLQ_R1EA; + } else if (strcasecmp(str, "RAID1E-O") == 0) { + *level = G_RAID_VOLUME_RL_RAID1E; + *qual = G_RAID_VOLUME_RLQ_R1EO; + } else if (strcasecmp(str, "SINGLE") == 0) *level = G_RAID_VOLUME_RL_SINGLE; else if (strcasecmp(str, "CONCAT") == 0) *level = G_RAID_VOLUME_RL_CONCAT; - else if (strcasecmp(str, "RAID5E") == 0) + else if (strcasecmp(str, "RAID5E-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ERA; + } else if (strcasecmp(str, "RAID5E-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ERS; + } else if (strcasecmp(str, "RAID5E") == 0 || + strcasecmp(str, "RAID5E-LA") == 0) { *level = G_RAID_VOLUME_RL_RAID5E; - else if (strcasecmp(str, "RAID5EE") == 0) + *qual = G_RAID_VOLUME_RLQ_R5ELA; + } else if (strcasecmp(str, "RAID5E-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ELS; + } else if (strcasecmp(str, "RAID5EE-RA") == 0) { *level = G_RAID_VOLUME_RL_RAID5EE; - else + *qual = G_RAID_VOLUME_RLQ_R5EERA; + } else if (strcasecmp(str, "RAID5EE-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EERS; + } else if (strcasecmp(str, "RAID5EE") == 0 || + strcasecmp(str, "RAID5EE-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EELA; + } else if (strcasecmp(str, "RAID5EE-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EELS; + } else if (strcasecmp(str, "RAID5R-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RRA; + } else if (strcasecmp(str, "RAID5R-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RRS; + } else if (strcasecmp(str, "RAID5R") == 0 || + strcasecmp(str, "RAID5R-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RLA; + } else if (strcasecmp(str, "RAID5R-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RLS; + } else return (-1); return (0); } @@ -1673,8 +1822,8 @@ g_raid_create_node(struct g_class *mp, sc->sc_flags = 0; TAILQ_INIT(&sc->sc_volumes); TAILQ_INIT(&sc->sc_disks); - sx_init(&sc->sc_lock, "gmirror:lock"); - mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); + sx_init(&sc->sc_lock, "graid:lock"); + mtx_init(&sc->sc_queue_mtx, "graid:queue", NULL, MTX_DEF); TAILQ_INIT(&sc->sc_events); bioq_init(&sc->sc_queue); gp->softc = sc; @@ -1706,6 +1855,7 @@ g_raid_create_volume(struct g_raid_softc vol->v_state = G_RAID_VOLUME_S_STARTING; vol->v_raid_level = G_RAID_VOLUME_RL_UNKNOWN; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_UNKNOWN; + vol->v_rotate_parity = 1; bioq_init(&vol->v_inflight); bioq_init(&vol->v_locked); LIST_INIT(&vol->v_locks); @@ -1993,7 +2143,7 @@ g_raid_taste(struct g_class *mp, struct g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); - gp = g_new_geomf(mp, "mirror:taste"); + gp = g_new_geomf(mp, "raid:taste"); /* * This orphan function should be never called. */ @@ -2023,7 +2173,8 @@ g_raid_taste(struct g_class *mp, struct } int -g_raid_create_node_format(const char *format, struct g_geom **gp) +g_raid_create_node_format(const char *format, struct gctl_req *req, + struct g_geom **gp) { struct g_raid_md_class *class; struct g_raid_md_object *obj; @@ -2041,7 +2192,7 @@ g_raid_create_node_format(const char *fo obj = (void *)kobj_create((kobj_class_t)class, M_RAID, M_WAITOK); obj->mdo_class = class; - status = G_RAID_MD_CREATE(obj, &g_raid_class, gp); + status = G_RAID_MD_CREATE_REQ(obj, &g_raid_class, req, gp); if (status != G_RAID_MD_TASTE_NEW) kobj_delete((kobj_t)obj, M_RAID); return (status); Modified: stable/8/sys/geom/raid/g_raid.h ============================================================================== --- stable/8/sys/geom/raid/g_raid.h Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid.h Thu May 24 02:46:35 2012 (r235875) @@ -219,14 +219,48 @@ struct g_raid_subdisk { #define G_RAID_VOLUME_RL_RAID4 0x04 #define G_RAID_VOLUME_RL_RAID5 0x05 #define G_RAID_VOLUME_RL_RAID6 0x06 +#define G_RAID_VOLUME_RL_RAIDMDF 0x07 #define G_RAID_VOLUME_RL_RAID1E 0x11 #define G_RAID_VOLUME_RL_SINGLE 0x0f #define G_RAID_VOLUME_RL_CONCAT 0x1f #define G_RAID_VOLUME_RL_RAID5E 0x15 #define G_RAID_VOLUME_RL_RAID5EE 0x25 +#define G_RAID_VOLUME_RL_RAID5R 0x35 #define G_RAID_VOLUME_RL_UNKNOWN 0xff #define G_RAID_VOLUME_RLQ_NONE 0x00 +#define G_RAID_VOLUME_RLQ_R1SM 0x00 +#define G_RAID_VOLUME_RLQ_R1MM 0x01 +#define G_RAID_VOLUME_RLQ_R3P0 0x00 +#define G_RAID_VOLUME_RLQ_R3PN 0x01 +#define G_RAID_VOLUME_RLQ_R4P0 0x00 +#define G_RAID_VOLUME_RLQ_R4PN 0x01 +#define G_RAID_VOLUME_RLQ_R5RA 0x00 +#define G_RAID_VOLUME_RLQ_R5RS 0x01 +#define G_RAID_VOLUME_RLQ_R5LA 0x02 +#define G_RAID_VOLUME_RLQ_R5LS 0x03 +#define G_RAID_VOLUME_RLQ_R6RA 0x00 +#define G_RAID_VOLUME_RLQ_R6RS 0x01 +#define G_RAID_VOLUME_RLQ_R6LA 0x02 +#define G_RAID_VOLUME_RLQ_R6LS 0x03 +#define G_RAID_VOLUME_RLQ_RMDFRA 0x00 +#define G_RAID_VOLUME_RLQ_RMDFRS 0x01 +#define G_RAID_VOLUME_RLQ_RMDFLA 0x02 +#define G_RAID_VOLUME_RLQ_RMDFLS 0x03 +#define G_RAID_VOLUME_RLQ_R1EA 0x00 +#define G_RAID_VOLUME_RLQ_R1EO 0x01 +#define G_RAID_VOLUME_RLQ_R5ERA 0x00 +#define G_RAID_VOLUME_RLQ_R5ERS 0x01 +#define G_RAID_VOLUME_RLQ_R5ELA 0x02 +#define G_RAID_VOLUME_RLQ_R5ELS 0x03 +#define G_RAID_VOLUME_RLQ_R5EERA 0x00 +#define G_RAID_VOLUME_RLQ_R5EERS 0x01 +#define G_RAID_VOLUME_RLQ_R5EELA 0x02 +#define G_RAID_VOLUME_RLQ_R5EELS 0x03 +#define G_RAID_VOLUME_RLQ_R5RRA 0x00 +#define G_RAID_VOLUME_RLQ_R5RRS 0x01 +#define G_RAID_VOLUME_RLQ_R5RLA 0x02 +#define G_RAID_VOLUME_RLQ_R5RLS 0x03 #define G_RAID_VOLUME_RLQ_UNKNOWN 0xff struct g_raid_volume; @@ -244,7 +278,13 @@ struct g_raid_volume { u_int v_raid_level; /* Array RAID level. */ u_int v_raid_level_qualifier; /* RAID level det. */ u_int v_disks_count; /* Number of disks in array. */ + u_int v_mdf_pdisks; /* Number of parity disks + in RAIDMDF array. */ + uint16_t v_mdf_polynomial; /* Polynomial for RAIDMDF. */ + uint8_t v_mdf_method; /* Generation method for RAIDMDF. */ u_int v_strip_size; /* Array strip size. */ + u_int v_rotate_parity; /* Rotate RAID5R parity + after numer of stripes. */ u_int v_sectorsize; /* Volume sector size. */ off_t v_mediasize; /* Volume media size. */ struct bio_queue_head v_inflight; /* In-flight write requests. */ @@ -348,7 +388,8 @@ const char * g_raid_disk_state2str(int s struct g_raid_softc * g_raid_create_node(struct g_class *mp, const char *name, struct g_raid_md_object *md); -int g_raid_create_node_format(const char *format, struct g_geom **gp); +int g_raid_create_node_format(const char *format, struct gctl_req *req, + struct g_geom **gp); struct g_raid_volume * g_raid_create_volume(struct g_raid_softc *sc, const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); Modified: stable/8/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/8/sys/geom/raid/g_raid_ctl.c Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid_ctl.c Thu May 24 02:46:35 2012 (r235875) @@ -88,7 +88,7 @@ g_raid_ctl_label(struct gctl_req *req, s gctl_error(req, "No format recieved."); return; } - crstatus = g_raid_create_node_format(format, &geom); + crstatus = g_raid_create_node_format(format, req, &geom); if (crstatus == G_RAID_MD_TASTE_FAIL) { gctl_error(req, "Failed to create array with format '%s'.", format); Modified: stable/8/sys/geom/raid/g_raid_md_if.m ============================================================================== --- stable/8/sys/geom/raid/g_raid_md_if.m Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid_md_if.m Thu May 24 02:46:35 2012 (r235875) @@ -49,13 +49,22 @@ HEADER { # Default implementations of methods. CODE { static int - g_raid_md_create_default(struct g_raid_md_object *md) + g_raid_md_create_default(struct g_raid_md_object *md, + struct g_class *mp, struct g_geom **gp) { return (G_RAID_MD_TASTE_FAIL); } static int + g_raid_md_create_req_default(struct g_raid_md_object *md, + struct g_class *mp, struct gctl_req *req, struct g_geom **gp) + { + + return (G_RAID_MD_CREATE(md, mp, gp)); + } + + static int g_raid_md_ctl_default(struct g_raid_md_object *md, struct gctl_req *req) { @@ -95,6 +104,14 @@ METHOD int create { struct g_geom **gp; } DEFAULT g_raid_md_create_default; +# create_req() - create new node from scratch, with request argument. +METHOD int create_req { + struct g_raid_md_object *md; + struct g_class *mp; + struct gctl_req *req; + struct g_geom **gp; +} DEFAULT g_raid_md_create_req_default; + # taste() - taste disk and, if needed, create new node. METHOD int taste { struct g_raid_md_object *md; Copied and modified: stable/8/sys/geom/raid/md_ddf.c (from r234848, head/sys/geom/raid/md_ddf.c) ============================================================================== --- head/sys/geom/raid/md_ddf.c Mon Apr 30 17:53:02 2012 (r234848, copy source) +++ stable/8/sys/geom/raid/md_ddf.c Thu May 24 02:46:35 2012 (r235875) @@ -88,14 +88,15 @@ struct g_raid_md_ddf_pervolume { struct g_raid_md_ddf_object { struct g_raid_md_object mdio_base; + u_int mdio_bigendian; struct ddf_meta mdio_meta; + int mdio_starting; struct callout mdio_start_co; /* STARTING state timer. */ int mdio_started; - int mdio_incomplete; struct root_hold_token *mdio_rootmount; /* Root mount delay token. */ }; -static g_raid_md_create_t g_raid_md_create_ddf; +static g_raid_md_create_req_t g_raid_md_create_req_ddf; static g_raid_md_taste_t g_raid_md_taste_ddf; static g_raid_md_event_t g_raid_md_event_ddf; static g_raid_md_volume_event_t g_raid_md_volume_event_ddf; @@ -107,7 +108,7 @@ static g_raid_md_free_volume_t g_raid_md static g_raid_md_free_t g_raid_md_free_ddf; static kobj_method_t g_raid_md_ddf_methods[] = { - KOBJMETHOD(g_raid_md_create, g_raid_md_create_ddf), + KOBJMETHOD(g_raid_md_create_req, g_raid_md_create_req_ddf), KOBJMETHOD(g_raid_md_taste, g_raid_md_taste_ddf), KOBJMETHOD(g_raid_md_event, g_raid_md_event_ddf), KOBJMETHOD(g_raid_md_volume_event, g_raid_md_volume_event_ddf), @@ -172,6 +173,17 @@ static struct g_raid_md_class g_raid_md_ #define SET32D(m, f, v) SET32P((m), &(f), (v)) #define SET64D(m, f, v) SET64P((m), &(f), (v)) +#define GETCRNUM(m) (GET32((m), hdr->cr_length) / \ + GET16((m), hdr->Configuration_Record_Length)) + +#define GETVDCPTR(m, n) ((struct ddf_vdc_record *)((uint8_t *)(m)->cr + \ + (n) * GET16((m), hdr->Configuration_Record_Length) * \ + (m)->sectorsize)) + +#define GETSAPTR(m, n) ((struct ddf_sa_record *)((uint8_t *)(m)->cr + \ + (n) * GET16((m), hdr->Configuration_Record_Length) * \ + (m)->sectorsize)) + static int isff(uint8_t *buf, int size) { @@ -254,7 +266,7 @@ g_raid_md_ddf_print(struct ddf_meta *met GET16(meta, cdr->Controller_Type.SubVendor_ID), GET16(meta, cdr->Controller_Type.SubDevice_ID)); printf("Product_ID '%.16s'\n", (char *)&meta->cdr->Product_ID[0]); - printf("**** Physical Disk Data ****\n"); + printf("**** Physical Disk Records ****\n"); printf("Populated_PDEs %u\n", GET16(meta, pdr->Populated_PDEs)); printf("Max_PDE_Supported %u\n", GET16(meta, pdr->Max_PDE_Supported)); for (j = 0; j < GET16(meta, pdr->Populated_PDEs); j++) { @@ -276,7 +288,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("Block_Size %u\n", GET16(meta, pdr->entry[j].Block_Size)); } - printf("**** Virtual Disk Data ****\n"); + printf("**** Virtual Disk Records ****\n"); printf("Populated_VDEs %u\n", GET16(meta, vdr->Populated_VDEs)); printf("Max_VDE_Supported %u\n", GET16(meta, vdr->Max_VDE_Supported)); for (j = 0; j < GET16(meta, vdr->Populated_VDEs); j++) { @@ -287,8 +299,8 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("\n"); printf("VD_Number 0x%04x\n", GET16(meta, vdr->entry[j].VD_Number)); - printf("VD_Type 0x%02x\n", - GET8(meta, vdr->entry[j].VD_Type)); + printf("VD_Type 0x%04x\n", + GET16(meta, vdr->entry[j].VD_Type)); printf("VD_State 0x%02x\n", GET8(meta, vdr->entry[j].VD_State)); printf("Init_State 0x%02x\n", @@ -299,11 +311,9 @@ g_raid_md_ddf_print(struct ddf_meta *met (char *)&meta->vdr->entry[j].VD_Name); } printf("**** Configuration Records ****\n"); - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (j = 0; j < num; j++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - j * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, j); val = GET32D(meta, vdc->Signature); switch (val) { case DDF_VDCR_SIGNATURE: @@ -391,6 +401,7 @@ g_raid_md_ddf_print(struct ddf_meta *met GET16D(meta, sa->entry[i].Secondary_Element)); } break; + case 0x00000000: case 0xFFFFFFFF: break; default: @@ -463,17 +474,16 @@ ddf_meta_find_vdc(struct ddf_meta *meta, struct ddf_vdc_record *vdc; int i, num; - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GUID != NULL) { if (GET32D(meta, vdc->Signature) == DDF_VDCR_SIGNATURE && memcmp(vdc->VD_GUID, GUID, 24) == 0) return (vdc); } else - if (GET32D(meta, vdc->Signature) == 0xffffffff) + if (GET32D(meta, vdc->Signature) == 0xffffffff || + GET32D(meta, vdc->Signature) == 0) return (vdc); } return (NULL); @@ -486,11 +496,9 @@ ddf_meta_count_vdc(struct ddf_meta *meta int i, num, cnt; cnt = 0; - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) continue; if (GUID == NULL || memcmp(vdc->VD_GUID, GUID, 24) == 0) @@ -526,12 +534,36 @@ ddf_meta_find_disk(struct ddf_vol_meta * return (-1); } +static struct ddf_sa_record * +ddf_meta_find_sa(struct ddf_meta *meta, int create) +{ + struct ddf_sa_record *sa; + int i, num; + + num = GETCRNUM(meta); + for (i = 0; i < num; i++) { + sa = GETSAPTR(meta, i); + if (GET32D(meta, sa->Signature) == DDF_SA_SIGNATURE) + return (sa); + } + if (create) { + for (i = 0; i < num; i++) { + sa = GETSAPTR(meta, i); + if (GET32D(meta, sa->Signature) == 0xffffffff || + GET32D(meta, sa->Signature) == 0) + return (sa); + } + } + return (NULL); +} + static void ddf_meta_create(struct g_raid_disk *disk, struct ddf_meta *sample) { struct timespec ts; struct clocktime ct; struct g_raid_md_ddf_perdisk *pd; + struct g_raid_md_ddf_object *mdi; struct ddf_meta *meta; struct ddf_pd_entry *pde; off_t anchorlba; @@ -542,13 +574,14 @@ ddf_meta_create(struct g_raid_disk *disk if (sample->hdr == NULL) sample = NULL; + mdi = (struct g_raid_md_ddf_object *)disk->d_softc->sc_md; pd = (struct g_raid_md_ddf_perdisk *)disk->d_md_data; meta = &pd->pd_meta; ss = disk->d_consumer->provider->sectorsize; anchorlba = disk->d_consumer->provider->mediasize / ss - 1; meta->sectorsize = ss; - meta->bigendian = sample ? sample->bigendian : 0; + meta->bigendian = sample ? sample->bigendian : mdi->mdio_bigendian; getnanotime(&ts); clock_ts_to_ct(&ts, &ct); @@ -642,9 +675,9 @@ ddf_meta_create(struct g_raid_disk *disk pos += GET32(meta, hdr->Diagnostic_Space_Length); SET32(meta, hdr->Vendor_Specific_Logs, GET32(meta, hdr->Vendor_Specific_Logs_Length) != 0 ? pos : 0xffffffff); - pos += GET32(meta, hdr->Vendor_Specific_Logs_Length); + pos += min(GET32(meta, hdr->Vendor_Specific_Logs_Length), 1); SET64(meta, hdr->Primary_Header_LBA, - anchorlba - pos - 16); + anchorlba - pos); SET64(meta, hdr->Secondary_Header_LBA, 0xffffffffffffffffULL); SET64(meta, hdr->WorkSpace_LBA, @@ -756,7 +789,7 @@ ddf_meta_update(struct ddf_meta *meta, s if (isff(spde->PD_GUID, 24)) continue; j = ddf_meta_find_pd(meta, NULL, - src->pdr->entry[i].PD_Reference); + GET32(src, pdr->entry[i].PD_Reference)); if (j < 0) { j = ddf_meta_find_pd(meta, NULL, 0xffffffff); pde = &meta->pdr->entry[j]; @@ -835,7 +868,8 @@ ddf_vol_meta_create(struct ddf_vol_meta } static void -ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, uint8_t *GUID) +ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, + uint8_t *GUID, int started) { struct ddf_header *hdr; struct ddf_vd_entry *vde; @@ -850,15 +884,15 @@ ddf_vol_meta_update(struct ddf_vol_meta size = GET16(src, hdr->Configuration_Record_Length) * src->sectorsize; if (dst->vdc == NULL || - ((int32_t)(GET32D(src, vdc->Sequence_Number) - - GET32(dst, vdc->Sequence_Number))) > 0) + (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - + GET32(dst, vdc->Sequence_Number))) > 0)) vnew = 1; else vnew = 0; if (dst->bvdc[bvd] == NULL || - ((int32_t)(GET32D(src, vdc->Sequence_Number) - - GET32(dst, bvdc[bvd]->Sequence_Number))) > 0) + (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - + GET32(dst, bvdc[bvd]->Sequence_Number))) > 0)) bvnew = 1; else bvnew = 0; @@ -936,12 +970,9 @@ ddf_meta_unused_range(struct ddf_meta *m beg[0] = 0; end[0] = GET64(meta, pdr->entry[pos].Configured_Size); n = 1; - num = GET32(meta, hdr->cr_length) / - GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) continue; for (pos = 0; pos < GET16D(meta, vdc->Primary_Element_Count); pos++) @@ -1197,7 +1228,7 @@ hdrerror: } done: - free(abuf, M_MD_DDF); + g_free(abuf); if (error != 0) ddf_meta_free(meta); return (error); @@ -1260,11 +1291,10 @@ err: if (error != 0) goto err; - size = GET16(meta, hdr->Configuration_Record_Length); - num = GET32(meta, hdr->cr_length) / size; - size *= ss; + size = GET16(meta, hdr->Configuration_Record_Length) * ss; + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + i * size); + vdc = GETVDCPTR(meta, i); SET32D(meta, vdc->CRC, 0xffffffff); SET32D(meta, vdc->CRC, crc32(vdc, size)); } @@ -1320,29 +1350,6 @@ ddf_meta_erase(struct g_consumer *cp) return (error); } -#if 0 -static int -ddf_meta_write_spare(struct g_consumer *cp) -{ - struct ddf_header *meta; - int error; - - meta = malloc(sizeof(*meta), M_MD_DDF, M_WAITOK | M_ZERO); - memcpy(&meta->ddf_id[0], DDF_MAGIC, sizeof(DDF_MAGIC) - 1); - meta->dummy_0 = 0x00020000; - meta->integrity = DDF_I_VALID; - meta->disk.flags = DDF_F_SPARE | DDF_F_ONLINE | DDF_F_VALID; - meta->disk.number = 0xff; - arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; - error = ddf_meta_write(cp, &meta, 1); - free(meta, M_MD_DDF); - return (error); -} -#endif - static struct g_raid_volume * g_raid_md_ddf_get_volume(struct g_raid_softc *sc, uint8_t *GUID) { @@ -1510,16 +1517,14 @@ g_raid_md_ddf_supported(int level, int q qual != G_RAID_VOLUME_RLQ_RMDFLA && qual != G_RAID_VOLUME_RLQ_RMDFLS) return (0); - if (disks < 5) + if (disks < 4) return (0); break; case G_RAID_VOLUME_RL_RAID1E: if (qual != G_RAID_VOLUME_RLQ_R1EA && qual != G_RAID_VOLUME_RLQ_R1EO) return (0); - if (disks < 2) - return (0); - if (disks % 2 != 0) + if (disks < 3) return (0); break; case G_RAID_VOLUME_RL_SINGLE: @@ -1578,6 +1583,7 @@ g_raid_md_ddf_start_disk(struct g_raid_d struct ddf_vol_meta *vmeta; struct ddf_meta *pdmeta, *gmeta; struct ddf_vdc_record *vdc1; + struct ddf_sa_record *sa; off_t size, eoff = 0, esize = 0; uint64_t *val2; int disk_pos, md_disk_bvd = -1, md_disk_pos = -1, md_pde_pos; @@ -1600,7 +1606,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d md_pde_pos = ddf_meta_find_pd(gmeta, NULL, reference); if (disk_pos < 0) { - G_RAID_DEBUG1(1, sc, "Disk %s is not part of the volume %s", + G_RAID_DEBUG1(1, sc, + "Disk %s is not a present part of the volume %s", g_raid_get_diskname(disk), vol->v_name); /* Failed stale disk is useless for us. */ @@ -1610,10 +1617,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d } /* If disk has some metadata for this volume - erase. */ - if (pdmeta->cr != NULL && - (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { + if ((vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) SET32D(pdmeta, vdc1->Signature, 0xffffffff); - } /* If we are in the start process, that's all for now. */ if (!pv->pv_started) @@ -1634,6 +1639,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d g_raid_get_diskname(disk)); goto nofit; } + eoff *= pd->pd_meta.sectorsize; + esize *= pd->pd_meta.sectorsize; size = INT64_MAX; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; @@ -1646,26 +1653,41 @@ g_raid_md_ddf_start_disk(struct g_raid_d } if (disk_pos >= 0 && vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT && - (off_t)esize * 512 < size) { + esize < size) { G_RAID_DEBUG1(1, sc, "Disk %s free space " "is too small (%ju < %ju)", - g_raid_get_diskname(disk), - (off_t)esize * 512, size); + g_raid_get_diskname(disk), esize, size); disk_pos = -1; } if (disk_pos >= 0) { if (vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT) - esize = size / 512; + esize = size; md_disk_bvd = disk_pos / GET16(vmeta, vdc->Primary_Element_Count); // XXX md_disk_pos = disk_pos % GET16(vmeta, vdc->Primary_Element_Count); // XXX } else { nofit: - if (ddf_meta_count_vdc(&pd->pd_meta, NULL) == 0) { + if (disk->d_state == G_RAID_DISK_S_NONE) g_raid_change_disk_state(disk, - G_RAID_DISK_S_SPARE); - } + G_RAID_DISK_S_STALE); return (0); } + + /* + * If spare is committable, delete spare record. + * Othersize, mark it active and leave there. + */ + sa = ddf_meta_find_sa(&pd->pd_meta, 0); + if (sa != NULL) { + if ((GET8D(&pd->pd_meta, sa->Spare_Type) & + DDF_SAR_TYPE_REVERTIBLE) == 0) { + SET32D(&pd->pd_meta, sa->Signature, 0xffffffff); + } else { + SET8D(&pd->pd_meta, sa->Spare_Type, + GET8D(&pd->pd_meta, sa->Spare_Type) | + DDF_SAR_TYPE_ACTIVE); + } + } + G_RAID_DEBUG1(1, sc, "Disk %s takes pos %d in the volume %s", g_raid_get_diskname(disk), disk_pos, vol->v_name); resurrection = 1; @@ -1691,8 +1713,8 @@ nofit: g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); if (resurrection) { - sd->sd_offset = (off_t)eoff * 512; - sd->sd_size = (off_t)esize * 512; + sd->sd_offset = eoff; + sd->sd_size = esize; } else if (pdmeta->cr != NULL && (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { val2 = (uint64_t *)&(vdc1->Physical_Disk_Sequence[GET16(vmeta, hdr->Max_Primary_Element_Entries)]); @@ -1802,7 +1824,9 @@ g_raid_md_ddf_start(struct g_raid_volume struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_object *md; + struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_pervolume *pv; + struct g_raid_md_ddf_object *mdi; struct ddf_vol_meta *vmeta; struct ddf_vdc_record *vdc; uint64_t *val2; @@ -1810,6 +1834,7 @@ g_raid_md_ddf_start(struct g_raid_volume sc = vol->v_softc; md = sc->sc_md; + mdi = (struct g_raid_md_ddf_object *)md; pv = vol->v_md_data; vmeta = &pv->pv_meta; vdc = vmeta->vdc; @@ -1826,6 +1851,13 @@ g_raid_md_ddf_start(struct g_raid_volume vol->v_strip_size = vol->v_sectorsize << GET8(vmeta, vdc->Stripe_Size); vol->v_disks_count = GET16(vmeta, vdc->Primary_Element_Count) * GET8(vmeta, vdc->Secondary_Element_Count); + vol->v_mdf_pdisks = GET8(vmeta, vdc->MDF_Parity_Disks); + vol->v_mdf_polynomial = GET16(vmeta, vdc->MDF_Parity_Generator_Polynomial); + vol->v_mdf_method = GET8(vmeta, vdc->MDF_Constant_Generation_Method); + if (GET8(vmeta, vdc->Rotate_Parity_count) > 31) + vol->v_rotate_parity = 1; + else + vol->v_rotate_parity = 1 << GET8(vmeta, vdc->Rotate_Parity_count); vol->v_mediasize = GET64(vmeta, vdc->VD_Size) * vol->v_sectorsize; for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { if (j == GET16(vmeta, vdc->Primary_Element_Count)) { @@ -1848,20 +1880,14 @@ g_raid_md_ddf_start(struct g_raid_volume g_raid_start_volume(vol); /* Make all disks found till the moment take their places. */ - for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { - if (j == GET16(vmeta, vdc->Primary_Element_Count)) { - j = 0; - bvd++; - } - if (vmeta->bvdc[bvd] == NULL) - continue; - disk = g_raid_md_ddf_get_disk(sc, NULL, - GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[j])); - if (disk != NULL) + TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { + pd = (struct g_raid_md_ddf_perdisk *)disk->d_md_data; + if (ddf_meta_find_vdc(&pd->pd_meta, vmeta->vdc->VD_GUID) != NULL) g_raid_md_ddf_start_disk(disk, vol); } pv->pv_started = 1; + mdi->mdio_starting--; callout_stop(&pv->pv_start_co); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 04:24:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B457E106566B; Thu, 24 May 2012 04:24:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856958FC12; Thu, 24 May 2012 04:24:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O4OIqq015093; Thu, 24 May 2012 04:24:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4OI6A015089; Thu, 24 May 2012 04:24:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240424.q4O4OI6A015089@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 04:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235881 - stable/8/usr.bin/usbhidctl X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:24:18 -0000 Author: mav Date: Thu May 24 04:24:17 2012 New Revision: 235881 URL: http://svn.freebsd.org/changeset/base/235881 Log: MFC r235519: Add support for -z option for reading operations. It allows to not request current values from device, but only receive changes. Sponsored by: iXsystems, Inc. Modified: stable/8/usr.bin/usbhidctl/usbhid.c stable/8/usr.bin/usbhidctl/usbhidctl.1 Directory Properties: stable/8/usr.bin/usbhidctl/ (props changed) Modified: stable/8/usr.bin/usbhidctl/usbhid.c ============================================================================== --- stable/8/usr.bin/usbhidctl/usbhid.c Thu May 24 04:23:06 2012 (r235880) +++ stable/8/usr.bin/usbhidctl/usbhid.c Thu May 24 04:24:17 2012 (r235881) @@ -189,11 +189,11 @@ usage(void) fprintf(stderr, "usage: %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] name ...\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] name ...\n", getprogname()); fprintf(stderr, " %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] -a\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] -a\n", getprogname()); fprintf(stderr, " %s -f device " @@ -311,7 +311,7 @@ dumpdata(int f, report_desc_t rd, int lo u_char *dbuf; enum hid_kind kind; - kind = 0; + kind = zflag ? 3 : 0; rid = -1; use_rid = !!hid_get_report_id(f); do { Modified: stable/8/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- stable/8/usr.bin/usbhidctl/usbhidctl.1 Thu May 24 04:23:06 2012 (r235880) +++ stable/8/usr.bin/usbhidctl/usbhidctl.1 Thu May 24 04:24:17 2012 (r235881) @@ -54,6 +54,7 @@ .Op Fl l .Op Fl v .Op Fl x +.Op Fl z .Fl a .Nm .Fl f Ar device @@ -62,6 +63,7 @@ .Op Fl n .Op Fl v .Op Fl x +.Op Fl z .Ar item ... .Nm .Fl f Ar device @@ -106,9 +108,8 @@ Only 'output' and 'feature' kinds can be .It Fl x Dump data in hexadecimal as well as decimal. .It Fl z -Reset reports to zero before processing -.Fl w -arguments. If not specified, current values will be requested from device. +Reset reports to zero before processing other arguments. +If not specified, current values will be requested from device. .El .Sh SYNTAX .Nm From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 05:30:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26C2F106566B; Thu, 24 May 2012 05:30:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 109738FC16; Thu, 24 May 2012 05:30:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O5UHB6017999; Thu, 24 May 2012 05:30:17 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O5UHGn017992; Thu, 24 May 2012 05:30:17 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240530.q4O5UHGn017992@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 05:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235885 - in stable/8/sys: amd64/amd64 amd64/conf conf i386/conf i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 05:30:18 -0000 Author: alc Date: Thu May 24 05:30:17 2012 New Revision: 235885 URL: http://svn.freebsd.org/changeset/base/235885 Log: MFC r233433 Disable detailed PV entry accounting by default. Add a config option to enable it. Modified: stable/8/sys/amd64/amd64/pmap.c stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/options.amd64 stable/8/sys/conf/options.i386 stable/8/sys/i386/conf/NOTES stable/8/sys/i386/i386/pmap.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/amd64/amd64/pmap.c Thu May 24 05:30:17 2012 (r235885) @@ -152,7 +152,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/amd64/conf/NOTES Thu May 24 05:30:17 2012 (r235885) @@ -557,6 +557,10 @@ options LINSYSFS options KSTACK_PAGES=5 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: stable/8/sys/conf/options.amd64 ============================================================================== --- stable/8/sys/conf/options.amd64 Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/conf/options.amd64 Thu May 24 05:30:17 2012 (r235885) @@ -8,6 +8,7 @@ PERFMON MPTABLE_FORCE_HTT MP_WATCHDOG NKPT opt_pmap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: stable/8/sys/conf/options.i386 ============================================================================== --- stable/8/sys/conf/options.i386 Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/conf/options.i386 Thu May 24 05:30:17 2012 (r235885) @@ -16,6 +16,7 @@ NKPT opt_pmap.h PERFMON PMAP_SHPGPERPROC opt_pmap.h POWERFAIL_NMI opt_trap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/i386/conf/NOTES Thu May 24 05:30:17 2012 (r235885) @@ -986,6 +986,10 @@ device lindev options KSTACK_PAGES=3 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/i386/i386/pmap.c Thu May 24 05:30:17 2012 (r235885) @@ -166,7 +166,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 09:11:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83E2E1065670; Thu, 24 May 2012 09:11:39 +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 6D0448FC0C; Thu, 24 May 2012 09:11:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O9BdDN026974; Thu, 24 May 2012 09:11:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O9BdUw026971; Thu, 24 May 2012 09:11:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205240911.q4O9BdUw026971@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 May 2012 09:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235888 - stable/8/usr.bin/lastcomm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:11:39 -0000 Author: kib Date: Thu May 24 09:11:38 2012 New Revision: 235888 URL: http://svn.freebsd.org/changeset/base/235888 Log: MFC r235541: Allow to specify strftime(3) format for process start end exit times. Modified: stable/8/usr.bin/lastcomm/lastcomm.1 stable/8/usr.bin/lastcomm/lastcomm.c Directory Properties: stable/8/usr.bin/lastcomm/ (props changed) Modified: stable/8/usr.bin/lastcomm/lastcomm.1 ============================================================================== --- stable/8/usr.bin/lastcomm/lastcomm.1 Thu May 24 08:43:10 2012 (r235887) +++ stable/8/usr.bin/lastcomm/lastcomm.1 Thu May 24 09:11:38 2012 (r235888) @@ -32,7 +32,7 @@ .\" From: @(#)lastcomm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 14, 2007 +.Dd May 17, 2012 .Dt LASTCOMM 1 .Os .Sh NAME @@ -42,6 +42,7 @@ .Nm .Op Fl EScesu .Op Fl f Ar file +.Op Cm + Ns Ar format .Op Ar command ...\& .Op Ar user ...\& .Op Ar terminal ...\& @@ -81,6 +82,15 @@ is a single dash reads accounting entries from the standard input. .El .Pp +An operand with a leading plus sign +.Pq Sq + +is followed a user-defined format string which specifies the format +in which to display the process's start or exit date and time. +The format string may contain any of the conversion specifications +described in the +.Xr strftime 3 +manual page, as well as arbitrary text. +.Pp If no options are specified, .Fl cS is assumed. @@ -169,6 +179,7 @@ will print details of each terminating c .Sh SEE ALSO .Xr last 1 , .Xr sigaction 2 , +.Xr strftime 3 , .Xr acct 5 , .Xr core 5 .Sh HISTORY Modified: stable/8/usr.bin/lastcomm/lastcomm.c ============================================================================== --- stable/8/usr.bin/lastcomm/lastcomm.c Thu May 24 08:43:10 2012 (r235887) +++ stable/8/usr.bin/lastcomm/lastcomm.c Thu May 24 09:11:38 2012 (r235888) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "pathnames.h" @@ -87,10 +88,12 @@ main(int argc, char *argv[]) int (*readrec)(FILE *f, struct acctv2 *av2); time_t t; int ch, rv; - const char *acctfile; + const char *acctfile, *format; + char buf[1024]; int flags = 0; acctfile = _PATH_ACCT; + format = NULL; while ((ch = getopt(argc, argv, "f:usecSE")) != -1) switch((char)ch) { case 'f': @@ -131,6 +134,12 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (argc > 0 && **argv == '+') { + format = *argv + 1; /* skip + */ + argc--; + argv++; + } + if (strcmp(acctfile, "-") == 0) { fp = stdin; readrec = readrec_forward; @@ -182,14 +191,24 @@ main(int argc, char *argv[]) /* starting time */ if (flags & AC_BTIME) { - (void)printf(" %.16s", ctime(&ab.ac_btime)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&ab.ac_btime)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&ab.ac_btime)); } /* exit time (starting time + elapsed time )*/ if (flags & AC_FTIME) { t = ab.ac_btime; t += (time_t)(ab.ac_etime / 1000000); - (void)printf(" %.16s", ctime(&t)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&t)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&t)); } printf("\n"); } @@ -255,6 +274,7 @@ static void usage(void) { (void)fprintf(stderr, -"usage: lastcomm [-EScesu] [-f file] [command ...] [user ...] [terminal ...]\n"); + "usage: lastcomm [-EScesu] [-f file] [+format] [command ...] " + "[user ...] [terminal ...]\n"); exit(1); } From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 13:15:16 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1266E106566B; Thu, 24 May 2012 13:15:16 +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 EF3208FC16; Thu, 24 May 2012 13:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ODFFVZ040123; Thu, 24 May 2012 13:15:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ODFFbN040121; Thu, 24 May 2012 13:15:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201205241315.q4ODFFbN040121@svn.freebsd.org> From: Rick Macklem Date: Thu, 24 May 2012 13:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235910 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 13:15:16 -0000 Author: rmacklem Date: Thu May 24 13:15:15 2012 New Revision: 235910 URL: http://svn.freebsd.org/changeset/base/235910 Log: MFC: r235568 A problem with the NFSv4 server was reported by Andrew Leonard to freebsd-fs@, where the setfacl of an NFSv4 acl would fail. This was caused by the VOP_ACLCHECK() call for ZFS replying EOPNOTSUPP. After discussion with rwatson@, it was determined that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not required. This patch fixes the problem by deleting the VOP_ACLCHECK() call. Modified: stable/8/sys/fs/nfs/nfs_commonacl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonacl.c Thu May 24 12:45:01 2012 (r235909) +++ stable/8/sys/fs/nfs/nfs_commonacl.c Thu May 24 13:15:15 2012 (r235910) @@ -468,9 +468,7 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, error = NFSERR_ATTRNOTSUPP; goto out; } - error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); - if (!error) - error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); + error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); out: NFSEXITCODE(error); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 16:41:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C84DE1065670; Thu, 24 May 2012 16:41:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1E6E8FC17; Thu, 24 May 2012 16:41:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OGfQb8048838; Thu, 24 May 2012 16:41:26 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGfQQp048836; Thu, 24 May 2012 16:41:26 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205241641.q4OGfQQp048836@svn.freebsd.org> From: Sean Bruno Date: Thu, 24 May 2012 16:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235917 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:41:26 -0000 Author: sbruno Date: Thu May 24 16:41:26 2012 New Revision: 235917 URL: http://svn.freebsd.org/changeset/base/235917 Log: MFC r235634 Decode new battery status indications. Modified: stable/8/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_show.c Thu May 24 16:30:13 2012 (r235916) +++ stable/8/usr.sbin/mfiutil/mfi_show.c Thu May 24 16:41:26 2012 (r235917) @@ -224,7 +224,29 @@ show_battery(int ac, char **av) } if (stat.fw_status & MFI_BBU_STATE_DISCHARGE_ACTIVE) { printf("%s DISCHARGING", comma ? "," : ""); + comma = 1; } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_REQ) { + printf("%s LEARN_CYCLE_REQUESTED", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_ACTIVE) { + printf("%s LEARN_CYCLE_ACTIVE", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_FAIL) { + printf("%s LEARN_CYCLE_FAIL", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_TIMEOUT) { + printf("%s LEARN_CYCLE_TIMEOUT", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_I2C_ERR_DETECT) { + printf("%s I2C_ERROR_DETECT", comma ? "," : ""); + comma = 1; + } + if (!comma) printf(" normal"); printf("\n"); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 24 23:55:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E16C81065670; Thu, 24 May 2012 23:55:08 +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 C29B38FC0A; Thu, 24 May 2012 23:55:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ONt8Hd067866; Thu, 24 May 2012 23:55:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ONt8JJ067857; Thu, 24 May 2012 23:55:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242355.q4ONt8JJ067857@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 23:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235947 - in stable/8: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/wbwd sys/i386/conf sys/modules sys/modules/wbwd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:55:09 -0000 Author: bz Date: Thu May 24 23:55:08 2012 New Revision: 235947 URL: http://svn.freebsd.org/changeset/base/235947 Log: MFC r232614: Provide wbwd(4), a driver for the watchdog timer found on various Winbond Super I/O chips. Added: stable/8/share/man/man4/wbwd.4 - copied unchanged from r232614, head/share/man/man4/wbwd.4 stable/8/sys/dev/wbwd/ - copied from r232614, head/sys/dev/wbwd/ stable/8/sys/modules/wbwd/ - copied from r232614, head/sys/modules/wbwd/ Modified: stable/8/sys/amd64/conf/GENERIC.hints stable/8/sys/amd64/conf/NOTES stable/8/sys/boot/forth/loader.conf stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/GENERIC.hints stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Copied: stable/8/share/man/man4/wbwd.4 (from r232614, head/share/man/man4/wbwd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/wbwd.4 Thu May 24 23:55:08 2012 (r235947, copy of r232614, head/share/man/man4/wbwd.4) @@ -0,0 +1,117 @@ +.\"- +.\" Copyright (c) 2012 Bjoern A. Zeeb +.\" 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 March 6, 2012 +.Dt wbwd 4 +.Os +.Sh NAME +.Nm wbwd +.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Sh SYNOPSIS +To compile this driver into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wbwd" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +wbwd_load="YES" +.Ed +.Pp +In +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on at least the following +Winbond Super I/O chips: +.Pp +.Bl -bullet -compact +.It +83627HF/F/HG/G Rev. G +.It +83627HF/F/HG/G Rev. J +.It +83627HF/F/HG/G Rev. UD-A +.It +83627DHG IC ver. 5 +.El +.Sh SYSCTL VARIABLES +The +.Nm +driver provides the following options as +.Xr sysctl 8 +variables. +.Bl -tag -width "xxxxxx" +.It Va dev.wbwd.0.timeout_override +This variable allows to program the timer to a value independent on the one +provided by the +.Xr watchdog 4 +framework while still relying on the regular updates from e.g. +.Xr watchdogd 8 . +This is particularly useful if your system provides multiple watchdogs and +you want them to fire in a special sequence to trigger an NMI after a shorter +period than the reset timeout for example. +The value set must not be lower than the sleep time of +.Xr watchdogd 8 . +A value of 0 disables this feature and the timeout value provided by +.Xr watchdog 4 +will be used. +.It Va dev.wbwd.0.debug_verbose +If set this sysctl will tell the driver to log its current state before and +after the timer reset on each invocation from +.Xr watchdog 9 +to the kernel message buffer for debugging. +.It Va dev.wbwd.0.debug +This read-only value gives the state of some registers on last update. +.El +.Pp +The +.Nm +driver also provides further sysctl options that are hidden by default. +See the source code for more information. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr device.hints 5 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Bjoern A. Zeeb Aq bz@FreeBSD.org . Modified: stable/8/sys/amd64/conf/GENERIC.hints ============================================================================== --- stable/8/sys/amd64/conf/GENERIC.hints Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/amd64/conf/GENERIC.hints Thu May 24 23:55:08 2012 (r235947) @@ -27,3 +27,4 @@ hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" +hint.wbwd.0.at="isa" Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/amd64/conf/NOTES Thu May 24 23:55:08 2012 (r235947) @@ -465,10 +465,12 @@ device tpm # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/boot/forth/loader.conf Thu May 24 23:55:08 2012 (r235947) @@ -477,6 +477,7 @@ vpd_load="NO" # Vital Product Data ker vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor tpm_load="NO" # Trusted Platform Module +wbwd_load="NO" # Winbond watchdog ############################################################## ### ACPI settings ########################################## Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/conf/files.amd64 Thu May 24 23:55:08 2012 (r235947) @@ -239,6 +239,7 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/viawd/viawd.c optional viawd +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/conf/files.i386 Thu May 24 23:55:08 2012 (r235947) @@ -246,6 +246,7 @@ dev/uart/uart_cpu_i386.c optional uart dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: stable/8/sys/i386/conf/GENERIC.hints ============================================================================== --- stable/8/sys/i386/conf/GENERIC.hints Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/i386/conf/GENERIC.hints Thu May 24 23:55:08 2012 (r235947) @@ -35,3 +35,4 @@ hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" +hint.wbwd.0.at="isa" Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/i386/conf/NOTES Thu May 24 23:55:08 2012 (r235947) @@ -850,10 +850,12 @@ hint.pcf.0.irq="5" # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/modules/Makefile Thu May 24 23:55:08 2012 (r235947) @@ -316,6 +316,7 @@ SUBDIR= ${_3dfx} \ vte \ vx \ wb \ + ${_wbwd} \ ${_wi} \ wlan \ wlan_acl \ @@ -460,6 +461,7 @@ _stg= stg _streams= streams _svr4= svr4 _tmpfs= tmpfs +_wbwd= wbwd _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) @@ -613,6 +615,7 @@ _twa= twa _vesa= vesa _viawd= viawd _x86bios= x86bios +_wbwd= wbwd _wi= wi _wpi= wpi _wpifw= wpifw From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 01:21:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67527106566B; Fri, 25 May 2012 01:21:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC638FC19; Fri, 25 May 2012 01:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P1LIF6071627; Fri, 25 May 2012 01:21:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1LHXA071614; Fri, 25 May 2012 01:21:17 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201205250121.q4P1LHXA071614@svn.freebsd.org> From: Martin Matuska Date: Fri, 25 May 2012 01:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235952 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/comm... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:21:18 -0000 Author: mm Date: Fri May 25 01:21:17 2012 New Revision: 235952 URL: http://svn.freebsd.org/changeset/base/235952 Log: MFC r235222: Import illumos changeset 13686:4bc0783f6064 2703 add mechanism to report ZFS send progress If the zfs send command is used with the -v flag, the amount of bytes transmitted is reported in per second updates. References: https://www.illumos.org/issues/2703 Obtained from: illumos (issue #2703) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 25 01:21:17 2012 (r235952) @@ -20,6 +20,7 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" .\" $FreeBSD$ @@ -2272,6 +2273,7 @@ flags to determine what data will be sen Print machine-parsable verbose information about the stream package generated. .It Fl v Print verbose information about the stream package generated. +This information includes a per-second report of how much data has been sent. .El .Pp The format of the stream is committed. You will be able to receive your streams Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 01:21:17 2012 (r235952) @@ -24,6 +24,7 @@ * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. @@ -3579,6 +3580,7 @@ zfs_do_send(int argc, char **argv) if (flags.verbose) extraverbose = B_TRUE; flags.verbose = B_TRUE; + flags.progress = B_TRUE; break; case 'D': flags.dedup = B_TRUE; Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri May 25 01:21:17 2012 (r235952) @@ -25,7 +25,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. - * All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. */ @@ -573,6 +573,9 @@ typedef struct sendflags { /* parsable verbose output (ie. -P) */ boolean_t parsable; + + /* show progress (ie. -v) */ + boolean_t progress; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri May 25 01:21:17 2012 (r235952) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. */ @@ -40,6 +41,7 @@ #include #include #include +#include #include @@ -67,6 +69,12 @@ typedef struct dedup_arg { libzfs_handle_t *dedup_hdl; } dedup_arg_t; +typedef struct progress_arg { + zfs_handle_t *pa_zhp; + int pa_fd; + boolean_t pa_parsable; +} progress_arg_t; + typedef struct dataref { uint64_t ref_guid; uint64_t ref_object; @@ -786,7 +794,7 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable; + boolean_t verbose, dryrun, parsable, progress; int outfd; boolean_t err; nvlist_t *fss; @@ -979,10 +987,60 @@ hold_for_send(zfs_handle_t *zhp, send_du return (error); } +static void * +send_progress_thread(void *arg) +{ + progress_arg_t *pa = arg; + + zfs_cmd_t zc = { 0 }; + zfs_handle_t *zhp = pa->pa_zhp; + libzfs_handle_t *hdl = zhp->zfs_hdl; + unsigned long long bytes; + char buf[16]; + + time_t t; + struct tm *tm; + + assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); + (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); + + if (!pa->pa_parsable) + (void) fprintf(stderr, "TIME SENT SNAPSHOT\n"); + + /* + * Print the progress from ZFS_IOC_SEND_PROGRESS every second. + */ + for (;;) { + (void) sleep(1); + + zc.zc_cookie = pa->pa_fd; + if (zfs_ioctl(hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0) + return ((void *)-1); + + (void) time(&t); + tm = localtime(&t); + bytes = zc.zc_cookie; + + if (pa->pa_parsable) { + (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n", + tm->tm_hour, tm->tm_min, tm->tm_sec, + bytes, zhp->zfs_name); + } else { + zfs_nicenum(bytes, buf, sizeof (buf)); + (void) fprintf(stderr, "%02d:%02d:%02d %5s %s\n", + tm->tm_hour, tm->tm_min, tm->tm_sec, + buf, zhp->zfs_name); + } + } +} + static int dump_snapshot(zfs_handle_t *zhp, void *arg) { send_dump_data_t *sdd = arg; + progress_arg_t pa = { 0 }; + pthread_t tid; + char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; @@ -1100,8 +1158,29 @@ dump_snapshot(zfs_handle_t *zhp, void *a } if (!sdd->dryrun) { + /* + * If progress reporting is requested, spawn a new thread to + * poll ZFS_IOC_SEND_PROGRESS at a regular interval. + */ + if (sdd->progress) { + pa.pa_zhp = zhp; + pa.pa_fd = sdd->outfd; + pa.pa_parsable = sdd->parsable; + + if (err = pthread_create(&tid, NULL, + send_progress_thread, &pa)) { + zfs_close(zhp); + return (err); + } + } + err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj, fromorigin, sdd->outfd, sdd->debugnv); + + if (sdd->progress) { + (void) pthread_cancel(tid); + (void) pthread_join(tid, NULL); + } } (void) strcpy(sdd->prevsnap, thissnap); @@ -1451,12 +1530,13 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.fsavl = fsavl; sdd.verbose = flags->verbose; sdd.parsable = flags->parsable; + sdd.progress = flags->progress; sdd.dryrun = flags->dryrun; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; if (debugnvp) sdd.debugnv = *debugnvp; - if (holdsnaps) { + if (holdsnaps || flags->progress) { ++holdseq; (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag), ".send-%d-%llu", getpid(), (u_longlong_t)holdseq); Modified: stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 25 01:21:17 2012 (r235952) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_ZFS_CONTEXT_H @@ -228,6 +229,7 @@ struct proc { }; extern struct proc p0; +#define curproc (&p0) #define PS_NONE -1 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 25 01:21:17 2012 (r235952) @@ -25,6 +25,8 @@ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ #include @@ -54,38 +56,15 @@ int zfs_send_corrupt_data = B_FALSE; static char *dmu_recv_tag = "dmu_recv_tag"; -/* - * The list of data whose inclusion in a send stream can be pending from - * one call to backup_cb to another. Multiple calls to dump_free() and - * dump_freeobjects() can be aggregated into a single DRR_FREE or - * DRR_FREEOBJECTS replay record. - */ -typedef enum { - PENDING_NONE, - PENDING_FREE, - PENDING_FREEOBJECTS -} pendop_t; - -struct backuparg { - dmu_replay_record_t *drr; - kthread_t *td; - struct file *fp; - offset_t *off; - objset_t *os; - zio_cksum_t zc; - uint64_t toguid; - int err; - pendop_t pending_op; -}; - static int -dump_bytes(struct backuparg *ba, void *buf, int len) +dump_bytes(dmu_sendarg_t *dsp, void *buf, int len) { + dsl_dataset_t *ds = dsp->dsa_os->os_dsl_dataset; struct uio auio; struct iovec aiov; ASSERT3U(len % 8, ==, 0); - fletcher_4_incremental_native(buf, len, &ba->zc); + fletcher_4_incremental_native(buf, len, &dsp->dsa_zc); aiov.iov_base = buf; aiov.iov_len = len; auio.uio_iov = &aiov; @@ -94,24 +73,28 @@ dump_bytes(struct backuparg *ba, void *b auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_offset = (off_t)-1; - auio.uio_td = ba->td; + auio.uio_td = dsp->dsa_td; #ifdef _KERNEL - if (ba->fp->f_type == DTYPE_VNODE) + if (dsp->dsa_fp->f_type == DTYPE_VNODE) bwillwrite(); - ba->err = fo_write(ba->fp, &auio, ba->td->td_ucred, 0, ba->td); + dsp->dsa_err = fo_write(dsp->dsa_fp, &auio, dsp->dsa_td->td_ucred, 0, + dsp->dsa_td); #else fprintf(stderr, "%s: returning EOPNOTSUPP\n", __func__); - ba->err = EOPNOTSUPP; + dsp->dsa_err = EOPNOTSUPP; #endif - *ba->off += len; - return (ba->err); + mutex_enter(&ds->ds_sendstream_lock); + *dsp->dsa_off += len; + mutex_exit(&ds->ds_sendstream_lock); + + return (dsp->dsa_err); } static int -dump_free(struct backuparg *ba, uint64_t object, uint64_t offset, +dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset, uint64_t length) { - struct drr_free *drrf = &(ba->drr->drr_u.drr_free); + struct drr_free *drrf = &(dsp->dsa_drr->drr_u.drr_free); /* * If there is a pending op, but it's not PENDING_FREE, push it out, @@ -120,13 +103,15 @@ dump_free(struct backuparg *ba, uint64_t * other DRR_FREE records. DRR_FREEOBJECTS records can only be * aggregated with other DRR_FREEOBJECTS records. */ - if (ba->pending_op != PENDING_NONE && ba->pending_op != PENDING_FREE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE && + dsp->dsa_pending_op != PENDING_FREE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } - if (ba->pending_op == PENDING_FREE) { + if (dsp->dsa_pending_op == PENDING_FREE) { /* * There should never be a PENDING_FREE if length is -1 * (because dump_dnode is the only place where this @@ -144,34 +129,35 @@ dump_free(struct backuparg *ba, uint64_t return (0); } else { /* not a continuation. Push out pending record */ - if (dump_bytes(ba, ba->drr, + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } } /* create a FREE record and make it pending */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_FREE; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_FREE; drrf->drr_object = object; drrf->drr_offset = offset; drrf->drr_length = length; - drrf->drr_toguid = ba->toguid; + drrf->drr_toguid = dsp->dsa_toguid; if (length == -1ULL) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); } else { - ba->pending_op = PENDING_FREE; + dsp->dsa_pending_op = PENDING_FREE; } return (0); } static int -dump_data(struct backuparg *ba, dmu_object_type_t type, +dump_data(dmu_sendarg_t *dsp, dmu_object_type_t type, uint64_t object, uint64_t offset, int blksz, const blkptr_t *bp, void *data) { - struct drr_write *drrw = &(ba->drr->drr_u.drr_write); + struct drr_write *drrw = &(dsp->dsa_drr->drr_u.drr_write); /* @@ -180,19 +166,20 @@ dump_data(struct backuparg *ba, dmu_obje * the stream, since aggregation can't be done across operations * of different types. */ - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write a DATA record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_WRITE; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_WRITE; drrw->drr_object = object; drrw->drr_type = type; drrw->drr_offset = offset; drrw->drr_length = blksz; - drrw->drr_toguid = ba->toguid; + drrw->drr_toguid = dsp->dsa_toguid; drrw->drr_checksumtype = BP_GET_CHECKSUM(bp); if (zio_checksum_table[drrw->drr_checksumtype].ci_dedup) drrw->drr_checksumflags |= DRR_CHECKSUM_DEDUP; @@ -201,42 +188,43 @@ dump_data(struct backuparg *ba, dmu_obje DDK_SET_COMPRESS(&drrw->drr_key, BP_GET_COMPRESS(bp)); drrw->drr_key.ddk_cksum = bp->blk_cksum; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - if (dump_bytes(ba, data, blksz) != 0) + if (dump_bytes(dsp, data, blksz) != 0) return (EINTR); return (0); } static int -dump_spill(struct backuparg *ba, uint64_t object, int blksz, void *data) +dump_spill(dmu_sendarg_t *dsp, uint64_t object, int blksz, void *data) { - struct drr_spill *drrs = &(ba->drr->drr_u.drr_spill); + struct drr_spill *drrs = &(dsp->dsa_drr->drr_u.drr_spill); - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write a SPILL record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_SPILL; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_SPILL; drrs->drr_object = object; drrs->drr_length = blksz; - drrs->drr_toguid = ba->toguid; + drrs->drr_toguid = dsp->dsa_toguid; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t))) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t))) return (EINTR); - if (dump_bytes(ba, data, blksz)) + if (dump_bytes(dsp, data, blksz)) return (EINTR); return (0); } static int -dump_freeobjects(struct backuparg *ba, uint64_t firstobj, uint64_t numobjs) +dump_freeobjects(dmu_sendarg_t *dsp, uint64_t firstobj, uint64_t numobjs) { - struct drr_freeobjects *drrfo = &(ba->drr->drr_u.drr_freeobjects); + struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects); /* * If there is a pending op, but it's not PENDING_FREEOBJECTS, @@ -245,13 +233,14 @@ dump_freeobjects(struct backuparg *ba, u * aggregated with other DRR_FREE records. DRR_FREEOBJECTS records * can only be aggregated with other DRR_FREEOBJECTS records. */ - if (ba->pending_op != PENDING_NONE && - ba->pending_op != PENDING_FREEOBJECTS) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE && + dsp->dsa_pending_op != PENDING_FREEOBJECTS) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } - if (ba->pending_op == PENDING_FREEOBJECTS) { + if (dsp->dsa_pending_op == PENDING_FREEOBJECTS) { /* * See whether this free object array can be aggregated * with pending one @@ -261,42 +250,43 @@ dump_freeobjects(struct backuparg *ba, u return (0); } else { /* can't be aggregated. Push out pending record */ - if (dump_bytes(ba, ba->drr, + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } } /* write a FREEOBJECTS record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_FREEOBJECTS; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_FREEOBJECTS; drrfo->drr_firstobj = firstobj; drrfo->drr_numobjs = numobjs; - drrfo->drr_toguid = ba->toguid; + drrfo->drr_toguid = dsp->dsa_toguid; - ba->pending_op = PENDING_FREEOBJECTS; + dsp->dsa_pending_op = PENDING_FREEOBJECTS; return (0); } static int -dump_dnode(struct backuparg *ba, uint64_t object, dnode_phys_t *dnp) +dump_dnode(dmu_sendarg_t *dsp, uint64_t object, dnode_phys_t *dnp) { - struct drr_object *drro = &(ba->drr->drr_u.drr_object); + struct drr_object *drro = &(dsp->dsa_drr->drr_u.drr_object); if (dnp == NULL || dnp->dn_type == DMU_OT_NONE) - return (dump_freeobjects(ba, object, 1)); + return (dump_freeobjects(dsp, object, 1)); - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write an OBJECT record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_OBJECT; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_OBJECT; drro->drr_object = object; drro->drr_type = dnp->dn_type; drro->drr_bonustype = dnp->dn_bonustype; @@ -304,19 +294,19 @@ dump_dnode(struct backuparg *ba, uint64_ drro->drr_bonuslen = dnp->dn_bonuslen; drro->drr_checksumtype = dnp->dn_checksum; drro->drr_compress = dnp->dn_compress; - drro->drr_toguid = ba->toguid; + drro->drr_toguid = dsp->dsa_toguid; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - if (dump_bytes(ba, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) + if (dump_bytes(dsp, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) return (EINTR); /* free anything past the end of the file */ - if (dump_free(ba, object, (dnp->dn_maxblkid + 1) * + if (dump_free(dsp, object, (dnp->dn_maxblkid + 1) * (dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT), -1ULL)) return (EINTR); - if (ba->err) + if (dsp->dsa_err) return (EINTR); return (0); } @@ -330,7 +320,7 @@ static int backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { - struct backuparg *ba = arg; + dmu_sendarg_t *dsp = arg; dmu_object_type_t type = bp ? BP_GET_TYPE(bp) : DMU_OT_NONE; int err = 0; @@ -343,10 +333,10 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } else if (bp == NULL && zb->zb_object == DMU_META_DNODE_OBJECT) { uint64_t span = BP_SPAN(dnp, zb->zb_level); uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT; - err = dump_freeobjects(ba, dnobj, span >> DNODE_SHIFT); + err = dump_freeobjects(dsp, dnobj, span >> DNODE_SHIFT); } else if (bp == NULL) { uint64_t span = BP_SPAN(dnp, zb->zb_level); - err = dump_free(ba, zb->zb_object, zb->zb_blkid * span, span); + err = dump_free(dsp, zb->zb_object, zb->zb_blkid * span, span); } else if (zb->zb_level > 0 || type == DMU_OT_OBJSET) { return (0); } else if (type == DMU_OT_DNODE) { @@ -365,7 +355,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co for (i = 0; i < blksz >> DNODE_SHIFT; i++) { uint64_t dnobj = (zb->zb_blkid << (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i; - err = dump_dnode(ba, dnobj, blk+i); + err = dump_dnode(dsp, dnobj, blk+i); if (err) break; } @@ -380,7 +370,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co ZIO_FLAG_CANFAIL, &aflags, zb) != 0) return (EIO); - err = dump_spill(ba, zb->zb_object, blksz, abuf->b_data); + err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data); (void) arc_buf_remove_ref(abuf, &abuf); } else { /* it's a level-0 block of a regular object */ uint32_t aflags = ARC_WAIT; @@ -404,7 +394,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } } - err = dump_data(ba, type, zb->zb_object, zb->zb_blkid * blksz, + err = dump_data(dsp, type, zb->zb_object, zb->zb_blkid * blksz, blksz, bp, abuf->b_data); (void) arc_buf_remove_ref(abuf, &abuf); } @@ -414,13 +404,13 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } int -dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - struct file *fp, offset_t *off) +dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, + int outfd, struct file *fp, offset_t *off) { dsl_dataset_t *ds = tosnap->os_dsl_dataset; dsl_dataset_t *fromds = fromsnap ? fromsnap->os_dsl_dataset : NULL; dmu_replay_record_t *drr; - struct backuparg ba; + dmu_sendarg_t *dsp; int err; uint64_t fromtxg = 0; @@ -461,8 +451,10 @@ dmu_sendbackup(objset_t *tosnap, objset_ #ifdef _KERNEL if (dmu_objset_type(tosnap) == DMU_OST_ZFS) { uint64_t version; - if (zfs_get_zplprop(tosnap, ZFS_PROP_VERSION, &version) != 0) + if (zfs_get_zplprop(tosnap, ZFS_PROP_VERSION, &version) != 0) { + kmem_free(drr, sizeof (dmu_replay_record_t)); return (EINVAL); + } if (version == ZPL_VERSION_SA) { DMU_SET_FEATUREFLAGS( drr->drr_u.drr_begin.drr_versioninfo, @@ -489,47 +481,60 @@ dmu_sendbackup(objset_t *tosnap, objset_ if (fromorigin) dsl_dataset_rele(fromds, FTAG); - ba.drr = drr; - ba.td = curthread; - ba.fp = fp; - ba.os = tosnap; - ba.off = off; - ba.toguid = ds->ds_phys->ds_guid; - ZIO_SET_CHECKSUM(&ba.zc, 0, 0, 0, 0); - ba.pending_op = PENDING_NONE; + dsp = kmem_zalloc(sizeof (dmu_sendarg_t), KM_SLEEP); - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) { - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (ba.err); + dsp->dsa_drr = drr; + dsp->dsa_outfd = outfd; + dsp->dsa_proc = curproc; + dsp->dsa_td = curthread; + dsp->dsa_fp = fp; + dsp->dsa_os = tosnap; + dsp->dsa_off = off; + dsp->dsa_toguid = ds->ds_phys->ds_guid; + ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); + dsp->dsa_pending_op = PENDING_NONE; + + mutex_enter(&ds->ds_sendstream_lock); + list_insert_head(&ds->ds_sendstreams, dsp); + mutex_exit(&ds->ds_sendstream_lock); + + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) { + err = dsp->dsa_err; + goto out; } err = traverse_dataset(ds, fromtxg, TRAVERSE_PRE | TRAVERSE_PREFETCH, - backup_cb, &ba); + backup_cb, dsp); - if (ba.pending_op != PENDING_NONE) - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) err = EINTR; if (err) { - if (err == EINTR && ba.err) - err = ba.err; - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (err); + if (err == EINTR && dsp->dsa_err) + err = dsp->dsa_err; + goto out; } bzero(drr, sizeof (dmu_replay_record_t)); drr->drr_type = DRR_END; - drr->drr_u.drr_end.drr_checksum = ba.zc; - drr->drr_u.drr_end.drr_toguid = ba.toguid; + drr->drr_u.drr_end.drr_checksum = dsp->dsa_zc; + drr->drr_u.drr_end.drr_toguid = dsp->dsa_toguid; - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) { - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (ba.err); + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) { + err = dsp->dsa_err; + goto out; } +out: + mutex_enter(&ds->ds_sendstream_lock); + list_remove(&ds->ds_sendstreams, dsp); + mutex_exit(&ds->ds_sendstream_lock); + kmem_free(drr, sizeof (dmu_replay_record_t)); + kmem_free(dsp, sizeof (dmu_sendarg_t)); - return (0); + return (err); } int Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 25 01:21:17 2012 (r235952) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Portions Copyright (c) 2011 Martin Matuska @@ -32,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -401,6 +403,8 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_recvlock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&ds->ds_sendstream_lock, NULL, MUTEX_DEFAULT, NULL); + rw_init(&ds->ds_rwlock, 0, 0, 0); cv_init(&ds->ds_exclusive_cv, NULL, CV_DEFAULT, NULL); @@ -408,6 +412,9 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint dsl_deadlist_open(&ds->ds_deadlist, mos, ds->ds_phys->ds_deadlist_obj); + list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), + offsetof(dmu_sendarg_t, dsa_link)); + if (err == 0) { err = dsl_dir_open_obj(dp, ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri May 25 01:21:17 2012 (r235952) @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -706,8 +707,8 @@ typedef void (*dmu_traverse_cb_t)(objset void dmu_traverse_objset(objset_t *os, uint64_t txg_start, dmu_traverse_cb_t cb, void *arg); -int dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - struct file *fp, offset_t *off); +int dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, + int outfd, struct file *fp, offset_t *off); int dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, uint64_t *sizep); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Fri May 25 01:21:17 2012 (r235952) @@ -21,6 +21,8 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ #ifndef _SYS_DMU_IMPL_H @@ -31,6 +33,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -265,6 +268,33 @@ static xuio_stats_t xuio_stats = { atomic_add_64(&xuio_stats.stat.value.ui64, (val)) #define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1) +/* + * The list of data whose inclusion in a send stream can be pending from + * one call to backup_cb to another. Multiple calls to dump_free() and + * dump_freeobjects() can be aggregated into a single DRR_FREE or + * DRR_FREEOBJECTS replay record. + */ +typedef enum { + PENDING_NONE, + PENDING_FREE, + PENDING_FREEOBJECTS +} dmu_pendop_t; + +typedef struct dmu_sendarg { + list_node_t dsa_link; + dmu_replay_record_t *dsa_drr; + kthread_t *dsa_td; + struct file *dsa_fp; + int dsa_outfd; + struct proc *dsa_proc; + offset_t *dsa_off; + objset_t *dsa_os; + zio_cksum_t dsa_zc; + uint64_t dsa_toguid; + int dsa_err; + dmu_pendop_t dsa_pending_op; +} dmu_sendarg_t; + #ifdef __cplusplus } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri May 25 01:21:17 2012 (r235952) @@ -23,6 +23,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_DSL_DATASET_H @@ -152,6 +153,9 @@ typedef struct dsl_dataset { uint64_t ds_reserved; /* cached refreservation */ uint64_t ds_quota; /* cached refquota */ + kmutex_t ds_sendstream_lock; + list_t ds_sendstreams; + /* Protected by ds_lock; keep at end of struct for better locality */ char ds_snapname[MAXNAMELEN]; } dsl_dataset_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 25 01:21:17 2012 (r235952) @@ -25,6 +25,7 @@ * Portions Copyright 2011 Martin Matuska * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include @@ -57,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -3933,7 +3935,8 @@ zfs_ioc_send(zfs_cmd_t *zc) } off = fp->f_offset; - error = dmu_sendbackup(tosnap, fromsnap, zc->zc_obj, fp, &off); + error = dmu_send(tosnap, fromsnap, zc->zc_obj, + zc->zc_cookie, fp, &off); if (off >= 0 && off <= MAXOFFSET_T) fp->f_offset = off; @@ -3945,6 +3948,49 @@ zfs_ioc_send(zfs_cmd_t *zc) return (error); } +/* + * inputs: + * zc_name name of snapshot on which to report progress + * zc_cookie file descriptor of send stream + * + * outputs: + * zc_cookie number of bytes written in send stream thus far + */ +static int +zfs_ioc_send_progress(zfs_cmd_t *zc) +{ + dsl_dataset_t *ds; + dmu_sendarg_t *dsp = NULL; + int error; + + if ((error = dsl_dataset_hold(zc->zc_name, FTAG, &ds)) != 0) + return (error); + + mutex_enter(&ds->ds_sendstream_lock); + + /* + * Iterate over all the send streams currently active on this dataset. + * If there's one which matches the specified file descriptor _and_ the + * stream was started by the current process, return the progress of + * that stream. + */ + for (dsp = list_head(&ds->ds_sendstreams); dsp != NULL; + dsp = list_next(&ds->ds_sendstreams, dsp)) { + if (dsp->dsa_outfd == zc->zc_cookie && + dsp->dsa_proc == curproc) + break; + } + + if (dsp != NULL) + zc->zc_cookie = *(dsp->dsa_off); + else + error = ENOENT; + + mutex_exit(&ds->ds_sendstream_lock); + dsl_dataset_rele(ds, FTAG); + return (error); +} + static int zfs_ioc_inject_fault(zfs_cmd_t *zc) { @@ -4946,7 +4992,9 @@ static zfs_ioc_vec_t zfs_ioc_vec[] = { { zfs_ioc_space_written, zfs_secpolicy_read, DATASET_NAME, B_FALSE, B_TRUE }, { zfs_ioc_space_snaps, zfs_secpolicy_read, DATASET_NAME, B_FALSE, - B_TRUE } + B_TRUE }, + { zfs_ioc_send_progress, zfs_secpolicy_read, DATASET_NAME, B_FALSE, + B_FALSE } }; int Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri May 25 01:21:17 2012 (r235952) @@ -23,6 +23,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -794,6 +796,7 @@ typedef unsigned long zfs_ioc_t; #define ZFS_IOC_POOL_REGUID _IOWR('Z', 60, struct zfs_cmd) #define ZFS_IOC_SPACE_WRITTEN _IOWR('Z', 61, struct zfs_cmd) #define ZFS_IOC_SPACE_SNAPS _IOWR('Z', 62, struct zfs_cmd) +#define ZFS_IOC_SEND_PROGRESS _IOWR('Z', 63, struct zfs_cmd) /* * Internal SPA load state. Used by FMA diagnosis engine. From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 03:08:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FB751065672; Fri, 25 May 2012 03:08:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275248FC0C; Fri, 25 May 2012 03:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P38lik076730; Fri, 25 May 2012 03:08:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P38kN8076719; Fri, 25 May 2012 03:08:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205250308.q4P38kN8076719@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 25 May 2012 03:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235966 - in stable/8/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:08:47 -0000 Author: pfg Date: Fri May 25 03:08:46 2012 New Revision: 235966 URL: http://svn.freebsd.org/changeset/base/235966 Log: MFC: r235623 Bring in a subset of gcc fixes that were backported to the GCC 4.1 branch and are available under GPLv2. Reviewed by: mm Approved by: jhb (mentor) Modified: stable/8/contrib/gcc/config/rs6000/rs6000.md stable/8/contrib/gcc/config/sparc/sparc.md stable/8/contrib/gcc/cse.c stable/8/contrib/gcc/expr.c stable/8/contrib/gcc/fold-const.c stable/8/contrib/gcc/ipa-pure-const.c stable/8/contrib/gcc/ipa-utils.c stable/8/contrib/gcc/rtl.h stable/8/contrib/gcc/var-tracking.c stable/8/contrib/gcc/varasm.c Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/config/rs6000/rs6000.md ============================================================================== --- stable/8/contrib/gcc/config/rs6000/rs6000.md Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/config/rs6000/rs6000.md Fri May 25 03:08:46 2012 (r235966) @@ -10075,6 +10075,7 @@ "" " { + operands[1] = force_reg (Pmode, operands[1]); operands[2] = gen_reg_rtx (Pmode); operands[3] = gen_frame_mem (Pmode, operands[0]); operands[4] = gen_frame_mem (Pmode, operands[1]); Modified: stable/8/contrib/gcc/config/sparc/sparc.md ============================================================================== --- stable/8/contrib/gcc/config/sparc/sparc.md Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/config/sparc/sparc.md Fri May 25 03:08:46 2012 (r235966) @@ -5071,14 +5071,11 @@ [(set_attr "type" "multi") (set_attr "length" "2")]) -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. - (define_expand "divsi3" - [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))])] + [(parallel [(set (match_operand:SI 0 "register_operand" "") + (div:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "input_operand" ""))) + (clobber (match_scratch:SI 3 ""))])] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { if (TARGET_ARCH64) @@ -5091,24 +5088,40 @@ } }) +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. + (define_insn "divsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" -{ - if (which_alternative == 0) - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdiv\t%1, %2, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; - else - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tsdiv\t%1, %3, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + [(set (match_operand:SI 0 "register_operand" "=r,r,r") + (div:SI (match_operand:SI 1 "register_operand" "r,r,r") + (match_operand:SI 2 "input_operand" "rI,K,m"))) + (clobber (match_scratch:SI 3 "=&r,&r,&r"))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" +{ + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + + switch (which_alternative) + { + case 0: + if (TARGET_V9) + return "sdiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; + case 1: + if (TARGET_V9) + return "sethi\t%%hi(%a2), %3\n\tsdiv\t%1, %3, %0"; + else + return "sethi\t%%hi(%a2), %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + case 2: + if (TARGET_V9) + return "ld\t%2, %3\n\tsdiv\t%1, %3, %0"; + else + return "ld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + default: + gcc_unreachable (); + } } [(set_attr "type" "multi") (set (attr "length") @@ -5143,10 +5156,13 @@ (clobber (match_scratch:SI 3 "=&r"))] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdivcc\t%1, %2, %0"; + return "sdivcc\t%1, %2, %0"; else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") @@ -5161,29 +5177,48 @@ "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" "") -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. (define_insn "udivsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,&r,&r") - (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,m") - (match_operand:SI 2 "input_operand" "rI,m,r")))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" + [(set (match_operand:SI 0 "register_operand" "=r,&r,&r,&r") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,r,m") + (match_operand:SI 2 "input_operand" "rI,K,m,r")))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" { - output_asm_insn ("wr\t%%g0, %%g0, %%y", operands); + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + switch (which_alternative) { - default: - return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; + case 0: + if (TARGET_V9) + return "udiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; case 1: - return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + if (TARGET_V9) + return "sethi\t%%hi(%a2), %0\n\tudiv\t%1, %0, %0"; + else + return "sethi\t%%hi(%a2), %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; case 2: - return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + if (TARGET_V9) + return "ld\t%2, %0\n\tudiv\t%1, %0, %0"; + else + return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + case 3: + if (TARGET_V9) + return "ld\t%1, %0\n\tudiv\t%0, %2, %0"; + else + return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + default: + gcc_unreachable (); } } [(set_attr "type" "multi") - (set_attr "length" "5")]) + (set (attr "length") + (if_then_else (eq_attr "isa" "v9") + (const_int 3) (const_int 5)))]) (define_insn "udivsi3_sp64" [(set (match_operand:SI 0 "register_operand" "=r") @@ -5209,13 +5244,14 @@ (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") (udiv:SI (match_dup 1) (match_dup 2)))] - "TARGET_V8 - || TARGET_DEPRECATED_V8_INSNS" + "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + if (TARGET_V9) - return "wr\t%%g0, %%g0, %%y\n\tudivcc\t%1, %2, %0"; + return "udivcc\t%1, %2, %0"; else - return "wr\t%%g0, %%g0, %%y\n\tnop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") Modified: stable/8/contrib/gcc/cse.c ============================================================================== --- stable/8/contrib/gcc/cse.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/cse.c Fri May 25 03:08:46 2012 (r235966) @@ -583,7 +583,8 @@ static void delete_reg_equiv (unsigned i static int mention_regs (rtx); static int insert_regs (rtx, struct table_elt *, int); static void remove_from_table (struct table_elt *, unsigned); -static struct table_elt *lookup (rtx, unsigned, enum machine_mode); +static void remove_pseudo_from_table (rtx, unsigned); +static struct table_elt *lookup (rtx, unsigned, enum machine_mode); static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); static rtx lookup_as_function (rtx, enum rtx_code); static struct table_elt *insert (rtx, struct table_elt *, unsigned, @@ -1381,6 +1382,19 @@ remove_from_table (struct table_elt *elt table_size--; } +/* Same as above, but X is a pseudo-register. */ + +static void +remove_pseudo_from_table (rtx x, unsigned int hash) +{ + struct table_elt *elt; + + /* Because a pseudo-register can be referenced in more than one + mode, we might have to remove more than one table entry. */ + while ((elt = lookup_for_remove (x, hash, VOIDmode))) + remove_from_table (elt, hash); +} + /* Look up X in the hash table and return its table element, or 0 if X is not in the table. @@ -1707,7 +1721,10 @@ merge_equiv_classes (struct table_elt *c delete_reg_equiv (REGNO (exp)); } - remove_from_table (elt, hash); + if (REG_P (exp) && REGNO (exp) >= FIRST_PSEUDO_REGISTER) + remove_pseudo_from_table (exp, hash); + else + remove_from_table (elt, hash); if (insert_regs (exp, class1, 0) || need_rehash) { @@ -1803,14 +1820,7 @@ invalidate (rtx x, enum machine_mode ful SUBREG_TICKED (regno) = -1; if (regno >= FIRST_PSEUDO_REGISTER) - { - /* Because a register can be referenced in more than one mode, - we might have to remove more than one table entry. */ - struct table_elt *elt; - - while ((elt = lookup_for_remove (x, hash, GET_MODE (x)))) - remove_from_table (elt, hash); - } + remove_pseudo_from_table (x, hash); else { HOST_WIDE_INT in_table Modified: stable/8/contrib/gcc/expr.c ============================================================================== --- stable/8/contrib/gcc/expr.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/expr.c Fri May 25 03:08:46 2012 (r235966) @@ -4750,14 +4750,7 @@ count_type_elements (tree type, bool all case UNION_TYPE: case QUAL_UNION_TYPE: - { - /* Ho hum. How in the world do we guess here? Clearly it isn't - right to count the fields. Guess based on the number of words. */ - HOST_WIDE_INT n = int_size_in_bytes (type); - if (n < 0) - return -1; - return n / UNITS_PER_WORD; - } + return -1; case COMPLEX_TYPE: return 2; Modified: stable/8/contrib/gcc/fold-const.c ============================================================================== --- stable/8/contrib/gcc/fold-const.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/fold-const.c Fri May 25 03:08:46 2012 (r235966) @@ -6657,12 +6657,14 @@ fold_widened_comparison (enum tree_code if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) return NULL_TREE; - arg1_unw = get_unwidened (arg1, shorter_type); + arg1_unw = get_unwidened (arg1, NULL_TREE); /* If possible, express the comparison in the shorter mode. */ if ((code == EQ_EXPR || code == NE_EXPR || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type)) && (TREE_TYPE (arg1_unw) == shorter_type + || (TYPE_PRECISION (shorter_type) + >= TYPE_PRECISION (TREE_TYPE (arg1_unw))) || (TREE_CODE (arg1_unw) == INTEGER_CST && (TREE_CODE (shorter_type) == INTEGER_TYPE || TREE_CODE (shorter_type) == BOOLEAN_TYPE) @@ -10647,24 +10649,24 @@ fold_binary (enum tree_code code, tree t tree arg01 = TREE_OPERAND (arg0, 1); if (TREE_CODE (arg00) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg00, 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg00), - arg01, TREE_OPERAND (arg00, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); - else if (TREE_CODE (TREE_OPERAND (arg0, 1)) == LSHIFT_EXPR - && integer_onep (TREE_OPERAND (TREE_OPERAND (arg0, 1), 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg01), - arg00, TREE_OPERAND (arg01, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg00), + arg01, TREE_OPERAND (arg00, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } + else if (TREE_CODE (arg01) == LSHIFT_EXPR + && integer_onep (TREE_OPERAND (arg01, 0))) + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg01), + arg00, TREE_OPERAND (arg01, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } } /* If this is an NE or EQ comparison of zero against the result of a Modified: stable/8/contrib/gcc/ipa-pure-const.c ============================================================================== --- stable/8/contrib/gcc/ipa-pure-const.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/ipa-pure-const.c Fri May 25 03:08:46 2012 (r235966) @@ -639,6 +639,7 @@ static_execute (void) for (i = 0; i < order_pos; i++ ) { enum pure_const_state_e pure_const_state = IPA_CONST; + int count = 0; node = order[i]; /* Find the worst state for any node in the cycle. */ @@ -655,11 +656,40 @@ static_execute (void) if (!w_l->state_set_in_source) { struct cgraph_edge *e; + count++; + + /* FIXME!!! Because of pr33826, we cannot have either + immediate or transitive recursive functions marked as + pure or const because dce can delete a function that + is in reality an infinite loop. A better solution + than just outlawing them is to add another bit the + functions to distinguish recursive from non recursive + pure and const function. This would allow the + recursive ones to be cse'd but not dce'd. In this + same vein, we could allow functions with loops to + also be cse'd but not dce'd. + + Unfortunately we are late in stage 3, and the fix + described above is is not appropriate. */ + if (count > 1) + { + pure_const_state = IPA_NEITHER; + break; + } + for (e = w->callees; e; e = e->next_callee) { struct cgraph_node *y = e->callee; /* Only look at the master nodes and skip external nodes. */ y = cgraph_master_clone (y); + + /* Check for immediate recursive functions. See the + FIXME above. */ + if (w == y) + { + pure_const_state = IPA_NEITHER; + break; + } if (y) { funct_state y_l = get_function_state (y); Modified: stable/8/contrib/gcc/ipa-utils.c ============================================================================== --- stable/8/contrib/gcc/ipa-utils.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/ipa-utils.c Fri May 25 03:08:46 2012 (r235966) @@ -78,7 +78,7 @@ struct searchc_env { has been customized for cgraph_nodes. The env parameter is because it is recursive and there are no nested functions here. This function should only be called from itself or - cgraph_reduced_inorder. ENV is a stack env and would be + ipa_utils_reduced_inorder. ENV is a stack env and would be unnecessary if C had nested functions. V is the node to start searching from. */ Modified: stable/8/contrib/gcc/rtl.h ============================================================================== --- stable/8/contrib/gcc/rtl.h Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/rtl.h Fri May 25 03:08:46 2012 (r235966) @@ -1184,8 +1184,8 @@ do { \ refer to part of a DECL. */ #define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl) -/* For a MEM rtx, the offset from the start of MEM_DECL, if known, as a - RTX that is always a CONST_INT. */ +/* For a REG rtx, the offset from the start of REG_EXPR, if known, as an + HOST_WIDE_INT. */ #define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset) /* Copy the attributes that apply to memory locations from RHS to LHS. */ Modified: stable/8/contrib/gcc/var-tracking.c ============================================================================== --- stable/8/contrib/gcc/var-tracking.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/var-tracking.c Fri May 25 03:08:46 2012 (r235966) @@ -259,6 +259,9 @@ typedef struct variable_def /* Pointer to the BB's information specific to variable tracking pass. */ #define VTI(BB) ((variable_tracking_info) (BB)->aux) +/* Macro to access MEM_OFFSET as an HOST_WIDE_INT. Evaluates MEM twice. */ +#define INT_MEM_OFFSET(mem) (MEM_OFFSET (mem) ? INTVAL (MEM_OFFSET (mem)) : 0) + /* Alloc pool for struct attrs_def. */ static alloc_pool attrs_pool; @@ -927,7 +930,7 @@ static void var_mem_set (dataflow_set *set, rtx loc) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -945,7 +948,7 @@ static void var_mem_delete_and_set (dataflow_set *set, rtx loc, bool modify) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -962,7 +965,7 @@ static void var_mem_delete (dataflow_set *set, rtx loc, bool clobber) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); if (clobber) @@ -1540,6 +1543,18 @@ track_expr_p (tree expr) return 1; } +/* Return true if OFFSET is a valid offset for a register or memory + access we want to track. This is used to reject out-of-bounds + accesses that can cause assertions to fail later. Note that we + don't reject negative offsets because they can be generated for + paradoxical subregs on big-endian architectures. */ + +static inline bool +offset_valid_for_tracked_p (HOST_WIDE_INT offset) +{ + return (-MAX_VAR_PARTS < offset) && (offset < MAX_VAR_PARTS); +} + /* Determine whether a given LOC refers to the same variable part as EXPR+OFFSET. */ @@ -1560,7 +1575,7 @@ same_variable_part_p (rtx loc, tree expr else if (MEM_P (loc)) { expr2 = MEM_EXPR (loc); - offset2 = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + offset2 = INT_MEM_OFFSET (loc); } else return false; @@ -1590,7 +1605,8 @@ count_uses (rtx *loc, void *insn) } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { VTI (bb)->n_mos++; } @@ -1626,14 +1642,19 @@ add_uses (rtx *loc, void *insn) basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; - mo->type = ((REG_EXPR (*loc) && track_expr_p (REG_EXPR (*loc))) - ? MO_USE : MO_USE_NO_VAR); + if (REG_EXPR (*loc) + && track_expr_p (REG_EXPR (*loc)) + && offset_valid_for_tracked_p (REG_OFFSET (*loc))) + mo->type = MO_USE; + else + mo->type = MO_USE_NO_VAR; mo->u.loc = *loc; mo->insn = (rtx) insn; } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1667,8 +1688,9 @@ add_stores (rtx loc, rtx expr, void *ins micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; if (GET_CODE (expr) == CLOBBER - || ! REG_EXPR (loc) - || ! track_expr_p (REG_EXPR (loc))) + || !(REG_EXPR (loc) + && track_expr_p (REG_EXPR (loc)) + && offset_valid_for_tracked_p (REG_OFFSET (loc)))) mo->type = MO_CLOBBER; else if (GET_CODE (expr) == SET && SET_DEST (expr) == loc @@ -1683,7 +1705,8 @@ add_stores (rtx loc, rtx expr, void *ins } else if (MEM_P (loc) && MEM_EXPR (loc) - && track_expr_p (MEM_EXPR (loc))) + && track_expr_p (MEM_EXPR (loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1694,8 +1717,7 @@ add_stores (rtx loc, rtx expr, void *ins && SET_DEST (expr) == loc && same_variable_part_p (SET_SRC (expr), MEM_EXPR (loc), - MEM_OFFSET (loc) - ? INTVAL (MEM_OFFSET (loc)) : 0)) + INT_MEM_OFFSET (loc))) mo->type = MO_COPY; else mo->type = MO_SET; @@ -2726,7 +2748,7 @@ vt_get_decl_and_offset (rtx rtl, tree *d if (MEM_ATTRS (rtl)) { *declp = MEM_EXPR (rtl); - *offsetp = MEM_OFFSET (rtl) ? INTVAL (MEM_OFFSET (rtl)) : 0; + *offsetp = INT_MEM_OFFSET (rtl); return true; } } Modified: stable/8/contrib/gcc/varasm.c ============================================================================== --- stable/8/contrib/gcc/varasm.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/varasm.c Fri May 25 03:08:46 2012 (r235966) @@ -5873,9 +5873,10 @@ default_binds_local_p_1 (tree exp, int s else if (DECL_WEAK (exp)) local_p = false; /* If PIC, then assume that any global name can be overridden by - symbols resolved from other modules. */ + symbols resolved from other modules, unless we are compiling with + -fwhole-program, which assumes that names are local. */ else if (shlib) - local_p = false; + local_p = flag_whole_program; /* Uninitialized COMMON variable may be unified with symbols resolved from other modules. */ else if (DECL_COMMON (exp) From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 04:26:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A84471065670; Fri, 25 May 2012 04:26:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C028FC08; Fri, 25 May 2012 04:26:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P4Qi7s080113; Fri, 25 May 2012 04:26:44 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P4Qivm080109; Fri, 25 May 2012 04:26:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201205250426.q4P4Qivm080109@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 May 2012 04:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235969 - stable/8/sys/geom/mirror X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:26:44 -0000 Author: ae Date: Fri May 25 04:26:44 2012 New Revision: 235969 URL: http://svn.freebsd.org/changeset/base/235969 Log: MFC r235599: Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should protect geom from destroying while it is tasting. MFC r235600: Prevent removing of the last active component from a mirror. PR: kern/154860 Reviewed by: pjd Tested by: Eugene Grosbein Modified: stable/8/sys/geom/mirror/g_mirror.c stable/8/sys/geom/mirror/g_mirror.h stable/8/sys/geom/mirror/g_mirror_ctl.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Fri May 25 04:26:14 2012 (r235968) +++ stable/8/sys/geom/mirror/g_mirror.c Fri May 25 04:26:44 2012 (r235969) @@ -1690,6 +1690,8 @@ g_mirror_can_destroy(struct g_mirror_sof gp = sc->sc_geom; if (gp->softc == NULL) return (1); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_TASTING) != 0) + return (0); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_mirror_is_busy(sc, cp)) return (0); @@ -3051,6 +3053,7 @@ g_mirror_taste(struct g_class *mp, struc G_MIRROR_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); g_topology_unlock(); sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; error = g_mirror_add_disk(sc, pp, &md); if (error != 0) { G_MIRROR_DEBUG(0, "Cannot add disk %s to %s (error=%d).", @@ -3063,6 +3066,12 @@ g_mirror_taste(struct g_class *mp, struc } gp = NULL; } + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(sc, G_MIRROR_DESTROY_HARD); + g_topology_lock(); + return (NULL); + } sx_xunlock(&sc->sc_lock); g_topology_lock(); return (gp); Modified: stable/8/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.h Fri May 25 04:26:14 2012 (r235968) +++ stable/8/sys/geom/mirror/g_mirror.h Fri May 25 04:26:44 2012 (r235969) @@ -157,6 +157,7 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL #define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL #define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 Modified: stable/8/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:26:14 2012 (r235968) +++ stable/8/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:26:44 2012 (r235969) @@ -560,7 +560,7 @@ g_mirror_ctl_remove(struct gctl_req *req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -587,6 +587,7 @@ g_mirror_ctl_remove(struct gctl_req *req "first."); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -599,6 +600,16 @@ g_mirror_ctl_remove(struct gctl_req *req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't remove the last " + "ACTIVE component %s.", sc->sc_geom->name, + name); + continue; + } + } g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DESTROY, G_MIRROR_EVENT_DONTWAIT); } From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 07:23:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71F3D106566B; Fri, 25 May 2012 07:23:25 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6458FC08; Fri, 25 May 2012 07:23:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P7NPsK087555; Fri, 25 May 2012 07:23:25 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7NPoM087552; Fri, 25 May 2012 07:23:25 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201205250723.q4P7NPoM087552@svn.freebsd.org> From: Fabien Thomas Date: Fri, 25 May 2012 07:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235976 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:23:25 -0000 Author: fabient Date: Fri May 25 07:23:24 2012 New Revision: 235976 URL: http://svn.freebsd.org/changeset/base/235976 Log: MFC r233611: - Support inlined location in calltree output. In case of multiple level of inlining all the locations are flattened. Require recent binutils/addr2line (head works or binutils from ports with the right $PATH order). - Multiple fixes in the calltree output (recursion case, ...) - Fix the calltree top view that previously hide some shared nodes. Tested with Kcachegrind(kdesdk4)/qcachegrind(head). Sponsored by: NETASQ Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Fri May 25 06:48:42 2012 (r235975) +++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Fri May 25 07:23:24 2012 (r235976) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, Fabien Thomas + * Copyright (c) 2012, Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,20 +59,18 @@ __FBSDID("$FreeBSD$"); #include "pmcstat_top.h" #include "pmcpl_calltree.h" -#define PMCPL_CT_GROWSIZE 4 - -static pmcstat_interned_string pmcpl_ct_prevfn; +#define PMCPL_CT_GROWSIZE 4 static int pmcstat_skiplink = 0; struct pmcpl_ct_node; /* Get the sample value for PMC a. */ -#define PMCPL_CT_SAMPLE(a, b) \ +#define PMCPL_CT_SAMPLE(a, b) \ ((a) < (b)->npmcs ? (b)->sb[a] : 0) /* Get the sample value in percent related to rsamples. */ -#define PMCPL_CT_SAMPLEP(a, b) \ +#define PMCPL_CT_SAMPLEP(a, b) \ (PMCPL_CT_SAMPLE(a, b) * 100.0 / rsamples->sb[a]) struct pmcpl_ct_sample { @@ -96,10 +94,13 @@ struct pmcpl_ct_instr { * Each calltree node is tracked by a pmcpl_ct_node struct. */ struct pmcpl_ct_node { -#define PMCPL_PCT_TAG 0x00000001 /* Loop detection. */ - uint32_t pct_flags; struct pmcstat_image *pct_image; uintfptr_t pct_func; + + struct pmcstat_symbol *pct_sym; + pmcstat_interned_string pct_ifl; + pmcstat_interned_string pct_ifn; + struct pmcpl_ct_sample pct_samples; int pct_narc; @@ -110,17 +111,25 @@ struct pmcpl_ct_node { int pct_ninstr; int pct_instr_c; struct pmcpl_ct_instr *pct_instr; + +#define PMCPL_PCT_ADDR 0 +#define PMCPL_PCT_NAME 1 + char pct_type; +#define PMCPL_PCT_WHITE 0 +#define PMCPL_PCT_GREY 1 +#define PMCPL_PCT_BLACK 2 + char pct_color; }; struct pmcpl_ct_node_hash { struct pmcpl_ct_node *pch_ctnode; - LIST_ENTRY(pmcpl_ct_node_hash) pch_next; + STAILQ_ENTRY(pmcpl_ct_node_hash) pch_next; }; struct pmcpl_ct_sample pmcpl_ct_callid; -#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX -#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */ +#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX +#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */ struct pmcpl_ct_line { unsigned ln_sum; @@ -128,12 +137,13 @@ struct pmcpl_ct_line { }; struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1]; -struct pmcpl_ct_node *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1]; +struct pmcpl_ct_node + *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1]; /* * All nodes indexed by function/image name are placed in a hash table. */ -static LIST_HEAD(,pmcpl_ct_node_hash) pmcpl_ct_node_hash[PMCSTAT_NHASH]; +static STAILQ_HEAD(,pmcpl_ct_node_hash) pmcpl_ct_node_hash[PMCSTAT_NHASH]; /* * Root node for the graph. @@ -257,7 +267,8 @@ pmcpl_ct_instr_grow(int cursize, int *ma */ static void -pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin, uintfptr_t pc) +pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin, + uintfptr_t pc, unsigned v) { int i; struct pmcpl_ct_instr *in; @@ -266,7 +277,7 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node if (ct->pct_instr[i].pctf_func == pc) { in = &ct->pct_instr[i]; pmcpl_ct_samples_grow(&in->pctf_samples); - in->pctf_samples.sb[pmcin]++; + in->pctf_samples.sb[pmcin] += v; return; } } @@ -276,7 +287,7 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node in->pctf_func = pc; pmcpl_ct_samples_init(&in->pctf_samples); pmcpl_ct_samples_grow(&in->pctf_samples); - in->pctf_samples.sb[pmcin] = 1; + in->pctf_samples.sb[pmcin] = v; ct->pct_ninstr++; } @@ -285,19 +296,19 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node */ static struct pmcpl_ct_node * -pmcpl_ct_node_allocate(struct pmcstat_image *image, uintfptr_t pc) +pmcpl_ct_node_allocate(void) { struct pmcpl_ct_node *ct; if ((ct = malloc(sizeof(*ct))) == NULL) err(EX_OSERR, "ERROR: Cannot allocate callgraph node"); - ct->pct_flags = 0; - ct->pct_image = image; - ct->pct_func = pc; - pmcpl_ct_samples_init(&ct->pct_samples); + ct->pct_sym = NULL; + ct->pct_image = NULL; + ct->pct_func = 0; + ct->pct_narc = 0; ct->pct_arc_c = 0; ct->pct_arc = NULL; @@ -306,6 +317,8 @@ pmcpl_ct_node_allocate(struct pmcstat_im ct->pct_instr_c = 0; ct->pct_instr = NULL; + ct->pct_color = PMCPL_PCT_WHITE; + return (ct); } @@ -339,10 +352,10 @@ pmcpl_ct_node_cleartag(void) struct pmcpl_ct_node_hash *pch; for (i = 0; i < PMCSTAT_NHASH; i++) - LIST_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) - pch->pch_ctnode->pct_flags &= ~PMCPL_PCT_TAG; + STAILQ_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) + pch->pch_ctnode->pct_color = PMCPL_PCT_WHITE; - pmcpl_ct_root->pct_flags &= ~PMCPL_PCT_TAG; + pmcpl_ct_root->pct_color = PMCPL_PCT_WHITE; } /* @@ -356,11 +369,9 @@ pmcpl_ct_node_dumptop(int pmcin, struct int i, terminal; struct pmcpl_ct_arc *arc; - if (ct->pct_flags & PMCPL_PCT_TAG) + if (ct->pct_color == PMCPL_PCT_GREY) return 0; - ct->pct_flags |= PMCPL_PCT_TAG; - if (x >= PMCPL_CT_MAXCOL) { pmcpl_ct_topscreen[x][*y] = NULL; return 1; @@ -375,11 +386,11 @@ pmcpl_ct_node_dumptop(int pmcin, struct terminal = 1; for (i = 0; i < ct->pct_narc; i++) { arc = &ct->pct_arc[i]; - if (PMCPL_CT_SAMPLE(pmcin, + if (arc->pcta_child->pct_color != PMCPL_PCT_GREY && + PMCPL_CT_SAMPLE(pmcin, &arc->pcta_samples) != 0 && PMCPL_CT_SAMPLEP(pmcin, - &arc->pcta_samples) > pmcstat_threshold && - (arc->pcta_child->pct_flags & PMCPL_PCT_TAG) == 0) { + &arc->pcta_samples) > pmcstat_threshold) { terminal = 0; break; } @@ -396,6 +407,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct return 0; } + ct->pct_color = PMCPL_PCT_GREY; for (i = 0; i < ct->pct_narc; i++) { if (PMCPL_CT_SAMPLE(pmcin, &ct->pct_arc[i].pcta_samples) == 0) @@ -404,10 +416,13 @@ pmcpl_ct_node_dumptop(int pmcin, struct &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) { if (pmcpl_ct_node_dumptop(pmcin, ct->pct_arc[i].pcta_child, - rsamples, x+1, y)) + rsamples, x+1, y)) { + ct->pct_color = PMCPL_PCT_BLACK; return 1; + } } } + ct->pct_color = PMCPL_PCT_BLACK; return 0; } @@ -447,7 +462,6 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s float v; char ns[30], vs[10], is[20]; struct pmcpl_ct_node *ct; - struct pmcstat_symbol *sym; const char *space = " "; /* @@ -504,10 +518,9 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s strlcpy(ns, ".", sizeof(ns)); ns_len = 1; } else { - sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func); - if (sym != NULL) { + if (ct->pct_sym != NULL) { ns_len = snprintf(ns, sizeof(ns), "%s", - pmcstat_string_unintern(sym->ps_name)); + pmcstat_string_unintern(ct->pct_sym->ps_name)); } else ns_len = snprintf(ns, sizeof(ns), "%p", (void *)ct->pct_func); @@ -548,7 +561,6 @@ pmcpl_ct_topdisplay(void) rsamples = &r; pmcpl_ct_samples_root(rsamples); - pmcpl_ct_node_cleartag(); PMCSTAT_PRINTW("%5.5s %s\n", "%SAMP", "CALLTREE"); @@ -589,81 +601,92 @@ pmcpl_ct_topkeypress(int c, WINDOW *w) * `ppm'. */ -static struct pmcpl_ct_node * -pmcpl_ct_node_hash_lookup_pc(struct pmcpl_ct_node *parent, - struct pmcstat_pcmap *ppm, uintfptr_t pc, int pmcin) +static void +pmcpl_ct_node_update(struct pmcpl_ct_node *parent, + struct pmcpl_ct_node *child, int pmcin, unsigned v, int cd) { - struct pmcstat_symbol *sym; - struct pmcstat_image *image; - struct pmcpl_ct_node *ct; - struct pmcpl_ct_node_hash *h; struct pmcpl_ct_arc *arc; - uintfptr_t loadaddress; int i; - unsigned int hash; assert(parent != NULL); - image = ppm->ppm_image; - - loadaddress = ppm->ppm_lowpc + image->pi_vaddr - image->pi_start; - pc -= loadaddress; /* Convert to an offset in the image. */ + /* + * Find related arc in parent node and + * increment the sample count. + */ + for (i = 0; i < parent->pct_narc; i++) { + if (parent->pct_arc[i].pcta_child == child) { + arc = &parent->pct_arc[i]; + pmcpl_ct_samples_grow(&arc->pcta_samples); + arc->pcta_samples.sb[pmcin] += v; + /* Estimate call count. */ + if (cd) { + pmcpl_ct_samples_grow(&arc->pcta_callid); + if (pmcpl_ct_callid.sb[pmcin] - + arc->pcta_callid.sb[pmcin] > 1) + arc->pcta_call++; + arc->pcta_callid.sb[pmcin] = + pmcpl_ct_callid.sb[pmcin]; + } + return; + } + } /* - * Try determine the function at this offset. If we can't - * find a function round leave the `pc' value alone. + * No arc found for us, add ourself to the parent. */ - if ((sym = pmcstat_symbol_search(image, pc)) != NULL) - pc = sym->ps_start; - else - pmcstat_stats.ps_samples_unknown_function++; + pmcpl_ct_arc_grow(parent->pct_narc, + &parent->pct_arc_c, &parent->pct_arc); + arc = &parent->pct_arc[parent->pct_narc]; + pmcpl_ct_samples_grow(&arc->pcta_samples); + arc->pcta_samples.sb[pmcin] = v; + arc->pcta_call = 1; + if (cd) { + pmcpl_ct_samples_grow(&arc->pcta_callid); + arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; + } + arc->pcta_child = child; + parent->pct_narc++; +} + +/* + * Lookup by image/pc. + */ + +static struct pmcpl_ct_node * +pmcpl_ct_node_hash_lookup(struct pmcstat_image *image, uintfptr_t pc, + struct pmcstat_symbol *sym, char *fl, char *fn) +{ + int i; + unsigned int hash; + struct pmcpl_ct_node *ct; + struct pmcpl_ct_node_hash *h; + pmcstat_interned_string ifl, ifn; + + if (fn != NULL) { + ifl = pmcstat_string_intern(fl); + ifn = pmcstat_string_intern(fn); + } else { + ifl = 0; + ifn = 0; + } for (hash = i = 0; i < (int)sizeof(uintfptr_t); i++) hash += (pc >> i) & 0xFF; hash &= PMCSTAT_HASH_MASK; - ct = NULL; - LIST_FOREACH(h, &pmcpl_ct_node_hash[hash], pch_next) { + STAILQ_FOREACH(h, &pmcpl_ct_node_hash[hash], pch_next) { ct = h->pch_ctnode; assert(ct != NULL); if (ct->pct_image == image && ct->pct_func == pc) { - /* - * Find related arc in parent node and - * increment the sample count. - */ - for (i = 0; i < parent->pct_narc; i++) { - if (parent->pct_arc[i].pcta_child == ct) { - arc = &parent->pct_arc[i]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin]++; - /* Estimate call count. */ - pmcpl_ct_samples_grow(&arc->pcta_callid); - if (pmcpl_ct_callid.sb[pmcin] - - arc->pcta_callid.sb[pmcin] > 1) - arc->pcta_call++; - arc->pcta_callid.sb[pmcin] = - pmcpl_ct_callid.sb[pmcin]; - return (ct); - } - } - - /* - * No arc found for us, add ourself to the parent. - */ - pmcpl_ct_arc_grow(parent->pct_narc, - &parent->pct_arc_c, &parent->pct_arc); - arc = &parent->pct_arc[parent->pct_narc]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin] = 1; - arc->pcta_call = 1; - pmcpl_ct_samples_grow(&arc->pcta_callid); - arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; - arc->pcta_child = ct; - parent->pct_narc++; - return (ct); + if (fn == NULL) + return (ct); + if (ct->pct_type == PMCPL_PCT_NAME && + ct->pct_ifl == ifl && ct->pct_ifn == ifn) + return (ct); } } @@ -671,23 +694,22 @@ pmcpl_ct_node_hash_lookup_pc(struct pmcp * We haven't seen this (pmcid, pc) tuple yet, so allocate a * new callgraph node and a new hash table entry for it. */ - ct = pmcpl_ct_node_allocate(image, pc); + ct = pmcpl_ct_node_allocate(); if ((h = malloc(sizeof(*h))) == NULL) err(EX_OSERR, "ERROR: Could not allocate callgraph node"); - h->pch_ctnode = ct; - LIST_INSERT_HEAD(&pmcpl_ct_node_hash[hash], h, pch_next); + if (fn != NULL) { + ct->pct_type = PMCPL_PCT_NAME; + ct->pct_ifl = ifl; + ct->pct_ifn = ifn; + } else + ct->pct_type = PMCPL_PCT_ADDR; + ct->pct_image = image; + ct->pct_func = pc; + ct->pct_sym = sym; - pmcpl_ct_arc_grow(parent->pct_narc, - &parent->pct_arc_c, &parent->pct_arc); - arc = &parent->pct_arc[parent->pct_narc]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin] = 1; - arc->pcta_call = 1; - pmcpl_ct_samples_grow(&arc->pcta_callid); - arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; - arc->pcta_child = ct; - parent->pct_narc++; + h->pch_ctnode = ct; + STAILQ_INSERT_HEAD(&pmcpl_ct_node_hash[hash], h, pch_next); return (ct); } @@ -699,10 +721,14 @@ void pmcpl_ct_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) { - int n, pmcin; + int i, n, pmcin; + uintfptr_t pc, loadaddress; + struct pmcstat_image *image; + struct pmcstat_symbol *sym; struct pmcstat_pcmap *ppm[PMC_CALLCHAIN_DEPTH_MAX]; struct pmcstat_process *km; - struct pmcpl_ct_node *parent, *child; + struct pmcpl_ct_node *ct; + struct pmcpl_ct_node *ctl[PMC_CALLCHAIN_DEPTH_MAX+1]; (void) cpu; @@ -741,30 +767,114 @@ pmcpl_ct_process(struct pmcstat_process pmcpl_ct_callid.sb[pmcin]++; /* - * Iterate remaining addresses. + * Build node list. */ - for (parent = pmcpl_ct_root, child = NULL; n >= 0; n--) { - child = pmcpl_ct_node_hash_lookup_pc(parent, ppm[n], cc[n], - pmcin); - if (child == NULL) { + ctl[0] = pmcpl_ct_root; + for (i = 1; n >= 0; n--) { + image = ppm[n]->ppm_image; + loadaddress = ppm[n]->ppm_lowpc + + image->pi_vaddr - image->pi_start; + /* Convert to an offset in the image. */ + pc = cc[n] - loadaddress; + /* + * Try determine the function at this offset. If we can't + * find a function round leave the `pc' value alone. + */ + if ((sym = pmcstat_symbol_search(image, pc)) != NULL) + pc = sym->ps_start; + else + pmcstat_stats.ps_samples_unknown_function++; + + ct = pmcpl_ct_node_hash_lookup(image, pc, sym, NULL, NULL); + if (ct == NULL) { pmcstat_stats.ps_callchain_dubious_frames++; continue; } - parent = child; + ctl[i++] = ct; } + /* No valid node found. */ + if (i == 1) + return; + n = i; + + ct = ctl[0]; + for (i = 1; i < n; i++) + pmcpl_ct_node_update(ctl[i-1], ctl[i], pmcin, 1, 1); /* * Increment the sample count for this PMC. */ - if (child != NULL) { - pmcpl_ct_samples_grow(&child->pct_samples); - child->pct_samples.sb[pmcin]++; - - /* Update per instruction sample if required. */ - if (args.pa_ctdumpinstr) - pmcpl_ct_instr_add(child, pmcin, cc[0] - - (ppm[0]->ppm_lowpc + ppm[0]->ppm_image->pi_vaddr - - ppm[0]->ppm_image->pi_start)); + pmcpl_ct_samples_grow(&ctl[n-1]->pct_samples); + ctl[n-1]->pct_samples.sb[pmcin]++; + + /* Update per instruction sample if required. */ + if (args.pa_ctdumpinstr) + pmcpl_ct_instr_add(ctl[n-1], pmcin, cc[0] - + (ppm[0]->ppm_lowpc + ppm[0]->ppm_image->pi_vaddr - + ppm[0]->ppm_image->pi_start), 1); +} + +/* + * Print node child cost. + */ + +static void +pmcpl_ct_node_printchild(struct pmcpl_ct_node *ct, uintfptr_t paddr, + int pline) +{ + int i, j, line; + uintfptr_t addr; + struct pmcpl_ct_node *child; + char sourcefile[PATH_MAX]; + char funcname[PATH_MAX]; + + /* + * Child cost. + * TODO: attach child cost to the real position in the funtion. + * TODO: cfn= / call addr() / addr(call ) + */ + for (i=0 ; ipct_narc; i++) { + child = ct->pct_arc[i].pcta_child; + /* Object binary. */ + fprintf(args.pa_graphfile, "cob=%s\n", + pmcstat_string_unintern(child->pct_image->pi_fullpath)); + /* Child function name. */ + addr = child->pct_image->pi_vaddr + child->pct_func; + line = 0; + /* Child function source file. */ + if (child->pct_type == PMCPL_PCT_NAME) { + fprintf(args.pa_graphfile, "cfi=%s\ncfn=%s\n", + pmcstat_string_unintern(child->pct_ifl), + pmcstat_string_unintern(child->pct_ifn)); + } else if (pmcstat_image_addr2line(child->pct_image, addr, + sourcefile, sizeof(sourcefile), &line, + funcname, sizeof(funcname))) { + fprintf(args.pa_graphfile, "cfi=%s\ncfn=%s\n", + sourcefile, funcname); + } else { + if (child->pct_sym != NULL) + fprintf(args.pa_graphfile, + "cfi=???\ncfn=%s\n", + pmcstat_string_unintern( + child->pct_sym->ps_name)); + else + fprintf(args.pa_graphfile, + "cfi=???\ncfn=%p\n", (void *)addr); + } + + /* Child function address, line and call count. */ + fprintf(args.pa_graphfile, "calls=%u %p %u\n", + ct->pct_arc[i].pcta_call, (void *)addr, line); + + /* + * Call address, line, sample. + * TODO: Associate call address to the right location. + */ + fprintf(args.pa_graphfile, "%p %u", (void *)paddr, pline); + for (j = 0; jpct_arc[i].pcta_samples)); + fprintf(args.pa_graphfile, "\n"); } } @@ -775,40 +885,37 @@ pmcpl_ct_process(struct pmcstat_process static void pmcpl_ct_node_printself(struct pmcpl_ct_node *ct) { - int i, j, line; - uintptr_t addr; - struct pmcstat_symbol *sym; + int i, j, fline, line; + uintfptr_t faddr, addr; char sourcefile[PATH_MAX]; char funcname[PATH_MAX]; /* * Object binary. */ -#ifdef PMCPL_CT_OPTIMIZEFN - if (pmcpl_ct_prevfn != ct->pct_image->pi_fullpath) { -#endif - pmcpl_ct_prevfn = ct->pct_image->pi_fullpath; - fprintf(args.pa_graphfile, "ob=%s\n", - pmcstat_string_unintern(pmcpl_ct_prevfn)); -#ifdef PMCPL_CT_OPTIMIZEFN - } -#endif + fprintf(args.pa_graphfile, "ob=%s\n", + pmcstat_string_unintern(ct->pct_image->pi_fullpath)); /* * Function name. */ - if (pmcstat_image_addr2line(ct->pct_image, ct->pct_func, - sourcefile, sizeof(sourcefile), &line, + faddr = ct->pct_image->pi_vaddr + ct->pct_func; + fline = 0; + if (ct->pct_type == PMCPL_PCT_NAME) { + fprintf(args.pa_graphfile, "fl=%s\nfn=%s\n", + pmcstat_string_unintern(ct->pct_ifl), + pmcstat_string_unintern(ct->pct_ifn)); + } else if (pmcstat_image_addr2line(ct->pct_image, faddr, + sourcefile, sizeof(sourcefile), &fline, funcname, sizeof(funcname))) { - fprintf(args.pa_graphfile, "fn=%s\n", - funcname); + fprintf(args.pa_graphfile, "fl=%s\nfn=%s\n", + sourcefile, funcname); } else { - sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func); - if (sym != NULL) - fprintf(args.pa_graphfile, "fn=%s\n", - pmcstat_string_unintern(sym->ps_name)); + if (ct->pct_sym != NULL) + fprintf(args.pa_graphfile, "fl=???\nfn=%s\n", + pmcstat_string_unintern(ct->pct_sym->ps_name)); else - fprintf(args.pa_graphfile, "fn=%p\n", + fprintf(args.pa_graphfile, "fl=???\nfn=%p\n", (void *)(ct->pct_image->pi_vaddr + ct->pct_func)); } @@ -816,15 +923,18 @@ pmcpl_ct_node_printself(struct pmcpl_ct_ * Self cost. */ if (ct->pct_ninstr > 0) { + /* + * Per location cost. + */ for (i = 0; i < ct->pct_ninstr; i++) { addr = ct->pct_image->pi_vaddr + ct->pct_instr[i].pctf_func; line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, + pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "fl=%s\n", sourcefile); - fprintf(args.pa_graphfile, "%p %u", (void *)addr, line); + funcname, sizeof(funcname)); + fprintf(args.pa_graphfile, "%p %u", + (void *)addr, line); for (j = 0; jpct_image->pi_vaddr + ct->pct_func; - line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, - sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "fl=%s\n", sourcefile); - fprintf(args.pa_graphfile, "* *"); + /* Global cost function cost. */ + fprintf(args.pa_graphfile, "%p %u", (void *)faddr, fline); for (i = 0; ipct_samples)); fprintf(args.pa_graphfile, "\n"); } + + pmcpl_ct_node_printchild(ct, faddr, fline); +} + +static void +pmcpl_ct_printnode(struct pmcpl_ct_node *ct) +{ + int i; + + if (ct == pmcpl_ct_root) { + fprintf(args.pa_graphfile, "fn=root\n"); + fprintf(args.pa_graphfile, "0x0 1"); + for (i = 0; ipch_ctnode = ct; + STAILQ_INSERT_TAIL(&q, pch, pch_next); + ct->pct_color = PMCPL_PCT_BLACK; + + while (!STAILQ_EMPTY(&q)) { + pch = STAILQ_FIRST(&q); + STAILQ_REMOVE_HEAD(&q, pch_next); + pmcpl_ct_printnode(pch->pch_ctnode); + for (i = 0; ipch_ctnode->pct_narc; i++) { + child = pch->pch_ctnode->pct_arc[i].pcta_child; + if (child->pct_color == PMCPL_PCT_WHITE) { + child->pct_color = PMCPL_PCT_BLACK; + if ((pchc = malloc(sizeof(*pchc))) == NULL) + err(EX_OSERR, + "ERROR: Cannot allocate queue"); + pchc->pch_ctnode = child; + STAILQ_INSERT_TAIL(&q, pchc, pch_next); + } + } + free(pch); + } +} + +/* + * Detect and fix inlined location. + */ + +static void +_pmcpl_ct_expand_inline(struct pmcpl_ct_node *ct) +{ + int i, j; + unsigned fline, line, v; + uintfptr_t faddr, addr, pc; char sourcefile[PATH_MAX]; - char funcname[PATH_MAX]; + char ffuncname[PATH_MAX], funcname[PATH_MAX]; + char buffer[PATH_MAX]; + struct pmcpl_ct_node *child; /* * Child cost. * TODO: attach child cost to the real position in the funtion. * TODO: cfn= / call addr() / addr(call ) + * Resolve parent and compare to each instr location. */ - for (i=0 ; ipct_narc; i++) { - child = ct->pct_arc[i].pcta_child; + faddr = ct->pct_image->pi_vaddr + ct->pct_func; + fline = 0; + if (!pmcstat_image_addr2line(ct->pct_image, faddr, + sourcefile, sizeof(sourcefile), &fline, + ffuncname, sizeof(ffuncname))) + return; - /* Object binary. */ -#ifdef PMCPL_CT_OPTIMIZEFN - if (pmcpl_ct_prevfn != child->pct_image->pi_fullpath) { -#endif - pmcpl_ct_prevfn = child->pct_image->pi_fullpath; - fprintf(args.pa_graphfile, "cob=%s\n", - pmcstat_string_unintern(pmcpl_ct_prevfn)); -#if PMCPL_CT_OPTIMIZEFN - } -#endif - /* Child function name. */ - addr = child->pct_image->pi_vaddr + child->pct_func; - /* Child function source file. */ - if (pmcstat_image_addr2line(child->pct_image, addr, + for (i = 0; i < ct->pct_ninstr; i++) { + addr = ct->pct_image->pi_vaddr + + ct->pct_instr[i].pctf_func; + line = 0; + if (!pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) { - fprintf(args.pa_graphfile, "cfn=%s\n", funcname); - fprintf(args.pa_graphfile, "cfl=%s\n", sourcefile); - } else { - sym = pmcstat_symbol_search(child->pct_image, - child->pct_func); - if (sym != NULL) - fprintf(args.pa_graphfile, "cfn=%s\n", - pmcstat_string_unintern(sym->ps_name)); - else - fprintf(args.pa_graphfile, "cfn=%p\n", (void *)addr); - } + funcname, sizeof(funcname))) + continue; - /* Child function address, line and call count. */ - fprintf(args.pa_graphfile, "calls=%u %p %u\n", - ct->pct_arc[i].pcta_call, (void *)addr, line); + if (strcmp(funcname, ffuncname) == 0) + continue; - if (ct->pct_image != NULL) { - /* Call address, line, sample. */ - addr = ct->pct_image->pi_vaddr + ct->pct_func; - line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, - sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "%p %u", (void *)addr, line); - else - fprintf(args.pa_graphfile, "* *"); + /* + * - Lookup/create inline node by function name. + * - Move instr PMCs to the inline node. + * - Link nodes. + * The lookup create a specific node per image/pc. + */ + if (args.pa_verbosity >= 2) + fprintf(args.pa_printfile, + "WARNING: inlined function at %p %s in %s\n", + (void *)addr, funcname, ffuncname); + + snprintf(buffer, sizeof(buffer), "%s@%s", + funcname, ffuncname); + child = pmcpl_ct_node_hash_lookup(ct->pct_image, + ct->pct_func, ct->pct_sym, sourcefile, buffer); + assert(child != NULL); + pc = ct->pct_instr[i].pctf_func; + for (j = 0; jpct_instr[i].pctf_samples); + if (v == 0) + continue; + pmcpl_ct_instr_add(child, j, pc, v); + pmcpl_ct_node_update(ct, child, j, v, 0); + if (j < ct->pct_samples.npmcs) + ct->pct_samples.sb[j] -= + ct->pct_instr[i].pctf_samples.sb[j]; + ct->pct_instr[i].pctf_samples.sb[j] = 0; } - else - fprintf(args.pa_graphfile, "* *"); - for (j = 0; jpct_arc[i].pcta_samples)); - fprintf(args.pa_graphfile, "\n"); } } +static void +pmcpl_ct_expand_inline(void) +{ + int i; + struct pmcpl_ct_node_hash *pch; + + if (!args.pa_ctdumpinstr) + return; + + for (i = 0; i < PMCSTAT_NHASH; i++) + STAILQ_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) + if (pch->pch_ctnode->pct_type == PMCPL_PCT_ADDR) + _pmcpl_ct_expand_inline(pch->pch_ctnode); +} + /* * Clean the PMC name for Kcachegrind formula */ @@ -941,13 +1115,12 @@ pmcpl_ct_fixup_pmcname(char *s) static void pmcpl_ct_print(void) { - int n, i; - struct pmcpl_ct_node_hash *pch; - struct pmcpl_ct_sample rsamples; + int i; char name[40]; + struct pmcpl_ct_sample rsamples; pmcpl_ct_samples_root(&rsamples); - pmcpl_ct_prevfn = NULL; + pmcpl_ct_expand_inline(); fprintf(args.pa_graphfile, "version: 1\n" @@ -964,25 +1137,8 @@ pmcpl_ct_print(void) for (i=0; ipch_ctnode); - pmcpl_ct_node_printchild(pch->pch_ctnode); - } - + pmcpl_ct_bfs(pmcpl_ct_root); pmcpl_ct_samples_free(&rsamples); } @@ -1003,11 +1159,10 @@ pmcpl_ct_init(void) { int i; - pmcpl_ct_prevfn = NULL; - pmcpl_ct_root = pmcpl_ct_node_allocate(NULL, 0); + pmcpl_ct_root = pmcpl_ct_node_allocate(); for (i = 0; i < PMCSTAT_NHASH; i++) - LIST_INIT(&pmcpl_ct_node_hash[i]); + STAILQ_INIT(&pmcpl_ct_node_hash[i]); pmcpl_ct_samples_init(&pmcpl_ct_callid); @@ -1030,7 +1185,7 @@ pmcpl_ct_shutdown(FILE *mf) */ for (i = 0; i < PMCSTAT_NHASH; i++) { - LIST_FOREACH_SAFE(pch, &pmcpl_ct_node_hash[i], pch_next, + STAILQ_FOREACH_SAFE(pch, &pmcpl_ct_node_hash[i], pch_next, pchtmp) { pmcpl_ct_node_free(pch->pch_ctnode); free(pch); Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Fri May 25 06:48:42 2012 (r235975) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Fri May 25 07:23:24 2012 (r235976) @@ -428,7 +428,9 @@ pmcstat_image_get_aout_params(struct pmc if ((fd = open(buffer, O_RDONLY, 0)) < 0 || (nbytes = read(fd, &ex, sizeof(ex))) < 0) { - warn("WARNING: Cannot determine type of \"%s\"", path); + if (args.pa_verbosity >= 2) + warn("WARNING: Cannot determine type of \"%s\"", + path); image->pi_type = PMCSTAT_IMAGE_INDETERMINABLE; if (fd != -1) (void) close(fd); @@ -638,8 +640,9 @@ pmcstat_image_get_elf_params(struct pmcs if ((fd = open(buffer, O_RDONLY, 0)) < 0 || (e = elf_begin(fd, ELF_C_READ, NULL)) == NULL || (elf_kind(e) != ELF_K_ELF)) { - warnx("WARNING: Cannot determine the type of \"%s\".", - buffer); + if (args.pa_verbosity >= 2) + warnx("WARNING: Cannot determine the type of \"%s\".", + buffer); goto done; } @@ -942,6 +945,7 @@ pmcstat_image_addr2line(struct pmcstat_i char *funcname, size_t funcname_len) { static int addr2line_warn = 0; + unsigned l; char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; int fd; @@ -957,6 +961,11 @@ pmcstat_image_addr2line(struct pmcstat_i pmcstat_string_unintern(image->pi_fullpath)); } else close(fd); + /* + * New addr2line support recursive inline function with -i + * but the format does not add a marker when no more entries + * are available. + */ snprintf(cmdline, sizeof(cmdline), "addr2line -Cfe \"%s\"", imagepath); image->pi_addr2line = popen(cmdline, "r+"); @@ -997,10 +1006,10 @@ pmcstat_image_addr2line(struct pmcstat_i return (0); } *sep = '\0'; - *sourceline = atoi(sep+1); - if (*sourceline == 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 14:54:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8F761065674; Fri, 25 May 2012 14:54:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938D68FC16; Fri, 25 May 2012 14:54:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PEsI8s016439; Fri, 25 May 2012 14:54:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEsIaY016437; Fri, 25 May 2012 14:54:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251454.q4PEsIaY016437@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235996 - stable/8/sys/boot/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:54:18 -0000 Author: marius Date: Fri May 25 14:54:18 2012 New Revision: 235996 URL: http://svn.freebsd.org/changeset/base/235996 Log: MFC: r234789 Add multiple inclusion protection. PR: 165025 Submitted by: Gavin Mu Modified: stable/8/sys/boot/common/bootstrap.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/common/bootstrap.h ============================================================================== --- stable/8/sys/boot/common/bootstrap.h Fri May 25 14:54:12 2012 (r235995) +++ stable/8/sys/boot/common/bootstrap.h Fri May 25 14:54:18 2012 (r235996) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _BOOTSTRAP_H_ +#define _BOOTSTRAP_H_ + #include #include #include @@ -307,3 +310,5 @@ void delay(int delay); void dev_cleanup(void); time_t time(time_t *tloc); + +#endif /* !_BOOTSTRAP_H_ */ From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 14:57:02 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF00F1065673; Fri, 25 May 2012 14:57:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88F3C8FC0C; Fri, 25 May 2012 14:57:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PEv2fc016660; Fri, 25 May 2012 14:57:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEv2rh016658; Fri, 25 May 2012 14:57:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251457.q4PEv2rh016658@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235998 - stable/8/sys/boot/sparc64/loader X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:57:03 -0000 Author: marius Date: Fri May 25 14:57:02 2012 New Revision: 235998 URL: http://svn.freebsd.org/changeset/base/235998 Log: MFC: r234897 Add a command for showing the heap usage. PR: 165025 Submitted by: Gavin Mu Modified: stable/8/sys/boot/sparc64/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri May 25 14:57:01 2012 (r235997) +++ stable/8/sys/boot/sparc64/loader/main.c Fri May 25 14:57:02 2012 (r235998) @@ -915,6 +915,18 @@ main(int (*openfirm)(void *)) return (1); } +COMMAND_SET(heap, "heap", "show heap usage", command_heap); + +static int +command_heap(int argc, char *argv[]) +{ + + mallocstats(); + printf("heap base at %p, top at %p, upper limit at %p\n", heapva, + sbrk(0), heapva + HEAPSZ); + return(CMD_OK); +} + COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 16:39:57 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AF6C1065674; Fri, 25 May 2012 16:39:57 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1101C8FC0C; Fri, 25 May 2012 16:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PGdv1d021282; Fri, 25 May 2012 16:39:57 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGduTt021277; Fri, 25 May 2012 16:39:56 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251639.q4PGduTt021277@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236007 - in stable/8/sys: conf contrib/dev/ral dev/ral modules/ral modules/ralfw modules/ralfw/rt2860 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:39:57 -0000 Author: bschmidt Date: Fri May 25 16:39:56 2012 New Revision: 236007 URL: http://svn.freebsd.org/changeset/base/236007 Log: MFC r232946,232958,235233: r232946: Update the rt2860's firmware and add a Makefile for the module. While here remove the ucode header file which was used to generate the fw files but by now is outdated. r232958: Import the latest microcode.h which was used to generate the current firmware files and adjust the Makefile. r235233: Add support for Ralink RT2800/RT3000 chipsets. Added: stable/8/sys/contrib/dev/ral/microcode.h - copied unchanged from r232958, head/sys/contrib/dev/ral/microcode.h stable/8/sys/dev/ral/rt2860.c - copied, changed from r235233, head/sys/dev/ral/rt2860.c stable/8/sys/dev/ral/rt2860reg.h - copied unchanged from r235233, head/sys/dev/ral/rt2860reg.h stable/8/sys/dev/ral/rt2860var.h - copied unchanged from r235233, head/sys/dev/ral/rt2860var.h stable/8/sys/modules/ralfw/rt2860/ - copied from r232946, head/sys/modules/ralfw/rt2860/ Deleted: stable/8/sys/contrib/dev/ral/rt2661_ucode.h Modified: stable/8/sys/conf/files stable/8/sys/contrib/dev/ral/Makefile stable/8/sys/contrib/dev/ral/rt2860.fw.uu stable/8/sys/dev/ral/if_ral_pci.c stable/8/sys/modules/ral/Makefile stable/8/sys/modules/ralfw/Makefile Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri May 25 16:30:42 2012 (r236006) +++ stable/8/sys/conf/files Fri May 25 16:39:56 2012 (r236007) @@ -1474,6 +1474,7 @@ dev/puc/pucdata.c optional puc pci dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral +dev/ral/rt2860.c optional ral dev/ral/if_ral_pci.c optional ral pci rt2561fw.c optional rt2561fw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561.fw:rt2561fw -mrt2561 -c${.TARGET}" \ Modified: stable/8/sys/contrib/dev/ral/Makefile ============================================================================== --- stable/8/sys/contrib/dev/ral/Makefile Fri May 25 16:30:42 2012 (r236006) +++ stable/8/sys/contrib/dev/ral/Makefile Fri May 25 16:39:56 2012 (r236007) @@ -2,31 +2,35 @@ FILES= rt2561s.fw.uu rt2561.fw.uu rt2661.fw.uu rt2860.fw.uu -rt2561s.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2561s.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2561s_ucode, sizeof(rt2561s_ucode)); return 0; \ + write(1, rt2561s, sizeof(rt2561s)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2561s.fw) > ${.TARGET} -rt2561.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2561.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2561_ucode, sizeof(rt2561_ucode)); return 0; \ + write(1, rt2561, sizeof(rt2561)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2561.fw) > ${.TARGET} -rt2661.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2661.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2661_ucode, sizeof(rt2661_ucode)); return 0; \ + write(1, rt2661, sizeof(rt2661)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2661.fw) > ${.TARGET} -rt2860.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2860.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2860_ucode, sizeof(rt2860_ucode)); return 0; \ + write(1, rt2860, sizeof(rt2860)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2860.fw) > ${.TARGET} Copied: stable/8/sys/contrib/dev/ral/microcode.h (from r232958, head/sys/contrib/dev/ral/microcode.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/contrib/dev/ral/microcode.h Fri May 25 16:39:56 2012 (r236007, copy of r232958, head/sys/contrib/dev/ral/microcode.h) @@ -0,0 +1,3016 @@ +/* $FreeBSD$ */ +/* $OpenBSD: microcode.h,v 1.7 2010/04/05 14:14:02 damien Exp $ */ + +/*- + * Copyright (c) 2005-2010, Ralink Technology, Corp. + * Paul Lin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file contains the loadable 8051 microcodes for the Ralink RT2561, + * RT2561S, RT2661 and RT2860 chipsets. + */ + +static const uint8_t rt2561[] = { + 0x02, 0x1c, 0x12, 0x02, 0x13, 0xcb, 0xc2, 0x8c, 0x22, 0x22, 0x00, + 0x02, 0x16, 0x0f, 0xc2, 0xaf, 0xc2, 0x8d, 0x75, 0x8c, 0x94, 0x75, + 0x8a, 0x93, 0xd2, 0xaf, 0x22, 0x02, 0x18, 0xda, 0x12, 0x1b, 0xe8, + 0x40, 0x03, 0x02, 0x02, 0x1e, 0x90, 0x21, 0x02, 0xe0, 0xf5, 0x2d, + 0x90, 0x00, 0x03, 0xe0, 0x12, 0x08, 0x25, 0x00, 0xb0, 0x00, 0x00, + 0xce, 0x01, 0x00, 0x5e, 0x10, 0x00, 0x6f, 0x11, 0x00, 0xf2, 0x20, + 0x01, 0x4d, 0x21, 0x01, 0x70, 0x22, 0x01, 0x84, 0x30, 0x01, 0x8f, + 0x31, 0x01, 0xd5, 0x50, 0x01, 0x9f, 0x51, 0x01, 0xf2, 0x52, 0x02, + 0x06, 0x60, 0x00, 0x00, 0x02, 0x14, 0x90, 0x00, 0x0a, 0xe0, 0x20, + 0xe5, 0x03, 0x30, 0x07, 0x03, 0xd2, 0x08, 0x22, 0x12, 0x17, 0xa5, + 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x11, 0xe5, 0x11, 0xc4, 0x33, + 0x54, 0xe0, 0x24, 0x21, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x11, 0xc4, 0x33, 0x54, 0xe0, 0x24, + 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x11, 0xf0, + 0xc4, 0x33, 0x54, 0xe0, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe5, 0x2d, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, + 0x12, 0x11, 0x31, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x31, 0x60, 0x05, + 0x12, 0x1b, 0x8a, 0x80, 0x03, 0x12, 0x1b, 0x3d, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x75, 0x31, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x01, 0x01, 0xe0, + 0x54, 0xfe, 0xf0, 0x54, 0x3e, 0xf0, 0xe4, 0x90, 0x00, 0x0b, 0xf0, + 0xf0, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, + 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x04, 0x0e, 0x90, 0x34, + 0xcd, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x21, 0x14, 0x12, 0x08, 0x01, + 0x90, 0x34, 0xc0, 0x12, 0x08, 0x0d, 0x90, 0x21, 0x18, 0x12, 0x08, + 0x01, 0x90, 0x34, 0xc8, 0x12, 0x08, 0x0d, 0x90, 0x21, 0x1c, 0x12, + 0x08, 0x01, 0x90, 0x34, 0xc4, 0x12, 0x08, 0x0d, 0x90, 0x34, 0xcc, + 0x74, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x01, 0x01, + 0xe0, 0x44, 0x01, 0xf0, 0x44, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, + 0x44, 0x10, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xfe, 0xf0, 0x54, 0xbf, 0xf0, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, + 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, + 0x12, 0x04, 0x0e, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0xd2, 0x05, 0x85, 0x2d, 0x23, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0x22, 0x12, 0x1a, 0x74, 0xc2, 0x00, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x85, 0x2d, 0x25, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xff, 0xf0, 0xe4, 0x90, 0x00, + 0x07, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x00, + 0x08, 0xf0, 0x90, 0x21, 0x00, 0xe0, 0x90, 0x00, 0x09, 0xf0, 0x90, + 0x00, 0x07, 0x74, 0x71, 0xf0, 0xef, 0x44, 0x04, 0x90, 0x00, 0x0b, + 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0xff, 0x54, 0x1f, 0xf5, 0x30, 0xa3, 0xe0, 0xf5, 0x27, 0x8f, 0x26, + 0x12, 0x08, 0x90, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x2c, 0x12, 0x18, + 0x13, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, + 0x22, 0x12, 0x19, 0x53, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x1c, 0x62, 0x22, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x1c, 0x62, 0x22, 0x8e, 0x15, 0x8f, 0x16, 0xca, 0xed, 0xca, + 0xc9, 0xeb, 0xc9, 0x30, 0x0a, 0x04, 0x7f, 0x4a, 0x80, 0x02, 0x7f, + 0x42, 0xcb, 0xef, 0xcb, 0xea, 0xc3, 0x94, 0x04, 0x50, 0x02, 0x80, + 0x01, 0xc3, 0x40, 0x04, 0xcb, 0x44, 0x20, 0xcb, 0x85, 0x16, 0x82, + 0x85, 0x15, 0x83, 0xeb, 0xf0, 0xa3, 0xe4, 0xf0, 0x85, 0x16, 0x82, + 0x85, 0x15, 0x83, 0xa3, 0xa3, 0xe5, 0x1a, 0xf0, 0xe5, 0x19, 0x85, + 0x16, 0x82, 0x85, 0x15, 0x83, 0xa3, 0xa3, 0xa3, 0xf0, 0xe5, 0x16, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x0f, + 0xf0, 0xe5, 0x16, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, + 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, + 0x15, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x24, 0x07, 0xf5, 0x82, + 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x10, 0xf0, 0xea, 0x90, 0x1a, + 0x9c, 0x93, 0xfb, 0xea, 0x64, 0x01, 0x60, 0x08, 0xea, 0x64, 0x02, + 0x60, 0x03, 0xba, 0x03, 0x04, 0xcb, 0x44, 0x08, 0xcb, 0xe5, 0x16, + 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xeb, 0xf0, + 0xe5, 0x16, 0x24, 0x15, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, + 0x74, 0xff, 0xf0, 0xe5, 0x16, 0x24, 0x16, 0xf5, 0x82, 0xe4, 0x35, + 0x15, 0xf5, 0x83, 0xe9, 0xf0, 0xe5, 0x16, 0x24, 0x09, 0xf5, 0x82, + 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x04, 0xf0, 0x25, 0x1a, 0xf5, + 0x1a, 0xe4, 0x35, 0x19, 0xf5, 0x19, 0xea, 0xc3, 0x94, 0x04, 0x40, + 0x03, 0x02, 0x03, 0xd6, 0xea, 0x60, 0x03, 0xba, 0x01, 0x1f, 0xea, + 0x24, 0x01, 0xfd, 0xe4, 0x33, 0xfc, 0xe5, 0x1a, 0xae, 0x19, 0x78, + 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0x12, 0x07, + 0x96, 0x8e, 0x19, 0x8f, 0x1a, 0x02, 0x03, 0xb6, 0xea, 0x24, 0xff, + 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, 0x0b, 0x12, 0x07, + 0x84, 0xcc, 0xee, 0xcc, 0xcd, 0xef, 0xcd, 0xe5, 0x1a, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x19, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0x12, 0x07, 0x96, 0x8c, 0x1b, 0x8d, 0x1c, 0xea, 0x24, 0xff, + 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, 0x0b, 0x12, 0x07, + 0x84, 0xcc, 0xee, 0xcc, 0xcd, 0xef, 0xcd, 0xe5, 0x1a, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x19, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0x12, 0x07, 0x96, 0x8e, 0x19, 0x8f, 0x1a, 0xe5, 0x1c, 0x45, + 0x1b, 0x60, 0x08, 0x05, 0x1a, 0xe5, 0x1a, 0x70, 0x02, 0x05, 0x19, + 0xea, 0x24, 0xff, 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, + 0x03, 0x12, 0x07, 0x84, 0xd3, 0xe5, 0x1c, 0x9f, 0xe5, 0x1b, 0x9e, + 0x50, 0x18, 0xe5, 0x1c, 0x45, 0x1b, 0x60, 0x12, 0xba, 0x03, 0x0f, + 0xe5, 0x16, 0x24, 0x09, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x16, 0x24, 0x0a, 0xf5, 0x82, 0xe4, + 0x35, 0x15, 0xf5, 0x83, 0xe5, 0x1a, 0xf0, 0xe5, 0x19, 0xff, 0xe5, + 0x16, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xef, + 0xf0, 0x80, 0x2d, 0xe5, 0x1a, 0x54, 0x3f, 0xff, 0xe5, 0x16, 0x24, + 0x0a, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xef, 0xf0, 0xe5, + 0x1a, 0xae, 0x19, 0x78, 0x06, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, + 0xf9, 0xff, 0xe5, 0x16, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x15, + 0xf5, 0x83, 0xef, 0xf0, 0x85, 0x16, 0x82, 0x85, 0x15, 0x83, 0xe0, + 0x44, 0x01, 0xf0, 0x22, 0x8e, 0x12, 0x8f, 0x13, 0x8d, 0x14, 0xe5, + 0x14, 0xa2, 0xe1, 0x92, 0x09, 0xe5, 0x34, 0x24, 0x19, 0xf5, 0x82, + 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xe5, 0x34, 0x24, 0x1a, + 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfb, 0xa2, 0x09, + 0x92, 0x0a, 0x75, 0x19, 0x00, 0x75, 0x1a, 0x1a, 0x12, 0x02, 0x1f, + 0x30, 0x09, 0x04, 0x7f, 0xc8, 0x80, 0x02, 0x7f, 0xe8, 0xe5, 0x13, + 0x24, 0x18, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, 0xf0, + 0xe5, 0x31, 0x60, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x01, 0xe5, + 0x13, 0x24, 0x19, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0xe5, 0x34, 0x24, 0x19, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, + 0x83, 0xe0, 0xff, 0x7d, 0x1a, 0x7c, 0x00, 0x12, 0x0e, 0x64, 0xe5, + 0x13, 0x24, 0x1a, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0xe5, 0x13, 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, + 0x83, 0xee, 0xf0, 0xe5, 0x31, 0x60, 0x60, 0xe5, 0x13, 0x24, 0x1c, + 0xff, 0xe4, 0x35, 0x12, 0xfe, 0xe5, 0x34, 0x24, 0x12, 0xfd, 0xe4, + 0x35, 0x33, 0xfc, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0xe5, 0x13, 0x24, 0x22, 0xff, 0xe4, 0x35, 0x12, 0xfe, 0x7c, 0x30, + 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xe5, + 0x13, 0x24, 0x28, 0xff, 0xe4, 0x35, 0x12, 0xfe, 0x7c, 0x30, 0x7d, + 0x08, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xe5, 0x34, + 0x24, 0x18, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, + 0xe5, 0x13, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, + 0xef, 0xf0, 0x80, 0x3f, 0xe5, 0x13, 0x24, 0x1c, 0xff, 0xe4, 0x35, + 0x12, 0xfe, 0x7c, 0x30, 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, + 0x12, 0x14, 0xab, 0xe5, 0x13, 0x24, 0x22, 0xff, 0xe4, 0x35, 0x12, + 0xfe, 0x7c, 0x30, 0x7d, 0x08, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, + 0x14, 0xab, 0xe5, 0x13, 0x24, 0x28, 0xff, 0xe4, 0x35, 0x12, 0xfe, + 0x7c, 0x30, 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, + 0xab, 0xe5, 0x13, 0x24, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, + 0x83, 0xe4, 0xf0, 0xe5, 0x13, 0x24, 0x2f, 0xf5, 0x82, 0xe4, 0x35, + 0x12, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x34, 0x24, 0x11, 0xf5, 0x82, + 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, 0xc3, 0x13, 0xff, 0xe5, + 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0x30, 0x09, 0x41, 0xe5, 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, + 0x35, 0x12, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x31, 0x60, 0x04, 0x7e, + 0x00, 0x80, 0x02, 0x7e, 0x10, 0xef, 0x4e, 0xf0, 0xe5, 0x31, 0x60, + 0x06, 0x7e, 0x00, 0x7f, 0x00, 0x80, 0x0f, 0xe5, 0x14, 0x30, 0xe0, + 0x06, 0x7e, 0x00, 0x7f, 0xff, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, + 0xe5, 0x13, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, + 0xef, 0xf0, 0x22, 0xe5, 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, + 0x12, 0xf5, 0x83, 0xe0, 0x44, 0x40, 0xf0, 0xe5, 0x14, 0x30, 0xe0, + 0x0f, 0xe5, 0x34, 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, + 0x83, 0xe0, 0xff, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x13, 0x24, 0x31, + 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, 0xf0, 0x22, 0xe5, + 0x34, 0x24, 0x11, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, + 0x30, 0xe7, 0x3b, 0xe5, 0x34, 0x24, 0x1c, 0xf5, 0x82, 0xe4, 0x35, + 0x33, 0xf5, 0x83, 0xe0, 0x65, 0x2b, 0x70, 0x03, 0x75, 0x2b, 0xff, + 0xe5, 0x34, 0x24, 0x1d, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, + 0xe0, 0xff, 0x12, 0x1c, 0x62, 0x7e, 0x22, 0x7f, 0x10, 0x12, 0x18, + 0x7c, 0x8e, 0x33, 0x8f, 0x34, 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, + 0xe0, 0x8e, 0x33, 0xf5, 0x34, 0xc3, 0x22, 0xd2, 0x0a, 0xe5, 0x34, + 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0x70, + 0x3a, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, + 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, + 0xee, 0x9c, 0xfe, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, 0xf0, + 0xd3, 0x94, 0x00, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x03, 0x02, + 0x07, 0x27, 0x80, 0xc6, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xe0, + 0xfe, 0xa3, 0xe0, 0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x03, + 0x02, 0x07, 0x27, 0x12, 0x1c, 0x41, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0x9f, 0xee, 0x64, 0x80, + 0xf8, 0xec, 0x64, 0x80, 0x98, 0x40, 0x20, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xa3, 0xa3, 0xe0, 0xfe, 0xa3, + 0xe0, 0xff, 0xed, 0x9f, 0xff, 0xec, 0x9e, 0xd0, 0x82, 0xd0, 0x83, + 0xf0, 0xa3, 0xef, 0xf0, 0xc2, 0x0a, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x34, 0x24, 0x10, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, + 0xfd, 0xee, 0x94, 0x00, 0xfc, 0x12, 0x16, 0x5a, 0x50, 0x2c, 0x85, + 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, + 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xa3, 0xa3, + 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, 0xee, 0x9c, + 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, 0xf0, 0xc2, 0x0a, 0x20, + 0x0a, 0x03, 0x02, 0x06, 0x37, 0x7e, 0x22, 0x7f, 0x10, 0x12, 0x18, + 0x7c, 0x8e, 0x33, 0x8f, 0x34, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xfe, + 0xa3, 0xe0, 0xd3, 0x94, 0x00, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, + 0x0d, 0x7e, 0x22, 0x7f, 0x10, 0xad, 0x34, 0xac, 0x33, 0x12, 0x15, + 0x0e, 0x80, 0x1a, 0x12, 0x1b, 0xab, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xee, 0x8f, 0xf0, 0x12, 0x07, 0xeb, 0x7e, 0x22, 0x7f, 0x30, + 0xad, 0x34, 0xac, 0x33, 0x12, 0x15, 0x0e, 0x90, 0x22, 0x2e, 0xe0, + 0xfe, 0xa3, 0xe0, 0xff, 0x65, 0x34, 0x70, 0x03, 0xee, 0x65, 0x33, + 0x70, 0x02, 0xd3, 0x22, 0x8e, 0x33, 0x8f, 0x34, 0xc3, 0x22, 0xef, + 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, 0xf0, 0xa4, 0x28, 0xce, + 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, 0x0b, 0xbe, 0x00, + 0x29, 0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, 0x22, 0xe4, 0xcc, + 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xec, + 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, 0xfc, 0xee, 0x9d, + 0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, 0x22, 0xed, 0xf8, + 0xf5, 0xf0, 0xee, 0x84, 0x20, 0xd2, 0x1c, 0xfe, 0xad, 0xf0, 0x75, + 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, 0x40, 0x07, 0x98, + 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, 0xfd, 0x0f, 0xd5, + 0xf0, 0xea, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, + 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, + 0x38, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, + 0xa3, 0xe0, 0xff, 0x22, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xa3, 0xee, + 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0xa4, 0x25, 0x82, 0xf5, 0x82, 0xe5, + 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, + 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, + 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, + 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, + 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xe4, 0xff, 0x90, 0x30, 0x8c, + 0xe4, 0xf0, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x44, 0x80, 0x90, 0x30, + 0x8d, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, + 0x8c, 0xe0, 0xfe, 0x74, 0x36, 0x2f, 0xf8, 0xc6, 0xee, 0xc6, 0xa3, + 0xe0, 0xfe, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x44, 0x80, 0x6e, 0x60, + 0x01, 0x1f, 0x0f, 0xef, 0xc3, 0x94, 0x09, 0x40, 0xc8, 0x22, 0x00, + 0x00, 0x00, 0x00, 0xe5, 0x30, 0x12, 0x08, 0x25, 0x08, 0xb1, 0x00, + 0x09, 0x1f, 0x01, 0x09, 0x87, 0x02, 0x0a, 0x1b, 0x03, 0x0a, 0x6f, + 0x04, 0x0a, 0xb6, 0x05, 0x0b, 0x29, 0x06, 0x0b, 0x98, 0x07, 0x00, + 0x00, 0x0b, 0xd0, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x12, 0xe5, 0x26, 0x20, 0xe5, 0x08, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x30, 0xe6, 0x0f, 0xe5, 0x27, 0x30, 0xe6, 0x05, + 0x53, 0x12, 0xfd, 0x80, 0x12, 0x43, 0x12, 0x02, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, + 0xfd, 0xe5, 0x26, 0x30, 0xe7, 0x0f, 0xe5, 0x27, 0x30, 0xe7, 0x05, + 0x53, 0x12, 0xf7, 0x80, 0x12, 0x43, 0x12, 0x08, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, + 0xf7, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x22, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x12, 0xe5, 0x26, 0x20, 0xe5, 0x08, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x1c, 0xe5, 0x27, 0x30, 0xe6, + 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, 0x43, 0x12, 0x02, 0xe5, 0x27, + 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, 0x80, 0x1f, 0x43, 0x12, 0x08, + 0x80, 0x1a, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, + 0x03, 0x53, 0x12, 0xfd, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, + 0x08, 0x80, 0x03, 0x53, 0x12, 0xf7, 0x43, 0x12, 0x01, 0x43, 0x12, + 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x22, 0xc2, 0x01, 0x12, + 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x43, 0x12, 0x01, + 0x43, 0x12, 0x04, 0xe5, 0x26, 0x30, 0xe5, 0x5c, 0x90, 0x34, 0x98, + 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x1c, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, 0x43, 0x12, + 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, 0x80, 0x30, + 0x43, 0x12, 0x08, 0x80, 0x2b, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x43, + 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, 0xfd, 0xe5, 0x27, 0x30, 0xe7, + 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, 0xf7, 0xe5, 0x27, + 0xf4, 0x54, 0x1f, 0xff, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0x4f, + 0xf0, 0xe4, 0xf5, 0x2c, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x80, + 0x15, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0xe5, 0x27, 0xf4, + 0x54, 0x1f, 0xff, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0x4f, 0xf0, + 0x90, 0x30, 0x35, 0xe0, 0xf5, 0x12, 0x53, 0x12, 0xe0, 0xe5, 0x12, + 0xf0, 0x22, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, + 0xf5, 0x12, 0xe5, 0x26, 0x30, 0xe5, 0x3c, 0x90, 0x34, 0x98, 0xe0, + 0x44, 0x01, 0xf0, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, + 0x80, 0x03, 0x43, 0x12, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, + 0x12, 0xf7, 0x80, 0x03, 0x43, 0x12, 0x08, 0xe5, 0x26, 0x54, 0xc0, + 0x60, 0x08, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, 0x80, 0x06, 0x53, + 0x12, 0xfe, 0x43, 0x12, 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, + 0x22, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0xc2, 0x01, + 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0xe5, 0x27, + 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, 0xfd, + 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, + 0x12, 0xf7, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x08, 0x53, 0x12, 0xfe, + 0x53, 0x12, 0xfb, 0x80, 0x06, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, + 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x22, 0x20, 0x02, 0x13, 0x12, 0x1c, 0x1e, 0xaf, 0x29, + 0x7e, 0x00, 0x12, 0x1c, 0x74, 0xaf, 0x35, 0x7e, 0x00, 0x12, 0x1c, + 0x7b, 0xd2, 0x02, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0xe5, 0x26, + 0x20, 0xe5, 0x0d, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x2c, 0xc2, 0x01, 0x12, 0x00, + 0x06, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, + 0x43, 0x12, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, + 0x80, 0x03, 0x43, 0x12, 0x08, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, + 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x22, 0x30, 0x01, 0x03, 0x02, + 0x0b, 0xd0, 0x12, 0x15, 0xc0, 0xd2, 0x01, 0x22, 0xc2, 0x01, 0x12, + 0x00, 0x06, 0xe5, 0x26, 0x20, 0xe5, 0x09, 0x90, 0x34, 0x98, 0xe0, + 0x54, 0xfe, 0xf0, 0x80, 0x55, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x30, 0xe6, 0x0f, 0xe5, 0x27, 0x30, 0xe6, 0x05, + 0x53, 0x12, 0xfd, 0x80, 0x12, 0x43, 0x12, 0x02, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, + 0xfd, 0xe5, 0x26, 0x30, 0xe7, 0x0f, 0xe5, 0x27, 0x30, 0xe7, 0x05, + 0x53, 0x12, 0xf7, 0x80, 0x12, 0x43, 0x12, 0x08, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, + 0xf7, 0x43, 0x12, 0x01, 0x53, 0x12, 0xfb, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x22, 0xe5, 0x26, + 0x30, 0xe5, 0x2c, 0x20, 0x03, 0x21, 0xd2, 0x03, 0x12, 0x1c, 0x1e, + 0x75, 0x35, 0x06, 0x75, 0x29, 0x09, 0xaf, 0x29, 0x7e, 0x00, 0x12, + 0x1c, 0x74, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x53, 0x12, 0xfe, + 0x43, 0x12, 0x04, 0xe5, 0x12, 0xf0, 0x90, 0x34, 0x98, 0xe0, 0x44, + 0x01, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0x22, + 0xe5, 0x31, 0x64, 0x01, 0x70, 0x41, 0x12, 0x1a, 0xd4, 0x40, 0x03, + 0x02, 0x0d, 0x4f, 0x12, 0x1b, 0x65, 0x50, 0x20, 0x7e, 0x2b, 0x7f, + 0x80, 0x7d, 0x03, 0x12, 0x04, 0x0e, 0x7f, 0x01, 0x12, 0x19, 0x78, + 0x40, 0x09, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, 0x22, + 0x12, 0x0d, 0x50, 0x75, 0x2f, 0x01, 0x22, 0x7f, 0x01, 0x12, 0x19, + 0x78, 0x50, 0x04, 0x75, 0x2f, 0x02, 0x22, 0xd2, 0x09, 0x12, 0x0f, + 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x1a, 0x1d, 0x50, 0x51, 0x12, + 0x1b, 0xcb, 0x90, 0x30, 0xf4, 0xe0, 0xf5, 0x2a, 0x7e, 0x30, 0x7f, + 0xec, 0xa3, 0xe0, 0xfd, 0xe4, 0xfb, 0x12, 0x19, 0x2b, 0xe4, 0xff, + 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0a, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xff, 0xf0, 0xfd, 0x90, 0x01, 0x05, + 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x44, 0x20, 0xf0, 0xed, + 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, 0x90, 0x34, 0xcc, 0xe0, 0x44, + 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, + 0xf0, 0xd2, 0x04, 0x12, 0x1a, 0x3a, 0x50, 0x43, 0x12, 0x1a, 0x57, + 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x30, 0x7d, 0xec, 0x75, 0x1b, 0x11, + 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x30, 0xf5, 0xe0, 0x75, 0xf0, + 0x20, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, + 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x90, 0x00, 0x0a, 0x74, + 0x40, 0xf0, 0x4d, 0x90, 0x00, 0x0b, 0xf0, 0xc2, 0x04, 0x12, 0x1a, + 0xfe, 0x50, 0x38, 0x12, 0x1a, 0x57, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, + 0xff, 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, + 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, + 0xdf, 0xf0, 0xc2, 0x04, 0x12, 0x1b, 0x28, 0x50, 0x25, 0x12, 0x1a, + 0x57, 0x7f, 0x02, 0x12, 0x19, 0x78, 0x90, 0x01, 0x04, 0xe0, 0x54, + 0x7f, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xe4, + 0x90, 0x00, 0x04, 0xf0, 0xef, 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, + 0xc2, 0x04, 0x12, 0x1a, 0xd4, 0x50, 0x2d, 0x12, 0x1a, 0x57, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x90, + 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xc2, 0x04, 0x22, 0x90, 0x34, + 0xcd, 0xe0, 0xf9, 0x20, 0xe3, 0xf8, 0xe5, 0x2b, 0xf4, 0x60, 0x66, + 0x90, 0x34, 0xc0, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, + 0x0d, 0x90, 0x34, 0xc8, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, + 0x82, 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, + 0x08, 0x0d, 0x90, 0x34, 0xd0, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, + 0x85, 0x33, 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, + 0xe5, 0x82, 0x24, 0x0c, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, + 0x12, 0x08, 0x0d, 0xe5, 0x34, 0x24, 0xf0, 0xff, 0xe5, 0x33, 0x34, + 0xde, 0xfe, 0xef, 0x78, 0x05, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, + 0xf9, 0xf5, 0x2b, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, + 0x20, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, + 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, 0xc0, 0x12, + 0x08, 0x0d, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, 0x20, + 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x08, 0xf5, 0x82, + 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, 0xc8, + 0x12, 0x08, 0x0d, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, + 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x0c, 0xf5, + 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, + 0xc4, 0x12, 0x08, 0x0d, 0x90, 0x01, 0x01, 0xe0, 0x44, 0x40, 0xf0, + 0x90, 0x01, 0x00, 0xe0, 0x44, 0x08, 0xf0, 0xe9, 0x44, 0x04, 0x90, + 0x34, 0xcd, 0xf0, 0x90, 0x34, 0xcc, 0xe0, 0x44, 0x01, 0xf0, 0xa3, + 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0x22, 0x8f, + 0x15, 0x8c, 0x16, 0x8d, 0x17, 0xe5, 0x15, 0xc3, 0x94, 0x04, 0x50, + 0x56, 0xe5, 0x15, 0x94, 0x00, 0x40, 0x06, 0x7a, 0x00, 0x7b, 0x60, + 0x80, 0x04, 0x7a, 0x00, 0x7b, 0xc0, 0xe5, 0x17, 0xc4, 0xf8, 0x54, + 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x16, 0xc4, 0x54, 0xf0, 0x48, 0xfe, + 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, + 0x96, 0xef, 0x2b, 0xfb, 0xee, 0x3a, 0xfa, 0xe5, 0x17, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x16, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0xe5, 0x15, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, 0x96, 0xed, + 0x4c, 0x60, 0x63, 0x0b, 0xbb, 0x00, 0x01, 0x0a, 0x80, 0x5c, 0x7a, + 0x00, 0x7b, 0x1a, 0xe5, 0x17, 0xae, 0x16, 0x78, 0x02, 0xc3, 0x33, + 0xce, 0x33, 0xce, 0xd8, 0xf9, 0x24, 0x0b, 0xff, 0xe4, 0x3e, 0xfe, + 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, + 0x96, 0xef, 0x78, 0x02, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, + 0x2b, 0xfb, 0xee, 0x3a, 0xfa, 0xe5, 0x17, 0xae, 0x16, 0x78, 0x02, + 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0x24, 0x0b, 0xff, 0xe4, + 0x3e, 0xfe, 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, + 0x12, 0x07, 0x96, 0xed, 0x4c, 0x60, 0x07, 0x74, 0x04, 0x2b, 0xfb, + 0xe4, 0x3a, 0xfa, 0xcf, 0xeb, 0xcf, 0xce, 0xea, 0xce, 0x22, 0xe5, + 0x2e, 0x14, 0x60, 0x1d, 0x14, 0x60, 0x3d, 0x14, 0x60, 0x5d, 0x14, + 0x70, 0x03, 0x02, 0x0f, 0xd7, 0x24, 0x04, 0x60, 0x03, 0x02, 0x0f, + 0xed, 0x20, 0x0d, 0x03, 0x02, 0x0f, 0xed, 0x75, 0x2e, 0x01, 0x22, + 0x90, 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x03, 0x44, 0x20, 0xf0, + 0xe5, 0x40, 0x45, 0x3f, 0x60, 0x03, 0x02, 0x0f, 0xed, 0x75, 0x2e, + 0x02, 0x12, 0x19, 0x9b, 0x12, 0x1b, 0x78, 0xaf, 0x28, 0x12, 0x1a, + 0xa8, 0x22, 0x90, 0x01, 0x03, 0xe0, 0xff, 0x30, 0xe7, 0x76, 0xef, + 0x44, 0x80, 0x90, 0x01, 0x03, 0xf0, 0x12, 0x08, 0x51, 0x12, 0x19, + 0xde, 0x12, 0x1b, 0xbb, 0x75, 0x2e, 0x03, 0xaf, 0x22, 0x7e, 0x00, + 0x12, 0x1c, 0x2a, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, 0x21, 0x12, + 0x14, 0x41, 0x12, 0x1b, 0x78, 0x12, 0x19, 0xbe, 0x12, 0x1b, 0xbb, + 0x12, 0x1c, 0x04, 0x30, 0x0d, 0x0b, 0x75, 0x2e, 0x01, 0xaf, 0x32, + 0x7e, 0x00, 0x12, 0x1c, 0x2a, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, + 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x2c, 0x44, 0x20, 0xf0, 0x12, + 0x14, 0x41, 0x12, 0x1b, 0x78, 0x12, 0x19, 0xbe, 0x12, 0x1b, 0xbb, + 0x12, 0x1c, 0x04, 0x75, 0x2e, 0x04, 0x22, 0xe5, 0x40, 0x45, 0x3f, + 0x70, 0x10, 0x30, 0x0d, 0x0a, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0xfe, + 0x12, 0x1c, 0x2a, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, 0x00, 0x04, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0x30, 0x09, 0x32, 0xe5, + 0x34, 0x45, 0x33, 0x70, 0x02, 0xc3, 0x22, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, + 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, + 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, 0xee, 0x9c, 0xd0, 0x82, 0xd0, + 0x83, 0xf0, 0xa3, 0xef, 0xf0, 0xe5, 0x34, 0x45, 0x33, 0x70, 0x02, + 0xc3, 0x22, 0x12, 0x05, 0xed, 0x50, 0xf3, 0x90, 0x00, 0x0a, 0xe0, + 0x20, 0xe5, 0x03, 0x30, 0x07, 0x41, 0xe5, 0x34, 0x45, 0x33, 0x70, + 0x02, 0xc3, 0x22, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, + 0xc0, 0x82, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, + 0x9d, 0xff, 0xee, 0x9c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, + 0xf0, 0xe5, 0x34, 0x45, 0x33, 0x70, 0x02, 0xc3, 0x22, 0x12, 0x05, + 0xed, 0x50, 0xf3, 0x80, 0xb5, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x12, 0x16, 0xea, 0xd3, 0x22, 0x12, + 0x1a, 0xfe, 0x40, 0x05, 0x12, 0x1a, 0xd4, 0x50, 0x44, 0x7e, 0x30, + 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, + 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, + 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, + 0xe0, 0x54, 0xbf, 0xf0, 0x54, 0x7f, 0xff, 0xf0, 0xe4, 0x90, 0x30, + 0xe9, 0xf0, 0xef, 0x54, 0xfd, 0x90, 0x00, 0x0b, 0xf0, 0xe4, 0x90, + 0x00, 0x04, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, + 0x12, 0x1b, 0x13, 0x50, 0x48, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, + 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, + 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, 0xff, + 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, + 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xff, 0x12, 0x19, + 0x78, 0x50, 0x04, 0x75, 0x2f, 0x07, 0x22, 0x90, 0x01, 0x04, 0xe0, + 0x54, 0x7f, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, + 0x22, 0xc2, 0xaf, 0xe4, 0xf5, 0x2f, 0xf5, 0x88, 0x75, 0xa8, 0x0f, + 0x75, 0x89, 0x11, 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x0f, 0x75, + 0x31, 0xff, 0x75, 0x2b, 0xff, 0x90, 0x22, 0x2e, 0xf0, 0xa3, 0xf0, + 0x90, 0x22, 0x4e, 0xf0, 0xa3, 0xf0, 0xc2, 0x05, 0xc2, 0x08, 0xc2, + 0x00, 0xc2, 0x07, 0xc2, 0x04, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, + 0x90, 0x00, 0x0b, 0x74, 0x01, 0xf0, 0x90, 0x01, 0x03, 0x74, 0xff, + 0xf0, 0xe4, 0x90, 0x01, 0x04, 0xf0, 0x90, 0x01, 0x05, 0x74, 0xff, + 0xf0, 0xe4, 0x90, 0x01, 0x06, 0xf0, 0x90, 0x00, 0x04, 0xf0, 0x90, + 0x30, 0xe8, 0x74, 0x10, 0xf0, 0x90, 0x01, 0x07, 0xf0, 0x90, 0x01, + 0x08, 0x04, 0xf0, 0x90, 0x01, 0x09, 0x74, 0x48, 0xf0, 0x90, 0x01, + 0x0a, 0x74, 0x7f, 0xf0, 0x90, 0x01, 0x02, 0x74, 0x1f, 0xf0, 0x90, + 0x01, 0x00, 0x74, 0x14, 0xf0, 0x90, 0x01, 0x01, 0x74, 0x20, 0xf0, + 0x90, 0x00, 0x00, 0xe0, 0x44, 0x80, 0xf0, 0x75, 0x49, 0x00, 0x75, + 0x4a, 0x01, 0xc2, 0x01, 0xd2, 0xaf, 0x22, 0x12, 0x1a, 0xd4, 0x50, + 0x2d, 0x12, 0x18, 0x48, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, + 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, + 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, + 0x90, 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, + 0x2f, 0x22, 0x12, 0x1b, 0x28, 0x50, 0x50, 0x12, 0x18, 0x48, 0x90, + 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0x90, 0x01, 0x03, 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x44, + 0x80, 0xf0, 0x7f, 0x02, 0x12, 0x19, 0x78, 0x50, 0x04, 0x75, 0x2f, + 0x05, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, + 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, + 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, + 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x2f, 0x22, + 0x90, 0x30, 0x30, 0x74, 0x02, 0xf0, 0x75, 0x11, 0x07, 0x75, 0x12, + 0xd0, 0x90, 0x30, 0x30, 0xe0, 0x30, 0xe0, 0x0e, 0xe5, 0x12, 0x15, + 0x12, 0x70, 0x02, 0x15, 0x11, 0xe5, 0x12, 0x45, 0x11, 0x70, 0xeb, + 0xe5, 0x12, 0x45, 0x11, 0x70, 0x12, 0x12, 0x1a, 0x74, 0x90, 0x21, + 0x00, 0xe0, 0x60, 0x07, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, + 0xc3, 0x22, 0xe4, 0x90, 0x34, 0x58, 0xf0, 0x90, 0x34, 0x32, 0x74, + 0x1f, 0xf0, 0x75, 0x11, 0x07, 0x75, 0x12, 0xd0, 0x90, 0x34, 0x81, + 0xe0, 0x64, 0x03, 0x60, 0x0e, 0xe5, 0x12, 0x15, 0x12, 0x70, 0x02, + 0x15, 0x11, 0xe5, 0x12, 0x45, 0x11, 0x70, 0xea, 0xe5, 0x12, 0x45, + 0x11, 0x70, 0x12, 0x12, 0x1a, 0x74, 0x90, 0x21, 0x00, 0xe0, 0x60, + 0x07, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xc3, 0x22, 0x90, + 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xe4, 0x90, 0x00, 0x01, 0xf0, + 0xd3, 0x22, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x10, 0x12, 0x1c, 0x57, + 0x50, 0x26, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x10, 0xfd, 0x80, + 0x03, 0x43, 0x10, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x10, + 0xf7, 0x80, 0x03, 0x43, 0x10, 0x08, 0x53, 0x10, 0xfe, 0x43, 0x10, + 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x10, 0xf0, 0x12, 0x1c, 0x4c, 0x50, + 0x48, 0x90, 0x01, 0x03, 0xe0, 0xf5, 0x10, 0x54, 0x1c, 0x60, 0x3e, + 0xe5, 0x10, 0x54, 0xe3, 0xf0, 0xa3, 0xe0, 0xf5, 0x10, 0xf0, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x10, 0x02, 0x80, 0x03, 0x53, 0x10, + 0xfd, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x10, 0x08, 0x80, 0x03, + 0x53, 0x10, 0xf7, 0x53, 0x10, 0xfe, 0x43, 0x10, 0x04, 0x90, 0x30, + 0x3a, 0xe5, 0x10, 0xf0, 0xaf, 0x29, 0x7e, 0x00, 0x12, 0x1c, 0x74, + 0xaf, 0x35, 0x7e, 0x00, 0x12, 0x1c, 0x7b, 0x22, 0x12, 0x1a, 0xbf, + 0x50, 0x72, 0x12, 0x1c, 0x41, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xe0, 0xfc, 0xa3, 0xe0, 0xc3, 0x9f, 0xf5, 0x12, 0xec, 0x9e, 0xf5, + 0x11, 0xd3, 0xe5, 0x12, 0x94, 0x00, 0xe5, 0x11, 0x64, 0x80, 0x94, + 0x80, 0x40, 0x06, 0xae, 0x11, 0xaf, 0x12, 0x80, 0x04, 0x7e, 0x00, + 0x7f, 0x00, 0x8e, 0x11, 0x8f, 0x12, 0xe5, 0x34, 0x24, 0x10, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xc3, 0x95, 0x12, 0xf5, + 0x12, 0xe4, 0x95, 0x11, 0xf5, 0x11, 0xc3, 0x64, 0x80, 0x94, 0x80, + 0x50, 0x05, 0xe4, 0xf5, 0x11, 0xf5, 0x12, 0xe5, 0x34, 0x24, 0x12, + 0xff, 0xe4, 0x35, 0x33, 0xfe, 0xad, 0x12, 0x7b, 0x01, 0x12, 0x19, + 0x2b, 0x90, 0x01, 0x05, 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x44, 0x20, 0xf0, 0x75, 0x2f, 0x03, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, + 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, + 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x33, 0xf5, 0x34, + 0xe5, 0x2f, 0x25, 0xe0, 0x24, 0x9b, 0xf5, 0x82, 0xe4, 0x34, 0x1b, + 0xf5, 0x83, 0xe4, 0x93, 0xfe, 0x74, 0x01, 0x93, 0xca, 0xee, 0xca, + 0xf9, 0x12, 0x08, 0x4b, 0x12, 0x1b, 0xf6, 0x50, 0x02, 0xd2, 0x07, + 0x12, 0x17, 0x2c, 0x12, 0x00, 0x1e, 0x12, 0x1a, 0xe9, 0x50, 0x05, + 0xaf, 0x25, 0x12, 0x1c, 0x62, 0x30, 0x05, 0x1b, 0xe5, 0x2f, 0x70, + 0x17, 0x20, 0x04, 0x14, 0x12, 0x12, 0x4e, 0x92, 0x00, 0xc2, 0x05, + 0xd2, 0x0b, 0xa2, 0x00, 0xe4, 0x33, 0xf5, 0x14, 0xaf, 0x23, 0x12, + 0x16, 0xa2, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, + 0xf0, 0xd0, 0xe0, 0x32, 0x90, 0x29, 0xa0, 0xe0, 0x70, 0x63, 0x90, + 0x30, 0x8c, 0xe4, 0xf0, 0xa3, 0x74, 0xc2, 0xf0, 0xa3, 0x74, 0x01, + 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, 0xff, 0x90, 0x29, + 0xa0, 0xf0, 0x90, 0x30, 0x8c, 0xe4, 0xf0, 0xa3, 0x74, 0xc5, 0xf0, + 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, + 0xff, 0x90, 0x29, 0xa1, 0xf0, 0x90, 0x30, 0x8c, 0xe4, 0xf0, 0xa3, + 0x74, 0xc4, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, + 0x30, 0x8c, 0xe0, 0xff, 0x90, 0x29, 0xa2, 0xf0, 0x90, 0x30, 0x8c, + 0xe4, 0xf0, 0xa3, 0x74, 0xc3, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, + 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, 0x90, 0x29, 0xa3, 0xf0, 0x22, + 0x8e, 0x16, 0x8f, 0x17, 0x8c, 0x18, 0x8d, 0x19, 0xe4, 0xff, 0xef, + 0xc3, 0x9b, 0x50, 0x53, 0xe5, 0x1b, 0x30, 0xe0, 0x12, 0xef, 0x7c, + 0x00, 0x25, 0x19, 0xfd, 0xec, 0x35, 0x18, 0x8d, 0x82, 0xf5, 0x83, + 0xe0, 0xf5, 0x1c, 0x80, 0x1f, 0xe5, 0x1b, 0x30, 0xe1, 0x13, 0xef, + 0x7c, 0x00, 0x25, 0x19, 0xfd, 0xec, 0x35, 0x18, 0x8d, 0x82, 0xf5, + 0x83, 0xe4, 0x93, 0xf5, 0x1c, 0x80, 0x07, 0xe5, 0x19, 0x2f, 0xf8, + 0xe6, 0xf5, 0x1c, 0xe5, 0x1b, 0x30, 0xe4, 0x0f, 0xe5, 0x17, 0x2f, + 0xf5, 0x82, 0xe4, 0x35, 0x16, 0xf5, 0x83, 0xe5, 0x1c, 0xf0, 0x80, + 0x06, 0xe5, 0x17, 0x2f, 0xf8, 0xa6, 0x1c, 0x0f, 0x80, 0xa8, 0x22, + 0x8c, 0x13, 0x8d, 0x14, 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, + 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0x4c, 0x60, 0x41, 0xef, 0x24, + 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, + 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0x85, 0x14, + 0x82, 0x85, 0x13, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb, 0xd3, 0xed, + 0x9b, 0xea, 0x64, 0x80, 0xf8, 0xec, 0x64, 0x80, 0x98, 0x40, 0x13, + 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, + 0xa3, 0xe0, 0xce, 0xec, 0xce, 0xff, 0x80, 0xaf, 0xad, 0x14, 0xac, + 0x13, 0x12, 0x18, 0xaf, 0x22, 0x12, 0x1a, 0xbf, 0x50, 0x4f, 0xe5, + 0x34, 0x24, 0x12, 0xff, 0xe4, 0x35, 0x33, 0xfe, 0xe5, 0x34, 0x24, + 0x10, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xe4, + 0xfb, 0x12, 0x19, 0x2b, 0xe5, 0x34, 0x24, 0x10, 0xf5, 0x82, 0xe4, + 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, 0x7e, 0x00, 0x12, 0x1c, 0x36, + 0x90, 0x00, 0x0a, 0x74, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, + 0x40, 0xff, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x80, 0xf0, 0x4f, 0x90, + 0x00, 0x0b, 0xf0, 0x90, 0x30, 0xe9, 0x74, 0x01, 0xf0, 0x75, 0x2f, + 0x06, 0x22, 0x90, 0x30, 0x3a, 0xe0, 0xff, 0xe5, 0x27, 0x30, 0xe6, + 0x12, 0x30, 0x0c, 0x06, 0xef, 0x54, 0xf5, 0xfe, 0x80, 0x04, 0xef, + 0x44, 0x0a, 0xfe, 0xcf, 0xee, 0xcf, 0x80, 0x10, 0x30, 0x0c, 0x06, + 0xef, 0x44, 0x0a, 0xfe, 0x80, 0x04, 0xef, 0x54, 0xf5, 0xfe, 0xcf, + 0xee, 0xcf, 0xcf, 0x54, 0xfe, 0xcf, 0xcf, 0x44, 0x04, 0xcf, 0x90, + 0x30, 0x3a, 0xef, 0xf0, 0x30, 0x0c, 0x09, 0x7f, 0x08, 0x7e, 0x00, + 0x12, 0x1c, 0x74, 0x80, 0x07, 0x7f, 0x22, 0x7e, 0x01, 0x12, 0x1c, + 0x74, 0xb2, 0x0c, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, + 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, 0xc2, 0x8c, 0xc2, + 0x8d, 0xd3, 0xe5, 0x4a, 0x94, 0x00, 0xe5, 0x49, 0x94, 0x00, 0x40, + 0x08, 0xe5, 0x4a, 0x15, 0x4a, 0x70, 0x02, 0x15, 0x49, 0xd3, 0xe5, + 0x4c, 0x94, 0x00, 0xe5, 0x4b, 0x94, 0x00, 0x40, 0x08, 0xe5, 0x4c, + 0x15, 0x4c, 0x70, 0x02, 0x15, 0x4b, 0x12, 0x00, 0x0e, 0xd2, 0x8c, + 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, + 0xe0, 0x32, 0xc3, 0xef, 0x94, 0x04, 0xee, 0x64, 0x80, 0x94, 0x80, + 0x40, 0x0c, 0xd3, 0xed, 0x94, 0x04, 0xec, 0x64, 0x80, 0x94, 0x80, + 0x50, 0x01, 0x22, 0xc3, 0xef, 0x94, 0xfc, 0xee, 0x64, 0x80, 0x94, + 0x7f, 0x40, 0x0c, 0xd3, 0xed, 0x94, 0xfc, 0xec, 0x64, 0x80, 0x94, + 0x7f, 0x50, 0x01, 0x22, 0xd3, 0xef, 0x94, 0x04, 0xee, 0x64, 0x80, + 0x94, 0x80, 0x50, 0x0d, 0xc3, 0xed, 0x94, 0xfc, 0xec, 0x64, 0x80, + 0x94, 0x7f, 0x40, 0x02, 0xd3, 0x22, 0xc3, 0x22, 0xe4, 0xfe, 0xef, + 0xf4, 0x60, 0x41, 0x74, 0x04, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe0, 0xb4, 0xff, 0x23, 0x74, 0x04, 0x2e, 0xf5, 0x82, + 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xef, 0xf0, 0x30, 0x0b, 0x0d, 0x74, + 0x08, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x14, + 0xf0, 0x90, 0x00, 0x02, 0x74, 0x01, 0xf0, 0x22, 0xbe, 0x03, 0x0a, + 0x90, 0x00, 0x02, 0x74, 0x01, 0xf0, 0xe4, 0xfe, 0x80, 0xc2, 0x0e, + 0x80, 0xbf, 0x22, 0x8e, 0x13, 0x8f, 0x14, 0x12, 0x1c, 0x41, 0xc3, + 0xef, 0x95, 0x14, 0xff, 0xee, 0x95, 0x13, 0xcd, 0xef, 0xcd, 0xfc, + 0xd3, 0xed, 0x94, 0x00, 0xec, 0x64, 0x80, 0x94, 0x80, 0x40, 0x05, + 0xce, 0xec, 0xce, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0xcc, 0xee, + 0xcc, 0xec, 0x90, 0x00, 0x05, 0xf0, 0x90, 0x00, 0x06, 0xef, 0xf0, + 0x90, 0x00, 0x04, 0x74, 0x51, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, + 0x02, 0xf0, 0x22, 0x30, 0x07, 0x3c, 0xe5, 0x2f, 0x70, 0x38, 0xc2, + 0x07, 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x11, 0xf5, + 0x12, 0x90, 0x22, 0x4e, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x90, 0x22, + 0x2e, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x22, 0x4e, 0xe5, 0x11, + 0xf0, 0xa3, 0xe5, 0x12, 0xf0, 0x8e, 0x33, 0x8f, 0x34, 0x30, 0x08, + 0x05, 0x12, 0x17, 0xa5, 0xc2, 0x08, 0xc2, 0x09, 0x12, 0x0f, 0xee, + 0x22, 0x7f, 0x80, 0x7e, 0x29, 0xe4, 0xfd, 0xfc, 0x8f, 0x82, 0x8e, + 0x83, 0xe0, 0xfb, 0x74, 0x45, 0x2d, 0xf8, 0xc6, 0xeb, 0xc6, 0x74, + 0x04, 0x2f, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfb, 0x74, + 0x41, 0x2d, 0xf8, 0xc6, 0xeb, 0xc6, 0x74, 0x08, 0x2f, 0xff, 0xe4, + 0x3e, 0xfe, 0x0d, 0xbd, 0x00, 0x01, 0x0c, 0xed, 0x64, 0x04, 0x4c, + 0x70, 0xcf, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xc4, 0x33, 0x54, 0xe0, + 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xab, 0x82, 0xfa, 0x12, + 0x1b, 0xab, 0x8b, 0x82, 0x8a, 0x83, 0xee, 0x8f, 0xf0, 0x12, 0x07, + 0xeb, 0x7e, 0x22, 0x7f, 0x30, 0xcd, 0xeb, 0xcd, 0xcc, 0xea, 0xcc, + 0x12, 0x15, 0x0e, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x00, 0x00, 0x74, 0x0e, 0xf0, 0x00, 0x00, + 0x00, 0xe4, 0xf0, 0x12, 0x11, 0x31, 0x12, 0x1c, 0x88, 0x90, 0x34, + 0x98, 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x30, 0xb4, 0x05, 0x0a, 0x12, + 0x1c, 0x4c, 0x50, 0x0d, 0x12, 0x15, 0xc0, 0x80, 0x08, 0xe5, 0x30, + 0xb4, 0x07, 0x03, 0x12, 0x12, 0xd4, 0x12, 0x0f, 0x2a, 0x80, 0xe4, + 0x80, 0xfe, 0x22, 0xe4, 0xff, 0xe5, 0x30, 0x24, 0xfe, 0x70, 0x2c, + 0xe4, 0xfe, 0xee, 0xc3, 0x95, 0x2c, 0x50, 0x12, 0x74, 0x01, 0xc8, + 0xee, 0xc8, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xcf, 0x4f, + 0xcf, 0x0e, 0x80, 0xe8, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0xfe, + 0xe5, 0x27, 0x54, 0x1f, 0x6f, 0xf4, 0xce, 0x4e, 0xce, 0xee, 0xf0, + 0x22, 0x90, 0x34, 0xce, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x34, 0xcd, + 0xe0, 0x54, 0xfe, 0xf0, 0x90, 0x34, 0xcd, 0xe0, 0x20, 0xe3, 0xf9, + 0x90, 0x01, 0x11, 0xe0, 0x54, 0x22, 0xff, 0xbf, 0x22, 0x03, 0xd3, + 0x80, 0x01, 0xc3, 0x50, 0xf0, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, + 0xf0, 0x90, 0x01, 0x01, 0xe0, 0x54, 0xbf, 0xf0, 0x22, 0xef, 0x24, + 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, + 0xfb, 0xca, 0xec, 0xca, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, + 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x24, 0x1e, 0xf5, 0x82, + 0xe4, 0x3e, 0xf5, 0x83, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xce, 0xea, + 0xce, 0xcf, 0xeb, 0xcf, 0x22, 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, + 0x3e, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb, 0xed, 0x24, 0x1e, + 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xea, 0xf0, 0xa3, 0xeb, 0xf0, + 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xec, 0xf0, + 0xa3, 0xed, 0xf0, 0x22, 0xc0, 0xe0, 0xc0, 0xd0, 0xc2, 0xaf, 0xc2, + 0x8e, 0xc2, 0x8f, 0xd3, 0xe5, 0x40, 0x94, 0x00, 0xe5, 0x3f, 0x94, + 0x00, 0x40, 0x0d, 0xe5, 0x40, 0x15, 0x40, 0x70, 0x02, 0x15, 0x3f, + 0x12, 0x1c, 0x6b, 0xd2, 0x8e, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0xe0, + 0x32, 0x12, 0x1a, 0xbf, 0x50, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xd2, + 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x8e, 0x13, 0x8f, + 0x14, 0x8d, 0x15, 0xeb, 0x60, 0x09, 0x14, 0x70, 0x1b, 0xaf, 0x15, + 0x12, 0x19, 0xfe, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0xac, 0x13, 0xad, + 0x14, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xaf, 0x15, + 0x12, 0x19, 0xfe, 0x22, 0x12, 0x17, 0x6c, 0x90, 0x21, 0x01, 0xe0, + 0xf5, 0x28, 0x74, 0x41, 0x25, 0x28, 0xf8, 0xe6, 0xf5, 0x32, 0x74, + 0x45, 0x25, 0x28, 0xf8, 0xe6, 0xf5, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0x60, 0x03, 0xd2, 0x0d, 0x22, 0xc2, 0x0d, 0x22, 0xcd, 0xef, 0xcd, + 0x90, 0x01, 0x02, 0xe0, 0x30, 0xe7, 0x02, 0xc3, 0x22, 0x7e, 0x2a, + 0x7f, 0x00, 0x12, 0x04, 0x0e, 0x90, 0x01, 0x04, 0xe0, 0x44, 0x80, + 0xf0, 0x90, 0x01, 0x02, 0xe0, 0x44, 0x80, 0xf0, 0xd3, 0x22, 0x90, + 0x34, 0x30, 0xe4, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x1f, 0xf0, 0xa3, + 0xe4, 0xf0, 0x90, 0x01, 0x10, 0xe0, 0x20, 0xe1, 0x03, 0x00, 0x80, + 0xf6, 0x90, 0x01, 0x12, 0xe0, 0x20, 0xe1, 0x03, 0x00, 0x80, 0xf6, + 0x22, 0xe4, 0xff, 0x74, 0x36, 0x2f, 0xf8, 0xe6, 0x90, 0x30, 0x8c, + 0xf0, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x90, 0x30, 0x8d, 0xf0, 0xa3, + 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x0f, 0xbf, 0x09, 0xe3, 0x22, + 0xe4, 0xff, 0xef, 0x90, 0x1b, 0x5b, 0x93, 0x90, 0x30, 0x8c, 0xf0, + 0xef, 0x90, 0x1b, 0x51, 0x93, 0x90, 0x30, 0x8d, 0xf0, 0xa3, 0x74, + 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x0f, 0xbf, 0x09, 0xe3, 0x22, 0xe4, + 0x90, 0x00, 0x05, 0xf0, 0xef, 0x60, 0x02, 0x80, 0x02, 0x7f, 0x01, + 0x90, 0x00, 0x06, 0xef, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x51, 0xf0, + 0x90, 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x90, 0x30, 0xf0, + 0xe0, 0xf5, 0x2a, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe4, 0x0e, 0x90, + 0x30, 0xf2, 0xe0, 0x60, 0x08, 0x90, 0x00, 0x0a, 0x74, 0x10, 0xf0, + 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x30, 0xf0, 0xe0, 0xf5, 0x2a, 0x90, + 0x00, 0x0a, 0xe0, 0x30, 0xe4, 0x0e, 0x90, 0x30, 0xf2, 0xe0, 0x70, + 0x08, 0x90, 0x00, 0x0a, 0x74, 0x10, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x34, 0xce, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x34, 0xcd, 0xe0, + 0x54, 0xfe, 0xf0, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xbf, 0xf0, 0x22, 0x90, 0x00, 0x01, 0x74, + 0x0e, 0xf0, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfb, 0xf0, 0x90, 0x34, + 0x58, 0x74, 0x01, 0xf0, 0x90, 0x30, 0x30, 0x74, 0x04, 0xf0, 0x22, + 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x6c, 0x90, 0xc8, 0x00, 0x01, 0x02, 0x03, 0x0b, 0x0f, 0x0a, 0x0e, + 0x09, 0x0d, 0x08, 0x0c, 0xef, 0xc4, 0x33, 0x33, 0x54, 0xc0, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0x3f, 0x4f, 0xf0, 0x90, 0x01, 0x02, + 0xe0, 0x44, 0x80, 0xf0, 0x22, 0x90, 0x01, 0x03, 0xe0, 0x30, 0xe7, + 0x0c, 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, + 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe1, 0x0c, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xd3, + 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe2, 0x0c, 0x74, + 0x04, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xf0, 0xd3, 0x22, + 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe6, 0x0c, 0x74, 0x40, + 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xd3, 0x22, 0xc3, + 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe7, 0x0c, 0x74, 0x80, 0xf0, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0x7f, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x01, 0x05, 0xe0, 0x30, 0xe5, 0x0c, 0x74, 0x20, 0xf0, 0x90, + 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0xd3, 0x22, 0xc3, 0x22, 0xe4, + 0xf5, 0x31, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x22, 0x2e, + 0x74, 0x21, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0x22, 0x52, 0x53, 0x54, + 0x12, 0x15, 0x16, 0x10, 0x11, 0x40, 0x00, 0x20, 0x00, 0x40, 0xff, + 0x3f, 0x3f, 0xbd, 0x28, 0x21, 0x00, 0xe5, 0x34, 0x24, 0x11, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0x30, 0xe6, 0x02, 0xd3, + 0x22, 0xc3, 0x22, 0x90, 0x30, 0x40, 0x74, 0x32, 0xf0, 0xa3, 0x74, + 0xb0, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x22, 0x75, + 0x31, 0x01, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x00, 0x0b, + 0xe0, 0x44, 0x20, 0xf0, 0x22, 0x0b, 0xd1, 0x13, 0x53, 0x15, 0x6b, + 0x11, 0xc6, 0x00, 0x09, 0x19, 0x03, 0x10, 0x95, 0x1b, 0xda, 0x90, + 0x30, 0x64, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xed, 0x25, 0xe0, 0xff, + 0xee, 0x33, 0xfe, 0x22, 0x90, 0x30, 0x40, 0x74, 0x32, 0xf0, 0xa3, + 0x74, 0xb0, 0xf0, 0xa3, 0xe4, 0xf0, 0xa3, 0xf0, 0x22, 0x90, 0x01, + 0x00, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x01, 0x01, 0xe0, 0x44, 0x40, + 0xf0, 0x22, 0x12, 0x1a, 0xbf, 0x50, 0x08, 0xd2, 0x09, 0x12, 0x0f, + 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe0, + 0x05, 0x74, 0x01, 0xf0, 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, + 0xe0, 0x30, 0xe5, 0x05, 0x74, 0x20, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x34, 0x30, 0x74, 0x1f, 0xf0, 0xa3, 0xe4, 0xf0, 0xa3, 0xf0, + 0xa3, 0xf0, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, + 0x4c, 0x02, 0x17, 0xdc, 0xc2, 0xaf, 0xc2, 0x8c, 0xc2, 0x8d, 0x12, + 0x00, 0x0e, 0xd2, 0xaf, 0x22, 0xc2, 0x8e, 0x8e, 0x3f, 0x8f, 0x40, + 0x12, 0x1c, 0x6b, 0xd2, 0x8e, 0x22, 0x90, 0x30, 0x3c, 0xef, 0xf0, + 0xee, 0x44, 0x80, 0xa3, 0xf0, 0x22, 0x90, 0x30, 0x78, 0xe0, 0xfd, + 0xa3, 0xe0, 0xfe, 0xed, 0xff, 0x22, 0xe5, 0x4a, 0x45, 0x49, 0x70, + 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0xe5, 0x4c, 0x45, 0x4b, 0x70, + 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0xc2, 0x0b, 0xe4, 0xf5, 0x14, + 0x12, 0x16, 0xa2, 0x22, 0xc2, 0x8f, 0x75, 0x8d, 0xf5, 0x75, 0x8b, + 0x41, 0x22, 0x8e, 0x49, 0x8f, 0x4a, 0xd2, 0x8c, 0x22, 0x8e, 0x4b, + 0x8f, 0x4c, 0xd2, 0x8c, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x0d, 0xe4, 0xf5, 0x2e, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xac, 0x30 +}; + +static const uint8_t rt2561s[] = { + 0x02, 0x1c, 0x2d, 0x02, 0x07, 0xdf, 0xc2, 0x8c, 0x22, 0x22, 0x00, + 0x02, 0x19, 0x43, 0xc2, 0xaf, 0xc2, 0x8d, 0x75, 0x8c, 0x94, 0x75, + 0x8a, 0x93, 0xd2, 0xaf, 0x22, 0x02, 0x1a, 0x9c, 0x12, 0x08, 0xdf, + 0x40, 0x03, 0x02, 0x02, 0x1e, 0x90, 0x21, 0x02, 0xe0, 0xf5, 0x2d, + 0x90, 0x00, 0x03, 0xe0, 0x12, 0x04, 0x3f, 0x00, 0xb0, 0x00, 0x00, + 0xce, 0x01, 0x00, 0x5e, 0x10, 0x00, 0x6f, 0x11, 0x00, 0xf2, 0x20, + 0x01, 0x4d, 0x21, 0x01, 0x70, 0x22, 0x01, 0x84, 0x30, 0x01, 0x8f, + 0x31, 0x01, 0xd5, 0x50, 0x01, 0x9f, 0x51, 0x01, 0xf2, 0x52, 0x02, + 0x06, 0x60, 0x00, 0x00, 0x02, 0x14, 0x90, 0x00, 0x0a, 0xe0, 0x20, + 0xe5, 0x03, 0x30, 0x07, 0x03, 0xd2, 0x08, 0x22, 0x12, 0x14, 0x2b, + 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x11, 0xe5, 0x11, 0xc4, 0x33, + 0x54, 0xe0, 0x24, 0x21, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x11, 0xc4, 0x33, 0x54, 0xe0, 0x24, + 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x11, 0xf0, + 0xc4, 0x33, 0x54, 0xe0, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe5, 0x2d, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, + 0x12, 0x05, 0xcb, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x31, 0x60, 0x05, + 0x12, 0x1b, 0xe0, 0x80, 0x03, 0x12, 0x1b, 0xa6, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x75, 0x31, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x01, 0x01, 0xe0, + 0x54, 0xfe, 0xf0, 0x54, 0x3e, 0xf0, 0xe4, 0x90, 0x00, 0x0b, 0xf0, + 0xf0, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, + 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x0a, 0xfb, 0x90, 0x34, + 0xcd, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x21, 0x14, 0x12, 0x04, 0x1b, + 0x90, 0x34, 0xc0, 0x12, 0x04, 0x27, 0x90, 0x21, 0x18, 0x12, 0x04, + 0x1b, 0x90, 0x34, 0xc8, 0x12, 0x04, 0x27, 0x90, 0x21, 0x1c, 0x12, + 0x04, 0x1b, 0x90, 0x34, 0xc4, 0x12, 0x04, 0x27, 0x90, 0x34, 0xcc, + 0x74, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x01, 0x01, + 0xe0, 0x44, 0x01, 0xf0, 0x44, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, + 0x44, 0x10, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xfe, 0xf0, 0x54, 0xbf, 0xf0, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, + 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, + 0x12, 0x0a, 0xfb, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0xd2, 0x05, 0x85, 0x2d, 0x23, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0x22, 0x12, 0x13, 0xae, 0xc2, 0x00, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x85, 0x2d, 0x25, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xff, 0xf0, 0xe4, 0x90, 0x00, + 0x07, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x00, + 0x08, 0xf0, 0x90, 0x21, 0x00, 0xe0, 0x90, 0x00, 0x09, 0xf0, 0x90, + 0x00, 0x07, 0x74, 0x71, 0xf0, 0xef, 0x44, 0x04, 0x90, 0x00, 0x0b, + 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0xff, 0x54, 0x1f, 0xf5, 0x30, 0xa3, 0xe0, 0xf5, 0x27, 0x8f, 0x26, + 0x12, 0x14, 0x62, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x2c, 0x12, 0x17, + 0xa3, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, + 0x22, 0x12, 0x1a, 0xed, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x10, 0xe8, 0x22, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x10, 0xe8, 0x22, 0xe5, 0x31, 0x64, 0x01, 0x70, 0x41, 0x12, + 0x08, 0xed, 0x40, 0x03, 0x02, 0x03, 0x9d, 0x12, 0x0e, 0x34, 0x50, + 0x20, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x0a, 0xfb, 0x7f, + 0x01, 0x12, 0x0a, 0xd8, 0x40, 0x09, 0xd2, 0x09, 0x12, 0x0e, 0x47, + 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x09, 0x64, 0x75, 0x2f, 0x01, 0x22, + 0x7f, 0x01, 0x12, 0x0a, 0xd8, 0x50, 0x04, 0x75, 0x2f, 0x02, 0x22, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x08, + 0x90, 0x50, 0x51, 0x12, 0x0a, 0xac, 0x90, 0x30, 0xf4, 0xe0, 0xf5, + 0x2a, 0x7e, 0x30, 0x7f, 0xec, 0xa3, 0xe0, 0xfd, 0xe4, 0xfb, 0x12, + 0x0d, 0xa0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, 0x0a, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xff, 0xf0, + 0xfd, 0x90, 0x01, 0x05, 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x44, 0x20, 0xf0, 0xed, 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, 0x90, + 0x34, 0xcc, 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, + 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0xd2, 0x04, 0x12, 0x08, 0xad, 0x50, + 0x43, 0x12, 0x0a, 0xbb, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x30, 0x7d, + 0xec, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x30, + 0xf5, 0xe0, 0x75, 0xf0, 0x20, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x0e, + 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, + 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, + 0x90, 0x00, 0x0a, 0x74, 0x40, 0xf0, 0x4d, 0x90, 0x00, 0x0b, 0xf0, + 0xc2, 0x04, 0x12, 0x09, 0x25, 0x50, 0x38, 0x12, 0x0a, 0xbb, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, + 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0xc2, 0x04, 0x12, 0x09, 0x4f, + 0x50, 0x25, 0x12, 0x0a, 0xbb, 0x7f, 0x02, 0x12, 0x0a, 0xd8, 0x90, + 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, + 0xfd, 0xff, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xef, 0x54, 0xbf, + 0x90, 0x00, 0x0b, 0xf0, 0xc2, 0x04, 0x12, 0x08, 0xed, 0x50, 0x2d, + 0x12, 0x0a, 0xbb, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, + 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x54, 0xdf, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xc2, + 0x04, 0x22, 0xef, 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, 0xf0, + 0xa4, 0x28, 0xce, 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, + 0x0b, 0xbe, 0x00, 0x29, 0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, + 0x22, 0xe4, 0xcc, 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xee, + 0x33, 0xfe, 0xec, 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, + 0xfc, 0xee, 0x9d, 0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, + 0x22, 0xed, 0xf8, 0xf5, 0xf0, 0xee, 0x84, 0x20, 0xd2, 0x1c, 0xfe, + 0xad, 0xf0, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, + 0x40, 0x07, 0x98, 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, + 0xfd, 0x0f, 0xd5, 0xf0, 0xea, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, + 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, + 0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, + 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x22, 0xec, 0xf0, 0xa3, 0xed, + 0xf0, 0xa3, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0xa4, 0x25, 0x82, + 0xf5, 0x82, 0xe5, 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0xd0, 0x83, + 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, + 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, + 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, + 0xa3, 0x80, 0xdf, 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xe5, 0x2e, + 0x14, 0x60, 0x1d, 0x14, 0x60, 0x3d, 0x14, 0x60, 0x5d, 0x14, 0x70, + 0x03, 0x02, 0x05, 0x18, 0x24, 0x04, 0x60, 0x03, 0x02, 0x05, 0x2e, + 0x20, 0x0d, 0x03, 0x02, 0x05, 0x2e, 0x75, 0x2e, 0x01, 0x22, 0x90, + 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x03, 0x44, 0x20, 0xf0, 0xe5, + 0x40, 0x45, 0x3f, 0x60, 0x03, 0x02, 0x05, 0x2e, 0x75, 0x2e, 0x02, + 0x12, 0x1b, 0x12, 0x12, 0x1b, 0xce, 0xaf, 0x28, 0x12, 0x1b, 0x8f, + 0x22, 0x90, 0x01, 0x03, 0xe0, 0xff, 0x30, 0xe7, 0x76, 0xef, 0x44, + 0x80, 0x90, 0x01, 0x03, 0xf0, 0x12, 0x08, 0x55, 0x12, 0x1b, 0x55, + 0x12, 0x1c, 0x01, 0x75, 0x2e, 0x03, 0xaf, 0x22, 0x7e, 0x00, 0x12, + 0x1c, 0x45, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, 0x21, 0x12, 0x17, + 0xd8, 0x12, 0x1b, 0xce, 0x12, 0x1b, 0x35, 0x12, 0x1c, 0x01, 0x12, + 0x1c, 0x1f, 0x30, 0x0d, 0x0b, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0x7e, + 0x00, 0x12, 0x1c, 0x45, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, 0x00, + 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x2c, 0x44, 0x20, 0xf0, 0x12, 0x17, + 0xd8, 0x12, 0x1b, 0xce, 0x12, 0x1b, 0x35, 0x12, 0x1c, 0x01, 0x12, + 0x1c, 0x1f, 0x75, 0x2e, 0x04, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, + 0x10, 0x30, 0x0d, 0x0a, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0xfe, 0x12, + 0x1c, 0x45, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x12, 0x09, 0x25, 0x40, + 0x05, 0x12, 0x08, 0xed, 0x50, 0x44, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, + 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, + 0xf0, 0x54, 0x7f, 0xff, 0xf0, 0xe4, 0x90, 0x30, 0xe9, 0xf0, 0xef, + 0x54, 0xfd, 0x90, 0x00, 0x0b, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x12, 0x09, 0x3a, + 0x50, 0x48, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, + 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, + 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, + 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0x54, 0xfd, 0xf0, + 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xff, 0x12, 0x0a, 0xd8, 0x50, 0x04, + 0x75, 0x2f, 0x07, 0x22, 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0xc2, 0xaf, + 0xe4, 0xf5, 0x2f, 0xf5, 0x88, 0x75, 0xa8, 0x0f, 0x75, 0x89, 0x11, + 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x0f, 0x75, 0x31, 0xff, 0x75, + 0x2b, 0xff, 0x90, 0x22, 0x2e, 0xf0, 0xa3, 0xf0, 0x90, 0x22, 0x4e, + 0xf0, 0xa3, 0xf0, 0xc2, 0x05, 0xc2, 0x08, 0xc2, 0x00, 0xc2, 0x07, + 0xc2, 0x04, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x00, 0x0b, + 0x74, 0x01, 0xf0, 0x90, 0x01, 0x03, 0x74, 0xff, 0xf0, 0xe4, 0x90, + 0x01, 0x04, 0xf0, 0x90, 0x01, 0x05, 0x74, 0xff, 0xf0, 0xe4, 0x90, + 0x01, 0x06, 0xf0, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x30, 0xe8, 0x74, + 0x10, 0xf0, 0x90, 0x01, 0x07, 0xf0, 0x90, 0x01, 0x08, 0x04, 0xf0, + 0x90, 0x01, 0x09, 0x74, 0x48, 0xf0, 0x90, 0x01, 0x0a, 0x74, 0x7f, + 0xf0, 0x90, 0x01, 0x02, 0x74, 0x1f, 0xf0, 0x90, 0x01, 0x00, 0x74, + 0x14, 0xf0, 0x90, 0x01, 0x01, 0x74, 0x20, 0xf0, 0x90, 0x00, 0x00, + 0xe0, 0x44, 0x80, 0xf0, 0x75, 0x49, 0x00, 0x75, 0x4a, 0x01, 0xc2, + 0x01, 0xd2, 0xaf, 0x22, 0x12, 0x08, 0xed, 0x50, 0x2d, 0x12, 0x0a, + 0x78, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x7e, 0x30, 0x7f, + 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, + 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, + 0xf0, 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0x12, + 0x09, 0x4f, 0x50, 0x50, 0x12, 0x0a, 0x78, 0x90, 0x00, 0x0b, 0xe0, + 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x03, + 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x44, 0x80, 0xf0, 0x7f, + 0x02, 0x12, 0x0a, 0xd8, 0x50, 0x04, 0x75, 0x2f, 0x05, 0x22, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0e, 0x47, 0x90, 0x01, 0x04, + 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x2f, 0x22, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x10, 0x12, 0x1c, 0x5c, 0x50, 0x26, 0xe5, 0x27, 0x30, + 0xe6, 0x05, 0x53, 0x10, 0xfd, 0x80, 0x03, 0x43, 0x10, 0x02, 0xe5, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 16:40:31 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F6310657C6; Fri, 25 May 2012 16:40:31 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1498FC0C; Fri, 25 May 2012 16:40:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PGeVfH021344; Fri, 25 May 2012 16:40:31 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGeVPK021342; Fri, 25 May 2012 16:40:31 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251640.q4PGeVPK021342@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236008 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:40:31 -0000 Author: bschmidt Date: Fri May 25 16:40:31 2012 New Revision: 236008 URL: http://svn.freebsd.org/changeset/base/236008 Log: MFC r235235-235237: Update man page due to import of RT2800/RT3000 support. Modified: stable/8/share/man/man4/ral.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ral.4 ============================================================================== --- stable/8/share/man/man4/ral.4 Fri May 25 16:39:56 2012 (r236007) +++ stable/8/share/man/man4/ral.4 Fri May 25 16:40:31 2012 (r236008) @@ -1,5 +1,4 @@ -.\" Copyright (c) 2005, 2006 -.\" Damien Bergamini +.\" Copyright (c) 2005-2010 Damien Bergamini .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -15,12 +14,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2009 +.Dd May 10, 2012 .Dt RAL 4 .Os .Sh NAME .Nm ral -.Nd "Ralink Technology IEEE 802.11 wireless network driver" +.Nd "Ralink Technology IEEE 802.11a/g/n wireless network device" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -42,31 +41,43 @@ if_ral_load="YES" .Sh DESCRIPTION The .Nm -driver supports PCI/CardBus wireless adapters based on the Ralink Technology -RT2500, RT2501, and RT2600 chipsets. +driver supports PCI/PCIe/CardBus wireless adapters based on the Ralink RT2500, +RT2501, RT2600, RT2700, RT2800 and RT3090 chipsets. .Pp The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink. -It consists of two integrated chips, a RT2560 MAC/BBP and a RT2525 radio +It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio transceiver. .Pp -The RT2501 chipset is the second generation of 802.11b/g adapters from Ralink. -It consists of two integrated chips, a RT2561 MAC/BBP and a RT2527 radio +The RT2501 chipset is the second generation of 802.11a/b/g adapters from +Ralink. +It consists of two integrated chips, an RT2561 MAC/BBP and an RT2527 radio transceiver. This chipset provides support for the IEEE 802.11e standard with multiple hardware transmission queues and allows scatter/gather for efficient DMA operations. .Pp -The RT2600 chipset consists of two integrated chips, a RT2661 MAC/BBP and a +The RT2600 chipset consists of two integrated chips, an RT2661 MAC/BBP and an RT2529 radio transceiver. This chipset uses the MIMO (multiple-input multiple-output) technology with -multiple antennas to extend the operating range of the adapter and to achieve -higher throughput. -MIMO is the basis of the forthcoming IEEE 802.11n standard. -.Pp -The transmit speed is user-selectable or can be adapted automatically by the -driver depending on the received signal strength and on the number of hardware -transmission retries. +multiple radio transceivers to extend the operating range of the adapter and +to achieve higher throughput. +However, the RT2600 chipset does not support any of the 802.11n features. +.Pp +The RT2700 chipset is a low-cost version of the RT2800 chipset. +It supports a single transmit path and two receiver paths (1T2R). +It consists of two integrated chips, an RT2760 or RT2790 (PCIe) MAC/BBP and +an RT2720 (2.4GHz) or RT2750 (2.4GHz/5GHz) radio transceiver. +.Pp +The RT2800 chipset is the first generation of 802.11n adapters from Ralink. +It consists of two integrated chips, an RT2860 or RT2890 (PCIe) MAC/BBP and +an RT2820 (2.4GHz) or RT2850 (2.4GHz/5GHz) radio transceiver. +The RT2800 chipset supports two transmit paths and up to three receiver +paths (2T2R/2T3R). +It can achieve speeds up to 144Mbps (20MHz bandwidth) and 300Mbps (40MHz +bandwidth.) .Pp +The RT3090 chipset is the first generation of single-chip 802.11n adapters +from Ralink. .Nm supports .Cm station , @@ -92,13 +103,16 @@ Multiple interfaces may be operated together with a .Cm hostap interface to construct a wireless repeater device. +.Pp +The transmit speed is user-selectable or can be adapted automatically by the +driver depending on the number of hardware transmission retries. For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm -driver supports PCI/CardBus wireless adapters based on the Ralink Technology -RT2500, RT2501, and RT2600 chipsets, including: +driver supports PCI/PCIe/CardBus wireless adapters based on Ralink Technology +chipsets, including: .Pp .Bl -column -compact ".Li Atlantis Land A02-PCM-W54" "RT2561S" "CardBus" .It Em Card Ta Em MAC/BBP Ta Em Bus @@ -188,9 +202,6 @@ RT2500, RT2501, and RT2600 chipsets, inc .It "Zonet ZEW1500" Ta RT2560 Ta CardBus .It "Zonet ZEW1600" Ta RT2560 Ta PCI .El -.Pp -An up to date list can be found at -.Pa http://damien.bergamini.free.fr/ral/list.html . .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Pp @@ -239,7 +250,7 @@ This should not happen. .Xr wlan_xauth 4 , .Xr hostapd 8 , .Xr ifconfig 8 , -.Xr wpa_supplicant 8 . +.Xr wpa_supplicant 8 .Rs .%T "Ralink Technology" .%U http://www.ralinktech.com/ @@ -249,12 +260,37 @@ The .Nm driver first appeared in .Ox 3.7 . +Support for the RT2501 and RT2600 chipsets was added in +.Ox 3.9 . +Support for the RT2800 chipset was added in +.Ox 4.3 . +Support for the RT2700 chipset was added in +.Ox 4.4 . +Support for the RT3090 chipset was added in +.Ox 4.9 . .Sh AUTHORS The original .Nm driver was written by -.An Damien Bergamini Aq damien@FreeBSD.org . -.Sh BUGS -Host AP mode doesn't support client power save. -Clients using power save mode will experience +.An Damien Bergamini Aq damien@openbsd.org . +.Sh CAVEATS +The +.Nm +driver does not make use of the hardware cryptographic engine. +.Pp +The +.Nm +driver does not support any of the 802.11n capabilities offered by +the RT2700 and RT2800 chipsets. +Additional work is required in before those features can be supported. +.Pp +Host AP mode doesn't support power saving. +Clients attempting to use power saving mode may experience significant packet loss (disabling power saving on the client will fix this). +.Pp +Some PCI +.Nm +adapters seem to strictly require a system supporting PCI 2.2 or greater and +will likely not work in systems based on older revisions of the PCI +specification. +Check the board's PCI version before purchasing the card. From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 16:52:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B38C1065686; Fri, 25 May 2012 16:52:01 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05AEA8FC0C; Fri, 25 May 2012 16:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PGq0sk021990; Fri, 25 May 2012 16:52:00 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGq0AW021987; Fri, 25 May 2012 16:52:00 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251652.q4PGq0AW021987@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236010 - stable/8/sys/dev/ral X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:52:01 -0000 Author: bschmidt Date: Fri May 25 16:52:00 2012 New Revision: 236010 URL: http://svn.freebsd.org/changeset/base/236010 Log: MFC r220502: Don't hardcode assumptions about basic rates, similar to what the rt2661 support code does. While here remove an unnecessary loop. Modified: stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Fri May 25 16:45:56 2012 (r236009) +++ stable/8/sys/dev/ral/rt2560.c Fri May 25 16:52:00 2012 (r236010) @@ -144,7 +144,8 @@ static void rt2560_enable_tsf_sync(stru static void rt2560_enable_tsf(struct rt2560_softc *); static void rt2560_update_plcp(struct rt2560_softc *); static void rt2560_update_slot(struct ifnet *); -static void rt2560_set_basicrates(struct rt2560_softc *); +static void rt2560_set_basicrates(struct rt2560_softc *, + const struct ieee80211_rateset *); static void rt2560_update_led(struct rt2560_softc *, int, int); static void rt2560_set_bssid(struct rt2560_softc *, const uint8_t *); static void rt2560_set_macaddr(struct rt2560_softc *, uint8_t *); @@ -779,7 +780,7 @@ rt2560_newstate(struct ieee80211vap *vap if (vap->iv_opmode != IEEE80211_M_MONITOR) { rt2560_update_plcp(sc); - rt2560_set_basicrates(sc); + rt2560_set_basicrates(sc, &ni->ni_rates); rt2560_set_bssid(sc, ni->ni_bssid); } @@ -2353,22 +2354,29 @@ rt2560_update_slot(struct ifnet *ifp) } static void -rt2560_set_basicrates(struct rt2560_softc *sc) +rt2560_set_basicrates(struct rt2560_softc *sc, + const struct ieee80211_rateset *rs) { +#define RV(r) ((r) & IEEE80211_RATE_VAL) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + uint32_t mask = 0; + uint8_t rate; + int i; - /* update basic rate set */ - if (ic->ic_curmode == IEEE80211_MODE_11B) { - /* 11b basic rates: 1, 2Mbps */ - RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x3); - } else if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) { - /* 11a basic rates: 6, 12, 24Mbps */ - RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x150); - } else { - /* 11g basic rates: 1, 2, 5.5, 11, 6, 12, 24Mbps */ - RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x15f); + for (i = 0; i < rs->rs_nrates; i++) { + rate = rs->rs_rates[i]; + + if (!(rate & IEEE80211_RATE_BASIC)) + continue; + + mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; } + + RAL_WRITE(sc, RT2560_ARSP_PLCP_1, mask); + + DPRINTF(sc, "Setting basic rate mask to 0x%x\n", mask); +#undef RV } static void Modified: stable/8/sys/dev/ral/rt2661.c ============================================================================== --- stable/8/sys/dev/ral/rt2661.c Fri May 25 16:45:56 2012 (r236009) +++ stable/8/sys/dev/ral/rt2661.c Fri May 25 16:52:00 2012 (r236010) @@ -1915,7 +1915,7 @@ rt2661_set_basicrates(struct rt2661_soft struct ieee80211com *ic = ifp->if_l2com; uint32_t mask = 0; uint8_t rate; - int i, j; + int i; for (i = 0; i < rs->rs_nrates; i++) { rate = rs->rs_rates[i]; @@ -1923,13 +1923,7 @@ rt2661_set_basicrates(struct rt2661_soft if (!(rate & IEEE80211_RATE_BASIC)) continue; - /* - * Find h/w rate index. We know it exists because the rate - * set has already been negotiated. - */ - for (j = 0; ic->ic_sup_rates[IEEE80211_MODE_11G].rs_rates[j] != RV(rate); j++); - - mask |= 1 << j; + mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; } RAL_WRITE(sc, RT2661_TXRX_CSR5, mask); From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 19:57:02 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33DAD106568D; Fri, 25 May 2012 19:57:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA9F8FC0A; Fri, 25 May 2012 19:57:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PJv122030216; Fri, 25 May 2012 19:57:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PJv1T8030213; Fri, 25 May 2012 19:57:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251957.q4PJv1T8030213@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 19:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236022 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:57:02 -0000 Author: marius Date: Fri May 25 19:57:01 2012 New Revision: 236022 URL: http://svn.freebsd.org/changeset/base/236022 Log: MFC: r235681 Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays casted to structs by getting rid of these buffers entirely. In r169832, it was tried to paper over this issue by 32-bit aligning the buffers. Depending on compiler optimizations that still was insufficient for 64-bit architectures with strong alignment requirements though. While at it, add comments regarding the total lack of locking in this area. Tested by: bz Reviewed by: bz (slightly earlier version), yongari (earlier version) Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Fri May 25 19:56:40 2012 (r236021) +++ stable/8/sys/netinet6/nd6.c Fri May 25 19:57:01 2012 (r236022) @@ -2146,128 +2146,101 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_defrouter *d, *de; + struct in6_defrouter d; struct nd_defrouter *dr; + int error; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&d, sizeof(d)); + d.rtaddr.sin6_family = AF_INET6; + d.rtaddr.sin6_len = sizeof(d.rtaddr); + + /* + * XXX locking + */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - d = (struct in6_defrouter *)buf; - de = (struct in6_defrouter *)(buf + sizeof(buf)); - - if (d + 1 <= de) { - bzero(d, sizeof(*d)); - d->rtaddr.sin6_family = AF_INET6; - d->rtaddr.sin6_len = sizeof(d->rtaddr); - d->rtaddr.sin6_addr = dr->rtaddr; - error = sa6_recoverscope(&d->rtaddr); - if (error != 0) - return (error); - d->flags = dr->flags; - d->rtlifetime = dr->rtlifetime; - d->expire = dr->expire; - d->if_index = dr->ifp->if_index; - } else - panic("buffer too short"); - - error = SYSCTL_OUT(req, buf, sizeof(*d)); - if (error) - break; + d.rtaddr.sin6_addr = dr->rtaddr; + error = sa6_recoverscope(&d.rtaddr); + if (error != 0) + return (error); + d.flags = dr->flags; + d.rtlifetime = dr->rtlifetime; + d.expire = dr->expire; + d.if_index = dr->ifp->if_index; + error = SYSCTL_OUT(req, &d, sizeof(d)); + if (error != 0) + return (error); } - - return (error); + return (0); } static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_prefix *p, *pe; + struct in6_prefix p; + struct sockaddr_in6 s6; struct nd_prefix *pr; + struct nd_pfxrouter *pfr; + time_t maxexpire; + int error; char ip6buf[INET6_ADDRSTRLEN]; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&p, sizeof(p)); + p.origin = PR_ORIG_RA; + bzero(&s6, sizeof(s6)); + s6.sin6_family = AF_INET6; + s6.sin6_len = sizeof(s6); + + /* + * XXX locking + */ LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - u_short advrtrs; - size_t advance; - struct sockaddr_in6 *sin6, *s6; - struct nd_pfxrouter *pfr; - - p = (struct in6_prefix *)buf; - pe = (struct in6_prefix *)(buf + sizeof(buf)); - - if (p + 1 <= pe) { - bzero(p, sizeof(*p)); - sin6 = (struct sockaddr_in6 *)(p + 1); - - p->prefix = pr->ndpr_prefix; - if (sa6_recoverscope(&p->prefix)) { + p.prefix = pr->ndpr_prefix; + if (sa6_recoverscope(&p.prefix)) { + log(LOG_ERR, "scope error in prefix list (%s)\n", + ip6_sprintf(ip6buf, &p.prefix.sin6_addr)); + /* XXX: press on... */ + } + p.raflags = pr->ndpr_raf; + p.prefixlen = pr->ndpr_plen; + p.vltime = pr->ndpr_vltime; + p.pltime = pr->ndpr_pltime; + p.if_index = pr->ndpr_ifp->if_index; + if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) + p.expire = 0; + else { + /* XXX: we assume time_t is signed. */ + maxexpire = (-1) & + ~((time_t)1 << ((sizeof(maxexpire) * 8) - 1)); + if (pr->ndpr_vltime < maxexpire - pr->ndpr_lastupdate) + p.expire = pr->ndpr_lastupdate + + pr->ndpr_vltime; + else + p.expire = maxexpire; + } + p.refcnt = pr->ndpr_refcnt; + p.flags = pr->ndpr_stateflags; + p.advrtrs = 0; + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) + p.advrtrs++; + error = SYSCTL_OUT(req, &p, sizeof(p)); + if (error != 0) + return (error); + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { + s6.sin6_addr = pfr->router->rtaddr; + if (sa6_recoverscope(&s6)) log(LOG_ERR, "scope error in prefix list (%s)\n", - ip6_sprintf(ip6buf, &p->prefix.sin6_addr)); - /* XXX: press on... */ - } - p->raflags = pr->ndpr_raf; - p->prefixlen = pr->ndpr_plen; - p->vltime = pr->ndpr_vltime; - p->pltime = pr->ndpr_pltime; - p->if_index = pr->ndpr_ifp->if_index; - if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) - p->expire = 0; - else { - time_t maxexpire; - - /* XXX: we assume time_t is signed. */ - maxexpire = (-1) & - ~((time_t)1 << - ((sizeof(maxexpire) * 8) - 1)); - if (pr->ndpr_vltime < - maxexpire - pr->ndpr_lastupdate) { - p->expire = pr->ndpr_lastupdate + - pr->ndpr_vltime; - } else - p->expire = maxexpire; - } - p->refcnt = pr->ndpr_refcnt; - p->flags = pr->ndpr_stateflags; - p->origin = PR_ORIG_RA; - advrtrs = 0; - LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { - if ((void *)&sin6[advrtrs + 1] > (void *)pe) { - advrtrs++; - continue; - } - s6 = &sin6[advrtrs]; - bzero(s6, sizeof(*s6)); - s6->sin6_family = AF_INET6; - s6->sin6_len = sizeof(*sin6); - s6->sin6_addr = pfr->router->rtaddr; - if (sa6_recoverscope(s6)) { - log(LOG_ERR, - "scope error in " - "prefix list (%s)\n", - ip6_sprintf(ip6buf, - &pfr->router->rtaddr)); - } - advrtrs++; - } - p->advrtrs = advrtrs; - } else - panic("buffer too short"); - - advance = sizeof(*p) + sizeof(*sin6) * advrtrs; - error = SYSCTL_OUT(req, buf, advance); - if (error) - break; + ip6_sprintf(ip6buf, &pfr->router->rtaddr)); + error = SYSCTL_OUT(req, &s6, sizeof(s6)); + if (error != 0) + return (error); + } } - - return (error); + return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 22:42:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32D5F106564A; Fri, 25 May 2012 22:42:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDFB8FC0C; Fri, 25 May 2012 22:42:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PMgLli037366; Fri, 25 May 2012 22:42:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PMgLH3037364; Fri, 25 May 2012 22:42:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205252242.q4PMgLH3037364@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 22:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236029 - stable/8/sys/boot/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 22:42:22 -0000 Author: marius Date: Fri May 25 22:42:21 2012 New Revision: 236029 URL: http://svn.freebsd.org/changeset/base/236029 Log: MFC: r212804 Remove magic value. Modified: stable/8/sys/boot/zfs/zfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Fri May 25 22:07:13 2012 (r236028) +++ stable/8/sys/boot/zfs/zfs.c Fri May 25 22:42:21 2012 (r236029) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.c" +#define MAXBDDEV 31 + static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); @@ -410,7 +412,7 @@ zfs_dev_init(void) * diskN, diskNpM or diskNsM. */ zfs_init(); - for (unit = 0; unit < 32 /* XXX */; unit++) { + for (unit = 0; unit < MAXBDDEV; unit++) { sprintf(devname, "disk%d:", unit); fd = open(devname, O_RDONLY); if (fd == -1) From owner-svn-src-stable-8@FreeBSD.ORG Fri May 25 23:24:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 644EA106564A; Fri, 25 May 2012 23:24:17 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3DD8FC0C; Fri, 25 May 2012 23:24:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PNOHve039125; Fri, 25 May 2012 23:24:17 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PNOHSw039123; Fri, 25 May 2012 23:24:17 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201205252324.q4PNOHSw039123@svn.freebsd.org> From: Ryan Stone Date: Fri, 25 May 2012 23:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236030 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 23:24:17 -0000 Author: rstone Date: Fri May 25 23:24:16 2012 New Revision: 236030 URL: http://svn.freebsd.org/changeset/base/236030 Log: MFC r227342 The in-kernel CTF parser caches the result of its first attempt to parse CTF data from a module. On subsequent attempts to retrieve CTF data for a module, return an error if there no CTF data. This fixes a panic if you try to enable fbt probes on a module without CTF data twice. Submitted by: Paul Ambrose (ambrosehua AT gmail DOT com) Modified: stable/8/sys/kern/kern_ctf.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_ctf.c ============================================================================== --- stable/8/sys/kern/kern_ctf.c Fri May 25 22:42:21 2012 (r236029) +++ stable/8/sys/kern/kern_ctf.c Fri May 25 23:24:16 2012 (r236030) @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linke * ctfcnt to -1. See below. */ if (ef->ctfcnt < 0) - return (0); + return (EFTYPE); /* Now check if we've already loaded the CTF data.. */ if (ef->ctfcnt > 0) { From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 07:58:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A83E21065673; Sat, 26 May 2012 07:58:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B1B8FC17; Sat, 26 May 2012 07:58:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q7wDRk060828; Sat, 26 May 2012 07:58:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7wDP8060824; Sat, 26 May 2012 07:58:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260758.q4Q7wDP8060824@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236055 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:58:13 -0000 Author: thompsa Date: Sat May 26 07:58:12 2012 New Revision: 236055 URL: http://svn.freebsd.org/changeset/base/236055 Log: MFC r232014,r232030,r232070 - bstp_input() always consumes the packet so remove the mbuf handling dance around it. - Now that network interfaces advertise if they support linkstate notifications we do not need to perform a media ioctl every 15 seconds. - Indicate this function decrements the timer as well as testing for expiry. Modified: stable/8/sys/net/bridgestp.c stable/8/sys/net/bridgestp.h stable/8/sys/net/if_bridge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 07:44:35 2012 (r236054) +++ stable/8/sys/net/bridgestp.c Sat May 26 07:58:12 2012 (r236055) @@ -134,7 +134,7 @@ static void bstp_tick(void *); static void bstp_timer_start(struct bstp_timer *, uint16_t); static void bstp_timer_stop(struct bstp_timer *); static void bstp_timer_latch(struct bstp_timer *); -static int bstp_timer_expired(struct bstp_timer *); +static int bstp_timer_dectest(struct bstp_timer *); static void bstp_hello_timer_expiry(struct bstp_state *, struct bstp_port *); static void bstp_message_age_expiry(struct bstp_state *, @@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp) return (flags); } -struct mbuf * +void bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m) { struct bstp_state *bs = bp->bp_bs; @@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct if (bp->bp_active == 0) { m_freem(m); - return (NULL); + return; } BSTP_LOCK(bs); @@ -521,7 +521,6 @@ out: BSTP_UNLOCK(bs); if (m) m_freem(m); - return (NULL); } static void @@ -1862,30 +1861,32 @@ bstp_tick(void *arg) CURVNET_SET(bs->bs_vnet); - /* slow timer to catch missed link events */ - if (bstp_timer_expired(&bs->bs_link_timer)) { - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) - bstp_ifupdstatus(bs, bp); + /* poll link events on interfaces that do not support linkstate */ + if (bstp_timer_dectest(&bs->bs_link_timer)) { + LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { + if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE)) + bstp_ifupdstatus(bs, bp); + } bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); } LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { /* no events need to happen for these */ - bstp_timer_expired(&bp->bp_tc_timer); - bstp_timer_expired(&bp->bp_recent_root_timer); - bstp_timer_expired(&bp->bp_forward_delay_timer); - bstp_timer_expired(&bp->bp_recent_backup_timer); + bstp_timer_dectest(&bp->bp_tc_timer); + bstp_timer_dectest(&bp->bp_recent_root_timer); + bstp_timer_dectest(&bp->bp_forward_delay_timer); + bstp_timer_dectest(&bp->bp_recent_backup_timer); - if (bstp_timer_expired(&bp->bp_hello_timer)) + if (bstp_timer_dectest(&bp->bp_hello_timer)) bstp_hello_timer_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_message_age_timer)) + if (bstp_timer_dectest(&bp->bp_message_age_timer)) bstp_message_age_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_migrate_delay_timer)) + if (bstp_timer_dectest(&bp->bp_migrate_delay_timer)) bstp_migrate_delay_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_edge_delay_timer)) + if (bstp_timer_dectest(&bp->bp_edge_delay_timer)) bstp_edge_delay_expiry(bs, bp); /* update the various state machines for the port */ @@ -1924,7 +1925,7 @@ bstp_timer_latch(struct bstp_timer *t) } static int -bstp_timer_expired(struct bstp_timer *t) +bstp_timer_dectest(struct bstp_timer *t) { if (t->active == 0 || t->latched) return (0); Modified: stable/8/sys/net/bridgestp.h ============================================================================== --- stable/8/sys/net/bridgestp.h Sat May 26 07:44:35 2012 (r236054) +++ stable/8/sys/net/bridgestp.h Sat May 26 07:58:12 2012 (r236055) @@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, in int bstp_set_autoedge(struct bstp_port *, int); int bstp_set_ptp(struct bstp_port *, int); int bstp_set_autoptp(struct bstp_port *, int); -struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); +void bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); #endif /* _KERNEL */ Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat May 26 07:44:35 2012 (r236054) +++ stable/8/sys/net/if_bridge.c Sat May 26 07:58:12 2012 (r236055) @@ -2208,11 +2208,9 @@ bridge_input(struct ifnet *ifp, struct m /* Tap off 802.1D packets; they do not get forwarded. */ if (memcmp(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN) == 0) { - m = bstp_input(&bif->bif_stp, ifp, m); - if (m == NULL) { - BRIDGE_UNLOCK(sc); - return (NULL); - } + bstp_input(&bif->bif_stp, ifp, m); /* consumes mbuf */ + BRIDGE_UNLOCK(sc); + return (NULL); } if ((bif->bif_flags & IFBIF_STP) && From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 07:58:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EAC361065673; Sat, 26 May 2012 07:58:58 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5BAB8FC17; Sat, 26 May 2012 07:58:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q7wwiX060892; Sat, 26 May 2012 07:58:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7wwUo060890; Sat, 26 May 2012 07:58:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260758.q4Q7wwUo060890@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236056 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:58:59 -0000 Author: thompsa Date: Sat May 26 07:58:58 2012 New Revision: 236056 URL: http://svn.freebsd.org/changeset/base/236056 Log: MFC r232118 Only look for a usable MAC address for the bridge ID from ports within our bridge, this allows us to have more than one independent bridge in the same STP domain. PR: kern/164369 Submitted by: Nikos Vassiliadis (earlier version) Modified: stable/8/sys/net/bridgestp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 07:58:12 2012 (r236055) +++ stable/8/sys/net/bridgestp.c Sat May 26 07:58:58 2012 (r236056) @@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs) struct bstp_port *bp; struct ifnet *ifp, *mif; u_char *e_addr; + void *bridgeptr; static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ BSTP_LOCK_ASSERT(bs); + if (LIST_EMPTY(&bs->bs_bplist)) + goto disablestp; + mif = NULL; + bridgeptr = LIST_FIRST(&bs->bs_bplist)->bp_ifp->if_bridge; + KASSERT(bridgeptr != NULL, ("Invalid bridge pointer")); /* * Search through the Ethernet adapters and find the one with the - * lowest value. The adapter which we take the MAC address from does - * not need to be part of the bridge, it just needs to be a unique - * value. + * lowest value. Make sure the adapter which we take the MAC address + * from is part of this bridge, so we can have more than one independent + * bridges in the same STP domain. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_type != IFT_ETHER) - continue; + continue; /* Not Ethernet */ + + if (ifp->if_bridge != bridgeptr) + continue; /* Not part of our bridge */ if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0) - continue; + continue; /* No mac address set */ if (mif == NULL) { mif = ifp; @@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs) } } IFNET_RUNLOCK_NOSLEEP(); - - if (LIST_EMPTY(&bs->bs_bplist) || mif == NULL) { - /* Set the bridge and root id (lower bits) to zero */ - bs->bs_bridge_pv.pv_dbridge_id = - ((uint64_t)bs->bs_bridge_priority) << 48; - bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id; - bs->bs_root_pv = bs->bs_bridge_pv; - /* Disable any remaining ports, they will have no MAC address */ - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { - bp->bp_infois = BSTP_INFO_DISABLED; - bstp_set_port_role(bp, BSTP_ROLE_DISABLED); - } - callout_stop(&bs->bs_bstpcallout); - return; - } + if (mif == NULL) + goto disablestp; e_addr = IF_LLADDR(mif); bs->bs_bridge_pv.pv_dbridge_id = @@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs) bstp_assign_roles(bs); bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); + return; + +disablestp: + /* Set the bridge and root id (lower bits) to zero */ + bs->bs_bridge_pv.pv_dbridge_id = + ((uint64_t)bs->bs_bridge_priority) << 48; + bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id; + bs->bs_root_pv = bs->bs_bridge_pv; + /* Disable any remaining ports, they will have no MAC address */ + LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { + bp->bp_infois = BSTP_INFO_DISABLED; + bstp_set_port_role(bp, BSTP_ROLE_DISABLED); + } + callout_stop(&bs->bs_bstpcallout); } static int From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 07:59:56 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2197106566B; Sat, 26 May 2012 07:59:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B19B8FC12; Sat, 26 May 2012 07:59:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q7xuHF060971; Sat, 26 May 2012 07:59:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7xupG060965; Sat, 26 May 2012 07:59:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260759.q4Q7xupG060965@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236057 - in stable/8: sbin/ifconfig sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:59:56 -0000 Author: thompsa Date: Sat May 26 07:59:56 2012 New Revision: 236057 URL: http://svn.freebsd.org/changeset/base/236057 Log: MFC r232629,r232640 Add the ability to set which packet layers are used for the load balance hash calculation. Modified: stable/8/sbin/ifconfig/ifconfig.8 stable/8/sbin/ifconfig/iflagg.c stable/8/sys/net/ieee8023ad_lacp.c stable/8/sys/net/if_lagg.c stable/8/sys/net/if_lagg.h Directory Properties: stable/8/sbin/ifconfig/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 07:59:56 2012 (r236057) @@ -2234,6 +2234,21 @@ Set the aggregation protocol. The default is failover. The available options are failover, fec, lacp, loadbalance, roundrobin and none. +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc +Set the packet layers to hash for aggregation protocols which load balance. +The default is +.Dq l2,l3,l4 . +The options can be combined using commas. +.Pp +.Bl -tag -width ".Cm l2" -compact +.It Cm l2 +src/dst mac address and optional vlan number. +.It Cm l3 +src/dst address for IPv4 or IPv6. +.It Cm l4 +src/dst port for TCP/UCP/SCTP. +.El +.Pp .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: stable/8/sbin/ifconfig/iflagg.c ============================================================================== --- stable/8/sbin/ifconfig/iflagg.c Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sbin/ifconfig/iflagg.c Sat May 26 07:59:56 2012 (r236057) @@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int err(1, "SIOCSLAGG"); } +static void +setlagghash(const char *val, int d, int s, const struct afswtch *afp) +{ + struct lagg_reqflags rf; + char *str, *tmp, *tok; + + + rf.rf_flags = 0; + str = tmp = strdup(val); + while ((tok = strsep(&tmp, ",")) != NULL) { + if (strcmp(tok, "l2") == 0) + rf.rf_flags |= LAGG_F_HASHL2; + else if (strcmp(tok, "l3") == 0) + rf.rf_flags |= LAGG_F_HASHL3; + else if (strcmp(tok, "l4") == 0) + rf.rf_flags |= LAGG_F_HASHL4; + else { + free(str); + errx(1, "Invalid lagghash option: %s", tok); + } + } + free(str); + if (rf.rf_flags == 0) + errx(1, "No lagghash options supplied"); + + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCSLAGGHASH, &rf)) + err(1, "SIOCSLAGGHASH"); +} + static char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -115,6 +145,7 @@ lagg_status(int s) struct lagg_protos lpr[] = LAGG_PROTOS; struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS]; struct lagg_reqall ra; + struct lagg_reqflags rf; struct lacp_opreq *lp; const char *proto = ""; int i, isport = 0; @@ -132,6 +163,10 @@ lagg_status(int s) ra.ra_size = sizeof(rpbuf); ra.ra_port = rpbuf; + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0) + rf.rf_flags = 0; + if (ioctl(s, SIOCGLAGG, &ra) == 0) { lp = (struct lacp_opreq *)&ra.ra_lacpreq; @@ -143,6 +178,23 @@ lagg_status(int s) } printf("\tlaggproto %s", proto); + if (rf.rf_flags & LAGG_F_HASHMASK) { + const char *sep = ""; + + printf(" lagghash "); + if (rf.rf_flags & LAGG_F_HASHL2) { + printf("%sl2", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL3) { + printf("%sl3", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL4) { + printf("%sl4", sep); + sep = ","; + } + } if (isport) printf(" laggdev %s", rp.rp_ifname); putchar('\n'); @@ -174,6 +226,7 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("laggport", setlaggport), DEF_CMD_ARG("-laggport", unsetlaggport), DEF_CMD_ARG("laggproto", setlaggproto), + DEF_CMD_ARG("lagghash", setlagghash), }; static struct afswtch af_lagg = { .af_name = "af_lagg", Modified: stable/8/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/8/sys/net/ieee8023ad_lacp.c Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sys/net/ieee8023ad_lacp.c Sat May 26 07:59:56 2012 (r236057) @@ -815,7 +815,7 @@ lacp_select_tx_port(struct lagg_softc *s if (sc->use_flowid && (m->m_flags & M_FLOWID)) hash = m->m_pkthdr.flowid; else - hash = lagg_hashmbuf(m, lsc->lsc_hashkey); + hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); hash %= pm->pm_count; lp = pm->pm_map[hash]; Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sys/net/if_lagg.c Sat May 26 07:59:56 2012 (r236057) @@ -280,6 +280,8 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + /* Hash all layers by default */ + sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; sc->sc_proto = LAGG_PROTO_NONE; for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { @@ -887,6 +889,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; struct lagg_reqall *ra = (struct lagg_reqall *)data; struct lagg_reqport *rp = (struct lagg_reqport *)data, rpbuf; + struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; struct lagg_port *lp; struct ifnet *tpif; @@ -976,6 +979,22 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd } error = EPROTONOSUPPORT; break; + case SIOCGLAGGFLAGS: + rf->rf_flags = sc->sc_flags; + break; + case SIOCSLAGGHASH: + error = priv_check(td, PRIV_NET_LAGG); + if (error) + break; + if ((rf->rf_flags & LAGG_F_HASHMASK) == 0) { + error = EINVAL; + break; + } + LAGG_WLOCK(sc); + sc->sc_flags &= ~LAGG_F_HASHMASK; + sc->sc_flags |= rf->rf_flags & LAGG_F_HASHMASK; + LAGG_WUNLOCK(sc); + break; case SIOCGLAGGPORT: if (rp->rp_portname[0] == '\0' || (tpif = ifunit(rp->rp_portname)) == NULL) { @@ -1405,42 +1424,55 @@ lagg_gethdr(struct mbuf *m, u_int off, u } uint32_t -lagg_hashmbuf(struct mbuf *m, uint32_t key) +lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) { uint16_t etype; - uint32_t p = 0; + uint32_t p = key; int off; struct ether_header *eh; - struct ether_vlan_header vlanbuf; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; - struct ip ipbuf; + const uint32_t *ports; + int iphlen; #endif #ifdef INET6 const struct ip6_hdr *ip6; - struct ip6_hdr ip6buf; uint32_t flow; #endif + union { +#ifdef INET + struct ip ip; +#endif +#ifdef INET6 + struct ip6_hdr ip6; +#endif + struct ether_vlan_header vlan; + uint32_t port; + } buf; + off = sizeof(*eh); if (m->m_len < off) goto out; eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, key); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + if (sc->sc_flags & LAGG_F_HASHL2) { + p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + } /* Special handling for encapsulating VLAN frames */ - if (m->m_flags & M_VLANTAG) { + if ((m->m_flags & M_VLANTAG) && (sc->sc_flags & LAGG_F_HASHL2)) { p = hash32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { - vlan = lagg_gethdr(m, off, sizeof(*vlan), &vlanbuf); + vlan = lagg_gethdr(m, off, sizeof(*vlan), &buf); if (vlan == NULL) goto out; - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + if (sc->sc_flags & LAGG_F_HASHL2) + p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } @@ -1448,17 +1480,37 @@ lagg_hashmbuf(struct mbuf *m, uint32_t k switch (etype) { #ifdef INET case ETHERTYPE_IP: - ip = lagg_gethdr(m, off, sizeof(*ip), &ipbuf); + ip = lagg_gethdr(m, off, sizeof(*ip), &buf); if (ip == NULL) goto out; - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + if (sc->sc_flags & LAGG_F_HASHL3) { + p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + } + if (!(sc->sc_flags & LAGG_F_HASHL4)) + break; + switch (ip->ip_p) { + case IPPROTO_TCP: + case IPPROTO_UDP: + case IPPROTO_SCTP: + iphlen = ip->ip_hl << 2; + if (iphlen < sizeof(*ip)) + break; + off += iphlen; + ports = lagg_gethdr(m, off, sizeof(*ports), &buf); + if (ports == NULL) + break; + p = hash32_buf(ports, sizeof(*ports), p); + break; + } break; #endif #ifdef INET6 case ETHERTYPE_IPV6: - ip6 = lagg_gethdr(m, off, sizeof(*ip6), &ip6buf); + if (!(sc->sc_flags & LAGG_F_HASHL3)) + break; + ip6 = lagg_gethdr(m, off, sizeof(*ip6), &buf); if (ip6 == NULL) goto out; @@ -1688,7 +1740,7 @@ lagg_lb_start(struct lagg_softc *sc, str if (sc->use_flowid && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid; else - p = lagg_hashmbuf(m, lb->lb_key); + p = lagg_hashmbuf(sc, m, lb->lb_key); p %= sc->sc_count; lp = lb->lb_ports[p]; Modified: stable/8/sys/net/if_lagg.h ============================================================================== --- stable/8/sys/net/if_lagg.h Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sys/net/if_lagg.h Sat May 26 07:59:56 2012 (r236057) @@ -31,6 +31,12 @@ #define LAGG_MAX_NAMESIZE 32 /* name of a protocol */ #define LAGG_MAX_STACKING 4 /* maximum number of stacked laggs */ +/* Lagg flags */ +#define LAGG_F_HASHL2 0x00000001 /* hash layer 2 */ +#define LAGG_F_HASHL3 0x00000002 /* hash layer 3 */ +#define LAGG_F_HASHL4 0x00000004 /* hash layer 4 */ +#define LAGG_F_HASHMASK 0x00000007 + /* Port flags */ #define LAGG_PORT_SLAVE 0x00000000 /* normal enslaved port */ #define LAGG_PORT_MASTER 0x00000001 /* primary port */ @@ -122,6 +128,14 @@ struct lagg_reqall { #define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall) #define SIOCSLAGG _IOW('i', 144, struct lagg_reqall) +struct lagg_reqflags { + char rf_ifname[IFNAMSIZ]; /* name of the lagg */ + uint32_t rf_flags; /* lagg protocol */ +}; + +#define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags) +#define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) + #ifdef _KERNEL /* * Internal kernel part @@ -179,6 +193,7 @@ struct lagg_softc { struct ifmedia sc_media; /* media config */ caddr_t sc_psc; /* protocol data */ uint32_t sc_seq; /* sequence counter */ + uint32_t sc_flags; SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ SLIST_ENTRY(lagg_softc) sc_entries; @@ -244,7 +259,7 @@ extern struct mbuf *(*lagg_input_p)(stru extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); -uint32_t lagg_hashmbuf(struct mbuf *, uint32_t); +uint32_t lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t); #endif /* _KERNEL */ From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:00:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9049106571F; Sat, 26 May 2012 08:00:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECAA08FC1D; Sat, 26 May 2012 08:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q80Yia061053; Sat, 26 May 2012 08:00:34 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q80YNO061052; Sat, 26 May 2012 08:00:34 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260800.q4Q80YNO061052@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236058 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:00:40 -0000 Author: thompsa Date: Sat May 26 08:00:34 2012 New Revision: 236058 URL: http://svn.freebsd.org/changeset/base/236058 Log: MFC r234163 Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets are discarded, this is an issue because lacp drops the lock which may allow network threads to access freed memory. Expand the lock coverage so the detach/attach happen atomically. Submitted by: Andrew Boyer (earlier version) Modified: stable/8/sys/net/if_lagg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Sat May 26 07:59:56 2012 (r236057) +++ stable/8/sys/net/if_lagg.c Sat May 26 08:00:34 2012 (r236058) @@ -942,11 +942,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = EPROTONOSUPPORT; break; } + LAGG_WLOCK(sc); if (sc->sc_proto != LAGG_PROTO_NONE) { - LAGG_WLOCK(sc); - error = sc->sc_detach(sc); - /* Reset protocol and pointers */ + /* Reset protocol first in case detach unlocks */ sc->sc_proto = LAGG_PROTO_NONE; + error = sc->sc_detach(sc); sc->sc_detach = NULL; sc->sc_start = NULL; sc->sc_input = NULL; @@ -958,10 +958,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd sc->sc_lladdr = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; - LAGG_WUNLOCK(sc); + } else if (sc->sc_input != NULL) { + /* Still detaching */ + error = EBUSY; } - if (error != 0) + if (error != 0) { + LAGG_WUNLOCK(sc); break; + } for (int i = 0; i < (sizeof(lagg_protos) / sizeof(lagg_protos[0])); i++) { if (lagg_protos[i].ti_proto == ra->ra_proto) { @@ -969,7 +973,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd printf("%s: using proto %u\n", sc->sc_ifname, lagg_protos[i].ti_proto); - LAGG_WLOCK(sc); sc->sc_proto = lagg_protos[i].ti_proto; if (sc->sc_proto != LAGG_PROTO_NONE) error = lagg_protos[i].ti_attach(sc); @@ -977,6 +980,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd return (error); } } + LAGG_WUNLOCK(sc); error = EPROTONOSUPPORT; break; case SIOCGLAGGFLAGS: From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:02:14 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BB6106564A; Sat, 26 May 2012 08:02:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9148FC15; Sat, 26 May 2012 08:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q82DNU061164; Sat, 26 May 2012 08:02:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q82DUH061159; Sat, 26 May 2012 08:02:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260802.q4Q82DUH061159@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236059 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:02:14 -0000 Author: thompsa Date: Sat May 26 08:02:13 2012 New Revision: 236059 URL: http://svn.freebsd.org/changeset/base/236059 Log: MFC r234487 Add linkstate to bridge(4), set the link to up when at least one underlying interface is up, otherwise the link is down. This, among other things, allows carp to work on a bridge. Modified: stable/8/sys/net/bridgestp.c stable/8/sys/net/bridgestp.h stable/8/sys/net/if.c stable/8/sys/net/if_bridge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/bridgestp.c Sat May 26 08:02:13 2012 (r236059) @@ -1767,28 +1767,16 @@ bstp_notify_rtage(void *arg, int pending } void -bstp_linkstate(struct ifnet *ifp, int state) +bstp_linkstate(struct bstp_port *bp) { - struct bstp_state *bs; - struct bstp_port *bp; + struct bstp_state *bs = bp->bp_bs; - /* search for the stp port */ - mtx_lock(&bstp_list_mtx); - LIST_FOREACH(bs, &bstp_list, bs_list) { - BSTP_LOCK(bs); - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { - if (bp->bp_ifp == ifp) { - bstp_ifupdstatus(bs, bp); - bstp_update_state(bs, bp); - /* it only exists once so return */ - BSTP_UNLOCK(bs); - mtx_unlock(&bstp_list_mtx); - return; - } - } - BSTP_UNLOCK(bs); + BSTP_LOCK(bs); + if (bp->bp_active) { + bstp_ifupdstatus(bs, bp); + bstp_update_state(bs, bp); } - mtx_unlock(&bstp_list_mtx); + BSTP_UNLOCK(bs); } static void @@ -2103,10 +2091,8 @@ bstp_modevent(module_t mod, int type, vo case MOD_LOAD: mtx_init(&bstp_list_mtx, "bridgestp list", NULL, MTX_DEF); LIST_INIT(&bstp_list); - bstp_linkstate_p = bstp_linkstate; break; case MOD_UNLOAD: - bstp_linkstate_p = NULL; mtx_destroy(&bstp_list_mtx); break; default: Modified: stable/8/sys/net/bridgestp.h ============================================================================== --- stable/8/sys/net/bridgestp.h Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/bridgestp.h Sat May 26 08:02:13 2012 (r236059) @@ -369,8 +369,6 @@ struct bstp_state { extern const uint8_t bstp_etheraddr[]; -extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state); - void bstp_attach(struct bstp_state *, struct bstp_cb_ops *); void bstp_detach(struct bstp_state *); void bstp_init(struct bstp_state *); @@ -379,7 +377,7 @@ int bstp_create(struct bstp_state *, str int bstp_enable(struct bstp_port *); void bstp_disable(struct bstp_port *); void bstp_destroy(struct bstp_port *); -void bstp_linkstate(struct ifnet *, int); +void bstp_linkstate(struct bstp_port *); int bstp_set_htime(struct bstp_state *, int); int bstp_set_fdelay(struct bstp_state *, int); int bstp_set_maxage(struct bstp_state *, int); Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/if.c Sat May 26 08:02:13 2012 (r236059) @@ -126,7 +126,7 @@ MALLOC_DEFINE(M_IFDESCR, "ifdescr", "ifn static struct sx ifdescr_sx; SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifnet descr"); -void (*bstp_linkstate_p)(struct ifnet *ifp, int state); +void (*bridge_linkstate_p)(struct ifnet *ifp); void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); void (*lagg_linkstate_p)(struct ifnet *ifp, int state); /* These are external hooks for CARP. */ @@ -1953,14 +1953,10 @@ do_link_state_change(void *arg, int pend (*ng_ether_link_state_p)(ifp, link_state); if (ifp->if_carp) (*carp_linkstate_p)(ifp); - if (ifp->if_bridge) { - KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); - (*bstp_linkstate_p)(ifp, link_state); - } - if (ifp->if_lagg) { - KASSERT(lagg_linkstate_p != NULL,("if_lagg not loaded!")); + if (ifp->if_bridge) + (*bridge_linkstate_p)(ifp); + if (ifp->if_lagg) (*lagg_linkstate_p)(ifp, link_state); - } if (IS_DEFAULT_VNET(curvnet)) devctl_notify("IFNET", ifp->if_xname, Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/if_bridge.c Sat May 26 08:02:13 2012 (r236059) @@ -333,6 +333,9 @@ static int bridge_ip6_checkbasic(struct #endif /* INET6 */ static int bridge_fragment(struct ifnet *, struct mbuf *, struct ether_header *, int, struct llc *); +static void bridge_linkstate(struct ifnet *ifp); + +extern void (*bridge_linkstate_p)(struct ifnet *ifp); /* The default bridge vlan is 1 (IEEE 802.1Q-2003 Table 9-2) */ #define VLANTAGOF(_m) \ @@ -489,6 +492,7 @@ bridge_modevent(module_t mod, int type, bridge_input_p = bridge_input; bridge_output_p = bridge_output; bridge_dn_p = bridge_dummynet; + bridge_linkstate_p = bridge_linkstate; bridge_detach_cookie = EVENTHANDLER_REGISTER( ifnet_departure_event, bridge_ifdetach, NULL, EVENTHANDLER_PRI_ANY); @@ -501,6 +505,7 @@ bridge_modevent(module_t mod, int type, bridge_input_p = NULL; bridge_output_p = NULL; bridge_dn_p = NULL; + bridge_linkstate_p = NULL; mtx_destroy(&bridge_list_mtx); break; default: @@ -981,6 +986,7 @@ bridge_delete_member(struct bridge_softc bridge_set_ifcap(sc, bif, bif->bif_savedcaps); } bstp_destroy(&bif->bif_stp); /* prepare to free */ + bridge_linkstate(ifs); BRIDGE_LOCK(sc); free(bif, M_DEVBUF); } @@ -1080,17 +1086,17 @@ bridge_ioctl_add(struct bridge_softc *sc /* Set interface capabilities to the intersection set of all members */ bridge_mutecaps(sc); + BRIDGE_UNLOCK(sc); + /* Update the linkstate for the bridge */ + bridge_linkstate(ifs); + /* Place the interface into promiscuous mode */ switch (ifs->if_type) { - case IFT_ETHER: - case IFT_L2VLAN: - /* - * Place the interface into promiscuous mode. - */ - BRIDGE_UNLOCK(sc); - error = ifpromisc(ifs, 1); - BRIDGE_LOCK(sc); - break; + case IFT_ETHER: + case IFT_L2VLAN: + error = ifpromisc(ifs, 1); + break; } + BRIDGE_LOCK(sc); if (error) bridge_delete_member(sc, bif, 0); out: @@ -3467,3 +3473,38 @@ out: m_freem(m); return (error); } + +static void +bridge_linkstate(struct ifnet *ifp) +{ + struct bridge_softc *sc = ifp->if_bridge; + struct bridge_iflist *bif, *bif2; + int new_link, hasls; + + BRIDGE_LOCK(sc); + bif = bridge_lookup_member_if(sc, ifp); + if (bif == NULL) { + BRIDGE_UNLOCK(sc); + return; + } + new_link = LINK_STATE_DOWN; + hasls = 0; + /* Our link is considered up if at least one of our ports is active */ + LIST_FOREACH(bif2, &sc->sc_iflist, bif_next) { + if (bif2->bif_ifp->if_capabilities & IFCAP_LINKSTATE) + hasls++; + if (bif2->bif_ifp->if_link_state == LINK_STATE_UP) { + new_link = LINK_STATE_UP; + break; + } + } + if (!LIST_EMPTY(&sc->sc_iflist) && !hasls) { + /* If no interfaces support link-state then we default to up */ + new_link = LINK_STATE_UP; + } + if_link_state_change(sc->sc_ifp, new_link); + BRIDGE_UNLOCK(sc); + + bstp_linkstate(&bif->bif_stp); +} + From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:02:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFCA31065670; Sat, 26 May 2012 08:02:45 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9133E8FC12; Sat, 26 May 2012 08:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q82j4L061219; Sat, 26 May 2012 08:02:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q82jN4061216; Sat, 26 May 2012 08:02:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260802.q4Q82jN4061216@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236060 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:02:45 -0000 Author: thompsa Date: Sat May 26 08:02:45 2012 New Revision: 236060 URL: http://svn.freebsd.org/changeset/base/236060 Log: MFC r234488 Move the interface media check to a taskqueue, some interfaces (usb) sleep during SIOCGIFMEDIA and we were holding locks. Modified: stable/8/sys/net/bridgestp.c stable/8/sys/net/bridgestp.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 08:02:13 2012 (r236059) +++ stable/8/sys/net/bridgestp.c Sat May 26 08:02:45 2012 (r236060) @@ -127,7 +127,7 @@ static int bstp_rerooted(struct bstp_sta static uint32_t bstp_calc_path_cost(struct bstp_port *); static void bstp_notify_state(void *, int); static void bstp_notify_rtage(void *, int); -static void bstp_ifupdstatus(struct bstp_state *, struct bstp_port *); +static void bstp_ifupdstatus(void *, int); static void bstp_enable_port(struct bstp_state *, struct bstp_port *); static void bstp_disable_port(struct bstp_state *, struct bstp_port *); static void bstp_tick(void *); @@ -1677,7 +1677,7 @@ bstp_set_autoptp(struct bstp_port *bp, i if (set) { bp->bp_flags |= BSTP_PORT_AUTOPTP; if (bp->bp_role != BSTP_ROLE_DISABLED) - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } else bp->bp_flags &= ~BSTP_PORT_AUTOPTP; BSTP_UNLOCK(bs); @@ -1771,69 +1771,89 @@ bstp_linkstate(struct bstp_port *bp) { struct bstp_state *bs = bp->bp_bs; + if (!bp->bp_active) + return; + + bstp_ifupdstatus(bp, 0); BSTP_LOCK(bs); - if (bp->bp_active) { - bstp_ifupdstatus(bs, bp); - bstp_update_state(bs, bp); - } + bstp_update_state(bs, bp); BSTP_UNLOCK(bs); } static void -bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp) +bstp_ifupdstatus(void *arg, int pending) { + struct bstp_port *bp = (struct bstp_port *)arg; + struct bstp_state *bs = bp->bp_bs; struct ifnet *ifp = bp->bp_ifp; struct ifmediareq ifmr; - int error = 0; + int error, changed; - BSTP_LOCK_ASSERT(bs); + if (!bp->bp_active) + return; bzero((char *)&ifmr, sizeof(ifmr)); error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + BSTP_LOCK(bs); + changed = 0; if ((error == 0) && (ifp->if_flags & IFF_UP)) { if (ifmr.ifm_status & IFM_ACTIVE) { /* A full-duplex link is assumed to be point to point */ if (bp->bp_flags & BSTP_PORT_AUTOPTP) { - bp->bp_ptp_link = - ifmr.ifm_active & IFM_FDX ? 1 : 0; + int fdx; + + fdx = ifmr.ifm_active & IFM_FDX ? 1 : 0; + if (bp->bp_ptp_link ^ fdx) { + bp->bp_ptp_link = fdx; + changed = 1; + } } /* Calc the cost if the link was down previously */ if (bp->bp_flags & BSTP_PORT_PNDCOST) { - bp->bp_path_cost = bstp_calc_path_cost(bp); + uint32_t cost; + + cost = bstp_calc_path_cost(bp); + if (bp->bp_path_cost != cost) { + bp->bp_path_cost = cost; + changed = 1; + } bp->bp_flags &= ~BSTP_PORT_PNDCOST; } - if (bp->bp_role == BSTP_ROLE_DISABLED) + if (bp->bp_role == BSTP_ROLE_DISABLED) { bstp_enable_port(bs, bp); + changed = 1; + } } else { if (bp->bp_role != BSTP_ROLE_DISABLED) { bstp_disable_port(bs, bp); + changed = 1; if ((bp->bp_flags & BSTP_PORT_ADMEDGE) && bp->bp_protover == BSTP_PROTO_RSTP) bp->bp_operedge = 1; } } - return; - } - - if (bp->bp_infois != BSTP_INFO_DISABLED) + } else if (bp->bp_infois != BSTP_INFO_DISABLED) { bstp_disable_port(bs, bp); + changed = 1; + } + if (changed) + bstp_assign_roles(bs); + BSTP_UNLOCK(bs); } static void bstp_enable_port(struct bstp_state *bs, struct bstp_port *bp) { bp->bp_infois = BSTP_INFO_AGED; - bstp_assign_roles(bs); } static void bstp_disable_port(struct bstp_state *bs, struct bstp_port *bp) { bp->bp_infois = BSTP_INFO_DISABLED; - bstp_assign_roles(bs); } static void @@ -1853,7 +1873,7 @@ bstp_tick(void *arg) if (bstp_timer_dectest(&bs->bs_link_timer)) { LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE)) - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); } @@ -2063,7 +2083,7 @@ bstp_reinit(struct bstp_state *bs) LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { bp->bp_port_id = (bp->bp_priority << 8) | (bp->bp_ifp->if_index & 0xfff); - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } bstp_assign_roles(bs); @@ -2184,6 +2204,7 @@ bstp_create(struct bstp_state *bs, struc bp->bp_priority = BSTP_DEFAULT_PORT_PRIORITY; TASK_INIT(&bp->bp_statetask, 0, bstp_notify_state, bp); TASK_INIT(&bp->bp_rtagetask, 0, bstp_notify_rtage, bp); + TASK_INIT(&bp->bp_mediatask, 0, bstp_ifupdstatus, bp); /* Init state */ bp->bp_infois = BSTP_INFO_DISABLED; @@ -2247,4 +2268,5 @@ bstp_destroy(struct bstp_port *bp) KASSERT(bp->bp_active == 0, ("port is still attached")); taskqueue_drain(taskqueue_swi, &bp->bp_statetask); taskqueue_drain(taskqueue_swi, &bp->bp_rtagetask); + taskqueue_drain(taskqueue_swi, &bp->bp_mediatask); } Modified: stable/8/sys/net/bridgestp.h ============================================================================== --- stable/8/sys/net/bridgestp.h Sat May 26 08:02:13 2012 (r236059) +++ stable/8/sys/net/bridgestp.h Sat May 26 08:02:45 2012 (r236060) @@ -326,6 +326,7 @@ struct bstp_port { uint8_t bp_txcount; struct task bp_statetask; struct task bp_rtagetask; + struct task bp_mediatask; }; /* From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:23:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4591F106566C; Sat, 26 May 2012 08:23:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 302228FC08; Sat, 26 May 2012 08:23:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8NRGD062251; Sat, 26 May 2012 08:23:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8NQDZ062249; Sat, 26 May 2012 08:23:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260823.q4Q8NQDZ062249@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236066 - stable/8/sbin/ifconfig X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:23:27 -0000 Author: thompsa Date: Sat May 26 08:23:26 2012 New Revision: 236066 URL: http://svn.freebsd.org/changeset/base/236066 Log: MFC r232638 Fix typo in lagg options. Modified: stable/8/sbin/ifconfig/ifconfig.8 Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 08:21:11 2012 (r236065) +++ stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 08:23:26 2012 (r236066) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd February 29, 2012 +.Dd March 7, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2246,7 +2246,7 @@ src/dst mac address and optional vlan nu .It Cm l3 src/dst address for IPv4 or IPv6. .It Cm l4 -src/dst port for TCP/UCP/SCTP. +src/dst port for TCP/UDP/SCTP. .El .Pp .El From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:25:42 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43EFF106566C; Sat, 26 May 2012 08:25:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED918FC15; Sat, 26 May 2012 08:25:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8Pg2s062407; Sat, 26 May 2012 08:25:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8PfXg062405; Sat, 26 May 2012 08:25:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260825.q4Q8PfXg062405@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236068 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:25:42 -0000 Author: thompsa Date: Sat May 26 08:25:41 2012 New Revision: 236068 URL: http://svn.freebsd.org/changeset/base/236068 Log: MFC r232321 Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a system tunable has never been implemented. This flag is only used by sysctl(8) to provide a helpful error message. Modified: stable/8/share/man/man9/sysctl.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/sysctl.9 ============================================================================== --- stable/8/share/man/man9/sysctl.9 Sat May 26 08:25:25 2012 (r236067) +++ stable/8/share/man/man9/sysctl.9 Sat May 26 08:25:41 2012 (r236068) @@ -142,9 +142,9 @@ This sysctl can be written to by process .It Dv CTLFLAG_SKIP When iterating the sysctl name space, do not list this sysctl. .It Dv CTLFLAG_TUN -Also declare a system tunable with the same name to initialize this variable. +Advisory flag that a system tunable also exists for this variable. .It Dv CTLFLAG_RDTUN -Also declare a system tunable with the same name to initialize this variable; +Advisory flag that a system tunable also exists for this variable; however, the run-time variable is read-only. .El .Pp From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:41:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E9F4106566C; Sat, 26 May 2012 08:41:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45528FC14; Sat, 26 May 2012 08:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8fmUm063187; Sat, 26 May 2012 08:41:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8fmdF063185; Sat, 26 May 2012 08:41:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260841.q4Q8fmdF063185@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236072 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:41:49 -0000 Author: thompsa Date: Sat May 26 08:41:48 2012 New Revision: 236072 URL: http://svn.freebsd.org/changeset/base/236072 Log: MFC r231130 (pjd) Allow to set if_bridge(4) sysctls from /boot/loader.conf. Modified: stable/8/sys/net/if_bridge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat May 26 08:41:17 2012 (r236071) +++ stable/8/sys/net/if_bridge.c Sat May 26 08:41:48 2012 (r236072) @@ -358,19 +358,26 @@ static int pfil_local_phys = 0; /* run p locally destined packets */ static int log_stp = 0; /* log STP state changes */ static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ +TUNABLE_INT("net.link.bridge.pfil_onlyip", &pfil_onlyip); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); +TUNABLE_INT("net.link.bridge.ipfw_arp", &pfil_ipfw_arp); SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, &pfil_ipfw_arp, 0, "Filter ARP packets through IPFW layer2"); +TUNABLE_INT("net.link.bridge.pfil_bridge", &pfil_bridge); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW, &pfil_bridge, 0, "Packet filter on the bridge interface"); +TUNABLE_INT("net.link.bridge.pfil_member", &pfil_member); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW, &pfil_member, 0, "Packet filter on the member interface"); +TUNABLE_INT("net.link.bridge.pfil_local_phys", &pfil_local_phys); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW, &pfil_local_phys, 0, "Packet filter on the physical interface for locally destined packets"); +TUNABLE_INT("net.link.bridge.log_stp", &log_stp); SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, &log_stp, 0, "Log STP state changes"); +TUNABLE_INT("net.link.bridge.inherit_mac", &bridge_inherit_mac); SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:44:51 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E50910656E8; Sat, 26 May 2012 08:44:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48FCF8FC0A; Sat, 26 May 2012 08:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8ipde063430; Sat, 26 May 2012 08:44:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8ipaS063428; Sat, 26 May 2012 08:44:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260844.q4Q8ipaS063428@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236075 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:44:51 -0000 Author: thompsa Date: Sat May 26 08:44:50 2012 New Revision: 236075 URL: http://svn.freebsd.org/changeset/base/236075 Log: MFC r234936 (emaste) Relax restriction on direct tx to child ports Lagg(4) restricts the type of packet that may be sent directly to a child port, to avoid undesired output from accidental misconfiguration. Previously only ETHERTYPE_PAE was permitted. BPF writes to a lagg(4) child port are presumably intentional, so just allow them, while still blocking other packets that should take the aggregation path. PR: kern/138620 Modified: stable/8/sys/net/if_lagg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Sat May 26 08:44:26 2012 (r236074) +++ stable/8/sys/net/if_lagg.c Sat May 26 08:44:50 2012 (r236075) @@ -756,28 +756,18 @@ fallback: return (EINVAL); } +/* + * For direct output to child ports. + */ static int lagg_port_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct route *ro) { struct lagg_port *lp = ifp->if_lagg; - struct ether_header *eh; - short type = 0; switch (dst->sa_family) { case pseudo_AF_HDRCMPLT: case AF_UNSPEC: - eh = (struct ether_header *)dst->sa_data; - type = eh->ether_type; - break; - } - - /* - * Only allow ethernet types required to initiate or maintain the link, - * aggregated frames take a different path. - */ - switch (ntohs(type)) { - case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */ return ((*lp->lp_output)(ifp, m, dst, ro)); } From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:54:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 972AB106568D; Sat, 26 May 2012 08:54:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7348FC0C; Sat, 26 May 2012 08:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8sjvT063968; Sat, 26 May 2012 08:54:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8sjGS063959; Sat, 26 May 2012 08:54:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260854.q4Q8sjGS063959@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236077 - in stable/8/sys/boot: ofw/libofw sparc64 sparc64/boot1 sparc64/loader sparc64/zfsboot sparc64/zfsloader zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:54:45 -0000 Author: marius Date: Sat May 26 08:54:44 2012 New Revision: 236077 URL: http://svn.freebsd.org/changeset/base/236077 Log: MFC: r234898, r235207 Add initial support for booting from ZFS on sparc64. At least on Sun Fire V100, the firmware is known to be broken and not allowing to simultaneously open disk devices, causing attempts to boot from a mirror or RAIDZ to cause a crash. This will be worked around later. The firmwares of newer sun4u models don't seem to exhibit this problem though. PR: 165025 Submitted by: Gavin Mu Added: stable/8/sys/boot/sparc64/zfsboot/ - copied from r234898, head/sys/boot/sparc64/zfsboot/ stable/8/sys/boot/sparc64/zfsloader/ - copied from r234898, head/sys/boot/sparc64/zfsloader/ Modified: stable/8/sys/boot/ofw/libofw/devicename.c stable/8/sys/boot/sparc64/Makefile stable/8/sys/boot/sparc64/boot1/Makefile stable/8/sys/boot/sparc64/boot1/boot1.c stable/8/sys/boot/sparc64/loader/Makefile stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/boot/sparc64/zfsboot/Makefile stable/8/sys/boot/zfs/zfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/ofw/libofw/devicename.c ============================================================================== --- stable/8/sys/boot/ofw/libofw/devicename.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/ofw/libofw/devicename.c Sat May 26 08:54:44 2012 (r236077) @@ -28,6 +28,8 @@ __FBSDID("$FreeBSD$"); #include + +#include "bootstrap.h" #include "libofw.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -76,6 +78,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c phandle_t handle; const char *p; const char *s; + char *ep; char name[256]; char type[64]; int len; @@ -87,9 +90,10 @@ ofw_parsedev(struct ofw_devdesc **dev, c len = s - devspec; bcopy(devspec, name, len); name[len] = '\0'; - if ((handle = OF_finddevice(name)) == -1) - break; - if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) + if ((handle = OF_finddevice(name)) == -1) { + bcopy(name, type, len); + type[len] = '\0'; + } else if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) continue; for (i = 0; (dv = devsw[i]) != NULL; i++) { if (strncmp(dv->dv_name, type, strlen(dv->dv_name)) == 0) @@ -109,6 +113,18 @@ found: strcpy(idev->d_path, name); idev->d_dev = dv; idev->d_type = dv->dv_type; + if (idev->d_type == DEVT_ZFS) { + idev->d_unit = 0; + p = name + strlen(dv->dv_name); + if (*p && (*p != ':')) { + idev->d_unit = strtol(p, &ep, 0); + if (ep == p) { + free(idev); + return (EUNIT); + } + } + } + if (dev == NULL) { free(idev); } else { Modified: stable/8/sys/boot/sparc64/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/Makefile Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= boot1 loader +SUBDIR= boot1 loader zfsboot zfsloader .include Modified: stable/8/sys/boot/sparc64/boot1/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/boot1/Makefile Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/boot1/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -3,22 +3,23 @@ PROG= boot1.elf INTERNALPROG= NO_MAN= -FILES= boot1 +FILES?= boot1 SRCS= _start.s boot1.c +CLEANFILES=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 -CFLAGS= -mcmodel=medlow -Os -I${.CURDIR}/../../common +CFLAGS+=-mcmodel=medlow -Os -I${.CURDIR}/../../common LDFLAGS=-N -Ttext ${BOOTBLOCKBASE} # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. -boot1: boot1.aout +${FILES}: boot1.aout + @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 dd if=/dev/zero of=${.TARGET} bs=512 count=16 dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc -CLEANFILES= boot1.aout - boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} Modified: stable/8/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/8/sys/boot/sparc64/boot1/boot1.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/boot1/boot1.c Sat May 26 08:54:44 2012 (r236077) @@ -20,11 +20,13 @@ __FBSDID("$FreeBSD$"); #include #include + #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#define _PATH_LOADER "/boot/loader" +#define _PATH_KERNEL "/boot/kernel/kernel" +#define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); typedef int32_t ofwh_t; @@ -45,17 +47,21 @@ static ofwh_t bootdev; static uint32_t fs_off; int main(int ac, char **av); - static void exit(int) __dead2; -static void load(const char *); -static int dskread(void *, u_int64_t, int); - static void usage(void); +#ifdef ZFSBOOT +static void loadzfs(void); +static int zbread(char *buf, off_t off, size_t bytes); +#else +static void load(const char *); +#endif + static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); static int mount(const char *device); +static int dskread(void *buf, u_int64_t lba, int nblk); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); @@ -312,8 +318,6 @@ strcmp(const char *s1, const char *s2) return ((u_char)*s1 - (u_char)*s2); } -#include "ufsread.c" - int main(int ac, char **av) { @@ -335,14 +339,22 @@ main(int ac, char **av) } } - printf(" \n>> FreeBSD/sparc64 boot block\n" - " Boot path: %s\n" - " Boot loader: %s\n", bootpath, path); +#ifdef ZFSBOOT + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + bootpath); +#else + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", "", bootpath, path); +#endif if (mount(bootpath) == -1) panic("mount"); +#ifdef ZFSBOOT + loadzfs(); +#else load(path); +#endif return (1); } @@ -361,24 +373,86 @@ exit(int code) ofw_exit(); } -static struct dmadat __dmadat; +#ifdef ZFSBOOT + +#define VDEV_BOOT_OFFSET (2 * 256 * 1024) +static char zbuf[READ_BUF_SIZE]; static int -mount(const char *device) +zbread(char *buf, off_t off, size_t bytes) { + size_t len; + off_t poff; + off_t soff; + char *p; + unsigned int nb; + unsigned int lb; - dmadat = &__dmadat; - if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); - return (-1); + p = buf; + soff = VDEV_BOOT_OFFSET + off; + lb = (soff + bytes + DEV_BSIZE - 1) / DEV_BSIZE; + poff = soff; + while (poff < soff + bytes) { + nb = lb - poff / DEV_BSIZE; + if (nb > READ_BUF_SIZE / DEV_BSIZE) + nb = READ_BUF_SIZE / DEV_BSIZE; + if (dskread(zbuf, poff / DEV_BSIZE, nb)) + break; + if ((poff / DEV_BSIZE + nb) * DEV_BSIZE > soff + bytes) + len = soff + bytes - poff; + else + len = (poff / DEV_BSIZE + nb) * DEV_BSIZE - poff; + memcpy(p, zbuf + poff % DEV_BSIZE, len); + p += len; + poff += len; } - if (fsread(0, NULL, 0)) { - printf("mount: can't read superblock\n"); - return (-1); + return (poff - soff); +} + +static void +loadzfs(void) +{ + Elf64_Ehdr eh; + Elf64_Phdr ph; + caddr_t p; + ino_t ino; + int i; + + if (zbread((char *)&eh, 0, sizeof(eh)) != sizeof(eh)) { + printf("Can't read elf header\n"); + return; } - return (0); + if (!IS_ELF(eh)) { + printf("Not an ELF file\n"); + return; + } + for (i = 0; i < eh.e_phnum; i++) { + fs_off = eh.e_phoff + i * eh.e_phentsize; + if (zbread((char *)&ph, fs_off, sizeof(ph)) != sizeof(ph)) { + printf("Can't read program header %d\n", i); + return; + } + if (ph.p_type != PT_LOAD) + continue; + fs_off = ph.p_offset; + p = (caddr_t)ph.p_vaddr; + if (zbread(p, fs_off, ph.p_filesz) != ph.p_filesz) { + printf("Can't read content of section %d\n", i); + return; + } + if (ph.p_filesz != ph.p_memsz) + bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); + } + ofw_close(bootdev); + (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); } +#else + +#include "ufsread.c" + +static struct dmadat __dmadat; + static void load(const char *fname) { @@ -421,6 +495,26 @@ load(const char *fname) (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); } +#endif /* ZFSBOOT */ + +static int +mount(const char *device) +{ + + if ((bootdev = ofw_open(device)) == -1) { + printf("mount: can't open device\n"); + return (-1); + } +#ifndef ZFSBOOT + dmadat = &__dmadat; + if (fsread(0, NULL, 0)) { + printf("mount: can't read superblock\n"); + return (-1); + } +#endif + return (0); +} + static int dskread(void *buf, u_int64_t lba, int nblk) { Modified: stable/8/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/loader/Makefile Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/loader/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -3,8 +3,8 @@ .include MK_SSP= no -PROG= loader -NEWVERSWHAT= "bootstrap loader" sparc64 +PROG?= loader +NEWVERSWHAT?= "bootstrap loader" sparc64 INSTALLFLAGS= -b # Architecture-specific loader code @@ -13,12 +13,17 @@ SRCS= locore.S main.c metadata.c vers.c LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes +LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no +LOADER_DEBUG?= no +.if ${LOADER_DEBUG} == "yes" +CFLAGS+= -DLOADER_DEBUG +.endif .if ${LOADER_DISK_SUPPORT} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT .endif @@ -28,6 +33,11 @@ CFLAGS+= -DLOADER_UFS_SUPPORT .if ${LOADER_CD9660_SUPPORT} == "yes" CFLAGS+= -DLOADER_CD9660_SUPPORT .endif +.if ${LOADER_ZFS_SUPPORT} == "yes" +CFLAGS+= -DLOADER_ZFS_SUPPORT +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +.endif .if ${LOADER_GZIP_SUPPORT} == "yes" CFLAGS+= -DLOADER_GZIP_SUPPORT .endif @@ -47,7 +57,8 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64 +CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl +CFLAGS+= -I${.CURDIR}/../../ficl/sparc64 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif @@ -75,8 +86,9 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} -lstand -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/loader/main.c Sat May 26 08:54:44 2012 (r236077) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LOADER_ZFS_SUPPORT +#include +#endif #include #include @@ -157,6 +160,11 @@ static vm_offset_t heapva; static phandle_t root; +#ifdef LOADER_ZFS_SUPPORT +static int zfs_dev_init(void); +#include "zfs.c" +#endif + /* * Machine dependent structures that the machine independent * loader part uses. @@ -168,6 +176,9 @@ struct devsw *devsw[] = { #ifdef LOADER_NET_SUPPORT &netdev, #endif +#ifdef LOADER_ZFS_SUPPORT + &zfs_dev, +#endif 0 }; struct arch_switch archsw; @@ -180,6 +191,7 @@ struct file_format *file_formats[] = { &sparc64_elf, 0 }; + struct fs_ops *file_system[] = { #ifdef LOADER_UFS_SUPPORT &ufs_fsops, @@ -187,6 +199,9 @@ struct fs_ops *file_system[] = { #ifdef LOADER_CD9660_SUPPORT &cd9660_fsops, #endif +#ifdef LOADER_ZFS_SUPPORT + &zfs_fsops, +#endif #ifdef LOADER_ZIP_SUPPORT &zipfs_fsops, #endif @@ -828,6 +843,82 @@ tlb_init_sun4v(void) memset(tlb_store, 0xFF, SUN4V_TLB_SLOT_MAX * sizeof(*tlb_store)); } +#ifdef LOADER_ZFS_SUPPORT + +static int +zfs_dev_init(void) +{ + struct vtoc8 vtoc; + char devname[512]; + spa_t *spa; + vdev_t *vdev; + uint64_t guid; + int fd, part, unit; + + zfs_init(); + + guid = 0; + /* Get the GUID of the ZFS pool on the boot device. */ + fd = open(getenv("currdev"), O_RDONLY); + if (fd != -1) { + if (vdev_probe(vdev_read, (void *)(uintptr_t) fd, &spa) == 0) + guid = spa->spa_guid; + close(fd); + } + + /* Clean up the environment to let ZFS work. */ + while ((vdev = STAILQ_FIRST(&zfs_vdevs)) != NULL) { + STAILQ_REMOVE_HEAD(&zfs_vdevs, v_alllink); + free(vdev); + } + while ((spa = STAILQ_FIRST(&zfs_pools)) != NULL) { + STAILQ_REMOVE_HEAD(&zfs_pools, spa_link); + free(spa); + } + + for (unit = 0; unit < MAXBDDEV; unit++) { + /* Find freebsd-zfs slices in the VTOC. */ + sprintf(devname, "disk%d:", unit); + fd = open(devname, O_RDONLY); + if (fd == -1) + continue; + lseek(fd, 0, SEEK_SET); + if (read(fd, &vtoc, sizeof(vtoc)) != sizeof(vtoc)) { + close(fd); + continue; + } + close(fd); + + for (part = 0; part < 8; part++) { + if (part == 2 || vtoc.part[part].tag != + VTOC_TAG_FREEBSD_ZFS) + continue; + sprintf(devname, "disk%d:%c", unit, part + 'a'); + fd = open(devname, O_RDONLY); + if (fd == -1) + break; + + if (vdev_probe(vdev_read, (void*)(uintptr_t) fd, 0)) + close(fd); + } + } + + if (guid != 0) { + unit = zfs_guid_to_unit(guid); + if (unit >= 0) { + /* Update the environment for ZFS. */ + sprintf(devname, "zfs%d", unit); + env_setenv("currdev", EV_VOLATILE, devname, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, devname, + env_noset, env_nounset); + } + } + return (0); +} + +#endif /* LOADER_ZFS_SUPPORT */ + int main(int (*openfirm)(void *)) { @@ -871,14 +962,6 @@ main(int (*openfirm)(void *)) mmu_ops->tlb_init(); /* - * Initialize devices. - */ - for (dp = devsw; *dp != 0; dp++) { - if ((*dp)->dv_init != 0) - (*dp)->dv_init(); - } - - /* * Set up the current device. */ OF_getprop(chosen, "bootpath", bootpath, sizeof(bootpath)); @@ -895,7 +978,8 @@ main(int (*openfirm)(void *)) * needs to be altered. */ if (bootpath[strlen(bootpath) - 2] == ':' && - bootpath[strlen(bootpath) - 1] == 'f') { + bootpath[strlen(bootpath) - 1] == 'f' && + strstr(bootpath, "cdrom")) { bootpath[strlen(bootpath) - 1] = 'a'; printf("Boot path set to %s\n", bootpath); } @@ -905,6 +989,13 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); + /* + * Initialize devices. + */ + for (dp = devsw; *dp != 0; dp++) + if ((*dp)->dv_init != 0) + (*dp)->dv_init(); + printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); Modified: stable/8/sys/boot/sparc64/zfsboot/Makefile ============================================================================== --- head/sys/boot/sparc64/zfsboot/Makefile Tue May 1 17:16:01 2012 (r234898) +++ stable/8/sys/boot/sparc64/zfsboot/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -5,9 +5,5 @@ PROGNAME= zfsboot CFLAGS+= -DZFSBOOT FILES= zfsboot -CLEANFILES+= zfsboot - -zfsboot: boot1 - ln -s ${.ALLSRC} ${.TARGET} .include "${.CURDIR}/../boot1/Makefile" Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/zfs/zfs.c Sat May 26 08:54:44 2012 (r236077) @@ -399,6 +399,7 @@ zfs_guid_to_unit(uint64_t guid) return (-1); } +#if defined(__amd64__) || defined(__i386__) static int zfs_dev_init(void) { @@ -441,6 +442,7 @@ zfs_dev_init(void) return (0); } +#endif /* * Print information about ZFS pools From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 08:58:29 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC7881065674; Sat, 26 May 2012 08:58:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5A8A8FC08; Sat, 26 May 2012 08:58:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8wT2a064226; Sat, 26 May 2012 08:58:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8wTlx064222; Sat, 26 May 2012 08:58:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260858.q4Q8wTlx064222@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236079 - in stable/8/sys: conf dev/iicbus X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:58:29 -0000 Author: marius Date: Sat May 26 08:58:29 2012 New Revision: 236079 URL: http://svn.freebsd.org/changeset/base/236079 Log: MFC: r234248 Add a driver for the NXP (Philips) PCF8563 RTC. Obtained from: NetBSD (pcf8563reg.h) Added: stable/8/sys/dev/iicbus/pcf8563.c - copied unchanged from r234248, head/sys/dev/iicbus/pcf8563.c stable/8/sys/dev/iicbus/pcf8563reg.h - copied unchanged from r234248, head/sys/dev/iicbus/pcf8563reg.h Modified: stable/8/sys/conf/files Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sat May 26 08:58:27 2012 (r236078) +++ stable/8/sys/conf/files Sat May 26 08:58:29 2012 (r236079) @@ -1007,6 +1007,7 @@ dev/iicbus/iicbus_if.m optional iicbus dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" +dev/iicbus/pcf8563.c optional pcf8563 dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci Copied: stable/8/sys/dev/iicbus/pcf8563.c (from r234248, head/sys/dev/iicbus/pcf8563.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/iicbus/pcf8563.c Sat May 26 08:58:29 2012 (r236079, copy of r234248, head/sys/dev/iicbus/pcf8563.c) @@ -0,0 +1,202 @@ +/*- + * Copyright (c) 2012 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for NXP PCF8563 real-time clock/calendar + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +#define PCF8563_NCLOCKREGS (PCF8563_R_YEAR - PCF8563_R_CS1 + 1) + +struct pcf8563_softc { + uint32_t sc_flags; +#define PCF8563_CPOL (1 << 0) /* PCF8563_R_MONTH_C means 19xx */ + uint16_t sc_addr; /* PCF8563 slave address */ + uint16_t sc_year0; /* TOD clock year 0 */ +}; + +static device_attach_t pcf8563_attach; +static device_probe_t pcf8563_probe; +static clock_gettime_t pcf8563_gettime; +static clock_settime_t pcf8563_settime; + +static int +pcf8563_probe(device_t dev) +{ + + device_set_desc(dev, "NXP PCF8563 RTC"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +pcf8563_attach(device_t dev) +{ + uint8_t reg = PCF8563_R_SECOND, val; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, sizeof(val), &val } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->sc_addr = iicbus_get_addr(dev); + if (sc->sc_addr == 0) + sc->sc_addr = PCF8563_ADDR; + + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + if ((val & PCF8563_R_SECOND_VL) != 0) { + device_printf(dev, "%s: battery low\n", __func__); + return (ENXIO); + } + + sc->sc_year0 = 1900; + clock_register(dev, 1000000); /* 1 second resolution */ + return (0); +} + +static int +pcf8563_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t reg = PCF8563_R_SECOND, val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, PCF8563_NCLOCKREGS, &val[PCF8563_R_SECOND] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + + ct.nsec = 0; + ct.sec = FROMBCD(val[PCF8563_R_SECOND] & PCF8563_M_SECOND); + ct.min = FROMBCD(val[PCF8563_R_MINUTE] & PCF8563_M_MINUTE); + ct.hour = FROMBCD(val[PCF8563_R_HOUR] & PCF8563_M_HOUR); + ct.day = FROMBCD(val[PCF8563_R_DAY] & PCF8563_M_DAY); + ct.dow = val[PCF8563_R_WEEKDAY] & PCF8563_M_WEEKDAY; + ct.mon = FROMBCD(val[PCF8563_R_MONTH] & PCF8563_M_MONTH); + ct.year = FROMBCD(val[PCF8563_R_YEAR] & PCF8563_M_YEAR); + ct.year += sc->sc_year0; + if (ct.year < POSIX_BASE_YEAR) + ct.year += 100; /* assume [1970, 2069] */ + if ((val[PCF8563_R_MONTH] & PCF8563_R_MONTH_C) != 0) { + if (ct.year >= 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + } else if (ct.year < 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + return (clock_ct_to_ts(&ct, ts)); +} + +static int +pcf8563_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, PCF8563_NCLOCKREGS - 1, &val[PCF8563_R_CS2] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + val[PCF8563_R_CS2] = PCF8563_R_SECOND; /* abuse */ + /* Accuracy is only one second. */ + if (ts->tv_nsec >= 500000000) + ts->tv_sec++; + ts->tv_nsec = 0; + clock_ts_to_ct(ts, &ct); + val[PCF8563_R_SECOND] = TOBCD(ct.sec); + val[PCF8563_R_MINUTE] = TOBCD(ct.min); + val[PCF8563_R_HOUR] = TOBCD(ct.hour); + val[PCF8563_R_DAY] = TOBCD(ct.day); + val[PCF8563_R_WEEKDAY] = ct.dow; + val[PCF8563_R_MONTH] = TOBCD(ct.mon); + val[PCF8563_R_YEAR] = TOBCD(ct.year % 100); + if ((sc->sc_flags & PCF8563_CPOL) != 0) { + if (ct.year >= 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + } else if (ct.year < 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + + msgs[0].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) + device_printf(dev, "%s: cannot write RTC\n", __func__); + return (error); +} + +static device_method_t pcf8563_methods[] = { + DEVMETHOD(device_probe, pcf8563_probe), + DEVMETHOD(device_attach, pcf8563_attach), + + DEVMETHOD(clock_gettime, pcf8563_gettime), + DEVMETHOD(clock_settime, pcf8563_settime), + + DEVMETHOD_END +}; + +static driver_t pcf8563_driver = { + "pcf8563_rtc", + pcf8563_methods, + sizeof(struct pcf8563_softc), +}; + +static devclass_t pcf8563_devclass; + +DRIVER_MODULE(pcf8563, iicbus, pcf8563_driver, pcf8563_devclass, NULL, NULL); +MODULE_VERSION(pcf8563, 1); +MODULE_DEPEND(pcf8563, iicbus, 1, 1, 1); Copied: stable/8/sys/dev/iicbus/pcf8563reg.h (from r234248, head/sys/dev/iicbus/pcf8563reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/iicbus/pcf8563reg.h Sat May 26 08:58:29 2012 (r236079, copy of r234248, head/sys/dev/iicbus/pcf8563reg.h) @@ -0,0 +1,58 @@ +/* $NetBSD: pcf8563reg.h,v 1.1 2011/01/21 19:11:47 jakllsch Exp $ */ + +/*- + * Jonathan Kollasch, 2011 + * + * This file is in the public domain. + * + * $FreeBSD$ + */ + +/* + * NXP (Philips) PCF8563 RTC registers + */ + +/* We only have clock mode registers here. */ + +#ifndef _PCF8563REG_H_ +#define _PCF8563REG_H_ + +/* + * PCF8563 RTC I2C address: + * + * 101 0001 + */ +#define PCF8563_ADDR 0xa2 + +#define PCF8563_R_CS1 0x00 +#define PCF8563_R_CS2 0x01 +#define PCF8563_R_SECOND 0x02 +#define PCF8563_R_MINUTE 0x03 +#define PCF8563_R_HOUR 0x04 +#define PCF8563_R_DAY 0x05 +#define PCF8563_R_WEEKDAY 0x06 +#define PCF8563_R_MONTH 0x07 +#define PCF8563_R_YEAR 0x08 +#define PCF8563_R_MINUTE_ALARM 0x09 +#define PCF8563_R_HOUR_ALARM 0x0a +#define PCF8563_R_DAY_ALARM 0x0b +#define PCF8563_R_WEEKDAY_ALARM 0x0c +#define PCF8563_R_CLKOUT_CNTRL 0x0d +#define PCF8563_R_TIMER_CNTRL 0x0e +#define PCF8563_R_TIMER 0x0f + +#define PCF8563_R_SECOND_VL 0x80 +#define PCF8563_R_MONTH_C 0x80 + +#define PCF8563_NREGS 0x10 + +#define PCF8563_M_SECOND 0x7f +#define PCF8563_M_MINUTE 0x7f +#define PCF8563_M_HOUR 0x3f +#define PCF8563_M_DAY 0x3f +#define PCF8563_M_WEEKDAY 0x07 +#define PCF8563_M_MONTH 0x1f +#define PCF8563_M_CENTURY 0x80 +#define PCF8563_M_YEAR 0xff + +#endif /* _PCF8563REG_H_ */ From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 09:08:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 572D4106566B; Sat, 26 May 2012 09:08:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41D578FC0C; Sat, 26 May 2012 09:08:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q98YUo064893; Sat, 26 May 2012 09:08:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q98Y3P064891; Sat, 26 May 2012 09:08:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260908.q4Q98Y3P064891@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236083 - stable/8/sys/arm/at91 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:08:34 -0000 Author: marius Date: Sat May 26 09:08:33 2012 New Revision: 236083 URL: http://svn.freebsd.org/changeset/base/236083 Log: MFC: r234293 Generate an obviously missing STOP when having finished transmitting data. This fixes communication with PCF8563. Modified: stable/8/sys/arm/at91/at91_twi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/arm/at91/at91_twi.c ============================================================================== --- stable/8/sys/arm/at91/at91_twi.c Sat May 26 09:08:30 2012 (r236082) +++ stable/8/sys/arm/at91/at91_twi.c Sat May 26 09:08:33 2012 (r236083) @@ -364,6 +364,7 @@ at91_twi_transfer(device_t dev, struct i goto out; WR4(sc, TWI_THR, *buf++); } + WR4(sc, TWI_CR, TWI_CR_STOP); } if ((err = at91_twi_wait(sc, TWI_SR_TXCOMP))) break; From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 09:13:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89B30106579F; Sat, 26 May 2012 09:13:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74F728FC15; Sat, 26 May 2012 09:13:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q9Ddwb065268; Sat, 26 May 2012 09:13:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9DdID065266; Sat, 26 May 2012 09:13:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260913.q4Q9DdID065266@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236086 - stable/8/sys/arm/arm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:13:39 -0000 Author: marius Date: Sat May 26 09:13:38 2012 New Revision: 236086 URL: http://svn.freebsd.org/changeset/base/236086 Log: MFC: r234561 Interrupts must be disabled while handling a partial cache line flush, as otherwise the interrupt handling code may modify data in the non-DMA part of the cache line while we have it stashed away in the temporary stack buffer, then we end up restoring a stale value. PR: 160431 Submitted by: Ian Lepore Modified: stable/8/sys/arm/arm/busdma_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/8/sys/arm/arm/busdma_machdep.c Sat May 26 09:13:24 2012 (r236085) +++ stable/8/sys/arm/arm/busdma_machdep.c Sat May 26 09:13:38 2012 (r236086) @@ -1091,14 +1091,16 @@ static void bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op) { char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align]; + register_t s; + int partial; if ((op & BUS_DMASYNC_PREWRITE) && !(op & BUS_DMASYNC_PREREAD)) { cpu_dcache_wb_range((vm_offset_t)buf, len); cpu_l2cache_wb_range((vm_offset_t)buf, len); } + partial = (((vm_offset_t)buf) | len) & arm_dcache_align_mask; if (op & BUS_DMASYNC_PREREAD) { - if (!(op & BUS_DMASYNC_PREWRITE) && - ((((vm_offset_t)(buf) | len) & arm_dcache_align_mask) == 0)) { + if (!(op & BUS_DMASYNC_PREWRITE) && !partial) { cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); } else { @@ -1107,27 +1109,32 @@ bus_dmamap_sync_buf(void *buf, int len, } } if (op & BUS_DMASYNC_POSTREAD) { - if ((vm_offset_t)buf & arm_dcache_align_mask) { - memcpy(_tmp_cl, (void *)((vm_offset_t)buf & ~ - arm_dcache_align_mask), - (vm_offset_t)buf & arm_dcache_align_mask); - } - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) { - memcpy(_tmp_clend, (void *)((vm_offset_t)buf + len), - arm_dcache_align - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + if (partial) { + s = intr_disable(); + if ((vm_offset_t)buf & arm_dcache_align_mask) + memcpy(_tmp_cl, (void *)((vm_offset_t)buf & + ~arm_dcache_align_mask), + (vm_offset_t)buf & arm_dcache_align_mask); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + memcpy(_tmp_clend, + (void *)((vm_offset_t)buf + len), + arm_dcache_align - (((vm_offset_t)(buf) + + len) & arm_dcache_align_mask)); } cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); - - if ((vm_offset_t)buf & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf & - ~arm_dcache_align_mask), _tmp_cl, - (vm_offset_t)buf & arm_dcache_align_mask); - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf + len), _tmp_clend, - arm_dcache_align - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + if (partial) { + if ((vm_offset_t)buf & arm_dcache_align_mask) + memcpy((void *)((vm_offset_t)buf & + ~arm_dcache_align_mask), _tmp_cl, + (vm_offset_t)buf & arm_dcache_align_mask); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + memcpy((void *)((vm_offset_t)buf + len), + _tmp_clend, arm_dcache_align - + (((vm_offset_t)(buf) + len) & + arm_dcache_align_mask)); + intr_restore(s); + } } } From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 09:31:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D55C1065672; Sat, 26 May 2012 09:31:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55F648FC08; Sat, 26 May 2012 09:31:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q9VQVV066174; Sat, 26 May 2012 09:31:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9VQTO066167; Sat, 26 May 2012 09:31:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260931.q4Q9VQTO066167@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236090 - in stable/8/sys: dev/mmc modules/mmcsd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:31:26 -0000 Author: marius Date: Sat May 26 09:31:25 2012 New Revision: 236090 URL: http://svn.freebsd.org/changeset/base/236090 Log: MFC: r234524 o Fixes: - When switching to 4-bit operation, send a SET_CLR_CARD_DETECT command to disconnect the card-detect pull-up resistor from the DAT3 line before sending the SET_BUS_WIDTH command. - Add the missing "reserved" zero entry to the mantissa table used to decode various CSD fields. This was causing SD cards to report that they could run at 30 MHz instead of the maximum 25 MHz mandated in the spec. o Enhancements: - At the MMC layer, format various info from the CID into a string that uniquely identifies the card instance (manufacturer number, serial number, product name and revision, etc). Export it as an instance variable. - At the MMCSD layer, display the formatted card ID string, and also report the clock speed of the hardware (not the card's max speed), and the number of bits and number of blocks per transfer. It comes out like this now: mmcsd0: 968MB at mmc0 22.5MHz/4bit/128-block o Use DEVMETHOD_END. o Use NULL instead of 0 for pointers. PR: 156496 Submitted by: Ian Lepore Modified: stable/8/sys/dev/mmc/mmc.c stable/8/sys/dev/mmc/mmcbrvar.h stable/8/sys/dev/mmc/mmcreg.h stable/8/sys/dev/mmc/mmcsd.c stable/8/sys/dev/mmc/mmcvar.h stable/8/sys/modules/mmcsd/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/mmc/mmc.c ============================================================================== --- stable/8/sys/dev/mmc/mmc.c Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmc.c Sat May 26 09:31:25 2012 (r236090) @@ -101,6 +101,7 @@ struct mmc_ivars { uint32_t tran_speed; /* Max speed in normal mode */ uint32_t hs_tran_speed; /* Max speed in high speed mode */ uint32_t erase_sector; /* Card native erase sector size */ + char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */ }; #define CMD_RETRIES 3 @@ -140,6 +141,7 @@ static void mmc_app_decode_scr(uint32_t static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); static void mmc_scan(struct mmc_softc *sc); static int mmc_delete_cards(struct mmc_softc *sc); +static void mmc_format_card_id_string(struct mmc_ivars *ivar); static void mmc_ms_delay(int ms) @@ -606,6 +608,13 @@ mmc_set_card_bus_width(struct mmc_softc if (mmcbr_get_mode(sc->dev) == mode_sd) { memset(&cmd, 0, sizeof(struct mmc_command)); + cmd.opcode = ACMD_SET_CLR_CARD_DETECT; + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + cmd.arg = SD_CLR_CARD_DETECT; + err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES); + if (err != 0) + return (err); + memset(&cmd, 0, sizeof(struct mmc_command)); cmd.opcode = ACMD_SET_BUS_WIDTH; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; switch (width) { @@ -788,15 +797,52 @@ mmc_decode_cid_mmc(uint32_t *raw_cid, st cid->mdt_year = mmc_get_bits(raw_cid, 128, 8, 4) + 1997; } +static void +mmc_format_card_id_string(struct mmc_ivars *ivar) +{ + char oidstr[8]; + uint8_t c1; + uint8_t c2; + + /* + * Format a card ID string for use by the mmcsd driver, it's what + * appears between the <> in the following: + * mmcsd0: 968MB at mmc0 + * 22.5MHz/4bit/128-block + * + * The card_id_string in mmc_ivars is currently allocated as 64 bytes, + * and our max formatted length is currently 55 bytes if every field + * contains the largest value. + * + * Sometimes the oid is two printable ascii chars; when it's not, + * format it as 0xnnnn instead. + */ + c1 = (ivar->cid.oid >> 8) & 0x0ff; + c2 = ivar->cid.oid & 0x0ff; + if (c1 > 0x1f && c1 < 0x7f && c2 > 0x1f && c2 < 0x7f) + snprintf(oidstr, sizeof(oidstr), "%c%c", c1, c2); + else + snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); + snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), + "%s%s %s %d.%d SN %d MFG %02d/%04d by %d %s", + ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", + ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, + ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, + ivar->cid.mid, oidstr); +} + static const int exp[8] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 }; + static const int mant[16] = { - 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 + 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 }; + static const int cur_min[8] = { 500, 1000, 5000, 10000, 25000, 35000, 60000, 100000 }; + static const int cur_max[8] = { 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 }; @@ -1080,13 +1126,7 @@ mmc_log_card(device_t dev, struct mmc_iv { device_printf(dev, "Card at relative address %d%s:\n", ivar->rca, newcard ? " added" : ""); - device_printf(dev, " card: %s%s (0x%x/0x%x/\"%s\" rev %d.%d " - "m/d %02d.%04d s/n %08x)\n", - ivar->mode == mode_sd ? "SD" : "MMC", - ivar->high_cap ? " High Capacity" : "", - ivar->cid.mid, ivar->cid.oid, - ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, - ivar->cid.mdt_month, ivar->cid.mdt_year, ivar->cid.psn); + device_printf(dev, " card: %s\n", ivar->card_id_string); device_printf(dev, " bus: %ubit, %uMHz%s\n", (ivar->bus_width == bus_width_1 ? 1 : (ivar->bus_width == bus_width_4 ? 4 : 8)), @@ -1188,6 +1228,7 @@ mmc_discover_cards(struct mmc_softc *sc) if ((mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) ivar->bus_width = bus_width_4; + mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) mmc_log_card(sc->dev, ivar, newcard); if (newcard) { @@ -1245,6 +1286,7 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->bus_width = bus_width_1; ivar->timing = bus_timing_normal; } + mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) mmc_log_card(sc->dev, ivar, newcard); if (newcard) { @@ -1477,6 +1519,9 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_MAX_DATA: *result = mmcbr_get_max_data(bus); break; + case MMC_IVAR_CARD_ID_STRING: + *(char **)result = ivar->card_id_string; + break; } return (0); } @@ -1527,7 +1572,7 @@ static device_method_t mmc_methods[] = { DEVMETHOD(mmcbus_acquire_bus, mmc_acquire_bus), DEVMETHOD(mmcbus_release_bus, mmc_release_bus), - {0, 0}, + DEVMETHOD_END }; static driver_t mmc_driver = { @@ -1537,6 +1582,5 @@ static driver_t mmc_driver = { }; static devclass_t mmc_devclass; - DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, NULL, NULL); Modified: stable/8/sys/dev/mmc/mmcbrvar.h ============================================================================== --- stable/8/sys/dev/mmc/mmcbrvar.h Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcbrvar.h Sat May 26 09:31:25 2012 (r236090) @@ -56,6 +56,7 @@ #define DEV_MMC_MMCBRVAR_H #include +#include #include "mmcbr_if.h" enum mmcbr_device_ivars { @@ -72,8 +73,7 @@ enum mmcbr_device_ivars { MMCBR_IVAR_VDD, MMCBR_IVAR_CAPS, MMCBR_IVAR_TIMING, - MMCBR_IVAR_MAX_DATA, -// MMCBR_IVAR_, + MMCBR_IVAR_MAX_DATA }; /* Modified: stable/8/sys/dev/mmc/mmcreg.h ============================================================================== --- stable/8/sys/dev/mmc/mmcreg.h Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcreg.h Sat May 26 09:31:25 2012 (r236090) @@ -139,8 +139,8 @@ struct mmc_command { #define R1_READY_FOR_DATA (1u << 8) /* sx, a */ #define R1_APP_CMD (1u << 5) /* sr, c */ #define R1_AKE_SEQ_ERROR (1u << 3) /* er, c */ -#define R1_STATUS(x) (x & 0xFFFFE000 -#define R1_CURRENT_STATE(x) ((x) & R1_CURRENT_STATE_MASK) >> 9 +#define R1_STATUS(x) ((x) & 0xFFFFE000) +#define R1_CURRENT_STATE(x) (((x) & R1_CURRENT_STATE_MASK) >> 9) #define R1_STATE_IDLE 0 #define R1_STATE_READY 1 #define R1_STATE_IDENT 2 @@ -330,6 +330,9 @@ struct mmc_request { #define SD_SWITCH_HS_MODE 1 #define SD_SWITCH_NOCHANGE 0xF +#define SD_CLR_CARD_DETECT 0 +#define SD_SET_CARD_DETECT 1 + #define SD_MAX_HS 50000000 /* OCR bits */ @@ -380,7 +383,7 @@ struct mmc_cid { uint8_t fwrev; }; -struct mmc_csd +struct mmc_csd { uint8_t csd_structure; uint8_t spec_vers; Modified: stable/8/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/8/sys/dev/mmc/mmcsd.c Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcsd.c Sat May 26 09:31:25 2012 (r236090) @@ -66,11 +66,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include +#include #include "mmcbus_if.h" +#if __FreeBSD_version < 800002 +#define kproc_create kthread_create +#define kproc_exit kthread_exit +#endif + struct mmcsd_softc { device_t dev; struct mtx sc_mtx; @@ -95,7 +101,6 @@ static int mmcsd_dump(void *arg, void *v off_t offset, size_t length); static void mmcsd_task(void *arg); -static const char *mmcsd_card_name(device_t dev); static int mmcsd_bus_bit_width(device_t dev); #define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -122,6 +127,8 @@ mmcsd_attach(device_t dev) struct mmcsd_softc *sc; struct disk *d; intmax_t mb; + uint32_t speed; + uint32_t maxblocks; char unit; sc = device_get_softc(dev); @@ -157,11 +164,22 @@ mmcsd_attach(device_t dev) unit = 'G'; mb /= 1024; } - device_printf(dev, "%ju%cB <%s Memory Card>%s at %s %dMHz/%dbit\n", - mb, unit, mmcsd_card_name(dev), + /* + * Report the clock speed of the underlying hardware, which might be + * different than what the card reports due to hardware limitations. + * Report how many blocks the hardware transfers at once, but clip the + * number to MAXPHYS since the system won't initiate larger transfers. + */ + speed = mmcbr_get_clock(device_get_parent(dev)); + maxblocks = mmc_get_max_data(dev); + if (maxblocks > MAXPHYS) + maxblocks = MAXPHYS; + device_printf(dev, "%ju%cB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", + mb, unit, mmc_get_card_id_string(dev), mmc_get_read_only(dev) ? " (read-only)" : "", device_get_nameunit(device_get_parent(dev)), - mmc_get_tran_speed(dev) / 1000000, mmcsd_bus_bit_width(dev)); + speed / 1000000, (speed / 100000) % 10, + mmcsd_bus_bit_width(dev), maxblocks); disk_create(d, DISK_VERSION); bioq_init(&sc->bio_queue); @@ -500,16 +518,6 @@ out: kproc_exit(0); } -static const char * -mmcsd_card_name(device_t dev) -{ - if (mmc_get_card_type(dev) == mode_mmc) - return ("MMC"); - if (mmc_get_high_cap(dev)) - return ("SDHC"); - return ("SD"); -} - static int mmcsd_bus_bit_width(device_t dev) { @@ -526,7 +534,7 @@ static device_method_t mmcsd_methods[] = DEVMETHOD(device_detach, mmcsd_detach), DEVMETHOD(device_suspend, mmcsd_suspend), DEVMETHOD(device_resume, mmcsd_resume), - {0, 0}, + DEVMETHOD_END }; static driver_t mmcsd_driver = { @@ -536,4 +544,4 @@ static driver_t mmcsd_driver = { }; static devclass_t mmcsd_devclass; -DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_devclass, 0, 0); +DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_devclass, NULL, NULL); Modified: stable/8/sys/dev/mmc/mmcvar.h ============================================================================== --- stable/8/sys/dev/mmc/mmcvar.h Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcvar.h Sat May 26 09:31:25 2012 (r236090) @@ -69,7 +69,7 @@ enum mmc_device_ivars { MMC_IVAR_BUS_WIDTH, MMC_IVAR_ERASE_SECTOR, MMC_IVAR_MAX_DATA, -// MMC_IVAR_, + MMC_IVAR_CARD_ID_STRING }; /* @@ -89,5 +89,6 @@ MMC_ACCESSOR(card_type, CARD_TYPE, int) MMC_ACCESSOR(bus_width, BUS_WIDTH, int) MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int) MMC_ACCESSOR(max_data, MAX_DATA, int) +MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *) #endif /* DEV_MMC_MMCVAR_H */ Modified: stable/8/sys/modules/mmcsd/Makefile ============================================================================== --- stable/8/sys/modules/mmcsd/Makefile Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/modules/mmcsd/Makefile Sat May 26 09:31:25 2012 (r236090) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/mmc KMOD= mmcsd -SRCS= mmcsd.c mmcbus_if.h device_if.h bus_if.h +SRCS= bus_if.h device_if.h mmcbr_if.h mmcbus_if.h mmcsd.c .include From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 10:24:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AFE5106564A; Sat, 26 May 2012 10:24:36 +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 147598FC08; Sat, 26 May 2012 10:24:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QAOZ18072179; Sat, 26 May 2012 10:24:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QAOZWK072176; Sat, 26 May 2012 10:24:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205261024.q4QAOZWK072176@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 10:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236092 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 10:24:36 -0000 Author: bz Date: Sat May 26 10:24:35 2012 New Revision: 236092 URL: http://svn.freebsd.org/changeset/base/236092 Log: MFC r235474: Switch to a standard 2 clause BSD license (from bsd-style-copyright). Approved by: Myricom Inc. (gallatin) Approved by: Intel Corporation (jfv) Modified: stable/8/sys/netinet/tcp_lro.c stable/8/sys/netinet/tcp_lro.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_lro.c ============================================================================== --- stable/8/sys/netinet/tcp_lro.c Sat May 26 10:24:30 2012 (r236091) +++ stable/8/sys/netinet/tcp_lro.c Sat May 26 10:24:35 2012 (r236092) @@ -1,37 +1,31 @@ -/****************************************************************************** - -Copyright (c) 2007, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 3. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -$FreeBSD$ -***************************************************************************/ +/*- + * Copyright (c) 2007, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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 Modified: stable/8/sys/netinet/tcp_lro.h ============================================================================== --- stable/8/sys/netinet/tcp_lro.h Sat May 26 10:24:30 2012 (r236091) +++ stable/8/sys/netinet/tcp_lro.h Sat May 26 10:24:35 2012 (r236092) @@ -1,39 +1,32 @@ -/******************************************************************************* +/*- + * Copyright (c) 2006, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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$ + */ -Copyright (c) 2006, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 2. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -$FreeBSD$ - -***************************************************************************/ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ From owner-svn-src-stable-8@FreeBSD.ORG Sat May 26 23:10:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF95910657EB; Sat, 26 May 2012 23:10:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA2C18FC16; Sat, 26 May 2012 23:10:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QNAanE012328; Sat, 26 May 2012 23:10:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNAaL0012326; Sat, 26 May 2012 23:10:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205262310.q4QNAaL0012326@svn.freebsd.org> From: Alan Cox Date: Sat, 26 May 2012 23:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236127 - stable/8/sys/i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:10:36 -0000 Author: alc Date: Sat May 26 23:10:36 2012 New Revision: 236127 URL: http://svn.freebsd.org/changeset/base/236127 Log: MFC r228513 Create large page mappings in pmap_map(). Modified: stable/8/sys/i386/i386/pmap.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Sat May 26 23:10:21 2012 (r236126) +++ stable/8/sys/i386/i386/pmap.c Sat May 26 23:10:36 2012 (r236127) @@ -1424,12 +1424,40 @@ vm_offset_t pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { vm_offset_t va, sva; + vm_paddr_t superpage_offset; + pd_entry_t newpde; - va = sva = *virt; + va = *virt; + /* + * Does the physical address range's size and alignment permit at + * least one superpage mapping to be created? + */ + superpage_offset = start & PDRMASK; + if ((end - start) - ((NBPDR - superpage_offset) & PDRMASK) >= NBPDR) { + /* + * Increase the starting virtual address so that its alignment + * does not preclude the use of superpage mappings. + */ + if ((va & PDRMASK) < superpage_offset) + va = (va & ~PDRMASK) + superpage_offset; + else if ((va & PDRMASK) > superpage_offset) + va = ((va + PDRMASK) & ~PDRMASK) + superpage_offset; + } + sva = va; while (start < end) { - pmap_kenter(va, start); - va += PAGE_SIZE; - start += PAGE_SIZE; + if ((start & PDRMASK) == 0 && end - start >= NBPDR && + pseflag) { + KASSERT((va & PDRMASK) == 0, + ("pmap_map: misaligned va %#x", va)); + newpde = start | PG_PS | pgeflag | PG_RW | PG_V; + pmap_kenter_pde(va, newpde); + va += NBPDR; + start += NBPDR; + } else { + pmap_kenter(va, start); + va += PAGE_SIZE; + start += PAGE_SIZE; + } } pmap_invalidate_range(kernel_pmap, sva, va); *virt = va;