From owner-svn-src-stable-9@FreeBSD.ORG Sun Dec 2 00:31:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D430B785; Sun, 2 Dec 2012 00:31:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C7178FC08; Sun, 2 Dec 2012 00:31:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB20VNBq031792; Sun, 2 Dec 2012 00:31:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB20VNrG031791; Sun, 2 Dec 2012 00:31:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212020031.qB20VNrG031791@svn.freebsd.org> From: Dimitry Andric Date: Sun, 2 Dec 2012 00:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243781 - stable/9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2012 00:31:23 -0000 Author: dim Date: Sun Dec 2 00:31:23 2012 New Revision: 243781 URL: http://svnweb.freebsd.org/changeset/base/243781 Log: Pull in r158245 from upstream clang: [C++11 Compat] Fix breaking change in C++11 pair copyctor. While this code is valid C++98, it is not valid C++11. The problem can be reduced to: class MDNode; class DIType { operator MDNode*() const {return 0;} }; class WeakVH { WeakVH(MDNode*) {} }; int main() { DIType di; std::pair p(std::make_pair((void*)0, di))); } This was not detected by any of the bots we have because they either compile C++98 with libstdc++ (which allows it), or C++11 with libc++ (which incorrectly allows it). I ran into the problem when compiling with VS 2012 RC. Thanks to Richard for explaining the issue. This fixes building clang 3.1 on stable/9 with libc++ in C++11 mode. This is a direct commit to stable/9, since there is no separate commit in head which has just this particular change, and I do not want to do a full import at this time. Reported by: Marco Bröder Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Sat Dec 1 22:13:38 2012 (r243780) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Sun Dec 2 00:31:23 2012 (r243781) @@ -1692,7 +1692,8 @@ llvm::DIType CGDebugInfo::getOrCreateTyp llvm::DIType TC = getTypeOrNull(Ty); if (TC.Verify() && TC.isForwardDecl()) - ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), TC)); + ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), + static_cast(TC))); // And update the type cache. TypeCache[Ty.getAsOpaquePtr()] = Res; @@ -1803,7 +1804,8 @@ llvm::DIType CGDebugInfo::getOrCreateLim llvm::DIType Res = CreateLimitedTypeNode(Ty, Unit); if (T.Verify() && T.isForwardDecl()) - ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), T)); + ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), + static_cast(T))); // And update the type cache. TypeCache[Ty.getAsOpaquePtr()] = Res; From owner-svn-src-stable-9@FreeBSD.ORG Sun Dec 2 12:26:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51549DDD; Sun, 2 Dec 2012 12:26:18 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 338FB8FC08; Sun, 2 Dec 2012 12:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB2CQILb065305; Sun, 2 Dec 2012 12:26:18 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB2CQI8R065304; Sun, 2 Dec 2012 12:26:18 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201212021226.qB2CQI8R065304@svn.freebsd.org> From: Isabell Long Date: Sun, 2 Dec 2012 12:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243788 - stable/9/usr.sbin/wpa/wpa_supplicant X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2012 12:26:18 -0000 Author: issyl0 (doc committer) Date: Sun Dec 2 12:26:17 2012 New Revision: 243788 URL: http://svnweb.freebsd.org/changeset/base/243788 Log: MFC r242696 from HEAD: Document all of the options that wpa_supplicant accepts. PR: docs/171755 Approved by: gabor (mentor) Modified: stable/9/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Directory Properties: stable/9/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: stable/9/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 ============================================================================== --- stable/9/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Sun Dec 2 06:50:27 2012 (r243787) +++ stable/9/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Sun Dec 2 12:26:17 2012 (r243788) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2008 +.Dd November 7, 2012 .Dt WPA_SUPPLICANT 8 .Os .Sh NAME @@ -32,9 +32,26 @@ .Nd "WPA/802.11i Supplicant for wireless network devices" .Sh SYNOPSIS .Nm -.Op Fl BdehLqsvw +.Op Fl BdhKLqstuvW +.Op Fl b Ar br_ifname +.Fl c Ar config-file +.Op Fl C Ar ctrl +.Op Fl D Ar driver +.Op Fl f Ar debug file +.Op Fl g Ar global ctrl +.Fl i Ar ifname +.Op Fl o Ar override driver +.Op Fl O Ar override ctrl +.Op Fl P Ar pid file +.Oo Fl N .Fl i Ar ifname .Fl c Ar config-file +.Op Fl C Ar ctrl +.Op Fl D driver +.Op Fl p Ar driver_param +.Op Fl b Ar br_ifname +.No ... +.Oc .Sh DESCRIPTION The .Nm @@ -87,15 +104,36 @@ utility, using .Sh OPTIONS The following options are available: .Bl -tag -width indent +.It Fl b +Optional bridge interface name. +.It Fl B +Detach from the controlling terminal and run as a daemon process +in the background. .It Fl d Enable debugging messages. If this option is supplied twice, more verbose messages are displayed. -.It Fl e -Use an external IEEE 802.1X Supplicant program and disable the -internal Supplicant. -This option is not normally used. +.It Fl D +Driver name (can be multiple drivers: nl80211,wext). +.It Fl f +Log output to debug file instead of stdout. +.It Fl g +Global ctrl_interface. .It Fl h Show help text. +.It Fl K +Include key information in debugging output. +.It Fl L +Display the license for this program on the terminal and exit. +.It Fl N +Start describing a new interface. +.It Fl o +Overrides driver parameter for new interfaces. +.It Fl O +Override ctrl_interface parameter for new interfaces. +.It Fl p +Specify driver parameters. +.It Fl P +File in which to save the process PID. .It Fl q Decrease debugging verbosity (i.e., counteract the use of the .Fl d @@ -104,23 +142,14 @@ flag). Send log messages through .Xr syslog 3 instead of to the terminal. +.It Fl t +Include timestamp in debug messages. +.It Fl u +Enable DBus control interface. .It Fl v Display version information on the terminal and exit. -.It Fl w -If the specified interface is not present, wait for it to be -added; e.g.\& a cardbus device to be inserted. -This option is not normally used; instead, -.Xr devd 8 -should be configured to launch -.Nm -when a device is created. -.It Fl B -Detach from the controlling terminal and run as a daemon process -in the background. -.It Fl K -Include key information in debugging output. -.It Fl L -Display the license for this program on the terminal and exit. +.It Fl W +Wait for a control interface monitor before starting. .El .Sh SEE ALSO .Xr an 4 , From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 01:02:21 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DFA6BA5; Mon, 3 Dec 2012 01:02:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41FEB8FC08; Mon, 3 Dec 2012 01:02:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB312Ll3001211; Mon, 3 Dec 2012 01:02:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB312Lou001210; Mon, 3 Dec 2012 01:02:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212030102.qB312Lou001210@svn.freebsd.org> From: Eitan Adler Date: Mon, 3 Dec 2012 01:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243803 - stable/9/share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 01:02:21 -0000 Author: eadler Date: Mon Dec 3 01:02:20 2012 New Revision: 243803 URL: http://svnweb.freebsd.org/changeset/base/243803 Log: MFC r243155: Correct spelling of "lily" [0] Correct spelling of Camellia PR: misc/173655 [0] Approved by: cperciva (implicit) Modified: stable/9/share/misc/flowers (contents, props changed) Directory Properties: stable/9/share/misc/ (props changed) Modified: stable/9/share/misc/flowers ============================================================================== --- stable/9/share/misc/flowers Sun Dec 2 22:21:40 2012 (r243802) +++ stable/9/share/misc/flowers Mon Dec 3 01:02:20 2012 (r243803) @@ -6,7 +6,7 @@ African violet:Such worth is rare. Apple blossom:Preference. Bachelor's button:Celibacy. Bay leaf:I change but in death. -Camelia:Reflected loveliness. +Camellia:Reflected loveliness. Chrysanthemum, other color:Slighted love. Chrysanthemum, red:I love. Chrysanthemum, white:Truth. @@ -21,8 +21,8 @@ Ivy:Friendship, fidelity, marriage. Jasmine:Amiability, transports of joy, sensuality. Leaves (dead):Melancholy. Lilac:Youthful innocence. -Lilly of the valley:Return of happiness. -Lilly:Purity, sweetness. +Lily of the valley:Return of happiness. +Lily:Purity, sweetness. Magnolia:Dignity, perseverance. Marigold:Jealousy. Mint:Virtue. From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:01:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09D6EAFF; Mon, 3 Dec 2012 18:01:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E16E18FC15; Mon, 3 Dec 2012 18:01:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3I1rPF095591; Mon, 3 Dec 2012 18:01:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3I1rP8095590; Mon, 3 Dec 2012 18:01:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031801.qB3I1rP8095590@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243809 - stable/9/sys/libkern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:01:54 -0000 Author: delphij Date: Mon Dec 3 18:01:53 2012 New Revision: 243809 URL: http://svnweb.freebsd.org/changeset/base/243809 Log: MFC r242506: Sync strlen with userland implementation. Modified: stable/9/sys/libkern/strlen.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/libkern/strlen.c ============================================================================== --- stable/9/sys/libkern/strlen.c Mon Dec 3 05:03:33 2012 (r243808) +++ stable/9/sys/libkern/strlen.c Mon Dec 3 18:01:53 2012 (r243809) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2009, 2010 Xin LI + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +10,11 @@ * 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. - * 4. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -31,14 +28,102 @@ __FBSDID("$FreeBSD$"); #include +#include + +/* + * Portable strlen() for 32-bit and 64-bit systems. + * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * + * The expression: + * + * ((x - 0x01....01) & ~x & 0x80....80) + * + * would evaluate to a non-zero value iff any of the bytes in the + * original word is zero. + * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * + * The algorithm above is found on "Hacker's Delight" by + * Henry S. Warren, Jr. + */ + +/* Magic numbers for the algorithm */ +#if LONG_BIT == 32 +static const unsigned long mask01 = 0x01010101; +static const unsigned long mask80 = 0x80808080; +#elif LONG_BIT == 64 +static const unsigned long mask01 = 0x0101010101010101; +static const unsigned long mask80 = 0x8080808080808080; +#else +#error Unsupported word size +#endif + +#define LONGPTR_MASK (sizeof(long) - 1) + +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t -strlen(str) - const char *str; +strlen(const char *str) { - register const char *s; + const char *p; + const unsigned long *lp; + long va, vb; - for (s = str; *s; ++s); - return(s - str); -} + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ + for (; ; lp++) { + va = (*lp - mask01); + vb = ((~*lp) & mask80); + if (va & vb) { + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif + } + } + + /* NOTREACHED */ + return (0); +} From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:08:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71C55E88; Mon, 3 Dec 2012 18:08:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5376B8FC19; Mon, 3 Dec 2012 18:08:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3I8j3l097654; Mon, 3 Dec 2012 18:08:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3I8jN1097653; Mon, 3 Dec 2012 18:08:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031808.qB3I8jN1097653@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243811 - stable/9/sys/libkern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:08:45 -0000 Author: delphij Date: Mon Dec 3 18:08:44 2012 New Revision: 243811 URL: http://svnweb.freebsd.org/changeset/base/243811 Log: MFC r242507: Sync strlcpy with userland version. Modified: stable/9/sys/libkern/strlcpy.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/libkern/strlcpy.c ============================================================================== --- stable/9/sys/libkern/strlcpy.c Mon Dec 3 18:03:06 2012 (r243810) +++ stable/9/sys/libkern/strlcpy.c Mon Dec 3 18:08:44 2012 (r243811) @@ -1,35 +1,21 @@ -/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ /*- * Copyright (c) 1998 Todd C. Miller - * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * 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. * - * THIS SOFTWARE IS PROVIDED ``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 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. + * 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. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -41,21 +27,19 @@ __FBSDID("$FreeBSD$"); * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ -size_t strlcpy(dst, src, siz) - char *dst; - const char *src; - size_t siz; +size_t +strlcpy(char * __restrict dst, const char * __restrict src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) + if (n != 0) { + while (--n != 0) { + if ((*d++ = *s++) == '\0') break; - } while (--n != 0); + } } /* Not enough room in dst, add NUL and traverse rest of src */ From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:12:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D8C745E; Mon, 3 Dec 2012 18:12:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5662D8FC12; Mon, 3 Dec 2012 18:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3ICt1U098986; Mon, 3 Dec 2012 18:12:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3ICtLV098985; Mon, 3 Dec 2012 18:12:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031812.qB3ICtLV098985@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243813 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:12:55 -0000 Author: delphij Date: Mon Dec 3 18:12:54 2012 New Revision: 243813 URL: http://svnweb.freebsd.org/changeset/base/243813 Log: MFC r242332: s/dettach/detach/g Approved by: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Dec 3 18:10:30 2012 (r243812) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Dec 3 18:12:54 2012 (r243813) @@ -329,7 +329,7 @@ vdev_geom_attach_taster(struct g_consume } static void -vdev_geom_dettach_taster(struct g_consumer *cp) +vdev_geom_detach_taster(struct g_consumer *cp) { g_access(cp, -1, 0, 0); g_detach(cp); @@ -370,7 +370,7 @@ vdev_geom_read_pool_label(const char *na g_topology_unlock(); error = vdev_geom_read_config(zcp, &vdev_cfg); g_topology_lock(); - vdev_geom_dettach_taster(zcp); + vdev_geom_detach_taster(zcp); if (error) continue; ZFS_LOG(1, "successfully read vdev config"); @@ -439,7 +439,7 @@ vdev_geom_attach_by_guid(uint64_t guid) g_topology_unlock(); pguid = vdev_geom_read_guid(zcp); g_topology_lock(); - vdev_geom_dettach_taster(zcp); + vdev_geom_detach_taster(zcp); if (pguid != guid) continue; cp = vdev_geom_attach(pp); From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:16:37 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67C2F667; Mon, 3 Dec 2012 18:16:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 425918FC12; Mon, 3 Dec 2012 18:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3IGbpv000105; Mon, 3 Dec 2012 18:16:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3IGbJ1000104; Mon, 3 Dec 2012 18:16:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031816.qB3IGbJ1000104@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243814 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:16:37 -0000 Author: delphij Date: Mon Dec 3 18:16:36 2012 New Revision: 243814 URL: http://svnweb.freebsd.org/changeset/base/243814 Log: MFC r242841: Use %s when calling make_dev with a string pointer. This makes clang happy. Modified: stable/9/sys/ofed/include/linux/cdev.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/cdev.h ============================================================================== --- stable/9/sys/ofed/include/linux/cdev.h Mon Dec 3 18:12:54 2012 (r243813) +++ stable/9/sys/ofed/include/linux/cdev.h Mon Dec 3 18:16:36 2012 (r243814) @@ -107,7 +107,7 @@ cdev_add(struct linux_cdev *cdev, dev_t if (count != 1) panic("cdev_add: Unsupported count: %d", count); cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), 0, 0, 0700, - kobject_name(&cdev->kobj)); + "%s", kobject_name(&cdev->kobj)); cdev->dev = dev; cdev->cdev->si_drv1 = cdev; From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:19:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09D1A893; Mon, 3 Dec 2012 18:19:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFF1C8FC16; Mon, 3 Dec 2012 18:19:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3IJw8R000948; Mon, 3 Dec 2012 18:19:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3IJwZf000947; Mon, 3 Dec 2012 18:19:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031819.qB3IJwZf000947@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243815 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:19:59 -0000 Author: delphij Date: Mon Dec 3 18:19:58 2012 New Revision: 243815 URL: http://svnweb.freebsd.org/changeset/base/243815 Log: MFC r242728: ICMPV6_FILTER should read ICMP6_FILTER. Submitted by: Frédéric Perrin Modified: stable/9/share/man/man4/icmp6.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/icmp6.4 ============================================================================== --- stable/9/share/man/man4/icmp6.4 Mon Dec 3 18:16:36 2012 (r243814) +++ stable/9/share/man/man4/icmp6.4 Mon Dec 3 18:19:58 2012 (r243815) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2004 +.Dd November 7, 2012 .Dt ICMP6 4 .Os .Sh NAME @@ -234,7 +234,7 @@ calls may be used to obtain and install option level .Dv IPPROTO_ICMPV6 and name -.Dv ICMPV6_FILTER +.Dv ICMP6_FILTER with a pointer to the .Vt icmp6_filter structure as the option value. From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:26:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F824FB8; Mon, 3 Dec 2012 18:26:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E483F8FC12; Mon, 3 Dec 2012 18:26:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3IQNJt002991; Mon, 3 Dec 2012 18:26:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3IQNOa002986; Mon, 3 Dec 2012 18:26:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031826.qB3IQNOa002986@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243818 - stable/9/contrib/netcat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:26:24 -0000 Author: delphij Date: Mon Dec 3 18:26:23 2012 New Revision: 243818 URL: http://svnweb.freebsd.org/changeset/base/243818 Log: MFC r235038,241906: netcat from OpenBSD 5.2. Modified: stable/9/contrib/netcat/FREEBSD-vendor stable/9/contrib/netcat/nc.1 stable/9/contrib/netcat/netcat.c stable/9/contrib/netcat/socks.c Directory Properties: stable/9/contrib/netcat/ (props changed) Modified: stable/9/contrib/netcat/FREEBSD-vendor ============================================================================== --- stable/9/contrib/netcat/FREEBSD-vendor Mon Dec 3 18:21:29 2012 (r243817) +++ stable/9/contrib/netcat/FREEBSD-vendor Mon Dec 3 18:26:23 2012 (r243818) @@ -1,5 +1,5 @@ # $FreeBSD$ Project: netcat (aka src/usr.bin/nc in OpenBSD) ProjectURL: http://www.openbsd.org/ -Version: 5.1 +Version: 5.2 License: BSD Modified: stable/9/contrib/netcat/nc.1 ============================================================================== --- stable/9/contrib/netcat/nc.1 Mon Dec 3 18:21:29 2012 (r243817) +++ stable/9/contrib/netcat/nc.1 Mon Dec 3 18:26:23 2012 (r243818) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.60 2012/02/07 12:11:43 lum Exp $ +.\" $OpenBSD: nc.1,v 1.61 2012/07/07 15:33:02 haesbaert Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 4, 2011 +.Dd February 7, 2012 .Dt NC 1 .Os .Sh NAME @@ -137,6 +137,10 @@ is completed. It is an error to use this option without the .Fl l option. +When used together with the +.Fl u +option, the server socket is not connected and it can receive UDP datagrams from +multiple hosts. .It Fl l Used to specify that .Nm Modified: stable/9/contrib/netcat/netcat.c ============================================================================== --- stable/9/contrib/netcat/netcat.c Mon Dec 3 18:21:29 2012 (r243817) +++ stable/9/contrib/netcat/netcat.c Mon Dec 3 18:26:23 2012 (r243818) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.105 2012/02/09 06:25:35 lum Exp $ */ +/* $OpenBSD: netcat.c,v 1.109 2012/07/07 15:33:02 haesbaert Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -75,7 +75,6 @@ /* Command Line Options */ int dflag; /* detached, no stdin */ unsigned int iflag; /* Interval Flag */ -int jflag; /* use jumbo frames if we can */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ int nflag; /* Don't do name look up */ @@ -116,6 +115,7 @@ int unix_connect(char *); int unix_listen(char *); void set_common_sockopts(int); int map_tos(char *, int *); +void report_connect(const struct sockaddr *, socklen_t); void usage(int); #ifdef IPSEC @@ -153,7 +153,7 @@ main(int argc, char *argv[]) sv = NULL; while ((ch = getopt_long(argc, argv, - "46DdEe:hI:i:jklnoO:P:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:hI:i:klnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -201,11 +201,6 @@ main(int argc, char *argv[]) if (errstr) errx(1, "interval %s: %s", errstr, optarg); break; -#ifdef SO_JUMBO - case 'j': - jflag = 1; - break; -#endif case 'k': kflag = 1; break; @@ -395,17 +390,23 @@ main(int argc, char *argv[]) if (s < 0) err(1, NULL); /* - * For UDP, we will use recvfrom() initially - * to wait for a caller, then use the regular - * functions to talk to the caller. + * For UDP and -k, don't connect the socket, let it + * receive datagrams from multiple socket pairs. + */ + if (uflag && kflag) + readwrite(s); + /* + * For UDP and not -k, we will use recvfrom() initially + * to wait for a caller, then use the regular functions + * to talk to the caller. */ - if (uflag) { + else if (uflag && !kflag) { int rv, plen; char buf[16384]; struct sockaddr_storage z; len = sizeof(z); - plen = jflag ? 16384 : 2048; + plen = 2048; rv = recvfrom(s, buf, plen, MSG_PEEK, (struct sockaddr *)&z, &len); if (rv < 0) @@ -415,11 +416,20 @@ main(int argc, char *argv[]) if (rv < 0) err(1, "connect"); + if (vflag) + report_connect((struct sockaddr *)&z, len); + readwrite(s); } else { len = sizeof(cliaddr); connfd = accept(s, (struct sockaddr *)&cliaddr, &len); + if (connfd == -1) + err(1, "accept"); + + if (vflag) + report_connect((struct sockaddr *)&cliaddr, len); + readwrite(connfd); close(connfd); } @@ -782,7 +792,7 @@ readwrite(int nfd) int lfd = fileno(stdout); int plen; - plen = jflag ? 16384 : 2048; + plen = 2048; /* Setup Network FD */ pfd[0].fd = nfd; @@ -961,13 +971,6 @@ set_common_sockopts(int s) &x, sizeof(x)) == -1) err(1, NULL); } -#ifdef SO_JUMBO - if (jflag) { - if (setsockopt(s, SOL_SOCKET, SO_JUMBO, - &x, sizeof(x)) == -1) - err(1, NULL); - } -#endif if (Tflag != -1) { if (setsockopt(s, IPPROTO_IP, IP_TOS, &Tflag, sizeof(Tflag)) == -1) @@ -1039,6 +1042,32 @@ map_tos(char *s, int *val) } void +report_connect(const struct sockaddr *sa, socklen_t salen) +{ + char remote_host[NI_MAXHOST]; + char remote_port[NI_MAXSERV]; + int herr; + int flags = NI_NUMERICSERV; + + if (nflag) + flags |= NI_NUMERICHOST; + + if ((herr = getnameinfo(sa, salen, + remote_host, sizeof(remote_host), + remote_port, sizeof(remote_port), + flags)) != 0) { + if (herr == EAI_SYSTEM) + err(1, "getnameinfo"); + else + errx(1, "getnameinfo: %s", gai_strerror(herr)); + } + + fprintf(stderr, + "Connection from %s %s " + "received!\n", remote_host, remote_port); +} + +void help(void) { usage(0); Modified: stable/9/contrib/netcat/socks.c ============================================================================== --- stable/9/contrib/netcat/socks.c Mon Dec 3 18:21:29 2012 (r243817) +++ stable/9/contrib/netcat/socks.c Mon Dec 3 18:26:23 2012 (r243818) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.19 2011/02/12 15:54:18 okan Exp $ */ +/* $OpenBSD: socks.c,v 1.20 2012/03/08 09:56:28 espie Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -231,12 +231,12 @@ socks_connect(const char *host, const ch case SOCKS_IPV4: cnt = atomicio(read, proxyfd, buf + 4, 6); if (cnt != 6) - err(1, "read failed (%zd/6)", cnt); + err(1, "read failed (%zu/6)", cnt); break; case SOCKS_IPV6: cnt = atomicio(read, proxyfd, buf + 4, 18); if (cnt != 18) - err(1, "read failed (%zd/18)", cnt); + err(1, "read failed (%zu/18)", cnt); break; default: errx(1, "connection failed, unsupported address type"); From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:30:12 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD3984DD; Mon, 3 Dec 2012 18:30:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95FCA8FC13; Mon, 3 Dec 2012 18:30:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3IUC5P004166; Mon, 3 Dec 2012 18:30:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3IUCGp004163; Mon, 3 Dec 2012 18:30:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031830.qB3IUCGp004163@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243820 - stable/9/usr.sbin/watchdogd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:30:12 -0000 Author: delphij Date: Mon Dec 3 18:30:12 2012 New Revision: 243820 URL: http://svnweb.freebsd.org/changeset/base/243820 Log: MFC r242519: Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency. Modified: stable/9/usr.sbin/watchdogd/Makefile stable/9/usr.sbin/watchdogd/watchdogd.c Directory Properties: stable/9/usr.sbin/watchdogd/ (props changed) Modified: stable/9/usr.sbin/watchdogd/Makefile ============================================================================== --- stable/9/usr.sbin/watchdogd/Makefile Mon Dec 3 18:28:54 2012 (r243819) +++ stable/9/usr.sbin/watchdogd/Makefile Mon Dec 3 18:30:12 2012 (r243820) @@ -4,8 +4,8 @@ PROG= watchdogd LINKS= ${BINDIR}/watchdogd ${BINDIR}/watchdog MAN= watchdogd.8 watchdog.8 -LDADD= -lm -lutil -DPADD= ${LIBM} ${LIBUTIL} +LDADD= -lutil +DPADD= ${LIBUTIL} .include Modified: stable/9/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- stable/9/usr.sbin/watchdogd/watchdogd.c Mon Dec 3 18:28:54 2012 (r243819) +++ stable/9/usr.sbin/watchdogd/watchdogd.c Mon Dec 3 18:30:12 2012 (r243820) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) if (a == 0) timeout = WD_TO_NEVER; else - timeout = 1.0 + log(a * 1e9) / log(2.0); + timeout = flsll(a * 1e9); if (debugging) printf("Timeout is 2^%d nanoseconds\n", timeout); From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:34:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D60F8A6C; Mon, 3 Dec 2012 18:34:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9FC88FC14; Mon, 3 Dec 2012 18:34:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3IYsbb005563; Mon, 3 Dec 2012 18:34:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3IYsXX005562; Mon, 3 Dec 2012 18:34:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031834.qB3IYsXX005562@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243823 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:34:54 -0000 Author: delphij Date: Mon Dec 3 18:34:54 2012 New Revision: 243823 URL: http://svnweb.freebsd.org/changeset/base/243823 Log: MFC r242497: Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI command properly. Without this change, mfi(4) always sends 10 byte READ and WRITE commands, which will cause data corruption when device is larger than 2^32 sectors. PR: kern/173291 Submitted by: Steven Hartland Reviewed by: mav Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Mon Dec 3 18:31:33 2012 (r243822) +++ stable/9/sys/dev/mfi/mfi.c Mon Dec 3 18:34:54 2012 (r243823) @@ -106,6 +106,8 @@ static void mfi_add_sys_pd_complete(stru static struct mfi_command * mfi_bio_command(struct mfi_softc *); static void mfi_bio_complete(struct mfi_command *); static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); +static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, + uint64_t lba, uint8_t byte2, int readop); static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); static int mfi_abort(struct mfi_softc *, struct mfi_command *); @@ -1982,13 +1984,78 @@ mfi_bio_command(struct mfi_softc *sc) mfi_enqueue_bio(sc, bio); return cm; } + +static int +mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, + uint64_t lba, uint8_t byte2, int readop) +{ + int cdb_len; + + if (((lba & 0x1fffff) == lba) + && ((block_count & 0xff) == block_count) + && (byte2 == 0)) { + /* We can fit in a 6 byte cdb */ + struct scsi_rw_6 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; + scsi_ulto3b(lba, scsi_cmd->addr); + scsi_cmd->length = block_count & 0xff; + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else if (((block_count & 0xffff) == block_count) && ((lba & 0xffffffff) == lba)) { + /* Need a 10 byte CDB */ + struct scsi_rw_10 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto2b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else if (((block_count & 0xffffffff) == block_count) && + ((lba & 0xffffffff) == lba)) { + /* Block count is too big for 10 byte CDB use a 12 byte CDB */ + struct scsi_rw_12 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else { + /* + * 16 byte CDB. We'll only get here if the LBA is larger + * than 2^32 + */ + struct scsi_rw_16 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; + scsi_cmd->byte2 = byte2; + scsi_u64to8b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } + + return cdb_len; +} + static struct mfi_command * mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) { struct mfi_command *cm; struct mfi_pass_frame *pass; - int flags = 0, blkcount = 0; - uint32_t context = 0; + int flags = 0; + uint8_t cdb_len; + uint32_t block_count, context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) return (NULL); @@ -2002,35 +2069,29 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->header.cmd = MFI_CMD_PD_SCSI_IO; switch (bio->bio_cmd & 0x03) { case BIO_READ: -#define SCSI_READ 0x28 - pass->cdb[0] = SCSI_READ; flags = MFI_CMD_DATAIN; break; case BIO_WRITE: -#define SCSI_WRITE 0x2a - pass->cdb[0] = SCSI_WRITE; flags = MFI_CMD_DATAOUT; break; default: - panic("Invalid bio command"); + /* TODO: what about BIO_DELETE??? */ + panic("Unsupported bio command"); } /* Cheat with the sector length to avoid a non-constant division */ - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + block_count = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; /* Fill the LBA and Transfer length in CDB */ - pass->cdb[2] = (bio->bio_pblkno & 0xff000000) >> 24; - pass->cdb[3] = (bio->bio_pblkno & 0x00ff0000) >> 16; - pass->cdb[4] = (bio->bio_pblkno & 0x0000ff00) >> 8; - pass->cdb[5] = bio->bio_pblkno & 0x000000ff; - pass->cdb[7] = (blkcount & 0xff00) >> 8; - pass->cdb[8] = (blkcount & 0x00ff); + cdb_len = mfi_build_syspd_cdb(pass, block_count, bio->bio_pblkno, 0, + flags == MFI_CMD_DATAIN); + pass->header.target_id = (uintptr_t)bio->bio_driver1; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = bio->bio_bcount; - pass->header.cdb_len = 10; + pass->header.cdb_len = cdb_len; pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_complete = mfi_bio_complete; @@ -2048,7 +2109,8 @@ mfi_build_ldio(struct mfi_softc *sc, str { struct mfi_io_frame *io; struct mfi_command *cm; - int flags, blkcount; + int flags; + uint32_t blkcount; uint32_t context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) @@ -2069,7 +2131,8 @@ mfi_build_ldio(struct mfi_softc *sc, str flags = MFI_CMD_DATAOUT; break; default: - panic("Invalid bio command"); + /* TODO: what about BIO_DELETE??? */ + panic("Unsupported bio command"); } /* Cheat with the sector length to avoid a non-constant division */ @@ -2460,7 +2523,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * struct mfi_command *cm; struct mfi_pass_frame *pass; int error; - int blkcount = 0; + uint32_t blkcount; if ((cm = mfi_dequeue_free(sc)) == NULL) return (EBUSY); @@ -2468,21 +2531,14 @@ mfi_dump_syspd_blocks(struct mfi_softc * pass = &cm->cm_frame->pass; bzero(pass->cdb, 16); pass->header.cmd = MFI_CMD_PD_SCSI_IO; - pass->cdb[0] = SCSI_WRITE; - pass->cdb[2] = (lba & 0xff000000) >> 24; - pass->cdb[3] = (lba & 0x00ff0000) >> 16; - pass->cdb[4] = (lba & 0x0000ff00) >> 8; - pass->cdb[5] = (lba & 0x000000ff); blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; - pass->cdb[7] = (blkcount & 0xff00) >> 8; - pass->cdb[8] = (blkcount & 0x00ff); pass->header.target_id = id; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = len; - pass->header.cdb_len = 10; + pass->header.cdb_len = mfi_build_syspd_cdb(pass, blkcount, lba, 0, 0); pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_data = virt; From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 3 18:37:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A3B4C44; Mon, 3 Dec 2012 18:37:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 597BB8FC12; Mon, 3 Dec 2012 18:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3Ib3h9006144; Mon, 3 Dec 2012 18:37:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3Ib3fj006137; Mon, 3 Dec 2012 18:37:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031837.qB3Ib3fj006137@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243824 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:37:03 -0000 Author: delphij Date: Mon Dec 3 18:37:02 2012 New Revision: 243824 URL: http://svnweb.freebsd.org/changeset/base/243824 Log: MFC r242681 (ambrisko): - Extend the prior commit to use the generic SCSI command building function use that for JBOD and Thunderbolt disk write command. Now we only have one implementation in mfi. - Fix dumping on Thunderbolt cards. Polled IO commands do not seem to be normally acknowledged by changing cmd_status to MFI_STAT_OK. In order to get acknowledgement of the IO is complete, the Thunderbolt command queue needs to be run through. I added a flag MFI_CMD_SCSI to indicate this command is being polled and to complete the Thunderbolt wrapper and indicate the result. This flag needs to be set in the JBOD case in case if that us using Thunderbolt card. When in the polling loop check for completed commands. - Remove mfi_tbolt_is_ldio and just do the check when needed. - Fix an issue when attaching of disk device happens when a device is already scheduled to be attached but hasn't attached. - add a tunable to allow raw disk attachment to CAM via: hw.mfi.allow_cam_disk_passthrough=1 - fixup aborting of commands (AEN and LD state change). Use a generic abort function and only wait the command being aborted not both. Thunderbolt cards don't seem to abort commands so the abort times out. Modified: stable/9/sys/dev/mfi/mfi.c stable/9/sys/dev/mfi/mfi_cam.c stable/9/sys/dev/mfi/mfi_disk.c stable/9/sys/dev/mfi/mfi_syspd.c stable/9/sys/dev/mfi/mfi_tbolt.c stable/9/sys/dev/mfi/mfivar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Mon Dec 3 18:34:54 2012 (r243823) +++ stable/9/sys/dev/mfi/mfi.c Mon Dec 3 18:37:02 2012 (r243824) @@ -106,11 +106,9 @@ static void mfi_add_sys_pd_complete(stru static struct mfi_command * mfi_bio_command(struct mfi_softc *); static void mfi_bio_complete(struct mfi_command *); static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); -static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, - uint64_t lba, uint8_t byte2, int readop); static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); -static int mfi_abort(struct mfi_softc *, struct mfi_command *); +static int mfi_abort(struct mfi_softc *, struct mfi_command **); static int mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, struct thread *); static void mfi_timeout(void *); static int mfi_user_command(struct mfi_softc *, @@ -376,6 +374,8 @@ mfi_attach(struct mfi_softc *sc) sx_init(&sc->mfi_config_lock, "MFI config"); TAILQ_INIT(&sc->mfi_ld_tqh); TAILQ_INIT(&sc->mfi_syspd_tqh); + TAILQ_INIT(&sc->mfi_ld_pend_tqh); + TAILQ_INIT(&sc->mfi_syspd_pend_tqh); TAILQ_INIT(&sc->mfi_evt_queue); TASK_INIT(&sc->mfi_evt_task, 0, mfi_handle_evt, sc); TASK_INIT(&sc->mfi_map_sync_task, 0, mfi_handle_map_sync, sc); @@ -697,6 +697,7 @@ mfi_attach(struct mfi_softc *sc) device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } + sc->mfi_intr_ptr = mfi_intr_tbolt; sc->mfi_enable_intr(sc); } else { if ((error = mfi_comms_init(sc)) != 0) @@ -707,6 +708,7 @@ mfi_attach(struct mfi_softc *sc) device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } + sc->mfi_intr_ptr = mfi_intr; sc->mfi_enable_intr(sc); } if ((error = mfi_get_controller_info(sc)) != 0) @@ -1281,6 +1283,17 @@ mfi_shutdown(struct mfi_softc *sc) struct mfi_command *cm; int error; + + if (sc->mfi_aen_cm) + sc->cm_aen_abort = 1; + if (sc->mfi_aen_cm != NULL) + mfi_abort(sc, &sc->mfi_aen_cm); + + if (sc->mfi_map_sync_cm) + sc->cm_map_abort = 1; + if (sc->mfi_map_sync_cm != NULL) + mfi_abort(sc, &sc->mfi_map_sync_cm); + mtx_lock(&sc->mfi_io_lock); error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_SHUTDOWN, NULL, 0); if (error) { @@ -1288,12 +1301,6 @@ mfi_shutdown(struct mfi_softc *sc) return (error); } - if (sc->mfi_aen_cm != NULL) - mfi_abort(sc, sc->mfi_aen_cm); - - if (sc->mfi_map_sync_cm != NULL) - mfi_abort(sc, sc->mfi_map_sync_cm); - dcmd = &cm->cm_frame->dcmd; dcmd->header.flags = MFI_FRAME_DIR_NONE; cm->cm_flags = MFI_CMD_POLLED; @@ -1315,6 +1322,7 @@ mfi_syspdprobe(struct mfi_softc *sc) struct mfi_command *cm = NULL; struct mfi_pd_list *pdlist = NULL; struct mfi_system_pd *syspd, *tmp; + struct mfi_system_pending *syspd_pend; int error, i, found; sx_assert(&sc->mfi_config_lock, SA_XLOCKED); @@ -1355,6 +1363,10 @@ mfi_syspdprobe(struct mfi_softc *sc) if (syspd->pd_id == pdlist->addr[i].device_id) found = 1; } + TAILQ_FOREACH(syspd_pend, &sc->mfi_syspd_pend_tqh, pd_link) { + if (syspd_pend->pd_id == pdlist->addr[i].device_id) + found = 1; + } if (found == 0) mfi_add_sys_pd(sc, pdlist->addr[i].device_id); } @@ -1390,6 +1402,7 @@ mfi_ldprobe(struct mfi_softc *sc) struct mfi_command *cm = NULL; struct mfi_ld_list *list = NULL; struct mfi_disk *ld; + struct mfi_disk_pending *ld_pend; int error, i; sx_assert(&sc->mfi_config_lock, SA_XLOCKED); @@ -1418,6 +1431,10 @@ mfi_ldprobe(struct mfi_softc *sc) if (ld->ld_id == list->ld_list[i].ld.v.target_id) goto skip_add; } + TAILQ_FOREACH(ld_pend, &sc->mfi_ld_pend_tqh, ld_link) { + if (ld_pend->ld_id == list->ld_list[i].ld.v.target_id) + goto skip_add; + } mfi_add_ld(sc, list->ld_list[i].ld.v.target_id); skip_add:; } @@ -1620,9 +1637,7 @@ mfi_aen_register(struct mfi_softc *sc, i < current_aen.members.evt_class) current_aen.members.evt_class = prior_aen.members.evt_class; - mtx_lock(&sc->mfi_io_lock); - mfi_abort(sc, sc->mfi_aen_cm); - mtx_unlock(&sc->mfi_io_lock); + mfi_abort(sc, &sc->mfi_aen_cm); } } @@ -1814,10 +1829,17 @@ mfi_add_ld(struct mfi_softc *sc, int id) struct mfi_command *cm; struct mfi_dcmd_frame *dcmd = NULL; struct mfi_ld_info *ld_info = NULL; + struct mfi_disk_pending *ld_pend; int error; mtx_assert(&sc->mfi_io_lock, MA_OWNED); + ld_pend = malloc(sizeof(*ld_pend), M_MFIBUF, M_NOWAIT | M_ZERO); + if (ld_pend != NULL) { + ld_pend->ld_id = id; + TAILQ_INSERT_TAIL(&sc->mfi_ld_pend_tqh, ld_pend, ld_link); + } + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); if (error) { @@ -1858,11 +1880,13 @@ mfi_add_ld_complete(struct mfi_command * hdr = &cm->cm_frame->header; ld_info = cm->cm_private; - if (hdr->cmd_status != MFI_STAT_OK) { + if (sc->cm_map_abort || hdr->cmd_status != MFI_STAT_OK) { free(ld_info, M_MFIBUF); + wakeup(&sc->mfi_map_sync_cm); mfi_release_command(cm); return; } + wakeup(&sc->mfi_map_sync_cm); mfi_release_command(cm); mtx_unlock(&sc->mfi_io_lock); @@ -1887,10 +1911,17 @@ static int mfi_add_sys_pd(struct mfi_sof struct mfi_command *cm; struct mfi_dcmd_frame *dcmd = NULL; struct mfi_pd_info *pd_info = NULL; + struct mfi_system_pending *syspd_pend; int error; mtx_assert(&sc->mfi_io_lock, MA_OWNED); + syspd_pend = malloc(sizeof(*syspd_pend), M_MFIBUF, M_NOWAIT | M_ZERO); + if (syspd_pend != NULL) { + syspd_pend->pd_id = id; + TAILQ_INSERT_TAIL(&sc->mfi_syspd_pend_tqh, syspd_pend, pd_link); + } + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_GET_INFO, (void **)&pd_info, sizeof(*pd_info)); if (error) { @@ -1985,9 +2016,12 @@ mfi_bio_command(struct mfi_softc *sc) return cm; } -static int -mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, - uint64_t lba, uint8_t byte2, int readop) +/* + * mostly copied from cam/scsi/scsi_all.c:scsi_read_write + */ + +int +mfi_build_cdb(int readop, uint8_t byte2, u_int64_t lba, u_int32_t block_count, uint8_t *cdb) { int cdb_len; @@ -1997,7 +2031,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram /* We can fit in a 6 byte cdb */ struct scsi_rw_6 *scsi_cmd; - scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_6 *)cdb; scsi_cmd->opcode = readop ? READ_6 : WRITE_6; scsi_ulto3b(lba, scsi_cmd->addr); scsi_cmd->length = block_count & 0xff; @@ -2007,7 +2041,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram /* Need a 10 byte CDB */ struct scsi_rw_10 *scsi_cmd; - scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_10 *)cdb; scsi_cmd->opcode = readop ? READ_10 : WRITE_10; scsi_cmd->byte2 = byte2; scsi_ulto4b(lba, scsi_cmd->addr); @@ -2020,7 +2054,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram /* Block count is too big for 10 byte CDB use a 12 byte CDB */ struct scsi_rw_12 *scsi_cmd; - scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_12 *)cdb; scsi_cmd->opcode = readop ? READ_12 : WRITE_12; scsi_cmd->byte2 = byte2; scsi_ulto4b(lba, scsi_cmd->addr); @@ -2035,7 +2069,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram */ struct scsi_rw_16 *scsi_cmd; - scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_16 *)cdb; scsi_cmd->opcode = readop ? READ_16 : WRITE_16; scsi_cmd->byte2 = byte2; scsi_u64to8b(lba, scsi_cmd->addr); @@ -2053,15 +2087,15 @@ mfi_build_syspdio(struct mfi_softc *sc, { struct mfi_command *cm; struct mfi_pass_frame *pass; - int flags = 0; + uint32_t context = 0; + int flags = 0, blkcount = 0, readop; uint8_t cdb_len; - uint32_t block_count, context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) return (NULL); /* Zero out the MFI frame */ - context = cm->cm_frame->header.context; + context = cm->cm_frame->header.context; bzero(cm->cm_frame, sizeof(union mfi_frame)); cm->cm_frame->header.context = context; pass = &cm->cm_frame->pass; @@ -2070,22 +2104,24 @@ mfi_build_syspdio(struct mfi_softc *sc, switch (bio->bio_cmd & 0x03) { case BIO_READ: flags = MFI_CMD_DATAIN; + readop = 1; break; case BIO_WRITE: flags = MFI_CMD_DATAOUT; + readop = 0; break; default: /* TODO: what about BIO_DELETE??? */ - panic("Unsupported bio command"); + panic("Unsupported bio command %x\n", bio->bio_cmd); } /* Cheat with the sector length to avoid a non-constant division */ - block_count = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; /* Fill the LBA and Transfer length in CDB */ - cdb_len = mfi_build_syspd_cdb(pass, block_count, bio->bio_pblkno, 0, - flags == MFI_CMD_DATAIN); - + cdb_len = mfi_build_cdb(readop, 0, bio->bio_pblkno, blkcount, + pass->cdb); pass->header.target_id = (uintptr_t)bio->bio_driver1; + pass->header.lun_id = 0; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; @@ -2132,7 +2168,7 @@ mfi_build_ldio(struct mfi_softc *sc, str break; default: /* TODO: what about BIO_DELETE??? */ - panic("Unsupported bio command"); + panic("Unsupported bio command %x\n", bio->bio_cmd); } /* Cheat with the sector length to avoid a non-constant division */ @@ -2422,15 +2458,14 @@ mfi_complete(struct mfi_softc *sc, struc } static int -mfi_abort(struct mfi_softc *sc, struct mfi_command *cm_abort) +mfi_abort(struct mfi_softc *sc, struct mfi_command **cm_abort) { struct mfi_command *cm; struct mfi_abort_frame *abort; int i = 0; uint32_t context = 0; - mtx_assert(&sc->mfi_io_lock, MA_OWNED); - + mtx_lock(&sc->mfi_io_lock); if ((cm = mfi_dequeue_free(sc)) == NULL) { return (EBUSY); } @@ -2444,29 +2479,27 @@ mfi_abort(struct mfi_softc *sc, struct m abort->header.cmd = MFI_CMD_ABORT; abort->header.flags = 0; abort->header.scsi_status = 0; - abort->abort_context = cm_abort->cm_frame->header.context; - abort->abort_mfi_addr_lo = (uint32_t)cm_abort->cm_frame_busaddr; + abort->abort_context = (*cm_abort)->cm_frame->header.context; + abort->abort_mfi_addr_lo = (uint32_t)(*cm_abort)->cm_frame_busaddr; abort->abort_mfi_addr_hi = - (uint32_t)((uint64_t)cm_abort->cm_frame_busaddr >> 32); + (uint32_t)((uint64_t)(*cm_abort)->cm_frame_busaddr >> 32); cm->cm_data = NULL; cm->cm_flags = MFI_CMD_POLLED; - if (sc->mfi_aen_cm) - sc->cm_aen_abort = 1; - if (sc->mfi_map_sync_cm) - sc->cm_map_abort = 1; mfi_mapcmd(sc, cm); mfi_release_command(cm); - while (i < 5 && sc->mfi_aen_cm != NULL) { - msleep(&sc->mfi_aen_cm, &sc->mfi_io_lock, 0, "mfiabort", + mtx_unlock(&sc->mfi_io_lock); + while (i < 5 && *cm_abort != NULL) { + tsleep(cm_abort, 0, "mfiabort", 5 * hz); i++; } - while (i < 5 && sc->mfi_map_sync_cm != NULL) { - msleep(&sc->mfi_map_sync_cm, &sc->mfi_io_lock, 0, "mfiabort", - 5 * hz); - i++; + if (*cm_abort != NULL) { + /* Force a complete if command didn't abort */ + mtx_lock(&sc->mfi_io_lock); + (*cm_abort)->cm_complete(*cm_abort); + mtx_unlock(&sc->mfi_io_lock); } return (0); @@ -2522,7 +2555,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * { struct mfi_command *cm; struct mfi_pass_frame *pass; - int error; + int error, readop, cdb_len; uint32_t blkcount; if ((cm = mfi_dequeue_free(sc)) == NULL) @@ -2531,21 +2564,24 @@ mfi_dump_syspd_blocks(struct mfi_softc * pass = &cm->cm_frame->pass; bzero(pass->cdb, 16); pass->header.cmd = MFI_CMD_PD_SCSI_IO; + + readop = 0; blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + cdb_len = mfi_build_cdb(readop, 0, lba, blkcount, pass->cdb); pass->header.target_id = id; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = len; - pass->header.cdb_len = mfi_build_syspd_cdb(pass, blkcount, lba, 0, 0); + pass->header.cdb_len = cdb_len; pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_data = virt; cm->cm_len = len; cm->cm_sg = &pass->sgl; cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE; - cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT; + cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT | MFI_CMD_SCSI; error = mfi_mapcmd(sc, cm); bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap, @@ -2745,16 +2781,24 @@ mfi_check_command_post(struct mfi_softc } } -static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm) +static int +mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm) { - struct mfi_config_data *conf_data=(struct mfi_config_data *)cm->cm_data; + struct mfi_config_data *conf_data; struct mfi_command *ld_cm = NULL; struct mfi_ld_info *ld_info = NULL; + struct mfi_ld_config *ld; + char *p; int error = 0; - if ((cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) && - (conf_data->ld[0].params.isSSCD == 1)) { - error = 1; + conf_data = (struct mfi_config_data *)cm->cm_data; + + if (cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) { + p = (char *)conf_data->array; + p += conf_data->array_size * conf_data->array_count; + ld = (struct mfi_ld_config *)p; + if (ld->params.isSSCD == 1) + error = 1; } else if (cm->cm_frame->dcmd.opcode == MFI_DCMD_LD_DELETE) { error = mfi_dcmd_command (sc, &ld_cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); Modified: stable/9/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_cam.c Mon Dec 3 18:34:54 2012 (r243823) +++ stable/9/sys/dev/mfi/mfi_cam.c Mon Dec 3 18:37:02 2012 (r243824) @@ -79,6 +79,11 @@ static void mfip_cam_poll(struct cam_sim static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); +static int mfi_allow_disks = 0; +TUNABLE_INT("hw.mfi.allow_cam_disk_passthrough", &mfi_allow_disks); +SYSCTL_INT(_hw_mfi, OID_AUTO, allow_cam_disk_passthrough, CTLFLAG_RD, + &mfi_allow_disks, 0, "event message locale"); + static devclass_t mfip_devclass; static device_method_t mfip_methods[] = { DEVMETHOD(device_probe, mfip_probe), @@ -349,7 +354,8 @@ mfip_done(struct mfi_command *cm) command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { device = csio->data_ptr[0] & 0x1f; - if ((device == T_DIRECT) || (device == T_PROCESSOR)) + if ((!mfi_allow_disks && device == T_DIRECT) || + (device == T_PROCESSOR)) csio->data_ptr[0] = (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } @@ -392,6 +398,9 @@ mfip_done(struct mfi_command *cm) static void mfip_cam_poll(struct cam_sim *sim) { - return; + struct mfip_softc *sc = cam_sim_softc(sim); + struct mfi_softc *mfisc = sc->mfi_sc; + + mfisc->mfi_intr_ptr(mfisc); } Modified: stable/9/sys/dev/mfi/mfi_disk.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_disk.c Mon Dec 3 18:34:54 2012 (r243823) +++ stable/9/sys/dev/mfi/mfi_disk.c Mon Dec 3 18:37:02 2012 (r243824) @@ -93,6 +93,7 @@ mfi_disk_attach(device_t dev) { struct mfi_disk *sc; struct mfi_ld_info *ld_info; + struct mfi_disk_pending *ld_pend; uint64_t sectors; uint32_t secsize; char *state; @@ -111,6 +112,13 @@ mfi_disk_attach(device_t dev) secsize = MFI_SECTOR_LEN; mtx_lock(&sc->ld_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->ld_controller->mfi_ld_tqh, sc, ld_link); + TAILQ_FOREACH(ld_pend, &sc->ld_controller->mfi_ld_pend_tqh, + ld_link) { + TAILQ_REMOVE(&sc->ld_controller->mfi_ld_pend_tqh, + ld_pend, ld_link); + free(ld_pend, M_MFIBUF); + break; + } mtx_unlock(&sc->ld_controller->mfi_io_lock); switch (ld_info->ld_config.params.state) { @@ -131,16 +139,16 @@ mfi_disk_attach(device_t dev) break; } - if ( strlen(ld_info->ld_config.properties.name) == 0 ) { - device_printf(dev, - "%juMB (%ju sectors) RAID volume (no label) is %s\n", - sectors / (1024 * 1024 / secsize), sectors, state); - } else { - device_printf(dev, - "%juMB (%ju sectors) RAID volume '%s' is %s\n", - sectors / (1024 * 1024 / secsize), sectors, - ld_info->ld_config.properties.name, state); - } + if ( strlen(ld_info->ld_config.properties.name) == 0 ) { + device_printf(dev, + "%juMB (%ju sectors) RAID volume (no label) is %s\n", + sectors / (1024 * 1024 / secsize), sectors, state); + } else { + device_printf(dev, + "%juMB (%ju sectors) RAID volume '%s' is %s\n", + sectors / (1024 * 1024 / secsize), sectors, + ld_info->ld_config.properties.name, state); + } sc->ld_disk = disk_alloc(); sc->ld_disk->d_drv1 = sc; Modified: stable/9/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_syspd.c Mon Dec 3 18:34:54 2012 (r243823) +++ stable/9/sys/dev/mfi/mfi_syspd.c Mon Dec 3 18:37:02 2012 (r243824) @@ -89,7 +89,6 @@ DRIVER_MODULE(mfisyspd, mfi, mfi_syspd_d static int mfi_syspd_probe(device_t dev) { - return (0); } @@ -98,12 +97,12 @@ mfi_syspd_attach(device_t dev) { struct mfi_system_pd *sc; struct mfi_pd_info *pd_info; + struct mfi_system_pending *syspd_pend; uint64_t sectors; uint32_t secsize; sc = device_get_softc(dev); pd_info = device_get_ivars(dev); - sc->pd_dev = dev; sc->pd_id = pd_info->ref.v.device_id; sc->pd_unit = device_get_unit(dev); @@ -115,6 +114,13 @@ mfi_syspd_attach(device_t dev) secsize = MFI_SECTOR_LEN; mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); + TAILQ_FOREACH(syspd_pend, &sc->pd_controller->mfi_syspd_pend_tqh, + pd_link) { + TAILQ_REMOVE(&sc->pd_controller->mfi_syspd_pend_tqh, + syspd_pend, pd_link); + free(syspd_pend, M_MFIBUF); + break; + } mtx_unlock(&sc->pd_controller->mfi_io_lock); device_printf(dev, "%juMB (%ju sectors) SYSPD volume (deviceid: %d)\n", sectors / (1024 * 1024 / secsize), sectors, sc->pd_id); @@ -139,6 +145,7 @@ mfi_syspd_attach(device_t dev) disk_create(sc->pd_disk, DISK_VERSION); device_printf(dev, " SYSPD volume attached\n"); + return (0); } Modified: stable/9/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_tbolt.c Mon Dec 3 18:34:54 2012 (r243823) +++ stable/9/sys/dev/mfi/mfi_tbolt.c Mon Dec 3 18:37:02 2012 (r243824) @@ -69,13 +69,10 @@ uint8_t mfi_build_mpt_pass_thru(struct mfi_softc *sc, struct mfi_command *mfi_cmd); union mfi_mpi2_request_descriptor *mfi_build_and_issue_cmd(struct mfi_softc *sc, struct mfi_command *mfi_cmd); -int mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd); void mfi_tbolt_build_ldio(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd); static int mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd, pMpi25IeeeSgeChain64_t sgl_ptr, struct mfi_cmd_tbolt *cmd); -static int mfi_tbolt_build_cdb(struct mfi_softc *sc, struct mfi_command - *mfi_cmd, uint8_t *cdb); void map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status, uint8_t ext_status); @@ -502,6 +499,7 @@ mfi_tbolt_alloc_cmd(struct mfi_softc *sc + i * MEGASAS_MAX_SZ_CHAIN_FRAME); cmd->sg_frame_phys_addr = sc->sg_frame_busaddr + i * MEGASAS_MAX_SZ_CHAIN_FRAME; + cmd->sync_cmd_idx = sc->mfi_max_fw_cmds; TAILQ_INSERT_TAIL(&(sc->mfi_cmd_tbolt_tqh), cmd, next); } @@ -574,11 +572,11 @@ void map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status, uint8_t ext_status) { - switch (status) { case MFI_STAT_OK: - mfi_cmd->cm_frame->header.cmd_status = 0; - mfi_cmd->cm_frame->dcmd.header.cmd_status = 0; + mfi_cmd->cm_frame->header.cmd_status = MFI_STAT_OK; + mfi_cmd->cm_frame->dcmd.header.cmd_status = MFI_STAT_OK; + mfi_cmd->cm_error = MFI_STAT_OK; break; case MFI_STAT_SCSI_IO_FAILED: @@ -618,6 +616,7 @@ mfi_tbolt_return_cmd(struct mfi_softc *s { mtx_assert(&sc->mfi_io_lock, MA_OWNED); + cmd->sync_cmd_idx = sc->mfi_max_fw_cmds; TAILQ_INSERT_TAIL(&sc->mfi_cmd_tbolt_tqh, cmd, next); } @@ -667,16 +666,26 @@ mfi_tbolt_complete_cmd(struct mfi_softc extStatus = cmd_mfi->cm_frame->dcmd.header.scsi_status; map_tbolt_cmd_status(cmd_mfi, status, extStatus); - /* remove command from busy queue if not polled */ - TAILQ_FOREACH(cmd_mfi_check, &sc->mfi_busy, cm_link) { - if (cmd_mfi_check == cmd_mfi) { - mfi_remove_busy(cmd_mfi); - break; + if (cmd_mfi->cm_flags & MFI_CMD_SCSI && + (cmd_mfi->cm_flags & MFI_CMD_POLLED) != 0) { + /* polled LD/SYSPD IO command */ + mfi_tbolt_return_cmd(sc, cmd_tbolt); + /* XXX mark okay for now DJA */ + cmd_mfi->cm_frame->header.cmd_status = MFI_STAT_OK; + } else { + + /* remove command from busy queue if not polled */ + TAILQ_FOREACH(cmd_mfi_check, &sc->mfi_busy, cm_link) { + if (cmd_mfi_check == cmd_mfi) { + mfi_remove_busy(cmd_mfi); + break; + } } + + /* complete the command */ + mfi_complete(sc, cmd_mfi); + mfi_tbolt_return_cmd(sc, cmd_tbolt); } - cmd_mfi->cm_error = 0; - mfi_complete(sc, cmd_mfi); - mfi_tbolt_return_cmd(sc, cmd_tbolt); sc->last_reply_idx++; if (sc->last_reply_idx >= sc->mfi_max_fw_cmds) { @@ -811,13 +820,13 @@ mfi_tbolt_build_ldio(struct mfi_softc *s MFI_FRAME_DIR_READ) io_info.isRead = 1; - io_request->RaidContext.timeoutValue - = MFI_FUSION_FP_DEFAULT_TIMEOUT; - io_request->Function = MPI2_FUNCTION_LD_IO_REQUEST; - io_request->DevHandle = device_id; - cmd->request_desc->header.RequestFlags - = (MFI_REQ_DESCRIPT_FLAGS_LD_IO - << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + io_request->RaidContext.timeoutValue + = MFI_FUSION_FP_DEFAULT_TIMEOUT; + io_request->Function = MPI2_FUNCTION_LD_IO_REQUEST; + io_request->DevHandle = device_id; + cmd->request_desc->header.RequestFlags + = (MFI_REQ_DESCRIPT_FLAGS_LD_IO + << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if ((io_request->IoFlags == 6) && (io_info.numBlocks == 0)) io_request->RaidContext.RegLockLength = 0x100; io_request->DataLength = mfi_cmd->cm_frame->io.header.data_len @@ -825,40 +834,36 @@ mfi_tbolt_build_ldio(struct mfi_softc *s } int -mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd) -{ - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ - || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - return 1; - else - return 0; -} - -int mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd) { - uint32_t device_id; + struct mfi_mpi2_request_raid_scsi_io *io_request; uint32_t sge_count; - uint8_t cdb[32], cdb_len; - - memset(cdb, 0, 32); - struct mfi_mpi2_request_raid_scsi_io *io_request = cmd->io_request; - - device_id = mfi_cmd->cm_frame->header.target_id; + uint8_t cdb_len; + int readop; + u_int64_t lba; - /* Have to build CDB here for TB as BSD don't have a scsi layer */ - if ((cdb_len = mfi_tbolt_build_cdb(sc, mfi_cmd, cdb)) == 1) + io_request = cmd->io_request; + if (!(mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ + || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE)) return 1; - /* Just the CDB length,rest of the Flags are zero */ - io_request->IoFlags = cdb_len; - memcpy(io_request->CDB.CDB32, cdb, 32); + mfi_tbolt_build_ldio(sc, mfi_cmd, cmd); - if (mfi_tbolt_is_ldio(mfi_cmd)) - mfi_tbolt_build_ldio(sc, mfi_cmd , cmd); + /* Convert to SCSI command CDB */ + bzero(io_request->CDB.CDB32, sizeof(io_request->CDB.CDB32)); + if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) + readop = 0; else - return 1; + readop = 1; + + lba = mfi_cmd->cm_frame->io.lba_hi; + lba = (lba << 32) + mfi_cmd->cm_frame->io.lba_lo; + cdb_len = mfi_build_cdb(readop, 0, lba, + mfi_cmd->cm_frame->io.header.data_len, io_request->CDB.CDB32); + + /* Just the CDB length, rest of the Flags are zero */ + io_request->IoFlags = cdb_len; /* * Construct SGL @@ -883,84 +888,12 @@ mfi_tbolt_build_io(struct mfi_softc *sc, io_request->SenseBufferLowAddress = mfi_cmd->cm_sense_busaddr; io_request->SenseBufferLength = MFI_SENSE_LEN; + io_request->RaidContext.Status = MFI_STAT_INVALID_STATUS; + io_request->RaidContext.exStatus = MFI_STAT_INVALID_STATUS; + return 0; } -static int -mfi_tbolt_build_cdb(struct mfi_softc *sc, struct mfi_command *mfi_cmd, - uint8_t *cdb) -{ - uint32_t lba_lo, lba_hi, num_lba; - uint8_t cdb_len; - - if (mfi_cmd == NULL || cdb == NULL) - return 1; - num_lba = mfi_cmd->cm_frame->io.header.data_len; - lba_lo = mfi_cmd->cm_frame->io.lba_lo; - lba_hi = mfi_cmd->cm_frame->io.lba_hi; - - if (lba_hi == 0 && (num_lba <= 0xFF) && (lba_lo <= 0x1FFFFF)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 6 or Write 6 */ - cdb[0] = (uint8_t) (0x0A); - else - cdb[0] = (uint8_t) (0x08); - - cdb[4] = (uint8_t) num_lba; - cdb[3] = (uint8_t) (lba_lo & 0xFF); - cdb[2] = (uint8_t) (lba_lo >> 8); - cdb[1] = (uint8_t) ((lba_lo >> 16) & 0x1F); - cdb_len = 6; - } - else if (lba_hi == 0 && (num_lba <= 0xFFFF) && (lba_lo <= 0xFFFFFFFF)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 10 or Write 10 */ - cdb[0] = (uint8_t) (0x2A); - else - cdb[0] = (uint8_t) (0x28); - cdb[8] = (uint8_t) (num_lba & 0xFF); - cdb[7] = (uint8_t) (num_lba >> 8); - cdb[5] = (uint8_t) (lba_lo & 0xFF); - cdb[4] = (uint8_t) (lba_lo >> 8); - cdb[3] = (uint8_t) (lba_lo >> 16); - cdb[2] = (uint8_t) (lba_lo >> 24); - cdb_len = 10; - } else if ((num_lba > 0xFFFF) && (lba_hi == 0)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 12 or Write 12 */ - cdb[0] = (uint8_t) (0xAA); - else - cdb[0] = (uint8_t) (0xA8); - cdb[9] = (uint8_t) (num_lba & 0xFF); - cdb[8] = (uint8_t) (num_lba >> 8); - cdb[7] = (uint8_t) (num_lba >> 16); - cdb[6] = (uint8_t) (num_lba >> 24); - cdb[5] = (uint8_t) (lba_lo & 0xFF); - cdb[4] = (uint8_t) (lba_lo >> 8); - cdb[3] = (uint8_t) (lba_lo >> 16); - cdb[2] = (uint8_t) (lba_lo >> 24); - cdb_len = 12; - } else { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - cdb[0] = (uint8_t) (0x8A); - else - cdb[0] = (uint8_t) (0x88); - cdb[13] = (uint8_t) (num_lba & 0xFF); - cdb[12] = (uint8_t) (num_lba >> 8); - cdb[11] = (uint8_t) (num_lba >> 16); - cdb[10] = (uint8_t) (num_lba >> 24); - cdb[9] = (uint8_t) (lba_lo & 0xFF); - cdb[8] = (uint8_t) (lba_lo >> 8); - cdb[7] = (uint8_t) (lba_lo >> 16); - cdb[6] = (uint8_t) (lba_lo >> 24); - cdb[5] = (uint8_t) (lba_hi & 0xFF); - cdb[4] = (uint8_t) (lba_hi >> 8); - cdb[3] = (uint8_t) (lba_hi >> 16); - cdb[2] = (uint8_t) (lba_hi >> 24); - cdb_len = 16; - } - return cdb_len; -} static int mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd, @@ -1100,8 +1033,7 @@ mfi_tbolt_send_frame(struct mfi_softc *s if ((cm->cm_flags & MFI_CMD_POLLED) == 0) { cm->cm_timestamp = time_uptime; mfi_enqueue_busy(cm); - } - else { /* still get interrupts for it */ + } else { /* still get interrupts for it */ hdr->cmd_status = MFI_STAT_INVALID_STATUS; hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; } @@ -1118,31 +1050,49 @@ mfi_tbolt_send_frame(struct mfi_softc *s } else device_printf(sc->mfi_dev, "DJA NA XXX SYSPDIO\n"); - } - else if (hdr->cmd == MFI_CMD_LD_SCSI_IO || + } else if (hdr->cmd == MFI_CMD_LD_SCSI_IO || hdr->cmd == MFI_CMD_LD_READ || hdr->cmd == MFI_CMD_LD_WRITE) { + cm->cm_flags |= MFI_CMD_SCSI; if ((req_desc = mfi_build_and_issue_cmd(sc, cm)) == NULL) { device_printf(sc->mfi_dev, "LDIO Failed \n"); return 1; } - } else - if ((req_desc = mfi_tbolt_build_mpt_cmd(sc, cm)) == NULL) { + } else if ((req_desc = mfi_tbolt_build_mpt_cmd(sc, cm)) == NULL) { device_printf(sc->mfi_dev, "Mapping from MFI to MPT " "Failed\n"); return 1; - } + } + + if (cm->cm_flags & MFI_CMD_SCSI) { + /* + * LD IO needs to be posted since it doesn't get + * acknowledged via a status update so have the + * controller reply via mfi_tbolt_complete_cmd. + */ + hdr->flags &= ~MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + } + MFI_WRITE4(sc, MFI_ILQP, (req_desc->words & 0xFFFFFFFF)); MFI_WRITE4(sc, MFI_IHQP, (req_desc->words >>0x20)); if ((cm->cm_flags & MFI_CMD_POLLED) == 0) return 0; + if (cm->cm_flags & MFI_CMD_SCSI) { + /* check reply queue */ + mfi_tbolt_complete_cmd(sc); + } + /* This is a polled command, so busy-wait for it to complete. */ while (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { DELAY(1000); tm -= 1; if (tm <= 0) - break; + break; + if (cm->cm_flags & MFI_CMD_SCSI) { + /* check reply queue */ + mfi_tbolt_complete_cmd(sc); + } } if (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { @@ -1375,7 +1325,7 @@ mfi_tbolt_sync_map_info(struct mfi_softc free(ld_sync, M_MFIBUF); goto out; } - + context = cmd->cm_frame->header.context; bzero(cmd->cm_frame, sizeof(union mfi_frame)); cmd->cm_frame->header.context = context; Modified: stable/9/sys/dev/mfi/mfivar.h ============================================================================== --- stable/9/sys/dev/mfi/mfivar.h Mon Dec 3 18:34:54 2012 (r243823) +++ stable/9/sys/dev/mfi/mfivar.h Mon Dec 3 18:37:02 2012 (r243824) @@ -106,6 +106,7 @@ struct mfi_command { #define MFI_ON_MFIQ_READY (1<<6) #define MFI_ON_MFIQ_BUSY (1<<7) #define MFI_ON_MFIQ_MASK ((1<<5)|(1<<6)|(1<<7)) +#define MFI_CMD_SCSI (1<<8) uint8_t retry_for_fw_reset; void (* cm_complete)(struct mfi_command *cm); void *cm_private; @@ -126,6 +127,11 @@ struct mfi_disk { #define MFI_DISK_FLAGS_DISABLED 0x02 }; +struct mfi_disk_pending { + TAILQ_ENTRY(mfi_disk_pending) ld_link; + int ld_id; +}; + struct mfi_system_pd { TAILQ_ENTRY(mfi_system_pd) pd_link; device_t pd_dev; @@ -137,6 +143,11 @@ struct mfi_system_pd { int pd_flags; }; +struct mfi_system_pending { + TAILQ_ENTRY(mfi_system_pending) pd_link; + int pd_id; +}; + struct mfi_evt_queue_elm { TAILQ_ENTRY(mfi_evt_queue_elm) link; struct mfi_evt_detail detail; @@ -285,6 +296,8 @@ struct mfi_softc { TAILQ_HEAD(,mfi_disk) mfi_ld_tqh; TAILQ_HEAD(,mfi_system_pd) mfi_syspd_tqh; + TAILQ_HEAD(,mfi_disk_pending) mfi_ld_pend_tqh; + TAILQ_HEAD(,mfi_system_pending) mfi_syspd_pend_tqh; eventhandler_tag mfi_eh; struct cdev *mfi_cdev; @@ -303,6 +316,7 @@ struct mfi_softc { uint32_t frame_cnt); int (*mfi_adp_reset)(struct mfi_softc *sc); int (*mfi_adp_check_reset)(struct mfi_softc *sc); + void (*mfi_intr_ptr)(void *sc); /* ThunderBolt */ uint32_t mfi_tbolt; @@ -421,7 +435,8 @@ extern int mfi_tbolt_reset(struct mfi_so extern void mfi_tbolt_sync_map_info(struct mfi_softc *sc); extern void mfi_handle_map_sync(void *context, int pending); extern int mfi_dcmd_command(struct mfi_softc *, struct mfi_command **, - uint32_t, void **, size_t); + uint32_t, void **, size_t); +extern int mfi_build_cdb(int, uint8_t, u_int64_t, u_int32_t, uint8_t *); #define MFIQ_ADD(sc, qname) \ do { \ From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 4 00:51:30 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78618D58; Tue, 4 Dec 2012 00:51:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 527FC8FC13; Tue, 4 Dec 2012 00:51:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB40pUGd001176; Tue, 4 Dec 2012 00:51:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB40pUZG001173; Tue, 4 Dec 2012 00:51:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212040051.qB40pUZG001173@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 4 Dec 2012 00:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243848 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 00:51:30 -0000 Author: kib Date: Tue Dec 4 00:51:29 2012 New Revision: 243848 URL: http://svnweb.freebsd.org/changeset/base/243848 Log: MFC r242433: Enable the new instructions for reading and writing bases for %fs, %gs, when supported. Enable SMEP when supported. MFC r242828: Do not try to enable new features in the %cr4 if running under hypervisor. Modified: stable/9/sys/amd64/amd64/identcpu.c stable/9/sys/amd64/amd64/initcpu.c stable/9/sys/amd64/amd64/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/identcpu.c Tue Dec 4 00:44:31 2012 (r243847) +++ stable/9/sys/amd64/amd64/identcpu.c Tue Dec 4 00:51:29 2012 (r243848) @@ -481,7 +481,7 @@ SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, void identify_cpu(void) { - u_int regs[4]; + u_int regs[4], cpu_stdext_disable; do_cpuid(0, regs); cpu_high = regs[0]; @@ -516,6 +516,20 @@ identify_cpu(void) if (cpu_high >= 7) { cpuid_count(7, 0, regs); cpu_stdext_feature = regs[1]; + + /* + * Some hypervisors fail to filter out unsupported + * extended features. For now, disable the + * extensions, activation of which requires setting a + * bit in CR4, and which VM monitors do not support. + */ + if (cpu_feature2 & CPUID2_HV) { + cpu_stdext_disable = CPUID_STDEXT_FSGSBASE | + CPUID_STDEXT_SMEP; + } else + cpu_stdext_disable = 0; + TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable); + cpu_stdext_feature &= ~cpu_stdext_disable; } if (cpu_vendor_id == CPU_VENDOR_INTEL || Modified: stable/9/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/initcpu.c Tue Dec 4 00:44:31 2012 (r243847) +++ stable/9/sys/amd64/amd64/initcpu.c Tue Dec 4 00:51:29 2012 (r243848) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -153,11 +154,25 @@ void initializecpu(void) { uint64_t msr; + uint32_t cr4; + cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { - load_cr4(rcr4() | CR4_FXSR | CR4_XMM); + cr4 |= CR4_FXSR | CR4_XMM; cpu_fxsr = hw_instruction_sse = 1; } + if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) + cr4 |= CR4_FSGSBASE; + + /* + * Postpone enabling the SMEP on the boot CPU until the page + * tables are switched from the boot loader identity mapping + * to the kernel tables. The boot loader enables the U bit in + * its tables. + */ + if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP)) + cr4 |= CR4_SMEP; + load_cr4(cr4); if ((amd_feature & AMDID_NX) != 0) { msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Tue Dec 4 00:44:31 2012 (r243847) +++ stable/9/sys/amd64/amd64/pmap.c Tue Dec 4 00:51:29 2012 (r243848) @@ -629,6 +629,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* XXX do %cr0 as well */ load_cr4(rcr4() | CR4_PGE | CR4_PSE); load_cr3(KPML4phys); + if (cpu_stdext_feature & CPUID_STDEXT_SMEP) + load_cr4(rcr4() | CR4_SMEP); /* * Initialize the kernel pmap (which is statically allocated). From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 4 00:54:49 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DB09C2; Tue, 4 Dec 2012 00:54:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7196F8FC14; Tue, 4 Dec 2012 00:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB40snSm001980; Tue, 4 Dec 2012 00:54:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB40snD5001979; Tue, 4 Dec 2012 00:54:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212040054.qB40snD5001979@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 4 Dec 2012 00:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243850 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 00:54:49 -0000 Author: kib Date: Tue Dec 4 00:54:49 2012 New Revision: 243850 URL: http://svnweb.freebsd.org/changeset/base/243850 Log: MFC r243341: Add a special meaning to the negative ticks argument for taskqueue_enqueue_timeout(). Do not rearm the callout if it is already armed and the ticks is negative. Otherwise rearm it to fire in abs(ticks) ticks in the future. Modified: stable/9/sys/kern/subr_taskqueue.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_taskqueue.c ============================================================================== --- stable/9/sys/kern/subr_taskqueue.c Tue Dec 4 00:53:20 2012 (r243849) +++ stable/9/sys/kern/subr_taskqueue.c Tue Dec 4 00:54:49 2012 (r243850) @@ -252,9 +252,13 @@ taskqueue_enqueue_timeout(struct taskque } else { queue->tq_callouts++; timeout_task->f |= DT_CALLOUT_ARMED; + if (ticks < 0) + ticks = -ticks; /* Ignore overflow. */ + } + if (ticks > 0) { + callout_reset(&timeout_task->c, ticks, + taskqueue_timeout_func, timeout_task); } - callout_reset(&timeout_task->c, ticks, taskqueue_timeout_func, - timeout_task); } TQ_UNLOCK(queue); return (res); From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 4 00:57:12 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66D0132B; Tue, 4 Dec 2012 00:57:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 324978FC14; Tue, 4 Dec 2012 00:57:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB40vCOj002594; Tue, 4 Dec 2012 00:57:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB40vCHQ002593; Tue, 4 Dec 2012 00:57:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212040057.qB40vCHQ002593@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 4 Dec 2012 00:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243851 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 00:57:12 -0000 Author: kib Date: Tue Dec 4 00:57:11 2012 New Revision: 243851 URL: http://svnweb.freebsd.org/changeset/base/243851 Log: MFC r243342: Schedule garbage collection run for the in-flight rights passed over the unix domain sockets to the next tick, coalescing the serial calls until the collection fires. Modified: stable/9/sys/kern/uipc_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_usrreq.c ============================================================================== --- stable/9/sys/kern/uipc_usrreq.c Tue Dec 4 00:54:49 2012 (r243850) +++ stable/9/sys/kern/uipc_usrreq.c Tue Dec 4 00:57:11 2012 (r243851) @@ -131,7 +131,7 @@ static const struct sockaddr sun_noname * reentrance in the UNIX domain socket, file descriptor, and socket layer * code. See unp_gc() for a full description. */ -static struct task unp_gc_task; +static struct timeout_task unp_gc_task; /* * The close of unix domain sockets attached as SCM_RIGHTS is @@ -681,7 +681,7 @@ uipc_detach(struct socket *so) VFS_UNLOCK_GIANT(vfslocked); } if (local_unp_rights) - taskqueue_enqueue(taskqueue_thread, &unp_gc_task); + taskqueue_enqueue_timeout(taskqueue_thread, &unp_gc_task, -1); } static int @@ -1801,7 +1801,7 @@ unp_init(void) LIST_INIT(&unp_shead); LIST_INIT(&unp_sphead); SLIST_INIT(&unp_defers); - TASK_INIT(&unp_gc_task, 0, unp_gc, NULL); + TIMEOUT_TASK_INIT(taskqueue_thread, &unp_gc_task, 0, unp_gc, NULL); TASK_INIT(&unp_defer_task, 0, unp_process_defers, NULL); UNP_LINK_LOCK_INIT(); UNP_LIST_LOCK_INIT(); From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 4 00:58:40 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEEF6496 for ; Tue, 4 Dec 2012 00:58:40 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 705AF8FC15 for ; Tue, 4 Dec 2012 00:58:40 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo14so3221543vcb.13 for ; Mon, 03 Dec 2012 16:58:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=D2KNycFzkWDU3xoFdmvPL17uA/44FkmP35SRDQ6naqM=; b=e193GN7iLorLl/TGmhapkQHB2+0xpOT+CuwKMedS1WBsfYroyBprfENLN1o7jG2MQf rW94D+6rfeHZpeFUowp8GL6LuOXArvZt6qfe1Usuyr8VaEZ41/isT5ewRs+StQCq+wYY 0e20ossUgH1GiIAgNxXQ+f5MoImDc0xMfvlKM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=D2KNycFzkWDU3xoFdmvPL17uA/44FkmP35SRDQ6naqM=; b=b7ybwNmDwExb0tIgnVQl6Aoq3oFp2YafGI7Lx57lWjoHsWH/uqk76d3lufgheQjsT5 jkeU0xtICrndJq/t3Fg7SWpn0jNYoI5XuMxwGOBhNFh512lw9KwHoVMvcpPHXkyoIjAL SGeyJsChekOtEmk99AP1CEnIQfIPxWJfN8/VxYHCOMS35EQ9m0ULfR/ZRWZHT/zHHnQ4 bYW9MGfs4sWMGOEaEenuXqDXrnC9LYYQj/+baUP5zAz1S6srg1RoRmN5nSP5EPEDYMSv vWokJA8bho9rb1/NkCTtRnXlMRb/9R7Pa7Gy84Hmne91Wqv/21/WeZhCSbpy9uZ8jjyJ ye0g== Received: by 10.221.2.69 with SMTP id nt5mr10129584vcb.68.1354582719472; Mon, 03 Dec 2012 16:58:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.55.201 with HTTP; Mon, 3 Dec 2012 16:58:09 -0800 (PST) In-Reply-To: <201212040054.qB40snD5001979@svn.freebsd.org> References: <201212040054.qB40snD5001979@svn.freebsd.org> From: Eitan Adler Date: Mon, 3 Dec 2012 19:58:09 -0500 Message-ID: Subject: Re: svn commit: r243850 - stable/9/sys/kern To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkMNTPYDcsm8+TeF8+UsGufxeOxj4Ys9vDJe5CeC12uLIZL72EaJDRIxPNPCKNcEvXE/UWr Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 00:58:41 -0000 On 3 December 2012 19:54, Konstantin Belousov wrote: > Author: kib > Date: Tue Dec 4 00:54:49 2012 > New Revision: 243850 > URL: http://svnweb.freebsd.org/changeset/base/243850 > > Log: > MFC r243341: > Add a special meaning to the negative ticks argument for > taskqueue_enqueue_timeout(). Do not rearm the callout if it is > already armed and the ticks is negative. Otherwise rearm it to fire > in abs(ticks) ticks in the future. Why was this not MFCed together with r243845 ? -- Eitan Adler From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 4 01:47:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91506635; Tue, 4 Dec 2012 01:47:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 0F9198FC17; Tue, 4 Dec 2012 01:47:00 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qB41ktKv002698; Tue, 4 Dec 2012 03:46:55 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qB41ktKv002698 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qB41ktHZ002697; Tue, 4 Dec 2012 03:46:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Dec 2012 03:46:55 +0200 From: Konstantin Belousov To: Eitan Adler Subject: Re: svn commit: r243850 - stable/9/sys/kern Message-ID: <20121204014655.GN3013@kib.kiev.ua> References: <201212040054.qB40snD5001979@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aaeYxw/B9teUOk8U" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 01:47:01 -0000 --aaeYxw/B9teUOk8U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 03, 2012 at 07:58:09PM -0500, Eitan Adler wrote: > On 3 December 2012 19:54, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Dec 4 00:54:49 2012 > > New Revision: 243850 > > URL: http://svnweb.freebsd.org/changeset/base/243850 > > > > Log: > > MFC r243341: > > Add a special meaning to the negative ticks argument for > > taskqueue_enqueue_timeout(). Do not rearm the callout if it is > > already armed and the ticks is negative. Otherwise rearm it to fire > > in abs(ticks) ticks in the future. >=20 > Why was this not MFCed together with r243845 ? Because r243845 was only committed today, and I do not see a need to postpone the merge of the fix for the (rare) bug. Less formal, I do not see much use in the single commit spanning both sys and non-sys. We almost never should have such interlock, otherwise ABI issues would cause troubles for people updating the system. And spanning commits are somewhat more cumbersome to both merge, revert and for non-developer to pick. --aaeYxw/B9teUOk8U Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQvVYOAAoJEJDCuSvBvK1B0OwP/0a2FhkePmZDTj0PbKYtr4Xz 2FwooqSVQjBSHd2H7EiZoVGOUGBrrzP2r6KzgA8L5ipgLlasnW3MGBoiXF1wu8z9 gju6aV8SoH4+kp1pjG/Z/VSLeqc8qO4245yczdY2Ska1HDpuiVBrQqv8XW0r1+PI vprfjz6LWXg5lNbK8KzZ5hSB+OoRCGxhYLD/ngX0kJax6O8J7yC5ZM8YK3sML505 Q10B3bTq7AcqUBHi3hLi7LVqq4lXGdyJeE01aVcyxUXQqzkY9rQOW4sRBrGPfI6G EY1b4djmZ/TY5hq3FNCJOmwW4lR0RXfcUTpZehXqtQxQDw5rodIP2NFfCfdW/5nz cz4UegNIB45A4hqeZXViqBgsTrV4sNrC6T61pD2LdAXe4QrbLuDJ5jyJhCQQKqo5 umXLBM5nl2W6KOHe4ZS67hqWgAcU0KS2XwaxFEwD6mObnLcZFqjqpn44CUHLotAi KBlxWBlHIwI7gTzm+RCuhMafaRtv4UhefNQ0qLuCuigIfFbQx3YncjOco/tgG4Gv 1QaBDxw4gpf1Wisl/qPpGRnLRcU7CWbAqALJ8MYPiOB3XAWf/MqIXRGO79/N9O/k ZFG3H3Z83z01ubXNtXj+DLejJAtssty9F9OhnkSiWL3X93sJsmCrztvlpSTHPaK9 +hij9S2MAvxPT9YRxTXB =1mgo -----END PGP SIGNATURE----- --aaeYxw/B9teUOk8U-- From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 4 02:30:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E33EB437 for ; Tue, 4 Dec 2012 02:30:44 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx1.freebsd.org (Postfix) with ESMTP id 897B18FC0C for ; Tue, 4 Dec 2012 02:30:44 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id p1so3031169vbi.18 for ; Mon, 03 Dec 2012 18:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ue6aIzqgyop838pp2/p8P62fh2N1ovIeoPVLr/T6jSQ=; b=F4QYYhzmi3f9esYpvaIqowcOgDCoZf5B1PjFrrXw5Qj4WAPlpHzpw3oIk1SYqfaRMa N1GMOSErWOmcyJPmY0yqJUoNBpbKO3u4k0MpdBt3U6ojO7tGtyxl2+VQ01d4noEt2a/e s3zxjiqaTZG1JV5b+DKEC/xt0WbiS3CHPwc20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=ue6aIzqgyop838pp2/p8P62fh2N1ovIeoPVLr/T6jSQ=; b=M2waEQHoGxiRQzYi2ZsbbfKspAnjYJoSeQzxT9cWWz4m78o4O4knBxNIQGWGf3+EcO I6pezhCvNESaIqyyg+EbCnrXLthIWScMuMGyNqmvyY0bEHU40fFEowJcnyrTNpsSIeyi SGPVih6CZKYNNl/rmO4NRHJOPfJHapZxhVeq+6AyssmLwOF8yaAhHLPuZy9FKsMZ1pWc yexnHsxzHKKXP20W2zhI3kqz5Y+hSSyciZjReKEcuQEvqUOA+doOkt+qB2Yrqllcg41D YzaJPcsH7631ZgfU5kyU+x6boWEJBErRw/irIpvpCZKUvfic4Wlm8dXjlKDrYuPgNQp6 xGzQ== Received: by 10.52.22.240 with SMTP id h16mr9056570vdf.82.1354588243624; Mon, 03 Dec 2012 18:30:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.55.201 with HTTP; Mon, 3 Dec 2012 18:30:13 -0800 (PST) In-Reply-To: <20121204014655.GN3013@kib.kiev.ua> References: <201212040054.qB40snD5001979@svn.freebsd.org> <20121204014655.GN3013@kib.kiev.ua> From: Eitan Adler Date: Mon, 3 Dec 2012 21:30:13 -0500 Message-ID: Subject: Re: svn commit: r243850 - stable/9/sys/kern To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmKvLy2ATme8F09DMKjGW58f6rEYgM6s8E0PUKEvXlWZPQesMiWz/9CbcrkT57WP1GZhnY2 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 02:30:45 -0000 On 3 December 2012 20:46, Konstantin Belousov wrote: > Less formal, I do not see much use in the single commit spanning both > sys and non-sys. We almost never should have such interlock, otherwise > ABI issues would cause troubles for people updating the system. > And spanning commits are somewhat more cumbersome to both merge, > revert and for non-developer to pick. This isn't an issue of sys and non-sys being tied together. This is one of documentation and feature being committed together. -- Eitan Adler From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 5 22:47:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 187B320C; Wed, 5 Dec 2012 22:47:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4D808FC12; Wed, 5 Dec 2012 22:47:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB5MljhI052052; Wed, 5 Dec 2012 22:47:45 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB5MljmH052051; Wed, 5 Dec 2012 22:47:45 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201212052247.qB5MljmH052051@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 5 Dec 2012 22:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243913 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2012 22:47:46 -0000 Author: pfg Date: Wed Dec 5 22:47:45 2012 New Revision: 243913 URL: http://svnweb.freebsd.org/changeset/base/243913 Log: MFC r243641: Partially bring r242520 to ext2fs. When a file is first being written, the dynamic block reallocation (implemented by ext2_reallocblks) relocates the file's blocks so as to cluster them together into a contiguous set of blocks on the disk. When the cluster crosses the boundary into the first indirect block, the first indirect block is initially allocated in a position immediately following the last direct block. Block reallocation would usually destroy locality by moving the indirect block out of the way to keep the data blocks contiguous. The issue was diagnosed long ago by Bruce Evans on ffs and surfaced on ext2fs when block reallocaton was ported. This is only a partial solution based on the similarities with FFS. We still require more review of the allocation details that vary in ext2fs. Reported by: bde Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Wed Dec 5 22:32:12 2012 (r243912) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Wed Dec 5 22:47:45 2012 (r243913) @@ -197,6 +197,18 @@ ext2_reallocblks(ap) panic("ext2_reallocblks: non-cluster"); #endif /* + * If the cluster crosses the boundary for the first indirect + * block, leave space for the indirect block. Indirect blocks + * are initially laid out in a position after the last direct + * block. Block reallocation would usually destroy locality by + * moving the indirect block out of the way to make room for + * data blocks if we didn't compensate here. We should also do + * this for other indirect block boundaries, but it is only + * important for the first one. + */ + if (start_lbn < NDADDR && end_lbn >= NDADDR) + return (ENOSPC); + /* * If the latest allocation is in a new cylinder group, assume that * the filesystem has decided to move and do not force it back to * the previous cylinder group. From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 00:25:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C47724C8; Thu, 6 Dec 2012 00:25:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8EED8FC13; Thu, 6 Dec 2012 00:25:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB60PgVQ018180; Thu, 6 Dec 2012 00:25:42 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB60PgKL018179; Thu, 6 Dec 2012 00:25:42 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212060025.qB60PgKL018179@svn.freebsd.org> From: Glen Barber Date: Thu, 6 Dec 2012 00:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243923 - stable/9/release X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 00:25:42 -0000 Author: gjb (doc,ports committer) Date: Thu Dec 6 00:25:42 2012 New Revision: 243923 URL: http://svnweb.freebsd.org/changeset/base/243923 Log: MFC r242897: Prevent including .zfs snapshot directories in the src.txz distribution. This can happen if the src/ tree checkout is within its own ZFS dataset, and the 'snapdir' ZFS property is set to 'visible.' Modified: stable/9/release/Makefile Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/Makefile ============================================================================== --- stable/9/release/Makefile Thu Dec 6 00:17:25 2012 (r243922) +++ stable/9/release/Makefile Thu Dec 6 00:25:42 2012 (r243923) @@ -80,7 +80,7 @@ kernel.txz: src.txz: -mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src - cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn \ + cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \ --exclude CVS --exclude @ --exclude usr/src/release/dist usr/src ports.txz: From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 08:35:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B5C7BA6; Thu, 6 Dec 2012 08:35:47 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFBA8FC18; Thu, 6 Dec 2012 08:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB68Zkml099715; Thu, 6 Dec 2012 08:35:46 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB68ZkGe099714; Thu, 6 Dec 2012 08:35:46 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201212060835.qB68ZkGe099714@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 6 Dec 2012 08:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243942 - stable/9/sbin/fsck_msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 08:35:47 -0000 Author: jh Date: Thu Dec 6 08:35:46 2012 New Revision: 243942 URL: http://svnweb.freebsd.org/changeset/base/243942 Log: MFC r242511: Print a newline after the error message. PR: bin/168447 Modified: stable/9/sbin/fsck_msdosfs/check.c Directory Properties: stable/9/sbin/fsck_msdosfs/ (props changed) Modified: stable/9/sbin/fsck_msdosfs/check.c ============================================================================== --- stable/9/sbin/fsck_msdosfs/check.c Thu Dec 6 08:32:28 2012 (r243941) +++ stable/9/sbin/fsck_msdosfs/check.c Thu Dec 6 08:35:46 2012 (r243942) @@ -68,6 +68,7 @@ checkfilesys(const char *fname) if (dosfs < 0) { perror("Can't open"); + printf("\n"); return 8; } From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 11:52:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9820FB57; Thu, 6 Dec 2012 11:52:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 623E48FC08; Thu, 6 Dec 2012 11:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB6BqWtW035290; Thu, 6 Dec 2012 11:52:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB6BqV1r035287; Thu, 6 Dec 2012 11:52:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212061152.qB6BqV1r035287@svn.freebsd.org> From: Robert Watson Date: Thu, 6 Dec 2012 11:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243947 - in stable/9/etc: . mail X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 11:52:32 -0000 Author: rwatson Date: Thu Dec 6 11:52:31 2012 New Revision: 243947 URL: http://svnweb.freebsd.org/changeset/base/243947 Log: Early MFC of portions of r243752 adding an auditdistd user to stable/8 in order to ease future upgrades; the remainder of r243752 is left for a future MFC of the OpenBSM upgrade: Merge a number of changes required to hook up OpenBSM 1.2-alpha2's auditdistd (distributed audit daemon) to the build: - Manual cross references - Makefile for auditdistd - rc.d script, rc.conf entrie - New group and user for auditdistd; associated aliases, etc. The audit trail distribution daemon provides reliable, cryptographically protected (and sandboxed) delivery of audit tails from live clients to audit server hosts in order to both allow centralised analysis, and improve resilience in the event of client compromises: clients are not permitted to change trail contents after submission. Submitted by: pjd Sponsored by: The FreeBSD Foundation (auditdistd) Modified: stable/9/etc/ftpusers stable/9/etc/mail/aliases stable/9/etc/master.passwd Modified: stable/9/etc/ftpusers ============================================================================== --- stable/9/etc/ftpusers Thu Dec 6 08:45:43 2012 (r243946) +++ stable/9/etc/ftpusers Thu Dec 6 11:52:31 2012 (r243947) @@ -19,6 +19,7 @@ _pflogd _dhcp uucp pop +auditdistd www hast nobody Modified: stable/9/etc/mail/aliases ============================================================================== --- stable/9/etc/mail/aliases Thu Dec 6 08:45:43 2012 (r243946) +++ stable/9/etc/mail/aliases Thu Dec 6 11:52:31 2012 (r243947) @@ -26,6 +26,7 @@ postmaster: root # General redirections for pseudo accounts _dhcp: root _pflogd: root +auditdistd: root bin: root bind: root daemon: root Modified: stable/9/etc/master.passwd ============================================================================== --- stable/9/etc/master.passwd Thu Dec 6 08:45:43 2012 (r243946) +++ stable/9/etc/master.passwd Thu Dec 6 11:52:31 2012 (r243947) @@ -19,6 +19,7 @@ _pflogd:*:64:64::0:0:pflogd privsep user _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 11:55:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C404E55; Thu, 6 Dec 2012 11:55:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3CD338FC08; Thu, 6 Dec 2012 11:55:26 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id BC97646B32; Thu, 6 Dec 2012 06:55:25 -0500 (EST) Date: Thu, 6 Dec 2012 11:55:25 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r243947 - in stable/9/etc: . mail In-Reply-To: <201212061152.qB6BqV1r035287@svn.freebsd.org> Message-ID: References: <201212061152.qB6BqV1r035287@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 11:55:26 -0000 On Thu, 6 Dec 2012, Robert Watson wrote: > Log: > Early MFC of portions of r243752 adding an auditdistd user to stable/8 > in order to ease future upgrades; the remainder of r243752 is left for > a future MFC of the OpenBSM upgrade: This should have read 'stable/9' rather than 'stable/8', but hopefully everyone who cared figured that out already. :-) Robert From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 17:00:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D12BC870; Thu, 6 Dec 2012 17:00:54 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 802B68FC14; Thu, 6 Dec 2012 17:00:54 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 1C8741A3C6E; Thu, 6 Dec 2012 09:00:54 -0800 (PST) Message-ID: <50C0CF44.6040802@mu.org> Date: Thu, 06 Dec 2012 09:00:52 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jaakko Heinonen Subject: Re: svn commit: r243942 - stable/9/sbin/fsck_msdosfs References: <201212060835.qB68ZkGe099714@svn.freebsd.org> In-Reply-To: <201212060835.qB68ZkGe099714@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 17:00:55 -0000 On 12/6/12 12:35 AM, Jaakko Heinonen wrote: > Author: jh > Date: Thu Dec 6 08:35:46 2012 > New Revision: 243942 > URL: http://svnweb.freebsd.org/changeset/base/243942 > > Log: > MFC r242511: Print a newline after the error message. > > PR: bin/168447 > > Modified: > stable/9/sbin/fsck_msdosfs/check.c > Directory Properties: > stable/9/sbin/fsck_msdosfs/ (props changed) > > Modified: stable/9/sbin/fsck_msdosfs/check.c > ============================================================================== > --- stable/9/sbin/fsck_msdosfs/check.c Thu Dec 6 08:32:28 2012 (r243941) > +++ stable/9/sbin/fsck_msdosfs/check.c Thu Dec 6 08:35:46 2012 (r243942) > @@ -68,6 +68,7 @@ checkfilesys(const char *fname) > > if (dosfs < 0) { > perror("Can't open"); > + printf("\n"); > return 8; > } > > I think perror writes to STDERR, printf to STDOUT. (am I wrong?) Does fsck_msdosfs tie the two together? You might better use warn()? sorry if this is superfluous concern, it just popped out as potentially wrong. -Alfred From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 18:23:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D608CE1; Thu, 6 Dec 2012 18:23:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2648FC08; Thu, 6 Dec 2012 18:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB6INOQp008531; Thu, 6 Dec 2012 18:23:24 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB6INNOd008527; Thu, 6 Dec 2012 18:23:23 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201212061823.qB6INNOd008527@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 6 Dec 2012 18:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243952 - stable/9/sys/dev/cxgbe/tom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 18:23:24 -0000 Author: np Date: Thu Dec 6 18:23:23 2012 New Revision: 243952 URL: http://svnweb.freebsd.org/changeset/base/243952 Log: MFC r243680, r243681. r243680: cxgbe/tom: Add a flag to indicate that the L2 table entry for an embryonic connection has been setup and never attempt to abort a tid before this is done. This fixes a bad race where a listening socket is closed when the driver is in the middle of step (b) here. The symptom of this were "ARP miss" errors from the driver followed by tid leaks. A hardware-offloaded passive open works this way: a) A SYN "hits" the TCAM entry for a server tid and the chip delivers it to the queue associated with the server tid (say, queue A). It waits for a response from the driver telling it what to do. b) The driver decides it is ok to proceed. It adds the new tid to the list of embryonic connections associated with the server tid and then hands off the SYN to the kernel's syncache to make sure that the kernel okays it too. If it does then the driver provides an L2 table entry, queue id (say, queue B), etc. and instructs the chip to send the SYN/ACK response. c) The chip delivers a status to queue B depending on how the third step of the 3-way handshake goes. The driver removes the tid from its list of embryonic connections and either expands the syncache entry or destroys the tid. In any case all subsequent messages for the new tid will be delivered to queue B, not queue A. Anything running in queue B knows that the L2 entry has long been setup and the new flag is of no interest from here on. If the listener is closed it will deal with so_comp as normal. r243681: cxgbe/tom: Handle the case where the chip falls out of DDP mode by itself. The hole in the receive sequence space corresponds to the number of bytes placed directly up to that point. Submittey by: Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c stable/9/sys/dev/cxgbe/tom/t4_ddp.c stable/9/sys/dev/cxgbe/tom/t4_listen.c stable/9/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Dec 6 15:36:24 2012 (r243951) +++ stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Dec 6 18:23:23 2012 (r243952) @@ -786,6 +786,29 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(opcode == CPL_PEER_CLOSE, ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); + + if (__predict_false(toep->flags & TPF_SYNQE)) { +#ifdef INVARIANTS + struct synq_entry *synqe = (void *)toep; + + INP_WLOCK(synqe->lctx->inp); + if (synqe->flags & TPF_SYNQE_HAS_L2TE) { + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, + ("%s: listen socket closed but tid %u not aborted.", + __func__, tid)); + } else { + /* + * do_pass_accept_req is still running and will + * eventually take care of this tid. + */ + } + INP_WUNLOCK(synqe->lctx->inp); +#endif + CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, + toep, toep->flags); + return (0); + } + KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); INP_INFO_WLOCK(&V_tcbinfo); @@ -1090,15 +1113,27 @@ do_rx_data(struct sge_iq *iq, const stru struct socket *so; struct sockbuf *sb; int len; + uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { - /* - * do_pass_establish failed and must be attempting to abort the - * synqe's tid. Meanwhile, the T4 has sent us data for such a - * connection. - */ - KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, - ("%s: synqe and tid isn't being aborted.", __func__)); +#ifdef INVARIANTS + struct synq_entry *synqe = (void *)toep; + + INP_WLOCK(synqe->lctx->inp); + if (synqe->flags & TPF_SYNQE_HAS_L2TE) { + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, + ("%s: listen socket closed but tid %u not aborted.", + __func__, tid)); + } else { + /* + * do_pass_accept_req is still running and will + * eventually take care of this tid. + */ + } + INP_WUNLOCK(synqe->lctx->inp); +#endif + CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, + toep, toep->flags); m_freem(m); return (0); } @@ -1120,13 +1155,8 @@ do_rx_data(struct sge_iq *iq, const stru tp = intotcpcb(inp); -#ifdef INVARIANTS - if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq))) { - log(LOG_ERR, - "%s: unexpected seq# %x for TID %u, rcv_nxt %x\n", - __func__, be32toh(cpl->seq), toep->tid, tp->rcv_nxt); - } -#endif + if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq))) + ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt; tp->rcv_nxt += len; KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); @@ -1173,12 +1203,20 @@ do_rx_data(struct sge_iq *iq, const stru int changed = !(toep->ddp_flags & DDP_ON) ^ cpl->ddp_off; if (changed) { - if (__predict_false(!(toep->ddp_flags & DDP_SC_REQ))) { - /* XXX: handle this if legitimate */ - panic("%s: unexpected DDP state change %d", - __func__, cpl->ddp_off); + if (toep->ddp_flags & DDP_SC_REQ) + toep->ddp_flags ^= DDP_ON | DDP_SC_REQ; + else { + KASSERT(cpl->ddp_off == 1, + ("%s: DDP switched on by itself.", + __func__)); + + /* Fell out of DDP mode */ + toep->ddp_flags &= ~(DDP_ON | DDP_BUF0_ACTIVE | + DDP_BUF1_ACTIVE); + + if (ddp_placed) + insert_ddp_data(toep, ddp_placed); } - toep->ddp_flags ^= DDP_ON | DDP_SC_REQ; } if ((toep->ddp_flags & DDP_OK) == 0 && Modified: stable/9/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_ddp.c Thu Dec 6 15:36:24 2012 (r243951) +++ stable/9/sys/dev/cxgbe/tom/t4_ddp.c Thu Dec 6 18:23:23 2012 (r243952) @@ -205,6 +205,42 @@ release_ddp_resources(struct toepcb *toe } } +/* XXX: handle_ddp_data code duplication */ +void +insert_ddp_data(struct toepcb *toep, uint32_t n) +{ + struct inpcb *inp = toep->inp; + struct tcpcb *tp = intotcpcb(inp); + struct sockbuf *sb = &inp->inp_socket->so_rcv; + struct mbuf *m; + + INP_WLOCK_ASSERT(inp); + SOCKBUF_LOCK_ASSERT(sb); + + m = m_get(M_NOWAIT, MT_DATA); + if (m == NULL) + CXGBE_UNIMPLEMENTED("mbuf alloc failure"); + m->m_len = n; + m->m_flags |= M_DDP; /* Data is already where it should be */ + m->m_data = "nothing to see here"; + + tp->rcv_nxt += n; +#ifndef USE_DDP_RX_FLOW_CONTROL + KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); + tp->rcv_wnd -= n; +#endif + + KASSERT(toep->sb_cc >= sb->sb_cc, + ("%s: sb %p has more data (%d) than last time (%d).", + __func__, sb, sb->sb_cc, toep->sb_cc)); + toep->rx_credits += toep->sb_cc - sb->sb_cc; +#ifdef USE_DDP_RX_FLOW_CONTROL + toep->rx_credits -= n; /* adjust for F_RX_FC_DDP */ +#endif + sbappendstream_locked(sb, m); + toep->sb_cc = sb->sb_cc; +} + /* SET_TCB_FIELD sent as a ULP command looks like this */ #define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Thu Dec 6 15:36:24 2012 (r243951) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Thu Dec 6 18:23:23 2012 (r243952) @@ -282,8 +282,8 @@ send_reset_synqe(struct toedev *tod, str INP_WLOCK_ASSERT(synqe->lctx->inp); - CTR4(KTR_CXGBE, "%s: synqe %p, tid %d%s", - __func__, synqe, synqe->tid, + CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s", + __func__, synqe, synqe->flags, synqe->tid, synqe->flags & TPF_ABORT_SHUTDOWN ? " (abort already in progress)" : ""); if (synqe->flags & TPF_ABORT_SHUTDOWN) @@ -501,8 +501,10 @@ t4_listen_stop(struct toedev *tod, struc * socket's so_comp. It doesn't know about the connections on the synq * so we need to take care of those. */ - TAILQ_FOREACH(synqe, &lctx->synq, link) - send_reset_synqe(tod, synqe); + TAILQ_FOREACH(synqe, &lctx->synq, link) { + if (synqe->flags & TPF_SYNQE_HAS_L2TE) + send_reset_synqe(tod, synqe); + } destroy_server(sc, lctx); return (0); @@ -1131,8 +1133,7 @@ do_pass_accept_req(struct sge_iq *iq, co synqe->lctx = lctx; synqe->syn = m; m = NULL; - refcount_init(&synqe->refcnt, 1); /* 1 so that it is held for the - duration of this function */ + refcount_init(&synqe->refcnt, 0); synqe->l2e_idx = e->idx; synqe->rcv_bufsize = rx_credits; atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); @@ -1155,46 +1156,9 @@ do_pass_accept_req(struct sge_iq *iq, co * If we replied during syncache_add (synqe->wr has been consumed), * good. Otherwise, set it to 0 so that further syncache_respond * attempts by the kernel will be ignored. - * - * The extra hold on the synqe makes sure that it is still around, even - * if the listener has been dropped and the synqe was aborted and the - * reply to the abort has removed and released the synqe from the synq - * list. */ if (atomic_cmpset_ptr(&synqe->wr, (uintptr_t)wr, 0)) { - INP_WLOCK(inp); - if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* listener closed. synqe must have been aborted. */ - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listener %p closed but synqe %p not aborted", - __func__, inp, synqe)); - - CTR5(KTR_CXGBE, - "%s: stid %u, tid %u, lctx %p, synqe %p, ABORTED", - __func__, stid, tid, lctx, synqe); - INP_WUNLOCK(inp); - free(wr, M_CXGBE); - release_synqe(synqe); /* about to exit function */ - return (__LINE__); - } - - /* - * synqe aborted before TOM replied to PASS_ACCEPT_REQ. But - * that can only happen if the listener was closed and we just - * checked for that. - */ - KASSERT(!(synqe->flags & TPF_ABORT_SHUTDOWN), - ("%s: synqe %p aborted, but listener %p not dropped.", - __func__, synqe, inp)); - - /* Yank the synqe out of the lctx synq. */ - TAILQ_REMOVE(&lctx->synq, synqe, link); - release_synqe(synqe); /* removed from synq list */ - inp = release_lctx(sc, lctx); - if (inp) - INP_WUNLOCK(inp); - /* * syncache may or may not have a hold on the synqe, which may * or may not be stashed in the original SYN mbuf passed to us. @@ -1205,13 +1169,39 @@ do_pass_accept_req(struct sge_iq *iq, co m->m_pkthdr.rcvif = ifp; remove_tid(sc, synqe->tid); - release_synqe(synqe); /* about to exit function */ free(wr, M_CXGBE); + + /* Yank the synqe out of the lctx synq. */ + INP_WLOCK(inp); + TAILQ_REMOVE(&lctx->synq, synqe, link); + release_synqe(synqe); /* removed from synq list */ + inp = release_lctx(sc, lctx); + if (inp) + INP_WUNLOCK(inp); + REJECT_PASS_ACCEPT(); } - release_synqe(synqe); /* about to exit function */ + CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK", __func__, stid, tid, lctx, synqe); + + INP_WLOCK(inp); + synqe->flags |= TPF_SYNQE_HAS_L2TE; + if (__predict_false(inp->inp_flags & INP_DROPPED)) { + /* + * Listening socket closed but tod_listen_stop did not abort + * this tid because there was no L2T entry for the tid at that + * time. Abort it now. The reply to the abort will clean up. + */ + CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, ABORT", + __func__, stid, tid, lctx, synqe); + send_reset_synqe(tod, synqe); + INP_WUNLOCK(inp); + + return (__LINE__); + } + INP_WUNLOCK(inp); + return (0); reject: CTR4(KTR_CXGBE, "%s: stid %u, tid %u, REJECT (%d)", __func__, stid, tid, @@ -1293,15 +1283,12 @@ do_pass_establish(struct sge_iq *iq, con __func__, stid, tid, synqe, synqe->flags, inp->inp_flags); if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* - * The listening socket has closed. The TOM must have aborted - * all the embryonic connections (including this one) that were - * on the lctx's synq. do_abort_rpl for the tid is responsible - * for cleaning up. - */ - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket dropped but tid %u not aborted.", - __func__, tid)); + + if (synqe->flags & TPF_SYNQE_HAS_L2TE) { + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, + ("%s: listen socket closed but tid %u not aborted.", + __func__, tid)); + } INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -1321,7 +1308,12 @@ do_pass_establish(struct sge_iq *iq, con toep = alloc_toepcb(pi, txqid, rxqid, M_NOWAIT); if (toep == NULL) { reset: - /* The reply to this abort will perform final cleanup */ + /* + * The reply to this abort will perform final cleanup. There is + * no need to check for HAS_L2TE here. We can be here only if + * we responded to the PASS_ACCEPT_REQ, and our response had the + * L2T idx. + */ send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); Modified: stable/9/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_tom.h Thu Dec 6 15:36:24 2012 (r243951) +++ stable/9/sys/dev/cxgbe/tom/t4_tom.h Thu Dec 6 18:23:23 2012 (r243952) @@ -67,6 +67,7 @@ enum { TPF_SYNQE_NEEDFREE = (1 << 9), /* synq_entry was malloc'd separately */ TPF_SYNQE_TCPDDP = (1 << 10), /* ulp_mode TCPDDP in toepcb */ TPF_SYNQE_EXPANDED = (1 << 11), /* toepcb ready, tid context updated */ + TPF_SYNQE_HAS_L2TE = (1 << 12), /* we've replied to PASS_ACCEPT_REQ */ }; enum { @@ -272,4 +273,5 @@ int t4_soreceive_ddp(struct socket *, st struct mbuf **, struct mbuf **, int *); void enable_ddp(struct adapter *, struct toepcb *toep); void release_ddp_resources(struct toepcb *toep); +void insert_ddp_data(struct toepcb *, uint32_t); #endif From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 18:35:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5825C414; Thu, 6 Dec 2012 18:35:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BAB78FC18; Thu, 6 Dec 2012 18:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB6IZ1xK010580; Thu, 6 Dec 2012 18:35:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB6IZ18d010579; Thu, 6 Dec 2012 18:35:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212061835.qB6IZ18d010579@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Dec 2012 18:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243953 - stable/9/sys/netgraph X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 18:35:01 -0000 Author: mav Date: Thu Dec 6 18:35:00 2012 New Revision: 243953 URL: http://svnweb.freebsd.org/changeset/base/243953 Log: MFC r239007: Remove duplicate check. Modified: stable/9/sys/netgraph/ng_pptpgre.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_pptpgre.c ============================================================================== --- stable/9/sys/netgraph/ng_pptpgre.c Thu Dec 6 18:23:23 2012 (r243952) +++ stable/9/sys/netgraph/ng_pptpgre.c Thu Dec 6 18:35:00 2012 (r243953) @@ -562,7 +562,7 @@ ng_pptpgre_xmit(hpriv_p hpriv, item_p it } /* Sanity check frame length */ - if (m != NULL && m->m_pkthdr.len > PPTP_MAX_PAYLOAD) { + if (m->m_pkthdr.len > PPTP_MAX_PAYLOAD) { priv->stats.xmitTooBig++; ERROUT(EMSGSIZE); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 19:35:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B234C74; Thu, 6 Dec 2012 19:35:54 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id C83D18FC15; Thu, 6 Dec 2012 19:35:53 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 4386C139741; Thu, 6 Dec 2012 21:35:44 +0200 (EET) Date: Thu, 6 Dec 2012 21:35:43 +0200 From: Jaakko Heinonen To: Alfred Perlstein Subject: Re: svn commit: r243942 - stable/9/sbin/fsck_msdosfs Message-ID: <20121206193543.GB2182@a91-153-116-96.elisa-laajakaista.fi> References: <201212060835.qB68ZkGe099714@svn.freebsd.org> <50C0CF44.6040802@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50C0CF44.6040802@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 19:35:54 -0000 On 2012-12-06, Alfred Perlstein wrote: > I think perror writes to STDERR, printf to STDOUT. (am I wrong?) perror(3) prints on stderr. However fsck uses its own perror() (renamed to perr() in head) which prints on stdout. > You might better use warn()? Using warn(3) here wouldn't be correct. For additional details, please see the following mail: http://lists.freebsd.org/pipermail/svn-src-all/2012-November/060990.html -- Jaakko From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 6 22:50:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E51FCD6; Thu, 6 Dec 2012 22:50:43 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id CED9D8FC08; Thu, 6 Dec 2012 22:50:42 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 553131A3C4D; Thu, 6 Dec 2012 14:50:42 -0800 (PST) Message-ID: <50C12143.3020505@mu.org> Date: Thu, 06 Dec 2012 14:50:43 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jaakko Heinonen Subject: Re: svn commit: r243942 - stable/9/sbin/fsck_msdosfs References: <201212060835.qB68ZkGe099714@svn.freebsd.org> <50C0CF44.6040802@mu.org> <20121206193543.GB2182@a91-153-116-96.elisa-laajakaista.fi> In-Reply-To: <20121206193543.GB2182@a91-153-116-96.elisa-laajakaista.fi> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 22:50:43 -0000 On 12/6/12 11:35 AM, Jaakko Heinonen wrote: > On 2012-12-06, Alfred Perlstein wrote: >> I think perror writes to STDERR, printf to STDOUT. (am I wrong?) > perror(3) prints on stderr. However fsck uses its own perror() (renamed > to perr() in head) which prints on stdout. heh, ouch. > >> You might better use warn()? > Using warn(3) here wouldn't be correct. > > For additional details, please see the following mail: > > http://lists.freebsd.org/pipermail/svn-src-all/2012-November/060990.html > ok thank you. -Alfred From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 01:13:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA9EF70D; Fri, 7 Dec 2012 01:13:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1BD8FC14; Fri, 7 Dec 2012 01:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB71D8Vu072095; Fri, 7 Dec 2012 01:13:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB71D82o072090; Fri, 7 Dec 2012 01:13:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212070113.qB71D82o072090@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 7 Dec 2012 01:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243962 - in stable/9/sys: fs/nfsclient kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 01:13:08 -0000 Author: kib Date: Fri Dec 7 01:13:07 2012 New Revision: 243962 URL: http://svnweb.freebsd.org/changeset/base/243962 Log: MFC r243142: In pget(9), if PGET_NOTWEXIT flag is not specified, also search the zombie list for the pid. This allows several kern.proc sysctls to report useful information for zombies. Hold the allproc_lock around all searches instead of relocking it. Remove private pfind_locked() from the new nfs client code. MFC r243528 (by pjd): Look for zombie process only if we were given process id. Modified: stable/9/sys/fs/nfsclient/nfs_clport.c stable/9/sys/kern/kern_proc.c stable/9/sys/sys/proc.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Fri Dec 7 00:46:43 2012 (r243961) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Fri Dec 7 01:13:07 2012 (r243962) @@ -1150,31 +1150,6 @@ nfscl_maperr(struct thread *td, int erro } /* - * Locate a process by number; return only "live" processes -- i.e., neither - * zombies nor newly born but incompletely initialized processes. By not - * returning processes in the PRS_NEW state, we allow callers to avoid - * testing for that condition to avoid dereferencing p_ucred, et al. - * Identical to pfind() in kern_proc.c, except it assume the list is - * already locked. - */ -static struct proc * -pfind_locked(pid_t pid) -{ - struct proc *p; - - LIST_FOREACH(p, PIDHASH(pid), p_hash) - if (p->p_pid == pid) { - PROC_LOCK(p); - if (p->p_state == PRS_NEW) { - PROC_UNLOCK(p); - p = NULL; - } - break; - } - return (p); -} - -/* * Check to see if the process for this owner exists. Return 1 if it doesn't * and 0 otherwise. */ Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Fri Dec 7 00:46:43 2012 (r243961) +++ stable/9/sys/kern/kern_proc.c Fri Dec 7 01:13:07 2012 (r243962) @@ -137,6 +137,7 @@ static void proc_dtor(void *mem, int siz static int proc_init(void *mem, int size, int flags); static void proc_fini(void *mem, int size); static void pargs_free(struct pargs *pa); +static struct proc *zpfind_locked(pid_t pid); /* * Other process lists @@ -284,20 +285,13 @@ inferior(p) return (1); } -/* - * Locate a process by number; return only "live" processes -- i.e., neither - * zombies nor newly born but incompletely initialized processes. By not - * returning processes in the PRS_NEW state, we allow callers to avoid - * testing for that condition to avoid dereferencing p_ucred, et al. - */ struct proc * -pfind(pid) - register pid_t pid; +pfind_locked(pid_t pid) { - register struct proc *p; + struct proc *p; - sx_slock(&allproc_lock); - LIST_FOREACH(p, PIDHASH(pid), p_hash) + sx_assert(&allproc_lock, SX_LOCKED); + LIST_FOREACH(p, PIDHASH(pid), p_hash) { if (p->p_pid == pid) { PROC_LOCK(p); if (p->p_state == PRS_NEW) { @@ -306,17 +300,34 @@ pfind(pid) } break; } + } + return (p); +} + +/* + * Locate a process by number; return only "live" processes -- i.e., neither + * zombies nor newly born but incompletely initialized processes. By not + * returning processes in the PRS_NEW state, we allow callers to avoid + * testing for that condition to avoid dereferencing p_ucred, et al. + */ +struct proc * +pfind(pid_t pid) +{ + struct proc *p; + + sx_slock(&allproc_lock); + p = pfind_locked(pid); sx_sunlock(&allproc_lock); return (p); } static struct proc * -pfind_tid(pid_t tid) +pfind_tid_locked(pid_t tid) { struct proc *p; struct thread *td; - sx_slock(&allproc_lock); + sx_assert(&allproc_lock, SX_LOCKED); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state == PRS_NEW) { @@ -330,7 +341,6 @@ pfind_tid(pid_t tid) PROC_UNLOCK(p); } found: - sx_sunlock(&allproc_lock); return (p); } @@ -364,12 +374,17 @@ pget(pid_t pid, int flags, struct proc * struct proc *p; int error; - if (pid <= PID_MAX) - p = pfind(pid); - else if ((flags & PGET_NOTID) == 0) - p = pfind_tid(pid); - else + sx_slock(&allproc_lock); + if (pid <= PID_MAX) { + p = pfind_locked(pid); + if (p == NULL && (flags & PGET_NOTWEXIT) == 0) + p = zpfind_locked(pid); + } else if ((flags & PGET_NOTID) == 0) { + p = pfind_tid_locked(pid); + } else { p = NULL; + } + sx_sunlock(&allproc_lock); if (p == NULL) return (ESRCH); if ((flags & PGET_CANSEE) != 0) { @@ -1046,6 +1061,21 @@ pstats_free(struct pstats *ps) free(ps, M_SUBPROC); } +static struct proc * +zpfind_locked(pid_t pid) +{ + struct proc *p; + + sx_assert(&allproc_lock, SX_LOCKED); + LIST_FOREACH(p, &zombproc, p_list) { + if (p->p_pid == pid) { + PROC_LOCK(p); + break; + } + } + return (p); +} + /* * Locate a zombie process by number */ @@ -1055,11 +1085,7 @@ zpfind(pid_t pid) struct proc *p; sx_slock(&allproc_lock); - LIST_FOREACH(p, &zombproc, p_list) - if (p->p_pid == pid) { - PROC_LOCK(p); - break; - } + p = zpfind_locked(pid); sx_sunlock(&allproc_lock); return (p); } Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Fri Dec 7 00:46:43 2012 (r243961) +++ stable/9/sys/sys/proc.h Fri Dec 7 01:13:07 2012 (r243962) @@ -835,6 +835,7 @@ extern struct proc *initproc, *pageproc; extern struct uma_zone *proc_zone; struct proc *pfind(pid_t); /* Find process by id. */ +struct proc *pfind_locked(pid_t pid); struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 01:14:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2BA68BD; Fri, 7 Dec 2012 01:14:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C10D88FC16; Fri, 7 Dec 2012 01:14:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB71EqYM072623; Fri, 7 Dec 2012 01:14:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB71EqZK072622; Fri, 7 Dec 2012 01:14:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212070114.qB71EqZK072622@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 7 Dec 2012 01:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243963 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 01:14:53 -0000 Author: kib Date: Fri Dec 7 01:14:52 2012 New Revision: 243963 URL: http://svnweb.freebsd.org/changeset/base/243963 Log: MFC r243845: Document the interpretation of the negative value of ticks for taskqueue_enqueue_timeout(9). MFC r243863: Fix typo. Modified: stable/9/share/man/man9/taskqueue.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/taskqueue.9 ============================================================================== --- stable/9/share/man/man9/taskqueue.9 Fri Dec 7 01:13:07 2012 (r243962) +++ stable/9/share/man/man9/taskqueue.9 Fri Dec 7 01:14:52 2012 (r243963) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2011 +.Dd December 4, 2012 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -180,6 +180,13 @@ is used to schedule the enqueue after th Only non-fast task queues can be used for .Va timeout_task scheduling. +If the +.Va ticks +argument is negative, the already scheduled enqueueing is not re-scheduled. +Otherwise, the task is scheduled for enqueueing in the future, +after the absolute value of +.Va ticks +is passed. .Pp The .Fn taskqueue_cancel From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 13:03:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52822B79; Fri, 7 Dec 2012 13:03:24 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3696D8FC0C; Fri, 7 Dec 2012 13:03:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB7D3OOD099924; Fri, 7 Dec 2012 13:03:24 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB7D3NHN099920; Fri, 7 Dec 2012 13:03:23 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201212071303.qB7D3NHN099920@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 7 Dec 2012 13:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243983 - in stable/9: share/man/man4 sys/netgraph/netflow X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 13:03:24 -0000 Author: melifaro Date: Fri Dec 7 13:03:23 2012 New Revision: 243983 URL: http://svnweb.freebsd.org/changeset/base/243983 Log: MFC r241446,r241501 Add NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific data. Submitted by: Dmitry Luhtionov Modified: stable/9/share/man/man4/ng_netflow.4 stable/9/sys/netgraph/netflow/netflow_v9.c stable/9/sys/netgraph/netflow/ng_netflow.c stable/9/sys/netgraph/netflow/ng_netflow.h Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/share/man/man4/ng_netflow.4 ============================================================================== --- stable/9/share/man/man4/ng_netflow.4 Fri Dec 7 13:00:41 2012 (r243982) +++ stable/9/share/man/man4/ng_netflow.4 Fri Dec 7 13:03:23 2012 (r243983) @@ -229,6 +229,9 @@ not directly from See also .Sx BUGS section. +.It Dv NGM_NETFLOW_V9INFO +Returns some NetFlow v9 related values in a +.Vt "struct ng_netflow_v9info" . .El .Sh ASCII CONTROL MESSAGES Most binary control messages have an Modified: stable/9/sys/netgraph/netflow/netflow_v9.c ============================================================================== --- stable/9/sys/netgraph/netflow/netflow_v9.c Fri Dec 7 13:00:41 2012 (r243982) +++ stable/9/sys/netgraph/netflow/netflow_v9.c Fri Dec 7 13:03:23 2012 (r243983) @@ -480,3 +480,14 @@ ng_netflow_v9_cache_flush(priv_p priv) for (i = 0; i < priv->flowsets_count; i++) free(priv->v9_flowsets[i], M_NETFLOW_GENERAL); } + +/* Get a snapshot of NetFlow v9 settings */ +void +ng_netflow_copyv9info(priv_p priv, struct ng_netflow_v9info *i) +{ + + i->templ_time = priv->templ_time; + i->templ_packets = priv->templ_packets; + i->mtu = priv->mtu; +} + Modified: stable/9/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- stable/9/sys/netgraph/netflow/ng_netflow.c Fri Dec 7 13:00:41 2012 (r243982) +++ stable/9/sys/netgraph/netflow/ng_netflow.c Fri Dec 7 13:03:23 2012 (r243983) @@ -138,6 +138,14 @@ static const struct ng_parse_type ng_net &ng_netflow_setmtu_type_fields }; +/* Parse type for struct ng_netflow_v9info */ +static const struct ng_parse_struct_field ng_netflow_v9info_type_fields[] + = NG_NETFLOW_V9INFO_TYPE; +static const struct ng_parse_type ng_netflow_v9info_type = { + &ng_parse_struct_type, + &ng_netflow_v9info_type_fields +}; + /* List of commands and how to convert arguments to/from ASCII */ static const struct ng_cmdlist ng_netflow_cmds[] = { { @@ -196,6 +204,13 @@ static const struct ng_cmdlist ng_netflo &ng_netflow_setmtu_type, NULL }, + { + NGM_NETFLOW_COOKIE, + NGM_NETFLOW_V9INFO, + "v9info", + NULL, + &ng_netflow_v9info_type + }, { 0 } }; @@ -526,6 +541,17 @@ ng_netflow_rcvmsg (node_p node, item_p i break; } + case NGM_NETFLOW_V9INFO: + { + struct ng_netflow_v9info *i; + + NG_MKRESPONSE(resp, msg, sizeof(struct ng_netflow_v9info), + M_NOWAIT); + i = (struct ng_netflow_v9info *)resp->data; + ng_netflow_copyv9info(priv, i); + + break; + } default: ERROUT(EINVAL); /* unknown command */ break; Modified: stable/9/sys/netgraph/netflow/ng_netflow.h ============================================================================== --- stable/9/sys/netgraph/netflow/ng_netflow.h Fri Dec 7 13:00:41 2012 (r243982) +++ stable/9/sys/netgraph/netflow/ng_netflow.h Fri Dec 7 13:03:23 2012 (r243983) @@ -34,6 +34,7 @@ #define NG_NETFLOW_NODE_TYPE "netflow" #define NGM_NETFLOW_COOKIE 1309868867 +#define NGM_NETFLOW_V9_COOKIE 1349865386 #define NG_NETFLOW_MAXIFACES USHRT_MAX @@ -58,6 +59,7 @@ enum { NGM_NETFLOW_SETCONFIG = 7, /* set flow generation options */ NGM_NETFLOW_SETTEMPLATE = 8, /* set v9 flow template periodic */ NGM_NETFLOW_SETMTU = 9, /* set outgoing interface MTU */ + NGM_NETFLOW_V9INFO = 10|NGM_READONLY|NGM_HASREPLY, /* get v9 info */ }; /* This structure is returned by the NGM_NETFLOW_INFO message */ @@ -141,6 +143,13 @@ struct ngnf_show_header { uint32_t nentries; /* number of records in response */ }; +/* This structure is used in NGM_NETFLOW_V9INFO message */ +struct ng_netflow_v9info { + uint16_t templ_packets; /* v9 template packets */ + uint16_t templ_time; /* v9 template time */ + uint16_t mtu; /* v9 MTU */ +}; + /* XXXGL * Somewhere flow_rec6 is casted to flow_rec, and flow6_entry_data is * casted to flow_entry_data. After casting, fle->r.fib is accessed. @@ -341,6 +350,14 @@ struct flow6_entry { { NULL } \ } +/* Parse the v9info structure */ +#define NG_NETFLOW_V9INFO_TYPE { \ + { "v9 template packets", &ng_parse_uint16_type },\ + { "v9 template time", &ng_parse_uint16_type },\ + { "v9 MTU", &ng_parse_uint16_type },\ + { NULL } \ +} + /* Private hook data */ struct ng_netflow_iface { hook_p hook; /* NULL when disconnected */ @@ -416,6 +433,7 @@ struct netflow { fib_export_p *fib_data; /* array of pointers to per-fib data */ uint16_t maxfibs; /* number of allocated fibs */ + /* Netflow v9 configuration options */ /* * RFC 3954 clause 7.3 * "Both options MUST be configurable by the user on the Exporter." @@ -466,6 +484,7 @@ void ng_netflow_cache_init(priv_p); void ng_netflow_cache_flush(priv_p); int ng_netflow_fib_init(priv_p priv, int fib); void ng_netflow_copyinfo(priv_p, struct ng_netflow_info *); +void ng_netflow_copyv9info(priv_p, struct ng_netflow_v9info *); timeout_t ng_netflow_expire; int ng_netflow_flow_add(priv_p, fib_export_p, struct ip *, caddr_t, uint8_t, uint8_t, unsigned int); int ng_netflow_flow6_add(priv_p, fib_export_p, struct ip6_hdr *, caddr_t , uint8_t, uint8_t, unsigned int); From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 19:06:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 933F926F; Fri, 7 Dec 2012 19:06:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 713A28FC14; Fri, 7 Dec 2012 19:06:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB7J6ghf064054; Fri, 7 Dec 2012 19:06:42 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB7J6f3Y064043; Fri, 7 Dec 2012 19:06:41 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201212071906.qB7J6f3Y064043@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 7 Dec 2012 19:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243989 - in stable/9: cddl/lib/libdtrace sys/kern sys/modules/dtrace sys/modules/dtrace/dtio sys/modules/dtrace/dtraceall sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 19:06:42 -0000 Author: gnn Date: Fri Dec 7 19:06:40 2012 New Revision: 243989 URL: http://svnweb.freebsd.org/changeset/base/243989 Log: MFC: 238366, 240924 Initial commit of an I/O provider for DTrace on FreeBSD. These probes are most useful when looking into the structures they provide, which are listed in io.d. For example: dtrace -n 'io:kernel::start { printf("%d\n", args[0]->bio_bcount); }' Note that the I/O systems in FreeBSD and Solaris/Illumos are sufficiently different that there is not a 1:1 mapping from scripts that work with one to the other. This commit includes the fix so that our probes use "kernel" instead of the Solaris specific "genunix" Added: stable/9/cddl/lib/libdtrace/io.d - copied, changed from r236628, head/cddl/lib/libdtrace/io.d stable/9/sys/kern/dtio_kdtrace.c - copied, changed from r238366, head/sys/kern/dtio_kdtrace.c stable/9/sys/modules/dtrace/dtio/ - copied from r238366, head/sys/modules/dtrace/dtio/ Modified: stable/9/cddl/lib/libdtrace/Makefile stable/9/sys/kern/subr_devstat.c stable/9/sys/modules/dtrace/Makefile stable/9/sys/modules/dtrace/dtraceall/dtraceall.c stable/9/sys/sys/dtrace_bsd.h Directory Properties: stable/9/cddl/lib/libdtrace/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/cddl/lib/libdtrace/Makefile ============================================================================== --- stable/9/cddl/lib/libdtrace/Makefile Fri Dec 7 16:26:32 2012 (r243988) +++ stable/9/cddl/lib/libdtrace/Makefile Fri Dec 7 19:06:40 2012 (r243989) @@ -46,6 +46,7 @@ SRCS= dt_aggregate.c \ dis_tables.c DSRCS= errno.d \ + io.d \ psinfo.d \ signal.d \ unistd.d Copied and modified: stable/9/cddl/lib/libdtrace/io.d (from r236628, head/cddl/lib/libdtrace/io.d) ============================================================================== --- head/cddl/lib/libdtrace/io.d Tue Jun 5 18:58:05 2012 (r236628, copy source) +++ stable/9/cddl/lib/libdtrace/io.d Fri Dec 7 19:06:40 2012 (r243989) @@ -27,114 +27,50 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#pragma D depends_on module unix #pragma D depends_on provider io -inline int B_BUSY = B_BUSY; -#pragma D binding "1.0" B_BUSY -inline int B_DONE = 0x00000200; -#pragma D binding "1.0" B_DONE -inline int B_ERROR = B_ERROR; -#pragma D binding "1.0" B_ERROR -inline int B_PAGEIO = B_PAGEIO; -#pragma D binding "1.0" B_PAGEIO -inline int B_PHYS = B_PHYS; -#pragma D binding "1.0" B_PHYS -inline int B_READ = B_READ; -#pragma D binding "1.0" B_READ -inline int B_WRITE = B_WRITE; -#pragma D binding "1.0" B_WRITE -inline int B_ASYNC = 0x00000004; -#pragma D binding "1.0" B_ASYNC - -typedef struct bufinfo { - int b_flags; /* buffer status */ - size_t b_bcount; /* number of bytes */ - caddr_t b_addr; /* buffer address */ - uint64_t b_lblkno; /* block # on device */ - uint64_t b_blkno; /* expanded block # on device */ - size_t b_resid; /* # of bytes not transferred */ - size_t b_bufsize; /* size of allocated buffer */ - caddr_t b_iodone; /* I/O completion routine */ - int b_error; /* expanded error field */ - dev_t b_edev; /* extended device */ -} bufinfo_t; - -#pragma D binding "1.0" translator -translator bufinfo_t < struct buf *B > { - b_flags = B->b_flags; - b_addr = B->b_un.b_addr; - b_bcount = B->b_bcount; - b_lblkno = B->_b_blkno._f; - b_blkno = sizeof (long) == 8 ? B->_b_blkno._f : B->_b_blkno._p._l; - b_resid = B->b_resid; - b_bufsize = B->b_bufsize; - b_iodone = (caddr_t)B->b_iodone; - b_error = B->b_error; - b_edev = B->b_edev; -}; - typedef struct devinfo { - int dev_major; /* major number */ - int dev_minor; /* minor number */ - int dev_instance; /* instance number */ - string dev_name; /* name of device */ - string dev_statname; /* name of device + instance/minor */ - string dev_pathname; /* pathname of device */ + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ } devinfo_t; #pragma D binding "1.0" translator -translator devinfo_t < struct buf *B > { - dev_major = B->b_dip != NULL ? getmajor(B->b_edev) : - getmajor(B->b_file->v_vfsp->vfs_dev); - dev_minor = B->b_dip != NULL ? getminor(B->b_edev) : - getminor(B->b_file->v_vfsp->vfs_dev); - dev_instance = B->b_dip == NULL ? - getminor(B->b_file->v_vfsp->vfs_dev) : - ((struct dev_info *)B->b_dip)->devi_instance; - dev_name = B->b_dip == NULL ? "nfs" : - stringof(`devnamesp[getmajor(B->b_edev)].dn_name); - dev_statname = strjoin(B->b_dip == NULL ? "nfs" : - stringof(`devnamesp[getmajor(B->b_edev)].dn_name), - lltostr(B->b_dip == NULL ? getminor(B->b_file->v_vfsp->vfs_dev) : - ((struct dev_info *)B->b_dip)->devi_instance == 0 && - ((struct dev_info *)B->b_dip)->devi_parent != NULL && - ((struct dev_info *)B->b_dip)->devi_parent->devi_node_name == - "pseudo" ? getminor(B->b_edev) : - ((struct dev_info *)B->b_dip)->devi_instance)); - dev_pathname = B->b_dip == NULL ? "" : - ddi_pathname(B->b_dip, getminor(B->b_edev)); +translator devinfo_t < struct devstat *D > { + dev_major = D->device_number; + dev_minor = D->unit_number; + dev_instance = 0; + dev_name = stringof(D->device_name); + dev_statname = stringof(D->device_name); + dev_pathname = stringof(D->device_name); }; -typedef struct fileinfo { - string fi_name; /* name (basename of fi_pathname) */ - string fi_dirname; /* directory (dirname of fi_pathname) */ - string fi_pathname; /* full pathname */ - offset_t fi_offset; /* offset within file */ - string fi_fs; /* filesystem */ - string fi_mount; /* mount point of file system */ - int fi_oflags; /* open(2) flags for file descriptor */ -} fileinfo_t; +typedef struct bufinfo { + int b_flags; /* flags */ + long b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_blkno; /* expanded block # on device */ + uint64_t b_lblkno; /* block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ +/* caddr_t b_iodone; I/O completion routine */ + int b_error; /* expanded error field */ +/* dev_t b_edev; extended device */ +} bufinfo_t; #pragma D binding "1.0" translator -translator fileinfo_t < struct buf *B > { - fi_name = B->b_file == NULL ? "" : - B->b_file->v_path == NULL ? "" : - basename(cleanpath(B->b_file->v_path)); - fi_dirname = B->b_file == NULL ? "" : - B->b_file->v_path == NULL ? "" : - dirname(cleanpath(B->b_file->v_path)); - fi_pathname = B->b_file == NULL ? "" : - B->b_file->v_path == NULL ? "" : - cleanpath(B->b_file->v_path); - fi_offset = B->b_offset; - fi_fs = B->b_file == NULL ? "" : - stringof(B->b_file->v_op->vnop_name); - fi_mount = B->b_file == NULL ? "" : - B->b_file->v_vfsp->vfs_vnodecovered == NULL ? "/" : - B->b_file->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : - cleanpath(B->b_file->v_vfsp->vfs_vnodecovered->v_path); - fi_oflags = 0; +translator bufinfo_t < struct bio *B > { + b_flags = B->bio_flags; + b_bcount = B->bio_bcount; + b_addr = B->bio_data; + b_blkno = 0; + b_lblkno = 0; + b_resid = B->bio_resid; + b_bufsize = 0; /* XXX gnn */ + b_error = B->bio_error; }; /* @@ -158,63 +94,17 @@ inline int O_APPEND = 0x0008; #pragma D binding "1.1" O_APPEND inline int O_CREAT = 0x0200; #pragma D binding "1.1" O_CREAT -inline int O_DSYNC = O_DSYNC; -#pragma D binding "1.1" O_DSYNC inline int O_EXCL = 0x0800; #pragma D binding "1.1" O_EXCL -inline int O_LARGEFILE = O_LARGEFILE; -#pragma D binding "1.1" O_LARGEFILE inline int O_NOCTTY = 0x8000; #pragma D binding "1.1" O_NOCTTY inline int O_NONBLOCK = 0x0004; #pragma D binding "1.1" O_NONBLOCK inline int O_NDELAY = 0x0004; #pragma D binding "1.1" O_NDELAY -inline int O_RSYNC = O_RSYNC; -#pragma D binding "1.1" O_RSYNC inline int O_SYNC = 0x0080; #pragma D binding "1.1" O_SYNC inline int O_TRUNC = 0x0400; #pragma D binding "1.1" O_TRUNC -inline int O_XATTR = O_XATTR; -#pragma D binding "1.1" O_XATTR -#pragma D binding "1.1" translator -translator fileinfo_t < struct file *F > { - fi_name = F == NULL ? "" : - F->f_vnode->v_path == NULL ? "" : - basename(cleanpath(F->f_vnode->v_path)); - fi_dirname = F == NULL ? "" : - F->f_vnode->v_path == NULL ? "" : - dirname(cleanpath(F->f_vnode->v_path)); - fi_pathname = F == NULL ? "" : - F->f_vnode->v_path == NULL ? "" : - cleanpath(F->f_vnode->v_path); - fi_offset = F == NULL ? 0 : F->f_offset; - fi_fs = F == NULL ? "" : stringof(F->f_vnode->v_op->vnop_name); - fi_mount = F == NULL ? "" : - F->f_vnode->v_vfsp->vfs_vnodecovered == NULL ? "/" : - F->f_vnode->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : - cleanpath(F->f_vnode->v_vfsp->vfs_vnodecovered->v_path); - fi_oflags = F == NULL ? 0 : F->f_flag + (int)FOPEN; -}; -inline fileinfo_t fds[int fd] = xlate ( - fd >= 0 && fd < curthread->t_procp->p_user.u_finfo.fi_nfiles ? - curthread->t_procp->p_user.u_finfo.fi_list[fd].uf_file : NULL); - -#pragma D attributes Stable/Stable/Common fds -#pragma D binding "1.1" fds - -#pragma D binding "1.2" translator -translator fileinfo_t < struct vnode *V > { - fi_name = V->v_path == NULL ? "" : - basename(cleanpath(V->v_path)); - fi_dirname = V->v_path == NULL ? "" : - dirname(cleanpath(V->v_path)); - fi_pathname = V->v_path == NULL ? "" : cleanpath(V->v_path); - fi_fs = stringof(V->v_op->vnop_name); - fi_mount = V->v_vfsp->vfs_vnodecovered == NULL ? "/" : - V->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : - cleanpath(V->v_vfsp->vfs_vnodecovered->v_path); -}; Copied and modified: stable/9/sys/kern/dtio_kdtrace.c (from r238366, head/sys/kern/dtio_kdtrace.c) ============================================================================== --- head/sys/kern/dtio_kdtrace.c Wed Jul 11 16:27:02 2012 (r238366, copy source) +++ stable/9/sys/kern/dtio_kdtrace.c Fri Dec 7 19:06:40 2012 (r243989) @@ -56,7 +56,7 @@ static dtrace_pattr_t dtio_attr = { { DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, }; -static char *genunix = "genunix"; +static char *kernel = "kernel"; /* * Name strings. @@ -113,25 +113,25 @@ dtio_provide(void *arg, dtrace_probedesc if (desc != NULL) return; - if (dtrace_probe_lookup(dtio_id, genunix, NULL, + if (dtrace_probe_lookup(dtio_id, kernel, NULL, dtio_start_str) == 0) { - dtio_start_id = dtrace_probe_create(dtio_id, genunix, NULL, + dtio_start_id = dtrace_probe_create(dtio_id, kernel, NULL, dtio_start_str, 0, NULL); } - if (dtrace_probe_lookup(dtio_id, genunix, NULL, dtio_done_str) == 0) { - dtio_done_id = dtrace_probe_create(dtio_id, genunix, NULL, + if (dtrace_probe_lookup(dtio_id, kernel, NULL, dtio_done_str) == 0) { + dtio_done_id = dtrace_probe_create(dtio_id, kernel, NULL, dtio_done_str, 0, NULL); } - if (dtrace_probe_lookup(dtio_id, genunix, NULL, + if (dtrace_probe_lookup(dtio_id, kernel, NULL, dtio_wait_start_str) == 0) { - dtio_wait_start_id = dtrace_probe_create(dtio_id, genunix, + dtio_wait_start_id = dtrace_probe_create(dtio_id, kernel, NULL, dtio_wait_start_str, 0, NULL); } - if (dtrace_probe_lookup(dtio_id, genunix, NULL, + if (dtrace_probe_lookup(dtio_id, kernel, NULL, dtio_wait_done_str) == 0) { - dtio_wait_done_id = dtrace_probe_create(dtio_id, genunix, NULL, + dtio_wait_done_id = dtrace_probe_create(dtio_id, kernel, NULL, dtio_wait_done_str, 0, NULL); } Modified: stable/9/sys/kern/subr_devstat.c ============================================================================== --- stable/9/sys/kern/subr_devstat.c Fri Dec 7 16:26:32 2012 (r243988) +++ stable/9/sys/kern/subr_devstat.c Fri Dec 7 19:06:40 2012 (r243989) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include @@ -44,6 +46,54 @@ __FBSDID("$FreeBSD$"); #include +#ifdef KDTRACE_HOOKS +#include + +dtrace_io_start_probe_func_t dtrace_io_start_probe; +dtrace_io_done_probe_func_t dtrace_io_done_probe; +dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; +dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; + +uint32_t dtio_start_id; +uint32_t dtio_done_id; +uint32_t dtio_wait_start_id; +uint32_t dtio_wait_done_id; + +#define DTRACE_DEVSTAT_START() \ + if (dtrace_io_start_probe != NULL) \ + (*dtrace_io_start_probe)(dtio_start_id, NULL, ds); + +#define DTRACE_DEVSTAT_BIO_START() \ + if (dtrace_io_start_probe != NULL) \ + (*dtrace_io_start_probe)(dtio_start_id, bp, ds); + +#define DTRACE_DEVSTAT_DONE() \ + if (dtrace_io_done_probe != NULL) \ + (*dtrace_io_done_probe)(dtio_done_id, NULL, ds); + +#define DTRACE_DEVSTAT_BIO_DONE() \ + if (dtrace_io_done_probe != NULL) \ + (*dtrace_io_done_probe)(dtio_done_id, bp, ds); + +#define DTRACE_DEVSTAT_WAIT_START() \ + if (dtrace_io_wait_start_probe != NULL) \ + (*dtrace_io_wait_start_probe)(dtio_wait_start_id, NULL, ds); + +#define DTRACE_DEVSTAT_WAIT_DONE() \ + if (dtrace_io_wait_done_probe != NULL) \ + (*dtrace_io_wait_done_probe)(dtio_wait_done_id, NULL, ds); + +#else /* ! KDTRACE_HOOKS */ + +#define DTRACE_DEVSTAT_START() + +#define DTRACE_DEVSTAT_DONE() + +#define DTRACE_DEVSTAT_WAIT_START() + +#define DTRACE_DEVSTAT_WAIT_DONE() +#endif /* KDTRACE_HOOKS */ + static int devstat_num_devs; static long devstat_generation = 1; static int devstat_version = DEVSTAT_VERSION; @@ -227,6 +277,7 @@ devstat_start_transaction(struct devstat } ds->start_count++; atomic_add_rel_int(&ds->sequence0, 1); + DTRACE_DEVSTAT_START(); } void @@ -241,6 +292,7 @@ devstat_start_transaction_bio(struct dev binuptime(&bp->bio_t0); devstat_start_transaction(ds, &bp->bio_t0); + DTRACE_DEVSTAT_BIO_START(); } /* @@ -312,6 +364,7 @@ devstat_end_transaction(struct devstat * ds->end_count++; atomic_add_rel_int(&ds->sequence0, 1); + DTRACE_DEVSTAT_DONE(); } void @@ -334,6 +387,7 @@ devstat_end_transaction_bio(struct devst devstat_end_transaction(ds, bp->bio_bcount - bp->bio_resid, DEVSTAT_TAG_SIMPLE, flg, NULL, &bp->bio_t0); + DTRACE_DEVSTAT_BIO_DONE(); } /* Modified: stable/9/sys/modules/dtrace/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/Makefile Fri Dec 7 16:26:32 2012 (r243988) +++ stable/9/sys/modules/dtrace/Makefile Fri Dec 7 19:06:40 2012 (r243989) @@ -11,6 +11,7 @@ SUBDIR= dtmalloc \ dtrace_test \ lockstat \ profile \ + dtio \ prototype \ sdt \ systrace Modified: stable/9/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- stable/9/sys/modules/dtrace/dtraceall/dtraceall.c Fri Dec 7 16:26:32 2012 (r243988) +++ stable/9/sys/modules/dtrace/dtraceall/dtraceall.c Fri Dec 7 19:06:40 2012 (r243989) @@ -65,6 +65,7 @@ MODULE_VERSION(dtraceall, 1); MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1); MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); +MODULE_DEPEND(dtraceall, dtio, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); Modified: stable/9/sys/sys/dtrace_bsd.h ============================================================================== --- stable/9/sys/sys/dtrace_bsd.h Fri Dec 7 16:26:32 2012 (r243988) +++ stable/9/sys/sys/dtrace_bsd.h Fri Dec 7 19:06:40 2012 (r243989) @@ -38,6 +38,8 @@ struct thread; struct vattr; struct vnode; struct reg; +struct devstat; +struct bio; /* * Cyclic clock function type definition used to hook the cyclic @@ -168,6 +170,23 @@ extern dtrace_nfsclient_nfs23_done_probe extern dtrace_nfsclient_nfs23_done_probe_func_t dtrace_nfscl_nfs234_done_probe; +/* IO Provider hooks, really hook into devstat */ +typedef void (*dtrace_io_start_probe_func_t)(uint32_t, struct bio *, + struct devstat *); +extern dtrace_io_start_probe_func_t dtrace_io_start_probe; + +typedef void (*dtrace_io_done_probe_func_t)(uint32_t, struct bio *, + struct devstat *); +extern dtrace_io_done_probe_func_t dtrace_io_done_probe; + +typedef void (*dtrace_io_wait_start_probe_func_t)(uint32_t, uintptr_t *, + struct devstat *); +extern dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; + +typedef void (*dtrace_io_wait_done_probe_func_t)(uint32_t, uintptr_t *, + struct devstat *); +extern dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; + /* * Functions which allow the dtrace module to check that the kernel * hooks have been compiled with sufficient space for it's private From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 20:07:14 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92507208 for ; Fri, 7 Dec 2012 20:07:14 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm12-vm4.bullet.mail.gq1.yahoo.com (nm12-vm4.bullet.mail.gq1.yahoo.com [98.136.218.191]) by mx1.freebsd.org (Postfix) with ESMTP id 52D548FC18 for ; Fri, 7 Dec 2012 20:07:13 +0000 (UTC) Received: from [98.137.12.60] by nm12.bullet.mail.gq1.yahoo.com with NNFMP; 07 Dec 2012 20:07:07 -0000 Received: from [98.136.185.45] by tm5.bullet.mail.gq1.yahoo.com with NNFMP; 07 Dec 2012 20:07:06 -0000 Received: from [127.0.0.1] by smtp106.mail.gq1.yahoo.com with NNFMP; 07 Dec 2012 20:07:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1354910826; bh=YNuKtG4LXNs4ijtT/m9ZgbbgkkuQKze8o0Rnb+wMN2E=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=PD6X1iEKDNNnTicn6Izbj91bzmCqFpkc7eTpFFoiqBQcMar/Yz+Bx7N126QX8lnntLJ0VXvcBfXQTbxcXv8lZT98he928e50B06mkYI8UCL6buiKSU8zUfLfHZEnL2UESAZzWu85wv9VJH01GD7IYihIZ6wvHGHzsC0OePrJ4Wg= X-Yahoo-Newman-Id: 878787.91522.bm@smtp106.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bblDn40VM1lABPiA3rxQ4SI0I1m1lYkivsdU5pM1Ol_9D5i _EOwLAAirsJgt3iuC8Wwwnw0_l.vZCIiQY93F5JJ407PSkbHXvlq3iUoEfSE U7xNB9TZY2AFl1Mvy5hLOUeCXMdghdhk6N8.AvHnqFqx47yH4ezu5u9tPKZX MbbCGjnHwv7I0P0U5VkdSQ6Z_G8IvLisQ5HBpDsuJ0oQrPhbKKN3ILnnDH35 y99CbXV2nEfrPzWWDWJ1bzddJGeAyNFKoSNAoelVk10JixuGruC_GQBf6TAJ E2qnefEocBFZM.a6WakuxtuxvXESCyRgrz4YTt.AQ5d_MPdg_fy24nvFtvWe 4ADh447kLe7l1xSLbKAPJmh2Hk1pEO0UlR5HpncFs8DWUG2c5c5l_.BX5xq9 _wGbTbo089flcqbpL1NnaflRpLocf.vvVnAFBlFRxcAqdn8ej_MCWJvIPRjF Ss.YzE1xDt6VC4LG5hc.Ws_CebIp0IEk- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Received: from lgmac-ddenlinger.corp.netflix.com (scott4long@69.53.237.126 with plain) by smtp106.mail.gq1.yahoo.com with SMTP; 07 Dec 2012 12:07:06 -0800 PST Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r243989 - in stable/9: cddl/lib/libdtrace sys/kern sys/modules/dtrace sys/modules/dtrace/dtio sys/modules/dtrace/dtraceall sys/sys From: Scott Long In-Reply-To: <201212071906.qB7J6f3Y064043@svn.freebsd.org> Date: Fri, 7 Dec 2012 13:07:04 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <12702B8F-645A-4F27-9A2B-63845EFB3DF1@yahoo.com> References: <201212071906.qB7J6f3Y064043@svn.freebsd.org> To: George V. Neville-Neil X-Mailer: Apple Mail (2.1499) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 20:07:14 -0000 Publicly, I'll state that I don't think that devstat is the right place = for these, and I was hoping to have some time to move them to a better = place, or at least fix up the existing problems that are present. This = commit shouldn't be considered the final word the stability of this set = of SDT probes. Scott On Dec 7, 2012, at 12:06 PM, George V. Neville-Neil = wrote: > Author: gnn > Date: Fri Dec 7 19:06:40 2012 > New Revision: 243989 > URL: http://svnweb.freebsd.org/changeset/base/243989 >=20 > Log: > MFC: 238366, 240924 >=20 > Initial commit of an I/O provider for DTrace on FreeBSD. >=20 > These probes are most useful when looking into the structures > they provide, which are listed in io.d. For example: >=20 > dtrace -n 'io:kernel::start { printf("%d\n", args[0]->bio_bcount); = }' >=20 > Note that the I/O systems in FreeBSD and Solaris/Illumos are = sufficiently > different that there is not a 1:1 mapping from scripts that work > with one to the other. >=20 > This commit includes the fix so that our probes use "kernel" > instead of the Solaris specific "genunix" >=20 > Added: > stable/9/cddl/lib/libdtrace/io.d > - copied, changed from r236628, head/cddl/lib/libdtrace/io.d > stable/9/sys/kern/dtio_kdtrace.c > - copied, changed from r238366, head/sys/kern/dtio_kdtrace.c > stable/9/sys/modules/dtrace/dtio/ > - copied from r238366, head/sys/modules/dtrace/dtio/ > Modified: > stable/9/cddl/lib/libdtrace/Makefile > stable/9/sys/kern/subr_devstat.c > stable/9/sys/modules/dtrace/Makefile > stable/9/sys/modules/dtrace/dtraceall/dtraceall.c > stable/9/sys/sys/dtrace_bsd.h > Directory Properties: > stable/9/cddl/lib/libdtrace/ (props changed) > stable/9/sys/ (props changed) > stable/9/sys/amd64/include/xen/ (props changed) > stable/9/sys/boot/ (props changed) > stable/9/sys/boot/i386/efi/ (props changed) > stable/9/sys/boot/ia64/efi/ (props changed) > stable/9/sys/boot/ia64/ski/ (props changed) > stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) > stable/9/sys/boot/powerpc/ofw/ (props changed) > stable/9/sys/cddl/contrib/opensolaris/ (props changed) > stable/9/sys/conf/ (props changed) > stable/9/sys/contrib/dev/acpica/ (props changed) > stable/9/sys/contrib/octeon-sdk/ (props changed) > stable/9/sys/contrib/pf/ (props changed) > stable/9/sys/contrib/x86emu/ (props changed) > stable/9/sys/dev/ (props changed) > stable/9/sys/dev/e1000/ (props changed) > stable/9/sys/dev/isp/ (props changed) > stable/9/sys/dev/ixgbe/ (props changed) > stable/9/sys/dev/puc/ (props changed) > stable/9/sys/fs/ (props changed) > stable/9/sys/fs/ntfs/ (props changed) > stable/9/sys/modules/ (props changed) >=20 > Modified: stable/9/cddl/lib/libdtrace/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/cddl/lib/libdtrace/Makefile Fri Dec 7 16:26:32 2012 = (r243988) > +++ stable/9/cddl/lib/libdtrace/Makefile Fri Dec 7 19:06:40 2012 = (r243989) > @@ -46,6 +46,7 @@ SRCS=3D dt_aggregate.c \ > dis_tables.c >=20 > DSRCS=3D errno.d \ > + io.d \ > psinfo.d \ > signal.d \ > unistd.d >=20 > Copied and modified: stable/9/cddl/lib/libdtrace/io.d (from r236628, = head/cddl/lib/libdtrace/io.d) > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/cddl/lib/libdtrace/io.d Tue Jun 5 18:58:05 2012 = (r236628, copy source) > +++ stable/9/cddl/lib/libdtrace/io.d Fri Dec 7 19:06:40 2012 = (r243989) > @@ -27,114 +27,50 @@ >=20 > #pragma ident "%Z%%M% %I% %E% SMI" >=20 > -#pragma D depends_on module unix > #pragma D depends_on provider io >=20 > -inline int B_BUSY =3D B_BUSY; > -#pragma D binding "1.0" B_BUSY > -inline int B_DONE =3D 0x00000200; > -#pragma D binding "1.0" B_DONE > -inline int B_ERROR =3D B_ERROR; > -#pragma D binding "1.0" B_ERROR > -inline int B_PAGEIO =3D B_PAGEIO; > -#pragma D binding "1.0" B_PAGEIO > -inline int B_PHYS =3D B_PHYS; > -#pragma D binding "1.0" B_PHYS > -inline int B_READ =3D B_READ; > -#pragma D binding "1.0" B_READ > -inline int B_WRITE =3D B_WRITE; > -#pragma D binding "1.0" B_WRITE > -inline int B_ASYNC =3D 0x00000004; > -#pragma D binding "1.0" B_ASYNC > - > -typedef struct bufinfo { > - int b_flags; /* buffer status */ > - size_t b_bcount; /* number of bytes */ > - caddr_t b_addr; /* buffer address */ > - uint64_t b_lblkno; /* block # on device */ > - uint64_t b_blkno; /* expanded block # on device */ > - size_t b_resid; /* # of bytes not transferred */ > - size_t b_bufsize; /* size of allocated buffer */ > - caddr_t b_iodone; /* I/O completion routine */ > - int b_error; /* expanded error field */ > - dev_t b_edev; /* extended device */ > -} bufinfo_t; > - > -#pragma D binding "1.0" translator > -translator bufinfo_t < struct buf *B > { > - b_flags =3D B->b_flags; > - b_addr =3D B->b_un.b_addr; > - b_bcount =3D B->b_bcount; > - b_lblkno =3D B->_b_blkno._f; > - b_blkno =3D sizeof (long) =3D=3D 8 ? B->_b_blkno._f : = B->_b_blkno._p._l; > - b_resid =3D B->b_resid; > - b_bufsize =3D B->b_bufsize; > - b_iodone =3D (caddr_t)B->b_iodone; > - b_error =3D B->b_error; > - b_edev =3D B->b_edev; > -};=20 > - > typedef struct devinfo { > - int dev_major; /* major number */ > - int dev_minor; /* minor number */ > - int dev_instance; /* instance number */ > - string dev_name; /* name of device */ > - string dev_statname; /* name of device + = instance/minor */ > - string dev_pathname; /* pathname of device */ > + int dev_major; /* major number */ > + int dev_minor; /* minor number */ > + int dev_instance; /* instance number */ > + string dev_name; /* name of device */ > + string dev_statname; /* name of device + = instance/minor */ > + string dev_pathname; /* pathname of device */ > } devinfo_t; >=20 > #pragma D binding "1.0" translator > -translator devinfo_t < struct buf *B > { > - dev_major =3D B->b_dip !=3D NULL ? getmajor(B->b_edev) : > - getmajor(B->b_file->v_vfsp->vfs_dev); > - dev_minor =3D B->b_dip !=3D NULL ? getminor(B->b_edev) : > - getminor(B->b_file->v_vfsp->vfs_dev); > - dev_instance =3D B->b_dip =3D=3D NULL ?=20 > - getminor(B->b_file->v_vfsp->vfs_dev) : > - ((struct dev_info *)B->b_dip)->devi_instance; > - dev_name =3D B->b_dip =3D=3D NULL ? "nfs" : > - stringof(`devnamesp[getmajor(B->b_edev)].dn_name); > - dev_statname =3D strjoin(B->b_dip =3D=3D NULL ? "nfs" : > - stringof(`devnamesp[getmajor(B->b_edev)].dn_name), > - lltostr(B->b_dip =3D=3D NULL ? = getminor(B->b_file->v_vfsp->vfs_dev) : > - ((struct dev_info *)B->b_dip)->devi_instance =3D=3D 0 && > - ((struct dev_info *)B->b_dip)->devi_parent !=3D NULL && > - ((struct dev_info *)B->b_dip)->devi_parent->devi_node_name = =3D=3D > - "pseudo" ? getminor(B->b_edev) : > - ((struct dev_info *)B->b_dip)->devi_instance)); > - dev_pathname =3D B->b_dip =3D=3D NULL ? "" : > - ddi_pathname(B->b_dip, getminor(B->b_edev)); > +translator devinfo_t < struct devstat *D > { > + dev_major =3D D->device_number; > + dev_minor =3D D->unit_number; > + dev_instance =3D 0; > + dev_name =3D stringof(D->device_name); > + dev_statname =3D stringof(D->device_name); > + dev_pathname =3D stringof(D->device_name); > }; >=20 > -typedef struct fileinfo { > - string fi_name; /* name (basename of = fi_pathname) */ > - string fi_dirname; /* directory (dirname of = fi_pathname) */ > - string fi_pathname; /* full pathname */ > - offset_t fi_offset; /* offset within file */ > - string fi_fs; /* filesystem */ > - string fi_mount; /* mount point of file system */ > - int fi_oflags; /* open(2) flags for file = descriptor */ > -} fileinfo_t; > +typedef struct bufinfo { > + int b_flags; /* flags */ > + long b_bcount; /* number of bytes */ > + caddr_t b_addr; /* buffer address */ > + uint64_t b_blkno; /* expanded block # on device = */ > + uint64_t b_lblkno; /* block # on device */ > + size_t b_resid; /* # of bytes not transferred = */ > + size_t b_bufsize; /* size of allocated buffer = */ > +/* caddr_t b_iodone; I/O completion routine */ > + int b_error; /* expanded error field */ > +/* dev_t b_edev; extended device */ > +} bufinfo_t; >=20 > #pragma D binding "1.0" translator > -translator fileinfo_t < struct buf *B > { > - fi_name =3D B->b_file =3D=3D NULL ? "" : > - B->b_file->v_path =3D=3D NULL ? "" : > - basename(cleanpath(B->b_file->v_path)); > - fi_dirname =3D B->b_file =3D=3D NULL ? "" : > - B->b_file->v_path =3D=3D NULL ? "" : > - dirname(cleanpath(B->b_file->v_path)); > - fi_pathname =3D B->b_file =3D=3D NULL ? "" : > - B->b_file->v_path =3D=3D NULL ? "" : > - cleanpath(B->b_file->v_path); > - fi_offset =3D B->b_offset; > - fi_fs =3D B->b_file =3D=3D NULL ? "" : > - stringof(B->b_file->v_op->vnop_name); > - fi_mount =3D B->b_file =3D=3D NULL ? "" : > - B->b_file->v_vfsp->vfs_vnodecovered =3D=3D NULL ? "/" : > - B->b_file->v_vfsp->vfs_vnodecovered->v_path =3D=3D NULL ? = "" : > - cleanpath(B->b_file->v_vfsp->vfs_vnodecovered->v_path); > - fi_oflags =3D 0; > +translator bufinfo_t < struct bio *B > { > + b_flags =3D B->bio_flags; > + b_bcount =3D B->bio_bcount; > + b_addr =3D B->bio_data; > + b_blkno =3D 0; > + b_lblkno =3D 0; > + b_resid =3D B->bio_resid; > + b_bufsize =3D 0; /* XXX gnn */ > + b_error =3D B->bio_error; > }; >=20 > /* > @@ -158,63 +94,17 @@ inline int O_APPEND =3D 0x0008; > #pragma D binding "1.1" O_APPEND > inline int O_CREAT =3D 0x0200; > #pragma D binding "1.1" O_CREAT > -inline int O_DSYNC =3D O_DSYNC; > -#pragma D binding "1.1" O_DSYNC > inline int O_EXCL =3D 0x0800; > #pragma D binding "1.1" O_EXCL > -inline int O_LARGEFILE =3D O_LARGEFILE; > -#pragma D binding "1.1" O_LARGEFILE > inline int O_NOCTTY =3D 0x8000; > #pragma D binding "1.1" O_NOCTTY > inline int O_NONBLOCK =3D 0x0004; > #pragma D binding "1.1" O_NONBLOCK > inline int O_NDELAY =3D 0x0004; > #pragma D binding "1.1" O_NDELAY > -inline int O_RSYNC =3D O_RSYNC; > -#pragma D binding "1.1" O_RSYNC > inline int O_SYNC =3D 0x0080; > #pragma D binding "1.1" O_SYNC > inline int O_TRUNC =3D 0x0400; > #pragma D binding "1.1" O_TRUNC > -inline int O_XATTR =3D O_XATTR; > -#pragma D binding "1.1" O_XATTR >=20 > -#pragma D binding "1.1" translator > -translator fileinfo_t < struct file *F > { > - fi_name =3D F =3D=3D NULL ? "" : > - F->f_vnode->v_path =3D=3D NULL ? "" : > - basename(cleanpath(F->f_vnode->v_path)); > - fi_dirname =3D F =3D=3D NULL ? "" : > - F->f_vnode->v_path =3D=3D NULL ? "" : > - dirname(cleanpath(F->f_vnode->v_path)); > - fi_pathname =3D F =3D=3D NULL ? "" : > - F->f_vnode->v_path =3D=3D NULL ? "" : > - cleanpath(F->f_vnode->v_path); > - fi_offset =3D F =3D=3D NULL ? 0 : F->f_offset; > - fi_fs =3D F =3D=3D NULL ? "" : = stringof(F->f_vnode->v_op->vnop_name); > - fi_mount =3D F =3D=3D NULL ? "" : > - F->f_vnode->v_vfsp->vfs_vnodecovered =3D=3D NULL ? "/" : > - F->f_vnode->v_vfsp->vfs_vnodecovered->v_path =3D=3D NULL ? = "" : > - cleanpath(F->f_vnode->v_vfsp->vfs_vnodecovered->v_path); > - fi_oflags =3D F =3D=3D NULL ? 0 : F->f_flag + (int)FOPEN; > -}; >=20 > -inline fileinfo_t fds[int fd] =3D xlate ( > - fd >=3D 0 && fd < curthread->t_procp->p_user.u_finfo.fi_nfiles ? > - curthread->t_procp->p_user.u_finfo.fi_list[fd].uf_file : NULL); > - > -#pragma D attributes Stable/Stable/Common fds > -#pragma D binding "1.1" fds > - > -#pragma D binding "1.2" translator > -translator fileinfo_t < struct vnode *V > { > - fi_name =3D V->v_path =3D=3D NULL ? "" : > - basename(cleanpath(V->v_path)); > - fi_dirname =3D V->v_path =3D=3D NULL ? "" : > - dirname(cleanpath(V->v_path)); > - fi_pathname =3D V->v_path =3D=3D NULL ? "" : = cleanpath(V->v_path); > - fi_fs =3D stringof(V->v_op->vnop_name); > - fi_mount =3D V->v_vfsp->vfs_vnodecovered =3D=3D NULL ? "/" : > - V->v_vfsp->vfs_vnodecovered->v_path =3D=3D NULL ? = "" : > - cleanpath(V->v_vfsp->vfs_vnodecovered->v_path); > -}; >=20 > Copied and modified: stable/9/sys/kern/dtio_kdtrace.c (from r238366, = head/sys/kern/dtio_kdtrace.c) > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/dtio_kdtrace.c Wed Jul 11 16:27:02 2012 = (r238366, copy source) > +++ stable/9/sys/kern/dtio_kdtrace.c Fri Dec 7 19:06:40 2012 = (r243989) > @@ -56,7 +56,7 @@ static dtrace_pattr_t dtio_attr =3D { > { DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, = DTRACE_CLASS_COMMON }, > }; >=20 > -static char *genunix =3D "genunix"; > +static char *kernel =3D "kernel"; >=20 > /* > * Name strings. > @@ -113,25 +113,25 @@ dtio_provide(void *arg, dtrace_probedesc > if (desc !=3D NULL) > return; >=20 > - if (dtrace_probe_lookup(dtio_id, genunix, NULL,=20 > + if (dtrace_probe_lookup(dtio_id, kernel, NULL,=20 > dtio_start_str) =3D=3D 0) { > - dtio_start_id =3D dtrace_probe_create(dtio_id, genunix, = NULL,=20 > + dtio_start_id =3D dtrace_probe_create(dtio_id, kernel, = NULL,=20 > dtio_start_str, 0, = NULL); > } > - if (dtrace_probe_lookup(dtio_id, genunix, NULL, dtio_done_str) = =3D=3D 0) { > - dtio_done_id =3D dtrace_probe_create(dtio_id, genunix, = NULL,=20 > + if (dtrace_probe_lookup(dtio_id, kernel, NULL, dtio_done_str) =3D=3D= 0) { > + dtio_done_id =3D dtrace_probe_create(dtio_id, kernel, = NULL,=20 > dtio_done_str, 0, = NULL); > } > - if (dtrace_probe_lookup(dtio_id, genunix, NULL,=20 > + if (dtrace_probe_lookup(dtio_id, kernel, NULL,=20 > dtio_wait_start_str) =3D=3D 0) { > - dtio_wait_start_id =3D dtrace_probe_create(dtio_id, = genunix,=20 > + dtio_wait_start_id =3D dtrace_probe_create(dtio_id, = kernel,=20 > NULL,=20 > = dtio_wait_start_str,=20 > 0, NULL); > } > - if (dtrace_probe_lookup(dtio_id, genunix, NULL,=20 > + if (dtrace_probe_lookup(dtio_id, kernel, NULL,=20 > dtio_wait_done_str) =3D=3D 0) { > - dtio_wait_done_id =3D dtrace_probe_create(dtio_id, = genunix, NULL,=20 > + dtio_wait_done_id =3D dtrace_probe_create(dtio_id, = kernel, NULL,=20 > dtio_wait_done_str, = 0, NULL); > } >=20 >=20 > Modified: stable/9/sys/kern/subr_devstat.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/kern/subr_devstat.c Fri Dec 7 16:26:32 2012 = (r243988) > +++ stable/9/sys/kern/subr_devstat.c Fri Dec 7 19:06:40 2012 = (r243989) > @@ -29,6 +29,8 @@ > #include > __FBSDID("$FreeBSD$"); >=20 > +#include "opt_kdtrace.h" > + > #include > #include > #include > @@ -44,6 +46,54 @@ __FBSDID("$FreeBSD$"); >=20 > #include >=20 > +#ifdef KDTRACE_HOOKS > +#include > + > +dtrace_io_start_probe_func_t dtrace_io_start_probe; > +dtrace_io_done_probe_func_t dtrace_io_done_probe; > +dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; > +dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; > + > +uint32_t dtio_start_id; > +uint32_t dtio_done_id; > +uint32_t dtio_wait_start_id; > +uint32_t dtio_wait_done_id; > + > +#define DTRACE_DEVSTAT_START() \ > + if (dtrace_io_start_probe !=3D NULL) \ > + (*dtrace_io_start_probe)(dtio_start_id, NULL, ds); > + > +#define DTRACE_DEVSTAT_BIO_START() \ > + if (dtrace_io_start_probe !=3D NULL) \ > + (*dtrace_io_start_probe)(dtio_start_id, bp, ds); > + > +#define DTRACE_DEVSTAT_DONE() \ > + if (dtrace_io_done_probe !=3D NULL) \ > + (*dtrace_io_done_probe)(dtio_done_id, NULL, ds); > + > +#define DTRACE_DEVSTAT_BIO_DONE() \ > + if (dtrace_io_done_probe !=3D NULL) \ > + (*dtrace_io_done_probe)(dtio_done_id, bp, ds); > + > +#define DTRACE_DEVSTAT_WAIT_START() \ > + if (dtrace_io_wait_start_probe !=3D NULL) \ > + (*dtrace_io_wait_start_probe)(dtio_wait_start_id, NULL, = ds); > + > +#define DTRACE_DEVSTAT_WAIT_DONE() \ > + if (dtrace_io_wait_done_probe !=3D NULL) \ > + (*dtrace_io_wait_done_probe)(dtio_wait_done_id, NULL, = ds); > + > +#else /* ! KDTRACE_HOOKS */ > + > +#define DTRACE_DEVSTAT_START() > + > +#define DTRACE_DEVSTAT_DONE() > + > +#define DTRACE_DEVSTAT_WAIT_START() > + > +#define DTRACE_DEVSTAT_WAIT_DONE() > +#endif /* KDTRACE_HOOKS */ > + > static int devstat_num_devs; > static long devstat_generation =3D 1; > static int devstat_version =3D DEVSTAT_VERSION; > @@ -227,6 +277,7 @@ devstat_start_transaction(struct devstat > } > ds->start_count++; > atomic_add_rel_int(&ds->sequence0, 1); > + DTRACE_DEVSTAT_START(); > } >=20 > void > @@ -241,6 +292,7 @@ devstat_start_transaction_bio(struct dev >=20 > binuptime(&bp->bio_t0); > devstat_start_transaction(ds, &bp->bio_t0); > + DTRACE_DEVSTAT_BIO_START(); > } >=20 > /* > @@ -312,6 +364,7 @@ devstat_end_transaction(struct devstat * >=20 > ds->end_count++; > atomic_add_rel_int(&ds->sequence0, 1); > + DTRACE_DEVSTAT_DONE(); > } >=20 > void > @@ -334,6 +387,7 @@ devstat_end_transaction_bio(struct devst >=20 > devstat_end_transaction(ds, bp->bio_bcount - bp->bio_resid, > DEVSTAT_TAG_SIMPLE, flg, NULL, = &bp->bio_t0); > + DTRACE_DEVSTAT_BIO_DONE(); > } >=20 > /* >=20 > Modified: stable/9/sys/modules/dtrace/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/modules/dtrace/Makefile Fri Dec 7 16:26:32 2012 = (r243988) > +++ stable/9/sys/modules/dtrace/Makefile Fri Dec 7 19:06:40 2012 = (r243989) > @@ -11,6 +11,7 @@ SUBDIR=3D dtmalloc \ > dtrace_test \ > lockstat \ > profile \ > + dtio \ > prototype \ > sdt \ > systrace >=20 > Modified: stable/9/sys/modules/dtrace/dtraceall/dtraceall.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/modules/dtrace/dtraceall/dtraceall.c Fri Dec 7 = 16:26:32 2012 (r243988) > +++ stable/9/sys/modules/dtrace/dtraceall/dtraceall.c Fri Dec 7 = 19:06:40 2012 (r243989) > @@ -65,6 +65,7 @@ MODULE_VERSION(dtraceall, 1); > MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1); > MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); > +MODULE_DEPEND(dtraceall, dtio, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); >=20 > Modified: stable/9/sys/sys/dtrace_bsd.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/sys/dtrace_bsd.h Fri Dec 7 16:26:32 2012 = (r243988) > +++ stable/9/sys/sys/dtrace_bsd.h Fri Dec 7 19:06:40 2012 = (r243989) > @@ -38,6 +38,8 @@ struct thread; > struct vattr; > struct vnode; > struct reg; > +struct devstat; > +struct bio; >=20 > /* > * Cyclic clock function type definition used to hook the cyclic > @@ -168,6 +170,23 @@ extern dtrace_nfsclient_nfs23_done_probe > extern dtrace_nfsclient_nfs23_done_probe_func_t > dtrace_nfscl_nfs234_done_probe; >=20 > +/* IO Provider hooks, really hook into devstat */ > +typedef void (*dtrace_io_start_probe_func_t)(uint32_t, struct bio *, > + struct devstat *); > +extern dtrace_io_start_probe_func_t dtrace_io_start_probe; > + > +typedef void (*dtrace_io_done_probe_func_t)(uint32_t, struct bio *, > + struct devstat *); > +extern dtrace_io_done_probe_func_t dtrace_io_done_probe; > + > +typedef void (*dtrace_io_wait_start_probe_func_t)(uint32_t, uintptr_t = *,=20 > + struct devstat *); > +extern dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; > + > +typedef void (*dtrace_io_wait_done_probe_func_t)(uint32_t, uintptr_t = *,=20 > + struct devstat *); > +extern dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; > + > /* > * Functions which allow the dtrace module to check that the kernel=20 > * hooks have been compiled with sufficient space for it's private From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 20:55:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3615D5B0; Fri, 7 Dec 2012 20:55:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16D948FC0C; Fri, 7 Dec 2012 20:55:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB7KtOG9081540; Fri, 7 Dec 2012 20:55:24 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB7KtOio081539; Fri, 7 Dec 2012 20:55:24 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201212072055.qB7KtOio081539@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 7 Dec 2012 20:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243991 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 20:55:25 -0000 Author: melifaro Date: Fri Dec 7 20:55:24 2012 New Revision: 243991 URL: http://svnweb.freebsd.org/changeset/base/243991 Log: Merge r241882. Provide example for newly-added NG_NETFLOW_V9INFO_TYPE Submitted by: Dmitry Luhtionov Modified: stable/9/share/man/man4/ng_netflow.4 Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_netflow.4 ============================================================================== --- stable/9/share/man/man4/ng_netflow.4 Fri Dec 7 20:09:27 2012 (r243990) +++ stable/9/share/man/man4/ng_netflow.4 Fri Dec 7 20:55:24 2012 (r243991) @@ -258,6 +258,8 @@ commands are: .Qq Li "settemplate { time = %u packets = %u }" .It Dv NGM_NETFLOW_SETMTU .Qq Li "setmtu { mtu = %u }" +.It Dv NGM_NETFLOW_V9INFO +.Qq Li v9info .El .Sh SHUTDOWN This node shuts down upon receipt of a From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 7 22:44:36 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFAF5859; Fri, 7 Dec 2012 22:44:36 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 9E19C8FC18; Fri, 7 Dec 2012 22:44:36 +0000 (UTC) Received: from [38.105.238.108] (port=57947 helo=[10.7.1.235]) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80) (envelope-from ) id 1Th6ep-0007sw-BX; Fri, 07 Dec 2012 17:44:35 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r243989 - in stable/9: cddl/lib/libdtrace sys/kern sys/modules/dtrace sys/modules/dtrace/dtio sys/modules/dtrace/dtraceall sys/sys From: George Neville-Neil In-Reply-To: <12702B8F-645A-4F27-9A2B-63845EFB3DF1@yahoo.com> Date: Fri, 7 Dec 2012 17:44:34 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212071906.qB7J6f3Y064043@svn.freebsd.org> <12702B8F-645A-4F27-9A2B-63845EFB3DF1@yahoo.com> To: Scott Long X-Mailer: Apple Mail (2.1499) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 22:44:37 -0000 On Dec 7, 2012, at 15:07 , Scott Long wrote: > Publicly, I'll state that I don't think that devstat is the right = place for these, and I was hoping to have some time to move them to a = better place, or at least fix up the existing problems that are present. = This commit shouldn't be considered the final word the stability of = this set of SDT probes. >=20 And, since we've chatted, I have the notes of that discussion and will = start working on such changes in HEAD. Best, George From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 8 00:08:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 710B315A; Sat, 8 Dec 2012 00:08:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5586D8FC15; Sat, 8 Dec 2012 00:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB808VDu017500; Sat, 8 Dec 2012 00:08:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB808Vx2017499; Sat, 8 Dec 2012 00:08:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212080008.qB808Vx2017499@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 8 Dec 2012 00:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244002 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 00:08:31 -0000 Author: kib Date: Sat Dec 8 00:08:30 2012 New Revision: 244002 URL: http://svnweb.freebsd.org/changeset/base/244002 Log: MFC r238372: Fix build for kernels with dtrace hooks. Modified: stable/9/sys/kern/subr_devstat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_devstat.c ============================================================================== --- stable/9/sys/kern/subr_devstat.c Fri Dec 7 23:48:54 2012 (r244001) +++ stable/9/sys/kern/subr_devstat.c Sat Dec 8 00:08:30 2012 (r244002) @@ -87,8 +87,12 @@ uint32_t dtio_wait_done_id; #define DTRACE_DEVSTAT_START() +#define DTRACE_DEVSTAT_BIO_START() + #define DTRACE_DEVSTAT_DONE() +#define DTRACE_DEVSTAT_BIO_DONE() + #define DTRACE_DEVSTAT_WAIT_START() #define DTRACE_DEVSTAT_WAIT_DONE() From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 8 00:21:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 652E2475; Sat, 8 Dec 2012 00:21:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48C2D8FC08; Sat, 8 Dec 2012 00:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB80Luvh020270; Sat, 8 Dec 2012 00:21:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB80LtoT020267; Sat, 8 Dec 2012 00:21:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212080021.qB80LtoT020267@svn.freebsd.org> From: Eitan Adler Date: Sat, 8 Dec 2012 00:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244003 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 00:21:56 -0000 Author: eadler Date: Sat Dec 8 00:21:55 2012 New Revision: 244003 URL: http://svnweb.freebsd.org/changeset/base/244003 Log: MFC r243663: Add support for AT&T Sierra Wireless USB 3G adapter PR: kern/173982 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Sat Dec 8 00:08:30 2012 (r244002) +++ stable/9/sys/dev/usb/serial/u3g.c Sat Dec 8 00:21:55 2012 (r244003) @@ -213,6 +213,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), U3G_DEV(AIRPRIME, PC5220, 0), + U3G_DEV(AIRPRIME, AC313U, 0), U3G_DEV(ALINK, 3G, 0), U3G_DEV(ALINK, 3GU, 0), U3G_DEV(ALINK, DWM652U5, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Sat Dec 8 00:08:30 2012 (r244002) +++ stable/9/sys/dev/usb/usbdevs Sat Dec 8 00:21:55 2012 (r244003) @@ -943,6 +943,7 @@ product AIRPLUS MCD650 0x3198 MCD650 mo /* AirPrime products */ product AIRPRIME PC5220 0x0112 CDMA Wireless PC Card product AIRPRIME USB308 0x68A3 USB308 HSPA+ USB Modem +product AIRPRIME AC313U 0x68aa Sierra Wireless AirCard 313U /* AirTies products */ product AIRTIES RT3070 0x2310 RT3070 From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 8 00:25:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01DFF60E; Sat, 8 Dec 2012 00:25:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9A638FC13; Sat, 8 Dec 2012 00:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB80Pp4w021089; Sat, 8 Dec 2012 00:25:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB80PpId021088; Sat, 8 Dec 2012 00:25:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212080025.qB80PpId021088@svn.freebsd.org> From: Eitan Adler Date: Sat, 8 Dec 2012 00:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244005 - stable/9/etc/root X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 00:25:52 -0000 Author: eadler Date: Sat Dec 8 00:25:51 2012 New Revision: 244005 URL: http://svnweb.freebsd.org/changeset/base/244005 Log: MFC r243893: Remove hack to emulate effective uid and just use the EUID's name in the first place. I was unaware of this option when originally committing this change. Approved by: cperciva (implicit) Modified: stable/9/etc/root/dot.cshrc Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/root/dot.cshrc ============================================================================== --- stable/9/etc/root/dot.cshrc Sat Dec 8 00:25:51 2012 (r244004) +++ stable/9/etc/root/dot.cshrc Sat Dec 8 00:25:51 2012 (r244005) @@ -23,10 +23,7 @@ setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up - if ($uid == 0) then - set user = root - endif - set prompt = "%n@%m:%~ %# " + set prompt = "%N@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 8 00:28:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7A74A51; Sat, 8 Dec 2012 00:28:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B97FD8FC0C; Sat, 8 Dec 2012 00:28:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB80SGn7021958; Sat, 8 Dec 2012 00:28:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB80SGUA021957; Sat, 8 Dec 2012 00:28:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212080028.qB80SGUA021957@svn.freebsd.org> From: Eitan Adler Date: Sat, 8 Dec 2012 00:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244007 - in stable: 7/share/skel 8/share/skel 9/share/skel X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 00:28:17 -0000 Author: eadler Date: Sat Dec 8 00:28:16 2012 New Revision: 244007 URL: http://svnweb.freebsd.org/changeset/base/244007 Log: MFC r243893: Remove hack to emulate effective uid and just use the EUID's name in the first place. I was unaware of this option when originally committing this change. I accidently merged this to only one directory last time :( Approved by: cperciva (implicit) Modified: stable/9/share/skel/dot.cshrc Directory Properties: stable/9/share/skel/ (props changed) Changes in other areas also in this revision: Modified: stable/7/share/skel/dot.cshrc stable/8/share/skel/dot.cshrc Directory Properties: stable/7/share/skel/ (props changed) stable/8/share/skel/ (props changed) Modified: stable/9/share/skel/dot.cshrc ============================================================================== --- stable/9/share/skel/dot.cshrc Sat Dec 8 00:25:51 2012 (r244006) +++ stable/9/share/skel/dot.cshrc Sat Dec 8 00:28:16 2012 (r244007) @@ -23,10 +23,7 @@ setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up - if ($uid == 0) then - set user = root - endif - set prompt = "%n@%m:%~ %# " + set prompt = "%N@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 8 07:34:21 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48336524; Sat, 8 Dec 2012 07:34:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D64A8FC13; Sat, 8 Dec 2012 07:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB87YLtS092997; Sat, 8 Dec 2012 07:34:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB87YL6R092996; Sat, 8 Dec 2012 07:34:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212080734.qB87YL6R092996@svn.freebsd.org> From: Alexander Motin Date: Sat, 8 Dec 2012 07:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244018 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 07:34:21 -0000 Author: mav Date: Sat Dec 8 07:34:20 2012 New Revision: 244018 URL: http://svnweb.freebsd.org/changeset/base/244018 Log: MFC r240885: Document ipv6 hook, present there for ages. Modified: stable/9/share/man/man4/ng_ppp.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_ppp.4 ============================================================================== --- stable/9/share/man/man4/ng_ppp.4 Sat Dec 8 05:51:27 2012 (r244017) +++ stable/9/share/man/man4/ng_ppp.4 Sat Dec 8 07:34:20 2012 (r244018) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_ppp.8,v 1.3 1999/01/25 23:46:27 archie Exp $ .\" -.Dd December 28, 2006 +.Dd September 24, 2012 .Dt NG_PPP 4 .Os .Sh NAME @@ -325,6 +325,8 @@ Connection to hook .It Dv inet IP packet data +.It Dv ipv6 +IPv6 packet data .It Dv atalk AppleTalk packet data .It Dv ipx From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 8 07:37:12 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D299D801; Sat, 8 Dec 2012 07:37:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4A538FC0C; Sat, 8 Dec 2012 07:37:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB87bCiv093448; Sat, 8 Dec 2012 07:37:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB87bCn5093446; Sat, 8 Dec 2012 07:37:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212080737.qB87bCn5093446@svn.freebsd.org> From: Alexander Motin Date: Sat, 8 Dec 2012 07:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244020 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 07:37:13 -0000 Author: mav Date: Sat Dec 8 07:37:12 2012 New Revision: 244020 URL: http://svnweb.freebsd.org/changeset/base/244020 Log: MFC r243571: Fix problem with the Samsung 840 PRO series SSD detection. The device reports support for SATA Asynchronous Notification in its IDENTIFY data, but returns error on attempt to enable that feature. Make SATA XPT of CAM only report these errors, but not fail the device. Modified: stable/9/sys/cam/ata/ata_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Dec 8 07:34:57 2012 (r244019) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Dec 8 07:37:12 2012 (r244020) @@ -745,6 +745,14 @@ probedone(struct cam_periph *periph, uni goto noerror; /* + * Some Samsung SSDs report supported Asynchronous Notification, + * but return ABORT on attempt to enable it. + */ + } else if (softc->action == PROBE_SETAN && + status == CAM_ATA_STATUS_ERROR) { + goto noerror; + + /* * SES and SAF-TE SEPs have different IDENTIFY commands, * but SATA specification doesn't tell how to identify them. * Until better way found, just try another if first fail.