From owner-svn-src-all@FreeBSD.ORG Sun May 6 03:15:56 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id BDE25106566B; Sun, 6 May 2012 03:15:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 63EAA1502EC; Sun, 6 May 2012 03:15:55 +0000 (UTC) Date: Sat, 5 May 2012 20:15:54 -0700 (PDT) From: Doug Barton To: Bruce Evans In-Reply-To: <20120505192318.T1202@besplex.bde.org> Message-ID: References: <201205041531.q44FVaYF010236@svn.freebsd.org> <20120504182200.GD1604@azathoth.lan> <4FA438C4.3080701@FreeBSD.org> <20120505192318.T1202@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Baptiste Daroussin , "src-committers@freebsd.org" , Garrett Cooper , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "kmoore@freebsd.org" , Josh Paetzel Subject: Re: svn commit: r235005 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 03:15:56 -0000 On Sat, 5 May 2012, Bruce Evans wrote: > On Fri, 4 May 2012, Doug Barton wrote: > >> On 05/04/2012 11:22 AM, Baptiste Daroussin wrote: >>>>>>> fetch -s "${FETCHFILE}" >${SIZEFILE} >>>>>>> SIZE="`cat ${SIZEFILE}`" >>>>>>> - SIZE="`expr ${SIZE} / 1024`" >>>>>>> + SIZE=$((SIZE/1024)) >>>>> >>>>> Bug; should be '$SIZE/' >>> No this is perfectly valid >> >> Yes, that works, but it's not our usual style. However, the point is >> moot as that whole block should be reduced down to: >> >> SIZE=$(( `fetch -s "${FETCHFILE}"` / 1024 )) > > The KNF rule that there shall be spaces around binary operators should > probably apply in shell expressions too, but I don't like the spaces > on 1 side of (( and )). Shell syntax doesn't even allow spaces between > '$' ((. The "extra" spaces there are a personal style thing. I do it for 2 reasons, readability primarily, but also to distinguish arithmetic operations from $(command) style. > The rc.d style seems to be to use backquotes and not use $(cmd), but I > prefer the opposite except possibly in shell expressions like the above > so that it is easier to separate the commands from the shell expressions. Yeah, backticks over $() is also a personal style issue, for no particular good reason other than "looks better to me." :) Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sun May 6 05:49:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41398106564A; Sun, 6 May 2012 05:49:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5F38FC08; Sun, 6 May 2012 05:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q465nOtW098853; Sun, 6 May 2012 05:49:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q465nNDZ098851; Sun, 6 May 2012 05:49:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205060549.q465nNDZ098851@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 05:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235069 - head/sys/geom/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 05:49:24 -0000 Author: mav Date: Sun May 6 05:49:23 2012 New Revision: 235069 URL: http://svn.freebsd.org/changeset/base/235069 Log: Fix `gmultipath configure` for big-endian machines. MFC after: 1 week Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sat May 5 23:51:24 2012 (r235068) +++ head/sys/geom/multipath/g_multipath.c Sun May 6 05:49:23 2012 (r235069) @@ -944,7 +944,7 @@ g_multipath_ctl_configure(struct gctl_re struct g_geom *gp; struct g_consumer *cp; struct g_provider *pp; - struct g_multipath_metadata *md; + struct g_multipath_metadata md; const char *name; int error, *val; void *buf; @@ -980,14 +980,15 @@ g_multipath_ctl_configure(struct gctl_re return; } g_topology_unlock(); - md = buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); - strlcpy(md->md_magic, G_MULTIPATH_MAGIC, sizeof(md->md_magic)); - memcpy(md->md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); - strlcpy(md->md_name, name, sizeof(md->md_name)); - md->md_version = G_MULTIPATH_VERSION; - md->md_size = pp->mediasize; - md->md_sectorsize = pp->sectorsize; - md->md_active_active = sc->sc_active_active; + buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); + strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); + memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); + strlcpy(md.md_name, name, sizeof(md.md_name)); + md.md_version = G_MULTIPATH_VERSION; + md.md_size = pp->mediasize; + md.md_sectorsize = pp->sectorsize; + md.md_active_active = sc->sc_active_active; + multipath_metadata_encode(&md, buf); error = g_write_data(cp, pp->mediasize - pp->sectorsize, buf, pp->sectorsize); g_topology_lock(); From owner-svn-src-all@FreeBSD.ORG Sun May 6 05:58:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 022DA106564A; Sun, 6 May 2012 05:58:57 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0BDD8FC17; Sun, 6 May 2012 05:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q465wuRV099199; Sun, 6 May 2012 05:58:56 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q465wuMU099195; Sun, 6 May 2012 05:58:56 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201205060558.q465wuMU099195@svn.freebsd.org> From: Juli Mallett Date: Sun, 6 May 2012 05:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235070 - head/sys/mips/gxemul X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 05:58:57 -0000 Author: jmallett Date: Sun May 6 05:58:56 2012 New Revision: 235070 URL: http://svn.freebsd.org/changeset/base/235070 Log: Get the memory size from the gxemul mp device. Don't dump the environment if it is not present. Added: head/sys/mips/gxemul/mpreg.h (contents, props changed) Modified: head/sys/mips/gxemul/files.gxemul head/sys/mips/gxemul/gxemul_machdep.c Modified: head/sys/mips/gxemul/files.gxemul ============================================================================== --- head/sys/mips/gxemul/files.gxemul Sun May 6 05:49:23 2012 (r235069) +++ head/sys/mips/gxemul/files.gxemul Sun May 6 05:58:56 2012 (r235070) @@ -3,3 +3,6 @@ dev/gxemul/cons/gxemul_cons.c optional mips/gxemul/gxemul_machdep.c standard mips/mips/intr_machdep.c standard mips/mips/tick.c standard + +dev/gxemul/disk/gxemul_disk.c optional gxemul_disk +dev/gxemul/ether/gxemul_ether.c optional gxemul_ether Modified: head/sys/mips/gxemul/gxemul_machdep.c ============================================================================== --- head/sys/mips/gxemul/gxemul_machdep.c Sun May 6 05:49:23 2012 (r235069) +++ head/sys/mips/gxemul/gxemul_machdep.c Sun May 6 05:58:56 2012 (r235070) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + extern int *edata; extern int *end; @@ -123,7 +125,6 @@ platform_start(__register_t a0, __regist int argc = a0; char **argv = (char **)a1; char **envp = (char **)a2; - unsigned int memsize = a3; int i; /* clear the BSS and SBSS segments */ @@ -152,14 +153,16 @@ platform_start(__register_t a0, __regist printf("%s ", argv[i]); printf("\n"); - printf("envp:\n"); - for (i = 0; envp[i]; i += 2) - printf("\t%s = %s\n", envp[i], envp[i+1]); - - printf("memsize = %08x\n", memsize); + if (envp != NULL) { + printf("envp:\n"); + for (i = 0; envp[i]; i += 2) + printf("\t%s = %s\n", envp[i], envp[i+1]); + } else { + printf("no envp.\n"); + } } - realmem = btoc(memsize); + realmem = btoc(GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_MEMORY)); mips_init(); mips_timer_init_params(platform_counter_freq, 0); Added: head/sys/mips/gxemul/mpreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/gxemul/mpreg.h Sun May 6 05:58:56 2012 (r235070) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2004-2012 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MIPS_GXEMUL_MPREG_H_ +#define _MIPS_GXEMUL_MPREG_H_ + +#define GXEMUL_MP_DEV_BASE 0x11000000 + +#define GXEMUL_MP_DEV_WHOAMI 0x0000 +#define GXEMUL_MP_DEV_NCPUS 0x0010 +#define GXEMUL_MP_DEV_START 0x0020 +#define GXEMUL_MP_DEV_STARTADDR 0x0030 +#define GXEMUL_MP_DEV_STACK 0x0070 +#define GXEMUL_MP_DEV_MEMORY 0x0090 +#define GXEMUL_MP_DEV_IPI_ONE 0x00a0 +#define GXEMUL_MP_DEV_IPI_MANY 0x00b0 +#define GXEMUL_MP_DEV_IPI_READ 0x00c0 + +#define GXEMUL_MP_DEV_FUNCTION(f) \ + (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_MP_DEV_BASE + (f)) +#define GXEMUL_MP_DEV_READ(f) \ + (volatile uint64_t)*GXEMUL_MP_DEV_FUNCTION(f) +#define GXEMUL_MP_DEV_WRITE(f, v) \ + *GXEMUL_MP_DEV_FUNCTION(f) = (v) + +#define GXEMUL_MP_DEV_IPI_INTERRUPT (6) + +#endif /* !_MIPS_GXEMUL_MPREG_H */ From owner-svn-src-all@FreeBSD.ORG Sun May 6 06:25:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B85EB1065673; Sun, 6 May 2012 06:25:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A474F8FC14; Sun, 6 May 2012 06:25:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q466PHtU000108; Sun, 6 May 2012 06:25:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q466PH73000106; Sun, 6 May 2012 06:25:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205060625.q466PH73000106@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 06:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235071 - head/sbin/geom/class/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 06:25:17 -0000 Author: mav Date: Sun May 6 06:25:17 2012 New Revision: 235071 URL: http://svn.freebsd.org/changeset/base/235071 Log: Add description for GEOM RAID tunables/sysctls. MFC after: 1 week Modified: head/sbin/geom/class/raid/graid.8 Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Sun May 6 05:58:56 2012 (r235070) +++ head/sbin/geom/class/raid/graid.8 Sun May 6 06:25:17 2012 (r235071) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2012 +.Dd May 6, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -276,6 +276,33 @@ corruption! .Sh 2TiB BARRIERS Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variable can be used to control the behavior of the +.Nm RAID +GEOM class. +.Bl -tag -width indent +.It Va kern.geom.raid.aggressive_spare : No 0 +Use any disks without metadata connected to controllers of the vendor +matching to volume metadata format as spare. +Use it with much care to not lose data if connecting unrelated disk! +.It Va kern.geom.raid.clean_time : No 5 +Mark volume as clean when idle for the specified number of seconds. +.It Va kern.geom.raid.debug : No 0 +Debug level of the +.Nm RAID +GEOM class. +.It Va kern.geom.raid.idle_threshold : No 1000000 +Time in microseconds to consider a volume idle for rebuild puroses. +.It Va kern.geom.raid.name_format : No 0 +Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. +.It Va kern.geom.raid.read_err_thresh : No 10 +Number of read errors equated to disk failure. +Write errors are always considered as disk failures. +.It Va kern.geom.raid.start_timeout : No 30 +Time to wait for missing array components on startup. +.El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Sun May 6 07:20:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD45D106566B; Sun, 6 May 2012 07:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 982F58FC08; Sun, 6 May 2012 07:20:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q467KmhF001866; Sun, 6 May 2012 07:20:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q467KmWT001864; Sun, 6 May 2012 07:20:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205060720.q467KmWT001864@svn.freebsd.org> From: Warner Losh Date: Sun, 6 May 2012 07:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235072 - head/sys/arm/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 07:20:48 -0000 Author: imp Date: Sun May 6 07:20:48 2012 New Revision: 235072 URL: http://svn.freebsd.org/changeset/base/235072 Log: Fix the MACHINE_ARCH for big endian arm to be armeb. Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Sun May 6 06:25:17 2012 (r235071) +++ head/sys/arm/include/param.h Sun May 6 07:20:48 2012 (r235072) @@ -56,8 +56,12 @@ #define MACHINE "arm" #endif #ifndef MACHINE_ARCH +#ifdef __ARMEB__ +#define MACHINE_ARCH "armeb" +#else #define MACHINE_ARCH "arm" #endif +#endif #define MID_MACHINE MID_ARM6 #if defined(SMP) || defined(KLD_MODULE) From owner-svn-src-all@FreeBSD.ORG Sun May 6 08:28:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BB851065675; Sun, 6 May 2012 08:28:09 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855E28FC14; Sun, 6 May 2012 08:28:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q468S9Ek004113; Sun, 6 May 2012 08:28:09 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q468S9k5004110; Sun, 6 May 2012 08:28:09 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201205060828.q468S9k5004110@svn.freebsd.org> From: Juli Mallett Date: Sun, 6 May 2012 08:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235073 - in head/sys: dev/gxemul/disk mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 08:28:09 -0000 Author: jmallett Date: Sun May 6 08:28:08 2012 New Revision: 235073 URL: http://svn.freebsd.org/changeset/base/235073 Log: Add a driver for the GXemul test machine's disk controller and disk devices. Prefer it to using an md device in the GXEMUL kernel configuration. Requested by: rwatson, theraven Added: head/sys/dev/gxemul/disk/ head/sys/dev/gxemul/disk/gxemul_disk.c (contents, props changed) head/sys/dev/gxemul/disk/gxemul_diskreg.h (contents, props changed) Modified: head/sys/mips/conf/GXEMUL Added: head/sys/dev/gxemul/disk/gxemul_disk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gxemul/disk/gxemul_disk.c Sun May 6 08:28:08 2012 (r235073) @@ -0,0 +1,315 @@ +/*- + * Copyright (c) 2008-2012 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +struct gxemul_disk_softc { + device_t sc_dev; + uint64_t sc_size; + struct g_geom *sc_geom; + struct g_provider *sc_provider; +}; + +static struct mtx gxemul_disk_controller_mutex; + +static g_start_t gxemul_disk_start; +static g_access_t gxemul_disk_access; + +struct g_class g_gxemul_disk_class = { + .name = "GXemul", + .version = G_VERSION, + .start = gxemul_disk_start, + .access = gxemul_disk_access, +}; + +DECLARE_GEOM_CLASS(g_gxemul_disk_class, g_gxemul_disk); + +static void gxemul_disk_identify(driver_t *, device_t); +static int gxemul_disk_probe(device_t); +static int gxemul_disk_attach(device_t); +static void gxemul_disk_attach_geom(void *, int); + +static int gxemul_disk_read(unsigned, void *, off_t); +static int gxemul_disk_size(unsigned, uint64_t *); +static int gxemul_disk_write(unsigned, const void *, off_t); + +static void +gxemul_disk_start(struct bio *bp) +{ + struct gxemul_disk_softc *sc; + unsigned diskid; + off_t offset; + uint8_t *buf; + int error; + + sc = bp->bio_to->geom->softc; + diskid = device_get_unit(sc->sc_dev); + + if ((bp->bio_length % GXEMUL_DISK_DEV_BLOCKSIZE) != 0) { + g_io_deliver(bp, EINVAL); + return; + } + + buf = bp->bio_data; + offset = bp->bio_offset; + bp->bio_resid = bp->bio_length; + while (bp->bio_resid != 0) { + switch (bp->bio_cmd) { + case BIO_READ: + mtx_lock(&gxemul_disk_controller_mutex); + error = gxemul_disk_read(diskid, buf, offset); + mtx_unlock(&gxemul_disk_controller_mutex); + break; + case BIO_WRITE: + mtx_lock(&gxemul_disk_controller_mutex); + error = gxemul_disk_write(diskid, buf, offset); + mtx_unlock(&gxemul_disk_controller_mutex); + break; + default: + g_io_deliver(bp, EOPNOTSUPP); + return; + } + if (error != 0) { + g_io_deliver(bp, error); + return; + } + + buf += GXEMUL_DISK_DEV_BLOCKSIZE; + offset += GXEMUL_DISK_DEV_BLOCKSIZE; + bp->bio_completed += GXEMUL_DISK_DEV_BLOCKSIZE; + bp->bio_resid -= GXEMUL_DISK_DEV_BLOCKSIZE; + } + + g_io_deliver(bp, 0); +} + +static int +gxemul_disk_access(struct g_provider *pp, int r, int w, int e) +{ + return (0); +} + +static void +gxemul_disk_identify(driver_t *drv, device_t parent) +{ + unsigned diskid; + + mtx_init(&gxemul_disk_controller_mutex, "GXemul disk controller", NULL, MTX_DEF); + + mtx_lock(&gxemul_disk_controller_mutex); + for (diskid = 0; diskid < 0x100; diskid++) { + /* + * If we can read at offset 0, this disk id must be + * present enough. If we get an error, stop looking. + * Disks in GXemul are allocated linearly from 0. + */ + if (gxemul_disk_read(diskid, NULL, 0) != 0) + break; + BUS_ADD_CHILD(parent, 0, "gxemul_disk", diskid); + } + mtx_unlock(&gxemul_disk_controller_mutex); +} + +static int +gxemul_disk_probe(device_t dev) +{ + device_set_desc(dev, "GXemul test disk"); + + return (0); +} + +static void +gxemul_disk_attach_geom(void *arg, int flag) +{ + struct gxemul_disk_softc *sc; + + sc = arg; + + sc->sc_geom = g_new_geomf(&g_gxemul_disk_class, "%s", device_get_nameunit(sc->sc_dev)); + sc->sc_geom->softc = sc; + + sc->sc_provider = g_new_providerf(sc->sc_geom, sc->sc_geom->name); + sc->sc_provider->sectorsize = GXEMUL_DISK_DEV_BLOCKSIZE; + sc->sc_provider->mediasize = sc->sc_size; + g_error_provider(sc->sc_provider, 0); +} + +static int +gxemul_disk_attach(device_t dev) +{ + struct gxemul_disk_softc *sc; + unsigned diskid; + int error; + + diskid = device_get_unit(dev); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_geom = NULL; + sc->sc_provider = NULL; + + mtx_lock(&gxemul_disk_controller_mutex); + error = gxemul_disk_size(diskid, &sc->sc_size); + if (error != 0) { + mtx_unlock(&gxemul_disk_controller_mutex); + return (error); + } + mtx_unlock(&gxemul_disk_controller_mutex); + + g_post_event(gxemul_disk_attach_geom, sc, M_WAITOK, NULL); + + return (0); +} + +static int +gxemul_disk_read(unsigned diskid, void *buf, off_t off) +{ + const volatile void *src; + + mtx_assert(&gxemul_disk_controller_mutex, MA_OWNED); + + if (off < 0 || off % GXEMUL_DISK_DEV_BLOCKSIZE != 0) + return (EINVAL); + + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET, (uint64_t)off); + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_DISKID, diskid); + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_START, GXEMUL_DISK_DEV_START_READ); + switch (GXEMUL_DISK_DEV_READ(GXEMUL_DISK_DEV_STATUS)) { + case GXEMUL_DISK_DEV_STATUS_FAILURE: + return (EIO); + default: + break; + } + + if (buf != NULL) { + src = GXEMUL_DISK_DEV_FUNCTION(GXEMUL_DISK_DEV_BLOCK); + memcpy(buf, (const void *)(uintptr_t)src, + GXEMUL_DISK_DEV_BLOCKSIZE); + } + + return (0); +} + +static int +gxemul_disk_size(unsigned diskid, uint64_t *sizep) +{ + uint64_t offset, ogood; + uint64_t m, s; + int error; + + m = 1; + s = 3; + ogood = 0; + + for (;;) { + offset = (ogood * s) + (m * GXEMUL_DISK_DEV_BLOCKSIZE); + + error = gxemul_disk_read(diskid, NULL, offset); + if (error != 0) { + if (m == 1 && s == 1) { + *sizep = ogood + GXEMUL_DISK_DEV_BLOCKSIZE; + return (0); + } + if (m > 1) + m /= 2; + if (s > 1) + s--; + continue; + } + if (ogood == offset) { + m = 1; + continue; + } + ogood = offset; + m++; + } + + return (EDOOFUS); +} + +static int +gxemul_disk_write(unsigned diskid, const void *buf, off_t off) +{ + volatile void *dst; + + mtx_assert(&gxemul_disk_controller_mutex, MA_OWNED); + + if (off < 0 || off % GXEMUL_DISK_DEV_BLOCKSIZE != 0) + return (EINVAL); + + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET, (uint64_t)off); + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_DISKID, diskid); + + dst = GXEMUL_DISK_DEV_FUNCTION(GXEMUL_DISK_DEV_BLOCK); + memcpy((void *)(uintptr_t)dst, buf, GXEMUL_DISK_DEV_BLOCKSIZE); + + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_START, GXEMUL_DISK_DEV_START_READ); + switch (GXEMUL_DISK_DEV_READ(GXEMUL_DISK_DEV_STATUS)) { + case GXEMUL_DISK_DEV_STATUS_FAILURE: + return (EIO); + default: + break; + } + + return (0); +} + +static device_method_t gxemul_disk_methods[] = { + DEVMETHOD(device_probe, gxemul_disk_probe), + DEVMETHOD(device_identify, gxemul_disk_identify), + DEVMETHOD(device_attach, gxemul_disk_attach), + + { 0, 0 } +}; + +static driver_t gxemul_disk_driver = { + "gxemul_disk", + gxemul_disk_methods, + sizeof (struct gxemul_disk_softc) +}; + +static devclass_t gxemul_disk_devclass; +DRIVER_MODULE(gxemul_disk, nexus, gxemul_disk_driver, gxemul_disk_devclass, 0, 0); Added: head/sys/dev/gxemul/disk/gxemul_diskreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gxemul/disk/gxemul_diskreg.h Sun May 6 08:28:08 2012 (r235073) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2008-2012 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_GXEMUL_DISK_GXEMUL_DISK_H_ +#define _DEV_GXEMUL_DISK_GXEMUL_DISK_H_ + +#define GXEMUL_DISK_DEV_BASE (0x13000000) + +#define GXEMUL_DISK_DEV_BLOCKSIZE (0x0200) + +#define GXEMUL_DISK_DEV_ID_START (0x0000) +#define GXEMUL_DISK_DEV_ID_END (0x0100) + +#define GXEMUL_DISK_DEV_OFFSET (0x0000) +#define GXEMUL_DISK_DEV_DISKID (0x0010) +#define GXEMUL_DISK_DEV_START (0x0020) +#define GXEMUL_DISK_DEV_STATUS (0x0030) +#define GXEMUL_DISK_DEV_BLOCK (0x4000) + +#define GXEMUL_DISK_DEV_FUNCTION(f) \ + (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_DISK_DEV_BASE + (f)) +#define GXEMUL_DISK_DEV_READ(f) \ + (volatile uint64_t)*GXEMUL_DISK_DEV_FUNCTION(f) +#define GXEMUL_DISK_DEV_WRITE(f, v) \ + *GXEMUL_DISK_DEV_FUNCTION(f) = (v) + +#define GXEMUL_DISK_DEV_START_READ (0x00) +#define GXEMUL_DISK_DEV_START_WRITE (0x01) + +#define GXEMUL_DISK_DEV_STATUS_FAILURE (0x00) + +#endif /* !_DEV_GXEMUL_DISK_GXEMUL_DISK_H_ */ Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Sun May 6 07:20:48 2012 (r235072) +++ head/sys/mips/conf/GXEMUL Sun May 6 08:28:08 2012 (r235073) @@ -37,16 +37,10 @@ options INVARIANT_SUPPORT #Extra sanity #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -# -# This kernel configuration uses an embedded 8MB memory root file system. -# Adjust the following path based on local requirements. -# -options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 -#makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img -options ROOTDEVNAME=\"ufs:md0\" +options ROOTDEVNAME=\"ufs:gxemul_disk0\" device gxemul_cons +device gxemul_disk device md device loop device random From owner-svn-src-all@FreeBSD.ORG Sun May 6 08:31:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC85106564A; Sun, 6 May 2012 08:31:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9D4D8FC08; Sun, 6 May 2012 08:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q468VvML004270; Sun, 6 May 2012 08:31:57 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q468Vv2v004268; Sun, 6 May 2012 08:31:57 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201205060831.q468Vv2v004268@svn.freebsd.org> From: Doug Barton Date: Sun, 6 May 2012 08:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235074 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 08:31:57 -0000 Author: dougb Date: Sun May 6 08:31:57 2012 New Revision: 235074 URL: http://svn.freebsd.org/changeset/base/235074 Log: MFC r231929: If nested scheme allows dump kernel to its partition, we may allow dump for the parent partition too. Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Sun May 6 08:28:08 2012 (r235073) +++ stable/8/sys/geom/part/g_part.c Sun May 6 08:31:57 2012 (r235074) @@ -2048,9 +2048,12 @@ g_part_start(struct bio *bp) /* * Check that the partition is suitable for kernel * dumps. Typically only swap partitions should be - * used. + * used. If the request comes from the nested scheme + * we allow dumping there as well. */ - if (!G_PART_DUMPTO(table, entry)) { + if ((bp->bio_from == NULL || + bp->bio_from->geom->class != &g_part_class) && + G_PART_DUMPTO(table, entry) == 0) { g_io_deliver(bp, ENODEV); printf("GEOM_PART: Partition '%s' not suitable" " for kernel dumps (wrong type?)\n", From owner-svn-src-all@FreeBSD.ORG Sun May 6 11:02:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A9511065674; Sun, 6 May 2012 11:02:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44D008FC0A; Sun, 6 May 2012 11:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46B2suX011147; Sun, 6 May 2012 11:02:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46B2sXj011142; Sun, 6 May 2012 11:02:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205061102.q46B2sXj011142@svn.freebsd.org> From: Michael Tuexen Date: Sun, 6 May 2012 11:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235075 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 11:02:54 -0000 Author: tuexen Date: Sun May 6 11:02:53 2012 New Revision: 235075 URL: http://svn.freebsd.org/changeset/base/235075 Log: Add support for SCTP_SEND_FAILED_EVENT as required by RFC 6458. MFC after: 3 days Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sun May 6 08:31:57 2012 (r235074) +++ head/sys/netinet/sctp.h Sun May 6 11:02:53 2012 (r235075) @@ -526,7 +526,7 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x00000800 #define SCTP_PCB_FLAGS_RECVPADDREVNT 0x00001000 #define SCTP_PCB_FLAGS_RECVPEERERR 0x00002000 -#define SCTP_PCB_FLAGS_RECVSENDFAILEVNT 0x00004000 +#define SCTP_PCB_FLAGS_RECVSENDFAILEVNT 0x00004000 /* deprecated */ #define SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT 0x00008000 #define SCTP_PCB_FLAGS_ADAPTATIONEVNT 0x00010000 #define SCTP_PCB_FLAGS_PDAPIEVNT 0x00020000 @@ -542,6 +542,7 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_RECVNXTINFO 0x10000000 #define SCTP_PCB_FLAGS_ASSOC_RESETEVNT 0x20000000 #define SCTP_PCB_FLAGS_STREAM_CHANGEEVNT 0x40000000 +#define SCTP_PCB_FLAGS_RECVNSENDFAILEVNT 0x80000000 /*- * mobility_features parameters (by micchie).Note Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Sun May 6 08:31:57 2012 (r235074) +++ head/sys/netinet/sctp_uio.h Sun May 6 11:02:53 2012 (r235075) @@ -343,7 +343,7 @@ struct sctp_remote_error { uint8_t sre_data[4]; }; -/* data send failure event */ +/* data send failure event (deprecated) */ struct sctp_send_failed { uint16_t ssf_type; uint16_t ssf_flags; @@ -354,6 +354,17 @@ struct sctp_send_failed { uint8_t ssf_data[]; }; +/* data send failure event (not deprecated) */ +struct sctp_send_failed_event { + uint16_t ssfe_type; + uint16_t ssfe_flags; + uint32_t ssfe_length; + uint32_t ssfe_error; + struct sctp_sndinfo ssfe_info; + sctp_assoc_t ssfe_assoc_id; + uint8_t ssfe_data[]; +}; + /* flag that indicates state of data */ #define SCTP_DATA_UNSENT 0x0001 /* inqueue never on wire */ #define SCTP_DATA_SENT 0x0002 /* on wire at failure */ @@ -513,22 +524,22 @@ union sctp_notification { }; /* notification types */ -#define SCTP_ASSOC_CHANGE 0x0001 -#define SCTP_PEER_ADDR_CHANGE 0x0002 -#define SCTP_REMOTE_ERROR 0x0003 -#define SCTP_SEND_FAILED 0x0004 -#define SCTP_SHUTDOWN_EVENT 0x0005 -#define SCTP_ADAPTATION_INDICATION 0x0006 +#define SCTP_ASSOC_CHANGE 0x0001 +#define SCTP_PEER_ADDR_CHANGE 0x0002 +#define SCTP_REMOTE_ERROR 0x0003 +#define SCTP_SEND_FAILED 0x0004 +#define SCTP_SHUTDOWN_EVENT 0x0005 +#define SCTP_ADAPTATION_INDICATION 0x0006 /* same as above */ -#define SCTP_ADAPTION_INDICATION 0x0006 -#define SCTP_PARTIAL_DELIVERY_EVENT 0x0007 -#define SCTP_AUTHENTICATION_EVENT 0x0008 -#define SCTP_STREAM_RESET_EVENT 0x0009 -#define SCTP_SENDER_DRY_EVENT 0x000a -#define SCTP_NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ -#define SCTP_ASSOC_RESET_EVENT 0x000c -#define SCTP_STREAM_CHANGE_EVENT 0x000d - +#define SCTP_ADAPTION_INDICATION 0x0006 +#define SCTP_PARTIAL_DELIVERY_EVENT 0x0007 +#define SCTP_AUTHENTICATION_EVENT 0x0008 +#define SCTP_STREAM_RESET_EVENT 0x0009 +#define SCTP_SENDER_DRY_EVENT 0x000a +#define SCTP_NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ +#define SCTP_ASSOC_RESET_EVENT 0x000c +#define SCTP_STREAM_CHANGE_EVENT 0x000d +#define SCTP_SEND_FAILED_EVENT 0x000e /* * socket option structs */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 6 08:31:57 2012 (r235074) +++ head/sys/netinet/sctp_usrreq.c Sun May 6 11:02:53 2012 (r235075) @@ -2989,6 +2989,9 @@ flags_out: case SCTP_STREAM_CHANGE_EVENT: event_type = SCTP_PCB_FLAGS_STREAM_CHANGEEVNT; break; + case SCTP_SEND_FAILED_EVENT: + event_type = SCTP_PCB_FLAGS_RECVNSENDFAILEVNT; + break; default: event_type = 0; SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -5412,6 +5415,9 @@ sctp_setopt(struct socket *so, int optna case SCTP_STREAM_CHANGE_EVENT: event_type = SCTP_PCB_FLAGS_STREAM_CHANGEEVNT; break; + case SCTP_SEND_FAILED_EVENT: + event_type = SCTP_PCB_FLAGS_RECVNSENDFAILEVNT; + break; default: event_type = 0; SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 6 08:31:57 2012 (r235074) +++ head/sys/netinet/sctputil.c Sun May 6 11:02:53 2012 (r235075) @@ -2798,39 +2798,66 @@ sctp_notify_send_failed(struct sctp_tcb { struct mbuf *m_notify; struct sctp_send_failed *ssf; + struct sctp_send_failed_event *ssfe; struct sctp_queued_to_read *control; int length; if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT)) { + (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT) && + sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT))) { /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_send_failed), 0, M_DONTWAIT, 1, MT_DATA); + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { + length = sizeof(struct sctp_send_failed_event); + } else { + length = sizeof(struct sctp_send_failed); + } + m_notify = sctp_get_mbuf_for_msg(length, 0, M_DONTWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; - length = sizeof(struct sctp_send_failed) + chk->send_size; + length += chk->send_size; length -= sizeof(struct sctp_data_chunk); SCTP_BUF_LEN(m_notify) = 0; - ssf = mtod(m_notify, struct sctp_send_failed *); - ssf->ssf_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssf->ssf_flags = SCTP_DATA_UNSENT; - else - ssf->ssf_flags = SCTP_DATA_SENT; - ssf->ssf_length = length; - ssf->ssf_error = error; - /* not exactly what the user sent in, but should be close :) */ - bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); - ssf->ssf_info.sinfo_stream = chk->rec.data.stream_number; - ssf->ssf_info.sinfo_ssn = chk->rec.data.stream_seq; - ssf->ssf_info.sinfo_flags = chk->rec.data.rcv_flags; - ssf->ssf_info.sinfo_ppid = chk->rec.data.payloadtype; - ssf->ssf_info.sinfo_context = chk->rec.data.context; - ssf->ssf_info.sinfo_assoc_id = sctp_get_associd(stcb); - ssf->ssf_assoc_id = sctp_get_associd(stcb); - + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { + ssfe = mtod(m_notify, struct sctp_send_failed_event *); + ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; + if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) + ssfe->ssfe_flags = SCTP_DATA_UNSENT; + else + ssfe->ssfe_flags = SCTP_DATA_SENT; + ssfe->ssfe_length = length; + ssfe->ssfe_error = error; + /* not exactly what the user sent in, but should be close :) */ + bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info)); + ssfe->ssfe_info.snd_sid = chk->rec.data.stream_number; + ssfe->ssfe_info.snd_flags = chk->rec.data.rcv_flags; + ssfe->ssfe_info.snd_ppid = chk->rec.data.payloadtype; + ssfe->ssfe_info.snd_context = chk->rec.data.context; + ssfe->ssfe_info.snd_assoc_id = sctp_get_associd(stcb); + ssfe->ssfe_assoc_id = sctp_get_associd(stcb); + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event); + } else { + ssf = mtod(m_notify, struct sctp_send_failed *); + ssf->ssf_type = SCTP_SEND_FAILED; + if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) + ssf->ssf_flags = SCTP_DATA_UNSENT; + else + ssf->ssf_flags = SCTP_DATA_SENT; + ssf->ssf_length = length; + ssf->ssf_error = error; + /* not exactly what the user sent in, but should be close :) */ + bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); + ssf->ssf_info.sinfo_stream = chk->rec.data.stream_number; + ssf->ssf_info.sinfo_ssn = chk->rec.data.stream_seq; + ssf->ssf_info.sinfo_flags = chk->rec.data.rcv_flags; + ssf->ssf_info.sinfo_ppid = chk->rec.data.payloadtype; + ssf->ssf_info.sinfo_context = chk->rec.data.context; + ssf->ssf_info.sinfo_assoc_id = sctp_get_associd(stcb); + ssf->ssf_assoc_id = sctp_get_associd(stcb); + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed); + } if (chk->data) { /* * trim off the sctp chunk header(it should be there) @@ -2842,7 +2869,6 @@ sctp_notify_send_failed(struct sctp_tcb } } SCTP_BUF_NEXT(m_notify) = chk->data; - SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed); /* Steal off the mbuf */ chk->data = NULL; /* @@ -2882,43 +2908,75 @@ sctp_notify_send_failed2(struct sctp_tcb { struct mbuf *m_notify; struct sctp_send_failed *ssf; + struct sctp_send_failed_event *ssfe; struct sctp_queued_to_read *control; int length; if ((stcb == NULL) || - sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT)) { + (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT) && + sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT))) { /* event not enabled */ return; } - length = sizeof(struct sctp_send_failed) + sp->length; - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_send_failed), 0, M_DONTWAIT, 1, MT_DATA); - if (m_notify == NULL) + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { + length = sizeof(struct sctp_send_failed_event); + } else { + length = sizeof(struct sctp_send_failed); + } + m_notify = sctp_get_mbuf_for_msg(length, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { /* no space left */ return; + } + length += sp->length; SCTP_BUF_LEN(m_notify) = 0; - ssf = mtod(m_notify, struct sctp_send_failed *); - ssf->ssf_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssf->ssf_flags = SCTP_DATA_UNSENT; - else - ssf->ssf_flags = SCTP_DATA_SENT; - ssf->ssf_length = length; - ssf->ssf_error = error; - /* not exactly what the user sent in, but should be close :) */ - bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); - ssf->ssf_info.sinfo_stream = sp->stream; - ssf->ssf_info.sinfo_ssn = sp->strseq; - if (sp->some_taken) { - ssf->ssf_info.sinfo_flags = SCTP_DATA_LAST_FRAG; + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { + ssfe = mtod(m_notify, struct sctp_send_failed_event *); + ssfe->ssfe_type = SCTP_SEND_FAILED; + if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) + ssfe->ssfe_flags = SCTP_DATA_UNSENT; + else + ssfe->ssfe_flags = SCTP_DATA_SENT; + ssfe->ssfe_length = length; + ssfe->ssfe_error = error; + /* not exactly what the user sent in, but should be close :) */ + bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info)); + ssfe->ssfe_info.snd_sid = sp->stream; + if (sp->some_taken) { + ssfe->ssfe_info.snd_flags = SCTP_DATA_LAST_FRAG; + } else { + ssfe->ssfe_info.snd_flags = SCTP_DATA_NOT_FRAG; + } + ssfe->ssfe_info.snd_ppid = sp->ppid; + ssfe->ssfe_info.snd_context = sp->context; + ssfe->ssfe_info.snd_assoc_id = sctp_get_associd(stcb); + ssfe->ssfe_assoc_id = sctp_get_associd(stcb); + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event); } else { - ssf->ssf_info.sinfo_flags = SCTP_DATA_NOT_FRAG; + ssf = mtod(m_notify, struct sctp_send_failed *); + ssf->ssf_type = SCTP_SEND_FAILED; + if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) + ssf->ssf_flags = SCTP_DATA_UNSENT; + else + ssf->ssf_flags = SCTP_DATA_SENT; + ssf->ssf_length = length; + ssf->ssf_error = error; + /* not exactly what the user sent in, but should be close :) */ + bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); + ssf->ssf_info.sinfo_stream = sp->stream; + ssf->ssf_info.sinfo_ssn = sp->strseq; + if (sp->some_taken) { + ssf->ssf_info.sinfo_flags = SCTP_DATA_LAST_FRAG; + } else { + ssf->ssf_info.sinfo_flags = SCTP_DATA_NOT_FRAG; + } + ssf->ssf_info.sinfo_ppid = sp->ppid; + ssf->ssf_info.sinfo_context = sp->context; + ssf->ssf_info.sinfo_assoc_id = sctp_get_associd(stcb); + ssf->ssf_assoc_id = sctp_get_associd(stcb); + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed); } - ssf->ssf_info.sinfo_ppid = sp->ppid; - ssf->ssf_info.sinfo_context = sp->context; - ssf->ssf_info.sinfo_assoc_id = sctp_get_associd(stcb); - ssf->ssf_assoc_id = sctp_get_associd(stcb); SCTP_BUF_NEXT(m_notify) = sp->data; - SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed); /* Steal off the mbuf */ sp->data = NULL; From owner-svn-src-all@FreeBSD.ORG Sun May 6 11:32:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FDD01065670; Sun, 6 May 2012 11:32:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 496D28FC08; Sun, 6 May 2012 11:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46BWbtf012112; Sun, 6 May 2012 11:32:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46BWbVq012106; Sun, 6 May 2012 11:32:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205061132.q46BWbVq012106@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 11:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235076 - in head: sbin/geom/class/raid sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 11:32:37 -0000 Author: mav Date: Sun May 6 11:32:36 2012 New Revision: 235076 URL: http://svn.freebsd.org/changeset/base/235076 Log: Add support for RAID5R. Slightly improve support for RAIDMDF. Modified: head/sbin/geom/class/raid/graid.8 head/sys/geom/raid/g_raid.c head/sys/geom/raid/g_raid.h head/sys/geom/raid/md_ddf.c head/sys/geom/raid/tr_raid5.c Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Sun May 6 11:02:53 2012 (r235075) +++ head/sbin/geom/class/raid/graid.8 Sun May 6 11:32:36 2012 (r235076) @@ -215,7 +215,7 @@ volumes per array, partitions per disk, The following configurations are supported: RAID0 (2+ disks), RAID1 (2+ disks), RAID1E (3+ disks), RAID3 (3+ disks), RAID4 (3+ disks), RAID5 (3+ disks), RAID5E (4+ disks), RAID5EE (4+ disks), RAID5R (3+ disks), RAID6 (4+ disks), -RAIDMDF (5+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks). +RAIDMDF (4+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks). .Pp Format supports two options "BE" and "LE", that mean big-endian byte order defined by specification (default) and little-endian used by some Adaptec @@ -264,8 +264,8 @@ to be used. Full support for the following RAID levels is currently implemented: RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. The following RAID levels supported as read-only for volumes in optimal -state (without using redundancy): RAID4, RAID5, RAID5E, RAID5EE, RAID6, -RAIDMDF. +state (without using redundancy): RAID4, RAID5, RAID5E, RAID5EE, RAID5R, +RAID6, RAIDMDF. .Sh RAID LEVEL MIGRATION The GEOM RAID class has no support for RAID level migration, allowed by some metadata formats. Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sun May 6 11:02:53 2012 (r235075) +++ head/sys/geom/raid/g_raid.c Sun May 6 11:32:36 2012 (r235076) @@ -1856,6 +1856,7 @@ g_raid_create_volume(struct g_raid_softc vol->v_state = G_RAID_VOLUME_S_STARTING; vol->v_raid_level = G_RAID_VOLUME_RL_UNKNOWN; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_UNKNOWN; + vol->v_rotate_parity = 1; bioq_init(&vol->v_inflight); bioq_init(&vol->v_locked); LIST_INIT(&vol->v_locks); Modified: head/sys/geom/raid/g_raid.h ============================================================================== --- head/sys/geom/raid/g_raid.h Sun May 6 11:02:53 2012 (r235075) +++ head/sys/geom/raid/g_raid.h Sun May 6 11:32:36 2012 (r235076) @@ -278,7 +278,13 @@ struct g_raid_volume { u_int v_raid_level; /* Array RAID level. */ u_int v_raid_level_qualifier; /* RAID level det. */ u_int v_disks_count; /* Number of disks in array. */ + u_int v_mdf_pdisks; /* Number of parity disks + in RAIDMDF array. */ + uint16_t v_mdf_polynomial; /* Polynomial for RAIDMDF. */ + uint8_t v_mdf_method; /* Generation method for RAIDMDF. */ u_int v_strip_size; /* Array strip size. */ + u_int v_rotate_parity; /* Rotate RAID5R parity + after numer of stripes. */ u_int v_sectorsize; /* Volume sector size. */ off_t v_mediasize; /* Volume media size. */ struct bio_queue_head v_inflight; /* In-flight write requests. */ Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Sun May 6 11:02:53 2012 (r235075) +++ head/sys/geom/raid/md_ddf.c Sun May 6 11:32:36 2012 (r235076) @@ -1517,7 +1517,7 @@ g_raid_md_ddf_supported(int level, int q qual != G_RAID_VOLUME_RLQ_RMDFLA && qual != G_RAID_VOLUME_RLQ_RMDFLS) return (0); - if (disks < 5) + if (disks < 4) return (0); break; case G_RAID_VOLUME_RL_RAID1E: @@ -1850,6 +1850,13 @@ g_raid_md_ddf_start(struct g_raid_volume vol->v_strip_size = vol->v_sectorsize << GET8(vmeta, vdc->Stripe_Size); vol->v_disks_count = GET16(vmeta, vdc->Primary_Element_Count) * GET8(vmeta, vdc->Secondary_Element_Count); + vol->v_mdf_pdisks = GET8(vmeta, vdc->MDF_Parity_Disks); + vol->v_mdf_polynomial = GET16(vmeta, vdc->MDF_Parity_Generator_Polynomial); + vol->v_mdf_method = GET8(vmeta, vdc->MDF_Constant_Generation_Method); + if (GET8(vmeta, vdc->Rotate_Parity_count) > 31) + vol->v_rotate_parity = 1; + else + vol->v_rotate_parity = 1 << GET8(vmeta, vdc->Rotate_Parity_count); vol->v_mediasize = GET64(vmeta, vdc->VD_Size) * vol->v_sectorsize; for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { if (j == GET16(vmeta, vdc->Primary_Element_Count)) { @@ -2430,16 +2437,24 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec vol->v_mediasize = size; else if (level == G_RAID_VOLUME_RL_RAID3 || level == G_RAID_VOLUME_RL_RAID4 || - level == G_RAID_VOLUME_RL_RAID5 || - level == G_RAID_VOLUME_RL_RAID5R) + level == G_RAID_VOLUME_RL_RAID5) vol->v_mediasize = size * (numdisks - 1); - else if (level == G_RAID_VOLUME_RL_RAID6 || + else if (level == G_RAID_VOLUME_RL_RAID5R) { + vol->v_mediasize = size * (numdisks - 1); + vol->v_rotate_parity = 1024; + } else if (level == G_RAID_VOLUME_RL_RAID6 || level == G_RAID_VOLUME_RL_RAID5E || level == G_RAID_VOLUME_RL_RAID5EE) vol->v_mediasize = size * (numdisks - 2); - else if (level == G_RAID_VOLUME_RL_RAIDMDF) - vol->v_mediasize = size * (numdisks - 3); - else { /* RAID1E */ + else if (level == G_RAID_VOLUME_RL_RAIDMDF) { + if (numdisks < 5) + vol->v_mdf_pdisks = 2; + else + vol->v_mdf_pdisks = 3; + vol->v_mdf_polynomial = 0x11d; + vol->v_mdf_method = 0x00; + vol->v_mediasize = size * (numdisks - vol->v_mdf_pdisks); + } else { /* RAID1E */ vol->v_mediasize = ((size * numdisks) / strip / 2) * strip; } @@ -2761,6 +2776,13 @@ g_raid_md_write_ddf(struct g_raid_md_obj SET64(vmeta, vdc->Block_Count, 0); SET64(vmeta, vdc->VD_Size, vol->v_mediasize / vol->v_sectorsize); SET16(vmeta, vdc->Block_Size, vol->v_sectorsize); + SET8(vmeta, vdc->Rotate_Parity_count, + fls(vol->v_rotate_parity) - 1); + SET8(vmeta, vdc->MDF_Parity_Disks, vol->v_mdf_pdisks); + SET16(vmeta, vdc->MDF_Parity_Generator_Polynomial, + vol->v_mdf_polynomial); + SET8(vmeta, vdc->MDF_Constant_Generation_Method, + vol->v_mdf_method); SET16(vmeta, vde->VD_Number, vol->v_global_id); if (vol->v_state <= G_RAID_VOLUME_S_BROKEN) Modified: head/sys/geom/raid/tr_raid5.c ============================================================================== --- head/sys/geom/raid/tr_raid5.c Sun May 6 11:02:53 2012 (r235075) +++ head/sys/geom/raid/tr_raid5.c Sun May 6 11:32:36 2012 (r235076) @@ -112,10 +112,11 @@ g_raid_tr_taste_raid5(struct g_raid_tr_o } else if ((tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5 || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5E || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5EE || + tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5R || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID6 || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAIDMDF) && qual >= 0 && qual <= 3) { - /* RAID5/5E/5EE/6/MDF */ + /* RAID5/5E/5EE/5R/6/MDF */ } else return (G_RAID_TR_TASTE_FAIL); trs->trso_starting = 1; @@ -210,7 +211,7 @@ g_raid_tr_iostart_raid5_read(struct g_ra struct bio *cbp; char *addr; off_t offset, start, length, nstripe, remain; - int no, pno, ddisks, pdisks; + int no, pno, ddisks, pdisks, protate, pleft; u_int strip_size, lvl, qual; vol = tr->tro_volume; @@ -218,6 +219,7 @@ g_raid_tr_iostart_raid5_read(struct g_ra strip_size = vol->v_strip_size; lvl = tr->tro_volume->v_raid_level; qual = tr->tro_volume->v_raid_level_qualifier; + protate = tr->tro_volume->v_rotate_parity; /* Stripe number. */ nstripe = bp->bio_offset / strip_size; @@ -225,7 +227,7 @@ g_raid_tr_iostart_raid5_read(struct g_ra start = bp->bio_offset % strip_size; /* Number of data and parity disks. */ if (lvl == G_RAID_VOLUME_RL_RAIDMDF) - pdisks = 3; + pdisks = tr->tro_volume->v_mdf_pdisks; else if (lvl == G_RAID_VOLUME_RL_RAID5EE || lvl == G_RAID_VOLUME_RL_RAID6) pdisks = 2; @@ -238,8 +240,10 @@ g_raid_tr_iostart_raid5_read(struct g_ra pno = 0; else /* PN */ pno = ddisks; + pleft = -1; } else { - pno = (nstripe / ddisks) % vol->v_disks_count; + pno = (nstripe / (ddisks * protate)) % vol->v_disks_count; + pleft = protate - (nstripe / ddisks) % protate; if (qual >= 2) { /* PN/Left */ pno = ddisks - pno; if (pno < 0) @@ -281,11 +285,14 @@ g_raid_tr_iostart_raid5_read(struct g_ra } else if (qual & 1) { /* Continuation/Symmetric */ no %= vol->v_disks_count; if (no == pno) { - if (qual < 2) /* P0/Right */ - pno++; - else /* PN/Left */ - pno += vol->v_disks_count - 1; - pno %= vol->v_disks_count; + if ((--pleft) <= 0) { + pleft += protate; + if (qual < 2) /* P0/Right */ + pno++; + else /* PN/Left */ + pno += vol->v_disks_count - 1; + pno %= vol->v_disks_count; + } no = (pno + pdisks) % vol->v_disks_count; offset += strip_size; } @@ -294,11 +301,14 @@ g_raid_tr_iostart_raid5_read(struct g_ra no += pdisks; if (no >= vol->v_disks_count) { no -= vol->v_disks_count; - if (qual < 2) /* P0/Right */ - pno++; - else /* PN/Left */ - pno += vol->v_disks_count - 1; - pno %= vol->v_disks_count; + if ((--pleft) <= 0) { + pleft += protate; + if (qual < 2) /* P0/Right */ + pno++; + else /* PN/Left */ + pno += vol->v_disks_count - 1; + pno %= vol->v_disks_count; + } if (no == pno) no += pdisks; else From owner-svn-src-all@FreeBSD.ORG Sun May 6 11:37:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 722CE1065673; Sun, 6 May 2012 11:37:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D5C8FC1C; Sun, 6 May 2012 11:37:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46BbgWT012305; Sun, 6 May 2012 11:37:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46Bbgkq012300; Sun, 6 May 2012 11:37:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205061137.q46Bbgkq012300@svn.freebsd.org> From: Michael Tuexen Date: Sun, 6 May 2012 11:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235077 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 11:37:42 -0000 Author: tuexen Date: Sun May 6 11:37:41 2012 New Revision: 235077 URL: http://svn.freebsd.org/changeset/base/235077 Log: Remove debug code. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 6 11:32:36 2012 (r235076) +++ head/sys/netinet/sctp_input.c Sun May 6 11:37:41 2012 (r235077) @@ -785,15 +785,6 @@ sctp_handle_abort(struct sctp_abort_chun /* notify user of the abort and clean up... */ sctp_abort_notification(stcb, 0, SCTP_SO_NOT_LOCKED); /* free the tcb */ -#if defined(SCTP_PANIC_ON_ABORT) - SCTP_PRINTF("stcb:%p state:%d rport:%d net:%p\n", - stcb, stcb->asoc.state, stcb->rport, net); - if (!(stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { - panic("Received an ABORT"); - } else { - SCTP_PRINTF("No panic its in state %x closed\n", stcb->asoc.state); - } -#endif SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun May 6 11:32:36 2012 (r235076) +++ head/sys/netinet/sctp_pcb.c Sun May 6 11:37:41 2012 (r235077) @@ -3426,9 +3426,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_3); } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_3; -#if defined(SCTP_PANIC_ON_ABORT) - panic("inpcb_free does an abort"); -#endif sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || @@ -3520,10 +3517,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_5); } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_5; -#if defined(SCTP_PANIC_ON_ABORT) - panic("inpcb_free does an abort"); -#endif - sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || @@ -3604,9 +3597,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_7; -#if defined(SCTP_PANIC_ON_ABORT) - panic("inpcb_free does an abort"); -#endif sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); } else if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 6 11:32:36 2012 (r235076) +++ head/sys/netinet/sctp_usrreq.c Sun May 6 11:37:41 2012 (r235077) @@ -780,9 +780,6 @@ sctp_disconnect(struct socket *so) ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(err)); } -#if defined(SCTP_PANIC_ON_ABORT) - panic("disconnect does an abort"); -#endif sctp_send_abort_tcb(stcb, err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); } @@ -888,10 +885,6 @@ sctp_disconnect(struct socket *so) ippp = (uint32_t *) (ph + 1); *ippp = htonl(SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4); } -#if defined(SCTP_PANIC_ON_ABORT) - panic("disconnect does an abort"); -#endif - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4; sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); @@ -1103,9 +1096,6 @@ sctp_shutdown(struct socket *so) ippp = (uint32_t *) (ph + 1); *ippp = htonl(SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6); } -#if defined(SCTP_PANIC_ON_ABORT) - panic("shutdown does an abort"); -#endif stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_RESPONSE_TO_USER_REQ, Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 6 11:32:36 2012 (r235076) +++ head/sys/netinet/sctputil.c Sun May 6 11:37:41 2012 (r235077) @@ -3881,9 +3881,6 @@ sctp_abort_an_association(struct sctp_in if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) sctp_abort_notification(stcb, error, so_locked); /* notify the peer */ -#if defined(SCTP_PANIC_ON_ABORT) - panic("aborting an association"); -#endif sctp_send_abort_tcb(stcb, op_err, so_locked); SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || From owner-svn-src-all@FreeBSD.ORG Sun May 6 11:41:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9A2A106566B; Sun, 6 May 2012 11:41:00 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CDE8FC1B; Sun, 6 May 2012 11:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46Bf0mL012444; Sun, 6 May 2012 11:41:00 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46Bf0F8012442; Sun, 6 May 2012 11:41:00 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201205061141.q46Bf0F8012442@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 6 May 2012 11:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235078 - head/sys/modules/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 11:41:01 -0000 Author: uqs Date: Sun May 6 11:41:00 2012 New Revision: 235078 URL: http://svn.freebsd.org/changeset/base/235078 Log: Fix make depend Modified: head/sys/modules/linux/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Sun May 6 11:37:41 2012 (r235077) +++ head/sys/modules/linux/Makefile Sun May 6 11:41:00 2012 (r235078) @@ -13,8 +13,8 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ - opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ - device_if.h bus_if.h assym.s + opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \ + vnode_if.h device_if.h bus_if.h assym.s # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h From owner-svn-src-all@FreeBSD.ORG Sun May 6 11:48:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E010106566C; Sun, 6 May 2012 11:48:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDAB28FC0A; Sun, 6 May 2012 11:48:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46BmbFG012708; Sun, 6 May 2012 11:48:37 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46BmbNZ012706; Sun, 6 May 2012 11:48:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205061148.q46BmbNZ012706@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 6 May 2012 11:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235079 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 11:48:38 -0000 Author: trasz Date: Sun May 6 11:48:37 2012 New Revision: 235079 URL: http://svn.freebsd.org/changeset/base/235079 Log: Fix offset calculation to actually rewrite the _last_ block. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sun May 6 11:41:00 2012 (r235078) +++ head/sbin/growfs/growfs.c Sun May 6 11:48:37 2012 (r235079) @@ -1567,9 +1567,9 @@ main(int argc, char **argv) testbuf = malloc(sblock.fs_fsize); if (testbuf == NULL) err(1, "malloc"); - rdfs((ufs2_daddr_t)((size / DEV_BSIZE) - sblock.fs_fsize), + rdfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), sblock.fs_fsize, testbuf, fsi); - wtfs((ufs2_daddr_t)((size / DEV_BSIZE) - sblock.fs_fsize), + wtfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), sblock.fs_fsize, testbuf, fso, Nflag); free(testbuf); From owner-svn-src-all@FreeBSD.ORG Sun May 6 12:55:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3599D106564A; Sun, 6 May 2012 12:55:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20ECA8FC0A; Sun, 6 May 2012 12:55:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46CtKVs014826; Sun, 6 May 2012 12:55:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46CtKl7014823; Sun, 6 May 2012 12:55:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205061255.q46CtKl7014823@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 12:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235080 - head/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 12:55:21 -0000 Author: mav Date: Sun May 6 12:55:20 2012 New Revision: 235080 URL: http://svn.freebsd.org/changeset/base/235080 Log: Plug small memory leaks. Modified: head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_promise.c Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Sun May 6 11:48:37 2012 (r235079) +++ head/sys/geom/raid/md_ddf.c Sun May 6 12:55:20 2012 (r235080) @@ -1228,7 +1228,7 @@ hdrerror: } done: - free(abuf, M_MD_DDF); + g_free(abuf); if (error != 0) ddf_meta_free(meta); return (error); @@ -3039,6 +3039,8 @@ g_raid_md_free_volume_ddf(struct g_raid_ mdi->mdio_starting--; callout_stop(&pv->pv_start_co); } + free(pv, M_MD_DDF); + vol->v_md_data = NULL; return (0); } Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Sun May 6 11:48:37 2012 (r235079) +++ head/sys/geom/raid/md_promise.c Sun May 6 12:55:20 2012 (r235080) @@ -1955,6 +1955,8 @@ g_raid_md_free_volume_promise(struct g_r pv->pv_started = 1; callout_stop(&pv->pv_start_co); } + free(pv, M_MD_PROMISE); + vol->v_md_data = NULL; return (0); } From owner-svn-src-all@FreeBSD.ORG Sun May 6 13:09:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B2C106566C; Sun, 6 May 2012 13:09:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE3DE8FC16; Sun, 6 May 2012 13:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46D9Dnw015281; Sun, 6 May 2012 13:09:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46D9DCm015278; Sun, 6 May 2012 13:09:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205061309.q46D9DCm015278@svn.freebsd.org> From: Michael Tuexen Date: Sun, 6 May 2012 13:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235081 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 13:09:14 -0000 Author: tuexen Date: Sun May 6 13:09:13 2012 New Revision: 235081 URL: http://svn.freebsd.org/changeset/base/235081 Log: Add support for the sac_info field in struct sctp_assoc_change as required by RFC 6458. MFC after: 3 days Modified: head/sys/netinet/sctp_uio.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Sun May 6 12:55:20 2012 (r235080) +++ head/sys/netinet/sctp_uio.h Sun May 6 13:09:13 2012 (r235081) @@ -296,16 +296,23 @@ struct sctp_assoc_change { uint16_t sac_outbound_streams; uint16_t sac_inbound_streams; sctp_assoc_t sac_assoc_id; + uint8_t sac_info[]; }; /* sac_state values */ -#define SCTP_COMM_UP 0x0001 -#define SCTP_COMM_LOST 0x0002 -#define SCTP_RESTART 0x0003 -#define SCTP_SHUTDOWN_COMP 0x0004 -#define SCTP_CANT_STR_ASSOC 0x0005 - - +#define SCTP_COMM_UP 0x0001 +#define SCTP_COMM_LOST 0x0002 +#define SCTP_RESTART 0x0003 +#define SCTP_SHUTDOWN_COMP 0x0004 +#define SCTP_CANT_STR_ASSOC 0x0005 + +/* sac_info values */ +#define SCTP_ASSOC_SUPPORTS_PR 0x01 +#define SCTP_ASSOC_SUPPORTS_AUTH 0x02 +#define SCTP_ASSOC_SUPPORTS_ASCONF 0x03 +#define SCTP_ASSOC_SUPPORTS_MULTIBUF 0x04 +#define SCTP_ASSOC_SUPPORTS_RE_CONFIG 0x05 +#define SCTP_ASSOC_SUPPORTS_MAX 0x05 /* * Address event */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 6 12:55:20 2012 (r235080) +++ head/sys/netinet/sctputil.c Sun May 6 13:09:13 2012 (r235081) @@ -2602,6 +2602,7 @@ sctp_notify_assoc_change(uint32_t event, struct mbuf *m_notify; struct sctp_assoc_change *sac; struct sctp_queued_to_read *control; + unsigned int i; #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -2666,7 +2667,22 @@ sctp_notify_assoc_change(uint32_t event, sac->sac_outbound_streams = stcb->asoc.streamoutcnt; sac->sac_inbound_streams = stcb->asoc.streamincnt; sac->sac_assoc_id = sctp_get_associd(stcb); - SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_change); + i = 0; + if (stcb->asoc.peer_supports_prsctp) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; + } + if (stcb->asoc.peer_supports_auth) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; + } + if (stcb->asoc.peer_supports_asconf) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; + } + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; + if (stcb->asoc.peer_supports_strreset) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; + } + sac->sac_length += i; + SCTP_BUF_LEN(m_notify) = sac->sac_length; SCTP_BUF_NEXT(m_notify) = NULL; control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, 0, 0, stcb->asoc.context, 0, 0, 0, From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:10:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24B171065675; Sun, 6 May 2012 14:10:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 103308FC1A; Sun, 6 May 2012 14:10:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EAuhE017195; Sun, 6 May 2012 14:10:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EAuUx017192; Sun, 6 May 2012 14:10:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061410.q46EAuUx017192@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235082 - stable/9/lib/libc/gmon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:10:57 -0000 Author: eadler Date: Sun May 6 14:10:56 2012 New Revision: 235082 URL: http://svn.freebsd.org/changeset/base/235082 Log: MFC r234819: Allow users of gprof to get per run output files (using the pid) PR: bin/99800 Approved by: cperciva (implicit) Modified: stable/9/lib/libc/gmon/gmon.c stable/9/lib/libc/gmon/moncontrol.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gmon/gmon.c ============================================================================== --- stable/9/lib/libc/gmon/gmon.c Sun May 6 13:09:13 2012 (r235081) +++ stable/9/lib/libc/gmon/gmon.c Sun May 6 14:10:56 2012 (r235082) @@ -157,7 +157,12 @@ _mcleanup(void) } moncontrol(0); - snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); + if (getenv("PROFIL_USE_PID")) + snprintf(outname, sizeof(outname), "%s.%d.gmon", + _getprogname(), getpid()); + else + snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); + fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666); if (fd < 0) { _warn("_mcleanup: %s", outname); Modified: stable/9/lib/libc/gmon/moncontrol.3 ============================================================================== --- stable/9/lib/libc/gmon/moncontrol.3 Sun May 6 13:09:13 2012 (r235081) +++ stable/9/lib/libc/gmon/moncontrol.3 Sun May 6 14:10:56 2012 (r235082) @@ -98,6 +98,12 @@ however, all functions in that address r have their execution time measured. Profiling begins on return from .Fn monstartup . +.Sh ENVIRONMENT +The following environment variables affect the execution of +.Nm : +.Bl -tag -width ".Ev PROFIL_USE_PID" +.It PROFIL_USE_PID +If set, the pid of the process is inserted into the filename. .Sh FILES .Bl -tag -width progname.gmon -compact .It Pa progname.gmon From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:11:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB6E510656D1; Sun, 6 May 2012 14:11:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C61588FC2C; Sun, 6 May 2012 14:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EBPDG017254; Sun, 6 May 2012 14:11:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EBP4J017251; Sun, 6 May 2012 14:11:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061411.q46EBP4J017251@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235083 - stable/7/lib/libc/gmon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:11:26 -0000 Author: eadler Date: Sun May 6 14:11:25 2012 New Revision: 235083 URL: http://svn.freebsd.org/changeset/base/235083 Log: MFC r234819: Allow users of gprof to get per run output files (using the pid) PR: bin/99800 Approved by: cperciva (implicit) Modified: stable/7/lib/libc/gmon/gmon.c stable/7/lib/libc/gmon/moncontrol.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/gmon/gmon.c ============================================================================== --- stable/7/lib/libc/gmon/gmon.c Sun May 6 14:10:56 2012 (r235082) +++ stable/7/lib/libc/gmon/gmon.c Sun May 6 14:11:25 2012 (r235083) @@ -170,7 +170,12 @@ _mcleanup() } moncontrol(0); - snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); + if (getenv("PROFIL_USE_PID")) + snprintf(outname, sizeof(outname), "%s.%d.gmon", + _getprogname(), getpid()); + else + snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); + fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666); if (fd < 0) { _warn("_mcleanup: %s", outname); Modified: stable/7/lib/libc/gmon/moncontrol.3 ============================================================================== --- stable/7/lib/libc/gmon/moncontrol.3 Sun May 6 14:10:56 2012 (r235082) +++ stable/7/lib/libc/gmon/moncontrol.3 Sun May 6 14:11:25 2012 (r235083) @@ -98,6 +98,12 @@ however, all functions in that address r have their execution time measured. Profiling begins on return from .Fn monstartup . +.Sh ENVIRONMENT +The following environment variables affect the execution of +.Nm : +.Bl -tag -width ".Ev PROFIL_USE_PID" +.It PROFIL_USE_PID +If set, the pid of the process is inserted into the filename. .Sh FILES .Bl -tag -width progname.gmon -compact .It Pa progname.gmon From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:11:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C899B1065670; Sun, 6 May 2012 14:11:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2B818FC0C; Sun, 6 May 2012 14:11:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EBpVd017301; Sun, 6 May 2012 14:11:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EBpCD017298; Sun, 6 May 2012 14:11:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061411.q46EBpCD017298@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235084 - stable/8/lib/libc/gmon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:11:51 -0000 Author: eadler Date: Sun May 6 14:11:51 2012 New Revision: 235084 URL: http://svn.freebsd.org/changeset/base/235084 Log: MFC r234819: Allow users of gprof to get per run output files (using the pid) PR: bin/99800 Approved by: cperciva (implicit) Modified: stable/8/lib/libc/gmon/gmon.c stable/8/lib/libc/gmon/moncontrol.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gmon/gmon.c ============================================================================== --- stable/8/lib/libc/gmon/gmon.c Sun May 6 14:11:25 2012 (r235083) +++ stable/8/lib/libc/gmon/gmon.c Sun May 6 14:11:51 2012 (r235084) @@ -170,7 +170,12 @@ _mcleanup() } moncontrol(0); - snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); + if (getenv("PROFIL_USE_PID")) + snprintf(outname, sizeof(outname), "%s.%d.gmon", + _getprogname(), getpid()); + else + snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); + fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666); if (fd < 0) { _warn("_mcleanup: %s", outname); Modified: stable/8/lib/libc/gmon/moncontrol.3 ============================================================================== --- stable/8/lib/libc/gmon/moncontrol.3 Sun May 6 14:11:25 2012 (r235083) +++ stable/8/lib/libc/gmon/moncontrol.3 Sun May 6 14:11:51 2012 (r235084) @@ -98,6 +98,12 @@ however, all functions in that address r have their execution time measured. Profiling begins on return from .Fn monstartup . +.Sh ENVIRONMENT +The following environment variables affect the execution of +.Nm : +.Bl -tag -width ".Ev PROFIL_USE_PID" +.It PROFIL_USE_PID +If set, the pid of the process is inserted into the filename. .Sh FILES .Bl -tag -width progname.gmon -compact .It Pa progname.gmon From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:15:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7933D106564A; Sun, 6 May 2012 14:15:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644E38FC08; Sun, 6 May 2012 14:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EFXYm017459; Sun, 6 May 2012 14:15:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EFXlg017457; Sun, 6 May 2012 14:15:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061415.q46EFXlg017457@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235085 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:15:33 -0000 Author: eadler Date: Sun May 6 14:15:32 2012 New Revision: 235085 URL: http://svn.freebsd.org/changeset/base/235085 Log: MFC r234821: Add support for: Olympus FE-210 camera LG UP3S MP3 player Laser MP3-2GA13 MP3 PR: usb/119201 Approved by: cperciva (implicit) Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sun May 6 14:11:51 2012 (r235084) +++ stable/9/sys/cam/scsi/scsi_da.c Sun May 6 14:15:32 2012 (r235085) @@ -787,6 +787,27 @@ static struct da_quirk_entry da_quirk_ta { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "???PVT*", "*" }, /*quirks*/DA_Q_4K }, + { + /* + * Olympus FE-210 camera + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * LG UP3S MP3 player + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "LG", "UP3S", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Laser MP3-2GA13 MP3 player + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "USB 2.0", "(HS) Flash Disk", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:15:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4296B106599A; Sun, 6 May 2012 14:15:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD648FC15; Sun, 6 May 2012 14:15:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EFrTD017500; Sun, 6 May 2012 14:15:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EFqCZ017498; Sun, 6 May 2012 14:15:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061415.q46EFqCZ017498@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235086 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:15:53 -0000 Author: eadler Date: Sun May 6 14:15:52 2012 New Revision: 235086 URL: http://svn.freebsd.org/changeset/base/235086 Log: MFC r234821: Add support for: Olympus FE-210 camera LG UP3S MP3 player Laser MP3-2GA13 MP3 PR: usb/119201 Approved by: cperciva (implicit) Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sun May 6 14:15:32 2012 (r235085) +++ stable/8/sys/cam/scsi/scsi_da.c Sun May 6 14:15:52 2012 (r235086) @@ -785,6 +785,27 @@ static struct da_quirk_entry da_quirk_ta { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "???PVT*", "*" }, /*quirks*/DA_Q_4K }, + { + /* + * Olympus FE-210 camera + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * LG UP3S MP3 player + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "LG", "UP3S", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Laser MP3-2GA13 MP3 player + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "USB 2.0", "(HS) Flash Disk", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:16:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 074AB10656D9; Sun, 6 May 2012 14:16:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E67268FC12; Sun, 6 May 2012 14:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EGId4017551; Sun, 6 May 2012 14:16:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EGIom017549; Sun, 6 May 2012 14:16:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061416.q46EGIom017549@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235087 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:16:19 -0000 Author: eadler Date: Sun May 6 14:16:18 2012 New Revision: 235087 URL: http://svn.freebsd.org/changeset/base/235087 Log: MFC r234821: Add support for: Olympus FE-210 camera LG UP3S MP3 player Laser MP3-2GA13 MP3 PR: usb/119201 Approved by: cperciva (implicit) Modified: stable/7/sys/cam/scsi/scsi_da.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_da.c Sun May 6 14:15:52 2012 (r235086) +++ stable/7/sys/cam/scsi/scsi_da.c Sun May 6 14:16:18 2012 (r235087) @@ -555,6 +555,27 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "Netac", "OnlyDisk*", "2000"}, /*quirks*/ DA_Q_NO_SYNC_CACHE } + { + /* + * Olympus FE-210 camera + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * LG UP3S MP3 player + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "LG", "UP3S", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Laser MP3-2GA13 MP3 player + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "USB 2.0", "(HS) Flash Disk", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:22:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AE39106566C; Sun, 6 May 2012 14:22:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45CFB8FC0C; Sun, 6 May 2012 14:22:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EMV11017798; Sun, 6 May 2012 14:22:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EMVSa017796; Sun, 6 May 2012 14:22:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061422.q46EMVSa017796@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235088 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:22:31 -0000 Author: eadler Date: Sun May 6 14:22:30 2012 New Revision: 235088 URL: http://svn.freebsd.org/changeset/base/235088 Log: MFC r234820: pread(2) might fail with EBUSY, so document it PR: docs/167201 Approved by: cperciva (implicit) Modified: stable/9/lib/libc/sys/read.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/read.2 ============================================================================== --- stable/9/lib/libc/sys/read.2 Sun May 6 14:16:18 2012 (r235087) +++ stable/9/lib/libc/sys/read.2 Sun May 6 14:22:30 2012 (r235088) @@ -164,6 +164,8 @@ argument points outside the allocated address space. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EBUSY +Failed to read from a file, e.g. /proc//regs while is not stopped .It Bq Er EINTR A read from a slow device (i.e.\& one that might block for an arbitrary amount of time) From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:23:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 110C41065672; Sun, 6 May 2012 14:23:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFA848FC08; Sun, 6 May 2012 14:23:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EN1Of017844; Sun, 6 May 2012 14:23:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EN1lw017842; Sun, 6 May 2012 14:23:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061423.q46EN1lw017842@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235089 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:23:02 -0000 Author: eadler Date: Sun May 6 14:23:01 2012 New Revision: 235089 URL: http://svn.freebsd.org/changeset/base/235089 Log: MFC r234820: pread(2) might fail with EBUSY, so document it PR: docs/167201 Approved by: cperciva (implicit) Modified: stable/8/lib/libc/sys/read.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/read.2 ============================================================================== --- stable/8/lib/libc/sys/read.2 Sun May 6 14:22:30 2012 (r235088) +++ stable/8/lib/libc/sys/read.2 Sun May 6 14:23:01 2012 (r235089) @@ -164,6 +164,8 @@ argument points outside the allocated address space. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EBUSY +Failed to read from a file, e.g. /proc//regs while is not stopped .It Bq Er EINTR A read from a slow device (i.e.\& one that might block for an arbitrary amount of time) From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:23:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1389106564A; Sun, 6 May 2012 14:23:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C25F8FC0C; Sun, 6 May 2012 14:23:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46ENJpS017887; Sun, 6 May 2012 14:23:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46ENJbw017885; Sun, 6 May 2012 14:23:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205061423.q46ENJbw017885@svn.freebsd.org> From: Eitan Adler Date: Sun, 6 May 2012 14:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235090 - stable/7/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:23:19 -0000 Author: eadler Date: Sun May 6 14:23:19 2012 New Revision: 235090 URL: http://svn.freebsd.org/changeset/base/235090 Log: MFC r234820: pread(2) might fail with EBUSY, so document it PR: docs/167201 Approved by: cperciva (implicit) Modified: stable/7/lib/libc/sys/read.2 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/sys/read.2 ============================================================================== --- stable/7/lib/libc/sys/read.2 Sun May 6 14:23:01 2012 (r235089) +++ stable/7/lib/libc/sys/read.2 Sun May 6 14:23:19 2012 (r235090) @@ -164,6 +164,8 @@ argument points outside the allocated address space. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EBUSY +Failed to read from a file, e.g. /proc//regs while is not stopped .It Bq Er EINTR A read from a slow device (i.e.\& one that might block for an arbitrary amount of time) From owner-svn-src-all@FreeBSD.ORG Sun May 6 14:50:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F97106566B; Sun, 6 May 2012 14:50:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93E8D8FC17; Sun, 6 May 2012 14:50:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46EosHt018789; Sun, 6 May 2012 14:50:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46EosOk018786; Sun, 6 May 2012 14:50:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205061450.q46EosOk018786@svn.freebsd.org> From: Michael Tuexen Date: Sun, 6 May 2012 14:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235091 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 14:50:54 -0000 Author: tuexen Date: Sun May 6 14:50:54 2012 New Revision: 235091 URL: http://svn.freebsd.org/changeset/base/235091 Log: Address clang warnings. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 6 14:23:19 2012 (r235090) +++ head/sys/netinet/sctp_usrreq.c Sun May 6 14:50:54 2012 (r235091) @@ -5838,7 +5838,6 @@ sctp_ctloutput(struct socket *so, struct { void *optval = NULL; size_t optsize = 0; - struct sctp_inpcb *inp; void *p; int error = 0; @@ -5856,12 +5855,11 @@ sctp_ctloutput(struct socket *so, struct #endif return (error); } - inp = (struct sctp_inpcb *)so->so_pcb; optsize = sopt->sopt_valsize; if (optsize) { SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); if (optval == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS); + SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS); return (ENOBUFS); } error = sooptcopyin(sopt, optval, optsize, optsize); @@ -5876,7 +5874,7 @@ sctp_ctloutput(struct socket *so, struct } else if (sopt->sopt_dir == SOPT_GET) { error = sctp_getopt(so, sopt->sopt_name, optval, &optsize, p); } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } if ((error == 0) && (optval != NULL)) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 6 14:23:19 2012 (r235090) +++ head/sys/netinet/sctputil.c Sun May 6 14:50:54 2012 (r235091) @@ -3288,7 +3288,8 @@ sctp_notify_stream_reset_add(struct sctp struct sctp_stream_change_event *stradd; int len; - if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT)) { + if ((stcb == NULL) || + (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT))) { /* event not enabled */ return; } @@ -3349,7 +3350,8 @@ sctp_notify_stream_reset_tsn(struct sctp struct sctp_assoc_reset_event *strasoc; int len; - if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT)) { + if ((stcb == NULL) || + (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT))) { /* event not enabled */ return; } @@ -3407,7 +3409,8 @@ sctp_notify_stream_reset(struct sctp_tcb struct sctp_stream_reset_event *strreset; int len; - if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { + if ((stcb == NULL) || + (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT))) { /* event not enabled */ return; } From owner-svn-src-all@FreeBSD.ORG Sun May 6 15:55:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06117106566B; Sun, 6 May 2012 15:55:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CD58FC14; Sun, 6 May 2012 15:55:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46Ft1vx020929; Sun, 6 May 2012 15:55:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46Ft1g3020924; Sun, 6 May 2012 15:55:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205061555.q46Ft1g3020924@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 15:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235092 - stable/9/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 15:55:02 -0000 Author: mav Date: Sun May 6 15:55:01 2012 New Revision: 235092 URL: http://svn.freebsd.org/changeset/base/235092 Log: MFC r234601: Add sos@ copyrights to RAID metadata modules, respecting his efforts in decoding metadata formats in ataraid(4) code. Modified: stable/9/sys/geom/raid/md_intel.c stable/9/sys/geom/raid/md_jmicron.c stable/9/sys/geom/raid/md_nvidia.c stable/9/sys/geom/raid/md_promise.c stable/9/sys/geom/raid/md_sii.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Sun May 6 14:50:54 2012 (r235091) +++ stable/9/sys/geom/raid/md_intel.c Sun May 6 15:55:01 2012 (r235092) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/9/sys/geom/raid/md_jmicron.c Sun May 6 14:50:54 2012 (r235091) +++ stable/9/sys/geom/raid/md_jmicron.c Sun May 6 15:55:01 2012 (r235092) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/9/sys/geom/raid/md_nvidia.c Sun May 6 14:50:54 2012 (r235091) +++ stable/9/sys/geom/raid/md_nvidia.c Sun May 6 15:55:01 2012 (r235092) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Sun May 6 14:50:54 2012 (r235091) +++ stable/9/sys/geom/raid/md_promise.c Sun May 6 15:55:01 2012 (r235092) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Sun May 6 14:50:54 2012 (r235091) +++ stable/9/sys/geom/raid/md_sii.c Sun May 6 15:55:01 2012 (r235092) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sun May 6 15:56:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE34D1065670; Sun, 6 May 2012 15:56:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C00098FC1F; Sun, 6 May 2012 15:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46Fu7hP021029; Sun, 6 May 2012 15:56:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46Fu73b021023; Sun, 6 May 2012 15:56:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205061556.q46Fu73b021023@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 15:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235093 - stable/8/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 15:56:08 -0000 Author: mav Date: Sun May 6 15:56:07 2012 New Revision: 235093 URL: http://svn.freebsd.org/changeset/base/235093 Log: MFC r234601: Add sos@ copyrights to RAID metadata modules, respecting his efforts in decoding metadata formats in ataraid(4) code. Modified: stable/8/sys/geom/raid/md_intel.c stable/8/sys/geom/raid/md_jmicron.c stable/8/sys/geom/raid/md_nvidia.c stable/8/sys/geom/raid/md_promise.c stable/8/sys/geom/raid/md_sii.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Sun May 6 15:55:01 2012 (r235092) +++ stable/8/sys/geom/raid/md_intel.c Sun May 6 15:56:07 2012 (r235093) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/8/sys/geom/raid/md_jmicron.c Sun May 6 15:55:01 2012 (r235092) +++ stable/8/sys/geom/raid/md_jmicron.c Sun May 6 15:56:07 2012 (r235093) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/8/sys/geom/raid/md_nvidia.c Sun May 6 15:55:01 2012 (r235092) +++ stable/8/sys/geom/raid/md_nvidia.c Sun May 6 15:56:07 2012 (r235093) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Sun May 6 15:55:01 2012 (r235092) +++ stable/8/sys/geom/raid/md_promise.c Sun May 6 15:56:07 2012 (r235093) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/geom/raid/md_sii.c ============================================================================== --- stable/8/sys/geom/raid/md_sii.c Sun May 6 15:55:01 2012 (r235092) +++ stable/8/sys/geom/raid/md_sii.c Sun May 6 15:56:07 2012 (r235093) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Alexander Motin + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sun May 6 16:01:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66438106566C; Sun, 6 May 2012 16:01:59 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 382DC8FC0C; Sun, 6 May 2012 16:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46G1xrj021257; Sun, 6 May 2012 16:01:59 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46G1xSr021254; Sun, 6 May 2012 16:01:59 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201205061601.q46G1xSr021254@svn.freebsd.org> From: Tim Kientzle Date: Sun, 6 May 2012 16:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235094 - head/sys/boot/uboot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 16:01:59 -0000 Author: kientzle Date: Sun May 6 16:01:58 2012 New Revision: 235094 URL: http://svn.freebsd.org/changeset/base/235094 Log: Don't call strcmp with a NULL pointer. In particular, on the AM335x, which comes up with no memory mapped to low addresses, dereferencing the NULL causes a crash. Modified: head/sys/boot/uboot/common/main.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sun May 6 15:56:07 2012 (r235093) +++ head/sys/boot/uboot/common/main.c Sun May 6 16:01:58 2012 (r235094) @@ -116,6 +116,16 @@ meminfo(void) } } +static uint64_t +uboot_loadaddr(u_int type, void *data, uint64_t addr) +{ + printf("uboot_loadaddr: type=%d data=0x%x addr=0x%x\n", + type, data, addr); + if (type == 1) + return 0x40000000; + return (addr); +} + int main(void) { @@ -211,6 +221,7 @@ main(void) archsw.arch_copyout = uboot_copyout; archsw.arch_readin = uboot_readin; archsw.arch_autoload = uboot_autoload; + archsw.arch_loadaddr = uboot_loadaddr; interact(); /* doesn't return */ Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Sun May 6 15:56:07 2012 (r235093) +++ head/sys/boot/uboot/common/metadata.c Sun May 6 16:01:58 2012 (r235094) @@ -72,6 +72,7 @@ static int md_getboothowto(char *kargs) { char *cp; + char *p; int howto; int active; int i; @@ -132,10 +133,12 @@ md_getboothowto(char *kargs) if (getenv(howto_names[i].ev) != NULL) howto |= howto_names[i].mask; } - if (!strcmp(getenv("console"), "comconsole")) - howto |= RB_SERIAL; - if (!strcmp(getenv("console"), "nullconsole")) - howto |= RB_MUTE; + if ((p = getenv("console"))) { + if (!strcmp(p, "comconsole")) + howto |= RB_SERIAL; + if (!strcmp(p, "nullconsole")) + howto |= RB_MUTE; + } return(howto); } From owner-svn-src-all@FreeBSD.ORG Sun May 6 16:32:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 706361065670; Sun, 6 May 2012 16:32:29 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59AEC8FC17; Sun, 6 May 2012 16:32:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46GWTrh022273; Sun, 6 May 2012 16:32:29 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46GWTxb022271; Sun, 6 May 2012 16:32:29 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201205061632.q46GWTxb022271@svn.freebsd.org> From: Tim Kientzle Date: Sun, 6 May 2012 16:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235095 - head/sys/boot/uboot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 16:32:29 -0000 Author: kientzle Date: Sun May 6 16:32:28 2012 New Revision: 235095 URL: http://svn.freebsd.org/changeset/base/235095 Log: Ooops. Back out changes to main.c from r235094. This change is specific to BeagleBone; I need to figure out how to generalize this before committing. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sun May 6 16:01:58 2012 (r235094) +++ head/sys/boot/uboot/common/main.c Sun May 6 16:32:28 2012 (r235095) @@ -116,16 +116,6 @@ meminfo(void) } } -static uint64_t -uboot_loadaddr(u_int type, void *data, uint64_t addr) -{ - printf("uboot_loadaddr: type=%d data=0x%x addr=0x%x\n", - type, data, addr); - if (type == 1) - return 0x40000000; - return (addr); -} - int main(void) { @@ -221,7 +211,6 @@ main(void) archsw.arch_copyout = uboot_copyout; archsw.arch_readin = uboot_readin; archsw.arch_autoload = uboot_autoload; - archsw.arch_loadaddr = uboot_loadaddr; interact(); /* doesn't return */ From owner-svn-src-all@FreeBSD.ORG Sun May 6 16:41:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAB30106566B; Sun, 6 May 2012 16:41:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D4788FC0A; Sun, 6 May 2012 16:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46GfRNc022587; Sun, 6 May 2012 16:41:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46GfRC2022585; Sun, 6 May 2012 16:41:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205061641.q46GfRC2022585@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 May 2012 16:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235096 - head/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 16:41:27 -0000 Author: mav Date: Sun May 6 16:41:27 2012 New Revision: 235096 URL: http://svn.freebsd.org/changeset/base/235096 Log: Remove some hardcoded constants from code. Modified: head/sys/geom/raid/md_ddf.c Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Sun May 6 16:32:28 2012 (r235095) +++ head/sys/geom/raid/md_ddf.c Sun May 6 16:41:27 2012 (r235096) @@ -1639,6 +1639,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d g_raid_get_diskname(disk)); goto nofit; } + eoff *= pd->pd_meta.sectorsize; + esize *= pd->pd_meta.sectorsize; size = INT64_MAX; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; @@ -1651,16 +1653,15 @@ g_raid_md_ddf_start_disk(struct g_raid_d } if (disk_pos >= 0 && vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT && - (off_t)esize * 512 < size) { + esize < size) { G_RAID_DEBUG1(1, sc, "Disk %s free space " "is too small (%ju < %ju)", - g_raid_get_diskname(disk), - (off_t)esize * 512, size); + g_raid_get_diskname(disk), esize, size); disk_pos = -1; } if (disk_pos >= 0) { if (vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT) - esize = size / 512; + esize = size; md_disk_bvd = disk_pos / GET16(vmeta, vdc->Primary_Element_Count); // XXX md_disk_pos = disk_pos % GET16(vmeta, vdc->Primary_Element_Count); // XXX } else { @@ -1712,8 +1713,8 @@ nofit: g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); if (resurrection) { - sd->sd_offset = (off_t)eoff * 512; - sd->sd_size = (off_t)esize * 512; + sd->sd_offset = eoff; + sd->sd_size = esize; } else if (pdmeta->cr != NULL && (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { val2 = (uint64_t *)&(vdc1->Physical_Disk_Sequence[GET16(vmeta, hdr->Max_Primary_Element_Entries)]); @@ -2317,6 +2318,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec disks[i] = disk; ddf_meta_unused_range(&pd->pd_meta, &offs[i], &esize); + offs[i] *= pp->sectorsize; size = MIN(size, (off_t)esize * pp->sectorsize); sectorsize = MAX(sectorsize, pp->sectorsize); continue; @@ -2356,7 +2358,8 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec cp->provider->name); /* Reserve some space for metadata. */ - size = MIN(size, pp->mediasize - 131072llu * pp->sectorsize); + size = MIN(size, GET64(&pd->pd_meta, + pdr->entry[0].Configured_Size) * pp->sectorsize); sectorsize = MAX(sectorsize, pp->sectorsize); } if (error != 0) { @@ -2466,7 +2469,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec disk = disks[i]; sd = &vol->v_subdisks[i]; sd->sd_disk = disk; - sd->sd_offset = (off_t)offs[i] * 512; + sd->sd_offset = offs[i]; sd->sd_size = size; if (disk == NULL) continue; From owner-svn-src-all@FreeBSD.ORG Sun May 6 18:04:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AC2A1065674; Sun, 6 May 2012 18:04:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC4F8FC20; Sun, 6 May 2012 18:04:02 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id CEB6125D3A00; Sun, 6 May 2012 18:04:00 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BABC9BE6619; Sun, 6 May 2012 18:03:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id W736mFn0vNlT; Sun, 6 May 2012 18:03:57 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id DDAEDBE6618; Sun, 6 May 2012 18:03:55 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20120421171128.GA6732@lor.one-eyed-alien.net> Date: Sun, 6 May 2012 18:03:54 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <3D17FEF6-8CC5-4BBB-B098-BEA7D28F377D@FreeBSD.org> References: <201204202137.q3KLbhNj056524@svn.freebsd.org> <20120421171128.GA6732@lor.one-eyed-alien.net> To: Brooks Davis , Ryan Stone X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234504 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 18:04:03 -0000 On 21. Apr 2012, at 17:11 , Brooks Davis wrote: > On Sat, Apr 21, 2012 at 09:45:57AM -0400, Ryan Stone wrote: >> On Fri, Apr 20, 2012 at 5:37 PM, Brooks Davis = wrote: >>> Author: brooks >>> Date: Fri Apr 20 21:37:42 2012 >>> New Revision: 234504 >>> URL: http://svn.freebsd.org/changeset/base/234504 >>>=20 >>> Log: >>> ?Enable DTrace hooks in GENERIC. >>>=20 >>> ?Reviewed by: ?gnn >>> ?Approved by: ?core (jhb, imp) >>> ?Requested by: a cast of thousands >>> ?MFC after: ? ?3 days >>=20 >> Excellent! Thanks to everybody who helped make this happen, starting >> with the participants at dtrace.conf who gave us the requisite whacks >> with the clue-by-four. >>=20 >> However, what is our policy for enabling features in -STABLE that are >> known to be unstable? If we MFC this I don't have the slightest = worry >> that somebody might see instability in their system just because the >> hooks are all of a sudden there, but I would worry that somebody make >> take DTrace hooks being enabled in GENERIC on -STABLE to imply that >> DTrace is stable, start using it and being upset when they trip over = a >> DTrace bug. >=20 > I think we should note that it remains experimental and somewhat buggy > in the release notes and probably in the MFC message. Otherwise, it's > like any new feature. If you start using a feature in production > without extensive testing you may be surprised. I am sorry but I am close to requesting a backout now but I hope someone else might be able to debug it further, so I'll wait for another couple of days. I have heard this from multiple people and I am now at the point where I wasted almost a day or work on this over the course of two weeks. I am not able to finish HEAD snapshot release builds even after updating the underlying kernel and world to a today's HEAD (I had to disable the WITH_CTF=3D to get the kernel now booted to build). I have seen this on multiple setups for about two weeks. The common factor is always that ctfmerge is hanging forever. I have = seen this on both i386 and amd64. I have seen it with modules and with kernels built with NO_MODULES. I have seen it on NFS and on local = disks. As son as I add the # Temprary as ctfmerge hangs. nomakeoptions WITH_CTF things are fine again. At the moment it looks like this: root 34611 0.0 0.1 35908 8736 - I 4:19PM 0:00.07 ctfmerge -L = VERSION -g -o if_ath.ko.debug if_ath.o if_ath_debug.o if_ath_keycache.o = if_ath_sysctl.o if_ath_tx.o if_ath_tx_ht.o if_ath_led.o ah_osdep.o ah.o = ah_regdom root 39282 0.0 0.2 44104 14516 - I 4:20PM 0:00.06 ctfmerge -L = VERSION -g -o kernel.debug locore.o aic7xxx_reg_print.o = aic79xx_reg_print.o cam.o cam_periph.o cam_queue.o cam_sim.o cam_xpt.o = ata_all.o ata_xpt.o ata_pm root@bz1:/home/bz # procstat -k 34611 PID TID COMM TDNAME KSTACK = =20 34611 100228 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 34611 100452 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 34611 100453 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 34611 100454 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 34611 100455 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 34611 100456 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 root@bz1:/home/bz # procstat -k 39282 PID TID COMM TDNAME KSTACK = =20 39282 100348 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep do_wait = __umtx_op_wait_uint_private amd64_syscall Xfast_syscall=20 39282 100457 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 39282 100458 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 39282 100459 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 39282 100460 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 39282 100461 ctfmerge - mi_switch = sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex = do_lock_umutex __umtx_op_wait_umutex amd64_syscall Xfast_syscall=20 root@bz1:/home/bz # procstat -t 34611 PID TID COMM TDNAME CPU PRI STATE WCHAN =20= 34611 100228 ctfmerge - 7 152 sleep umtxn = =20 34611 100452 ctfmerge - 1 152 sleep umtxn = =20 34611 100453 ctfmerge - 1 152 sleep umtxn = =20 34611 100454 ctfmerge - 4 152 sleep umtxn = =20 34611 100455 ctfmerge - 0 152 sleep umtxn = =20 34611 100456 ctfmerge - 5 152 sleep umtxn = =20 root@bz1:/home/bz # procstat -t 39282 PID TID COMM TDNAME CPU PRI STATE WCHAN =20= 39282 100348 ctfmerge - 7 152 sleep uwait = =20 39282 100457 ctfmerge - 2 152 sleep umtxn = =20 39282 100458 ctfmerge - 4 152 sleep umtxn = =20 39282 100459 ctfmerge - 1 152 sleep umtxn = =20 39282 100460 ctfmerge - 5 152 sleep umtxn = =20 39282 100461 ctfmerge - 0 152 sleep umtxn = =20 root@bz1:/home/bz # procstat -i 34611 | grep -v -- '---$' PID COMM SIG FLAGS 34611 ctfmerge INT --C 34611 ctfmerge QUIT --C 34611 ctfmerge TERM --C 34611 ctfmerge URG -I- 34611 ctfmerge TSTP -I- 34611 ctfmerge CHLD -I- 34611 ctfmerge TTIN -I- 34611 ctfmerge TTOU -I- 34611 ctfmerge IO -I- 34611 ctfmerge WINCH -I- 34611 ctfmerge INFO -I- 34611 ctfmerge 32 --C root@bz1:/home/bz # procstat -i 39282 | grep -v -- '---$' PID COMM SIG FLAGS 39282 ctfmerge INT --C 39282 ctfmerge QUIT --C 39282 ctfmerge TERM --C 39282 ctfmerge URG -I- 39282 ctfmerge TSTP -I- 39282 ctfmerge CHLD -I- 39282 ctfmerge TTIN -I- 39282 ctfmerge TTOU -I- 39282 ctfmerge IO -I- 39282 ctfmerge WINCH -I- 39282 ctfmerge INFO -I- 39282 ctfmerge 32 --C root@bz1:/home/bz # procstat -j 34611 | grep -v -- '--$' PID TID COMM SIG FLAGS 34611 100452 ctfmerge INT -B 34611 100452 ctfmerge QUIT -B 34611 100452 ctfmerge TERM -B 34611 100453 ctfmerge INT -B 34611 100453 ctfmerge QUIT -B 34611 100453 ctfmerge TERM -B 34611 100454 ctfmerge INT -B 34611 100454 ctfmerge QUIT -B 34611 100454 ctfmerge TERM -B 34611 100455 ctfmerge INT -B 34611 100455 ctfmerge QUIT -B 34611 100455 ctfmerge TERM -B 34611 100456 ctfmerge INT -B 34611 100456 ctfmerge QUIT -B 34611 100456 ctfmerge TERM -B root@bz1:/home/bz # procstat -j 39282 | grep -v -- '--$' PID TID COMM SIG FLAGS 39282 100457 ctfmerge INT -B 39282 100457 ctfmerge QUIT -B 39282 100457 ctfmerge TERM -B 39282 100458 ctfmerge INT -B 39282 100458 ctfmerge QUIT -B 39282 100458 ctfmerge TERM -B 39282 100459 ctfmerge INT -B 39282 100459 ctfmerge QUIT -B 39282 100459 ctfmerge TERM -B 39282 100460 ctfmerge INT -B 39282 100460 ctfmerge QUIT -B 39282 100460 ctfmerge TERM -B 39282 100461 ctfmerge INT -B 39282 100461 ctfmerge QUIT -B 39282 100461 ctfmerge TERM -B So given I have been upset I started to investigate some more. make -C /usr/src buildworld did not work either (no -j). So I started and limited the build to 1 core: cpuset -l 1 make -C /usr/src buildkernel did not work either. So added the nomakeoptions WITH_CTF and make -C /usr/src -j8 buildkernel completes. So removed the makeoptions WITH_CTF from GENRIC and the nomakeoptions = from my kernel including GENERIC and added it to the command line: make -C /usr/src -j8 buildkernel WITH_CTF=3D=20 and that doesn't seem to work at all anymore? "/usr/src/share/mk/bsd.own.mk", line 482: WITH_CTF and WITHOUT_CTF can't = both be set. So I did: echo WITH_CTF=3D >> /etc/src.conf make -C /usr/src -j8 buildkernel and of course it did not work again. Given all this and given it has reliably worked in the past, my = conclusions is that it must be something related to ctfmerge or = libraries? /usr/bin/ctfmerge: libctf.so.2 =3D> /lib/libctf.so.2 (0x800829000) libdwarf.so.3 =3D> /usr/lib/libdwarf.so.3 (0x800a36000) libelf.so.1 =3D> /usr/lib/libelf.so.1 (0x800c3f000) libz.so.6 =3D> /lib/libz.so.6 (0x800e58000) libthr.so.3 =3D> /lib/libthr.so.3 (0x80106e000) libc.so.7 =3D> /lib/libc.so.7 (0x801293000) What has changed the last 3ish months? /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sun May 6 18:34:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0262D1065670; Sun, 6 May 2012 18:34:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23848FC0A; Sun, 6 May 2012 18:34:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46IYV52026278; Sun, 6 May 2012 18:34:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46IYVAf026276; Sun, 6 May 2012 18:34:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205061834.q46IYVAf026276@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 May 2012 18:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235099 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 18:34:32 -0000 Author: kib Date: Sun May 6 18:34:31 2012 New Revision: 235099 URL: http://svn.freebsd.org/changeset/base/235099 Log: Add definition for the -z nodefaultlib flag. MFC after: 3 days Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sun May 6 18:23:19 2012 (r235098) +++ head/sys/sys/elf_common.h Sun May 6 18:34:31 2012 (r235099) @@ -480,6 +480,7 @@ typedef struct { #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ +#define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ From owner-svn-src-all@FreeBSD.ORG Sun May 6 19:01:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D32281065674; Sun, 6 May 2012 19:01:18 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE39B8FC0C; Sun, 6 May 2012 19:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46J1I1b027102; Sun, 6 May 2012 19:01:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46J1I4t027100; Sun, 6 May 2012 19:01:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201205061901.q46J1I4t027100@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 6 May 2012 19:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235100 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 19:01:18 -0000 Author: pluknet Date: Sun May 6 19:01:18 2012 New Revision: 235100 URL: http://svn.freebsd.org/changeset/base/235100 Log: Fix r234821 mis-merge. Modified: stable/7/sys/cam/scsi/scsi_da.c Modified: stable/7/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_da.c Sun May 6 18:34:31 2012 (r235099) +++ stable/7/sys/cam/scsi/scsi_da.c Sun May 6 19:01:18 2012 (r235100) @@ -554,7 +554,7 @@ static struct da_quirk_entry da_quirk_ta { {T_DIRECT, SIP_MEDIA_REMOVABLE, "Netac", "OnlyDisk*", "2000"}, /*quirks*/ DA_Q_NO_SYNC_CACHE - } + }, { /* * Olympus FE-210 camera From owner-svn-src-all@FreeBSD.ORG Sun May 6 19:03:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDEE6106566B; Sun, 6 May 2012 19:03:37 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4E78FC08; Sun, 6 May 2012 19:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46J3bAe027205; Sun, 6 May 2012 19:03:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46J3bVX027203; Sun, 6 May 2012 19:03:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201205061903.q46J3bVX027203@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 6 May 2012 19:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235101 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 19:03:37 -0000 Author: pluknet Date: Sun May 6 19:03:36 2012 New Revision: 235101 URL: http://svn.freebsd.org/changeset/base/235101 Log: OpenBSD 5.1 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sun May 6 19:01:18 2012 (r235100) +++ head/share/misc/bsd-family-tree Sun May 6 19:03:36 2012 (r235101) @@ -253,7 +253,7 @@ FreeBSD 5.2 | | *--FreeBSD | | | | | | 9.0 | | | | DragonFly 3.0.1 | v FreeBSD | | | | - | 8.3 | | | | + | 8.3 | | OpenBSD 5.1 | | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | @@ -546,6 +546,7 @@ OpenBSD 5.0 2011-11-01 [OBD] FreeBSD 9.0 2012-01-12 [FBD] DragonFly 3.0.1 2012-02-21 [DFB] FreeBSD 8.3 2012-04-18 [FBD] +OpenBSD 5.1 2012-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Sun May 6 20:26:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED46C106566C; Sun, 6 May 2012 20:26:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDB658FC08; Sun, 6 May 2012 20:26:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46KQM2F030386; Sun, 6 May 2012 20:26:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46KQMEu030383; Sun, 6 May 2012 20:26:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205062026.q46KQMEu030383@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 6 May 2012 20:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235103 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 20:26:23 -0000 Author: bz Date: Sun May 6 20:26:22 2012 New Revision: 235103 URL: http://svn.freebsd.org/changeset/base/235103 Log: MFC r233113: Hide kernel option ROUTETABLES evaluations in the implementation rather than the header file. With this also move RT_MAXFIBS and RT_NUMFIBS into the implemantion to avoid further usage in other code. rt_numfibs is all that should be needed. This allows users to change the number of FIBs from 1..RT_MAXFIBS(16) dynamically using the tunable without the need to change the kernel config for the maximum anymore. This means that the multi-FIB feature is now fully available with GENERIC kernels. The kernel option ROUTETABLES can still be used to set the default numbers of FIBs in absence of the tunable. Modified: stable/9/sys/net/route.c stable/9/sys/net/route.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Sun May 6 19:34:55 2012 (r235102) +++ stable/9/sys/net/route.c Sun May 6 20:26:22 2012 (r235103) @@ -68,6 +68,24 @@ #include +/* We use 4 bits in the mbuf flags, thus we are limited to 16 FIBS. */ +#define RT_MAXFIBS 16 + +/* Kernel config default option. */ +#ifdef ROUTETABLES +#if ROUTETABLES <= 0 +#error "ROUTETABLES defined too low" +#endif +#if ROUTETABLES > RT_MAXFIBS +#error "ROUTETABLES defined too big" +#endif +#define RT_NUMFIBS ROUTETABLES +#endif /* ROUTETABLES */ +/* Initialize to default if not otherwise set. */ +#ifndef RT_NUMFIBS +#define RT_NUMFIBS 1 +#endif + u_int rt_numfibs = RT_NUMFIBS; SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, ""); /* Modified: stable/9/sys/net/route.h ============================================================================== --- stable/9/sys/net/route.h Sun May 6 19:34:55 2012 (r235102) +++ stable/9/sys/net/route.h Sun May 6 20:26:22 2012 (r235103) @@ -90,27 +90,6 @@ struct rt_metrics { #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) -/* MRT compile-time constants */ -#ifdef _KERNEL - #ifndef ROUTETABLES - #define RT_NUMFIBS 1 - #define RT_MAXFIBS 1 - #else - /* while we use 4 bits in the mbuf flags, we are limited to 16 */ - #define RT_MAXFIBS 16 - #if ROUTETABLES > RT_MAXFIBS - #define RT_NUMFIBS RT_MAXFIBS - #error "ROUTETABLES defined too big" - #else - #if ROUTETABLES == 0 - #define RT_NUMFIBS 1 - #else - #define RT_NUMFIBS ROUTETABLES - #endif - #endif - #endif -#endif - #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ extern u_int rt_numfibs; /* number fo usable routing tables */ /* From owner-svn-src-all@FreeBSD.ORG Sun May 6 20:26:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 214F8106564A; Sun, 6 May 2012 20:26:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E79BA8FC0C; Sun, 6 May 2012 20:26:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46KQSX1030426; Sun, 6 May 2012 20:26:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46KQS2L030423; Sun, 6 May 2012 20:26:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205062026.q46KQS2L030423@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 6 May 2012 20:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235104 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 20:26:29 -0000 Author: bz Date: Sun May 6 20:26:28 2012 New Revision: 235104 URL: http://svn.freebsd.org/changeset/base/235104 Log: MFC r233113: Hide kernel option ROUTETABLES evaluations in the implementation rather than the header file. With this also move RT_MAXFIBS and RT_NUMFIBS into the implemantion to avoid further usage in other code. rt_numfibs is all that should be needed. This allows users to change the number of FIBs from 1..RT_MAXFIBS(16) dynamically using the tunable without the need to change the kernel config for the maximum anymore. This means that the multi-FIB feature is now fully available with GENERIC kernels. The kernel option ROUTETABLES can still be used to set the default numbers of FIBs in absence of the tunable. Modified: stable/8/sys/net/route.c stable/8/sys/net/route.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Sun May 6 20:26:22 2012 (r235103) +++ stable/8/sys/net/route.c Sun May 6 20:26:28 2012 (r235104) @@ -68,6 +68,24 @@ #include +/* We use 4 bits in the mbuf flags, thus we are limited to 16 FIBS. */ +#define RT_MAXFIBS 16 + +/* Kernel config default option. */ +#ifdef ROUTETABLES +#if ROUTETABLES <= 0 +#error "ROUTETABLES defined too low" +#endif +#if ROUTETABLES > RT_MAXFIBS +#error "ROUTETABLES defined too big" +#endif +#define RT_NUMFIBS ROUTETABLES +#endif /* ROUTETABLES */ +/* Initialize to default if not otherwise set. */ +#ifndef RT_NUMFIBS +#define RT_NUMFIBS 1 +#endif + u_int rt_numfibs = RT_NUMFIBS; SYSCTL_INT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, ""); /* Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Sun May 6 20:26:22 2012 (r235103) +++ stable/8/sys/net/route.h Sun May 6 20:26:28 2012 (r235104) @@ -86,27 +86,6 @@ struct rt_metrics { #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) -/* MRT compile-time constants */ -#ifdef _KERNEL - #ifndef ROUTETABLES - #define RT_NUMFIBS 1 - #define RT_MAXFIBS 1 - #else - /* while we use 4 bits in the mbuf flags, we are limited to 16 */ - #define RT_MAXFIBS 16 - #if ROUTETABLES > RT_MAXFIBS - #define RT_NUMFIBS RT_MAXFIBS - #error "ROUTETABLES defined too big" - #else - #if ROUTETABLES == 0 - #define RT_NUMFIBS 1 - #else - #define RT_NUMFIBS ROUTETABLES - #endif - #endif - #endif -#endif - #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ extern u_int rt_numfibs; /* number fo usable routing tables */ /* From owner-svn-src-all@FreeBSD.ORG Sun May 6 20:46:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 756CD106564A; Sun, 6 May 2012 20:46:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FBA28FC12; Sun, 6 May 2012 20:46:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46Kk5Sg031157; Sun, 6 May 2012 20:46:05 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46Kk5Ae031154; Sun, 6 May 2012 20:46:05 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201205062046.q46Kk5Ae031154@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 6 May 2012 20:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235107 - in head/etc: defaults rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 20:46:05 -0000 Author: stas Date: Sun May 6 20:46:04 2012 New Revision: 235107 URL: http://svn.freebsd.org/changeset/base/235107 Log: - Change kfd rc script to be more conformant with rcNG conventions: o change rcname to kfd; o move mandatory options to command_args; o add missing "shutdown" keyword; o fix require line. Kfd doesn't really need to be started before daemons. Suggested by: dougb Modified: head/etc/defaults/rc.conf head/etc/rc.d/kfd Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun May 6 20:40:18 2012 (r235106) +++ head/etc/defaults/rc.conf Sun May 6 20:46:04 2012 (r235107) @@ -297,8 +297,8 @@ kadmind5_server_enable="NO" # Run kadmin kadmind5_server="/usr/libexec/kadmind" # path to kerberos 5 admin daemon kpasswdd_server_enable="NO" # Run kpasswdd (or NO) kpasswdd_server="/usr/libexec/kpasswdd" # path to kerberos 5 passwd daemon -kfd_server_enable="NO" # Run kfd (or NO) -kfd_server="/usr/libexec/kfd" # path to kerberos 5 kfd daemon +kfd_enable="NO" # Run kfd (or NO) +kfd_program="/usr/libexec/kfd" # path to kerberos 5 kfd daemon gssd_enable="NO" # Run the gssd daemon (or NO). gssd_flags="" # Flags for gssd. Modified: head/etc/rc.d/kfd ============================================================================== --- head/etc/rc.d/kfd Sun May 6 20:40:18 2012 (r235106) +++ head/etc/rc.d/kfd Sun May 6 20:46:04 2012 (r235107) @@ -4,16 +4,14 @@ # # PROVIDE: kfd -# BEFORE: DAEMON +# REQUIRE: NETWORK +# KEYWORD: shutdown . /etc/rc.subr -name="kfd" +name=kfd +rcvar=kfd_enable load_rc_config $name -rcvar="kfd_server_enable" -unset start_cmd -command="${kfd_server}" -kfd_flags="-i" -command_args="&" +command_args="-i &" run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Sun May 6 21:05:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0B2A106564A; Sun, 6 May 2012 21:05:58 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C2F98FC0C; Sun, 6 May 2012 21:05:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46L5wM2031799; Sun, 6 May 2012 21:05:58 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46L5wIh031797; Sun, 6 May 2012 21:05:58 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201205062105.q46L5wIh031797@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 6 May 2012 21:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235108 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 21:05:58 -0000 Author: stas Date: Sun May 6 21:05:58 2012 New Revision: 235108 URL: http://svn.freebsd.org/changeset/base/235108 Log: - Document kfd(8) rc.conf variables in the manpage. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun May 6 20:46:04 2012 (r235107) +++ head/share/man/man5/rc.conf.5 Sun May 6 21:05:58 2012 (r235108) @@ -2086,6 +2086,19 @@ If is set to .Dq Li YES this is the path to Kerberos 5 Password-Changing Daemon. +.It Va kfd_enable +.Pq Vt bool +Set to +.Dq Li YES +to start +.Xr kfd 8 , +the Kerberos 5 ticket forwarding daemon, at the boot time. +.It Va kfd_program +.Pq Vt str +Path to +.Xr kfd 8 +(default +.Pa /usr/libexec/kfd ) . .It Va rwhod_enable .Pq Vt bool If set to From owner-svn-src-all@FreeBSD.ORG Sun May 6 22:50:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF326106564A; Sun, 6 May 2012 22:50:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2C698FC0A; Sun, 6 May 2012 22:50:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46Mo7N0035293; Sun, 6 May 2012 22:50:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46Mo7hB035287; Sun, 6 May 2012 22:50:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205062250.q46Mo7hB035287@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 6 May 2012 22:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235112 - in stable/9/usr.sbin: . pkg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 06 May 2012 22:50:07 -0000 Author: bapt Date: Sun May 6 22:50:07 2012 New Revision: 235112 URL: http://svn.freebsd.org/changeset/base/235112 Log: MFC r234313 r234315 r234322 r234351 r234870 bootstrap tool for pkgng. it respects PACKAGESITE, PACKAGEROOT, and a new environment variable ABI (if a user want to use a different API from the base one for its packages) it has no man page on purpose to avoid hidding the pkg(8) man page from the pkgng package. for now uses pkgbeta.FreeBSD.org as default mirror to find its package it respects MK_PKGTOOLS Approved by: des (mentor) Added: stable/9/usr.sbin/pkg/ - copied from r234313, head/usr.sbin/pkg/ Modified: stable/9/usr.sbin/Makefile stable/9/usr.sbin/pkg/Makefile stable/9/usr.sbin/pkg/pkg.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/Makefile ============================================================================== --- stable/9/usr.sbin/Makefile Sun May 6 22:36:10 2012 (r235111) +++ stable/9/usr.sbin/Makefile Sun May 6 22:50:07 2012 (r235112) @@ -256,6 +256,7 @@ SUBDIR+= ftp-proxy .if ${MK_PKGTOOLS} != "no" SUBDIR+= pkg_install +SUBDIR+= pkg .endif # XXX MK_TOOLCHAIN? Modified: stable/9/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sun Apr 15 15:13:36 2012 (r234313) +++ stable/9/usr.sbin/pkg/Makefile Sun May 6 22:50:07 2012 (r235112) @@ -4,6 +4,7 @@ PROG= pkg SRC= pkg.c NO_MAN= yes +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} LDADD= -larchive -lelf -lfetch .include Modified: stable/9/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Apr 15 15:13:36 2012 (r234313) +++ stable/9/usr.sbin/pkg/pkg.c Sun May 6 22:50:07 2012 (r235112) @@ -27,11 +27,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include #include +#include #include #include @@ -39,24 +38,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include -#include #include "elf_tables.h" #define _LOCALBASE "/usr/local" #define _PKGS_URL "http://pkgbeta.FreeBSD.org" -#define _DEFAULT_TMP "/tmp" static const char * -elf_corres_to_string(struct _elf_corres* m, int e) +elf_corres_to_string(struct _elf_corres *m, int e) { - int i = 0; + int i; for (i = 0; m[i].string != NULL; i++) if (m[i].elf_nb == e) @@ -69,29 +68,30 @@ static int pkg_get_myabi(char *dest, size_t sz) { Elf *elf; - GElf_Ehdr elfhdr; - GElf_Shdr shdr; Elf_Data *data; Elf_Note note; Elf_Scn *scn; char *src, *osname; const char *abi; + GElf_Ehdr elfhdr; + GElf_Shdr shdr; int fd, i, ret; uint32_t version; version = 0; - ret = 0; + ret = -1; scn = NULL; abi = NULL; if (elf_version(EV_CURRENT) == EV_NONE) { - warnx("ELF library initialization failed: %s", elf_errmsg(-1)); - return -1; + warnx("ELF library initialization failed: %s", + elf_errmsg(-1)); + return (-1); } if ((fd = open("/bin/sh", O_RDONLY)) < 0) { warn("open()"); - return -1; + return (-1); } if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { @@ -119,13 +119,13 @@ pkg_get_myabi(char *dest, size_t sz) if (scn == NULL) { ret = -1; - warn("fail to get the note section"); + warn("failed to get the note section"); goto cleanup; } data = elf_getdata(scn, NULL); src = data->d_buf; - while (1) { + for (;;) { memcpy(¬e, src, sizeof(Elf_Note)); src += sizeof(Elf_Note); if (note.n_type == NT_VERSION) @@ -143,52 +143,50 @@ pkg_get_myabi(char *dest, size_t sz) osname[i] = (char)tolower(osname[i]); snprintf(dest, sz, "%s:%d:%s:%s", - osname, - version / 100000, - elf_corres_to_string(mach_corres, (int) elfhdr.e_machine), + osname, version / 100000, + elf_corres_to_string(mach_corres, (int)elfhdr.e_machine), elf_corres_to_string(wordsize_corres, - (int)elfhdr.e_ident[EI_CLASS])); + (int)elfhdr.e_ident[EI_CLASS])); + + ret = 0; switch (elfhdr.e_machine) { - case EM_ARM: - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s:%s", - elf_corres_to_string(endian_corres, - (int) elfhdr.e_ident[EI_DATA]), - (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? - "eabi" : "oabi", - (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? - "softfp" : "vfp"); + case EM_ARM: + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), + (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? + "eabi" : "oabi", + (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? + "softfp" : "vfp"); + break; + case EM_MIPS: + /* + * this is taken from binutils sources: + * include/elf/mips.h + * mapping is figured out from binutils: + * gas/config/tc-mips.c + */ + switch (elfhdr.e_flags & EF_MIPS_ABI) { + case E_MIPS_ABI_O32: + abi = "o32"; break; - case EM_MIPS: - /* - * this is taken from binutils sources: - * include/elf/mips.h - * mapping is figured out from binutils: - * gas/config/tc-mips.c - */ - switch (elfhdr.e_flags & EF_MIPS_ABI) { - case E_MIPS_ABI_O32: - abi = "o32"; - break; - case E_MIPS_ABI_N32: - abi = "n32"; - break; - default: - if (elfhdr.e_ident[EI_DATA] == - ELFCLASS32) - abi = "o32"; - else if (elfhdr.e_ident[EI_DATA] == - ELFCLASS64) - abi = "n64"; - break; - } - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s", - elf_corres_to_string(endian_corres, - (int) elfhdr.e_ident[EI_DATA]), - abi); + case E_MIPS_ABI_N32: + abi = "n32"; break; + default: + if (elfhdr.e_ident[EI_DATA] == + ELFCLASS32) + abi = "o32"; + else if (elfhdr.e_ident[EI_DATA] == + ELFCLASS64) + abi = "n64"; + break; + } + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), abi); + break; } cleanup: @@ -207,17 +205,22 @@ extract_pkg_static(int fd, char *p, int char *end; int ret, r; - ret = 0; + ret = -1; a = archive_read_new(); + if (a == NULL) { + warn("archive_read_new"); + return (ret); + } archive_read_support_compression_all(a); archive_read_support_format_tar(a); - lseek(fd, 0, 0); + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + goto cleanup; + } if (archive_read_open_fd(a, fd, 4096) != ARCHIVE_OK) { - warnx("archive_read_open_fd: %s", - archive_error_string(a)); - ret = -1; + warnx("archive_read_open_fd: %s", archive_error_string(a)); goto cleanup; } @@ -229,22 +232,22 @@ extract_pkg_static(int fd, char *p, int if (strcmp(end, "/pkg-static") == 0) { r = archive_read_extract(a, ae, - ARCHIVE_EXTRACT_OWNER |ARCHIVE_EXTRACT_PERM| - ARCHIVE_EXTRACT_TIME |ARCHIVE_EXTRACT_ACL | - ARCHIVE_EXTRACT_FFLAGS|ARCHIVE_EXTRACT_XATTR); - snprintf(p, sz, archive_entry_pathname(ae)); + ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_ACL | + ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR); + strlcpy(p, archive_entry_pathname(ae), sz); break; } } - if (r != ARCHIVE_OK) { + if (r == ARCHIVE_OK) + ret = 0; + else warnx("fail to extract pkg-static"); - ret = -1; - } cleanup: archive_read_finish(a); - return ret; + return (ret); } @@ -255,129 +258,151 @@ install_pkg_static(char *path, char *pkg pid_t pid; switch ((pid = fork())) { - case -1: - return (-1); - case 0: - execl(path, "pkg-static", "add", pkgpath, (char *)NULL); - _exit(1); /* NOT REACHED */ - default: - break; + case -1: + return (-1); + case 0: + execl(path, "pkg-static", "add", pkgpath, (char *)NULL); + _exit(1); + default: + break; } - while (waitpid(pid, &pstat, 0) == -1) { + while (waitpid(pid, &pstat, 0) == -1) if (errno != EINTR) return (-1); - } - return (WEXITSTATUS(pstat)); + if (WEXITSTATUS(pstat)) + return (WEXITSTATUS(pstat)); + else if (WIFSIGNALED(pstat)) + return (128 & (WTERMSIG(pstat))); + return (pstat); } static int bootstrap_pkg(void) { - struct url_stat st; FILE *remote; - time_t begin_dl; - time_t now; - time_t last = 0; + FILE *config; + char *site; char url[MAXPATHLEN]; + char conf[MAXPATHLEN]; char abi[BUFSIZ]; char tmppkg[MAXPATHLEN]; char buf[10240]; char pkgstatic[MAXPATHLEN]; int fd, retry, ret; + struct url_stat st; off_t done, r; + time_t now; + time_t last; done = 0; - ret = 0; - retry = 3; + last = 0; + ret = -1; remote = NULL; + config = NULL; - printf("Bootstraping pkg please wait\n"); + printf("Bootstrapping pkg please wait\n"); if (pkg_get_myabi(abi, MAXPATHLEN) != 0) { - warnx("fail to determine my abi"); - return -1; + warnx("failed to determine the system ABI"); + return (-1); } - if (getenv("PACKAGESITE") != NULL) { - snprintf(url, MAXPATHLEN, "%s/pkg.txz", - getenv("PACKAGESITE")); - } else { + if (getenv("PACKAGESITE") != NULL) + snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", getenv("PACKAGESITE")); + else snprintf(url, MAXPATHLEN, "%s/%s/latest/Latest/pkg.txz", getenv("PACKAGEROOT") ? getenv("PACKAGEROOT") : _PKGS_URL, getenv("ABI") ? getenv("ABI") : abi); - } snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : "/tmp"); + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); if ((fd = mkstemp(tmppkg)) == -1) { warn("mkstemp()"); - return -1; + return (-1); } - while (remote == NULL) { + retry = 3; + do { remote = fetchXGetURL(url, &st, ""); - if (remote == NULL) { - --retry; - if (retry == 0) { - warnx("Error fetching %s: %s", url, - fetchLastErrString); - ret = 1; - goto cleanup; - } + if (remote == NULL) sleep(1); - } - } + } while (remote == NULL && retry-- > 0); + + if (remote == NULL) + goto fetchfail; - begin_dl = time(NULL); while (done < st.size) { if ((r = fread(buf, 1, sizeof(buf), remote)) < 1) break; if (write(fd, buf, r) != r) { warn("write()"); - ret = -1; goto cleanup; } done += r; now = time(NULL); - if (now > last || done == st.size) { + if (now > last || done == st.size) last = now; - } } - if (ferror(remote)) { - warnx("Error fetching %s: %s", url, - fetchLastErrString); - ret = 1; - goto cleanup; - } + if (ferror(remote)) + goto fetchfail; if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) ret = install_pkg_static(pkgstatic, tmppkg); + snprintf(conf, MAXPATHLEN, "%s/etc/pkg.conf", + getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); + + if (access(conf, R_OK) == -1) { + site = strrchr(url, '/'); + if (site == NULL) + goto cleanup; + site[0] = '\0'; + site = strrchr(url, '/'); + if (site == NULL) + goto cleanup; + site[0] = '\0'; + + config = fopen(conf, "w+"); + if (config == NULL) + goto cleanup; + fprintf(config, "packagesite: %s", url); + fclose(config); + } + + goto cleanup; + +fetchfail: + warnx("Error fetching %s: %s", url, fetchLastErrString); + cleanup: + if (remote != NULL) + fclose(remote); close(fd); unlink(tmppkg); - return 0; + return (ret); } int -main(__unused int argc, char * argv[]) +main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", - getenv("LOCALBASE") ? getenv("LOCALBASE"): _LOCALBASE); + getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); if (access(pkgpath, X_OK) == -1) - bootstrap_pkg(); + if (bootstrap_pkg() != 0) + exit(EXIT_FAILURE); execv(pkgpath, argv); - return (EXIT_SUCCESS); + /* NOT REACHED */ + return (EXIT_FAILURE); } From owner-svn-src-all@FreeBSD.ORG Mon May 7 02:50:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D29106564A; Mon, 7 May 2012 02:50:53 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C63F8FC0A; Mon, 7 May 2012 02:50:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q472oqlr042930; Mon, 7 May 2012 02:50:52 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q472oqYG042928; Mon, 7 May 2012 02:50:52 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201205070250.q472oqYG042928@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 7 May 2012 02:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235116 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 02:50:53 -0000 Author: stas Date: Mon May 7 02:50:52 2012 New Revision: 235116 URL: http://svn.freebsd.org/changeset/base/235116 Log: - Bump the manpage date after kfd addition. Reported by: gjb Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon May 7 00:39:47 2012 (r235115) +++ head/share/man/man5/rc.conf.5 Mon May 7 02:50:52 2012 (r235116) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2012 +.Dd May 06, 2012 .Dt RC.CONF 5 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon May 7 04:15:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F03106564A; Mon, 7 May 2012 04:15:47 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1A298FC19; Mon, 7 May 2012 04:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q474Fkms045878; Mon, 7 May 2012 04:15:46 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q474Fknx045874; Mon, 7 May 2012 04:15:46 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201205070415.q474Fknx045874@svn.freebsd.org> From: Juli Mallett Date: Mon, 7 May 2012 04:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235117 - in head/sys: dev/gxemul/ether mips/conf mips/gxemul X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 04:15:47 -0000 Author: jmallett Date: Mon May 7 04:15:46 2012 New Revision: 235117 URL: http://svn.freebsd.org/changeset/base/235117 Log: Add a trivial driver for the GXemul Ethernet device. Probably quite buggy and certainly non-optimal, but enough for basic networking use. Requested by: rwatson Added: head/sys/dev/gxemul/ether/ head/sys/dev/gxemul/ether/gxreg.h (contents, props changed) head/sys/dev/gxemul/ether/if_gx.c (contents, props changed) Modified: head/sys/mips/conf/GXEMUL head/sys/mips/gxemul/files.gxemul Added: head/sys/dev/gxemul/ether/gxreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gxemul/ether/gxreg.h Mon May 7 04:15:46 2012 (r235117) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2008-2012 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_GXEMUL_ETHER_GXREG_H_ +#define _DEV_GXEMUL_ETHER_GXREG_H_ + +#define GXEMUL_ETHER_DEV_BASE (0x14000000) +#define GXEMUL_ETHER_DEV_IRQ (3) + +#define GXEMUL_ETHER_DEV_MTU (0x4000) + +#define GXEMUL_ETHER_DEV_BUFFER (0x0000) +#define GXEMUL_ETHER_DEV_STATUS (0x4000) +#define GXEMUL_ETHER_DEV_LENGTH (0x4010) +#define GXEMUL_ETHER_DEV_COMMAND (0x4020) +#define GXEMUL_ETHER_DEV_MAC (0x4040) + +#define GXEMUL_ETHER_DEV_FUNCTION(f) \ + (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_ETHER_DEV_BASE + (f)) +#define GXEMUL_ETHER_DEV_READ(f) \ + (volatile uint64_t)*GXEMUL_ETHER_DEV_FUNCTION(f) +#define GXEMUL_ETHER_DEV_WRITE(f, v) \ + *GXEMUL_ETHER_DEV_FUNCTION(f) = (v) + +#define GXEMUL_ETHER_DEV_STATUS_RX_OK (0x01) +#define GXEMUL_ETHER_DEV_STATUS_RX_MORE (0x02) + +#define GXEMUL_ETHER_DEV_COMMAND_RX (0x00) +#define GXEMUL_ETHER_DEV_COMMAND_TX (0x01) + +#endif /* !_DEV_GXEMUL_ETHER_GXREG_H_ */ Added: head/sys/dev/gxemul/ether/if_gx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gxemul/ether/if_gx.c Mon May 7 04:15:46 2012 (r235117) @@ -0,0 +1,398 @@ +/*- + * Copyright (c) 2008-2012 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "opt_inet.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INET +#include +#include +#endif + +#include + +#include + +struct gx_softc { + struct ifnet *sc_ifp; + device_t sc_dev; + unsigned sc_port; + int sc_flags; + struct ifmedia sc_ifmedia; + struct resource *sc_intr; + void *sc_intr_cookie; + struct mtx sc_mtx; +}; + +#define GXEMUL_ETHER_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define GXEMUL_ETHER_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) + +static void gx_identify(driver_t *, device_t); +static int gx_probe(device_t); +static int gx_attach(device_t); +static int gx_detach(device_t); +static int gx_shutdown(device_t); + +static void gx_init(void *); +static int gx_transmit(struct ifnet *, struct mbuf *); + +static int gx_medchange(struct ifnet *); +static void gx_medstat(struct ifnet *, struct ifmediareq *); + +static int gx_ioctl(struct ifnet *, u_long, caddr_t); + +static void gx_rx_intr(void *); + +static device_method_t gx_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, gx_identify), + DEVMETHOD(device_probe, gx_probe), + DEVMETHOD(device_attach, gx_attach), + DEVMETHOD(device_detach, gx_detach), + DEVMETHOD(device_shutdown, gx_shutdown), + + { 0, 0 } +}; + +static driver_t gx_driver = { + "gx", + gx_methods, + sizeof (struct gx_softc), +}; + +static devclass_t gx_devclass; + +DRIVER_MODULE(gx, nexus, gx_driver, gx_devclass, 0, 0); + +static void +gx_identify(driver_t *drv, device_t parent) +{ + BUS_ADD_CHILD(parent, 0, "gx", 0); +} + +static int +gx_probe(device_t dev) +{ + if (device_get_unit(dev) != 0) + return (ENXIO); + + device_set_desc(dev, "GXemul test Ethernet"); + + return (0); +} + +static int +gx_attach(device_t dev) +{ + struct ifnet *ifp; + struct gx_softc *sc; + uint8_t mac[6]; + int error; + int rid; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_port = device_get_unit(dev); + + /* Read MAC address. */ + GXEMUL_ETHER_DEV_WRITE(GXEMUL_ETHER_DEV_MAC, (uintptr_t)mac); + + /* Allocate and establish interrupt. */ + rid = 0; + sc->sc_intr = bus_alloc_resource(sc->sc_dev, SYS_RES_IRQ, &rid, + GXEMUL_ETHER_DEV_IRQ - 2, GXEMUL_ETHER_DEV_IRQ - 2, 1, RF_ACTIVE); + if (sc->sc_intr == NULL) { + device_printf(dev, "unable to allocate IRQ.\n"); + return (ENXIO); + } + + error = bus_setup_intr(sc->sc_dev, sc->sc_intr, INTR_TYPE_NET, NULL, + gx_rx_intr, sc, &sc->sc_intr_cookie); + if (error != 0) { + device_printf(dev, "unable to setup interrupt.\n"); + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_intr); + return (ENXIO); + } + + bus_describe_intr(sc->sc_dev, sc->sc_intr, sc->sc_intr_cookie, "rx"); + + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "cannot allocate ifnet.\n"); + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_intr); + return (ENOMEM); + } + + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_mtu = ETHERMTU; + ifp->if_init = gx_init; + ifp->if_softc = sc; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | IFF_ALLMULTI; + ifp->if_ioctl = gx_ioctl; + + sc->sc_ifp = ifp; + sc->sc_flags = ifp->if_flags; + + ifmedia_init(&sc->sc_ifmedia, 0, gx_medchange, gx_medstat); + + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->sc_ifmedia, IFM_ETHER | IFM_AUTO); + + mtx_init(&sc->sc_mtx, "GXemul Ethernet", NULL, MTX_DEF); + + ether_ifattach(ifp, mac); + + ifp->if_transmit = gx_transmit; + + return (bus_generic_attach(dev)); +} + +static int +gx_detach(device_t dev) +{ + struct gx_softc *sc; + + sc = device_get_softc(dev); + + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_intr); + /* XXX Incomplete. */ + + return (0); +} + +static int +gx_shutdown(device_t dev) +{ + return (gx_detach(dev)); +} + +static void +gx_init(void *arg) +{ + struct ifnet *ifp; + struct gx_softc *sc; + + sc = arg; + ifp = sc->sc_ifp; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; +} + +static int +gx_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct gx_softc *sc; + + sc = ifp->if_softc; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != IFF_DRV_RUNNING) { + m_freem(m); + return (0); + } + + GXEMUL_ETHER_LOCK(sc); + GXEMUL_ETHER_DEV_WRITE(GXEMUL_ETHER_DEV_LENGTH, m->m_pkthdr.len); + m_copydata(m, 0, m->m_pkthdr.len, (void *)(uintptr_t)GXEMUL_ETHER_DEV_FUNCTION(GXEMUL_ETHER_DEV_BUFFER)); + GXEMUL_ETHER_DEV_WRITE(GXEMUL_ETHER_DEV_COMMAND, GXEMUL_ETHER_DEV_COMMAND_TX); + GXEMUL_ETHER_UNLOCK(sc); + + ETHER_BPF_MTAP(ifp, m); + + ifp->if_opackets++; + ifp->if_obytes += m->m_pkthdr.len; + + m_freem(m); + + return (0); +} + +static int +gx_medchange(struct ifnet *ifp) +{ + return (ENOTSUP); +} + +static void +gx_medstat(struct ifnet *ifp, struct ifmediareq *ifm) +{ + struct gx_softc *sc; + + sc = ifp->if_softc; + + /* Lie amazingly. */ + ifm->ifm_status = IFM_AVALID | IFM_ACTIVE; + ifm->ifm_active = IFT_ETHER | IFM_1000_T | IFM_FDX; +} + +static int +gx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct gx_softc *sc; + struct ifreq *ifr; +#ifdef INET + struct ifaddr *ifa; +#endif + int error; + + sc = ifp->if_softc; + ifr = (struct ifreq *)data; +#ifdef INET + ifa = (struct ifaddr *)data; +#endif + + switch (cmd) { + case SIOCSIFADDR: +#ifdef INET + /* + * Avoid reinitialization unless it's necessary. + */ + if (ifa->ifa_addr->sa_family == AF_INET) { + ifp->if_flags |= IFF_UP; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + gx_init(sc); + arp_ifinit(ifp, ifa); + + return (0); + } +#endif + error = ether_ioctl(ifp, cmd, data); + if (error != 0) + return (error); + return (0); + + case SIOCSIFFLAGS: + if (ifp->if_flags == sc->sc_flags) + return (0); + if ((ifp->if_flags & IFF_UP) != 0) { + gx_init(sc); + } else { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + } + } + sc->sc_flags = ifp->if_flags; + return (0); + + case SIOCSIFMTU: + if (ifr->ifr_mtu + ifp->if_data.ifi_hdrlen > GXEMUL_ETHER_DEV_MTU) + return (ENOTSUP); + return (0); + + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, cmd); + if (error != 0) + return (error); + return (0); + + default: + error = ether_ioctl(ifp, cmd, data); + if (error != 0) + return (error); + return (0); + } +} + +static void +gx_rx_intr(void *arg) +{ + struct gx_softc *sc = arg; + + GXEMUL_ETHER_LOCK(sc); + for (;;) { + uint64_t status, length; + struct mbuf *m; + + /* + * XXX + * Limit number of packets received at once? + */ + status = GXEMUL_ETHER_DEV_READ(GXEMUL_ETHER_DEV_STATUS); + if (status == GXEMUL_ETHER_DEV_STATUS_RX_MORE) { + GXEMUL_ETHER_DEV_WRITE(GXEMUL_ETHER_DEV_COMMAND, GXEMUL_ETHER_DEV_COMMAND_RX); + continue; + } + if (status != GXEMUL_ETHER_DEV_STATUS_RX_OK) + break; + length = GXEMUL_ETHER_DEV_READ(GXEMUL_ETHER_DEV_LENGTH); + if (length > MCLBYTES - ETHER_ALIGN) { + sc->sc_ifp->if_ierrors++; + continue; + } + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) { + device_printf(sc->sc_dev, "no memory for receive mbuf.\n"); + sc->sc_ifp->if_iqdrops++; + GXEMUL_ETHER_UNLOCK(sc); + return; + } + + /* Align incoming frame so IP headers are aligned. */ + m->m_data += ETHER_ALIGN; + + memcpy(m->m_data, (const void *)(uintptr_t)GXEMUL_ETHER_DEV_FUNCTION(GXEMUL_ETHER_DEV_BUFFER), length); + + m->m_pkthdr.rcvif = sc->sc_ifp; + m->m_pkthdr.len = m->m_len = length; + + sc->sc_ifp->if_ipackets++; + + GXEMUL_ETHER_UNLOCK(sc); + + (*sc->sc_ifp->if_input)(sc->sc_ifp, m); + + GXEMUL_ETHER_LOCK(sc); + } + GXEMUL_ETHER_UNLOCK(sc); +} Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Mon May 7 02:50:52 2012 (r235116) +++ head/sys/mips/conf/GXEMUL Mon May 7 04:15:46 2012 (r235117) @@ -27,6 +27,8 @@ options DDB options KDB options SCHED_ULE +options INET # InterNETworking +options INET6 # IPv6 communications protocols options FFS #Berkeley Fast Filesystem @@ -41,6 +43,18 @@ options ROOTDEVNAME=\"ufs:gxemul_disk0\ device gxemul_cons device gxemul_disk -device md -device loop -device random +device gxemul_ether + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter Modified: head/sys/mips/gxemul/files.gxemul ============================================================================== --- head/sys/mips/gxemul/files.gxemul Mon May 7 02:50:52 2012 (r235116) +++ head/sys/mips/gxemul/files.gxemul Mon May 7 04:15:46 2012 (r235117) @@ -5,4 +5,4 @@ mips/mips/intr_machdep.c standard mips/mips/tick.c standard dev/gxemul/disk/gxemul_disk.c optional gxemul_disk -dev/gxemul/ether/gxemul_ether.c optional gxemul_ether +dev/gxemul/ether/if_gx.c optional gxemul_ether From owner-svn-src-all@FreeBSD.ORG Mon May 7 04:36:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D39211065673; Mon, 7 May 2012 04:36:48 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE3D58FC08; Mon, 7 May 2012 04:36:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q474amWp046585; Mon, 7 May 2012 04:36:48 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q474amCk046581; Mon, 7 May 2012 04:36:48 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201205070436.q474amCk046581@svn.freebsd.org> From: Juli Mallett Date: Mon, 7 May 2012 04:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235118 - in head/sys/mips: conf gxemul X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 04:36:48 -0000 Author: jmallett Date: Mon May 7 04:36:48 2012 New Revision: 235118 URL: http://svn.freebsd.org/changeset/base/235118 Log: Add basic SMP support for GXemul. Ideally we would have some way to override some of the IPI mechanisms used by the common MIPS SMP code so we could use the multicast IPI facilities, on GXemul as well as on several real hardware platforms, and the ability to have multiple hard IPI types. Modified: head/sys/mips/conf/GXEMUL head/sys/mips/gxemul/gxemul_machdep.c head/sys/mips/gxemul/mpreg.h Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Mon May 7 04:15:46 2012 (r235117) +++ head/sys/mips/conf/GXEMUL Mon May 7 04:36:48 2012 (r235118) @@ -26,6 +26,9 @@ makeoptions MODULES_OVERRIDE="" options DDB options KDB +# Make an SMP-capable kernel by default +options SMP # Symmetric MultiProcessor Kernel + options SCHED_ULE options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/mips/gxemul/gxemul_machdep.c ============================================================================== --- head/sys/mips/gxemul/gxemul_machdep.c Mon May 7 04:15:46 2012 (r235117) +++ head/sys/mips/gxemul/gxemul_machdep.c Mon May 7 04:36:48 2012 (r235118) @@ -62,6 +62,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef SMP +#include +#include +#endif + #include extern int *edata; @@ -167,3 +172,67 @@ platform_start(__register_t a0, __regist mips_timer_init_params(platform_counter_freq, 0); } + +#ifdef SMP +void +platform_ipi_send(int cpuid) +{ + GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_IPI_ONE, (1 << 16) | cpuid); +} + +void +platform_ipi_clear(void) +{ + GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_IPI_READ, 0); +} + +int +platform_ipi_intrnum(void) +{ + return (GXEMUL_MP_DEV_IPI_INTERRUPT - 2); +} + +struct cpu_group * +platform_smp_topo(void) +{ + return (smp_topo_none()); +} + +void +platform_init_ap(int cpuid) +{ + int ipi_int_mask, clock_int_mask; + + /* + * Unmask the clock and ipi interrupts. + */ + clock_int_mask = hard_int_mask(5); + ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); + set_intr_mask(ipi_int_mask | clock_int_mask); +} + +void +platform_cpu_mask(cpuset_t *mask) +{ + unsigned i, n; + + n = GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_NCPUS); + CPU_ZERO(mask); + for (i = 0; i < n; i++) + CPU_SET(i, mask); +} + +int +platform_processor_id(void) +{ + return (GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_WHOAMI)); +} + +int +platform_start_ap(int cpuid) +{ + GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_STARTADDR, (intptr_t)mpentry); + GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_START, cpuid); + return (0); +} +#endif /* SMP */ Modified: head/sys/mips/gxemul/mpreg.h ============================================================================== --- head/sys/mips/gxemul/mpreg.h Mon May 7 04:15:46 2012 (r235117) +++ head/sys/mips/gxemul/mpreg.h Mon May 7 04:36:48 2012 (r235118) @@ -36,10 +36,12 @@ #define GXEMUL_MP_DEV_START 0x0020 #define GXEMUL_MP_DEV_STARTADDR 0x0030 #define GXEMUL_MP_DEV_STACK 0x0070 +#define GXEMUL_MP_DEV_RANDOM 0x0080 #define GXEMUL_MP_DEV_MEMORY 0x0090 #define GXEMUL_MP_DEV_IPI_ONE 0x00a0 #define GXEMUL_MP_DEV_IPI_MANY 0x00b0 #define GXEMUL_MP_DEV_IPI_READ 0x00c0 +#define GXEMUL_MP_DEV_CYCLES 0x00d0 #define GXEMUL_MP_DEV_FUNCTION(f) \ (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_MP_DEV_BASE + (f)) From owner-svn-src-all@FreeBSD.ORG Mon May 7 04:56:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14C301065670; Mon, 7 May 2012 04:56:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C368FC08; Mon, 7 May 2012 04:56:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q474uQut047201; Mon, 7 May 2012 04:56:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q474uQvZ047199; Mon, 7 May 2012 04:56:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205070456.q474uQvZ047199@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 May 2012 04:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235119 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 04:56:27 -0000 Author: yongari Date: Mon May 7 04:56:26 2012 New Revision: 235119 URL: http://svn.freebsd.org/changeset/base/235119 Log: Restore jumbo frame configuration which was broken in r218423. Submitted by: Andrey Zonov zonov dot org > (initial version) Tested by: Andrey Zonov zonov dot org > MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon May 7 04:36:48 2012 (r235118) +++ head/sys/dev/bce/if_bce.c Mon May 7 04:56:26 2012 (r235119) @@ -6842,6 +6842,8 @@ bce_init_locked(struct bce_softc *sc) bcopy(IF_LLADDR(sc->bce_ifp), sc->eaddr, ETHER_ADDR_LEN); bce_set_mac_addr(sc); + if (bce_hdr_split == FALSE) + bce_get_rx_buffer_sizes(sc, ifp->if_mtu); /* * Calculate and program the hardware Ethernet MTU * size. Be generous on the receive if we have room @@ -7436,22 +7438,10 @@ bce_ioctl(struct ifnet *ifp, u_long comm BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - - if (bce_hdr_split == FALSE) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - /* - * Because allocation size is used in RX - * buffer allocation, stop controller if - * it is already running. - */ - bce_stop(sc); - } - - bce_get_rx_buffer_sizes(sc, ifp->if_mtu); - + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bce_init_locked(sc); } - BCE_UNLOCK(sc); break; From owner-svn-src-all@FreeBSD.ORG Mon May 7 07:04:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA337106566C; Mon, 7 May 2012 07:04:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 995158FC15; Mon, 7 May 2012 07:04:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4774gUo051367; Mon, 7 May 2012 07:04:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4774ghF051352; Mon, 7 May 2012 07:04:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205070704.q4774ghF051352@svn.freebsd.org> From: Marius Strobl Date: Mon, 7 May 2012 07:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235121 - in stable/8/sys: arm/at91 conf ddb dev/cfe dev/dcons dev/ofw dev/sio dev/syscons dev/uart i386/conf kern modules/dcons modules/sio pc98/cbus sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 07:04:42 -0000 Author: marius Date: Mon May 7 07:04:41 2012 New Revision: 235121 URL: http://svn.freebsd.org/changeset/base/235121 Log: MFC: r225203 (partial) Attempt to make break-to-debugger and alternative break-to-debugger more accessible: (1) Always compile in support for breaking into the debugger if options KDB is present in the kernel. (2) Disable both by default, but allow them to be enabled via tunables and sysctls debug.kdb.break_to_debugger and debug.kdb.alt_break_to_debugger. (3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue to behave as before -- only now instead of compiling in break-to-debugger support, they change the default values of the above sysctls to enable those features by default. Current kernel configurations should, therefore, continue to behave as expected. (4) Migrate alternative break-to-debugger state machine logic out of individual device drivers into centralised KDB code. This has a number of upsides, but also one downside: it's now tricky to release sio spin locks when entering the debugger, so we don't. However, similar logic does not exist in other device drivers, including uart. (5) dcons requires some special handling; unlike other console types, it allows overriding KDB's own debugger selection, so we need a new interface to KDB to allow that to work. GENERIC kernels will now support break-to-debugger as long as appropriate boot/run-time options are set, which should improve the debuggability of kernels significantly. MFC: r225214 (partial) Follow up to r225203 refining break-to-debugger run-time configuration improvements: (1) Implement new model in previously missed at91 UART driver (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h to opt_kdb.h (spotted by np) (3) Garbage collect now-unused opt_comconsole.h Modified: stable/8/sys/arm/at91/uart_dev_at91usart.c stable/8/sys/conf/options stable/8/sys/ddb/db_break.c stable/8/sys/dev/cfe/cfe_console.c stable/8/sys/dev/dcons/dcons_os.c stable/8/sys/dev/ofw/ofw_console.c stable/8/sys/dev/sio/sio.c stable/8/sys/dev/syscons/syscons.c stable/8/sys/dev/uart/uart_core.c stable/8/sys/kern/subr_kdb.c stable/8/sys/modules/dcons/Makefile stable/8/sys/modules/sio/Makefile stable/8/sys/pc98/cbus/sio.c stable/8/sys/sys/kdb.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/8/sys/arm/at91/uart_dev_at91usart.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/arm/at91/uart_dev_at91usart.c Mon May 7 07:04:41 2012 (r235121) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include @@ -508,25 +506,10 @@ at91_usart_bus_param(struct uart_softc * static __inline void at91_rx_put(struct uart_softc *sc, int key) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { - if ((kdb_brk = kdb_alt_break(key, &sc->sc_altbrk)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } - } +#if defined(KDB) + if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) + kdb_alt_break(key, &sc->sc_altbrk); #endif uart_rx_put(sc, key); } Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/conf/options Mon May 7 07:04:41 2012 (r235121) @@ -47,6 +47,8 @@ TWA_DEBUG opt_twa.h TWA_FLASH_FIRMWARE opt_twa.h # Debugging options. +ALT_BREAK_TO_DEBUGGER opt_kdb.h +BREAK_TO_DEBUGGER opt_kdb.h DDB DDB_BUFR_SIZE opt_ddb.h DDB_CAPTURE_DEFAULTBUFSIZE opt_ddb.h @@ -631,9 +633,6 @@ BKTR_SIS_VIA_MODE opt_bktr.h BKTR_USE_FREEBSD_SMBUS opt_bktr.h BKTR_NEW_MSP34XX_DRIVER opt_bktr.h -BREAK_TO_DEBUGGER opt_comconsole.h -ALT_BREAK_TO_DEBUGGER opt_comconsole.h - # Options to support PPS UART_PPS_ON_CTS opt_uart.h Modified: stable/8/sys/ddb/db_break.c ============================================================================== --- stable/8/sys/ddb/db_break.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/ddb/db_break.c Mon May 7 07:04:41 2012 (r235121) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include Modified: stable/8/sys/dev/cfe/cfe_console.c ============================================================================== --- stable/8/sys/dev/cfe/cfe_console.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/dev/cfe/cfe_console.c Mon May 7 07:04:41 2012 (r235121) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include @@ -67,7 +65,7 @@ static int polltime; static struct callout_handle cfe_timeouthandle = CALLOUT_HANDLE_INITIALIZER(&cfe_timeouthandle); -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) static int alt_break_state; #endif @@ -191,24 +189,8 @@ cfe_cngetc(struct consdev *cp) unsigned char ch; if (cfe_read(conhandle, &ch, 1) == 1) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - - } - } +#if defined(KDB) + kdb_alt_break(ch, &alt_break_state); #endif return (ch); } Modified: stable/8/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/8/sys/dev/dcons/dcons_os.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/dev/dcons/dcons_os.c Mon May 7 07:04:41 2012 (r235121) @@ -64,7 +64,6 @@ #include #include -#include "opt_comconsole.h" #include "opt_dcons.h" #include "opt_kdb.h" #include "opt_gdb.h" @@ -133,38 +132,21 @@ static struct ttydevsw dcons_ttydevsw = .tsw_outwakeup = dcons_outwakeup, }; -#if (defined(GDB) || defined(DDB)) && defined(ALT_BREAK_TO_DEBUGGER) +#if (defined(GDB) || defined(DDB)) static int dcons_check_break(struct dcons_softc *dc, int c) { - int kdb_brk; if (c < 0) return (c); - if ((kdb_brk = kdb_alt_break(c, &dc->brk_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - if ((dc->flags & DC_GDB) != 0) { #ifdef GDB - if (gdb_cur == &dcons_gdb_dbgport) { - kdb_dbbe_select("gdb"); - kdb_enter(KDB_WHY_BREAK, - "Break sequence on dcons gdb port"); - } -#endif - } else - kdb_enter(KDB_WHY_BREAK, - "Break sequence on dcons console port"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on dcons console port"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } + if ((dc->flags & DC_GDB) != 0 && gdb_cur == &dcons_gdb_dbgport) + kdb_alt_break_gdb(c, &dc->brk_state); + else +#endif + kdb_alt_break(c, &dc->brk_state); + return (c); } #else Modified: stable/8/sys/dev/ofw/ofw_console.c ============================================================================== --- stable/8/sys/dev/ofw/ofw_console.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/dev/ofw/ofw_console.c Mon May 7 07:04:41 2012 (r235121) @@ -26,7 +26,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" #include "opt_ofw.h" #include @@ -64,7 +63,7 @@ static int polltime; static struct callout_handle ofw_timeouthandle = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) static int alt_break_state; #endif @@ -199,24 +198,8 @@ ofw_cngetc(struct consdev *cp) unsigned char ch; if (OF_read(stdin, &ch, 1) > 0) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - - } - } +#if defined(KDB) + kdb_alt_break(ch, &alt_break_state); #endif return (ch); } Modified: stable/8/sys/dev/sio/sio.c ============================================================================== --- stable/8/sys/dev/sio/sio.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/dev/sio/sio.c Mon May 7 07:04:41 2012 (r235121) @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" #include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" @@ -228,7 +227,7 @@ struct com_s { struct pps_state pps; int pps_bit; -#ifdef ALT_BREAK_TO_DEBUGGER +#ifdef KDB int alt_brk_state; #endif @@ -1102,8 +1101,7 @@ determined_type: ; } if (ret) device_printf(dev, "could not activate interrupt\n"); -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Enable interrupts for early break-to-debugger support * on the console. @@ -1196,8 +1194,7 @@ comclose(tp) com->poll_output = FALSE; sio_setreg(com, com_cfcr, com->cfcr_image &= ~CFCR_SBREAK); -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Leave interrupts enabled and don't clear DTR if this is the * console. This allows us to detect break-to-debugger events @@ -1484,9 +1481,8 @@ siointr1(com) u_char modem_status; u_char *ioptr; u_char recv_data; -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; +#ifdef KDB again: #endif @@ -1519,27 +1515,9 @@ again: else recv_data = inb(com->data_port); #ifdef KDB -#ifdef ALT_BREAK_TO_DEBUGGER if (com->unit == comconsole && - (kdb_brk = kdb_alt_break(recv_data, - &com->alt_brk_state)) != 0) { - mtx_unlock_spin(&sio_lock); - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("panic on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - mtx_lock_spin(&sio_lock); + kdb_alt_break(recv_data, &com->alt_brk_state) != 0) goto again; - } -#endif /* ALT_BREAK_TO_DEBUGGER */ #endif /* KDB */ if (line_status & (LSR_BI | LSR_FE | LSR_PE)) { /* @@ -1555,10 +1533,9 @@ again: * Note: BI together with FE/PE means just BI. */ if (line_status & LSR_BI) { -#if defined(KDB) && defined(BREAK_TO_DEBUGGER) +#if defined(KDB) if (com->unit == comconsole) { - kdb_enter(KDB_WHY_BREAK, - "Line break on console"); + kdb_break(); goto cont; } #endif Modified: stable/8/sys/dev/syscons/syscons.c ============================================================================== --- stable/8/sys/dev/syscons/syscons.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/dev/syscons/syscons.c Mon May 7 07:04:41 2012 (r235121) @@ -3426,7 +3426,7 @@ next_code: case DBG: #ifndef SC_DISABLE_KDBKEY if (enable_kdbkey) - kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); + kdb_break(); #endif break; Modified: stable/8/sys/dev/uart/uart_core.c ============================================================================== --- stable/8/sys/dev/uart/uart_core.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/dev/uart/uart_core.c Mon May 7 07:04:41 2012 (r235121) @@ -27,10 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef KLD_MODULE -#include "opt_comconsole.h" -#endif - #include #include #include @@ -119,10 +115,10 @@ uart_intr_break(void *arg) { struct uart_softc *sc = arg; -#if defined(KDB) && defined(BREAK_TO_DEBUGGER) +#if defined(KDB) if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { - kdb_enter(KDB_WHY_BREAK, "Line break on console"); - return (0); + if (kdb_break()) + return (0); } #endif if (sc->sc_opened) @@ -171,26 +167,10 @@ uart_intr_rxready(void *arg) rxp = sc->sc_rxput; UART_RECEIVE(sc); -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { while (rxp != sc->sc_rxput) { - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(sc->sc_rxbuf[rxp++], - &sc->sc_altbrk)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } + kdb_alt_break(sc->sc_rxbuf[rxp++], &sc->sc_altbrk); if (rxp == sc->sc_rxbufsz) rxp = 0; } Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/kern/subr_kdb.c Mon May 7 07:04:41 2012 (r235121) @@ -56,6 +56,21 @@ struct pcb *kdb_thrctx = NULL; struct thread *kdb_thread = NULL; struct trapframe *kdb_frame = NULL; +#ifdef BREAK_TO_DEBUGGER +#define KDB_BREAK_TO_DEBUGGER 1 +#else +#define KDB_BREAK_TO_DEBUGGER 0 +#endif + +#ifdef ALT_BREAK_TO_DEBUGGER +#define KDB_ALT_BREAK_TO_DEBUGGER 1 +#else +#define KDB_ALT_BREAK_TO_DEBUGGER 0 +#endif + +static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; +static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; + KDB_BACKEND(null, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); @@ -86,6 +101,15 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap, SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); +SYSCTL_INT(_debug_kdb, OID_AUTO, break_to_debugger, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_TUN, &kdb_break_to_debugger, 0, "Enable break to debugger"); +TUNABLE_INT("debug.kdb.break_to_debugger", &kdb_break_to_debugger); + +SYSCTL_INT(_debug_kdb, OID_AUTO, alt_break_to_debugger, CTLTYPE_INT | + CTLFLAG_RW | CTLFLAG_TUN, &kdb_alt_break_to_debugger, 0, + "Enable alternative break to debugger"); +TUNABLE_INT("debug.kdb.alt_break_to_debugger", &kdb_alt_break_to_debugger); + /* * Flag indicating whether or not to IPI the other CPUs to stop them on * entering the debugger. Sometimes, this will result in a deadlock as @@ -260,7 +284,17 @@ kdb_reboot(void) #define KEY_CRTLR 18 /* ^R */ int -kdb_alt_break(int key, int *state) +kdb_break(void) +{ + + if (!kdb_break_to_debugger) + return (0); + kdb_enter(KDB_WHY_BREAK, "Break to debugger"); + return (KDB_REQ_DEBUGGER); +} + +static int +kdb_alt_break_state(int key, int *state) { int brk; @@ -286,6 +320,53 @@ kdb_alt_break(int key, int *state) return (brk); } +static int +kdb_alt_break_internal(int key, int *state, int force_gdb) +{ + int brk; + + if (!kdb_alt_break_to_debugger) + return (0); + brk = kdb_alt_break_state(key, state); + switch (brk) { + case KDB_REQ_DEBUGGER: + if (force_gdb) + kdb_dbbe_select("gdb"); + kdb_enter(KDB_WHY_BREAK, "Break to debugger"); + break; + + case KDB_REQ_PANIC: + if (force_gdb) + kdb_dbbe_select("gdb"); + kdb_panic("Panic sequence on console"); + break; + + case KDB_REQ_REBOOT: + kdb_reboot(); + break; + } + return (0); +} + +int +kdb_alt_break(int key, int *state) +{ + + return (kdb_alt_break_internal(key, state, 0)); +} + +/* + * This variation on kdb_alt_break() is used only by dcons, which has its own + * configuration flag to force GDB use regardless of the global KDB + * configuration. + */ +int +kdb_alt_break_gdb(int key, int *state) +{ + + return (kdb_alt_break_internal(key, state, 1)); +} + /* * Print a backtrace of the calling thread. The backtrace is generated by * the selected debugger, provided it supports backtraces. If no debugger Modified: stable/8/sys/modules/dcons/Makefile ============================================================================== --- stable/8/sys/modules/dcons/Makefile Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/modules/dcons/Makefile Mon May 7 07:04:41 2012 (r235121) @@ -5,7 +5,7 @@ KMOD = dcons SRCS = dcons.c dcons.h dcons_os.c dcons_os.h \ - opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h opt_comconsole.h + opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h .if !defined(KERNBUILDDIR) opt_kdb.h: @@ -13,9 +13,6 @@ opt_kdb.h: opt_ddb.h: echo "#define DDB 1" > $@ - -opt_comconsole.h: - echo "#define ALT_BREAK_TO_DEBUGGER 1" > $@ .endif CFLAGS+= -I${.CURDIR}/../.. Modified: stable/8/sys/modules/sio/Makefile ============================================================================== --- stable/8/sys/modules/sio/Makefile Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/modules/sio/Makefile Mon May 7 07:04:41 2012 (r235121) @@ -7,7 +7,7 @@ KMOD= sio SRCS= bus_if.h card_if.h device_if.h isa_if.h pci_if.h serdev_if.h \ - opt_comconsole.h opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ + opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ sio.c sio_pccard.c sio_pci.c sio_puc.c pccarddevs.h .if ${MACHINE} == "pc98" SRCS+= sio_cbus.c Modified: stable/8/sys/pc98/cbus/sio.c ============================================================================== --- stable/8/sys/pc98/cbus/sio.c Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/pc98/cbus/sio.c Mon May 7 07:04:41 2012 (r235121) @@ -31,7 +31,6 @@ * from: i386/isa sio.c,v 1.234 */ -#include "opt_comconsole.h" #include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" @@ -310,7 +309,7 @@ struct com_s { struct pps_state pps; int pps_bit; -#ifdef ALT_BREAK_TO_DEBUGGER +#ifdef KDB int alt_brk_state; #endif @@ -1752,8 +1751,7 @@ determined_type: ; } if (ret) device_printf(dev, "could not activate interrupt\n"); -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Enable interrupts for early break-to-debugger support * on the console. @@ -1896,8 +1894,7 @@ comclose(tp) sio_setreg(com, com_cfcr, com->cfcr_image &= ~CFCR_SBREAK); #endif -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Leave interrupts enabled and don't clear DTR if this is the * console. This allows us to detect break-to-debugger events @@ -2273,7 +2270,7 @@ siointr1(com) u_char rsa_buf_status = 0; int rsa_tx_fifo_size = 0; #endif /* PC98 */ -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) int kdb_brk; again: @@ -2370,27 +2367,11 @@ more_intr: else recv_data = inb(com->data_port); #ifdef KDB -#ifdef ALT_BREAK_TO_DEBUGGER if (com->unit == comconsole && (kdb_brk = kdb_alt_break(recv_data, &com->alt_brk_state)) != 0) { - mtx_unlock_spin(&sio_lock); - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("panic on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - mtx_lock_spin(&sio_lock); goto again; } -#endif /* ALT_BREAK_TO_DEBUGGER */ #endif /* KDB */ if (line_status & (LSR_BI | LSR_FE | LSR_PE)) { /* @@ -2406,7 +2387,7 @@ more_intr: * Note: BI together with FE/PE means just BI. */ if (line_status & LSR_BI) { -#if defined(KDB) && defined(BREAK_TO_DEBUGGER) +#if defined(KDB) if (com->unit == comconsole) { kdb_enter(KDB_WHY_BREAK, "Line break on console"); Modified: stable/8/sys/sys/kdb.h ============================================================================== --- stable/8/sys/sys/kdb.h Mon May 7 05:28:49 2012 (r235120) +++ stable/8/sys/sys/kdb.h Mon May 7 07:04:41 2012 (r235121) @@ -64,6 +64,8 @@ extern struct pcb *kdb_thrctx; /* Curre extern struct thread *kdb_thread; /* Current thread. */ int kdb_alt_break(int, int *); +int kdb_alt_break_gdb(int, int *); +int kdb_break(void); void kdb_backtrace(void); int kdb_dbbe_select(const char *); void kdb_enter(const char *, const char *); From owner-svn-src-all@FreeBSD.ORG Mon May 7 09:00:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94F67106566B; Mon, 7 May 2012 09:00:31 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8002F8FC14; Mon, 7 May 2012 09:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4790VeL055125; Mon, 7 May 2012 09:00:31 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4790VWq055121; Mon, 7 May 2012 09:00:31 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201205070900.q4790VWq055121@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 7 May 2012 09:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235122 - in head: . share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 09:00:31 -0000 Author: jlh Date: Mon May 7 09:00:30 2012 New Revision: 235122 URL: http://svn.freebsd.org/changeset/base/235122 Log: Introduce the ${SHLIB_LDSCRIPT} variable to have an ld(1) script instead of a symlink for .so files. Reviewed by: kib, kan (previous version), dim Approved by: kib (mentor) Silence from: -hackers@ MFC after: 1 week Modified: head/Makefile.inc1 head/share/mk/bsd.README head/share/mk/bsd.lib.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon May 7 07:04:41 2012 (r235121) +++ head/Makefile.inc1 Mon May 7 09:00:30 2012 (r235122) @@ -265,6 +265,7 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE # world stage WMAKEENV= ${CROSSENV} \ _SHLIBDIRPREFIX=${WORLDTMP} \ + _LDSCRIPTROOT= \ VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} @@ -307,6 +308,7 @@ LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMP # Yes, the flags are redundant. LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ _SHLIBDIRPREFIX=${LIB32TMP} \ + _LDSCRIPTROOT=${LIB32TMP} \ VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} \ @@ -319,11 +321,11 @@ LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DN -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ -DWITHOUT_HTML -DNO_CTF -DNO_LINT -ECC -ECXX -EAS -ELD \ DESTDIR=${LIB32TMP} -LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS +LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS .endif # install stage -IMAKEENV= ${CROSSENV} +IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Mon May 7 07:04:41 2012 (r235121) +++ head/share/mk/bsd.README Mon May 7 09:00:30 2012 (r235122) @@ -352,6 +352,10 @@ SRCS List of source files to build the to .c files of the same name. (This is not the default for versions of make.) +SHLIB_LDSCRIPT Template file to generate shared library linker script. + Unless used, a simple symlink is created to the real + shared object. + The include file includes the file named "../Makefile.inc" if it exists, as well as the include file . Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon May 7 07:04:41 2012 (r235121) +++ head/share/mk/bsd.lib.mk Mon May 7 09:00:30 2012 (r235122) @@ -271,6 +271,25 @@ _libinstall: ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) +# ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building +# and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory +# prefix where shared objects will be installed. ${_LDSCRIPTROOT} is the +# directory prefix that will be used in generated ld(1) scripts. They cannot +# be coalesced because of the way ld(1) handles the sysroot prefix (used in the +# cross-toolchain): +# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty. +# - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full +# path. Note that ld(1) scripts are generated both during buildworld and +# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty. +# On the other hand, the use of ${_SHLIBDIRPREFIX} is more consistent since it +# does not involve the logic of a tool we do not own. +.if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) + sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \ + -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \ + ${.CURDIR}/${SHLIB_LDSCRIPT} > lib${LIB}.ld + ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} lib${LIB}.ld ${DESTDIR}${LIBDIR}/${SHLIB_LINK} +.else .if ${SHLIBDIR} == ${LIBDIR} ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .else @@ -281,8 +300,9 @@ _libinstall: rm -f ${DESTDIR}${LIBDIR}/${SHLIB_NAME} .endif .endif -.endif -.endif +.endif # SHLIB_LDSCRIPT +.endif # SHLIB_LINK +.endif # SHIB_NAME .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR} @@ -350,6 +370,9 @@ clean: .endif .if defined(SHLIB_NAME) .if defined(SHLIB_LINK) +.if defined(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) + rm -f lib${LIB}.ld +.endif rm -f ${SHLIB_LINK} .endif .if defined(LIB) && !empty(LIB) From owner-svn-src-all@FreeBSD.ORG Mon May 7 10:46:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E87F5106566C; Mon, 7 May 2012 10:46:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8A798FC12; Mon, 7 May 2012 10:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q47AkQAP060564; Mon, 7 May 2012 10:46:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q47AkQUc060561; Mon, 7 May 2012 10:46:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205071046.q47AkQUc060561@svn.freebsd.org> From: Michael Tuexen Date: Mon, 7 May 2012 10:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235123 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 10:46:27 -0000 Author: tuexen Date: Mon May 7 10:46:26 2012 New Revision: 235123 URL: http://svn.freebsd.org/changeset/base/235123 Log: MFC r234832: Add support for missing gauth_number_of_chunks field. This Bug was found by Irene Ruengeler. Modified: stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Mon May 7 09:00:30 2012 (r235122) +++ stable/9/sys/netinet/sctp_uio.h Mon May 7 10:46:26 2012 (r235123) @@ -660,6 +660,7 @@ struct sctp_authkeyid { /* SCTP_PEER_AUTH_CHUNKS / SCTP_LOCAL_AUTH_CHUNKS */ struct sctp_authchunks { sctp_assoc_t gauth_assoc_id; + uint32_t gauth_number_of_chunks; uint8_t gauth_chunks[]; }; Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Mon May 7 09:00:30 2012 (r235122) +++ stable/9/sys/netinet/sctp_usrreq.c Mon May 7 10:46:26 2012 (r235123) @@ -2879,6 +2879,7 @@ flags_out: } else { /* copy in the chunks */ (void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks); + sac->gauth_number_of_chunks = (uint32_t) size; *optsize = sizeof(struct sctp_authchunks) + size; } SCTP_TCB_UNLOCK(stcb); @@ -2897,6 +2898,7 @@ flags_out: } else { /* copy in the chunks */ (void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks); + sac->gauth_number_of_chunks = (uint32_t) size; *optsize = sizeof(struct sctp_authchunks) + size; } SCTP_INP_RUNLOCK(inp); @@ -2927,6 +2929,7 @@ flags_out: } else { /* copy in the chunks */ (void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks); + sac->gauth_number_of_chunks = (uint32_t) size; *optsize = sizeof(struct sctp_authchunks) + size; } SCTP_TCB_UNLOCK(stcb); From owner-svn-src-all@FreeBSD.ORG Mon May 7 10:50:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 712B51065673; Mon, 7 May 2012 10:50:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8438FC0A; Mon, 7 May 2012 10:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q47AoRnp060737; Mon, 7 May 2012 10:50:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q47AoRMS060734; Mon, 7 May 2012 10:50:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205071050.q47AoRMS060734@svn.freebsd.org> From: Michael Tuexen Date: Mon, 7 May 2012 10:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235124 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2012 10:50:27 -0000 Author: tuexen Date: Mon May 7 10:50:26 2012 New Revision: 235124 URL: http://svn.freebsd.org/changeset/base/235124 Log: MFC r234951: Fix another RFC 6458 issue. Spotted by Irene Ruengeler. Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_uio.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Mon May 7 10:46:26 2012 (r235123) +++ stable/9/sys/netinet/sctp_output.c Mon May 7 10:50:26 2012 (r235124) @@ -3430,7 +3430,7 @@ sctp_find_cmsg(int c_type, void *data, s } m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); sndrcvinfo->sinfo_keynumber_valid = 1; - sndrcvinfo->sinfo_keynumber = authinfo.auth_keyid; + sndrcvinfo->sinfo_keynumber = authinfo.auth_keynumber; break; default: return (found); Modified: stable/9/sys/netinet/sctp_uio.h ======================================