From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 00:20:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D1F108BA; Sun, 14 Apr 2013 00:20:33 +0000 (UTC) (envelope-from sbruno@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 BF0EC1899; Sun, 14 Apr 2013 00:20:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0KXkF049608; Sun, 14 Apr 2013 00:20:33 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0KXaU049607; Sun, 14 Apr 2013 00:20:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304140020.r3E0KXaU049607@svn.freebsd.org> From: Sean Bruno Date: Sun, 14 Apr 2013 00:20:33 +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: r249455 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:20:33 -0000 Author: sbruno Date: Sun Apr 14 00:20:32 2013 New Revision: 249455 URL: http://svnweb.freebsd.org/changeset/base/249455 Log: MFC r248824 & r248826 Fix compile with CISS_DEBUG defined Fix DDB hook to actually work again Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Sat Apr 13 22:45:41 2013 (r249454) +++ stable/9/sys/dev/ciss/ciss.c Sun Apr 14 00:20:32 2013 (r249455) @@ -1868,7 +1868,7 @@ ciss_accept_media(struct ciss_softc *sc, ldrive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); - debug(0, "bringing logical drive %d back online"); + debug(0, "bringing logical drive %d back online", ldrive); /* * Build a CISS BMIC command to bring the drive back online. @@ -4307,6 +4307,9 @@ ciss_print_ldrive(struct ciss_softc *sc, } #ifdef CISS_DEBUG +#include "opt_ddb.h" +#ifdef DDB +#include /************************************************************************ * Print information about the controller/driver. */ @@ -4341,8 +4344,7 @@ ciss_print_adapter(struct ciss_softc *sc } /* DDB hook */ -static void -ciss_print0(void) +DB_COMMAND(ciss_prt, db_ciss_prt) { struct ciss_softc *sc; @@ -4354,6 +4356,7 @@ ciss_print0(void) } } #endif +#endif /************************************************************************ * Return a name for a logical drive status value. From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 00:49:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D6D2CE94; Sun, 14 Apr 2013 00:49:08 +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 C92451ABC; Sun, 14 Apr 2013 00:49:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0n8ua058445; Sun, 14 Apr 2013 00:49:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0n8br058444; Sun, 14 Apr 2013 00:49:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304140049.r3E0n8br058444@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Apr 2013 00:49:08 +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: r249456 - stable/9/usr.bin/fstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:49:08 -0000 Author: eadler Date: Sun Apr 14 00:49:08 2013 New Revision: 249456 URL: http://svnweb.freebsd.org/changeset/base/249456 Log: MFC r249359: fuser(1) requires a filename. Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.bin/fstat/fuser.1 Directory Properties: stable/9/usr.bin/fstat/ (props changed) Modified: stable/9/usr.bin/fstat/fuser.1 ============================================================================== --- stable/9/usr.bin/fstat/fuser.1 Sun Apr 14 00:20:32 2013 (r249455) +++ stable/9/usr.bin/fstat/fuser.1 Sun Apr 14 00:49:08 2013 (r249456) @@ -36,7 +36,7 @@ .Op Fl M Ar core .Op Fl N Ar system .Op Fl s Ar signal -.Op Ar +.Ar .Sh DESCRIPTION The .Nm From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 00:59:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 649142C6; Sun, 14 Apr 2013 00:59:57 +0000 (UTC) (envelope-from des@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 56CE01B15; Sun, 14 Apr 2013 00:59:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0xvWm061495; Sun, 14 Apr 2013 00:59:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0xvMr061494; Sun, 14 Apr 2013 00:59:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304140059.r3E0xvMr061494@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 00:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249457 - head/lib/libldns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:59:57 -0000 Author: des Date: Sun Apr 14 00:59:56 2013 New Revision: 249457 URL: http://svnweb.freebsd.org/changeset/base/249457 Log: Clean up. Modified: head/lib/libldns/Makefile Modified: head/lib/libldns/Makefile ============================================================================== --- head/lib/libldns/Makefile Sun Apr 14 00:49:08 2013 (r249456) +++ head/lib/libldns/Makefile Sun Apr 14 00:59:56 2013 (r249457) @@ -5,45 +5,18 @@ LDNSDIR = ${.CURDIR}/../../contrib/ldns .PATH: ${LDNSDIR} ${LDNSDIR}/compat -LIB = ldns -INTERNALLIB = true +LIB= ldns +INTERNALLIB= true -CFLAGS += -I${LDNSDIR} +CFLAGS+= -I${LDNSDIR} -SRCS += buffer.c -SRCS += dane.c -SRCS += dname.c -SRCS += dnssec.c -SRCS += dnssec_sign.c -SRCS += dnssec_verify.c -SRCS += dnssec_zone.c -SRCS += duration.c -SRCS += error.c -SRCS += higher.c -SRCS += host2str.c -SRCS += host2wire.c -SRCS += keys.c -SRCS += net.c -SRCS += packet.c -SRCS += parse.c -SRCS += rbtree.c -SRCS += rdata.c -SRCS += resolver.c -SRCS += rr.c -SRCS += rr_functions.c -SRCS += sha1.c -SRCS += sha2.c -SRCS += str2host.c -SRCS += tsig.c -SRCS += update.c -SRCS += util.c -SRCS += wire2host.c -SRCS += zone.c - -SRCS += b32_ntop.c -SRCS += b32_pton.c -SRCS += b64_ntop.c -SRCS += b64_pton.c +SRCS= buffer.c dane.c dname.c dnssec.c dnssec_sign.c dnssec_verify.c \ + dnssec_zone.c duration.c error.c higher.c host2str.c host2wire.c \ + keys.c net.c packet.c parse.c rbtree.c rdata.c resolver.c rr.c \ + rr_functions.c sha1.c sha2.c str2host.c tsig.c update.c util.c \ + wire2host.c zone.c + +SRCS+= b32_ntop.c b32_pton.c b64_ntop.c b64_pton.c WARNS ?= 3 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 02:26:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD915C51; Sun, 14 Apr 2013 02:26:12 +0000 (UTC) (envelope-from hiren@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 BF33D1CFD; Sun, 14 Apr 2013 02:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E2QCRQ089043; Sun, 14 Apr 2013 02:26:12 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E2QC1w089041; Sun, 14 Apr 2013 02:26:12 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304140226.r3E2QC1w089041@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 14 Apr 2013 02:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249460 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 02:26:12 -0000 Author: hiren Date: Sun Apr 14 02:26:12 2013 New Revision: 249460 URL: http://svnweb.freebsd.org/changeset/base/249460 Log: Improve/correct a comment. We now support a lot more cpu types. PR: kern/177496 Approved by: sbruno (mentor) Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Sun Apr 14 01:22:39 2013 (r249459) +++ head/sys/dev/hwpmc/hwpmc_core.c Sun Apr 14 02:26:12 2013 (r249460) @@ -25,7 +25,7 @@ */ /* - * Intel Core, Core 2 and Atom PMCs. + * Intel Core PMCs. */ #include From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 02:42:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0ABFEF16; Sun, 14 Apr 2013 02:42:41 +0000 (UTC) (envelope-from hiren@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 EFD211D50; Sun, 14 Apr 2013 02:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E2gexq094404; Sun, 14 Apr 2013 02:42:40 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E2geSq094403; Sun, 14 Apr 2013 02:42:40 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304140242.r3E2geSq094403@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 14 Apr 2013 02:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249461 - head/sys/dev/ips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 02:42:41 -0000 Author: hiren Date: Sun Apr 14 02:42:40 2013 New Revision: 249461 URL: http://svnweb.freebsd.org/changeset/base/249461 Log: Fixing a clang warning indicating uninitialized variable usage. PR: kern/177164 Approved by: sbruno (mentor) Modified: head/sys/dev/ips/ips.c Modified: head/sys/dev/ips/ips.c ============================================================================== --- head/sys/dev/ips/ips.c Sun Apr 14 02:26:12 2013 (r249460) +++ head/sys/dev/ips/ips.c Sun Apr 14 02:42:40 2013 (r249461) @@ -578,7 +578,7 @@ static int ips_copperhead_queue_init(ips { int error; bus_dma_tag_t dmatag; - bus_dmamap_t dmamap; + bus_dmamap_t dmamap = NULL; if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, /* boundary */ 0, From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:40:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1576FC55; Sun, 14 Apr 2013 08:40:25 +0000 (UTC) (envelope-from joel@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 089316ED; Sun, 14 Apr 2013 08:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E8eOFP003624; Sun, 14 Apr 2013 08:40:24 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E8eO4n003623; Sun, 14 Apr 2013 08:40:24 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304140840.r3E8eO4n003623@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Apr 2013 08:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249462 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:40:25 -0000 Author: joel (doc committer) Date: Sun Apr 14 08:40:24 2013 New Revision: 249462 URL: http://svnweb.freebsd.org/changeset/base/249462 Log: Correct spelling is "Christiaan Huygens". Submitted by: James J. Lippard Obtained from: OpenBSD Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 02:42:40 2013 (r249461) +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 08:40:24 2013 (r249462) @@ -120,7 +120,7 @@ 04/10 William Booth born, 1829, founder of the Salvation Army 04/13 Thomas Jefferson, 3rd President of the United States, born Shadwell Plantation, Albemarle County, Virginia, 1743 -04/14 Christian Huygen born, 1629, physicist & astronomer; +04/14 Christiaan Huygen born, 1629, physicist & astronomer; discovered Saturn's rings 04/15 Leonardo da Vinci born, 1452 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:44:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD9797A; Sun, 14 Apr 2013 08:44:12 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id A0C8678C; Sun, 14 Apr 2013 08:44:12 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1URIXh-0001zc-Ev; Sun, 14 Apr 2013 10:44:10 +0200 Received: from dhcp-077-251-158-153.chello.nl ([77.251.158.153] helo=pinky) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1URIXg-00022m-Tm; Sun, 14 Apr 2013 10:44:09 +0200 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Joel Dahl" Subject: Re: svn commit: r249462 - head/usr.bin/calendar/calendars References: <201304140840.r3E8eO4n003623@svn.freebsd.org> Date: Sun, 14 Apr 2013 10:44:07 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201304140840.r3E8eO4n003623@svn.freebsd.org> User-Agent: Opera Mail/12.15 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.8 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.1 X-Scan-Signature: 76f3589a93270604ea078d468a2051b3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:44:12 -0000 Than you still miss a 's' at the end. Ronald. On Sun, 14 Apr 2013 10:40:24 +0200, Joel Dahl wrote: > Author: joel (doc committer) > Date: Sun Apr 14 08:40:24 2013 > New Revision: 249462 > URL: http://svnweb.freebsd.org/changeset/base/249462 > > Log: > Correct spelling is "Christiaan Huygens". > Submitted by: James J. Lippard > Obtained from: OpenBSD > > Modified: > head/usr.bin/calendar/calendars/calendar.birthday > > Modified: head/usr.bin/calendar/calendars/calendar.birthday > ============================================================================== > --- head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 > 02:42:40 2013 (r249461) > +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 > 08:40:24 2013 (r249462) > @@ -120,7 +120,7 @@ > 04/10 William Booth born, 1829, founder of the Salvation Army > 04/13 Thomas Jefferson, 3rd President of the United States, born > Shadwell > Plantation, Albemarle County, Virginia, 1743 > -04/14 Christian Huygen born, 1629, physicist & astronomer; > +04/14 Christiaan Huygen born, 1629, physicist & astronomer; > discovered Saturn's rings > 04/15 Leonardo da Vinci born, 1452 > 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:47:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 77F8D224; Sun, 14 Apr 2013 08:47:02 +0000 (UTC) (envelope-from joel@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 6B0B279E; Sun, 14 Apr 2013 08:47:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E8l2QW004691; Sun, 14 Apr 2013 08:47:02 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E8l2UM004690; Sun, 14 Apr 2013 08:47:02 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304140847.r3E8l2UM004690@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Apr 2013 08:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249463 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:47:02 -0000 Author: joel (doc committer) Date: Sun Apr 14 08:47:01 2013 New Revision: 249463 URL: http://svnweb.freebsd.org/changeset/base/249463 Log: LSD first synthesised 16/11/38, not 7/4/43. Submitted by: James J. Lippard Obtained from: OpenBSD Modified: head/usr.bin/calendar/calendars/calendar.history Modified: head/usr.bin/calendar/calendars/calendar.history ============================================================================== --- head/usr.bin/calendar/calendars/calendar.history Sun Apr 14 08:40:24 2013 (r249462) +++ head/usr.bin/calendar/calendars/calendar.history Sun Apr 14 08:47:01 2013 (r249463) @@ -99,7 +99,6 @@ 04/04 Martin Luther King assassinated in Memphis, Tennessee, 1968 04/04 NATO Established, 1949 04/06 Joseph Smith founds Mormon Church, 1830 -04/07 Albert Hofmann synthesizes LSD in Switzerland, 1943 04/07 Alewives run, Cape Cod 04/08 Matthew Flinders and Nicolas Baudin meet in Encounter Bay, 1802 04/09 Lee surrenders to Grant at Appomattox Courthouse, 1865 @@ -420,6 +419,7 @@ from McDonald's), 1971 11/15 Niagara Falls power plant startup, 1896 11/16 Opening of the Suez Canal, 1869 +11/16 Albert Hofmann synthesizes LSD in Switzerland, 1938 11/17 46,000 meteoroids fall over AZ in 20 minutes, 1966 11/17 Richard Nixon says "I am not a crook.", 1973 11/18 First hydrogen bomb blasts Enewetok, 1952 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:49:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B078C3B8; Sun, 14 Apr 2013 08:49:35 +0000 (UTC) (envelope-from joel@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 A36987B8; Sun, 14 Apr 2013 08:49:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E8nZZa005053; Sun, 14 Apr 2013 08:49:35 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E8nZZF005052; Sun, 14 Apr 2013 08:49:35 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304140849.r3E8nZZF005052@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Apr 2013 08:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249464 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:49:35 -0000 Author: joel (doc committer) Date: Sun Apr 14 08:49:35 2013 New Revision: 249464 URL: http://svnweb.freebsd.org/changeset/base/249464 Log: Fix typo from previous commit. Submitted by: Ronald Klop Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 08:47:01 2013 (r249463) +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 08:49:35 2013 (r249464) @@ -120,7 +120,7 @@ 04/10 William Booth born, 1829, founder of the Salvation Army 04/13 Thomas Jefferson, 3rd President of the United States, born Shadwell Plantation, Albemarle County, Virginia, 1743 -04/14 Christiaan Huygen born, 1629, physicist & astronomer; +04/14 Christiaan Huygens born, 1629, physicist & astronomer; discovered Saturn's rings 04/15 Leonardo da Vinci born, 1452 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 09:28:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 943767FA; Sun, 14 Apr 2013 09:28:16 +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 842DF84C; Sun, 14 Apr 2013 09:28:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E9SG8t017194; Sun, 14 Apr 2013 09:28:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E9SE1G017182; Sun, 14 Apr 2013 09:28:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304140928.r3E9SE1G017182@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 09:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249466 - in head/sys/cam: . ata ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 09:28:16 -0000 Author: mav Date: Sun Apr 14 09:28:14 2013 New Revision: 249466 URL: http://svnweb.freebsd.org/changeset/base/249466 Log: MFprojects/camlock r248890, r248897, r248898, r248900, r248903, r248905, r248917, r248918, r248978, r249001, r249014, r249030: Remove multilevel freezing mechanism, implemented to handle specifics of the ATA/SATA error recovery, when post-reset recovery commands should be allocated when queues are already full of payload requests. Instead of removing frozen CCBs with specified range of priorities from the queue to provide free openings, use simple hack, allowing explicit CCBs over- allocation for requests with priority higher (numerically lower) then CAM_PRIORITY_OOB threshold. Simplify CCB allocation logic by removing SIM-level allocation queue. After that SIM-level queue manages only CCBs execution, while allocation logic is localized within each single device. Suggested by: gibbs Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam.h head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/cam_queue.c head/sys/cam/cam_queue.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/cam_xpt_sim.h head/sys/cam/ctl/scsi_ctl.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/ata/ata_da.c Sun Apr 14 09:28:14 2013 (r249466) @@ -972,8 +972,6 @@ adaasync(void *callback_arg, u_int32_t c else break; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } default: @@ -1297,15 +1295,11 @@ adaregister(struct cam_periph *periph, v cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { softc->state = ADA_STATE_RAHEAD; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } else softc->state = ADA_STATE_NORMAL; @@ -1587,8 +1581,6 @@ out: if (softc->flags & ADA_FLAG_PACK_INVALID) { softc->state = ADA_STATE_NORMAL; xpt_release_ccb(start_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; @@ -1612,6 +1604,7 @@ out: ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; } + start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); break; } @@ -1624,11 +1617,13 @@ adadone(struct cam_periph *periph, union struct ada_softc *softc; struct ccb_ataio *ataio; struct ccb_getdev *cgd; + struct cam_path *path; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + path = done_ccb->ccb_h.path; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("adadone\n")); switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: @@ -1656,8 +1651,7 @@ adadone(struct cam_periph *periph, union * XXX See if this is really a media * XXX change first? */ - xpt_print(periph->path, - "Invalidating pack\n"); + xpt_print(path, "Invalidating pack\n"); softc->flags |= ADA_FLAG_PACK_INVALID; } bp->bio_error = error; @@ -1670,7 +1664,7 @@ adadone(struct cam_periph *periph, union bp->bio_flags |= BIO_ERROR; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1711,9 +1705,12 @@ adadone(struct cam_periph *periph, union { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (adaerror(done_ccb, 0, 0) == ERESTART) { +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1730,7 +1727,7 @@ adadone(struct cam_periph *periph, union * operation. */ cgd = (struct ccb_getdev *)done_ccb; - xpt_setup_ccb(&cgd->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NORMAL); cgd->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)cgd); if (ADA_WC >= 0 && @@ -1738,12 +1735,12 @@ adadone(struct cam_periph *periph, union softc->state = ADA_STATE_WCACHE; xpt_release_ccb(done_ccb); xpt_schedule(periph, CAM_PRIORITY_DEV); - return; + goto out; } softc->state = ADA_STATE_NORMAL; xpt_release_ccb(done_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; @@ -1752,9 +1749,9 @@ adadone(struct cam_periph *periph, union { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (adaerror(done_ccb, 0, 0) == ERESTART) { - return; + goto out; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1772,8 +1769,8 @@ adadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:28:14 2013 (r249466) @@ -249,12 +249,6 @@ proberegister(struct cam_periph *periph, return (status); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); - - /* - * Ensure nobody slip in until probe finish. - */ - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_XPT + 1); probeschedule(periph); return(CAM_REQ_CMP); } @@ -661,6 +655,7 @@ negotiate: default: panic("probestart: invalid action state 0x%x\n", softc->action); } + start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); } @@ -708,12 +703,15 @@ probedone(struct cam_periph *periph, uni if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (cam_periph_error(done_ccb, 0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0, - NULL) == ERESTART) + NULL) == ERESTART) { +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(path, 0, 0, 0, FALSE); return; + } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ - xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, - /*run_queue*/TRUE); + xpt_release_devq(path, /*count*/1, /*run_queue*/TRUE); } status = done_ccb->ccb_h.status & CAM_STATUS_MASK; if (softc->restart) { @@ -768,7 +766,7 @@ probedone(struct cam_periph *periph, uni PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SAFTE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* @@ -830,7 +828,7 @@ noerror: } xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } case PROBE_IDENTIFY: { @@ -864,7 +862,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SPINUP); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } ident_buf = &path->device->ident_data; if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { @@ -954,7 +952,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } case PROBE_SPINUP: if (bootverbose) @@ -963,7 +961,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_IDENTIFY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_SETMODE: /* Set supported bits. */ bzero(&cts, sizeof(cts)); @@ -1034,7 +1032,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETPM); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETPM: @@ -1045,7 +1043,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETAPST); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETAPST: @@ -1055,7 +1053,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETDMAAA); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETDMAAA: @@ -1065,7 +1063,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETAN); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETAN: @@ -1077,15 +1075,14 @@ notsata: } xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_SET_MULTI: if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1118,7 +1115,7 @@ notsata: PROBE_SET_ACTION(softc, PROBE_FULL_INQUIRY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } ata_device_transport(path); @@ -1127,7 +1124,7 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1145,7 +1142,7 @@ notsata: PROBE_SET_ACTION(softc, PROBE_PM_PRV); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_PM_PRV: softc->pm_prv = (done_ccb->ataio.res.lba_high << 24) + (done_ccb->ataio.res.lba_mid << 16) + @@ -1200,12 +1197,11 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } else { done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); + xpt_async(AC_SCSI_AEN, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1250,8 +1246,7 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1263,7 +1258,7 @@ done: softc->restart = 0; xpt_release_ccb(done_ccb); probeschedule(periph); - return; + goto out; } xpt_release_ccb(done_ccb); CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); @@ -1273,9 +1268,9 @@ done: done_ccb->ccb_h.status = found ? CAM_REQ_CMP : CAM_REQ_CMP_ERR; xpt_done(done_ccb); } + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(path, 0, 0, 0, FALSE); cam_periph_invalidate(periph); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); cam_periph_release_locked(periph); } Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam.h Sun Apr 14 09:28:14 2013 (r249466) @@ -80,10 +80,9 @@ typedef struct { #define CAM_PRIORITY_BUS ((CAM_RL_BUS << 8) + 0x80) #define CAM_PRIORITY_XPT ((CAM_RL_XPT << 8) + 0x80) #define CAM_PRIORITY_DEV ((CAM_RL_DEV << 8) + 0x80) +#define CAM_PRIORITY_OOB (CAM_RL_DEV << 8) #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 -#define CAM_PRIORITY_TO_RL(x) ((x) >> 8) -#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_ccb.h Sun Apr 14 09:28:14 2013 (r249466) @@ -145,8 +145,6 @@ typedef enum { /* Path statistics (error counts, etc.) */ XPT_GDEV_STATS = 0x0c, /* Device statistics (error counts, etc.) */ - XPT_FREEZE_QUEUE = 0x0d, - /* Freeze device queue */ XPT_DEV_ADVINFO = 0x0e, /* Get/Set Device advanced information */ /* SCSI Control Functions: 0x10->0x1F */ @@ -749,7 +747,6 @@ struct ccb_relsim { #define RELSIM_RELEASE_AFTER_TIMEOUT 0x02 #define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 #define RELSIM_RELEASE_AFTER_QEMPTY 0x08 -#define RELSIM_RELEASE_RUNLEVEL 0x10 u_int32_t openings; u_int32_t release_timeout; /* Abstract argument. */ u_int32_t qfrozen_cnt; Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_periph.c Sun Apr 14 09:28:14 2013 (r249466) @@ -1117,21 +1117,12 @@ cam_periph_runccb(union ccb *ccb, void cam_freeze_devq(struct cam_path *path) { + struct ccb_hdr ccb_h; - cam_freeze_devq_arg(path, 0, 0); -} - -void -cam_freeze_devq_arg(struct cam_path *path, uint32_t flags, uint32_t arg) -{ - struct ccb_relsim crs; - - xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NONE); - crs.ccb_h.func_code = XPT_FREEZE_QUEUE; - crs.release_flags = flags; - crs.openings = arg; - crs.release_timeout = arg; - xpt_action((union ccb *)&crs); + xpt_setup_ccb(&ccb_h, path, /*priority*/1); + ccb_h.func_code = XPT_NOOP; + ccb_h.flags = CAM_DEV_QFREEZE; + xpt_action((union ccb *)&ccb_h); } u_int32_t Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_periph.h Sun Apr 14 09:28:14 2013 (r249466) @@ -171,8 +171,6 @@ int cam_periph_ioctl(struct cam_periph cam_flags camflags, u_int32_t sense_flags)); void cam_freeze_devq(struct cam_path *path); -void cam_freeze_devq_arg(struct cam_path *path, u_int32_t flags, - uint32_t arg); u_int32_t cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, u_int32_t opening_reduction, u_int32_t arg, int getcount_only); Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_queue.c Sun Apr 14 09:28:14 2013 (r249466) @@ -230,15 +230,8 @@ int cam_devq_init(struct cam_devq *devq, int devices, int openings) { bzero(devq, sizeof(*devq)); - if (camq_init(&devq->alloc_queue, devices) != 0) { + if (camq_init(&devq->send_queue, devices) != 0) return (1); - } - if (camq_init(&devq->send_queue, devices) != 0) { - camq_fini(&devq->alloc_queue); - return (1); - } - devq->alloc_openings = openings; - devq->alloc_active = 0; devq->send_openings = openings; devq->send_active = 0; return (0); @@ -247,7 +240,6 @@ cam_devq_init(struct cam_devq *devq, int void cam_devq_free(struct cam_devq *devq) { - camq_fini(&devq->alloc_queue); camq_fini(&devq->send_queue); free(devq, M_CAMDEVQ); } @@ -257,11 +249,7 @@ cam_devq_resize(struct cam_devq *camq, i { u_int32_t retval; - retval = camq_resize(&camq->alloc_queue, devices); - - if (retval == CAM_REQ_CMP) - retval = camq_resize(&camq->send_queue, devices); - + retval = camq_resize(&camq->send_queue, devices); return (retval); } @@ -328,11 +316,10 @@ int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) { + if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) return (1); - } ccbq->devq_openings = openings; - ccbq->dev_openings = openings; + ccbq->dev_openings = openings; return (0); } Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_queue.h Sun Apr 14 09:28:14 2013 (r249466) @@ -48,7 +48,7 @@ struct camq { int array_size; int entries; u_int32_t generation; - u_int32_t qfrozen_cnt[CAM_RL_VALUES]; + u_int32_t qfrozen_cnt; }; TAILQ_HEAD(ccb_hdr_tailq, ccb_hdr); @@ -58,7 +58,8 @@ SLIST_HEAD(ccb_hdr_slist, ccb_hdr); struct cam_ccbq { struct camq queue; int devq_openings; - int dev_openings; + int devq_allocating; + int dev_openings; int dev_active; int held; }; @@ -66,11 +67,7 @@ struct cam_ccbq { struct cam_ed; struct cam_devq { - struct camq alloc_queue; struct camq send_queue; - struct cam_ed *active_dev; - int alloc_openings; - int alloc_active; int send_openings; int send_active; }; @@ -195,8 +192,7 @@ cam_ccbq_insert_ccb(struct cam_ccbq *ccb { ccbq->held--; camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); - if (ccbq->queue.qfrozen_cnt[CAM_PRIORITY_TO_RL( - new_ccb->ccb_h.pinfo.priority)] > 0) { + if (ccbq->queue.qfrozen_cnt > 0) { ccbq->devq_openings++; ccbq->held++; return (1); @@ -208,8 +204,7 @@ static __inline int cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb) { camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index); - if (ccbq->queue.qfrozen_cnt[CAM_PRIORITY_TO_RL( - ccb->ccb_h.pinfo.priority)] > 0) { + if (ccbq->queue.qfrozen_cnt > 0) { ccbq->devq_openings--; ccbq->held--; return (1); @@ -248,81 +243,5 @@ cam_ccbq_release_opening(struct cam_ccbq ccbq->devq_openings++; } -static __inline int -cam_ccbq_freeze(struct cam_ccbq *ccbq, cam_rl rl, u_int32_t cnt) -{ - int i, frozen = 0; - cam_rl p, n; - - /* Find pevious run level. */ - for (p = 0; p < CAM_RL_VALUES && ccbq->queue.qfrozen_cnt[p] == 0; p++); - /* Find new run level. */ - n = min(rl, p); - /* Apply new run level. */ - for (i = rl; i < CAM_RL_VALUES; i++) - ccbq->queue.qfrozen_cnt[i] += cnt; - /* Update ccbq statistics. */ - if (n == p) - return (0); - for (i = CAMQ_HEAD; i <= ccbq->queue.entries; i++) { - cam_rl rrl = - CAM_PRIORITY_TO_RL(ccbq->queue.queue_array[i]->priority); - if (rrl < n) - continue; - if (rrl >= p) - break; - ccbq->devq_openings++; - ccbq->held++; - frozen++; - } - return (frozen); -} - -static __inline int -cam_ccbq_release(struct cam_ccbq *ccbq, cam_rl rl, u_int32_t cnt) -{ - int i, released = 0; - cam_rl p, n; - - /* Apply new run level. */ - for (i = rl; i < CAM_RL_VALUES; i++) - ccbq->queue.qfrozen_cnt[i] -= cnt; - /* Find new run level. */ - for (n = 0; n < CAM_RL_VALUES && ccbq->queue.qfrozen_cnt[n] == 0; n++); - /* Find previous run level. */ - p = min(rl, n); - /* Update ccbq statistics. */ - if (n == p) - return (0); - for (i = CAMQ_HEAD; i <= ccbq->queue.entries; i++) { - cam_rl rrl = - CAM_PRIORITY_TO_RL(ccbq->queue.queue_array[i]->priority); - if (rrl < p) - continue; - if (rrl >= n) - break; - ccbq->devq_openings--; - ccbq->held--; - released++; - } - return (released); -} - -static __inline u_int32_t -cam_ccbq_frozen(struct cam_ccbq *ccbq, cam_rl rl) -{ - - return (ccbq->queue.qfrozen_cnt[rl]); -} - -static __inline u_int32_t -cam_ccbq_frozen_top(struct cam_ccbq *ccbq) -{ - cam_rl rl; - - rl = CAM_PRIORITY_TO_RL(CAMQ_GET_PRIO(&ccbq->queue)); - return (ccbq->queue.qfrozen_cnt[rl]); -} - #endif /* _KERNEL */ #endif /* _CAM_CAM_QUEUE_H */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_xpt.c Sun Apr 14 09:28:14 2013 (r249466) @@ -223,13 +223,13 @@ static void xpt_async_bcast(struct asyn static path_id_t xptnextfreepathid(void); static path_id_t xptpathid(const char *sim_name, int sim_unit, int sim_bus); static union ccb *xpt_get_ccb(struct cam_ed *device); -static void xpt_run_dev_allocq(struct cam_eb *bus); -static void xpt_run_dev_sendq(struct cam_eb *bus); +static void xpt_run_dev_allocq(struct cam_ed *device); +static void xpt_run_devq(struct cam_devq *devq); static timeout_t xpt_release_devq_timeout; static void xpt_release_simq_timeout(void *arg) __unused; static void xpt_release_bus(struct cam_eb *bus); -static void xpt_release_devq_device(struct cam_ed *dev, cam_rl rl, - u_int count, int run_queue); +static void xpt_release_devq_device(struct cam_ed *dev, u_int count, + int run_queue); static struct cam_et* xpt_alloc_target(struct cam_eb *bus, target_id_t target_id); static void xpt_release_target(struct cam_et *target); @@ -296,49 +296,24 @@ static xpt_busfunc_t xptsetasyncbusfunc; static cam_status xptregister(struct cam_periph *periph, void *arg); static __inline int periph_is_queued(struct cam_periph *periph); -static __inline int device_is_alloc_queued(struct cam_ed *device); -static __inline int device_is_send_queued(struct cam_ed *device); +static __inline int device_is_queued(struct cam_ed *device); static __inline int -xpt_schedule_dev_allocq(struct cam_eb *bus, struct cam_ed *dev) -{ - int retval; - - if ((dev->drvq.entries > 0) && - (dev->ccbq.devq_openings > 0) && - (cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL( - CAMQ_GET_PRIO(&dev->drvq))) == 0)) { - /* - * The priority of a device waiting for CCB resources - * is that of the highest priority peripheral driver - * enqueued. - */ - retval = xpt_schedule_dev(&bus->sim->devq->alloc_queue, - &dev->alloc_ccb_entry.pinfo, - CAMQ_GET_PRIO(&dev->drvq)); - } else { - retval = 0; - } - - return (retval); -} - -static __inline int -xpt_schedule_dev_sendq(struct cam_eb *bus, struct cam_ed *dev) +xpt_schedule_devq(struct cam_devq *devq, struct cam_ed *dev) { int retval; if ((dev->ccbq.queue.entries > 0) && (dev->ccbq.dev_openings > 0) && - (cam_ccbq_frozen_top(&dev->ccbq) == 0)) { + (dev->ccbq.queue.qfrozen_cnt == 0)) { /* * The priority of a device waiting for controller * resources is that of the highest priority CCB * enqueued. */ retval = - xpt_schedule_dev(&bus->sim->devq->send_queue, - &dev->send_ccb_entry.pinfo, + xpt_schedule_dev(&devq->send_queue, + &dev->devq_entry.pinfo, CAMQ_GET_PRIO(&dev->ccbq.queue)); } else { retval = 0; @@ -353,15 +328,9 @@ periph_is_queued(struct cam_periph *peri } static __inline int -device_is_alloc_queued(struct cam_ed *device) -{ - return (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX); -} - -static __inline int -device_is_send_queued(struct cam_ed *device) +device_is_queued(struct cam_ed *device) { - return (device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX); + return (device->devq_entry.pinfo.index != CAM_UNQUEUED_INDEX); } static void @@ -2487,17 +2456,10 @@ xpt_action_default(union ccb *start_ccb) case XPT_RESET_DEV: case XPT_ENG_EXEC: case XPT_SMP_IO: - { - int frozen; - - frozen = cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); - path->device->sim->devq->alloc_openings += frozen; - if (frozen > 0) - xpt_run_dev_allocq(path->bus); - if (xpt_schedule_dev_sendq(path->bus, path->device)) - xpt_run_dev_sendq(path->bus); + cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); + if (xpt_schedule_devq(path->bus->sim->devq, path->device)) + xpt_run_devq(path->bus->sim->devq); break; - } case XPT_CALC_GEOMETRY: { struct cam_sim *sim; @@ -2546,8 +2508,7 @@ xpt_action_default(union ccb *start_ccb) device = abort_ccb->ccb_h.path->device; ccbq = &device->ccbq; - device->sim->devq->alloc_openings -= - cam_ccbq_remove_ccb(ccbq, abort_ccb); + cam_ccbq_remove_ccb(ccbq, abort_ccb); abort_ccb->ccb_h.status = CAM_REQ_ABORTED|CAM_DEV_QFRZN; xpt_freeze_devq(abort_ccb->ccb_h.path, 1); @@ -2928,13 +2889,9 @@ xpt_action_default(union ccb *start_ccb) } } - if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) { - xpt_release_devq_rl(path, /*runlevel*/ - (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ? - crs->release_timeout : 0, - /*count*/1, /*run_queue*/TRUE); - } - start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt[0]; + if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) + xpt_release_devq(path, /*count*/1, /*run_queue*/TRUE); + start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt; start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -2977,16 +2934,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } - case XPT_FREEZE_QUEUE: - { - struct ccb_relsim *crs = &start_ccb->crs; - - xpt_freeze_devq_rl(path, /*runlevel*/ - (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ? - crs->release_timeout : 0, /*count*/1); - start_ccb->ccb_h.status = CAM_REQ_CMP; - break; - } case XPT_NOOP: if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0) xpt_freeze_devq(path, 1); @@ -3092,7 +3039,7 @@ xpt_schedule(struct cam_periph *perph, u camq_change_priority(&device->drvq, perph->pinfo.index, new_priority); - runq = xpt_schedule_dev_allocq(perph->path->bus, device); + runq = 1; } } else { /* New entry on the queue */ @@ -3101,12 +3048,12 @@ xpt_schedule(struct cam_periph *perph, u perph->pinfo.priority = new_priority; perph->pinfo.generation = ++device->drvq.generation; camq_insert(&device->drvq, &perph->pinfo); - runq = xpt_schedule_dev_allocq(perph->path->bus, device); + runq = 1; } if (runq != 0) { CAM_DEBUG(perph->path, CAM_DEBUG_SUBTRACE, - (" calling xpt_run_devq\n")); - xpt_run_dev_allocq(perph->path->bus); + (" calling xpt_run_dev_allocq\n")); + xpt_run_dev_allocq(device); } } @@ -3159,43 +3106,25 @@ xpt_schedule_dev(struct camq *queue, cam } static void -xpt_run_dev_allocq(struct cam_eb *bus) +xpt_run_dev_allocq(struct cam_ed *device) { - struct cam_devq *devq; - - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq\n")); - devq = bus->sim->devq; + struct camq *drvq; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, - (" qfrozen_cnt == 0x%x, entries == %d, " - "openings == %d, active == %d\n", - devq->alloc_queue.qfrozen_cnt[0], - devq->alloc_queue.entries, - devq->alloc_openings, - devq->alloc_active)); - - devq->alloc_queue.qfrozen_cnt[0]++; - while ((devq->alloc_queue.entries > 0) - && (devq->alloc_openings > 0) - && (devq->alloc_queue.qfrozen_cnt[0] <= 1)) { - struct cam_ed_qinfo *qinfo; - struct cam_ed *device; + if (device->ccbq.devq_allocating) + return; + device->ccbq.devq_allocating = 1; + CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq(%p)\n", device)); + drvq = &device->drvq; + while ((drvq->entries > 0) && + (device->ccbq.devq_openings > 0 || + CAMQ_GET_PRIO(drvq) <= CAM_PRIORITY_OOB) && + (device->ccbq.queue.qfrozen_cnt == 0)) { union ccb *work_ccb; struct cam_periph *drv; - struct camq *drvq; - qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->alloc_queue, - CAMQ_HEAD); - device = qinfo->device; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, - ("running device %p\n", device)); - - drvq = &device->drvq; KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { - devq->alloc_openings--; - devq->alloc_active++; drv = (struct cam_periph*)camq_remove(drvq, CAMQ_HEAD); xpt_setup_ccb(&work_ccb->ccb_h, drv->path, drv->pinfo.priority); @@ -3214,27 +3143,21 @@ xpt_run_dev_allocq(struct cam_eb *bus) */ break; } - - /* We may have more work. Attempt to reschedule. */ - xpt_schedule_dev_allocq(bus, device); } - devq->alloc_queue.qfrozen_cnt[0]--; + device->ccbq.devq_allocating = 0; } static void -xpt_run_dev_sendq(struct cam_eb *bus) +xpt_run_devq(struct cam_devq *devq) { - struct cam_devq *devq; char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n")); - - devq = bus->sim->devq; + CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_devq\n")); - devq->send_queue.qfrozen_cnt[0]++; + devq->send_queue.qfrozen_cnt++; while ((devq->send_queue.entries > 0) && (devq->send_openings > 0) - && (devq->send_queue.qfrozen_cnt[0] <= 1)) { + && (devq->send_queue.qfrozen_cnt <= 1)) { struct cam_ed_qinfo *qinfo; struct cam_ed *device; union ccb *work_ccb; @@ -3284,9 +3207,9 @@ xpt_run_dev_sendq(struct cam_eb *bus) devq->send_openings--; devq->send_active++; - xpt_schedule_dev_sendq(bus, device); + xpt_schedule_devq(devq, device); - if (work_ccb && (work_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0){ + if ((work_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0) { /* * The client wants to freeze the queue * after this CCB is sent. @@ -3336,7 +3259,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) sim = work_ccb->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, work_ccb); } - devq->send_queue.qfrozen_cnt[0]--; + devq->send_queue.qfrozen_cnt--; } /* @@ -3799,14 +3722,7 @@ xpt_release_ccb(union ccb *free_ccb) SLIST_INSERT_HEAD(&sim->ccb_freeq, &free_ccb->ccb_h, xpt_links.sle); } - if (sim->devq == NULL) { - return; - } - sim->devq->alloc_openings++; - sim->devq->alloc_active--; - if (device_is_alloc_queued(device) == 0) - xpt_schedule_dev_allocq(bus, device); - xpt_run_dev_allocq(bus); + xpt_run_dev_allocq(device); } /* Functions accessed by SIM drivers */ @@ -4153,34 +4069,18 @@ xpt_dev_async_default(u_int32_t async_co } u_int32_t -xpt_freeze_devq_rl(struct cam_path *path, cam_rl rl, u_int count) +xpt_freeze_devq(struct cam_path *path, u_int count) { struct cam_ed *dev = path->device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - dev->sim->devq->alloc_openings += - cam_ccbq_freeze(&dev->ccbq, rl, count); - /* Remove frozen device from allocq. */ - if (device_is_alloc_queued(dev) && - cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL( - CAMQ_GET_PRIO(&dev->drvq)))) { - camq_remove(&dev->sim->devq->alloc_queue, - dev->alloc_ccb_entry.pinfo.index); - } + dev->ccbq.queue.qfrozen_cnt += count; /* Remove frozen device from sendq. */ - if (device_is_send_queued(dev) && - cam_ccbq_frozen_top(&dev->ccbq)) { + if (device_is_queued(dev)) { camq_remove(&dev->sim->devq->send_queue, - dev->send_ccb_entry.pinfo.index); + dev->devq_entry.pinfo.index); } - return (dev->ccbq.queue.qfrozen_cnt[rl]); -} - -u_int32_t -xpt_freeze_devq(struct cam_path *path, u_int count) -{ - - return (xpt_freeze_devq_rl(path, 0, count)); + return (dev->ccbq.queue.qfrozen_cnt); } u_int32_t @@ -4188,8 +4088,8 @@ xpt_freeze_simq(struct cam_sim *sim, u_i { mtx_assert(sim->mtx, MA_OWNED); - sim->devq->send_queue.qfrozen_cnt[0] += count; - return (sim->devq->send_queue.qfrozen_cnt[0]); + sim->devq->send_queue.qfrozen_cnt += count; + return (sim->devq->send_queue.qfrozen_cnt); } static void @@ -4198,45 +4098,30 @@ xpt_release_devq_timeout(void *arg) struct cam_ed *device; device = (struct cam_ed *)arg; - - xpt_release_devq_device(device, /*rl*/0, /*count*/1, /*run_queue*/TRUE); + xpt_release_devq_device(device, /*count*/1, /*run_queue*/TRUE); } void xpt_release_devq(struct cam_path *path, u_int count, int run_queue) { - mtx_assert(path->bus->sim->mtx, MA_OWNED); - xpt_release_devq_device(path->device, /*rl*/0, count, run_queue); -} - -void -xpt_release_devq_rl(struct cam_path *path, cam_rl rl, u_int count, int run_queue) -{ mtx_assert(path->bus->sim->mtx, MA_OWNED); - - xpt_release_devq_device(path->device, rl, count, run_queue); + xpt_release_devq_device(path->device, count, run_queue); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 09:55:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DADB5DA3; Sun, 14 Apr 2013 09:55:53 +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 BDFD18FB; Sun, 14 Apr 2013 09:55:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E9trVe025781; Sun, 14 Apr 2013 09:55:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E9tmv4025746; Sun, 14 Apr 2013 09:55:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304140955.r3E9tmv4025746@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 09:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249468 - in head/sys: cam cam/ata cam/ctl cam/scsi dev/aac dev/arcmsr dev/ciss dev/firewire dev/hpt27xx dev/hptiop dev/hptrr dev/isci dev/iscsi/initiator dev/isp dev/mfi dev/mly dev/mp... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 09:55:53 -0000 Author: mav Date: Sun Apr 14 09:55:48 2013 New Revision: 249468 URL: http://svnweb.freebsd.org/changeset/base/249468 Log: MFprojects/camlock r248982: Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now. Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/scsi/scsi_xpt.c head/sys/dev/aac/aac_cam.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/ciss/ciss.c head/sys/dev/firewire/sbp.c head/sys/dev/hpt27xx/osm_bsd.c head/sys/dev/hptiop/hptiop.c head/sys/dev/hptrr/hptrr_osm_bsd.c head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_domain.c head/sys/dev/isci/isci_remote_device.c head/sys/dev/iscsi/initiator/isc_cam.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mly/mly.c head/sys/dev/mps/mps_sas.c head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_raid.c head/sys/dev/twa/tw_osl_cam.c head/sys/dev/tws/tws_cam.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1439,7 +1439,7 @@ done: scan_info->counter = (scan_info->counter + 1 ) % (scan_info->cpi->max_target + 1); scan_next: - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, scan_info->request_ccb->ccb_h.path_id, scan_info->counter, 0); if (status != CAM_REQ_CMP) { @@ -1497,7 +1497,7 @@ ata_scan_lun(struct cam_periph *periph, "can't continue\n"); return; } - status = xpt_create_path(&new_path, xpt_periph, + status = xpt_create_path(&new_path, NULL, path->bus->path_id, path->target->target_id, path->device->lun_id); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/cam_xpt.c Sun Apr 14 09:55:48 2013 (r249468) @@ -451,7 +451,7 @@ xptioctl(struct cdev *dev, u_long cmd, c * Create a path using the bus, target, and lun the * user passed in. */ - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, inccb->ccb_h.path_id, inccb->ccb_h.target_id, inccb->ccb_h.target_lun) != @@ -487,7 +487,7 @@ xptioctl(struct cdev *dev, u_long cmd, c * Create a path using the bus, target, and lun the * user passed in. */ - if (xpt_create_path(&ccb.ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb.ccb_h.path, NULL, inccb->ccb_h.path_id, inccb->ccb_h.target_id, inccb->ccb_h.target_lun) != @@ -2918,7 +2918,7 @@ xpt_action_default(union ccb *start_ccb) CAM_SIM_LOCK(xpt_path_sim(start_ccb->ccb_h.path)); } if (start_ccb->cdbg.flags != CAM_DEBUG_NONE) { - if (xpt_create_path(&cam_dpath, xpt_periph, + if (xpt_create_path(&cam_dpath, NULL, start_ccb->ccb_h.path_id, start_ccb->ccb_h.target_id, start_ccb->ccb_h.target_lun) != @@ -4640,7 +4640,7 @@ xpt_config(void *arg) /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { - if (xpt_create_path_unlocked(&cam_dpath, xpt_periph, + if (xpt_create_path_unlocked(&cam_dpath, NULL, CAM_DEBUG_BUS, CAM_DEBUG_TARGET, CAM_DEBUG_LUN) != CAM_REQ_CMP) { printf("xpt_config: xpt_create_path() failed for debug" Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Apr 14 09:55:48 2013 (r249468) @@ -311,7 +311,7 @@ cfcs_onoffline(void *arg, int online) goto bailout; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: can't allocate path for rescan\n", __func__); Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/scsi/scsi_xpt.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1953,7 +1953,7 @@ scsi_scan_bus(struct cam_periph *periph, if (i == initiator_id) continue; - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, request_ccb->ccb_h.path_id, i, 0); if (status != CAM_REQ_CMP) { @@ -2154,7 +2154,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); break; } - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, scan_info->request_ccb->ccb_h.path_id, scan_info->counter, 0); if (status != CAM_REQ_CMP) { @@ -2177,7 +2177,7 @@ scsi_scan_bus(struct cam_periph *periph, request_ccb->crcn.flags = scan_info->request_ccb->crcn.flags; } else { - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, path_id, target_id, lun_id); /* * Free the old request path- we're done with it. We @@ -2250,7 +2250,7 @@ scsi_scan_lun(struct cam_periph *periph, "can't continue\n"); return; } - status = xpt_create_path(&new_path, xpt_periph, + status = xpt_create_path(&new_path, NULL, path->bus->path_id, path->target->target_id, path->device->lun_id); Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/aac/aac_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -129,7 +129,7 @@ aac_cam_rescan(struct aac_softc *sc, uin return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(camsc->sim), target_id, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/arcmsr/arcmsr.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1599,7 +1599,8 @@ static void arcmsr_rescan_lun(struct Ada if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) return; - if (xpt_create_path(&path, xpt_periph, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) + if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) + != CAM_REQ_CMP) { xpt_free_ccb(ccb); return; Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/ciss/ciss.c Sun Apr 14 09:55:48 2013 (r249468) @@ -2913,7 +2913,7 @@ ciss_cam_rescan_target(struct ciss_softc return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), target, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { ciss_printf(sc, "rescan failed (can't create path)\n"); Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/firewire/sbp.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1086,7 +1086,7 @@ END_DEBUG sbp_xfer_free(xfer); if (sdev->path == NULL) - xpt_create_path(&sdev->path, xpt_periph, + xpt_create_path(&sdev->path, NULL, cam_sim_path(target->sbp->sim), target->target_id, sdev->lun_id); @@ -2039,7 +2039,7 @@ END_DEBUG if (xpt_bus_register(sbp->sim, dev, /*bus*/0) != CAM_SUCCESS) goto fail; - if (xpt_create_path(&sbp->path, xpt_periph, cam_sim_path(sbp->sim), + if (xpt_create_path(&sbp->path, NULL, cam_sim_path(sbp->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(sbp->sim)); goto fail; Modified: head/sys/dev/hpt27xx/osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/osm_bsd.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/hpt27xx/osm_bsd.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1347,7 +1347,7 @@ static int hpt_rescan_bus(void) #endif ldm_for_each_vbus(vbus, vbus_ext) { - if (xpt_create_path(&path, xpt_periph, cam_sim_path(vbus_ext->sim), + if (xpt_create_path(&path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) return(EIO); if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL) Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/hptiop/hptiop.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1437,7 +1437,7 @@ static int hptiop_rescan_bus(struct hpt if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(hba->sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(hba->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); return(EIO); Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1355,7 +1355,7 @@ static int hpt_rescan_bus(void) ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isci/isci_controller.c Sun Apr 14 09:55:48 2013 (r249468) @@ -580,7 +580,7 @@ void isci_controller_domain_discovery_co */ union ccb *ccb = xpt_alloc_ccb_nowait(); - xpt_create_path(&ccb->ccb_h.path, xpt_periph, + xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(isci_controller->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); Modified: head/sys/dev/isci/isci_domain.c ============================================================================== --- head/sys/dev/isci/isci_domain.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isci/isci_domain.c Sun Apr 14 09:55:48 2013 (r249468) @@ -300,7 +300,7 @@ scif_cb_domain_device_removed(SCI_CONTRO isci_controller->remote_device[isci_remote_device->index] = NULL; - xpt_create_path(&ccb->ccb_h.path, xpt_periph, path, + xpt_create_path(&ccb->ccb_h.path, NULL, path, isci_remote_device->index, CAM_LUN_WILDCARD); xpt_rescan(ccb); Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isci/isci_remote_device.c Sun Apr 14 09:55:48 2013 (r249468) @@ -83,7 +83,7 @@ scif_cb_remote_device_ready(SCI_CONTROLL */ union ccb *ccb = xpt_alloc_ccb_nowait(); - xpt_create_path(&ccb->ccb_h.path, xpt_periph, + xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(isci_controller->sim), isci_remote_device->index, CAM_LUN_WILDCARD); @@ -262,7 +262,7 @@ isci_remote_device_freeze_lun_queue(stru if (!(remote_device->frozen_lun_mask & (1 << lun))) { struct cam_path *path; - xpt_create_path(&path, xpt_periph, + xpt_create_path(&path, NULL, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_freeze_devq(path, 1); @@ -279,7 +279,7 @@ isci_remote_device_release_lun_queue(str struct cam_path *path; remote_device->frozen_lun_mask &= ~(1 << lun); - xpt_create_path(&path, xpt_periph, + xpt_create_path(&path, NULL, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); Modified: head/sys/dev/iscsi/initiator/isc_cam.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/iscsi/initiator/isc_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -150,7 +150,7 @@ ic_scan(isc_session_t *sp) sp->flags |= ISC_SCANWAIT; CAM_LOCK(sp); - if(xpt_create_path(&sp->cam_path, xpt_periph, cam_sim_path(sp->cam_sim), + if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim), 0, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xdebug("can't create cam path"); CAM_UNLOCK(sp); Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isp/isp_freebsd.c Sun Apr 14 09:55:48 2013 (r249468) @@ -4554,7 +4554,8 @@ isp_make_here(ispsoftc_t *isp, int chan, isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for rescan", chan); return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(fc->sim), + tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan"); xpt_free_ccb(ccb); return; Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mfi/mfi_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -318,7 +318,7 @@ mfip_cam_rescan(struct mfi_softc *sc, ui } sim = camsc->sim; - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); device_printf(sc->mfi_dev, Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mly/mly.c Sun Apr 14 09:55:48 2013 (r249468) @@ -2025,7 +2025,7 @@ mly_cam_rescan_btl(struct mly_softc *sc, mly_printf(sc, "rescan failed (can't allocate CCB)\n"); return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->mly_cam_sim[bus]), target, 0) != CAM_REQ_CMP) { mly_printf(sc, "rescan failed (can't create path)\n"); xpt_free_ccb(ccb); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mps/mps_sas.c Sun Apr 14 09:55:48 2013 (r249468) @@ -271,7 +271,7 @@ mpssas_rescan_target(struct mps_softc *s return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mps_dprint(sc, MPS_FAULT, "unable to create path for rescan\n"); xpt_free_ccb(ccb); @@ -3318,7 +3318,7 @@ mpssas_check_eedp(struct mpssas_softc *s return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, lunid) != CAM_REQ_CMP) { mps_dprint(sc, MPS_FAULT, "Unable to create " "path for EEDP support\n"); Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mpt/mpt_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -2364,7 +2364,7 @@ mpt_cam_event(struct mpt_softc *mpt, req break; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); @@ -2512,7 +2512,7 @@ mpt_cam_event(struct mpt_softc *mpt, req "unable to alloc CCB for rescan\n"); break; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mpt/mpt_raid.c Sun Apr 14 09:55:48 2013 (r249468) @@ -705,7 +705,7 @@ mpt_raid_thread(void *arg) ccb = xpt_alloc_ccb(); MPT_LOCK(mpt); - error = xpt_create_path(&ccb->ccb_h.path, xpt_periph, + error = xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(mpt->phydisk_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (error != CAM_REQ_CMP) { @@ -1662,7 +1662,7 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - error = xpt_create_path(&path, xpt_periph, + error = xpt_create_path(&path, NULL, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); Modified: head/sys/dev/twa/tw_osl_cam.c ============================================================================== --- head/sys/dev/twa/tw_osl_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/twa/tw_osl_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -488,7 +488,7 @@ tw_osli_request_bus_scan(struct twa_soft if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); mtx_lock(sc->sim_lock); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); mtx_unlock(sc->sim_lock); Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/tws/tws_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -219,7 +219,7 @@ tws_bus_scan(struct tws_softc *sc) return(ENXIO); ccb = xpt_alloc_ccb(); mtx_lock(&sc->sim_lock); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mtx_unlock(&sc->sim_lock); xpt_free_ccb(ccb); Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1702,7 +1702,7 @@ vtscsi_execute_rescan(struct vtscsi_soft return; } - status = xpt_create_path(&ccb->ccb_h.path, xpt_periph, + status = xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->vtscsi_sim), target_id, lun_id); if (status != CAM_REQ_CMP) { xpt_free_ccb(ccb); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 10:14:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F07C280; Sun, 14 Apr 2013 10:14:27 +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 620DA965; Sun, 14 Apr 2013 10:14:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EAERDv032102; Sun, 14 Apr 2013 10:14:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EAERjD032100; Sun, 14 Apr 2013 10:14:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304141014.r3EAERjD032100@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 10:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249470 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 10:14:27 -0000 Author: mav Date: Sun Apr 14 10:14:26 2013 New Revision: 249470 URL: http://svnweb.freebsd.org/changeset/base/249470 Log: Remove owner field from struct cam_ed, unused at least since FreeBSD 7. Modified: head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 14 09:59:41 2013 (r249469) +++ head/sys/cam/cam_xpt.c Sun Apr 14 10:14:26 2013 (r249470) @@ -4428,7 +4428,6 @@ xpt_alloc_device(struct cam_eb *bus, str SLIST_INIT(&device->asyncs); SLIST_INIT(&device->periphs); device->generation = 0; - device->owner = NULL; device->flags = CAM_DEV_UNCONFIGURED; device->tag_delay_count = 0; device->tag_saved_openings = 0; Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Sun Apr 14 09:59:41 2013 (r249469) +++ head/sys/cam/cam_xpt_internal.h Sun Apr 14 10:14:26 2013 (r249470) @@ -83,7 +83,6 @@ struct cam_ed { struct async_list asyncs; /* Async callback info for this B/T/L */ struct periph_list periphs; /* All attached devices */ u_int generation; /* Generation number */ - struct cam_periph *owner; /* Peripheral driver's ownership tag */ void *quirk; /* Oddities about this device */ u_int maxtags; u_int mintags; From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 11:44:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 541E9CD6; Sun, 14 Apr 2013 11:44:48 +0000 (UTC) (envelope-from jilles@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 45240BE4; Sun, 14 Apr 2013 11:44:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EBimDW058907; Sun, 14 Apr 2013 11:44:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EBimN4058906; Sun, 14 Apr 2013 11:44:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304141144.r3EBimN4058906@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 14 Apr 2013 11:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249471 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 11:44:48 -0000 Author: jilles Date: Sun Apr 14 11:44:47 2013 New Revision: 249471 URL: http://svnweb.freebsd.org/changeset/base/249471 Log: libc: Fix typo in French translation. PR: kern/177704 Submitted by: martymac MFC after: 1 week Modified: head/lib/libc/nls/fr_FR.ISO8859-1.msg Modified: head/lib/libc/nls/fr_FR.ISO8859-1.msg ============================================================================== --- head/lib/libc/nls/fr_FR.ISO8859-1.msg Sun Apr 14 10:14:26 2013 (r249470) +++ head/lib/libc/nls/fr_FR.ISO8859-1.msg Sun Apr 14 11:44:47 2013 (r249471) @@ -94,7 +94,7 @@ $ EPROTONOSUPPORT $ ESOCKTNOSUPPORT 44 Type de socket non supporté $ EOPNOTSUPP -45 Opération non supporté +45 Opération non supportée $ EPFNOSUPPORT 46 Famille de protocole non supportée $ EAFNOSUPPORT From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 11:51:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E09CFCB; Sun, 14 Apr 2013 11:51:25 +0000 (UTC) (envelope-from des@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 905C8C32; Sun, 14 Apr 2013 11:51:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EBpPjo061425; Sun, 14 Apr 2013 11:51:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EBpPAu061424; Sun, 14 Apr 2013 11:51:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141151.r3EBpPAu061424@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 11:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249472 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 11:51:25 -0000 Author: des Date: Sun Apr 14 11:51:25 2013 New Revision: 249472 URL: http://svnweb.freebsd.org/changeset/base/249472 Log: MFH (r247285): always bootstrap liby along with yacc. Modified: stable/8/Makefile.inc1 (contents, props changed) Directory Properties: stable/8/ (props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Sun Apr 14 11:44:47 2013 (r249471) +++ stable/8/Makefile.inc1 Sun Apr 14 11:51:25 2013 (r249472) @@ -953,7 +953,8 @@ _lex= usr.bin/lex .endif .if ${BOOTSTRAPPING} >= 1000013 -_yacc= usr.bin/yacc +_yacc= lib/liby \ + usr.bin/yacc .endif .if ${BOOTSTRAPPING} < 800013 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 12:20:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 56AB0728; Sun, 14 Apr 2013 12:20:14 +0000 (UTC) (envelope-from antoine@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 48253DB2; Sun, 14 Apr 2013 12:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ECKDMR069034; Sun, 14 Apr 2013 12:20:13 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ECKDW5069033; Sun, 14 Apr 2013 12:20:13 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201304141220.r3ECKDW5069033@svn.freebsd.org> From: Antoine Brodin Date: Sun, 14 Apr 2013 12:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249473 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 12:20:14 -0000 Author: antoine Date: Sun Apr 14 12:20:13 2013 New Revision: 249473 URL: http://svnweb.freebsd.org/changeset/base/249473 Log: Add one more obsolete file. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Apr 14 11:51:25 2013 (r249472) +++ head/ObsoleteFiles.inc Sun Apr 14 12:20:13 2013 (r249473) @@ -70,6 +70,7 @@ OLD_FILES+=usr/include/clang/3.2/xmmintr OLD_FILES+=usr/include/clang/3.2/xopintrin.h OLD_DIRS+=usr/include/clang/3.2 # 20130404: legacy ATA stack removed +OLD_FILES+=rescue/atacontrol OLD_FILES+=sbin/atacontrol OLD_FILES+=usr/share/man/man8/atacontrol.8.gz OLD_FILES+=usr/share/man/man4/atapicam.4.gz From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 12:55:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46857B7E; Sun, 14 Apr 2013 12:55:40 +0000 (UTC) (envelope-from des@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 37371E80; Sun, 14 Apr 2013 12:55:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ECtd2j080105; Sun, 14 Apr 2013 12:55:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ECtdgg080104; Sun, 14 Apr 2013 12:55:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141255.r3ECtdgg080104@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 12:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249474 - vendor-crypto/openssh/dist X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 12:55:40 -0000 Author: des Date: Sun Apr 14 12:55:39 2013 New Revision: 249474 URL: http://svnweb.freebsd.org/changeset/base/249474 Log: Apply a patch from OpenSSH bugzilla #2057 to silence "received disconnect" errors in the common case (i.e. client intentionally disconnected). Modified: vendor-crypto/openssh/dist/packet.c Modified: vendor-crypto/openssh/dist/packet.c ============================================================================== --- vendor-crypto/openssh/dist/packet.c Sun Apr 14 12:20:13 2013 (r249473) +++ vendor-crypto/openssh/dist/packet.c Sun Apr 14 12:55:39 2013 (r249474) @@ -1460,7 +1460,11 @@ packet_read_poll_seqnr(u_int32_t *seqnr_ case SSH2_MSG_DISCONNECT: reason = packet_get_int(); msg = packet_get_string(NULL); - error("Received disconnect from %s: %u: %.400s", + /* Ignore normal client exit notifications */ + do_log2(active_state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s: %u: %.400s", get_remote_ipaddr(), reason, msg); xfree(msg); cleanup_exit(255); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 13:06:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 19991E8B; Sun, 14 Apr 2013 13:06:08 +0000 (UTC) (envelope-from des@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 0AF02ECB; Sun, 14 Apr 2013 13:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ED67YX083539; Sun, 14 Apr 2013 13:06:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ED67Tn083538; Sun, 14 Apr 2013 13:06:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141306.r3ED67Tn083538@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 13:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249475 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 13:06:08 -0000 Author: des Date: Sun Apr 14 13:06:07 2013 New Revision: 249475 URL: http://svnweb.freebsd.org/changeset/base/249475 Log: Silence "received disconnect" in the common case. Modified: head/crypto/openssh/packet.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Sun Apr 14 12:55:39 2013 (r249474) +++ head/crypto/openssh/packet.c Sun Apr 14 13:06:07 2013 (r249475) @@ -1465,7 +1465,11 @@ packet_read_poll_seqnr(u_int32_t *seqnr_ case SSH2_MSG_DISCONNECT: reason = packet_get_int(); msg = packet_get_string(NULL); - error("Received disconnect from %s: %u: %.400s", + /* Ignore normal client exit notifications */ + do_log2(active_state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s: %u: %.400s", get_remote_ipaddr(), reason, msg); xfree(msg); cleanup_exit(255); @@ -1490,7 +1494,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr_ break; case SSH_MSG_DISCONNECT: msg = packet_get_string(NULL); - error("Received disconnect from %s: %.400s", + logit("Received disconnect from %s: %.400s", get_remote_ipaddr(), msg); cleanup_exit(255); break; From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 14:02:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C4E6869; Sun, 14 Apr 2013 14:02:35 +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 3475B95; Sun, 14 Apr 2013 14:02:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EE2Zl0001361; Sun, 14 Apr 2013 14:02:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EE2YIi001357; Sun, 14 Apr 2013 14:02:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304141402.r3EE2YIi001357@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Apr 2013 14:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249476 - in head/sys/dev: ata pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 14:02:35 -0000 Author: kib Date: Sun Apr 14 14:02:34 2013 New Revision: 249476 URL: http://svnweb.freebsd.org/changeset/base/249476 Log: Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI device which makes the request for dma tag, instead of some descendant of the PCI device, by creating a pass-through trampoline for vga_pci and ata_pci buses. Sponsored by: The FreeBSD Foundation Suggested by: jhb Discussed with: jhb, mav MFC after: 1 week Modified: head/sys/dev/ata/ata-pci.c head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sun Apr 14 13:06:07 2013 (r249475) +++ head/sys/dev/ata/ata-pci.c Sun Apr 14 14:02:34 2013 (r249476) @@ -571,6 +571,13 @@ ata_pci_child_location_str(device_t dev, return (0); } +static bus_dma_tag_t +ata_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t ata_pci_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_pci_probe), @@ -593,6 +600,7 @@ static device_method_t ata_pci_methods[] DEVMETHOD(pci_write_config, ata_pci_write_config), DEVMETHOD(bus_print_child, ata_pci_print_child), DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), + DEVMETHOD(bus_get_dma_tag, ata_pci_get_dma_tag), DEVMETHOD_END }; Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sun Apr 14 13:06:07 2013 (r249475) +++ head/sys/dev/pci/vga_pci.c Sun Apr 14 14:02:34 2013 (r249476) @@ -419,6 +419,13 @@ vga_pci_msix_count(device_t dev, device_ return (pci_msix_count(dev)); } +static bus_dma_tag_t +vga_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t vga_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vga_pci_probe), @@ -436,6 +443,7 @@ static device_method_t vga_pci_methods[] DEVMETHOD(bus_release_resource, vga_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_get_dma_tag, vga_pci_get_dma_tag), /* PCI interface */ DEVMETHOD(pci_read_config, vga_pci_read_config), From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 15:05:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE3631FB; Sun, 14 Apr 2013 15:05:14 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 4A39623D; Sun, 14 Apr 2013 15:05:13 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.6/8.14.6/ALCHEMY.FRANKEN.DE) with ESMTP id r3EF57XW068065; Sun, 14 Apr 2013 17:05:07 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.6/8.14.6/Submit) id r3EF57NM068064; Sun, 14 Apr 2013 17:05:07 +0200 (CEST) (envelope-from marius) Date: Sun, 14 Apr 2013 17:05:07 +0200 From: Marius Strobl To: Konstantin Belousov Subject: Re: svn commit: r249476 - in head/sys/dev: ata pci Message-ID: <20130414150507.GA62578@alchemy.franken.de> References: <201304141402.r3EE2YIi001357@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304141402.r3EE2YIi001357@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 15:05:14 -0000 On Sun, Apr 14, 2013 at 02:02:34PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sun Apr 14 14:02:34 2013 > New Revision: 249476 > URL: http://svnweb.freebsd.org/changeset/base/249476 > > Log: > Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI > device which makes the request for dma tag, instead of some descendant > of the PCI device, by creating a pass-through trampoline for vga_pci > and ata_pci buses. If you need to know the last PCI device requesting the DMA tag, wouldn't it make more sense to let the consumer of this walk up the tree as necessary instead of hacking N drivers? I.e.: foo_get_dma_tag(device_t bus, device_t child) { device_t device, parent; devclass_t pci_devclass; pci_devclass = devclass_find("pci"); for (device = child; child != bus; device = parent) { parent = device_get_parent(device); if (device_get_devclass(parent) != pci_devclass) continue; break; } /* use device */ } I suspect the problem you are hitting is also true for ISA devices behind a PCI-ISA-bridge, PCI device drivers attaching non-PCI sub- devices requesting DMA tags like sk(4) etc. Marius From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 16:20:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53761895; Sun, 14 Apr 2013 16:20:26 +0000 (UTC) (envelope-from jmg@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 45076788; Sun, 14 Apr 2013 16:20:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EGKPqa042289; Sun, 14 Apr 2013 16:20:25 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EGKPHn042288; Sun, 14 Apr 2013 16:20:25 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201304141620.r3EGKPHn042288@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 14 Apr 2013 16:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249477 - head/sbin/geom/class/nop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 16:20:26 -0000 Author: jmg Date: Sun Apr 14 16:20:25 2013 New Revision: 249477 URL: http://svnweb.freebsd.org/changeset/base/249477 Log: update information about debugging sysctl... MFC after: 1 week Modified: head/sbin/geom/class/nop/gnop.8 Modified: head/sbin/geom/class/nop/gnop.8 ============================================================================== --- head/sbin/geom/class/nop/gnop.8 Sun Apr 14 14:02:34 2013 (r249476) +++ head/sbin/geom/class/nop/gnop.8 Sun Apr 14 16:20:25 2013 (r249477) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2009 +.Dd April 14, 2013 .Dt GNOP 8 .Os .Sh NAME @@ -139,8 +139,11 @@ Debug level of the .Nm NOP GEOM class. This can be set to a number between 0 and 2 inclusive. -If set to 0 minimal debug information is printed, and if set to 2 the -maximum amount of debug information is printed. +If set to 0, minimal debug information is printed. +If set to 1, basic debug information is logged along with the I/O requests +that were returned as errors. +If set to 2, the maximum amount of debug information is printed including +all I/O requests. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 16:25:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6DEE3B59; Sun, 14 Apr 2013 16:25:38 +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 5FC417C4; Sun, 14 Apr 2013 16:25:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EGPcG8044459; Sun, 14 Apr 2013 16:25:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EGPcxK044455; Sun, 14 Apr 2013 16:25:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304141625.r3EGPcxK044455@svn.freebsd.org> From: Robert Watson Date: Sun, 14 Apr 2013 16:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249478 - in stable/8/sys: netinet netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 16:25:38 -0000 Author: rwatson Date: Sun Apr 14 16:25:37 2013 New Revision: 249478 URL: http://svnweb.freebsd.org/changeset/base/249478 Log: FreeBSD 8.0 introduced inpcb reference counting, and FreeBSD 8.1 began using that reference count to protect inpcb stability in udp_pcblist() and other monitoring functions, preventing the inpcb from being garbage collected across potentially sleeping copyout() operations despite the inpcb zone becoming shrinkable. However, this introduced a race condition in which inp->inp_socket() might become NULL as a result of the socket being freed, but before the inpcb we removed from the global list of connections, allowing it to be exposed to a third thread invoking udp_input() or udp6_input() which would try to indirect through inp_socket without testing it for NULL. This might occur with particular regularity on systems that frequently run netstat, or which use SNMP for connection monitoring. Later FreeBSD releases use a different reference/destruction model, but stable/8 remained affected in FreeBSD 8.2 and 8.3; the problem could be spotted on very high-load UDP services, such as top-level name servers. An Errata Note for 8.x branches under continuing support might be appropriate. Regardless, this fix should be merged to releng/8.4 prior to 8.4-RELEASE. PR: 172963 Submitted by: Vincent Miller Submitted by: Julien Charbon Submitted by: Marc De La Gueronniere Modified: stable/8/sys/netinet/udp_usrreq.c stable/8/sys/netinet6/udp6_usrreq.c Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Sun Apr 14 16:20:25 2013 (r249477) +++ stable/8/sys/netinet/udp_usrreq.c Sun Apr 14 16:25:37 2013 (r249478) @@ -495,6 +495,15 @@ udp_input(struct mbuf *m, int off) INP_RLOCK(inp); /* + * Detached PCBs can linger in the list if someone + * holds a reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + continue; + } + + /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] */ @@ -620,6 +629,15 @@ udp_input(struct mbuf *m, int off) */ INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); + + /* + * Detached PCBs can linger in the hash table if someone holds a + * reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + goto badunlocked; + } if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) { INP_RUNLOCK(inp); goto badunlocked; Modified: stable/8/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/udp6_usrreq.c Sun Apr 14 16:20:25 2013 (r249477) +++ stable/8/sys/netinet6/udp6_usrreq.c Sun Apr 14 16:25:37 2013 (r249478) @@ -273,6 +273,13 @@ udp6_input(struct mbuf **mp, int *offp, } /* + * Detached PCBs can linger in the list if someone + * holds a reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) + continue; + + /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] */ @@ -396,6 +403,15 @@ udp6_input(struct mbuf **mp, int *offp, } INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); + + /* + * Detached PCBs can linger in the hash table if someone holds a + * reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + goto badunlocked; + } up = intoudpcb(inp); if (up->u_tun_func == NULL) { udp6_append(inp, m, off, &fromsa); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 16:49:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3AE1E3FA; Sun, 14 Apr 2013 16:49:28 +0000 (UTC) (envelope-from des@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 2D73E8EA; Sun, 14 Apr 2013 16:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EGnS4G050808; Sun, 14 Apr 2013 16:49:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EGnR24050805; Sun, 14 Apr 2013 16:49:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141649.r3EGnR24050805@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 16:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249479 - in head: contrib/openpam/lib lib/libpam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 16:49:28 -0000 Author: des Date: Sun Apr 14 16:49:27 2013 New Revision: 249479 URL: http://svnweb.freebsd.org/changeset/base/249479 Log: Backport upstream r684 (OPENPAM_DEBUG enables debugging macros but does not turn debugging on by default) and add OPENPAM_DEBUG to CFLAGS. Modified: head/contrib/openpam/lib/openpam_log.c head/lib/libpam/Makefile.inc Modified: head/contrib/openpam/lib/openpam_log.c ============================================================================== --- head/contrib/openpam/lib/openpam_log.c Sun Apr 14 16:25:37 2013 (r249478) +++ head/contrib/openpam/lib/openpam_log.c Sun Apr 14 16:49:27 2013 (r249479) @@ -49,11 +49,7 @@ #include "openpam_impl.h" -#ifdef OPENPAM_DEBUG -int openpam_debug = 1; -#else int openpam_debug = 0; -#endif #if !defined(openpam_log) Modified: head/lib/libpam/Makefile.inc ============================================================================== --- head/lib/libpam/Makefile.inc Sun Apr 14 16:25:37 2013 (r249478) +++ head/lib/libpam/Makefile.inc Sun Apr 14 16:49:27 2013 (r249479) @@ -24,9 +24,7 @@ # # $FreeBSD$ -.ifdef PAM_DEBUG -DEBUG_FLAGS+= -DDEBUG -.endif +CFLAGS+= -DOPENPAM_DEBUG SHLIB_MAJOR= 5 PAM_MOD_DIR= ${LIBDIR} From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 17:08:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 802C2973; Sun, 14 Apr 2013 17:08:35 +0000 (UTC) (envelope-from mjg@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 72FD0982; Sun, 14 Apr 2013 17:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EH8Zp4057051; Sun, 14 Apr 2013 17:08:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EH8Y4A057048; Sun, 14 Apr 2013 17:08:34 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201304141708.r3EH8Y4A057048@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 14 Apr 2013 17:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249480 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 17:08:35 -0000 Author: mjg Date: Sun Apr 14 17:08:34 2013 New Revision: 249480 URL: http://svnweb.freebsd.org/changeset/base/249480 Log: Add fdallocn function and use it when passing fds over unix socket. This gets rid of "unp_externalize fdalloc failed" panic. Reviewed by: pjd MFC after: 1 week Modified: head/sys/kern/kern_descrip.c head/sys/kern/uipc_usrreq.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Apr 14 16:49:27 2013 (r249479) +++ head/sys/kern/kern_descrip.c Sun Apr 14 17:08:34 2013 (r249480) @@ -1582,6 +1582,34 @@ fdalloc(struct thread *td, int minfd, in } /* + * Allocate n file descriptors for the process. + */ +int +fdallocn(struct thread *td, int minfd, int *fds, int n) +{ + struct proc *p = td->td_proc; + struct filedesc *fdp = p->p_fd; + int i; + + FILEDESC_XLOCK_ASSERT(fdp); + + if (!fdavail(td, n)) + return (EMFILE); + + for (i = 0; i < n; i++) + if (fdalloc(td, 0, &fds[i]) != 0) + break; + + if (i < n) { + for (i--; i >= 0; i--) + fdunused(fdp, fds[i]); + return (EMFILE); + } + + return (0); +} + +/* * Check to see whether n user file descriptors are available to the process * p. */ Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Apr 14 16:49:27 2013 (r249479) +++ head/sys/kern/uipc_usrreq.c Sun Apr 14 17:08:34 2013 (r249480) @@ -1706,7 +1706,6 @@ unp_externalize(struct mbuf *control, st void *data; socklen_t clen = control->m_len, datalen; int error, newfds; - int f; u_int newlen; UNP_LINK_UNLOCK_ASSERT(); @@ -1732,13 +1731,6 @@ unp_externalize(struct mbuf *control, st goto next; } FILEDESC_XLOCK(fdesc); - /* if the new FD's will not fit free them. */ - if (!fdavail(td, newfds)) { - FILEDESC_XUNLOCK(fdesc); - error = EMSGSIZE; - unp_freerights(fdep, newfds); - goto next; - } /* * Now change each pointer to an fd in the global @@ -1758,17 +1750,22 @@ unp_externalize(struct mbuf *control, st fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + if (fdallocn(td, 0, fdp, newfds) != 0) { + FILEDESC_XUNLOCK(td->td_proc->p_fd); + error = EMSGSIZE; + unp_freerights(fdep, newfds); + m_freem(*controlp); + *controlp = NULL; + goto next; + } for (i = 0; i < newfds; i++, fdp++) { - if (fdalloc(td, 0, &f)) - panic("unp_externalize fdalloc failed"); - fde = &fdesc->fd_ofiles[f]; + fde = &fdesc->fd_ofiles[*fdp]; fde->fde_file = fdep[0]->fde_file; filecaps_move(&fdep[0]->fde_caps, &fde->fde_caps); if ((flags & MSG_CMSG_CLOEXEC) != 0) fde->fde_flags |= UF_EXCLOSE; unp_externalize_fp(fde->fde_file); - *fdp = f; } FILEDESC_XUNLOCK(fdesc); free(fdep[0], M_FILECAPS); Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sun Apr 14 16:49:27 2013 (r249479) +++ head/sys/sys/filedesc.h Sun Apr 14 17:08:34 2013 (r249480) @@ -150,6 +150,7 @@ int falloc_noinstall(struct thread *td, int finstall(struct thread *td, struct file *fp, int *resultfp, int flags, struct filecaps *fcaps); int fdalloc(struct thread *td, int minfd, int *result); +int fdallocn(struct thread *td, int minfd, int *fds, int n); int fdavail(struct thread *td, int n); int fdcheckstd(struct thread *td); void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 18:09:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49D03496; Sun, 14 Apr 2013 18:09:09 +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 3CD05B35; Sun, 14 Apr 2013 18:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EI98Lw075404; Sun, 14 Apr 2013 18:09:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EI986E075403; Sun, 14 Apr 2013 18:09:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304141809.r3EI986E075403@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 18:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249481 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 18:09:09 -0000 Author: mav Date: Sun Apr 14 18:09:08 2013 New Revision: 249481 URL: http://svnweb.freebsd.org/changeset/base/249481 Log: Remove some more pieces of multilevel freeze mechanism, missed in r249466. Modified: head/sys/cam/cam_queue.h Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Sun Apr 14 17:08:34 2013 (r249480) +++ head/sys/cam/cam_queue.h Sun Apr 14 18:09:08 2013 (r249481) @@ -155,10 +155,10 @@ cam_ccbq_pending_ccb_count(struct cam_cc static __inline void cam_ccbq_take_opening(struct cam_ccbq *ccbq); -static __inline int +static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb); -static __inline int +static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb); static __inline union ccb * @@ -187,29 +187,17 @@ cam_ccbq_take_opening(struct cam_ccbq *c ccbq->held++; } -static __inline int +static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb) { ccbq->held--; camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); - if (ccbq->queue.qfrozen_cnt > 0) { - ccbq->devq_openings++; - ccbq->held++; - return (1); - } else - return (0); } -static __inline int +static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb) { camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index); - if (ccbq->queue.qfrozen_cnt > 0) { - ccbq->devq_openings--; - ccbq->held--; - return (1); - } else - return (0); } static __inline union ccb * From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 19:13:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0AD34E0; Sun, 14 Apr 2013 19:13:52 +0000 (UTC) (envelope-from kientzle@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 B1C91E41; Sun, 14 Apr 2013 19:13:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EJDqIY095966; Sun, 14 Apr 2013 19:13:52 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EJDqPI095965; Sun, 14 Apr 2013 19:13:52 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201304141913.r3EJDqPI095965@svn.freebsd.org> From: Tim Kientzle Date: Sun, 14 Apr 2013 19:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249484 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 19:13:52 -0000 Author: kientzle Date: Sun Apr 14 19:13:51 2013 New Revision: 249484 URL: http://svnweb.freebsd.org/changeset/base/249484 Log: Install a symlink /usr/lib/include ==> /usr/include This fixes -print-file-name=include in clang (and is arguably a better way to fix the same issue in GCC than the change I made in r231336). MFC after: 1 week Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r249483) +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r249484) @@ -252,4 +252,7 @@ _libusbhid= libusbhid _libusb= libusb .endif +afterinstall: + ln -fs ../include ${DESTDIR}/usr/lib/include + .include From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 19:21:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 399DE747; Sun, 14 Apr 2013 19:21:44 +0000 (UTC) (envelope-from imp@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 1BDF3E7C; Sun, 14 Apr 2013 19:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EJLhot098643; Sun, 14 Apr 2013 19:21:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EJLhRD098642; Sun, 14 Apr 2013 19:21:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304141921.r3EJLhRD098642@svn.freebsd.org> From: Warner Losh Date: Sun, 14 Apr 2013 19:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249485 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 19:21:44 -0000 Author: imp Date: Sun Apr 14 19:21:43 2013 New Revision: 249485 URL: http://svnweb.freebsd.org/changeset/base/249485 Log: Print MB and GB instead of MiB and GiB mislabeled as MB and GB. SD cards are sold in GB not GiB, this will result in less confusion. Also, cache parent device pointer to save a few cycles for loops. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Sun Apr 14 19:13:51 2013 (r249484) +++ head/sys/dev/mmc/mmcsd.c Sun Apr 14 19:21:43 2013 (r249485) @@ -163,19 +163,20 @@ mmcsd_attach(device_t dev) d->d_unit = device_get_unit(dev); d->d_flags = DISKFLAG_CANDELETE; /* - * Display in most natural units. There's no cards < 1MB. - * The SD standard goes to 2GiB, but the data format supports - * up to 4GiB and some card makers push it up to this limit. - * The SDHC standard only goes to 32GiB (the data format in - * SDHC is good to 2TiB however, which isn't too ugly at - * 2048GiBm, so we note it in passing here and don't add the - * code to print TiB). + * Display in most natural units. There's no cards < 1MB. The SD + * standard goes to 2GiB due to its reliance on FAT, but the data + * format supports up to 4GiB and some card makers push it up to this + * limit. The SDHC standard only goes to 32GiB due to FAT32, but the + * data format supports up to 2TiB however. 2048GB isn't too ugly, so + * we note it in passing here and don't add the code to print + * TB). Since these cards are sold in terms of MB and GB not MiB and + * GiB, report them like that. */ - mb = d->d_mediasize >> 20; /* 1MiB == 1 << 20 */ + mb = d->d_mediasize / 1000000; unit = 'M'; - if (mb >= 10240) { /* 1GiB = 1024 MiB */ + if (mb >= 1000) { unit = 'G'; - mb /= 1024; + mb /= 1000; } /* * Report the clock speed of the underlying hardware, which might be @@ -312,6 +313,7 @@ mmcsd_rw(struct mmcsd_softc *sc, struct struct mmc_data data; device_t dev = sc->dev; int sz = sc->disk->d_sectorsize; + device_t mmcbr = device_get_parent(dev); block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); @@ -355,8 +357,7 @@ mmcsd_rw(struct mmcsd_softc *sc, struct stop.mrq = &req; req.stop = &stop; } - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "Error indicated: %d %s\n", req.cmd->error, mmcsd_errmsg(req.cmd->error)); @@ -376,6 +377,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str device_t dev = sc->dev; int sz = sc->disk->d_sectorsize; int erase_sector; + device_t mmcbr = device_get_parent(dev); block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); @@ -410,8 +412,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str if (!mmc_get_high_cap(dev)) cmd.arg <<= 9; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { printf("erase err1: %d\n", req.cmd->error); return (block); @@ -429,8 +430,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str cmd.arg <<= 9; cmd.arg--; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { printf("erase err2: %d\n", req.cmd->error); return (block); @@ -442,8 +442,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str cmd.opcode = MMC_ERASE; cmd.arg = 0; cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { printf("erase err3 %d\n", req.cmd->error); return (block); @@ -468,6 +467,7 @@ mmcsd_dump(void *arg, void *virtual, vm_ device_t dev = sc->dev; struct bio bp; daddr_t block, end; + device_t mmcbr = device_get_parent(dev); /* length zero is special and really means flush buffers to media */ if (!length) @@ -480,9 +480,9 @@ mmcsd_dump(void *arg, void *virtual, vm_ bp.bio_data = virtual; bp.bio_cmd = BIO_WRITE; end = bp.bio_pblkno + bp.bio_bcount / sc->disk->d_sectorsize; - MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev); + MMCBUS_ACQUIRE_BUS(mmcbr, dev); block = mmcsd_rw(sc, &bp); - MMCBUS_RELEASE_BUS(device_get_parent(dev), dev); + MMCBUS_RELEASE_BUS(mmcbr, dev); return ((end < block) ? EIO : 0); } @@ -493,9 +493,9 @@ mmcsd_task(void *arg) struct bio *bp; int sz; daddr_t block, end; - device_t dev; + device_t dev = sc->dev; + device_t mmcbr = device_get_parent(sc->dev); - dev = sc->dev; while (1) { MMCSD_LOCK(sc); do { @@ -513,7 +513,7 @@ mmcsd_task(void *arg) biodone(bp); continue; } - MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev); + MMCBUS_ACQUIRE_BUS(mmcbr, dev); sz = sc->disk->d_sectorsize; block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); @@ -525,7 +525,7 @@ mmcsd_task(void *arg) } else if (bp->bio_cmd == BIO_DELETE) { block = mmcsd_delete(sc, bp); } - MMCBUS_RELEASE_BUS(device_get_parent(dev), dev); + MMCBUS_RELEASE_BUS(mmcbr, dev); if (block < end) { bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 19:59:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB026DFF; Sun, 14 Apr 2013 19:59:38 +0000 (UTC) (envelope-from trociny@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 CCA73F9A; Sun, 14 Apr 2013 19:59:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EJxcrZ008563; Sun, 14 Apr 2013 19:59:38 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EJxcZ3008562; Sun, 14 Apr 2013 19:59:38 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304141959.r3EJxcZ3008562@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 14 Apr 2013 19:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249486 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 19:59:38 -0000 Author: trociny Date: Sun Apr 14 19:59:38 2013 New Revision: 249486 URL: http://svnweb.freebsd.org/changeset/base/249486 Log: Re-factor coredump routines. For each type of notes an output function is provided, which is used either to calculate the note size or output it to sbuf. On the first pass the notes are registered in a list and the resulting size is found, on the second pass the list is traversed outputing notes to sbuf. For the sbuf a drain routine is provided that writes data to a core file. The main goal of the change is to make coredump to write notes directly to the core file, without preliminary preparing them all in a memory buffer. Storing notes in memory is not a problem for the current, rather small, set of notes we write to the core, but it may becomes an issue when we start to store procstat notes. Reviewed by: jhb (initial version), kib Discussed with: jhb, kib MFC after: 3 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Apr 14 19:21:43 2013 (r249485) +++ head/sys/kern/imgact_elf.c Sun Apr 14 19:59:38 2013 (r249486) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,8 +105,8 @@ SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(el #ifdef COMPRESS_USER_CORES static int compress_core(gzFile, char *, char *, unsigned int, struct thread * td); -#define CORE_BUF_SIZE (16 * 1024) #endif +#define CORE_BUF_SIZE (16 * 1024) int __elfN(fallback_brand) = -1; SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, @@ -1038,14 +1039,35 @@ struct sseg_closure { size_t size; /* Total size of all writable segments. */ }; +typedef void (*outfunc_t)(void *, struct sbuf *, size_t *); + +struct note_info { + int type; /* Note type. */ + outfunc_t outfunc; /* Output function. */ + void *outarg; /* Argument for the output function. */ + size_t outsize; /* Output size. */ + TAILQ_ENTRY(note_info) link; /* Link to the next note info. */ +}; + +TAILQ_HEAD(note_info_list, note_info); + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(struct thread *, segment_callback, void *); static int __elfN(corehdr)(struct thread *, struct vnode *, struct ucred *, - int, void *, size_t, gzFile); -static void __elfN(puthdr)(struct thread *, void *, size_t *, int); -static void __elfN(putnote)(void *, size_t *, const char *, int, - const void *, size_t); + int, void *, size_t, struct note_info_list *, size_t, gzFile); +static void __elfN(prepare_notes)(struct thread *, struct note_info_list *, + size_t *); +static void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t); +static void __elfN(putnote)(struct note_info *, struct sbuf *); +static size_t register_note(struct note_info_list *, int, outfunc_t, void *); +static int sbuf_drain_core_output(void *, const char *, int); + +static void __elfN(note_fpregset)(void *, struct sbuf *, size_t *); +static void __elfN(note_prpsinfo)(void *, struct sbuf *, size_t *); +static void __elfN(note_prstatus)(void *, struct sbuf *, size_t *); +static void __elfN(note_threadmd)(void *, struct sbuf *, size_t *); +static void __elfN(note_thrmisc)(void *, struct sbuf *, size_t *); #ifdef COMPRESS_USER_CORES extern int compress_user_cores; @@ -1072,14 +1094,54 @@ core_output(struct vnode *vp, void *base return (error); } +/* Coredump output parameters for sbuf drain routine. */ +struct sbuf_drain_core_params { + off_t offset; + struct ucred *active_cred; + struct ucred *file_cred; + struct thread *td; + struct vnode *vp; +#ifdef COMPRESS_USER_CORES + gzFile gzfile; +#endif +}; + +/* + * Drain into a core file. + */ +static int +sbuf_drain_core_output(void *arg, const char *data, int len) +{ + struct sbuf_drain_core_params *p; + int error; + + p = (struct sbuf_drain_core_params *)arg; +#ifdef COMPRESS_USER_CORES + if (p->gzfile != Z_NULL) + error = compress_core(p->gzfile, NULL, __DECONST(char *, data), + len, p->td); + else +#endif + error = vn_rdwr_inchunks(UIO_WRITE, p->vp, + __DECONST(void *, data), len, p->offset, UIO_SYSSPACE, + IO_UNIT | IO_DIRECT, p->active_cred, p->file_cred, NULL, + p->td); + if (error != 0) + return (-error); + p->offset += len; + return (len); +} + int __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) { struct ucred *cred = td->td_ucred; int error = 0; struct sseg_closure seginfo; + struct note_info_list notelst; + struct note_info *ninfo; void *hdr; - size_t hdrsize; + size_t hdrsize, notesz, coresize; gzFile gzfile = Z_NULL; char *core_buf = NULL; @@ -1090,6 +1152,7 @@ __elfN(coredump)(struct thread *td, stru #endif hdr = NULL; + TAILQ_INIT(¬elst); #ifdef COMPRESS_USER_CORES if (doing_compress) { @@ -1118,30 +1181,29 @@ __elfN(coredump)(struct thread *td, stru each_writable_segment(td, cb_size_segment, &seginfo); /* - * Calculate the size of the core file header area by making - * a dry run of generating it. Nothing is written, but the - * size is calculated. + * Collect info about the core file header area. */ - hdrsize = 0; - __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count); + hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); + __elfN(prepare_notes)(td, ¬elst, ¬esz); + coresize = round_page(hdrsize + notesz) + seginfo.size; #ifdef RACCT PROC_LOCK(td->td_proc); - error = racct_add(td->td_proc, RACCT_CORE, hdrsize + seginfo.size); + error = racct_add(td->td_proc, RACCT_CORE, coresize); PROC_UNLOCK(td->td_proc); if (error != 0) { error = EFAULT; goto done; } #endif - if (hdrsize + seginfo.size >= limit) { + if (coresize >= limit) { error = EFAULT; goto done; } /* * Allocate memory for building the header, fill it up, - * and write it out. + * and write it out following the notes. */ hdr = malloc(hdrsize, M_TEMP, M_WAITOK); if (hdr == NULL) { @@ -1149,7 +1211,7 @@ __elfN(coredump)(struct thread *td, stru goto done; } error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, - gzfile); + ¬elst, notesz, gzfile); /* Write the contents of all of the writable segments. */ if (error == 0) { @@ -1158,7 +1220,7 @@ __elfN(coredump)(struct thread *td, stru int i; php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; - offset = hdrsize; + offset = round_page(hdrsize + notesz); for (i = 0; i < seginfo.count; i++) { error = core_output(vp, (caddr_t)(uintptr_t)php->p_vaddr, php->p_filesz, offset, cred, NOCRED, curthread, core_buf, gzfile); @@ -1181,8 +1243,12 @@ done: if (gzfile) gzclose(gzfile); #endif - - free(hdr, M_TEMP); + while ((ninfo = TAILQ_FIRST(¬elst)) != NULL) { + TAILQ_REMOVE(¬elst, ninfo, link); + free(ninfo, M_TEMP); + } + if (hdr != NULL) + free(hdr, M_TEMP); return (error); } @@ -1299,44 +1365,194 @@ each_writable_segment(td, func, closure) * the page boundary. */ static int -__elfN(corehdr)(td, vp, cred, numsegs, hdr, hdrsize, gzfile) - struct thread *td; - struct vnode *vp; - struct ucred *cred; - int numsegs; - size_t hdrsize; - void *hdr; - gzFile gzfile; -{ - size_t off; +__elfN(corehdr)(struct thread *td, struct vnode *vp, struct ucred *cred, + int numsegs, void *hdr, size_t hdrsize, struct note_info_list *notelst, + size_t notesz, gzFile gzfile) +{ + struct sbuf_drain_core_params params; + struct note_info *ninfo; + struct sbuf *sb; + int error; /* Fill in the header. */ bzero(hdr, hdrsize); - off = 0; - __elfN(puthdr)(td, hdr, &off, numsegs); + __elfN(puthdr)(td, hdr, hdrsize, numsegs, notesz); - if (!gzfile) { - /* Write it to the core file. */ - return (vn_rdwr_inchunks(UIO_WRITE, vp, hdr, hdrsize, (off_t)0, - UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, - td)); - } else { + params.offset = 0; + params.active_cred = cred; + params.file_cred = NOCRED; + params.td = td; + params.vp = vp; #ifdef COMPRESS_USER_CORES - if (gzwrite(gzfile, hdr, hdrsize) != hdrsize) { - log(LOG_WARNING, - "Failed to compress core file header for process" - " %s.\n", curproc->p_comm); - return (EFAULT); - } - else { - return (0); - } -#else - panic("shouldn't be here"); + params.gzfile = gzfile; #endif + sb = sbuf_new(NULL, NULL, CORE_BUF_SIZE, SBUF_FIXEDLEN); + sbuf_set_drain(sb, sbuf_drain_core_output, ¶ms); + sbuf_start_section(sb, NULL); + sbuf_bcat(sb, hdr, hdrsize); + TAILQ_FOREACH(ninfo, notelst, link) + __elfN(putnote)(ninfo, sb); + /* Align up to a page boundary for the program segments. */ + sbuf_end_section(sb, -1, PAGE_SIZE, 0); + error = sbuf_finish(sb); + sbuf_delete(sb); + + return (error); +} + +static void +__elfN(prepare_notes)(struct thread *td, struct note_info_list *list, + size_t *sizep) +{ + struct proc *p; + struct thread *thr; + size_t size; + + p = td->td_proc; + size = 0; + + size += register_note(list, NT_PRPSINFO, __elfN(note_prpsinfo), p); + + /* + * To have the debugger select the right thread (LWP) as the initial + * thread, we dump the state of the thread passed to us in td first. + * This is the thread that causes the core dump and thus likely to + * be the right thread one wants to have selected in the debugger. + */ + thr = td; + while (thr != NULL) { + size += register_note(list, NT_PRSTATUS, + __elfN(note_prstatus), thr); + size += register_note(list, NT_FPREGSET, + __elfN(note_fpregset), thr); + size += register_note(list, NT_THRMISC, + __elfN(note_thrmisc), thr); + size += register_note(list, -1, + __elfN(note_threadmd), thr); + + thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) : + TAILQ_NEXT(thr, td_plist); + if (thr == td) + thr = TAILQ_NEXT(thr, td_plist); } + + *sizep = size; +} + +static void +__elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs, + size_t notesz) +{ + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + struct phdr_closure phc; + + ehdr = (Elf_Ehdr *)hdr; + phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)); + + ehdr->e_ident[EI_MAG0] = ELFMAG0; + ehdr->e_ident[EI_MAG1] = ELFMAG1; + ehdr->e_ident[EI_MAG2] = ELFMAG2; + ehdr->e_ident[EI_MAG3] = ELFMAG3; + ehdr->e_ident[EI_CLASS] = ELF_CLASS; + ehdr->e_ident[EI_DATA] = ELF_DATA; + ehdr->e_ident[EI_VERSION] = EV_CURRENT; + ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + ehdr->e_ident[EI_ABIVERSION] = 0; + ehdr->e_ident[EI_PAD] = 0; + ehdr->e_type = ET_CORE; +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 + ehdr->e_machine = ELF_ARCH32; +#else + ehdr->e_machine = ELF_ARCH; +#endif + ehdr->e_version = EV_CURRENT; + ehdr->e_entry = 0; + ehdr->e_phoff = sizeof(Elf_Ehdr); + ehdr->e_flags = 0; + ehdr->e_ehsize = sizeof(Elf_Ehdr); + ehdr->e_phentsize = sizeof(Elf_Phdr); + ehdr->e_phnum = numsegs + 1; + ehdr->e_shentsize = sizeof(Elf_Shdr); + ehdr->e_shnum = 0; + ehdr->e_shstrndx = SHN_UNDEF; + + /* + * Fill in the program header entries. + */ + + /* The note segement. */ + phdr->p_type = PT_NOTE; + phdr->p_offset = hdrsize; + phdr->p_vaddr = 0; + phdr->p_paddr = 0; + phdr->p_filesz = notesz; + phdr->p_memsz = 0; + phdr->p_flags = PF_R; + phdr->p_align = sizeof(Elf32_Size); + phdr++; + + /* All the writable segments from the program. */ + phc.phdr = phdr; + phc.offset = round_page(hdrsize + notesz); + each_writable_segment(td, cb_put_phdr, &phc); +} + +static size_t +register_note(struct note_info_list *list, int type, outfunc_t out, void *arg) +{ + struct note_info *ninfo; + size_t size, notesize; + + size = 0; + out(arg, NULL, &size); + ninfo = malloc(sizeof(*ninfo), M_TEMP, M_ZERO | M_WAITOK); + ninfo->type = type; + ninfo->outfunc = out; + ninfo->outarg = arg; + ninfo->outsize = size; + TAILQ_INSERT_TAIL(list, ninfo, link); + + if (type == -1) + return (size); + + notesize = sizeof(Elf_Note) + /* note header */ + roundup2(8, sizeof(Elf32_Size)) + /* note name ("FreeBSD") */ + roundup2(size, sizeof(Elf32_Size)); /* note description */ + + return (notesize); +} + +static void +__elfN(putnote)(struct note_info *ninfo, struct sbuf *sb) +{ + Elf_Note note; + ssize_t old_len; + + if (ninfo->type == -1) { + ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); + return; + } + + note.n_namesz = 8; /* strlen("FreeBSD") + 1 */ + note.n_descsz = ninfo->outsize; + note.n_type = ninfo->type; + + sbuf_bcat(sb, ¬e, sizeof(note)); + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, "FreeBSD", note.n_namesz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + if (note.n_descsz == 0) + return; + sbuf_start_section(sb, &old_len); + ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); } +/* + * Miscellaneous note out functions. + */ + #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 #include @@ -1356,50 +1572,15 @@ typedef thrmisc_t elf_thrmisc_t; #endif static void -__elfN(puthdr)(struct thread *td, void *dst, size_t *off, int numsegs) +__elfN(note_prpsinfo)(void *arg, struct sbuf *sb, size_t *sizep) { - struct { - elf_prstatus_t status; - elf_prfpregset_t fpregset; - elf_prpsinfo_t psinfo; - elf_thrmisc_t thrmisc; - } *tempdata; - elf_prstatus_t *status; - elf_prfpregset_t *fpregset; - elf_prpsinfo_t *psinfo; - elf_thrmisc_t *thrmisc; struct proc *p; - struct thread *thr; - size_t ehoff, noteoff, notesz, phoff; - - p = td->td_proc; - - ehoff = *off; - *off += sizeof(Elf_Ehdr); - - phoff = *off; - *off += (numsegs + 1) * sizeof(Elf_Phdr); - - noteoff = *off; - /* - * Don't allocate space for the notes if we're just calculating - * the size of the header. We also don't collect the data. - */ - if (dst != NULL) { - tempdata = malloc(sizeof(*tempdata), M_TEMP, M_ZERO|M_WAITOK); - status = &tempdata->status; - fpregset = &tempdata->fpregset; - psinfo = &tempdata->psinfo; - thrmisc = &tempdata->thrmisc; - } else { - tempdata = NULL; - status = NULL; - fpregset = NULL; - psinfo = NULL; - thrmisc = NULL; - } + elf_prpsinfo_t *psinfo; - if (dst != NULL) { + p = (struct proc *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*psinfo), ("invalid size")); + psinfo = malloc(sizeof(*psinfo), M_TEMP, M_ZERO | M_WAITOK); psinfo->pr_version = PRPSINFO_VERSION; psinfo->pr_psinfosz = sizeof(elf_prpsinfo_t); strlcpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname)); @@ -1409,139 +1590,100 @@ __elfN(puthdr)(struct thread *td, void * */ strlcpy(psinfo->pr_psargs, p->p_comm, sizeof(psinfo->pr_psargs)); + + sbuf_bcat(sb, psinfo, sizeof(*psinfo)); + free(psinfo, M_TEMP); } - __elfN(putnote)(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, - sizeof *psinfo); + *sizep = sizeof(*psinfo); +} - /* - * To have the debugger select the right thread (LWP) as the initial - * thread, we dump the state of the thread passed to us in td first. - * This is the thread that causes the core dump and thus likely to - * be the right thread one wants to have selected in the debugger. - */ - thr = td; - while (thr != NULL) { - if (dst != NULL) { - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(elf_prstatus_t); - status->pr_gregsetsz = sizeof(elf_gregset_t); - status->pr_fpregsetsz = sizeof(elf_fpregset_t); - status->pr_osreldate = osreldate; - status->pr_cursig = p->p_sig; - status->pr_pid = thr->td_tid; +static void +__elfN(note_prstatus)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_prstatus_t *status; + + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*status), ("invalid size")); + status = malloc(sizeof(*status), M_TEMP, M_ZERO | M_WAITOK); + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(elf_prstatus_t); + status->pr_gregsetsz = sizeof(elf_gregset_t); + status->pr_fpregsetsz = sizeof(elf_fpregset_t); + status->pr_osreldate = osreldate; + status->pr_cursig = td->td_proc->p_sig; + status->pr_pid = td->td_tid; #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 - fill_regs32(thr, &status->pr_reg); - fill_fpregs32(thr, fpregset); + fill_regs32(td, &status->pr_reg); #else - fill_regs(thr, &status->pr_reg); - fill_fpregs(thr, fpregset); + fill_regs(td, &status->pr_reg); #endif - memset(&thrmisc->_pad, 0, sizeof (thrmisc->_pad)); - strcpy(thrmisc->pr_tname, thr->td_name); - } - __elfN(putnote)(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - __elfN(putnote)(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); - __elfN(putnote)(dst, off, "FreeBSD", NT_THRMISC, thrmisc, - sizeof *thrmisc); - /* - * Allow for MD specific notes, as well as any MD - * specific preparations for writing MI notes. - */ - __elfN(dump_thread)(thr, dst, off); - - thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) : - TAILQ_NEXT(thr, td_plist); - if (thr == td) - thr = TAILQ_NEXT(thr, td_plist); + sbuf_bcat(sb, status, sizeof(*status)); + free(status, M_TEMP); } + *sizep = sizeof(*status); +} - notesz = *off - noteoff; - - if (dst != NULL) - free(tempdata, M_TEMP); - - /* Align up to a page boundary for the program segments. */ - *off = round_page(*off); - - if (dst != NULL) { - Elf_Ehdr *ehdr; - Elf_Phdr *phdr; - struct phdr_closure phc; +static void +__elfN(note_fpregset)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_prfpregset_t *fpregset; - /* - * Fill in the ELF header. - */ - ehdr = (Elf_Ehdr *)((char *)dst + ehoff); - ehdr->e_ident[EI_MAG0] = ELFMAG0; - ehdr->e_ident[EI_MAG1] = ELFMAG1; - ehdr->e_ident[EI_MAG2] = ELFMAG2; - ehdr->e_ident[EI_MAG3] = ELFMAG3; - ehdr->e_ident[EI_CLASS] = ELF_CLASS; - ehdr->e_ident[EI_DATA] = ELF_DATA; - ehdr->e_ident[EI_VERSION] = EV_CURRENT; - ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - ehdr->e_ident[EI_ABIVERSION] = 0; - ehdr->e_ident[EI_PAD] = 0; - ehdr->e_type = ET_CORE; + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*fpregset), ("invalid size")); + fpregset = malloc(sizeof(*fpregset), M_TEMP, M_ZERO | M_WAITOK); #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 - ehdr->e_machine = ELF_ARCH32; + fill_fpregs32(td, fpregset); #else - ehdr->e_machine = ELF_ARCH; + fill_fpregs(td, fpregset); #endif - ehdr->e_version = EV_CURRENT; - ehdr->e_entry = 0; - ehdr->e_phoff = phoff; - ehdr->e_flags = 0; - ehdr->e_ehsize = sizeof(Elf_Ehdr); - ehdr->e_phentsize = sizeof(Elf_Phdr); - ehdr->e_phnum = numsegs + 1; - ehdr->e_shentsize = sizeof(Elf_Shdr); - ehdr->e_shnum = 0; - ehdr->e_shstrndx = SHN_UNDEF; + sbuf_bcat(sb, fpregset, sizeof(*fpregset)); + free(fpregset, M_TEMP); + } + *sizep = sizeof(*fpregset); +} - /* - * Fill in the program header entries. - */ - phdr = (Elf_Phdr *)((char *)dst + phoff); +static void +__elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_thrmisc_t thrmisc; - /* The note segement. */ - phdr->p_type = PT_NOTE; - phdr->p_offset = noteoff; - phdr->p_vaddr = 0; - phdr->p_paddr = 0; - phdr->p_filesz = notesz; - phdr->p_memsz = 0; - phdr->p_flags = PF_R; - phdr->p_align = sizeof(Elf32_Size); - phdr++; - - /* All the writable segments from the program. */ - phc.phdr = phdr; - phc.offset = *off; - each_writable_segment(td, cb_put_phdr, &phc); + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); + bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + strcpy(thrmisc.pr_tname, td->td_name); + sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } + *sizep = sizeof(thrmisc); } +/* + * Allow for MD specific notes, as well as any MD + * specific preparations for writing MI notes. + */ static void -__elfN(putnote)(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz) +__elfN(note_threadmd)(void *arg, struct sbuf *sb, size_t *sizep) { - Elf_Note note; + struct thread *td; + void *buf; + size_t size; - note.n_namesz = strlen(name) + 1; - note.n_descsz = descsz; - note.n_type = type; - if (dst != NULL) - bcopy(¬e, (char *)dst + *off, sizeof note); - *off += sizeof note; - if (dst != NULL) - bcopy(name, (char *)dst + *off, note.n_namesz); - *off += roundup2(note.n_namesz, sizeof(Elf32_Size)); - if (dst != NULL) - bcopy(desc, (char *)dst + *off, note.n_descsz); - *off += roundup2(note.n_descsz, sizeof(Elf32_Size)); + td = (struct thread *)arg; + size = *sizep; + buf = NULL; + if (size != 0 && sb != NULL) + buf = malloc(size, M_TEMP, M_ZERO | M_WAITOK); + size = 0; + __elfN(dump_thread)(td, buf, &size); + KASSERT(*sizep == size, ("invalid size")); + if (size != 0 && sb != NULL) + sbuf_bcat(sb, buf, size); + *sizep = size; } static boolean_t @@ -1636,6 +1778,8 @@ EXEC_SET(__CONCAT(elf, __ELF_WORD_SIZE), * routine gzwrite(). This copying is necessary because the content of the VM * segment may change between the compression pass and the crc-computation pass * in gzwrite(). This is because realtime threads may preempt the UNIX kernel. + * + * If inbuf is NULL it is assumed that data is already copied to 'dest_buf'. */ static int compress_core (gzFile file, char *inbuf, char *dest_buf, unsigned int len, @@ -1646,8 +1790,13 @@ compress_core (gzFile file, char *inbuf, unsigned int chunk_len; while (len) { - chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; - copyin(inbuf, dest_buf, chunk_len); + if (inbuf != NULL) { + chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; + copyin(inbuf, dest_buf, chunk_len); + inbuf += chunk_len; + } else { + chunk_len = len; + } len_compressed = gzwrite(file, dest_buf, chunk_len); EVENTHANDLER_INVOKE(app_coredump_progress, td, len_compressed); @@ -1662,7 +1811,6 @@ compress_core (gzFile file, char *inbuf, error = EFAULT; break; } - inbuf += chunk_len; len -= chunk_len; maybe_yield(); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 20:01:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AF4F9F96; Sun, 14 Apr 2013 20:01:37 +0000 (UTC) (envelope-from trociny@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 A120AFB0; Sun, 14 Apr 2013 20:01:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EK1bdN010737; Sun, 14 Apr 2013 20:01:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EK1b0v010733; Sun, 14 Apr 2013 20:01:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304142001.r3EK1b0v010733@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 14 Apr 2013 20:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249487 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 20:01:37 -0000 Author: trociny Date: Sun Apr 14 20:01:36 2013 New Revision: 249487 URL: http://svnweb.freebsd.org/changeset/base/249487 Log: Re-factor the code to provide kern_proc_filedesc_out(), kern_proc_out(), and kern_proc_vmmap_out() functions to output process kinfo structures to sbuf, to make the code reusable. The functions are going to be used in the coredump routine to store procstat info in the core program header notes. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Apr 14 19:59:38 2013 (r249486) +++ head/sys/kern/kern_descrip.c Sun Apr 14 20:01:36 2013 (r249487) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3168,9 +3169,9 @@ CTASSERT(sizeof(struct kinfo_file) == KI #endif static int -export_fd_for_sysctl(void *data, int type, int fd, int fflags, int refcnt, +export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, int64_t offset, cap_rights_t fd_cap_rights, struct kinfo_file *kif, - struct sysctl_req *req) + struct sbuf *sb, ssize_t *remainder) { struct { int fflag; @@ -3197,6 +3198,8 @@ export_fd_for_sysctl(void *data, int typ int error; unsigned int i; + if (*remainder == 0) + return (0); bzero(kif, sizeof(*kif)); switch (type) { case KF_TYPE_FIFO: @@ -3241,32 +3244,40 @@ export_fd_for_sysctl(void *data, int typ kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif->kf_path) + 1; kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); - error = SYSCTL_OUT(req, kif, kif->kf_structsize); + if (*remainder != -1) { + if (*remainder < kif->kf_structsize) { + /* Terminate export. */ + *remainder = 0; + return (0); + } + *remainder -= kif->kf_structsize; + } + error = sbuf_bcat(sb, kif, kif->kf_structsize); return (error); } /* - * Get per-process file descriptors for use by procstat(1), et al. + * Store a process file descriptor information to sbuf. + * + * Takes a locked proc as argument, and returns with the proc unlocked. */ -static int -sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) +int +kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) { struct file *fp; struct filedesc *fdp; struct kinfo_file *kif; - struct proc *p; struct vnode *cttyvp, *textvp, *tracevp; - size_t oldidx; int64_t offset; void *data; - int error, i, *name; + ssize_t remainder; + int error, i; int type, refcnt, fflags; cap_rights_t fd_cap_rights; - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); - if (error != 0) - return (error); + PROC_LOCK_ASSERT(p, MA_OWNED); + + remainder = maxlen; /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) @@ -3286,14 +3297,15 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER PROC_UNLOCK(p); kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); if (tracevp != NULL) - export_fd_for_sysctl(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, 0, kif, req); + export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, + FREAD | FWRITE, -1, -1, 0, kif, sb, &remainder); if (textvp != NULL) - export_fd_for_sysctl(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, + FREAD, -1, -1, 0, kif, sb, &remainder); if (cttyvp != NULL) - export_fd_for_sysctl(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, 0, kif, req); + export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, + FREAD | FWRITE, -1, -1, 0, kif, sb, &remainder); + error = 0; if (fdp == NULL) goto fail; FILEDESC_SLOCK(fdp); @@ -3302,8 +3314,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_cdir); data = fdp->fd_cdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, + FREAD, -1, -1, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } /* root directory */ @@ -3311,8 +3323,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_rdir); data = fdp->fd_rdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, + FREAD, -1, -1, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } /* jail directory */ @@ -3320,8 +3332,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_jdir); data = fdp->fd_jdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, + FREAD, -1, -1, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } for (i = 0; i < fdp->fd_nfiles; i++) { @@ -3403,26 +3415,14 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER * re-validate and re-evaluate its properties when * the loop continues. */ - oldidx = req->oldidx; if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) FILEDESC_SUNLOCK(fdp); - error = export_fd_for_sysctl(data, type, i, fflags, refcnt, - offset, fd_cap_rights, kif, req); + error = export_fd_to_sb(data, type, i, fflags, refcnt, + offset, fd_cap_rights, kif, sb, &remainder); if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) FILEDESC_SLOCK(fdp); - if (error) { - if (error == ENOMEM) { - /* - * The hack to keep the ABI of sysctl - * kern.proc.filedesc intact, but not - * to account a partially copied - * kinfo_file into the oldidx. - */ - req->oldidx = oldidx; - error = 0; - } + if (error) break; - } } FILEDESC_SUNLOCK(fdp); fail: @@ -3432,6 +3432,34 @@ fail: return (error); } +#define FILEDESC_SBUF_SIZE (sizeof(struct kinfo_file) * 5) + +/* + * Get per-process file descriptors for use by procstat(1), et al. + */ +static int +sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct proc *p; + ssize_t maxlen; + int error, error2, *name; + + name = (int *)arg1; + + sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + maxlen = req->oldptr != NULL ? req->oldlen : -1; + error = kern_proc_filedesc_out(p, &sb, maxlen); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + int vntype_to_kinfo(int vtype) { Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 14 19:59:38 2013 (r249486) +++ head/sys/kern/kern_proc.c Sun Apr 14 20:01:36 2013 (r249487) @@ -1089,9 +1089,6 @@ zpfind(pid_t pid) return (p); } -#define KERN_PROC_ZOMBMASK 0x3 -#define KERN_PROC_NOTHREADS 0x4 - #ifdef COMPAT_FREEBSD32 /* @@ -1191,59 +1188,69 @@ freebsd32_kinfo_proc_out(const struct ki CP(*ki, *ki32, ki_sflag); CP(*ki, *ki32, ki_tdflags); } - -static int -sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) -{ - struct kinfo_proc32 ki32; - int error; - - if (req->flags & SCTL_MASK32) { - freebsd32_kinfo_proc_out(ki, &ki32); - error = SYSCTL_OUT(req, &ki32, sizeof(struct kinfo_proc32)); - } else - error = SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc)); - return (error); -} -#else -static int -sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) -{ - - return (SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc))); -} #endif -/* - * Must be called with the process locked and will return with it unlocked. - */ -static int -sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags) +int +kern_proc_out(struct proc *p, struct sbuf *sb, int flags) { struct thread *td; - struct kinfo_proc kinfo_proc; - int error = 0; - struct proc *np; - pid_t pid = p->p_pid; + struct kinfo_proc ki; +#ifdef COMPAT_FREEBSD32 + struct kinfo_proc32 ki32; +#endif + int error; PROC_LOCK_ASSERT(p, MA_OWNED); MPASS(FIRST_THREAD_IN_PROC(p) != NULL); - fill_kinfo_proc(p, &kinfo_proc); - if (flags & KERN_PROC_NOTHREADS) - error = sysctl_out_proc_copyout(&kinfo_proc, req); - else { + error = 0; + fill_kinfo_proc(p, &ki); + if ((flags & KERN_PROC_NOTHREADS) != 0) { +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + freebsd32_kinfo_proc_out(&ki, &ki32); + error = sbuf_bcat(sb, &ki32, sizeof(ki32)); + } else +#endif + error = sbuf_bcat(sb, &ki, sizeof(ki)); + } else { FOREACH_THREAD_IN_PROC(p, td) { - fill_kinfo_thread(td, &kinfo_proc, 1); - error = sysctl_out_proc_copyout(&kinfo_proc, req); + fill_kinfo_thread(td, &ki, 1); +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + freebsd32_kinfo_proc_out(&ki, &ki32); + error = sbuf_bcat(sb, &ki32, sizeof(ki32)); + } else +#endif + error = sbuf_bcat(sb, &ki, sizeof(ki)); if (error) break; } } PROC_UNLOCK(p); - if (error) + return (error); +} + +static int +sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags, + int doingzomb) +{ + struct sbuf sb; + struct kinfo_proc ki; + struct proc *np; + int error, error2; + pid_t pid; + + pid = p->p_pid; + sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); + error = kern_proc_out(p, &sb, flags); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + if (error != 0) return (error); - if (flags & KERN_PROC_ZOMBMASK) + else if (error2 != 0) + return (error2); + if (doingzomb) np = zpfind(pid); else { if (pid == 0) @@ -1277,6 +1284,10 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) flags = 0; oid_number &= ~KERN_PROC_INC_THREAD; } +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + flags |= KERN_PROC_MASK32; +#endif if (oid_number == KERN_PROC_PID) { if (namelen != 1) return (EINVAL); @@ -1286,7 +1297,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error != 0) return (error); - error = sysctl_out_proc(p, req, flags); + error = sysctl_out_proc(p, req, flags, 0); return (error); } @@ -1415,7 +1426,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } - error = sysctl_out_proc(p, req, flags | doingzomb); + error = sysctl_out_proc(p, req, flags, doingzomb); if (error) { sx_sunlock(&allproc_lock); return (error); @@ -2119,8 +2130,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); #endif -static int -sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) +/* + * Must be called with the process locked and will return unlocked. + */ +int +kern_proc_vmmap_out(struct proc *p, struct sbuf *sb) { vm_map_entry_t entry, tmp_entry; unsigned int last_timestamp; @@ -2128,16 +2142,15 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR struct kinfo_vmentry *kve; struct vattr va; struct ucred *cred; - int error, *name; + int error; struct vnode *vp; - struct proc *p; struct vmspace *vm; vm_map_t map; - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_WANTREAD, &p); - if (error != 0) - return (error); + PROC_LOCK_ASSERT(p, MA_OWNED); + + _PHOLD(p); + PROC_UNLOCK(p); vm = vmspace_acquire_ref(p); if (vm == NULL) { PRELE(p); @@ -2145,6 +2158,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); + error = 0; map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; @@ -2284,7 +2298,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR strlen(kve->kve_path) + 1; kve->kve_structsize = roundup(kve->kve_structsize, sizeof(uint64_t)); - error = SYSCTL_OUT(req, kve, kve->kve_structsize); + error = sbuf_bcat(sb, kve, kve->kve_structsize); vm_map_lock_read(map); if (error) break; @@ -2300,6 +2314,26 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR return (error); } +static int +sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) +{ + struct proc *p; + struct sbuf sb; + int error, error2, *name; + + name = (int *)arg1; + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_vmentry), req); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + error = kern_proc_vmmap_out(p, &sb); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + #if defined(STACK) || defined(DDB) static int sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Sun Apr 14 19:59:38 2013 (r249486) +++ head/sys/sys/user.h Sun Apr 14 20:01:36 2013 (r249487) @@ -491,6 +491,25 @@ struct kinfo_kstack { }; #ifdef _KERNEL +/* Flags for kern_proc_out function. */ +#define KERN_PROC_NOTHREADS 0x1 +#define KERN_PROC_MASK32 0x2 + +struct sbuf; + +/* + * The kern_proc out functions are helper functions to dump process + * miscellaneous kinfo structures to sbuf. The main consumers are KERN_PROC + * sysctls but they may also be used by other kernel subsystems. + * + * The functions manipulate the process locking state and expect the process + * to be locked on enter. On return the process is unlocked. + */ + +int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); +int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); + int vntype_to_kinfo(int vtype); #endif /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 20:03:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B6EF1A5; Sun, 14 Apr 2013 20:03:49 +0000 (UTC) (envelope-from trociny@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 13A78FBE; Sun, 14 Apr 2013 20:03:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EK3m4D011163; Sun, 14 Apr 2013 20:03:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EK3meI011161; Sun, 14 Apr 2013 20:03:48 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304142003.r3EK3meI011161@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 14 Apr 2013 20:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249488 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 20:03:49 -0000 Author: trociny Date: Sun Apr 14 20:03:48 2013 New Revision: 249488 URL: http://svnweb.freebsd.org/changeset/base/249488 Log: Similarly to proc_getargv() and proc_getenvv(), export proc_getauxv() to be able to reuse the code. MFC after: 3 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 14 20:01:36 2013 (r249487) +++ head/sys/kern/kern_proc.c Sun Apr 14 20:03:48 2013 (r249488) @@ -1759,6 +1759,27 @@ proc_getenvv(struct thread *td, struct p return (get_ps_strings(curthread, p, sb, PROC_ENV)); } +int +proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb) +{ + size_t vsize, size; + char **auxv; + int error; + + error = get_proc_vector(td, p, &auxv, &vsize, PROC_AUX); + if (error == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + size = vsize * sizeof(Elf32_Auxinfo); + else +#endif + size = vsize * sizeof(Elf_Auxinfo); + error = sbuf_bcat(sb, auxv, size); + free(auxv, M_TEMP); + } + return (error); +} + /* * This sysctl allows a process to retrieve the argument list or process * title for another process without groping around in the address space @@ -1864,9 +1885,8 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; - size_t vsize, size; - char **auxv; - int error; + struct sbuf sb; + int error, error2; if (namelen != 1) return (EINVAL); @@ -1878,21 +1898,12 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG PRELE(p); return (0); } - error = get_proc_vector(curthread, p, &auxv, &vsize, PROC_AUX); - if (error == 0) { -#ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(p, SV_ILP32) != 0) - size = vsize * sizeof(Elf32_Auxinfo); - else -#endif - size = vsize * sizeof(Elf_Auxinfo); - PRELE(p); - error = SYSCTL_OUT(req, auxv, size); - free(auxv, M_TEMP); - } else { - PRELE(p); - } - return (error); + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getauxv(curthread, p, &sb); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + return (error != 0 ? error : error2); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Apr 14 20:01:36 2013 (r249487) +++ head/sys/sys/proc.h Sun Apr 14 20:03:48 2013 (r249488) @@ -873,6 +873,7 @@ struct pargs *pargs_alloc(int len); void pargs_drop(struct pargs *pa); void pargs_hold(struct pargs *pa); int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb); +int proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb); int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb); void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 20:52:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F22A9B1; Sun, 14 Apr 2013 20:52:33 +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 BA4521BC; Sun, 14 Apr 2013 20:52:32 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3EKqM6o060194; Sun, 14 Apr 2013 23:52:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3EKqM6o060194 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3EKqMmW060193; Sun, 14 Apr 2013 23:52:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Apr 2013 23:52:22 +0300 From: Konstantin Belousov To: Marius Strobl Subject: Re: svn commit: r249476 - in head/sys/dev: ata pci Message-ID: <20130414205222.GG2930@kib.kiev.ua> References: <201304141402.r3EE2YIi001357@svn.freebsd.org> <20130414150507.GA62578@alchemy.franken.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kra4tWuoVJHqwr45" Content-Disposition: inline In-Reply-To: <20130414150507.GA62578@alchemy.franken.de> 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-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 20:52:33 -0000 --Kra4tWuoVJHqwr45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2013 at 05:05:07PM +0200, Marius Strobl wrote: > On Sun, Apr 14, 2013 at 02:02:34PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Apr 14 14:02:34 2013 > > New Revision: 249476 > > URL: http://svnweb.freebsd.org/changeset/base/249476 > >=20 > > Log: > > Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI > > device which makes the request for dma tag, instead of some descendant > > of the PCI device, by creating a pass-through trampoline for vga_pci > > and ata_pci buses. >=20 > If you need to know the last PCI device requesting the DMA tag, > wouldn't it make more sense to let the consumer of this walk up the > tree as necessary instead of hacking N drivers? I.e.: > foo_get_dma_tag(device_t bus, device_t child) > { > device_t device, parent; > devclass_t pci_devclass; >=20 > pci_devclass =3D devclass_find("pci"); > for (device =3D child; child !=3D bus; device =3D parent) { > parent =3D device_get_parent(device); > if (device_get_devclass(parent) !=3D pci_devclass) > continue; > break; > } > /* use device */ > } The similar approach was my first thought, and I discussed it with John. After the discussion, I agreed that this is a hack. My understanding is that this default behaviour is only correct for the simple cases like the one fixed in the commit. Forcing this on other buses would only make the bugs hidden and cause more efforts in trying to identify it. >=20 > I suspect the problem you are hitting is also true for ISA devices > behind a PCI-ISA-bridge, PCI device drivers attaching non-PCI sub- > devices requesting DMA tags like sk(4) etc. And ISA DMA is probably good example why bus by default should not do the walking up. ISA bridge would need to allocate its own root tag for the ISA, while ISA bus needs to provide the specific tags and, most likely, specific busdma functions implementation for the ISA DMA channels. Of course, this talk assumes that ISA DMA is going to be converted to busdma. Unfortunately for me, the conversion looks inevitable. --Kra4tWuoVJHqwr45 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRaxcGAAoJEJDCuSvBvK1B1ccP/2j6mIBYsX7We7930/45fS6Y USydw8SQWN4N9Oaq/SOqWukF3wMRz/7arX62wrl+JMVicMp+twf6rC2j0A5ax30B tlMdkw5qmC8yZy8WJNNa0Vn6G5uF9+X7WO0BmXymXJhg2/Kf1xYDkcN+cFKHPzAN oPb78obSSxDYq1qemexgQBcC9deOJBd9xsWM3fv8VMa8IExRhaANEUOoQ8hN3/M5 EoAe6kBYB+0XNrUOu9vBeW3qi1m24OradrfmM72tHKzQWdORekr803s5XcDVUZiw 4/bmuF1pk3HZPPi0s4w0Kshg5MzOJn6Gm5keyoQ5T0FQlLFLEJTaP0/tYfgeelcQ RePeWLTuY5kYoEKJkq7fONBWBwOcjrWEf3dyKYqEn+mcrdX/U029WnryqUZgyuX7 THGwt41vRVNwlejqVnxtDL/LoaPW46/HCb2wiS4Z0/0y9E/G/CvwZ98dcRutU6LA 9joWoNqRr3ZLedVvAT0g92KXG4SLoKEWUoEst7dckjgsUvRekd5azHZF6ELtKs56 Tke6HDPy7sX9urj6+AC/R/GFLCgee7YGVEnaDWmqMYosO063MB+zVa3zzAnUWv0r Gsy4s7v0ctul82TmrJL7CbKidv3wg1wdiWhzxotxi+2Vjzr5bZu2CU46z5MVGV+g Cz184944vair0Hth9lRS =E2IE -----END PGP SIGNATURE----- --Kra4tWuoVJHqwr45-- From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 21:11:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7ECDAC63; Sun, 14 Apr 2013 21:11:20 +0000 (UTC) (envelope-from bdrewery@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 70BD2244; Sun, 14 Apr 2013 21:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ELBKdJ032134; Sun, 14 Apr 2013 21:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ELBKRG032133; Sun, 14 Apr 2013 21:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201304142111.r3ELBKRG032133@svn.freebsd.org> From: Bryan Drewery Date: Sun, 14 Apr 2013 21:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249489 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 21:11:20 -0000 Author: bdrewery (ports committer) Date: Sun Apr 14 21:11:19 2013 New Revision: 249489 URL: http://svnweb.freebsd.org/changeset/base/249489 Log: Run configtest before restarting so that the system is not left without a running sshd. Approved by: des MFC after: 1 week Modified: head/etc/rc.d/sshd Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Sun Apr 14 20:03:48 2013 (r249488) +++ head/etc/rc.d/sshd Sun Apr 14 21:11:19 2013 (r249489) @@ -14,6 +14,7 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" +restart_precmd="sshd_configtest" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 21:18:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E04B2E83; Sun, 14 Apr 2013 21:18:46 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7BDDF27E; Sun, 14 Apr 2013 21:18:46 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.6/8.14.6/ALCHEMY.FRANKEN.DE) with ESMTP id r3ELIjmX069077; Sun, 14 Apr 2013 23:18:45 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.6/8.14.6/Submit) id r3ELIimp069076; Sun, 14 Apr 2013 23:18:44 +0200 (CEST) (envelope-from marius) Date: Sun, 14 Apr 2013 23:18:44 +0200 From: Marius Strobl To: Konstantin Belousov Subject: Re: svn commit: r249476 - in head/sys/dev: ata pci Message-ID: <20130414211844.GB62578@alchemy.franken.de> References: <201304141402.r3EE2YIi001357@svn.freebsd.org> <20130414150507.GA62578@alchemy.franken.de> <20130414205222.GG2930@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130414205222.GG2930@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 21:18:47 -0000 On Sun, Apr 14, 2013 at 11:52:22PM +0300, Konstantin Belousov wrote: > On Sun, Apr 14, 2013 at 05:05:07PM +0200, Marius Strobl wrote: > > On Sun, Apr 14, 2013 at 02:02:34PM +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sun Apr 14 14:02:34 2013 > > > New Revision: 249476 > > > URL: http://svnweb.freebsd.org/changeset/base/249476 > > > > > > Log: > > > Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI > > > device which makes the request for dma tag, instead of some descendant > > > of the PCI device, by creating a pass-through trampoline for vga_pci > > > and ata_pci buses. > > > > If you need to know the last PCI device requesting the DMA tag, > > wouldn't it make more sense to let the consumer of this walk up the > > tree as necessary instead of hacking N drivers? I.e.: > > foo_get_dma_tag(device_t bus, device_t child) > > { > > device_t device, parent; > > devclass_t pci_devclass; > > > > pci_devclass = devclass_find("pci"); > > for (device = child; child != bus; device = parent) { > > parent = device_get_parent(device); > > if (device_get_devclass(parent) != pci_devclass) > > continue; > > break; > > } > > /* use device */ > > } > The similar approach was my first thought, and I discussed it with John. > After the discussion, I agreed that this is a hack. > > My understanding is that this default behaviour is only correct for > the simple cases like the one fixed in the commit. Forcing this on > other buses would only make the bugs hidden and cause more efforts > in trying to identify it. Oh, I see that now. Thanks for the clarification. Marius From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 22:38:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83A9E70E; Sun, 14 Apr 2013 22:38:30 +0000 (UTC) (envelope-from jpaetzel@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 73D7466A; Sun, 14 Apr 2013 22:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EMcUc2056863; Sun, 14 Apr 2013 22:38:30 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EMcSuY056852; Sun, 14 Apr 2013 22:38:28 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201304142238.r3EMcSuY056852@svn.freebsd.org> From: Josh Paetzel Date: Sun, 14 Apr 2013 22:38:28 +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: r249490 - in stable/9: sbin/iscontrol sys/dev/iscsi/initiator X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 22:38:30 -0000 Author: jpaetzel Date: Sun Apr 14 22:38:28 2013 New Revision: 249490 URL: http://svnweb.freebsd.org/changeset/base/249490 Log: MFC 234223: Update to version 2.3.1.0 MFC 234284, 234425, 234481: Unbreak the build caused by 234233 PR: kern/157770 Obtained from: Daniel Braniss Modified: stable/9/sbin/iscontrol/Makefile stable/9/sbin/iscontrol/iscontrol.8 stable/9/sbin/iscontrol/iscontrol.c stable/9/sbin/iscontrol/iscsi.conf.5 stable/9/sys/dev/iscsi/initiator/isc_subr.c stable/9/sys/dev/iscsi/initiator/iscsi.c stable/9/sys/dev/iscsi/initiator/iscsi_subr.c stable/9/sys/dev/iscsi/initiator/iscsivar.h Directory Properties: stable/9/sbin/iscontrol/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/iscontrol/Makefile ============================================================================== --- stable/9/sbin/iscontrol/Makefile Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/Makefile Sun Apr 14 22:38:28 2013 (r249490) @@ -7,8 +7,7 @@ LDADD= -lcam -lmd S= ${.CURDIR}/../../sys WARNS?= 3 -CFLAGS += -I$S -#CFLAGS += -g -DDEBUG +CFLAGS+= -I$S MAN= iscsi.conf.5 iscontrol.8 Modified: stable/9/sbin/iscontrol/iscontrol.8 ============================================================================== --- stable/9/sbin/iscontrol/iscontrol.8 Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscontrol.8 Sun Apr 14 22:38:28 2013 (r249490) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 22, 2007 +.Dd August 9, 2010 .Dt ISCONTROL 8 .Os .Sh NAME Modified: stable/9/sbin/iscontrol/iscontrol.c ============================================================================== --- stable/9/sbin/iscontrol/iscontrol.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscontrol.c Sun Apr 14 22:38:28 2013 (r249490) @@ -44,18 +44,22 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include #include #include +#include +#include +#include +#include #include +#include #include #include #include "iscontrol.h" +static char version[] = "2.3.1"; // keep in sync with iscsi_initiator + #define USAGE "[-v] [-d] [-c config] [-n name] [-t target] [-p pidfile]" #define OPTIONS "vdc:t:n:p:" @@ -109,6 +113,13 @@ isc_opt_t opvals = { .immediateData = TRUE, }; +static void +usage(const char *pname) +{ + fprintf(stderr, "usage: %s " USAGE "\n", pname); + exit(1); +} + int lookup(token_t *tbl, char *m) { @@ -124,20 +135,40 @@ int main(int cc, char **vv) { int ch, disco; - char *pname, *pidfile, *p, *q, *ta, *kw; + char *pname, *pidfile, *p, *q, *ta, *kw, *v; isc_opt_t *op; FILE *fd; + size_t n; op = &opvals; iscsidev = "/dev/"ISCSIDEV; fd = NULL; pname = vv[0]; - if((p = strrchr(pname, '/')) != NULL) - pname = p + 1; + if ((pname = basename(pname)) == NULL) + err(1, "basename"); kw = ta = 0; disco = 0; pidfile = NULL; + /* + | check for driver & controller version match + */ + n = 0; +#define VERSION_OID_S "net.iscsi_initiator.driver_version" + if (sysctlbyname(VERSION_OID_S, 0, &n, 0, 0) != 0) { + if (errno == ENOENT) + errx(1, "sysctlbyname(\"" VERSION_OID_S "\") " + "failed; is the iscsi driver loaded?"); + err(1, "sysctlbyname(\"" VERSION_OID_S "\")"); + } + v = malloc(n+1); + if (v == NULL) + err(1, "malloc"); + if (sysctlbyname(VERSION_OID_S, v, &n, 0, 0) != 0) + err(1, "sysctlbyname"); + + if (strncmp(version, v, 3) != 0) + errx(1, "versions mismatch"); while((ch = getopt(cc, vv, OPTIONS)) != -1) { switch(ch) { @@ -146,10 +177,8 @@ main(int cc, char **vv) break; case 'c': fd = fopen(optarg, "r"); - if(fd == NULL) { - perror(optarg); - exit(1); - } + if (fd == NULL) + err(1, "fopen(\"%s\")", optarg); break; case 'd': disco = 1; @@ -164,9 +193,7 @@ main(int cc, char **vv) pidfile = optarg; break; default: - badu: - fprintf(stderr, "Usage: %s %s\n", pname, USAGE); - exit(1); + usage(pname); } } if(fd == NULL) @@ -187,8 +214,8 @@ main(int cc, char **vv) op->targetAddress = ta; if(op->targetAddress == NULL) { - fprintf(stderr, "No target!\n"); - goto badu; + warnx("no target specified!"); + usage(pname); } q = op->targetAddress; if(*q == '[' && (q = strchr(q, ']')) != NULL) { @@ -206,7 +233,7 @@ main(int cc, char **vv) op->targetPortalGroupTag = atoi(p); } if(op->initiatorName == 0) { - char hostname[256]; + char hostname[MAXHOSTNAMELEN]; if(op->iqn) { if(gethostname(hostname, sizeof(hostname)) == 0) Modified: stable/9/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- stable/9/sbin/iscontrol/iscsi.conf.5 Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscsi.conf.5 Sun Apr 14 22:38:28 2013 (r249490) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 5, 2007 .Dt ISCSI.CONF 5 .Os .Sh NAME Modified: stable/9/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/isc_subr.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/isc_subr.c Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,104 @@ i_strdupin(char *s, size_t maxlen) return q; } +#if __FreeBSD_version < 800000 +/*****************************************************************/ +/* */ +/* CRC LOOKUP TABLE */ +/* ================ */ +/* The following CRC lookup table was generated automagically */ +/* by the Rocksoft^tm Model CRC Algorithm Table Generation */ +/* Program V1.0 using the following model parameters: */ +/* */ +/* Width : 4 bytes. */ +/* Poly : 0x1EDC6F41L */ +/* Reverse : TRUE. */ +/* */ +/* For more information on the Rocksoft^tm Model CRC Algorithm, */ +/* see the document titled "A Painless Guide to CRC Error */ +/* Detection Algorithms" by Ross Williams */ +/* (ross@guest.adelaide.edu.au.). This document is likely to be */ +/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ +/* */ +/*****************************************************************/ + +static uint32_t crc32Table[256] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, + 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, + 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, + 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, + 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, + 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, + 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, + 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, + 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, + 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, + 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, + 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, + 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, + 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, + 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, + 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, + 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, + 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, + 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, + 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, + 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, + 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, + 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, + 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, + 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, + 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, + 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, + 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, + 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, + 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, + 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, + 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, + 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, + 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, + 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, + 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, + 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, + 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, + 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, + 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, + 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, + 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, + 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, + 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, + 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, + 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, + 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, + 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, + 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, + 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, + 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, + 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, + 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, + 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, + 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, + 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, + 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, + 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, + 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, + 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, + 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, + 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, + 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, + 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L +}; + +static __inline int +calculate_crc32c(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p = buf; + + while (size--) + crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return crc; +} +#endif static uint32_t i_crc32c(const void *buf, size_t size, uint32_t crc) Modified: stable/9/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsi.c Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -static char *iscsi_driver_version = "2.2.4.2"; +static char *iscsi_driver_version = "2.3.1"; static struct isc_softc *isc; @@ -231,8 +231,8 @@ iscsi_ioctl(struct cdev *dev, u_long cmd if(error == 0) { sp->proc = td->td_proc; SYSCTL_ADD_INT(&sp->clist, SYSCTL_CHILDREN(sp->oid), - OID_AUTO, "pid", CTLFLAG_RD, - &sp->proc->p_pid, sizeof(pid_t), "control process id"); + OID_AUTO, "pid", CTLFLAG_RD, + &sp->proc->p_pid, sizeof(pid_t), "control process id"); } break; @@ -290,8 +290,7 @@ iscsi_read(struct cdev *dev, struct uio sprintf(buf, "%03d] '%s' '%s'\n", i++, sp->opt.targetAddress, sp->opt.targetName); uiomove(buf, strlen(buf), uio); } - sprintf(buf, "%d/%d /---- free -----/\n", sc->npdu_alloc, sc->npdu_max); - i = 0; + sprintf(buf, "free npdu_alloc=%d, npdu_max=%d\n", sc->npdu_alloc, sc->npdu_max); uiomove(buf, strlen(buf), uio); } else { @@ -696,7 +695,6 @@ iscsi_shutdown(void *v) static void free_pdus(struct isc_softc *sc) { - debug_called(8); if(sc->pdu_zone != NULL) { @@ -777,6 +775,10 @@ iscsi_start(void) sizeof(isc->nsess), "number of active session"); +#ifdef ISCSI_INITIATOR_DEBUG + mtx_init(&iscsi_dbg_mtx, "iscsi_dbg", NULL, MTX_DEF); +#endif + printf("iscsi: version %s\n", iscsi_driver_version); } @@ -814,6 +816,11 @@ iscsi_stop(void) xdebug("sysctl_ctx_free failed"); iscsi_shutdown(isc); // XXX: check EVENTHANDLER_ ... + +#ifdef ISCSI_INITIATOR_DEBUG + mtx_destroy(&iscsi_dbg_mtx); +#endif + free(isc, M_ISCSI); } Modified: stable/9/sys/dev/iscsi/initiator/iscsi_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Sun Apr 14 22:38:28 2013 (r249490) @@ -154,7 +154,7 @@ getSenseData(u_int status, union ccb *cc scsi_rsp_t *cmd = &pp->ipdu.scsi_rsp; caddr_t bp; int sense_len, mustfree = 0; - int error_code, sense_key, asc, ascq; + int error_code, sense_key, asc, ascq; bp = mtod(pq->mp, caddr_t); if((sense_len = scsi_2btoul(bp)) == 0) @@ -176,9 +176,8 @@ getSenseData(u_int status, union ccb *cc scsi->sense_resid = 0; if(cmd->flag & (BIT(1)|BIT(2))) scsi->sense_resid = ntohl(pp->ipdu.scsi_rsp.rcnt); - scsi_extract_sense_len(sense, scsi->sense_len - scsi->sense_resid, - &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); + &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); debug(3, "sense_len=%d rcnt=%d sense_resid=%d dsl=%d error_code=%x flags=%x", sense_len, @@ -479,6 +478,8 @@ scsi_encap(struct cam_sim *sim, union cc cmd = &pq->pdu.ipdu.scsi_req; cmd->opcode = ISCSI_SCSI_CMD; cmd->F = 1; +#if 0 +// this breaks at least Isilon's iscsi target. /* | map tag option, default is UNTAGGED */ @@ -488,6 +489,9 @@ scsi_encap(struct cam_sim *sim, union cc case MSG_ORDERED_Q_TAG: cmd->attr = iSCSI_TASK_ORDER; break; case MSG_ACA_TASK: cmd->attr = iSCSI_TASK_ACA; break; } +#else + cmd->attr = iSCSI_TASK_SIMPLE; +#endif dwl(sp, ccb_h->target_lun, (u_char *)&cmd->lun); Modified: stable/9/sys/dev/iscsi/initiator/iscsivar.h ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsivar.h Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsivar.h Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -204,6 +204,8 @@ struct isc_softc { struct sx unit_sx; uma_zone_t pdu_zone; // pool of free pdu's + TAILQ_HEAD(,pduq) freepdu; + #ifdef ISCSI_INITIATOR_DEBUG int npdu_alloc, npdu_max; // for instrumentation #endif @@ -306,9 +308,11 @@ pdu_alloc(struct isc_softc *isc, int wai return NULL; } #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc++; if(isc->npdu_alloc > isc->npdu_max) isc->npdu_max = isc->npdu_alloc; + mtx_unlock(&iscsi_dbg_mtx); #endif memset(pq, 0, sizeof(pduq_t)); @@ -324,10 +328,12 @@ pdu_free(struct isc_softc *isc, pduq_t * if(pq->buf != NULL) free(pq->buf, M_ISCSIBUF); #endif + uma_zfree(isc->pdu_zone, pq); #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc--; + mtx_unlock(&iscsi_dbg_mtx); #endif - uma_zfree(isc->pdu_zone, pq); } static __inline void From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 03:02:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9DB8DAD; Mon, 15 Apr 2013 03:02:55 +0000 (UTC) (envelope-from hiren@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 CC5D4DE7; Mon, 15 Apr 2013 03:02:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F32toR040909; Mon, 15 Apr 2013 03:02:55 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F32tDK040908; Mon, 15 Apr 2013 03:02:55 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304150302.r3F32tDK040908@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 15 Apr 2013 03:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249491 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 03:02:55 -0000 Author: hiren Date: Mon Apr 15 03:02:55 2013 New Revision: 249491 URL: http://svnweb.freebsd.org/changeset/base/249491 Log: Fixing a typo. Submitted by: Benedikt Steinbusch (benedikt.steinbusch@googlemail.com) Approved by: sbruno (mentor) Modified: head/share/man/man3/pthread_getconcurrency.3 Modified: head/share/man/man3/pthread_getconcurrency.3 ============================================================================== --- head/share/man/man3/pthread_getconcurrency.3 Sun Apr 14 22:38:28 2013 (r249490) +++ head/share/man/man3/pthread_getconcurrency.3 Mon Apr 15 03:02:55 2013 (r249491) @@ -40,7 +40,7 @@ .Fn pthread_setconcurrency "int new_level" .Sh DESCRIPTION The -.Fn pthread_getconcurrency +.Fn pthread_setconcurrency function allows an application to inform the threads implementation of its desired concurrency level, .Fa new_level . From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 03:10:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA0EAFE3; Mon, 15 Apr 2013 03:10:00 +0000 (UTC) (envelope-from hiren@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 CA8B8E36; Mon, 15 Apr 2013 03:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F3A0Wb042288; Mon, 15 Apr 2013 03:10:00 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F3A0Hu042269; Mon, 15 Apr 2013 03:10:00 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304150310.r3F3A0Hu042269@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 15 Apr 2013 03:10:00 +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: r249492 - in stable/9: lib/libpmc sys/dev/hwpmc 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 03:10:00 -0000 Author: hiren Date: Mon Apr 15 03:09:59 2013 New Revision: 249492 URL: http://svnweb.freebsd.org/changeset/base/249492 Log: MFC: r246166 Update hwpmc to support the Xeon class of Ivybridge processors. case 0x3E: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Approved by: sbruno (mentor) Added: stable/9/lib/libpmc/pmc.ivybridgexeon.3 (contents, props changed) Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgexeon.3 stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/Makefile Mon Apr 15 03:09:59 2013 (r249492) @@ -29,6 +29,7 @@ MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 +MAN+= pmc.ivybridgexeon.3 MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/libpmc.c Mon Apr 15 03:09:59 2013 (r249492) @@ -187,6 +187,11 @@ static const struct pmc_event_descr ivyb __PMC_EV_ALIAS_IVYBRIDGE() }; +static const struct pmc_event_descr ivybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_IVYBRIDGE_XEON() +}; + static const struct pmc_event_descr sandybridge_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGE() @@ -232,6 +237,7 @@ PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); +PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -270,6 +276,7 @@ PMC_CLASS_TABLE_DESC(core, IAP, core, ia PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); +PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); @@ -574,6 +581,8 @@ static struct pmc_event_alias core2_alia #define corei7_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf +#define ivybridge_xeon_aliases core2_aliases +#define ivybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_xeon_aliases core2_aliases @@ -804,7 +813,8 @@ iap_allocate_pmc(enum pmc_event pe, char return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON ) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else @@ -2673,6 +2683,10 @@ pmc_event_names_of_class(enum pmc_class ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); @@ -2968,6 +2982,9 @@ pmc_init(void) case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(ivybridge_xeon); + break; case PMC_CPU_INTE