From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 05:13:30 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 190762A4 for ; Sun, 25 Nov 2012 05:13:30 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 75E7D8FC15 for ; Sun, 25 Nov 2012 05:13:28 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so9693413lah.13 for ; Sat, 24 Nov 2012 21:13:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:disposition-notification-to:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:openpgp :content-type:content-transfer-encoding:x-gm-message-state; bh=Zj8Wd0LXkNNA4ro54XWMIxChI5KonKAWC47YM5bn4Bc=; b=OB2En4Yytxi0/6SuyU+1TnUKLShzwjhhEfyoMC23TztvPb9C+iLXL0/iki/drDmmD8 nywamBDmecaUrfxQhvRfNe7E0ZRjlWdRB62xDxHgRM7+Gz1GVoFKqtBbXZ/poudt74cv tYCIpdUHysmniXWj9vx/+lelbj0dGvYX6TvihYPPrTmBbkMFVlyMN9zLw3ddfIatuiR3 HpG3GjW5NIwREn2OrosEYcN3YVsplOMmdzmLHNnC1YPqdKD4u7fG67rzss09d3kVyMVT k7HJkmS2AqCayjy8ikw0lLIMxwYZicHu15T9b1T1B/mM4EO7No3vPMMR47YCJyGpqf7J Djyw== Received: by 10.112.48.40 with SMTP id i8mr3533254lbn.97.1353820407954; Sat, 24 Nov 2012 21:13:27 -0800 (PST) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPS id sj3sm3915623lab.2.2012.11.24.21.13.27 (version=SSLv3 cipher=OTHER); Sat, 24 Nov 2012 21:13:27 -0800 (PST) Message-ID: <50B1A8F8.9090302@freebsd.org> Date: Sun, 25 Nov 2012 09:13:28 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r243474 - head/usr.bin/cut References: <201211240415.qAO4FPaG062952@svn.freebsd.org> <50B07EB6.3010503@freebsd.org> <50B0D5B3.9000802@FreeBSD.org> <50B0DF04.5060001@freebsd.org> In-Reply-To: <50B0DF04.5060001@freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmdGosyXNziTabo6cIZPaUrBJxtydSbz3Jp86HPRtZAJFXUaQNuVx38m+NfEmRT0mALbf0q Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 05:13:30 -0000 On 24.11.2012 18:51, Andrey Chernov wrote: > On 24.11.2012 18:12, Dimitry Andric wrote: >>>> -is_delim(int ch) >>>> +is_delim(wchar_t ch) >>>> { >>>> if (wflag) { >>>> if (ch == ' ' || ch == '\t') >>>> >>> >>> I can't look at the whole code at this moment, but taking standalone >>> this is incorrect comparison for wchar_t. Should be L' ' and L'\t' >>> instead. >> >> The compiler just promotes the space and tab to wchar_t, this is only >> needed for the sake of consistency (and/or style). There is no binary >> change if you add the L prefixes. :) > > In general case byte order of type promotion is not necessary equal to > byte order of L'x' literals. > Forget to note that this point "The compiler just promotes the space and tab to wchar_t" is wrong. Since there are no direct (wchar_t) cast, compiler promotes both to the nearby integer type. From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 09:06:33 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 DBB9582C; Sun, 25 Nov 2012 09:06:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD6648FC08; Sun, 25 Nov 2012 09:06:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAP96WNb030300; Sun, 25 Nov 2012 09:06:32 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAP96W4D030291; Sun, 25 Nov 2012 09:06:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211250906.qAP96W4D030291@svn.freebsd.org> From: Martin Matuska Date: Sun, 25 Nov 2012 09:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243503 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 09:06:33 -0000 Author: mm Date: Sun Nov 25 09:06:32 2012 New Revision: 243503 URL: http://svnweb.freebsd.org/changeset/base/243503 Log: MFV r242735: Illumos 13879:4eac7a87eff2: 3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb() 3330 space_seg_t should have its own kmem_cache 3331 deferred frees should happen after sync_pass 1 3335 make SYNC_PASS_* constants tunable New loader-only tunables: vfs.zfs.sync_pass_deferred_free vfs.zfs.sync_pass_dont_compress vfs.zfs.sync_pass_rewrite References: https://www.illumos.org/issues/3329 https://www.illumos.org/issues/3330 https://www.illumos.org/issues/3331 https://www.illumos.org/issues/3335 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sun Nov 25 09:06:32 2012 (r243503) @@ -881,8 +881,9 @@ metaslab_activate(metaslab_t *msp, uint6 if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { space_map_load_wait(sm); if (!sm->sm_loaded) { - int error = space_map_load(sm, sm_ops, SM_FREE, - &msp->ms_smo, + space_map_obj_t *smo = &msp->ms_smo; + + int error = space_map_load(sm, sm_ops, SM_FREE, smo, spa_meta_objset(msp->ms_group->mg_vd->vdev_spa)); if (error) { metaslab_group_sort(msp->ms_group, msp, 0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 25 09:06:32 2012 (r243503) @@ -139,6 +139,7 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* u uint_t zio_taskq_basedc = 80; /* base duty cycle */ boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ +extern int zfs_sync_pass_deferred_free; /* * This (illegal) pool name is used when temporarily importing a spa_t in order @@ -6302,7 +6303,7 @@ spa_sync(spa_t *spa, uint64_t txg) spa_errlog_sync(spa, txg); dsl_pool_sync(dp, txg); - if (pass <= SYNC_PASS_DEFERRED_FREE) { + if (pass < zfs_sync_pass_deferred_free) { zio_t *zio = zio_root(spa, NULL, NULL, 0); bplist_iterate(free_bpl, spa_free_sync_cb, zio, tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Nov 25 09:06:32 2012 (r243503) @@ -1619,6 +1619,7 @@ spa_init(int mode) #endif /* illumos */ refcount_sysinit(); unique_init(); + space_map_init(); zio_init(); dmu_init(); zil_init(); @@ -1641,6 +1642,7 @@ spa_fini(void) zil_fini(); dmu_fini(); zio_fini(); + space_map_fini(); unique_fini(); refcount_fini(); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sun Nov 25 09:06:32 2012 (r243503) @@ -39,6 +39,23 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, space_map &space_map_last_hope, 0, "If kernel panic in space_map code on pool import, import the pool in readonly mode and backup all your data before trying this option."); +static kmem_cache_t *space_seg_cache; + +void +space_map_init(void) +{ + ASSERT(space_seg_cache == NULL); + space_seg_cache = kmem_cache_create("space_seg_cache", + sizeof (space_seg_t), 0, NULL, NULL, NULL, NULL, NULL, 0); +} + +void +space_map_fini(void) +{ + kmem_cache_destroy(space_seg_cache); + space_seg_cache = NULL; +} + /* * Space map routines. * NOTE: caller is responsible for all locking. @@ -148,7 +165,7 @@ again: avl_remove(sm->sm_pp_root, ss_after); } ss_after->ss_start = ss_before->ss_start; - kmem_free(ss_before, sizeof (*ss_before)); + kmem_cache_free(space_seg_cache, ss_before); ss = ss_after; } else if (merge_before) { ss_before->ss_end = end; @@ -161,7 +178,7 @@ again: avl_remove(sm->sm_pp_root, ss_after); ss = ss_after; } else { - ss = kmem_alloc(sizeof (*ss), KM_SLEEP); + ss = kmem_cache_alloc(space_seg_cache, KM_SLEEP); ss->ss_start = start; ss->ss_end = end; avl_insert(&sm->sm_root, ss, where); @@ -207,7 +224,7 @@ space_map_remove(space_map_t *sm, uint64 avl_remove(sm->sm_pp_root, ss); if (left_over && right_over) { - newseg = kmem_alloc(sizeof (*newseg), KM_SLEEP); + newseg = kmem_cache_alloc(space_seg_cache, KM_SLEEP); newseg->ss_start = end; newseg->ss_end = ss->ss_end; ss->ss_end = start; @@ -220,7 +237,7 @@ space_map_remove(space_map_t *sm, uint64 ss->ss_start = end; } else { avl_remove(&sm->sm_root, ss); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); ss = NULL; } @@ -260,7 +277,7 @@ space_map_vacate(space_map_t *sm, space_ while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { if (func != NULL) func(mdest, ss->ss_start, ss->ss_end - ss->ss_start); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } sm->sm_space = 0; } @@ -432,7 +449,7 @@ space_map_sync(space_map_t *sm, uint8_t spa_t *spa = dmu_objset_spa(os); void *cookie = NULL; space_seg_t *ss; - uint64_t bufsize, start, size, run_len; + uint64_t bufsize, start, size, run_len, delta, sm_space; uint64_t *entry, *entry_map, *entry_map_end; ASSERT(MUTEX_HELD(sm->sm_lock)); @@ -461,11 +478,13 @@ space_map_sync(space_map_t *sm, uint8_t SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) | SM_DEBUG_TXG_ENCODE(dmu_tx_get_txg(tx)); + delta = 0; + sm_space = sm->sm_space; while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { size = ss->ss_end - ss->ss_start; start = (ss->ss_start - sm->sm_start) >> sm->sm_shift; - sm->sm_space -= size; + delta += size; size >>= sm->sm_shift; while (size) { @@ -487,7 +506,7 @@ space_map_sync(space_map_t *sm, uint8_t start += run_len; size -= run_len; } - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } if (entry != entry_map) { @@ -499,8 +518,15 @@ space_map_sync(space_map_t *sm, uint8_t smo->smo_objsize += size; } + /* + * Ensure that the space_map's accounting wasn't changed + * while we were in the middle of writing it out. + */ + VERIFY3U(sm->sm_space, ==, sm_space); + zio_buf_free(entry_map, bufsize); + sm->sm_space -= delta; VERIFY0(sm->sm_space); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Sun Nov 25 09:06:32 2012 (r243503) @@ -21,7 +21,10 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright (c) 2011 by Delphix. All rights reserved. + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 25 09:06:32 2012 (r243503) @@ -489,14 +489,6 @@ extern int spa_scan_stop(spa_t *spa); extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ extern void spa_sync_allpools(void); -/* - * DEFERRED_FREE must be large enough that regular blocks are not - * deferred. XXX so can't we change it back to 1? - */ -#define SYNC_PASS_DEFERRED_FREE 2 /* defer frees after this pass */ -#define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ -#define SYNC_PASS_REWRITE 1 /* rewrite new bps after this pass */ - /* spa namespace global mutex */ extern kmutex_t spa_namespace_lock; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Sun Nov 25 09:06:32 2012 (r243503) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPACE_MAP_H #define _SYS_SPACE_MAP_H @@ -136,6 +140,8 @@ struct space_map_ops { typedef void space_map_func_t(space_map_t *sm, uint64_t start, uint64_t size); +extern void space_map_init(void); +extern void space_map_fini(void); extern void space_map_create(space_map_t *sm, uint64_t start, uint64_t size, uint8_t shift, kmutex_t *lp); extern void space_map_destroy(space_map_t *sm); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Sun Nov 25 09:06:32 2012 (r243503) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _ZIO_IMPL_H #define _ZIO_IMPL_H @@ -143,6 +147,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ + ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE | \ ZIO_STAGE_VDEV_IO_START | \ ZIO_STAGE_VDEV_IO_ASSESS) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Nov 24 13:23:15 2012 (r243502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Nov 25 09:06:32 2012 (r243503) @@ -107,6 +107,31 @@ extern vmem_t *zio_alloc_arena; extern int zfs_mg_alloc_failures; /* + * The following actions directly effect the spa's sync-to-convergence logic. + * The values below define the sync pass when we start performing the action. + * Care should be taken when changing these values as they directly impact + * spa_sync() performance. Tuning these values may introduce subtle performance + * pathologies and should only be done in the context of performance analysis. + * These tunables will eventually be removed and replaced with #defines once + * enough analysis has been done to determine optimal values. + * + * The 'zfs_sync_pass_deferred_free' pass must be greater than 1 to ensure that + * regular blocks are not deferred. + */ +int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_deferred_free", &zfs_sync_pass_deferred_free); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_deferred_free, CTLFLAG_RDTUN, + &zfs_sync_pass_deferred_free, 0, "defer frees starting in this pass"); +int zfs_sync_pass_dont_compress = 5; /* don't compress starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_dont_compress", &zfs_sync_pass_dont_compress); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_dont_compress, CTLFLAG_RDTUN, + &zfs_sync_pass_dont_compress, 0, "don't compress starting in this pass"); +int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_rewrite", &zfs_sync_pass_rewrite); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_rewrite, CTLFLAG_RDTUN, + &zfs_sync_pass_rewrite, 0, "rewrite new bps starting in this pass"); + +/* * An allocating zio is one that either currently has the DVA allocate * stage set or will have it later in its lifetime. */ @@ -742,7 +767,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui ASSERT(!BP_IS_HOLE(bp)); ASSERT(spa_syncing_txg(spa) == txg); - ASSERT(spa_sync_pass(spa) <= SYNC_PASS_DEFERRED_FREE); + ASSERT(spa_sync_pass(spa) < zfs_sync_pass_deferred_free); zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, @@ -1051,7 +1076,7 @@ zio_write_bp_init(zio_t *zio) ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); ASSERT(!BP_GET_DEDUP(bp)); - if (pass > SYNC_PASS_DONT_COMPRESS) + if (pass >= zfs_sync_pass_dont_compress) compress = ZIO_COMPRESS_OFF; /* Make sure someone doesn't change their mind on overwrites */ @@ -1080,7 +1105,7 @@ zio_write_bp_init(zio_t *zio) * There should only be a handful of blocks after pass 1 in any case. */ if (bp->blk_birth == zio->io_txg && BP_GET_PSIZE(bp) == psize && - pass > SYNC_PASS_REWRITE) { + pass >= zfs_sync_pass_rewrite) { ASSERT(psize != 0); enum zio_stage gang_stages = zio->io_pipeline & ZIO_GANG_STAGES; zio->io_pipeline = ZIO_REWRITE_PIPELINE | gang_stages; From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 10:37:11 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 7B53E437; Sun, 25 Nov 2012 10:37:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D68C8FC12; Sun, 25 Nov 2012 10:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPAbBKA042287; Sun, 25 Nov 2012 10:37:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPAbBc6042285; Sun, 25 Nov 2012 10:37:11 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211251037.qAPAbBc6042285@svn.freebsd.org> From: Devin Teske Date: Sun, 25 Nov 2012 10:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243504 - in head/usr.sbin/bsdconfig/networking: include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 10:37:11 -0000 Author: dteske Date: Sun Nov 25 10:37:10 2012 New Revision: 243504 URL: http://svnweb.freebsd.org/changeset/base/243504 Log: Split IP address validation routines and improve error detection for dotted- quad notation in IPv6 addresses. Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/messages.subr Sun Nov 25 09:06:32 2012 (r243503) +++ head/usr.sbin/bsdconfig/networking/include/messages.subr Sun Nov 25 10:37:10 2012 (r243504) @@ -55,10 +55,10 @@ msg_hostname_label_is_null="ERROR! One o msg_hostname_label_starts_or_ends_with_hyphen="ERROR! One or more individual labels within the hostname\n(separated by dots) starts or ends with a hyphen (hyphens\nare allowed, but a label cannot begin or end with a hyphen).\n\nInvalid Hostname: %s" msg_internal_error_nsindex_value="FATAL! dialog_input_nameserver_edit_awk: variable\nnsindex must be a whole positive integer greater-\nthan or equal-to zero.\n\nInvalid nsindex: %s" msg_ipaddr4="ipaddr" -msg_ipv4_addr_octet_contains_invalid_chars="ERROR! One or more individual octets within the IP address\n(separated by dots) contains one or more invalid characters.\nOctets must contain only the characters 0-9.\n\nInvalid IP Address: %s" -msg_ipv4_addr_octet_exceeds_max_value="ERROR! One or more individual octets within the IP address\n(separated by dots) exceeds the maximum of 255.\n\nInvalid IP Address: %s" -msg_ipv4_addr_octet_is_null="ERROR! One or more individual octets within the IP address\n(separated by dots) are null and/or missing.\n\nInvalid IP Address: %s" -msg_ipv4_addr_octet_missing_or_extra="ERROR! The IP address entered has either too few (less than\nfour) or too many (more than four) octets, separated by dots.\n\nInvalid IP Address: %s" +msg_ipv4_addr_octet_contains_invalid_chars="ERROR! One or more individual octets within the IPv4 address\n(separated by dots) contains one or more invalid characters.\nOctets must contain only the characters 0-9.\n\nInvalid IP Address: %s" +msg_ipv4_addr_octet_exceeds_max_value="ERROR! One or more individual octets within the IPv4 address\n(separated by dots) exceeds the maximum of 255.\n\nInvalid IP Address: %s" +msg_ipv4_addr_octet_is_null="ERROR! One or more individual octets within the IPv4 address\n(separated by dots) are null and/or missing.\n\nInvalid IP Address: %s" +msg_ipv4_addr_octet_missing_or_extra="ERROR! The IPv4 address entered has either too few (less than\nfour) or too many (more than four) octets, separated by dots.\n\nInvalid IP Address: %s" msg_ipv6_addr_segment_contains_invalid_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) contains one or more invalid characters.\nSegments must contain only combinations of the characters 0-9,\nA-F, or a-f.\n\nInvalid IPv6 Address: %s" msg_ipv6_addr_segment_contains_too_many_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) exceeds the length of 4 hex-digits.\n\nInvalid IPv6 Address: %s" msg_ipv6_addr_too_few_or_extra_segments="ERROR! The IP address entered has either too few (less than 3), too\nmany (more than 8), or not enough segments, separated by colons.\n\nInvalid IPv6 Address: %s" Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sun Nov 25 09:06:32 2012 (r243503) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sun Nov 25 10:37:10 2012 (r243504) @@ -60,7 +60,7 @@ f_ifconfig_inet() ' } -# f_dialog_validate_ipaddr $ipaddr +# f_validate_ipaddr $ipaddr # # Returns zero if the given argument (an IP address) is of the proper format. # @@ -73,10 +73,7 @@ f_ifconfig_inet() # maximum of 255 (or 2^8, being an octet comprised of 8 bits). # 4 The IP address has either too few or too many octets. # -# If the IP address is determined to be invalid, the appropriate error will be -# displayed using the f_dialog_msgbox function. -# -f_dialog_validate_ipaddr() +f_validate_ipaddr() { local ip="$1" @@ -106,12 +103,19 @@ f_dialog_validate_ipaddr() [ $noctets -eq 4 ] || exit 4 ) +} +# f_dialog_iperror $error $ipaddr +# +# Display a msgbox with the appropriate error message for an error returned by +# f_validate_ipaddr above. +# +f_dialog_iperror() +{ + local error="$1" ip="$2" - # - # Produce an appropriate error message if necessary. - # - local retval=$? - case $retval in + [ ${error:-0} -ne 0 ] || return $SUCCESS + + case "$error" in 1) f_dialog_msgbox "$( printf \ "$msg_ipv4_addr_octet_contains_invalid_chars" "$ip" )";; 2) f_dialog_msgbox "$( printf \ @@ -121,34 +125,57 @@ f_dialog_validate_ipaddr() 4) f_dialog_msgbox "$( printf \ "$msg_ipv4_addr_octet_missing_or_extra" "$ip" )";; esac +} + +# f_dialog_validate_ipaddr $ipaddr +# +# Returns zero if the given argument (an IP address) is of the proper format. +# +# If the IP address is determined to be invalid, the appropriate error will be +# displayed using the f_dialog_iperror function above. +# +f_dialog_validate_ipaddr() +{ + local ip="$1" + + f_validate_ipaddr "$ip" + local retval=$? + + # Produce an appropriate error message if necessary. + [ $retval -eq $SUCCESS ] || f_dialog_iperror $retval "$ip" return $retval } -# f_dialog_validate_ipaddr6 $ipv6_addr +# f_validate_ipaddr6 $ipv6_addr # # Returns zero if the given argument (an IPv6 address) is of the proper format. # # The return status for invalid IP address is one of: # 1 One or more individual segments within the IP address # (separated by colons) contains one or more invalid characters. -# 2 More than two segments within the IP address are null or the -# the second null segment is not at the end of the address. -# 3 One or more individual segments within the IP address exceeds -# the word length of 32-bits (segments are always hexadecimal). -# 4 The IP address has either too few or too many segments. -# 5 The IPv4 address at the end of the IPv6 address is invalid. +# Segments must contain only combinations of the characters 0-9, +# A-F, or a-f. +# 2 Too many/incorrect null segments. A single null segment is +# allowed within the IP address (separated by colons) but not +# allowed at the beginning or end (unless a double-null segment; +# i.e., "::*" or "*::"). +# 3 One or more individual segments within the IP address +# (separated by colons) exceeds the length of 4 hex-digits. +# 4 The IP address entered has either too few (less than 3), too +# many (more than 8), or not enough segments, separated by +# colons. +# 5* The IPv4 address at the end of the IPv6 address is invalid. +# * When there is an error with the dotted-quad IPv4 address at the +# end of the IPv6 address, the return value of 5 is OR'd with a +# bit-shifted (<< 4) return of f_validate_ipaddr. # -# If the IP address is determined to be invalid, the appropriate error will be -# displayed using the f_dialog_msgbox function. -# -f_dialog_validate_ipaddr6() +f_validate_ipaddr6() { local ip="$1" ( # Operate within a sub-shell to protect the parent environment - oldIFS="$IFS" IFS=":" # Split on `colon' set -- $ip: @@ -216,9 +243,8 @@ f_dialog_validate_ipaddr6() contains_ipv4_segment=1 # Validate the IPv4 address - IFS="$oldIFS" - f_dialog_validate_ipaddr "$segment" || exit 5 - IFS=":" + f_validate_ipaddr "$segment" || + exit $(( 5 | $? << 4 )) ;; *) # Segment characters are all valid but too many @@ -254,12 +280,20 @@ f_dialog_validate_ipaddr6() exit $SUCCESS ) +} - # - # Produce an appropriate error message if necessary. - # - local retval=$? - case $retval in +# f_dialog_ip6error $error $ipv6_addr +# +# Display a msgbox with the appropriate error message for an error returned by +# f_validate_ipaddr6 above. +# +f_dialog_ip6error() +{ + local error="$1" ip="$2" + + [ ${error:-0} -ne 0 ] || return $SUCCESS + + case "$error" in 1) f_dialog_msgbox "$( printf \ "$msg_ipv6_addr_segment_contains_invalid_chars" "$ip" )";; 2) f_dialog_msgbox "$( printf \ @@ -268,10 +302,30 @@ f_dialog_validate_ipaddr6() "$msg_ipv6_addr_segment_contains_too_many_chars" "$ip" )";; 4) f_dialog_msgbox "$( printf \ "$msg_ipv6_addr_too_few_or_extra_segments" "$ip" )";; - 5) : IPv4 at the end of IPv6 address is invalid ;; - # Don't display an error because f_dialog_validate_ipaddr - # already displayed one for the particular issue encountered. + *) + if [ $(( $error & 0xF )) -eq 5 ]; then + # IPv4 at the end of IPv6 address is invalid + f_dialog_iperror $(( $error >> 4 )) "$ip" + fi esac +} + +# f_dialog_validate_ipaddr6 $ipv6_addr +# +# Returns zero if the given argument (an IPv6 address) is of the proper format. +# +# If the IP address is determined to be invalid, the appropriate error will be +# displayed using the f_dialog_ip6error function above. +# +f_dialog_validate_ipaddr6() +{ + local ip="$1" + + f_validate_ipaddr6 "$ip" + local retval=$? + + # Produce an appropriate error message if necessary. + [ $retval -eq $SUCCESS ] || f_dialog_ip6error $retval "$ip" return $retval } From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 10:53: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 AAE277BC; Sun, 25 Nov 2012 10:53:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E3D08FC13; Sun, 25 Nov 2012 10:53:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPArgN2044397; Sun, 25 Nov 2012 10:53:42 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPArgOZ044395; Sun, 25 Nov 2012 10:53:42 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211251053.qAPArgOZ044395@svn.freebsd.org> From: Martin Matuska Date: Sun, 25 Nov 2012 10:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243505 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 10:53:42 -0000 Author: mm Date: Sun Nov 25 10:53:42 2012 New Revision: 243505 URL: http://svnweb.freebsd.org/changeset/base/243505 Log: MFV r243012: Illumos 13886:e3261d03efbf 3349 zpool upgrade -V bumps the on disk version number, but leaves the in core version References: https://www.illumos.org/issues/3349 MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Nov 25 10:37:10 2012 (r243504) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Nov 25 10:53:42 2012 (r243505) @@ -330,6 +330,7 @@ ztest_func_t ztest_vdev_add_remove; ztest_func_t ztest_vdev_aux_add_remove; ztest_func_t ztest_split_pool; ztest_func_t ztest_reguid; +ztest_func_t ztest_spa_upgrade; uint64_t zopt_always = 0ULL * NANOSEC; /* all the time */ uint64_t zopt_incessant = 1ULL * NANOSEC / 10; /* every 1/10 second */ @@ -363,6 +364,7 @@ ztest_info_t ztest_info[] = { { ztest_reguid, 1, &zopt_sometimes }, { ztest_spa_rename, 1, &zopt_rarely }, { ztest_scrub, 1, &zopt_rarely }, + { ztest_spa_upgrade, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, { ztest_vdev_attach_detach, 1, &zopt_rarely }, { ztest_vdev_LUN_growth, 1, &zopt_rarely }, @@ -797,7 +799,7 @@ ztest_get_ashift(void) } static nvlist_t * -make_vdev_file(char *path, char *aux, size_t size, uint64_t ashift) +make_vdev_file(char *path, char *aux, char *pool, size_t size, uint64_t ashift) { char pathbuf[MAXPATHLEN]; uint64_t vdev; @@ -813,12 +815,13 @@ make_vdev_file(char *path, char *aux, si vdev = ztest_shared->zs_vdev_aux; (void) snprintf(path, sizeof (pathbuf), ztest_aux_template, ztest_opts.zo_dir, - ztest_opts.zo_pool, aux, vdev); + pool == NULL ? ztest_opts.zo_pool : pool, + aux, vdev); } else { vdev = ztest_shared->zs_vdev_next_leaf++; (void) snprintf(path, sizeof (pathbuf), ztest_dev_template, ztest_opts.zo_dir, - ztest_opts.zo_pool, vdev); + pool == NULL ? ztest_opts.zo_pool : pool, vdev); } } @@ -840,17 +843,18 @@ make_vdev_file(char *path, char *aux, si } static nvlist_t * -make_vdev_raidz(char *path, char *aux, size_t size, uint64_t ashift, int r) +make_vdev_raidz(char *path, char *aux, char *pool, size_t size, + uint64_t ashift, int r) { nvlist_t *raidz, **child; int c; if (r < 2) - return (make_vdev_file(path, aux, size, ashift)); + return (make_vdev_file(path, aux, pool, size, ashift)); child = umem_alloc(r * sizeof (nvlist_t *), UMEM_NOFAIL); for (c = 0; c < r; c++) - child[c] = make_vdev_file(path, aux, size, ashift); + child[c] = make_vdev_file(path, aux, pool, size, ashift); VERIFY(nvlist_alloc(&raidz, NV_UNIQUE_NAME, 0) == 0); VERIFY(nvlist_add_string(raidz, ZPOOL_CONFIG_TYPE, @@ -869,19 +873,19 @@ make_vdev_raidz(char *path, char *aux, s } static nvlist_t * -make_vdev_mirror(char *path, char *aux, size_t size, uint64_t ashift, - int r, int m) +make_vdev_mirror(char *path, char *aux, char *pool, size_t size, + uint64_t ashift, int r, int m) { nvlist_t *mirror, **child; int c; if (m < 1) - return (make_vdev_raidz(path, aux, size, ashift, r)); + return (make_vdev_raidz(path, aux, pool, size, ashift, r)); child = umem_alloc(m * sizeof (nvlist_t *), UMEM_NOFAIL); for (c = 0; c < m; c++) - child[c] = make_vdev_raidz(path, aux, size, ashift, r); + child[c] = make_vdev_raidz(path, aux, pool, size, ashift, r); VERIFY(nvlist_alloc(&mirror, NV_UNIQUE_NAME, 0) == 0); VERIFY(nvlist_add_string(mirror, ZPOOL_CONFIG_TYPE, @@ -898,8 +902,8 @@ make_vdev_mirror(char *path, char *aux, } static nvlist_t * -make_vdev_root(char *path, char *aux, size_t size, uint64_t ashift, - int log, int r, int m, int t) +make_vdev_root(char *path, char *aux, char *pool, size_t size, uint64_t ashift, + int log, int r, int m, int t) { nvlist_t *root, **child; int c; @@ -909,7 +913,8 @@ make_vdev_root(char *path, char *aux, si child = umem_alloc(t * sizeof (nvlist_t *), UMEM_NOFAIL); for (c = 0; c < t; c++) { - child[c] = make_vdev_mirror(path, aux, size, ashift, r, m); + child[c] = make_vdev_mirror(path, aux, pool, size, ashift, + r, m); VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_IS_LOG, log) == 0); } @@ -927,6 +932,27 @@ make_vdev_root(char *path, char *aux, si return (root); } +/* + * Find a random spa version. Returns back a random spa version in the + * range [initial_version, SPA_VERSION_FEATURES]. + */ +static uint64_t +ztest_random_spa_version(uint64_t initial_version) +{ + uint64_t version = initial_version; + + if (version <= SPA_VERSION_BEFORE_FEATURES) { + version = version + + ztest_random(SPA_VERSION_BEFORE_FEATURES - version + 1); + } + + if (version > SPA_VERSION_BEFORE_FEATURES) + version = SPA_VERSION_FEATURES; + + ASSERT(SPA_VERSION_IS_SUPPORTED(version)); + return (version); +} + static int ztest_random_blocksize(void) { @@ -2269,7 +2295,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, /* * Attempt to create using a bad file. */ - nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 0, 1); + nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1); VERIFY3U(ENOENT, ==, spa_create("ztest_bad_file", nvroot, NULL, NULL, NULL)); nvlist_free(nvroot); @@ -2277,7 +2303,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, /* * Attempt to create using a bad mirror. */ - nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 2, 1); + nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 2, 1); VERIFY3U(ENOENT, ==, spa_create("ztest_bad_mirror", nvroot, NULL, NULL, NULL)); nvlist_free(nvroot); @@ -2287,7 +2313,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, * what's in the nvroot; we should fail with EEXIST. */ (void) rw_rdlock(&ztest_name_lock); - nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 0, 1); + nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1); VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL, NULL)); nvlist_free(nvroot); VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG)); @@ -2297,6 +2323,78 @@ ztest_spa_create_destroy(ztest_ds_t *zd, (void) rw_unlock(&ztest_name_lock); } +/* ARGSUSED */ +void +ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id) +{ + spa_t *spa; + uint64_t initial_version = SPA_VERSION_INITIAL; + uint64_t version, newversion; + nvlist_t *nvroot, *props; + char *name; + + VERIFY0(mutex_lock(&ztest_vdev_lock)); + name = kmem_asprintf("%s_upgrade", ztest_opts.zo_pool); + + /* + * Clean up from previous runs. + */ + (void) spa_destroy(name); + + nvroot = make_vdev_root(NULL, NULL, name, ztest_opts.zo_vdev_size, 0, + 0, ztest_opts.zo_raidz, ztest_opts.zo_mirrors, 1); + + /* + * If we're configuring a RAIDZ device then make sure that the + * the initial version is capable of supporting that feature. + */ + switch (ztest_opts.zo_raidz_parity) { + case 0: + case 1: + initial_version = SPA_VERSION_INITIAL; + break; + case 2: + initial_version = SPA_VERSION_RAIDZ2; + break; + case 3: + initial_version = SPA_VERSION_RAIDZ3; + break; + } + + /* + * Create a pool with a spa version that can be upgraded. Pick + * a value between initial_version and SPA_VERSION_BEFORE_FEATURES. + */ + do { + version = ztest_random_spa_version(initial_version); + } while (version > SPA_VERSION_BEFORE_FEATURES); + + props = fnvlist_alloc(); + fnvlist_add_uint64(props, + zpool_prop_to_name(ZPOOL_PROP_VERSION), version); + VERIFY0(spa_create(name, nvroot, props, NULL, NULL)); + fnvlist_free(nvroot); + fnvlist_free(props); + + VERIFY0(spa_open(name, &spa, FTAG)); + VERIFY3U(spa_version(spa), ==, version); + newversion = ztest_random_spa_version(version + 1); + + if (ztest_opts.zo_verbose >= 4) { + (void) printf("upgrading spa version from %llu to %llu\n", + (u_longlong_t)version, (u_longlong_t)newversion); + } + + spa_upgrade(spa, newversion); + VERIFY3U(spa_version(spa), >, version); + VERIFY3U(spa_version(spa), ==, fnvlist_lookup_uint64(spa->spa_config, + zpool_prop_to_name(ZPOOL_PROP_VERSION))); + spa_close(spa, FTAG); + + strfree(name); + VERIFY0(mutex_unlock(&ztest_vdev_lock)); +} + static vdev_t * vdev_lookup_by_path(vdev_t *vd, const char *path) { @@ -2386,7 +2484,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, ui /* * Make 1/4 of the devices be log devices. */ - nvroot = make_vdev_root(NULL, NULL, + nvroot = make_vdev_root(NULL, NULL, NULL, ztest_opts.zo_vdev_size, 0, ztest_random(4) == 0, ztest_opts.zo_raidz, zs->zs_mirrors, 1); @@ -2463,7 +2561,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd /* * Add a new device. */ - nvlist_t *nvroot = make_vdev_root(NULL, aux, + nvlist_t *nvroot = make_vdev_root(NULL, aux, NULL, (ztest_opts.zo_vdev_size * 5) / 4, 0, 0, 0, 0, 1); error = spa_vdev_add(spa, nvroot); if (error != 0) @@ -2732,7 +2830,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, /* * Build the nvlist describing newpath. */ - root = make_vdev_root(newpath, NULL, newvd == NULL ? newsize : 0, + root = make_vdev_root(newpath, NULL, NULL, newvd == NULL ? newsize : 0, ashift, 0, 0, 0, 1); error = spa_vdev_attach(spa, oldguid, root, replacing); @@ -4900,7 +4998,7 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id if (error != 0) return; - if (ztest_opts.zo_verbose >= 3) { + if (ztest_opts.zo_verbose >= 4) { (void) printf("Changed guid old %llu -> %llu\n", (u_longlong_t)orig, (u_longlong_t)spa_guid(spa)); } @@ -5647,7 +5745,7 @@ ztest_init(ztest_shared_t *zs) ztest_shared->zs_vdev_next_leaf = 0; zs->zs_splits = 0; zs->zs_mirrors = ztest_opts.zo_mirrors; - nvroot = make_vdev_root(NULL, NULL, ztest_opts.zo_vdev_size, 0, + nvroot = make_vdev_root(NULL, NULL, NULL, ztest_opts.zo_vdev_size, 0, 0, ztest_opts.zo_raidz, zs->zs_mirrors, 1); props = make_random_props(); for (int i = 0; i < SPA_FEATURES; i++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 25 10:37:10 2012 (r243504) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 25 10:53:42 2012 (r243505) @@ -5985,6 +5985,14 @@ spa_sync_config_object(spa_t *spa, dmu_t config = spa_config_generate(spa, spa->spa_root_vdev, dmu_tx_get_txg(tx), B_FALSE); + /* + * If we're upgrading the spa version then make sure that + * the config object gets updated with the correct version. + */ + if (spa->spa_ubsync.ub_version < spa->spa_uberblock.ub_version) + fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, + spa->spa_uberblock.ub_version); + spa_config_exit(spa, SCL_STATE, FTAG); if (spa->spa_config_syncing) From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 11:26:36 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 CF678E9; Sun, 25 Nov 2012 11:26:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B47B58FC08; Sun, 25 Nov 2012 11:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPBQaEP049347; Sun, 25 Nov 2012 11:26:36 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPBQa3f049346; Sun, 25 Nov 2012 11:26:36 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211251126.qAPBQa3f049346@svn.freebsd.org> From: Martin Matuska Date: Sun, 25 Nov 2012 11:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243506 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 11:26:36 -0000 Author: mm Date: Sun Nov 25 11:26:36 2012 New Revision: 243506 URL: http://svnweb.freebsd.org/changeset/base/243506 Log: zfs sha256 checksum is missing in zfs.8 manpage MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Nov 25 10:53:42 2012 (r243505) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Nov 25 11:26:36 2012 (r243506) @@ -830,7 +830,7 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 12:27:19 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 ECC79236; Sun, 25 Nov 2012 12:27:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D10ED8FC17; Sun, 25 Nov 2012 12:27:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPCRJOx059046; Sun, 25 Nov 2012 12:27:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPCRJmm059045; Sun, 25 Nov 2012 12:27:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211251227.qAPCRJmm059045@svn.freebsd.org> From: Dimitry Andric Date: Sun, 25 Nov 2012 12:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243511 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 12:27:20 -0000 Author: dim Date: Sun Nov 25 12:27:19 2012 New Revision: 243511 URL: http://svnweb.freebsd.org/changeset/base/243511 Log: MFC r243348: Do not expose LIBCXXRT and LIBCPLUSPLUS in bsd.libnames.mk, if WITHOUT_LIBCPLUSPLUS is specified. Submitted by: Garrett Cooper Modified: stable/9/share/mk/bsd.libnames.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.libnames.mk ============================================================================== --- stable/9/share/mk/bsd.libnames.mk Sun Nov 25 12:19:17 2012 (r243510) +++ stable/9/share/mk/bsd.libnames.mk Sun Nov 25 12:27:19 2012 (r243511) @@ -26,8 +26,10 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxm LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a +.if ${MK_LIBCPLUSPLUS} != "no" LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a +.endif LIBC?= ${DESTDIR}${LIBDIR}/libc.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 14:22: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 6F43A79E; Sun, 25 Nov 2012 14:22:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54F208FC13; Sun, 25 Nov 2012 14:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPEM8lV074657; Sun, 25 Nov 2012 14:22:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPEM8BV074656; Sun, 25 Nov 2012 14:22:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211251422.qAPEM8BV074656@svn.freebsd.org> From: Andriy Gapon Date: Sun, 25 Nov 2012 14:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243515 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 14:22:09 -0000 Author: avg Date: Sun Nov 25 14:22:08 2012 New Revision: 243515 URL: http://svnweb.freebsd.org/changeset/base/243515 Log: remove stop_scheduler_on_panic knob There has not been any complaints about the default behavior, so there is no need to keep a knob that enables the worse alternative. Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu spinlock-like logic can be dropped, because only a single CPU is supposed to win stop_cpus_hard(other_cpus) race and proceed past that call. MFC after: 1 month Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sun Nov 25 12:38:12 2012 (r243514) +++ head/sys/kern/kern_shutdown.c Sun Nov 25 14:22:08 2012 (r243515) @@ -121,11 +121,6 @@ SYSCTL_INT(_kern, OID_AUTO, sync_on_pani &sync_on_panic, 0, "Do a sync before rebooting from a panic"); TUNABLE_INT("kern.sync_on_panic", &sync_on_panic); -static int stop_scheduler_on_panic = 1; -SYSCTL_INT(_kern, OID_AUTO, stop_scheduler_on_panic, CTLFLAG_RW | CTLFLAG_TUN, - &stop_scheduler_on_panic, 0, "stop scheduler upon entering panic"); -TUNABLE_INT("kern.stop_scheduler_on_panic", &stop_scheduler_on_panic); - static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); @@ -552,7 +547,6 @@ void panic(const char *fmt, ...) { #ifdef SMP - static volatile u_int panic_cpu = NOCPU; cpuset_t other_cpus; #endif struct thread *td = curthread; @@ -560,39 +554,27 @@ panic(const char *fmt, ...) va_list ap; static char buf[256]; - if (stop_scheduler_on_panic) - spinlock_enter(); - else - critical_enter(); + spinlock_enter(); #ifdef SMP /* - * We don't want multiple CPU's to panic at the same time, so we - * use panic_cpu as a simple spinlock. We have to keep checking - * panic_cpu if we are spinning in case the panic on the first - * CPU is canceled. + * stop_cpus_hard(other_cpus) should prevent multiple CPUs from + * concurrently entering panic. Only the winner will proceed + * further. */ - if (panic_cpu != PCPU_GET(cpuid)) - while (atomic_cmpset_int(&panic_cpu, NOCPU, - PCPU_GET(cpuid)) == 0) - while (panic_cpu != NOCPU) - ; /* nothing */ - - if (stop_scheduler_on_panic) { - if (panicstr == NULL && !kdb_active) { - other_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &other_cpus); - stop_cpus_hard(other_cpus); - } - - /* - * We set stop_scheduler here and not in the block above, - * because we want to ensure that if panic has been called and - * stop_scheduler_on_panic is true, then stop_scheduler will - * always be set. Even if panic has been entered from kdb. - */ - td->td_stopsched = 1; + if (panicstr == NULL && !kdb_active) { + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + stop_cpus_hard(other_cpus); } + + /* + * We set stop_scheduler here and not in the block above, + * because we want to ensure that if panic has been called and + * stop_scheduler_on_panic is true, then stop_scheduler will + * always be set. Even if panic has been entered from kdb. + */ + td->td_stopsched = 1; #endif bootopt = RB_AUTOBOOT; @@ -632,8 +614,6 @@ panic(const char *fmt, ...) /* thread_unlock(td); */ if (!sync_on_panic) bootopt |= RB_NOSYNC; - if (!stop_scheduler_on_panic) - critical_exit(); kern_reboot(bootopt); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 14:25:08 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 D26209C2; Sun, 25 Nov 2012 14:25:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B94E48FC12; Sun, 25 Nov 2012 14:25:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPEP8W8075065; Sun, 25 Nov 2012 14:25:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPEP8vg075063; Sun, 25 Nov 2012 14:25:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211251425.qAPEP8vg075063@svn.freebsd.org> From: Michael Tuexen Date: Sun, 25 Nov 2012 14:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243516 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 14:25:08 -0000 Author: tuexen Date: Sun Nov 25 14:25:08 2012 New Revision: 243516 URL: http://svnweb.freebsd.org/changeset/base/243516 Log: Remove unused function. MFC after: 1 week Modified: head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_peeloff.h Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Sun Nov 25 14:22:08 2012 (r243515) +++ head/sys/netinet/sctp_peeloff.c Sun Nov 25 14:25:08 2012 (r243516) @@ -151,103 +151,3 @@ sctp_do_peeloff(struct socket *head, str return (0); } - - -struct socket * -sctp_get_peeloff(struct socket *head, sctp_assoc_t assoc_id, int *error) -{ - struct socket *newso; - struct sctp_inpcb *inp, *n_inp; - struct sctp_tcb *stcb; - - SCTPDBG(SCTP_DEBUG_PEEL1, "SCTP peel-off called\n"); - inp = (struct sctp_inpcb *)head->so_pcb; - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); - *error = EFAULT; - return (NULL); - } - stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); - if (stcb == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); - *error = ENOTCONN; - return (NULL); - } - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - CURVNET_SET(head->so_vnet); - newso = sonewconn(head, SS_ISCONNECTED - ); - CURVNET_RESTORE(); - if (newso == NULL) { - SCTPDBG(SCTP_DEBUG_PEEL1, "sctp_peeloff:sonewconn failed\n"); - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOMEM); - *error = ENOMEM; - atomic_subtract_int(&stcb->asoc.refcnt, 1); - return (NULL); - - } - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - n_inp = (struct sctp_inpcb *)newso->so_pcb; - SOCK_LOCK(head); - n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE | - SCTP_PCB_FLAGS_CONNECTED | - SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */ - (SCTP_PCB_COPY_FLAGS & inp->sctp_flags)); - n_inp->sctp_features = inp->sctp_features; - n_inp->sctp_frag_point = inp->sctp_frag_point; - n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; - n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; - n_inp->partial_delivery_point = inp->partial_delivery_point; - n_inp->sctp_context = inp->sctp_context; - n_inp->local_strreset_support = inp->local_strreset_support; - n_inp->inp_starting_point_for_iterator = NULL; - - /* copy in the authentication parameters from the original endpoint */ - if (n_inp->sctp_ep.local_hmacs) - sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs); - n_inp->sctp_ep.local_hmacs = - sctp_copy_hmaclist(inp->sctp_ep.local_hmacs); - if (n_inp->sctp_ep.local_auth_chunks) - sctp_free_chunklist(n_inp->sctp_ep.local_auth_chunks); - n_inp->sctp_ep.local_auth_chunks = - sctp_copy_chunklist(inp->sctp_ep.local_auth_chunks); - (void)sctp_copy_skeylist(&inp->sctp_ep.shared_keys, - &n_inp->sctp_ep.shared_keys); - - n_inp->sctp_socket = newso; - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { - sctp_feature_off(n_inp, SCTP_PCB_FLAGS_AUTOCLOSE); - n_inp->sctp_ep.auto_close_time = 0; - sctp_timer_stop(SCTP_TIMER_TYPE_AUTOCLOSE, n_inp, stcb, NULL, - SCTP_FROM_SCTP_PEELOFF + SCTP_LOC_1); - } - /* Turn off any non-blocking semantic. */ - SCTP_CLEAR_SO_NBIO(newso); - newso->so_state |= SS_ISCONNECTED; - /* We remove it right away */ - -#ifdef SCTP_LOCK_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOCK_LOGGING_ENABLE) { - sctp_log_lock(inp, (struct sctp_tcb *)NULL, SCTP_LOG_LOCK_SOCK); - } -#endif - TAILQ_REMOVE(&head->so_comp, newso, so_list); - head->so_qlen--; - SOCK_UNLOCK(head); - /* - * Now we must move it from one hash table to another and get the - * stcb in the right place. - */ - sctp_move_pcb_and_assoc(inp, n_inp, stcb); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - /* - * And now the final hack. We move data in the pending side i.e. - * head to the new socket buffer. Let the GRUBBING begin :-0 - */ - sctp_pull_off_control_to_new_inp(inp, n_inp, stcb, SBL_WAIT); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - return (newso); -} Modified: head/sys/netinet/sctp_peeloff.h ============================================================================== --- head/sys/netinet/sctp_peeloff.h Sun Nov 25 14:22:08 2012 (r243515) +++ head/sys/netinet/sctp_peeloff.h Sun Nov 25 14:25:08 2012 (r243516) @@ -35,18 +35,9 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_PEELOFF_H_ #define _NETINET_SCTP_PEELOFF_H_ - - - - #if defined(_KERNEL) - int sctp_can_peel_off(struct socket *, sctp_assoc_t); int sctp_do_peeloff(struct socket *, struct socket *, sctp_assoc_t); -struct socket *sctp_get_peeloff(struct socket *, sctp_assoc_t, int *); - - #endif /* _KERNEL */ - -#endif +#endif /* _NETINET_SCTP_PEELOFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 14:53: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 2A21B22F; Sun, 25 Nov 2012 14:53:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4F18FC08; Sun, 25 Nov 2012 14:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPErQYq078440; Sun, 25 Nov 2012 14:53:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPErQ4S078439; Sun, 25 Nov 2012 14:53:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211251453.qAPErQ4S078439@svn.freebsd.org> From: Andriy Gapon Date: Sun, 25 Nov 2012 14:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243517 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 14:53:27 -0000 Author: avg Date: Sun Nov 25 14:53:26 2012 New Revision: 243517 URL: http://svnweb.freebsd.org/changeset/base/243517 Log: zfs_getpages: optimize for large block sizes MFC after: 6 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 14:25:08 2012 (r243516) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 14:53:26 2012 (r243517) @@ -5556,34 +5556,61 @@ zfs_getpages(struct vnode *vp, vm_page_t znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; objset_t *os = zp->z_zfsvfs->z_os; - vm_page_t mreq; + vm_page_t mfirst, mlast, mreq; vm_object_t object; caddr_t va; struct sf_buf *sf; + off_t startoff, endoff; int i, error; - int pcount, size; + vm_pindex_t reqstart, reqend; + int pcount, lsize, reqsize, size; ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); - pcount = round_page(count) / PAGE_SIZE; + pcount = OFF_TO_IDX(round_page(count)); mreq = m[reqpage]; object = mreq->object; error = 0; KASSERT(vp->v_object == object, ("mismatching object")); + if (pcount > 1 && zp->z_blksz > PAGESIZE) { + startoff = rounddown(IDX_TO_OFF(mreq->pindex), zp->z_blksz); + reqstart = OFF_TO_IDX(round_page(startoff)); + if (reqstart < m[0]->pindex) + reqstart = 0; + else + reqstart = reqstart - m[0]->pindex; + endoff = roundup(IDX_TO_OFF(mreq->pindex) + PAGE_SIZE, + zp->z_blksz); + reqend = OFF_TO_IDX(trunc_page(endoff)) - 1; + if (reqend > m[pcount - 1]->pindex) + reqend = m[pcount - 1]->pindex; + reqsize = reqend - m[reqstart]->pindex + 1; + KASSERT(reqstart <= reqpage && reqpage < reqstart + reqsize, + ("reqpage beyond [reqstart, reqstart + reqsize[ bounds")); + } else { + reqstart = reqpage; + reqsize = 1; + } + mfirst = m[reqstart]; + mlast = m[reqstart + reqsize - 1]; + VM_OBJECT_LOCK(object); - for (i = 0; i < pcount; i++) { - if (i != reqpage) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } + for (i = 0; i < reqstart; i++) { + vm_page_lock(m[i]); + vm_page_free(m[i]); + vm_page_unlock(m[i]); + } + for (i = reqstart + reqsize; i < pcount; i++) { + vm_page_lock(m[i]); + vm_page_free(m[i]); + vm_page_unlock(m[i]); } - if (mreq->valid) { + if (mreq->valid && reqsize == 1) { if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); VM_OBJECT_UNLOCK(object); @@ -5592,30 +5619,66 @@ zfs_getpages(struct vnode *vp, vm_page_t } PCPU_INC(cnt.v_vnodein); - PCPU_INC(cnt.v_vnodepgsin); + PCPU_ADD(cnt.v_vnodepgsin, reqsize); if (IDX_TO_OFF(mreq->pindex) >= object->un_pager.vnp.vnp_size) { + for (i = reqstart; i < reqstart + reqsize; i++) { + if (i != reqpage) { + vm_page_lock(m[i]); + vm_page_free(m[i]); + vm_page_unlock(m[i]); + } + } VM_OBJECT_UNLOCK(object); ZFS_EXIT(zfsvfs); return (VM_PAGER_BAD); } - size = PAGE_SIZE; - if (IDX_TO_OFF(mreq->pindex) + size > object->un_pager.vnp.vnp_size) - size = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mreq->pindex); + lsize = PAGE_SIZE; + if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) + lsize = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mlast->pindex); VM_OBJECT_UNLOCK(object); - va = zfs_map_page(mreq, &sf); - error = dmu_read(os, zp->z_id, IDX_TO_OFF(mreq->pindex), - size, va, DMU_READ_PREFETCH); - if (size != PAGE_SIZE) - bzero(va + size, PAGE_SIZE - size); - zfs_unmap_page(sf); + + for (i = reqstart; i < reqstart + reqsize; i++) { + size = PAGE_SIZE; + if (i == (reqstart + reqsize - 1)) + size = lsize; + va = zfs_map_page(m[i], &sf); + error = dmu_read(os, zp->z_id, IDX_TO_OFF(m[i]->pindex), + size, va, DMU_READ_PREFETCH); + if (size != PAGE_SIZE) + bzero(va + size, PAGE_SIZE - size); + zfs_unmap_page(sf); + if (error != 0) + break; + } + VM_OBJECT_LOCK(object); - if (!error) - mreq->valid = VM_PAGE_BITS_ALL; - KASSERT(mreq->dirty == 0, ("zfs_getpages: page %p is dirty", mreq)); + for (i = reqstart; i < reqstart + reqsize; i++) { + m[i]->valid = VM_PAGE_BITS_ALL; + KASSERT(m[i]->dirty == 0, ("zfs_getpages: page %p is dirty", m[i])); + if (i != reqpage) { + if (!error) { + if (m[i]->oflags & VPO_WANTED) { + vm_page_lock(m[i]); + vm_page_activate(m[i]); + vm_page_unlock(m[i]); + } else { + vm_page_lock(m[i]); + vm_page_deactivate(m[i]); + vm_page_unlock(m[i]); + } + vm_page_wakeup(m[i]); + } else { + vm_page_lock(m[i]); + vm_page_free(m[i]); + vm_page_unlock(m[i]); + } + } + + } VM_OBJECT_UNLOCK(object); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 15:01:13 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 0360543A; Sun, 25 Nov 2012 15:01:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D881C8FC12; Sun, 25 Nov 2012 15:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPF1C8r079556; Sun, 25 Nov 2012 15:01:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPF1CKS079555; Sun, 25 Nov 2012 15:01:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211251501.qAPF1CKS079555@svn.freebsd.org> From: Andriy Gapon Date: Sun, 25 Nov 2012 15:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243518 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 15:01:13 -0000 Author: avg Date: Sun Nov 25 15:01:12 2012 New Revision: 243518 URL: http://svnweb.freebsd.org/changeset/base/243518 Log: add zfs_bmap to aid vnode_pager_haspage ... otherwise zfs_getpages would mostly be called with one page at a time. It is expected that ZFS VOP_BMAP is only called from vnode_pager_haspage. Since ZFS files can have variable block sizes and also because we don't really know if any given blocks are consecutive, we can not really report any additional blocks behind or ahead of a given block. Since physical block numbers do not make sense for ZFS, we do not do any real translation and thus pass back blk = lblk. The net effect is that vnode_pager_haspage knows that the block exists and that the pages backed by the block can be accessed. vnode_pager_haspage may be wrong about the exact count of the pages backed by the block, because of a variable block size, which vnode_pager_haspage doesn't really know - it only knows max block size in a filesystem. So pages from multiple blocks can be passed to zfs_getpages, but that is expected and correctly handled. vnode_pager should not call zfs_bmap for any other reason, because ZFS implements VOP_PUTPAGES and thus vnode_pager_generic_getpages is not used. vfs_cluster code vfs_bio code should not be called for ZFS, because ZFS does not use buffer cache layer. Also, ZFS does not use vn_bmap_seekhole, it has its prviate mechanism for working with holes. The above list should cover all the current calls to VOP_BMAP. Reviewed by: kib MFC after: 6 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 14:53:26 2012 (r243517) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 15:01:12 2012 (r243518) @@ -5702,6 +5702,30 @@ zfs_freebsd_getpages(ap) } static int +zfs_freebsd_bmap(ap) + struct vop_bmap_args /* { + struct vnode *a_vp; + daddr_t a_bn; + struct bufobj **a_bop; + daddr_t *a_bnp; + int *a_runp; + int *a_runb; + } */ *ap; +{ + + if (ap->a_bop != NULL) + *ap->a_bop = &ap->a_vp->v_bufobj; + if (ap->a_bnp != NULL) + *ap->a_bnp = ap->a_bn; + if (ap->a_runp != NULL) + *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; + + return (0); +} + +static int zfs_freebsd_open(ap) struct vop_open_args /* { struct vnode *a_vp; @@ -6806,7 +6830,7 @@ struct vop_vector zfs_vnodeops = { .vop_remove = zfs_freebsd_remove, .vop_rename = zfs_freebsd_rename, .vop_pathconf = zfs_freebsd_pathconf, - .vop_bmap = VOP_EOPNOTSUPP, + .vop_bmap = zfs_freebsd_bmap, .vop_fid = zfs_freebsd_fid, .vop_getextattr = zfs_getextattr, .vop_deleteextattr = zfs_deleteextattr, From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 15:07:28 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 36B997CF; Sun, 25 Nov 2012 15:07:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAF08FC15; Sun, 25 Nov 2012 15:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPF7RlJ080538; Sun, 25 Nov 2012 15:07:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPF7RLa080537; Sun, 25 Nov 2012 15:07:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211251507.qAPF7RLa080537@svn.freebsd.org> From: Andriy Gapon Date: Sun, 25 Nov 2012 15:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243519 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 15:07:28 -0000 Author: avg Date: Sun Nov 25 15:07:27 2012 New Revision: 243519 URL: http://svnweb.freebsd.org/changeset/base/243519 Log: zfs_fhtovp: there is no reason to amend lock flags with LK_RETRY here MFC after: 12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 25 15:01:12 2012 (r243518) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 25 15:07:27 2012 (r243519) @@ -2123,7 +2123,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int VN_HOLD(*vpp); } ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, flags | LK_RETRY); + err = zfs_vnode_lock(*vpp, flags); if (err != 0) *vpp = NULL; return (err); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 15:33:26 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 C22C2B7A; Sun, 25 Nov 2012 15:33:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DED08FC0C; Sun, 25 Nov 2012 15:33:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPFXQtc083872; Sun, 25 Nov 2012 15:33:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPFXQgi083867; Sun, 25 Nov 2012 15:33:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211251533.qAPFXQgi083867@svn.freebsd.org> From: Andriy Gapon Date: Sun, 25 Nov 2012 15:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243520 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 15:33:27 -0000 Author: avg Date: Sun Nov 25 15:33:26 2012 New Revision: 243520 URL: http://svnweb.freebsd.org/changeset/base/243520 Log: zfs: overhaul zfs-vfs glue for vnode life-cycle management * There is no need for the delayed destruction of znodes via taskqueue, now that we do not need to fear recursion from getnewvnode into zfs_inactive and zfs_freebsd_reclaim, thus making znode/vnode state machine a bit simpler. * More complete porting of zfs_inactive from Solaris VFS model to FreeBSD vop_inactive and vop_reclaim model. All destructive actions are done in zfs_freebsd_reclaim. This allows to simplify zfs_zget logic. * Allow zfs_zget to return a doomed vnode if the current thread already has an exclusive lock on the vnode. * Clean up Solaris-isms like bailing out of reclaim/inactive on certain values of v_usecount (aka v_count) or directly messing with this counter. * Do not clear z_vnode while znode is still accessible. z_vnode should be cleared only after zfs_znode_dmu_fini. Otherwise zfs_zget may get an effectively half-deconstructed znode. This allows to simplify zfs_zget logic further. The above changes fix at least two known/reported problems: o An indefinite wait in the following code path: vgone -> VOP_RECLAIM -> zfs_freebsd_reclaim -> vnode_destroy_vobject -> put_pages -> zfs_write -> zil_commit -> zfs_zget This happened because vgone marks a vnode as VI_DOOMED before calling VOP_RECLAIM, but zfs_zget would not return a doomed vnode under any circumstances. The fix in this change is not complete as it won't fix a deadlock between two threads doing VOP_RECLAIM where one thread is in zil_commit trying to zfs_zget a znode/vnode being reclaimed by the other thread, which would be blocked trying to enter zil_commit. This type of deadlock has not been reported as of now. o An indefinite wait in the unmount path caused by a znode "falling through the cracks" in inactive+reclaim. This would happen if the znode is unlinked while its vnode is still active. To Do: pass locking flags parameter to zfs_zget, so that the zfs-vfs glue code doesn't have to re-lock a vnode but could ask for proper locking from the very start. This would also allow for the higher level code to obtain a doomed vnode when it is expected/requested. Or to avoid blocking when it is not allowed (see zil_commit example above). ffs_vgetf seems like a good source of inspiration. Tested by: Willem Jan Withagen MFC after: 6 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sun Nov 25 15:07:27 2012 (r243519) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sun Nov 25 15:33:26 2012 (r243520) @@ -207,8 +207,6 @@ typedef struct znode { list_node_t z_link_node; /* all znodes in fs link */ sa_handle_t *z_sa_hdl; /* handle to sa data */ boolean_t z_is_sa; /* are we native sa? */ - /* FreeBSD-specific field. */ - struct task z_task; } znode_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 25 15:07:27 2012 (r243519) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 25 15:33:26 2012 (r243520) @@ -1847,18 +1847,6 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea zfsvfs->z_unmounted = B_TRUE; rrw_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); - -#ifdef __FreeBSD__ - /* - * Some znodes might not be fully reclaimed, wait for them. - */ - mutex_enter(&zfsvfs->z_znodes_lock); - while (list_head(&zfsvfs->z_all_znodes) != NULL) { - msleep(zfsvfs, &zfsvfs->z_znodes_lock, 0, - "zteardown", 0); - } - mutex_exit(&zfsvfs->z_znodes_lock); -#endif } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 15:07:27 2012 (r243519) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 15:33:26 2012 (r243520) @@ -4566,14 +4566,22 @@ zfs_inactive(vnode_t *vp, cred_t *cr, ca * The fs has been unmounted, or we did a * suspend/resume and this file no longer exists. */ - VI_LOCK(vp); - ASSERT(vp->v_count <= 1); - vp->v_count = 0; - VI_UNLOCK(vp); + rw_exit(&zfsvfs->z_teardown_inactive_lock); vrecycle(vp); + return; + } + + mutex_enter(&zp->z_lock); + if (zp->z_unlinked) { + /* + * Fast path to recycle a vnode of a removed file. + */ + mutex_exit(&zp->z_lock); rw_exit(&zfsvfs->z_teardown_inactive_lock); + vrecycle(vp); return; } + mutex_exit(&zp->z_lock); if (zp->z_atime_dirty && zp->z_unlinked == 0) { dmu_tx_t *tx = dmu_tx_create(zfsvfs->z_os); @@ -4592,8 +4600,6 @@ zfs_inactive(vnode_t *vp, cred_t *cr, ca dmu_tx_commit(tx); } } - - zfs_zinactive(zp); rw_exit(&zfsvfs->z_teardown_inactive_lock); } @@ -6196,28 +6202,6 @@ zfs_freebsd_inactive(ap) return (0); } -static void -zfs_reclaim_complete(void *arg, int pending) -{ - znode_t *zp = arg; - zfsvfs_t *zfsvfs = zp->z_zfsvfs; - - rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); - if (zp->z_sa_hdl != NULL) { - ZFS_OBJ_HOLD_ENTER(zfsvfs, zp->z_id); - zfs_znode_dmu_fini(zp); - ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); - } - zfs_znode_free(zp); - rw_exit(&zfsvfs->z_teardown_inactive_lock); - /* - * If the file system is being unmounted, there is a process waiting - * for us, wake it up. - */ - if (zfsvfs->z_unmounted) - wakeup_one(zfsvfs); -} - static int zfs_freebsd_reclaim(ap) struct vop_reclaim_args /* { @@ -6228,53 +6212,26 @@ zfs_freebsd_reclaim(ap) vnode_t *vp = ap->a_vp; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; - boolean_t rlocked; - - rlocked = rw_tryenter(&zfsvfs->z_teardown_inactive_lock, RW_READER); + int refcnt; ASSERT(zp != NULL); - /* - * Destroy the vm object and flush associated pages. - */ + /* Destroy the vm object and flush associated pages. */ vnode_destroy_vobject(vp); - mutex_enter(&zp->z_lock); - zp->z_vnode = NULL; - mutex_exit(&zp->z_lock); - - if (zp->z_unlinked) { - ; /* Do nothing. */ - } else if (!rlocked) { - TASK_INIT(&zp->z_task, 0, zfs_reclaim_complete, zp); - taskqueue_enqueue(taskqueue_thread, &zp->z_task); - } else if (zp->z_sa_hdl == NULL) { + /* + * z_teardown_inactive_lock protects from a race with + * zfs_znode_dmu_fini in zfsvfs_teardown during + * force unmount. + */ + rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); + if (zp->z_sa_hdl == NULL) zfs_znode_free(zp); - } else /* if (!zp->z_unlinked && zp->z_dbuf != NULL) */ { - int locked; + else + zfs_zinactive(zp); + rw_exit(&zfsvfs->z_teardown_inactive_lock); - locked = MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)) ? 2 : - ZFS_OBJ_HOLD_TRYENTER(zfsvfs, zp->z_id); - if (locked == 0) { - /* - * Lock can't be obtained due to deadlock possibility, - * so defer znode destruction. - */ - TASK_INIT(&zp->z_task, 0, zfs_reclaim_complete, zp); - taskqueue_enqueue(taskqueue_thread, &zp->z_task); - } else { - zfs_znode_dmu_fini(zp); - if (locked == 1) - ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); - zfs_znode_free(zp); - } - } - VI_LOCK(vp); vp->v_data = NULL; - ASSERT(vp->v_holdcnt >= 1); - VI_UNLOCK(vp); - if (rlocked) - rw_exit(&zfsvfs->z_teardown_inactive_lock); return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Nov 25 15:07:27 2012 (r243519) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Nov 25 15:33:26 2012 (r243520) @@ -1147,14 +1147,16 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_ dmu_object_info_t doi; dmu_buf_t *db; znode_t *zp; - int err; + vnode_t *vp; sa_handle_t *hdl; - int first = 1; - - *zpp = NULL; + struct thread *td; + int locked; + int err; + td = curthread; getnewvnode_reserve(1); again: + *zpp = NULL; ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db); @@ -1193,48 +1195,38 @@ again: if (zp->z_unlinked) { err = ENOENT; } else { - vnode_t *vp; - int dying = 0; - vp = ZTOV(zp); - if (vp == NULL) - dying = 1; - else { - VN_HOLD(vp); - if ((vp->v_iflag & VI_DOOMED) != 0) { - dying = 1; - /* - * Don't VN_RELE() vnode here, because - * it can call vn_lock() which creates - * LOR between vnode lock and znode - * lock. We will VN_RELE() the vnode - * after droping znode lock. - */ - } - } - if (dying) { - if (first) { - ZFS_LOG(1, "dying znode detected (zp=%p)", zp); - first = 0; - } - /* - * znode is dying so we can't reuse it, we must - * wait until destruction is completed. - */ - sa_buf_rele(db, NULL); - mutex_exit(&zp->z_lock); - ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); - if (vp != NULL) - VN_RELE(vp); - tsleep(zp, 0, "zcollide", 1); - goto again; - } *zpp = zp; err = 0; } sa_buf_rele(db, NULL); + + /* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */ + if (err == 0) + VN_HOLD(vp); + mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + + if (err == 0) { + locked = VOP_ISLOCKED(vp); + VI_LOCK(vp); + if ((vp->v_iflag & VI_DOOMED) != 0 && + locked != LK_EXCLUSIVE) { + /* + * The vnode is doomed and this thread doesn't + * hold the exclusive lock on it, so the vnode + * must be being reclaimed by another thread. + * Otherwise the doomed vnode is being reclaimed + * by this thread and zfs_zget is called from + * ZIL internals. + */ + VI_UNLOCK(vp); + VN_RELE(vp); + goto again; + } + VI_UNLOCK(vp); + } getnewvnode_drop_reserve(); return (err); } @@ -1400,7 +1392,6 @@ zfs_znode_delete(znode_t *zp, dmu_tx_t * void zfs_zinactive(znode_t *zp) { - vnode_t *vp = ZTOV(zp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; uint64_t z_id = zp->z_id; @@ -1412,19 +1403,6 @@ zfs_zinactive(znode_t *zp) ZFS_OBJ_HOLD_ENTER(zfsvfs, z_id); mutex_enter(&zp->z_lock); - VI_LOCK(vp); - if (vp->v_count > 0) { - /* - * If the hold count is greater than zero, somebody has - * obtained a new reference on this znode while we were - * processing it here, so we are done. - */ - VI_UNLOCK(vp); - mutex_exit(&zp->z_lock); - ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); - return; - } - VI_UNLOCK(vp); /* * If this was the last reference to a file with no links, @@ -1433,14 +1411,14 @@ zfs_zinactive(znode_t *zp) if (zp->z_unlinked) { mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); - ASSERT(vp->v_count == 0); - vrecycle(vp); zfs_rmnode(zp); return; } mutex_exit(&zp->z_lock); + zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); + zfs_znode_free(zp); } void @@ -1448,8 +1426,8 @@ zfs_znode_free(znode_t *zp) { zfsvfs_t *zfsvfs = zp->z_zfsvfs; - ASSERT(ZTOV(zp) == NULL); ASSERT(zp->z_sa_hdl == NULL); + zp->z_vnode = NULL; mutex_enter(&zfsvfs->z_znodes_lock); POINTER_INVALIDATE(&zp->z_zfsvfs); list_remove(&zfsvfs->z_all_znodes, zp); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 15:46: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 97318EB6; Sun, 25 Nov 2012 15:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CA218FC0C; Sun, 25 Nov 2012 15:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPFkTmc085485; Sun, 25 Nov 2012 15:46:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPFkTaT085484; Sun, 25 Nov 2012 15:46:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211251546.qAPFkTaT085484@svn.freebsd.org> From: Andriy Gapon Date: Sun, 25 Nov 2012 15:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243521 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 15:46:29 -0000 Author: avg Date: Sun Nov 25 15:46:29 2012 New Revision: 243521 URL: http://svnweb.freebsd.org/changeset/base/243521 Log: zfs_freebsd_reclaim: remove a stray variable ... which leaked from a subsequent local change. Unfortunately I noticed that only after commit. MFC after: 5 weeks X-MFC with: r243520 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 15:33:26 2012 (r243520) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 15:46:29 2012 (r243521) @@ -6212,7 +6212,6 @@ zfs_freebsd_reclaim(ap) vnode_t *vp = ap->a_vp; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; - int refcnt; ASSERT(zp != NULL); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 16:19:13 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 1A7967A5; Sun, 25 Nov 2012 16:19:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D733A8FC14; Sun, 25 Nov 2012 16:19:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPGJC7O090015; Sun, 25 Nov 2012 16:19:12 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPGJCXn090012; Sun, 25 Nov 2012 16:19:12 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201211251619.qAPGJCXn090012@svn.freebsd.org> From: Tim Kientzle Date: Sun, 25 Nov 2012 16:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243523 - in head/sys/arm: arm broadcom/bcm2835 ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 16:19:13 -0000 Author: kientzle Date: Sun Nov 25 16:19:12 2012 New Revision: 243523 URL: http://svnweb.freebsd.org/changeset/base/243523 Log: Fix spelling. Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sun Nov 25 15:58:35 2012 (r243522) +++ head/sys/arm/arm/mpcore_timer.c Sun Nov 25 16:19:12 2012 (r243523) @@ -128,7 +128,7 @@ static struct arm_tmr_softc *arm_tmr_sc static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { - .tc_name = "ARM MPCore Timecouter", + .tc_name = "ARM MPCore Timecounter", .tc_get_timecount = arm_tmr_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Sun Nov 25 15:58:35 2012 (r243522) +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Sun Nov 25 16:19:12 2012 (r243523) @@ -102,7 +102,7 @@ static struct bcm_systimer_softc *bcm_sy static unsigned bcm_systimer_tc_get_timecount(struct timecounter *); static struct timecounter bcm_systimer_tc = { - .tc_name = "BCM2835 Timecouter", + .tc_name = "BCM2835 Timecounter", .tc_get_timecount = bcm_systimer_tc_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Nov 25 15:58:35 2012 (r243522) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Nov 25 16:19:12 2012 (r243523) @@ -128,7 +128,7 @@ static struct am335x_dmtimer *am335x_dmt static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *); static struct timecounter am335x_dmtimer_tc = { - .tc_name = "AM335x Timecouter", + .tc_name = "AM335x Timecounter", .tc_get_timecount = am335x_dmtimer_tc_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 16:22:01 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 5504AB30; Sun, 25 Nov 2012 16:22:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id C96F18FC1B; Sun, 25 Nov 2012 16:22:00 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qAPGLq5R004822; Sun, 25 Nov 2012 18:21:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qAPGLq5R004822 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qAPGLqq4004821; Sun, 25 Nov 2012 18:21:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 25 Nov 2012 18:21:52 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r243142 - in head/sys: fs/nfsclient kern sys Message-ID: <20121125162152.GA3013@kib.kiev.ua> References: <201211160825.qAG8P6v6047507@svn.freebsd.org> <20121124222408.GH1460@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <20121124222408.GH1460@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 16:22:01 -0000 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 24, 2012 at 11:24:08PM +0100, Pawel Jakub Dawidek wrote: > On Fri, Nov 16, 2012 at 08:25:06AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Nov 16 08:25:06 2012 > > New Revision: 243142 > > URL: http://svnweb.freebsd.org/changeset/base/243142 > >=20 > > Log: > > In pget(9), if PGET_NOTWEXIT flag is not specified, also search the > > zombie list for the pid. This allows several kern.proc sysctls to > > report useful information for zombies. > > =20 > > Hold the allproc_lock around all searches instead of relocking it. > > Remove private pfind_locked() from the new nfs client code. > > =20 > > Requested and reviewed by: pjd > > Tested by: pho > > MFC after: 3 weeks > [...] > > @@ -364,12 +374,16 @@ pget(pid_t pid, int flags, struct proc * > > struct proc *p; > > int error; > > =20 > > + sx_slock(&allproc_lock); > > if (pid <=3D PID_MAX) > > - p =3D pfind(pid); > > + p =3D pfind_locked(pid); > > else if ((flags & PGET_NOTID) =3D=3D 0) > > - p =3D pfind_tid(pid); > > + p =3D pfind_tid_locked(pid); > > else > > p =3D NULL; > > + if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0) > > + p =3D zpfind_locked(pid); > > + sx_sunlock(&allproc_lock); > > if (p =3D=3D NULL) > > return (ESRCH); >=20 > I think we should move zpfind_locked() under 'pid <=3D PID_MAX': >=20 > sx_slock(&allproc_lock); > if (pid <=3D PID_MAX) { > p =3D pfind_locked(pid); > if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0) > p =3D zpfind_locked(pid); > } else if ((flags & PGET_NOTID) =3D=3D 0) { > p =3D pfind_tid_locked(pid); > } else { > p =3D NULL; > } > sx_sunlock(&allproc_lock); > if (p =3D=3D NULL) > return (ESRCH); >=20 Yes, I agree. Please remove {} for one-line blocks. --KsGdsel6WgEHnImy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCyRZ8ACgkQC3+MBN1Mb4jMWwCgsHJftyDD4T0q64Nfbrrnb4O7 KGIAoNJv5o1cUOxuReUv82kme48ikmZQ =sWF0 -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 16:32:08 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 AD93E79; Sun, 25 Nov 2012 16:32:08 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0DD8FC17; Sun, 25 Nov 2012 16:32:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPGW86N091593; Sun, 25 Nov 2012 16:32:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPGW8wd091581; Sun, 25 Nov 2012 16:32:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211251632.qAPGW8wd091581@svn.freebsd.org> From: Martin Matuska Date: Sun, 25 Nov 2012 16:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243524 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 16:32:08 -0000 Author: mm Date: Sun Nov 25 16:32:07 2012 New Revision: 243524 URL: http://svnweb.freebsd.org/changeset/base/243524 Log: MFV r243013 and r243267: Import the zio nop-write improvement from Illumos. To reduce I/O, nop-write omits overwriting data if the checksum (cryptographically secure) of new data matches the checksum of existing data. It also saves space if snapshots are in use. It currently works only on datasets with enabled compression, disabled deduplication and sha256 checksums. IllumOS 13887:196932ec9e6a and 13888:7204b3392a58 3236 zio nop-write References: https://www.illumos.org/issues/3236 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Nov 25 16:32:07 2012 (r243524) @@ -204,6 +204,7 @@ enum ztest_io_type { ZTEST_IO_WRITE_ZEROES, ZTEST_IO_TRUNCATE, ZTEST_IO_SETATTR, + ZTEST_IO_REWRITE, ZTEST_IO_TYPES }; @@ -1867,6 +1868,12 @@ ztest_get_data(void *arg, lr_write_t *lr DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -2012,6 +2019,9 @@ ztest_remove(ztest_ds_t *zd, ztest_od_t continue; } + /* + * No object was found. + */ if (od->od_object == 0) continue; @@ -2127,6 +2137,7 @@ ztest_prealloc(ztest_ds_t *zd, uint64_t static void ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset) { + int err; ztest_block_tag_t wbt; dmu_object_info_t doi; enum ztest_io_type io_type; @@ -2179,6 +2190,25 @@ ztest_io(ztest_ds_t *zd, uint64_t object case ZTEST_IO_SETATTR: (void) ztest_setattr(zd, object); break; + + case ZTEST_IO_REWRITE: + (void) rw_rdlock(&ztest_name_lock); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_COMPRESSION, + ztest_random_dsl_prop(ZFS_PROP_COMPRESSION), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + (void) rw_unlock(&ztest_name_lock); + + VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data, + DMU_READ_NO_PREFETCH)); + + (void) ztest_write(zd, object, offset, blocksize, data); + break; } (void) rw_unlock(&zd->zd_zilog_lock); @@ -2266,7 +2296,12 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; - VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); + /* + * We grab the zd_dirobj_lock to ensure that no other thread is + * updating the zil (i.e. adding in-memory log records) and the + * zd_zilog_lock to block any I/O. + */ + VERIFY0(mutex_lock(&zd->zd_dirobj_lock)); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -4925,8 +4960,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ */ for (int i = 0; i < copies; i++) { uint64_t offset = i * blocksize; - VERIFY(dmu_buf_hold(os, object, offset, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, offset, FTAG, &db, + DMU_READ_NO_PREFETCH)); ASSERT(db->db_offset == offset); ASSERT(db->db_size == blocksize); ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) || @@ -4942,8 +4977,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ /* * Find out what block we got. */ - VERIFY(dmu_buf_hold(os, object, 0, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, 0, FTAG, &db, + DMU_READ_NO_PREFETCH)); blk = *((dmu_buf_impl_t *)db)->db_blkptr; dmu_buf_rele(db, FTAG); @@ -5621,6 +5656,8 @@ ztest_freeze(void) kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); VERIFY3U(0, ==, ztest_dataset_open(0)); + spa->spa_debug = B_TRUE; + ztest_spa = spa; /* * Force the first log block to be transactionally allocated. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 25 16:32:07 2012 (r243524) @@ -3688,6 +3688,12 @@ arc_write_done(zio_t *zio) arc_hdr_destroy(exists); exists = buf_hash_insert(hdr, &hash_lock); ASSERT3P(exists, ==, NULL); + } else if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + /* nopwrite */ + ASSERT(zio->io_prop.zp_nopwrite); + if (!BP_EQUAL(&zio->io_bp_orig, zio->io_bp)) + panic("bad nopwrite, hdr=%p exists=%p", + (void *)hdr, (void *)exists); } else { /* Dedup */ ASSERT(hdr->b_datacnt == 1); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Nov 25 16:32:07 2012 (r243524) @@ -768,13 +768,15 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) ASSERT(db->db_data_pending != dr); /* free this block */ - if (!BP_IS_HOLE(bp)) { + if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { spa_t *spa; DB_GET_SPA(&spa, db); zio_free(spa, txg, bp); } dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; + dr->dt.dl.dr_nopwrite = B_FALSE; + /* * Release the already-written buffer, so we leave it in * a consistent dirty state. Note that all callers are @@ -2189,6 +2191,13 @@ dmu_buf_freeable(dmu_buf_t *dbuf) return (res); } +blkptr_t * +dmu_buf_get_blkptr(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + return (dbi->db_blkptr); +} + static void dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) { @@ -2531,7 +2540,11 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b ASSERT0(zio->io_error); ASSERT(db->db_blkptr == bp); - if (zio->io_flags & ZIO_FLAG_IO_REWRITE) { + /* + * For nopwrites and rewrites we ensure that the bp matches our + * original and bypass all the accounting. + */ + if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { ASSERT(BP_EQUAL(bp, bp_orig)); } else { objset_t *os; @@ -2722,7 +2735,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ mutex_enter(&db->db_mtx); dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by, - dr->dt.dl.dr_copies); + dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Nov 25 16:32:07 2012 (r243524) @@ -40,11 +40,17 @@ #include #include #include +#include #include #ifdef _KERNEL #include #endif +/* + * Enable/disable nopwrite feature. + */ +int zfs_nopwrite_enabled = 1; + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, "object directory" }, @@ -1287,6 +1293,16 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf mutex_enter(&db->db_mtx); ASSERT(dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC); if (zio->io_error == 0) { + dr->dt.dl.dr_nopwrite = !!(zio->io_flags & ZIO_FLAG_NOPWRITE); + if (dr->dt.dl.dr_nopwrite) { + blkptr_t *bp = zio->io_bp; + blkptr_t *bp_orig = &zio->io_bp_orig; + uint8_t chksum = BP_GET_CHECKSUM(bp_orig); + + ASSERT(BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_prop.zp_compress != ZIO_COMPRESS_OFF); + ASSERT(zio_checksum_table[chksum].ci_dedup); + } dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; dr->dt.dl.dr_copies = zio->io_prop.zp_copies; @@ -1308,11 +1324,22 @@ dmu_sync_late_arrival_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; dmu_sync_arg_t *dsa = zio->io_private; + blkptr_t *bp_orig = &zio->io_bp_orig; if (zio->io_error == 0 && !BP_IS_HOLE(bp)) { - ASSERT(zio->io_bp->blk_birth == zio->io_txg); - ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); - zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + /* + * If we didn't allocate a new block (i.e. ZIO_FLAG_NOPWRITE) + * then there is nothing to do here. Otherwise, free the + * newly allocated block in this txg. + */ + if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + ASSERT(BP_EQUAL(bp, bp_orig)); + } else { + ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_bp->blk_birth == zio->io_txg); + ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); + zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + } } dmu_tx_commit(dsa->dsa_tx); @@ -1357,7 +1384,7 @@ dmu_sync_late_arrival(zio_t *pio, objset * * Return values: * - * EEXIST: this txg has already been synced, so there's nothing to to. + * EEXIST: this txg has already been synced, so there's nothing to do. * The caller should not log the write. * * ENOENT: the block was dbuf_free_range()'d, so there's nothing to do. @@ -1389,7 +1416,6 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s dnode_t *dn; ASSERT(pio != NULL); - ASSERT(BP_IS_HOLE(bp)); ASSERT(txg != 0); SET_BOOKMARK(&zb, ds->ds_object, @@ -1444,6 +1470,23 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s return (ENOENT); } + ASSERT(dr->dr_next == NULL || dr->dr_next->dr_txg < txg); + + /* + * Assume the on-disk data is X, the current syncing data is Y, + * and the current in-memory data is Z (currently in dmu_sync). + * X and Z are identical but Y is has been modified. Normally, + * when X and Z are the same we will perform a nopwrite but if Y + * is different we must disable nopwrite since the resulting write + * of Y to disk can free the block containing X. If we allowed a + * nopwrite to occur the block pointing to Z would reference a freed + * block. Since this is a rare case we simplify this by disabling + * nopwrite if the current dmu_sync-ing dbuf has been modified in + * a previous transaction. + */ + if (dr->dr_next) + zp.zp_nopwrite = B_FALSE; + ASSERT(dr->dr_txg == txg); if (dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC || dr->dt.dl.dr_override_state == DR_OVERRIDDEN) { @@ -1532,15 +1575,27 @@ dmu_write_policy(objset_t *os, dnode_t * enum zio_checksum checksum = os->os_checksum; enum zio_compress compress = os->os_compress; enum zio_checksum dedup_checksum = os->os_dedup_checksum; - boolean_t dedup; + boolean_t dedup = B_FALSE; + boolean_t nopwrite = B_FALSE; boolean_t dedup_verify = os->os_dedup_verify; int copies = os->os_copies; /* - * Determine checksum setting. + * We maintain different write policies for each of the following + * types of data: + * 1. metadata + * 2. preallocated blocks (i.e. level-0 blocks of a dump device) + * 3. all other level 0 blocks */ if (ismd) { /* + * XXX -- we should design a compression algorithm + * that specializes in arrays of bps. + */ + compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : + ZIO_COMPRESS_LZJB; + + /* * Metadata always gets checksummed. If the data * checksum is multi-bit correctable, and it's not a * ZBT-style checksum, then it's suitable for metadata @@ -1550,45 +1605,47 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; - } else { - checksum = zio_checksum_select(dn->dn_checksum, checksum); - } + } else if (wp & WP_NOFILL) { + ASSERT(level == 0); - /* - * Determine compression setting. - */ - if (ismd) { /* - * XXX -- we should design a compression algorithm - * that specializes in arrays of bps. + * If we're writing preallocated blocks, we aren't actually + * writing them so don't set any policy properties. These + * blocks are currently only used by an external subsystem + * outside of zfs (i.e. dump) and not written by the zio + * pipeline. */ - compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : - ZIO_COMPRESS_LZJB; + compress = ZIO_COMPRESS_OFF; + checksum = ZIO_CHECKSUM_OFF; } else { compress = zio_compress_select(dn->dn_compress, compress); - } - /* - * Determine dedup setting. If we are in dmu_sync(), we won't - * actually dedup now because that's all done in syncing context; - * but we do want to use the dedup checkum. If the checksum is not - * strong enough to ensure unique signatures, force dedup_verify. - */ - dedup = (!ismd && dedup_checksum != ZIO_CHECKSUM_OFF); - if (dedup) { - checksum = dedup_checksum; - if (!zio_checksum_table[checksum].ci_dedup) - dedup_verify = 1; - } + checksum = (dedup_checksum == ZIO_CHECKSUM_OFF) ? + zio_checksum_select(dn->dn_checksum, checksum) : + dedup_checksum; - if (wp & WP_DMU_SYNC) - dedup = 0; + /* + * Determine dedup setting. If we are in dmu_sync(), + * we won't actually dedup now because that's all + * done in syncing context; but we do want to use the + * dedup checkum. If the checksum is not strong + * enough to ensure unique signatures, force + * dedup_verify. + */ + if (dedup_checksum != ZIO_CHECKSUM_OFF) { + dedup = (wp & WP_DMU_SYNC) ? B_FALSE : B_TRUE; + if (!zio_checksum_table[checksum].ci_dedup) + dedup_verify = B_TRUE; + } - if (wp & WP_NOFILL) { - ASSERT(!ismd && level == 0); - checksum = ZIO_CHECKSUM_OFF; - compress = ZIO_COMPRESS_OFF; - dedup = B_FALSE; + /* + * Enable nopwrite if we have a cryptographically secure + * checksum that has no known collisions (i.e. SHA-256) + * and compression is enabled. We don't enable nopwrite if + * dedup is enabled as the two features are mutually exclusive. + */ + nopwrite = (!dedup && zio_checksum_table[checksum].ci_dedup && + compress != ZIO_COMPRESS_OFF && zfs_nopwrite_enabled); } zp->zp_checksum = checksum; @@ -1598,6 +1655,7 @@ dmu_write_policy(objset_t *os, dnode_t * zp->zp_copies = MIN(copies + ismd, spa_max_replication(os->os_spa)); zp->zp_dedup = dedup; zp->zp_dedup_verify = dedup && dedup_verify; + zp->zp_nopwrite = nopwrite; } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sun Nov 25 16:32:07 2012 (r243524) @@ -440,7 +440,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * clean up our in-memory structures accumulated while syncing: * * - move dead blocks from the pending deadlist to the on-disk deadlist - * - clean up zil records * - release hold from dsl_dataset_dirty() */ while (ds = list_remove_head(&synced_datasets)) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Sun Nov 25 16:32:07 2012 (r243524) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DBUF_H @@ -130,6 +131,7 @@ typedef struct dbuf_dirty_record { blkptr_t dr_overridden_by; override_states_t dr_override_state; uint8_t dr_copies; + boolean_t dr_nopwrite; } dl; } dt; } dbuf_dirty_record_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sun Nov 25 16:32:07 2012 (r243524) @@ -505,6 +505,11 @@ void dmu_evict_user(objset_t *os, dmu_bu void *dmu_buf_get_user(dmu_buf_t *db); /* + * Returns the blkptr associated with this dbuf, or NULL if not set. + */ +struct blkptr *dmu_buf_get_blkptr(dmu_buf_t *db); + +/* * Indicate that you are going to modify the buffer's data (db_data). * * The transaction (tx) must be assigned to a txg (ie. you've called Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun Nov 25 16:32:07 2012 (r243524) @@ -188,7 +188,9 @@ enum zio_flag { ZIO_FLAG_RAW = 1 << 21, ZIO_FLAG_GANG_CHILD = 1 << 22, ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24 + ZIO_FLAG_GODFATHER = 1 << 24, + ZIO_FLAG_NOPWRITE = 1 << 25, + ZIO_FLAG_REEXECUTED = 1 << 26, }; #define ZIO_FLAG_MUSTSUCCEED 0 @@ -287,8 +289,9 @@ typedef struct zio_prop { dmu_object_type_t zp_type; uint8_t zp_level; uint8_t zp_copies; - uint8_t zp_dedup; - uint8_t zp_dedup_verify; + boolean_t zp_dedup; + boolean_t zp_dedup_verify; + boolean_t zp_nopwrite; } zio_prop_t; typedef struct zio_cksum_report zio_cksum_report_t; @@ -491,7 +494,8 @@ extern zio_t *zio_rewrite(zio_t *pio, sp void *data, uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, zbookmark_t *zb); -extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies); +extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, + boolean_t nopwrite); extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Sun Nov 25 16:32:07 2012 (r243524) @@ -38,6 +38,70 @@ extern "C" { #endif /* + * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * + * The ZFS I/O pipeline is comprised of various stages which are defined + * in the zio_stage enum below. The individual stages are used to construct + * these basic I/O operations: Read, Write, Free, Claim, and Ioctl. + * + * I/O operations: (XXX - provide detail for each of the operations) + * + * Read: + * Write: + * Free: + * Claim: + * Ioctl: + * + * Although the most common pipeline are used by the basic I/O operations + * above, there are some helper pipelines (one could consider them + * sub-pipelines) which are used internally by the ZIO module and are + * explained below: + * + * Interlock Pipeline: + * The interlock pipeline is the most basic pipeline and is used by all + * of the I/O operations. The interlock pipeline does not perform any I/O + * and is used to coordinate the dependencies between I/Os that are being + * issued (i.e. the parent/child relationship). + * + * Vdev child Pipeline: + * The vdev child pipeline is responsible for performing the physical I/O. + * It is in this pipeline where the I/O are queued and possibly cached. + * + * In addition to performing I/O, the pipeline is also responsible for + * data transformations. The transformations performed are based on the + * specific properties that user may have selected and modify the + * behavior of the pipeline. Examples of supported transformations are + * compression, dedup, and nop writes. Transformations will either modify + * the data or the pipeline. This list below further describes each of + * the supported transformations: + * + * Compression: + * ZFS supports three different flavors of compression -- gzip, lzjb, and + * zle. Compression occurs as part of the write pipeline and is performed + * in the ZIO_STAGE_WRITE_BP_INIT stage. + * + * Dedup: + * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and + * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing + * read pipeline if the dedup bit is set on the block pointer. + * Writing a dedup block is performed by the ZIO_STAGE_DDT_WRITE stage + * and added to a write pipeline if a user has enabled dedup on that + * particular dataset. + * + * NOP Write: + * The NOP write feature is performed by the ZIO_STAGE_NOP_WRITE stage + * and is added to an existing write pipeline if a crypographically + * secure checksum (i.e. SHA256) is enabled and compression is turned on. + * The NOP write stage will compare the checksums of the current data + * on-disk (level-0 blocks only) and the data that is currently being written. + * If the checksum values are identical then the pipeline is converted to + * an interlock pipeline skipping block allocation and bypassing the + * physical I/O. The nop write feature can handle writes in either + * syncing or open context (i.e. zil writes) and as a result is mutually + * exclusive with dedup. + */ + +/* * zio pipeline stage definitions */ enum zio_stage { @@ -50,27 +114,29 @@ enum zio_stage { ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */ - ZIO_STAGE_DDT_READ_START = 1 << 6, /* R---- */ - ZIO_STAGE_DDT_READ_DONE = 1 << 7, /* R---- */ - ZIO_STAGE_DDT_WRITE = 1 << 8, /* -W--- */ - ZIO_STAGE_DDT_FREE = 1 << 9, /* --F-- */ + ZIO_STAGE_NOP_WRITE = 1 << 6, /* -W--- */ + + ZIO_STAGE_DDT_READ_START = 1 << 7, /* R---- */ + ZIO_STAGE_DDT_READ_DONE = 1 << 8, /* R---- */ + ZIO_STAGE_DDT_WRITE = 1 << 9, /* -W--- */ + ZIO_STAGE_DDT_FREE = 1 << 10, /* --F-- */ - ZIO_STAGE_GANG_ASSEMBLE = 1 << 10, /* RWFC- */ - ZIO_STAGE_GANG_ISSUE = 1 << 11, /* RWFC- */ + ZIO_STAGE_GANG_ASSEMBLE = 1 << 11, /* RWFC- */ + ZIO_STAGE_GANG_ISSUE = 1 << 12, /* RWFC- */ - ZIO_STAGE_DVA_ALLOCATE = 1 << 12, /* -W--- */ - ZIO_STAGE_DVA_FREE = 1 << 13, /* --F-- */ - ZIO_STAGE_DVA_CLAIM = 1 << 14, /* ---C- */ + ZIO_STAGE_DVA_ALLOCATE = 1 << 13, /* -W--- */ + ZIO_STAGE_DVA_FREE = 1 << 14, /* --F-- */ + ZIO_STAGE_DVA_CLAIM = 1 << 15, /* ---C- */ - ZIO_STAGE_READY = 1 << 15, /* RWFCI */ + ZIO_STAGE_READY = 1 << 16, /* RWFCI */ - ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RWF-I */ - ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RWF-- */ - ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RWF-I */ + ZIO_STAGE_VDEV_IO_START = 1 << 17, /* RWF-I */ + ZIO_STAGE_VDEV_IO_DONE = 1 << 18, /* RWF-- */ + ZIO_STAGE_VDEV_IO_ASSESS = 1 << 19, /* RWF-I */ - ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */ + ZIO_STAGE_CHECKSUM_VERIFY = 1 << 20, /* R---- */ - ZIO_STAGE_DONE = 1 << 20 /* RWFCI */ + ZIO_STAGE_DONE = 1 << 21 /* RWFCI */ }; #define ZIO_INTERLOCK_STAGES \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 25 16:32:07 2012 (r243524) @@ -1203,6 +1203,12 @@ zfs_get_data(void *arg, lr_write_t *lr, DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Nov 25 16:32:07 2012 (r243524) @@ -709,9 +709,7 @@ zio_write(zio_t *pio, spa_t *spa, uint64 DMU_OT_IS_VALID(zp->zp_type) && zp->zp_level < 32 && zp->zp_copies > 0 && - zp->zp_copies <= spa_max_replication(spa) && - zp->zp_dedup <= 1 && - zp->zp_dedup_verify <= 1); + zp->zp_copies <= spa_max_replication(spa)); zio = zio_create(pio, spa, txg, bp, data, size, done, private, ZIO_TYPE_WRITE, priority, flags, NULL, 0, zb, @@ -739,13 +737,20 @@ zio_rewrite(zio_t *pio, spa_t *spa, uint } void -zio_write_override(zio_t *zio, blkptr_t *bp, int copies) +zio_write_override(zio_t *zio, blkptr_t *bp, int copies, boolean_t nopwrite) { ASSERT(zio->io_type == ZIO_TYPE_WRITE); ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); ASSERT(zio->io_stage == ZIO_STAGE_OPEN); ASSERT(zio->io_txg == spa_syncing_txg(zio->io_spa)); + /* + * We must reset the io_prop to match the values that existed + * when the bp was first written by dmu_sync() keeping in mind + * that nopwrite and dedup are mutually exclusive. + */ + zio->io_prop.zp_dedup = nopwrite ? B_FALSE : zio->io_prop.zp_dedup; + zio->io_prop.zp_nopwrite = nopwrite; zio->io_prop.zp_copies = copies; zio->io_bp_override = bp; } @@ -1045,6 +1050,19 @@ zio_write_bp_init(zio_t *zio) *bp = *zio->io_bp_override; zio->io_pipeline = ZIO_INTERLOCK_PIPELINE; + /* + * If we've been overridden and nopwrite is set then + * set the flag accordingly to indicate that a nopwrite + * has already occurred. + */ + if (!BP_IS_HOLE(bp) && zp->zp_nopwrite) { + ASSERT(!zp->zp_dedup); + zio->io_flags |= ZIO_FLAG_NOPWRITE; + return (ZIO_PIPELINE_CONTINUE); + } + + ASSERT(!zp->zp_nopwrite); + if (BP_IS_HOLE(bp) || !zp->zp_dedup) return (ZIO_PIPELINE_CONTINUE); @@ -1132,6 +1150,11 @@ zio_write_bp_init(zio_t *zio) ASSERT(!(zio->io_flags & ZIO_FLAG_IO_REWRITE)); zio->io_pipeline = ZIO_DDT_WRITE_PIPELINE; } + if (zp->zp_nopwrite) { + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + ASSERT(!(zio->io_flags & ZIO_FLAG_IO_REWRITE)); + zio->io_pipeline |= ZIO_STAGE_NOP_WRITE; + } } return (ZIO_PIPELINE_CONTINUE); @@ -1353,6 +1376,7 @@ zio_reexecute(zio_t *pio) pio->io_stage = pio->io_orig_stage; pio->io_pipeline = pio->io_orig_pipeline; pio->io_reexecute = 0; + pio->io_flags |= ZIO_FLAG_REEXECUTED; pio->io_error = 0; for (int w = 0; w < ZIO_WAIT_TYPES; w++) pio->io_state[w] = 0; @@ -1829,8 +1853,9 @@ zio_write_gang_block(zio_t *pio) zp.zp_type = DMU_OT_NONE; zp.zp_level = 0; zp.zp_copies = gio->io_prop.zp_copies; - zp.zp_dedup = 0; - zp.zp_dedup_verify = 0; + zp.zp_dedup = B_FALSE; + zp.zp_dedup_verify = B_FALSE; + zp.zp_nopwrite = B_FALSE; zio_nowait(zio_write(zio, spa, txg, &gbh->zg_blkptr[g], (char *)pio->io_data + (pio->io_size - resid), lsize, &zp, @@ -1850,6 +1875,62 @@ zio_write_gang_block(zio_t *pio) } /* + * The zio_nop_write stage in the pipeline determines if allocating + * a new bp is necessary. By leveraging a cryptographically secure checksum, + * such as SHA256, we can compare the checksums of the new data and the old + * to determine if allocating a new block is required. The nopwrite + * feature can handle writes in either syncing or open context (i.e. zil + * writes) and as a result is mutually exclusive with dedup. + */ +static int +zio_nop_write(zio_t *zio) +{ + blkptr_t *bp = zio->io_bp; + blkptr_t *bp_orig = &zio->io_bp_orig; + zio_prop_t *zp = &zio->io_prop; + + ASSERT(BP_GET_LEVEL(bp) == 0); + ASSERT(!(zio->io_flags & ZIO_FLAG_IO_REWRITE)); + ASSERT(zp->zp_nopwrite); + ASSERT(!zp->zp_dedup); + ASSERT(zio->io_bp_override == NULL); + ASSERT(IO_IS_ALLOCATING(zio)); + + /* + * Check to see if the original bp and the new bp have matching + * characteristics (i.e. same checksum, compression algorithms, etc). + * If they don't then just continue with the pipeline which will + * allocate a new bp. + */ + if (BP_IS_HOLE(bp_orig) || + !zio_checksum_table[BP_GET_CHECKSUM(bp)].ci_dedup || + BP_GET_CHECKSUM(bp) != BP_GET_CHECKSUM(bp_orig) || + BP_GET_COMPRESS(bp) != BP_GET_COMPRESS(bp_orig) || + BP_GET_DEDUP(bp) != BP_GET_DEDUP(bp_orig) || + zp->zp_copies != BP_GET_NDVAS(bp_orig)) + return (ZIO_PIPELINE_CONTINUE); + + /* + * If the checksums match then reset the pipeline so that we + * avoid allocating a new bp and issuing any I/O. + */ + if (ZIO_CHECKSUM_EQUAL(bp->blk_cksum, bp_orig->blk_cksum)) { + ASSERT(zio_checksum_table[zp->zp_checksum].ci_dedup); + ASSERT3U(BP_GET_PSIZE(bp), ==, BP_GET_PSIZE(bp_orig)); + ASSERT3U(BP_GET_LSIZE(bp), ==, BP_GET_LSIZE(bp_orig)); + ASSERT(zp->zp_compress != ZIO_COMPRESS_OFF); + ASSERT(bcmp(&bp->blk_prop, &bp_orig->blk_prop, + sizeof (uint64_t)) == 0); + + *bp = *bp_orig; + zio->io_pipeline = ZIO_INTERLOCK_PIPELINE; + zio->io_flags |= ZIO_FLAG_NOPWRITE; + } + + return (ZIO_PIPELINE_CONTINUE); +} + +/* * ========================================================================== * Dedup * ========================================================================== @@ -2121,7 +2202,7 @@ zio_ddt_write(zio_t *zio) zio->io_stage = ZIO_STAGE_OPEN; BP_ZERO(bp); } else { - zp->zp_dedup = 0; + zp->zp_dedup = B_FALSE; } zio->io_pipeline = ZIO_WRITE_PIPELINE; ddt_exit(ddt); @@ -2778,7 +2859,8 @@ zio_ready(zio_t *zio) if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); - ASSERT(bp->blk_birth == zio->io_txg || BP_IS_HOLE(bp)); + ASSERT(bp->blk_birth == zio->io_txg || BP_IS_HOLE(bp) || + (zio->io_flags & ZIO_FLAG_NOPWRITE)); ASSERT(zio->io_children[ZIO_CHILD_GANG][ZIO_WAIT_READY] == 0); zio->io_ready(zio); @@ -2860,6 +2942,8 @@ zio_done(zio_t *zio) ASSERT(BP_COUNT_GANG(bp) == 0 || (BP_COUNT_GANG(bp) == BP_GET_NDVAS(bp))); } + if (zio->io_flags & ZIO_FLAG_NOPWRITE) + VERIFY(BP_EQUAL(bp, &zio->io_bp_orig)); } /* @@ -2969,7 +3053,7 @@ zio_done(zio_t *zio) if ((zio->io_error || zio->io_reexecute) && IO_IS_ALLOCATING(zio) && zio->io_gang_leader == zio && - !(zio->io_flags & ZIO_FLAG_IO_REWRITE)) + !(zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE))) zio_dva_unallocate(zio, zio->io_gang_tree, bp); zio_gang_tree_free(&zio->io_gang_tree); @@ -3113,6 +3197,7 @@ static zio_pipe_stage_t *zio_pipeline[] zio_issue_async, zio_write_bp_init, zio_checksum_generate, + zio_nop_write, zio_ddt_read_start, zio_ddt_read_done, zio_ddt_write, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Nov 25 16:19:12 2012 (r243523) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Nov 25 16:32:07 2012 (r243524) @@ -78,6 +78,7 @@ #include #include #include +#include #include #include "zfs_namecheck.h" @@ -1051,6 +1052,12 @@ zvol_get_data(void *arg, lr_write_t *lr, error = dmu_buf_hold(os, object, offset, zgd, &db, DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 16:38:20 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 E47EA28A; Sun, 25 Nov 2012 16:38:20 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id A015C8FC12; Sun, 25 Nov 2012 16:38:20 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 8F6F7CB0; Sun, 25 Nov 2012 17:36:30 +0100 (CET) Date: Sun, 25 Nov 2012 17:39:24 +0100 From: Pawel Jakub Dawidek To: Martin Matuska Subject: Re: svn commit: r243524 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys Message-ID: <20121125163924.GM1460@garage.freebsd.pl> References: <201211251632.qAPGW8wd091581@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q8dntDJTu318bll0" Content-Disposition: inline In-Reply-To: <201211251632.qAPGW8wd091581@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 16:38:21 -0000 --q8dntDJTu318bll0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 25, 2012 at 04:32:08PM +0000, Martin Matuska wrote: > Author: mm > Date: Sun Nov 25 16:32:07 2012 > New Revision: 243524 > URL: http://svnweb.freebsd.org/changeset/base/243524 >=20 > Log: > MFV r243013 and r243267: > =20 > Import the zio nop-write improvement from Illumos. To reduce I/O, > nop-write omits overwriting data if the checksum (cryptographically > secure) of new data matches the checksum of existing data. > It also saves space if snapshots are in use. > =20 > It currently works only on datasets with enabled compression, disabled > deduplication and sha256 checksums. > =20 > IllumOS 13887:196932ec9e6a and 13888:7204b3392a58 > 3236 zio nop-write This is a nice change, although I don't understand why it depends on compression being turned on. It won't save any space. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --q8dntDJTu318bll0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCySbwACgkQForvXbEpPzTDXACg5iK922TMvB73fZJlZRjU1rOD tewAmgPjLCQacxqbnHko4RdbbSpVVDsH =9MAh -----END PGP SIGNATURE----- --q8dntDJTu318bll0-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 16:54:43 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 C15F265C; Sun, 25 Nov 2012 16:54:43 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3FDE8FC0C; Sun, 25 Nov 2012 16:54:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPGsh6e094408; Sun, 25 Nov 2012 16:54:43 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPGshis094407; Sun, 25 Nov 2012 16:54:43 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211251654.qAPGshis094407@svn.freebsd.org> From: Martin Matuska Date: Sun, 25 Nov 2012 16:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243525 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 16:54:43 -0000 Author: mm Date: Sun Nov 25 16:54:43 2012 New Revision: 243525 URL: http://svnweb.freebsd.org/changeset/base/243525 Log: Add loader(8) tunable to enable/disable nopwrite functionality: vfs.zfs.nopwrite_enabled MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Nov 25 16:32:07 2012 (r243524) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Nov 25 16:54:43 2012 (r243525) @@ -50,6 +50,10 @@ * Enable/disable nopwrite feature. */ int zfs_nopwrite_enabled = 1; +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled); +SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN, + &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, @@ -1562,7 +1566,6 @@ dmu_object_set_compress(objset_t *os, ui int zfs_mdcomp_disable = 0; TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable); -SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, &zfs_mdcomp_disable, 0, "Disable metadata compression"); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 18:22: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 55208D69; Sun, 25 Nov 2012 18:22:54 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3ABCD8FC0C; Sun, 25 Nov 2012 18:22:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPIMs6U006903; Sun, 25 Nov 2012 18:22:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPIMsiJ006902; Sun, 25 Nov 2012 18:22:54 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201211251822.qAPIMsiJ006902@svn.freebsd.org> From: Tim Kientzle Date: Sun, 25 Nov 2012 18:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243526 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 18:22:54 -0000 Author: kientzle Date: Sun Nov 25 18:22:53 2012 New Revision: 243526 URL: http://svnweb.freebsd.org/changeset/base/243526 Log: Print kernel args when booting the kernel. Modified: head/sys/boot/uboot/lib/elf_freebsd.c Modified: head/sys/boot/uboot/lib/elf_freebsd.c ============================================================================== --- head/sys/boot/uboot/lib/elf_freebsd.c Sun Nov 25 16:54:43 2012 (r243525) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sun Nov 25 18:22:53 2012 (r243526) @@ -82,6 +82,7 @@ __elfN(uboot_exec)(struct preloaded_file entry = uboot_vm_translate(e->e_entry); printf("Kernel entry at 0x%x...\n", (unsigned)entry); + printf("Kernel args: %s\n", fp->f_args); dev_cleanup(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 19:10: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 ABAE3FB0; Sun, 25 Nov 2012 19:10:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90B5C8FC08; Sun, 25 Nov 2012 19:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPJArx8012808; Sun, 25 Nov 2012 19:10:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPJArsO012807; Sun, 25 Nov 2012 19:10:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211251910.qAPJArsO012807@svn.freebsd.org> From: Hiroki Sato Date: Sun, 25 Nov 2012 19:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r243527 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 19:10:53 -0000 Author: hrs Date: Sun Nov 25 19:10:53 2012 New Revision: 243527 URL: http://svnweb.freebsd.org/changeset/base/243527 Log: Please welcome Takuya ASADA (syuu) as a new src committer. Takuya was a GSoC student who worked on Multiqueue BPF support in 2011 and BHyVe BIOS emulation in 2012, and will be continuing work on improving virtualization and parallelism in the network stack/drivers. I will be his mentor with gnn@ as co-mentor. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Nov 25 18:22:53 2012 (r243526) +++ svnadmin/conf/access Sun Nov 25 19:10:53 2012 (r243527) @@ -240,6 +240,7 @@ stas stefanf suz syrinx +syuu takawata tanimura theraven From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 19:28:59 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 F39AAA52; Sun, 25 Nov 2012 19:28:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id B1DB88FC08; Sun, 25 Nov 2012 19:28:57 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 16B74CEE; Sun, 25 Nov 2012 20:27:09 +0100 (CET) Date: Sun, 25 Nov 2012 20:30:08 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r243142 - in head/sys: fs/nfsclient kern sys Message-ID: <20121125193008.GN1460@garage.freebsd.pl> References: <201211160825.qAG8P6v6047507@svn.freebsd.org> <20121124222408.GH1460@garage.freebsd.pl> <20121125162152.GA3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i6vqABX3nJKXLk01" Content-Disposition: inline In-Reply-To: <20121125162152.GA3013@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 19:28:59 -0000 --i6vqABX3nJKXLk01 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 25, 2012 at 06:21:52PM +0200, Konstantin Belousov wrote: > On Sat, Nov 24, 2012 at 11:24:08PM +0100, Pawel Jakub Dawidek wrote: > > I think we should move zpfind_locked() under 'pid <=3D PID_MAX': > >=20 > > sx_slock(&allproc_lock); > > if (pid <=3D PID_MAX) { > > p =3D pfind_locked(pid); > > if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0) > > p =3D zpfind_locked(pid); > > } else if ((flags & PGET_NOTID) =3D=3D 0) { > > p =3D pfind_tid_locked(pid); > > } else { > > p =3D NULL; > > } > > sx_sunlock(&allproc_lock); > > if (p =3D=3D NULL) > > return (ESRCH); > >=20 >=20 > Yes, I agree. Please remove {} for one-line blocks. If I need braces in one place, I put them into all the places so that all the elses are aligned. style(9) does allow that. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --i6vqABX3nJKXLk01 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCyccAACgkQForvXbEpPzT3VgCggvcjjInHNPsmtHKUO+FJxA5m LdkAoMzIIgZvEQpRuD/JIs4wW/jBweUr =h3x4 -----END PGP SIGNATURE----- --i6vqABX3nJKXLk01-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 19:31: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 E9C0EDD2; Sun, 25 Nov 2012 19:31:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD8148FC08; Sun, 25 Nov 2012 19:31:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPJVgaA015467; Sun, 25 Nov 2012 19:31:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPJVgSA015466; Sun, 25 Nov 2012 19:31:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211251931.qAPJVgSA015466@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 25 Nov 2012 19:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243528 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 19:31:43 -0000 Author: pjd Date: Sun Nov 25 19:31:42 2012 New Revision: 243528 URL: http://svnweb.freebsd.org/changeset/base/243528 Log: Look for zombie process only if we were given process id. Reviewed by: kib MFC after: 2 weeks X-MFC-after-or-with: 243142 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Nov 25 19:10:53 2012 (r243527) +++ head/sys/kern/kern_proc.c Sun Nov 25 19:31:42 2012 (r243528) @@ -375,14 +375,15 @@ pget(pid_t pid, int flags, struct proc * int error; sx_slock(&allproc_lock); - if (pid <= PID_MAX) + if (pid <= PID_MAX) { p = pfind_locked(pid); - else if ((flags & PGET_NOTID) == 0) + if (p == NULL && (flags & PGET_NOTWEXIT) == 0) + p = zpfind_locked(pid); + } else if ((flags & PGET_NOTID) == 0) { p = pfind_tid_locked(pid); - else + } else { p = NULL; - if (p == NULL && (flags & PGET_NOTWEXIT) == 0) - p = zpfind_locked(pid); + } sx_sunlock(&allproc_lock); if (p == NULL) return (ESRCH); From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 19:42:36 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 BBDC9152; Sun, 25 Nov 2012 19:42:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 818018FC08; Sun, 25 Nov 2012 19:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPJgaiC016685; Sun, 25 Nov 2012 19:42:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPJgaC7016684; Sun, 25 Nov 2012 19:42:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201211251942.qAPJgaC7016684@svn.freebsd.org> From: Alan Cox Date: Sun, 25 Nov 2012 19:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243529 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 19:42:37 -0000 Author: alc Date: Sun Nov 25 19:42:36 2012 New Revision: 243529 URL: http://svnweb.freebsd.org/changeset/base/243529 Log: Make a few small changes to vm_map_pmap_enter(): Add detail to the comment describing this function. In particular, describe what MAP_PREFAULT_PARTIAL does. Eliminate the abrupt change in behavior when the specified address range grows from MAX_INIT_PT pages to MAX_INIT_PT plus one pages. Instead of doing nothing, i.e., preloading no mappings whatsoever, map any resident pages that fall within the start of the specified address range, i.e., [addr, addr + ulmin(size, ptoa(MAX_INIT_PT))). Long ago, the vm object's list of resident pages was not ordered, so this function had to choose between probing the global hash table of all resident pages and iterating over the vm object's unordered list of resident pages. Now, the list is ordered, so there is no reason for MAP_PREFAULT_PARTIAL to be concerned with the vm object's count of resident changes. MFC after: 14 days Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 25 19:31:42 2012 (r243528) +++ head/sys/vm/vm_map.c Sun Nov 25 19:42:36 2012 (r243529) @@ -1793,10 +1793,14 @@ vm_map_submap( /* * vm_map_pmap_enter: * - * Preload read-only mappings for the given object's resident pages into - * the given map. This eliminates the soft faults on process startup and - * immediately after an mmap(2). Because these are speculative mappings, - * cached pages are not reactivated and mapped. + * Preload read-only mappings for the specified object's resident pages + * into the target map. If "flags" is MAP_PREFAULT_PARTIAL, then only + * the resident pages within the address range [addr, addr + ulmin(size, + * ptoa(MAX_INIT_PT))) are mapped. Otherwise, all resident pages within + * the specified address range are mapped. This eliminates many soft + * faults on process startup and immediately after an mmap(2). Because + * these are speculative mappings, cached pages are not reactivated and + * mapped. */ void vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_prot_t prot, @@ -1815,11 +1819,8 @@ vm_map_pmap_enter(vm_map_t map, vm_offse } psize = atop(size); - - if ((flags & MAP_PREFAULT_PARTIAL) && psize > MAX_INIT_PT && - object->resident_page_count > MAX_INIT_PT) - goto unlock_return; - + if (psize > MAX_INIT_PT && (flags & MAP_PREFAULT_PARTIAL) != 0) + psize = MAX_INIT_PT; if (psize + pindex > object->size) { if (object->size < pindex) goto unlock_return; From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 20:06: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 3163B77D; Sun, 25 Nov 2012 20:06:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 162018FC16; Sun, 25 Nov 2012 20:06:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPK626w019725; Sun, 25 Nov 2012 20:06:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPK62QZ019724; Sun, 25 Nov 2012 20:06:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211252006.qAPK62QZ019724@svn.freebsd.org> From: Alexander Motin Date: Sun, 25 Nov 2012 20:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243530 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 20:06:02 -0000 Author: mav Date: Sun Nov 25 20:06:01 2012 New Revision: 243530 URL: http://svnweb.freebsd.org/changeset/base/243530 Log: On multiple requests, compact HDA driver verbose output by hiding CODEC's detailed information under the sound debug. To make it easier accessible, export that information through the set of sysctls like dev.hdaa.X.nidY. Also tune some output to make it both more compact and informative. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Sun Nov 25 19:42:36 2012 (r243529) +++ head/sys/dev/sound/pci/hda/hdaa.c Sun Nov 25 20:06:01 2012 (r243530) @@ -978,6 +978,253 @@ hdaa_local_patch_pin(struct hdaa_widget w->wclass.pin.newconf = w->wclass.pin.config = config; } +static void +hdaa_dump_audio_formats_sb(struct sbuf *sb, uint32_t fcap, uint32_t pcmcap) +{ + uint32_t cap; + + cap = fcap; + if (cap != 0) { + sbuf_printf(sb, " Stream cap: 0x%08x", cap); + if (HDA_PARAM_SUPP_STREAM_FORMATS_AC3(cap)) + sbuf_printf(sb, " AC3"); + if (HDA_PARAM_SUPP_STREAM_FORMATS_FLOAT32(cap)) + sbuf_printf(sb, " FLOAT32"); + if (HDA_PARAM_SUPP_STREAM_FORMATS_PCM(cap)) + sbuf_printf(sb, " PCM"); + sbuf_printf(sb, "\n"); + } + cap = pcmcap; + if (cap != 0) { + sbuf_printf(sb, " PCM cap: 0x%08x", cap); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_8BIT(cap)) + sbuf_printf(sb, " 8"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_16BIT(cap)) + sbuf_printf(sb, " 16"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_20BIT(cap)) + sbuf_printf(sb, " 20"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_24BIT(cap)) + sbuf_printf(sb, " 24"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_32BIT(cap)) + sbuf_printf(sb, " 32"); + sbuf_printf(sb, " bits,"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_8KHZ(cap)) + sbuf_printf(sb, " 8"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_11KHZ(cap)) + sbuf_printf(sb, " 11"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_16KHZ(cap)) + sbuf_printf(sb, " 16"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_22KHZ(cap)) + sbuf_printf(sb, " 22"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_32KHZ(cap)) + sbuf_printf(sb, " 32"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_44KHZ(cap)) + sbuf_printf(sb, " 44"); + sbuf_printf(sb, " 48"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_88KHZ(cap)) + sbuf_printf(sb, " 88"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_96KHZ(cap)) + sbuf_printf(sb, " 96"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_176KHZ(cap)) + sbuf_printf(sb, " 176"); + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_192KHZ(cap)) + sbuf_printf(sb, " 192"); + sbuf_printf(sb, " KHz\n"); + } +} + +static void +hdaa_dump_pin_sb(struct sbuf *sb, struct hdaa_widget *w) +{ + uint32_t pincap, conf; + + pincap = w->wclass.pin.cap; + + sbuf_printf(sb, " Pin cap: 0x%08x", pincap); + if (HDA_PARAM_PIN_CAP_IMP_SENSE_CAP(pincap)) + sbuf_printf(sb, " ISC"); + if (HDA_PARAM_PIN_CAP_TRIGGER_REQD(pincap)) + sbuf_printf(sb, " TRQD"); + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(pincap)) + sbuf_printf(sb, " PDC"); + if (HDA_PARAM_PIN_CAP_HEADPHONE_CAP(pincap)) + sbuf_printf(sb, " HP"); + if (HDA_PARAM_PIN_CAP_OUTPUT_CAP(pincap)) + sbuf_printf(sb, " OUT"); + if (HDA_PARAM_PIN_CAP_INPUT_CAP(pincap)) + sbuf_printf(sb, " IN"); + if (HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(pincap)) + sbuf_printf(sb, " BAL"); + if (HDA_PARAM_PIN_CAP_HDMI(pincap)) + sbuf_printf(sb, " HDMI"); + if (HDA_PARAM_PIN_CAP_VREF_CTRL(pincap)) { + sbuf_printf(sb, " VREF["); + if (HDA_PARAM_PIN_CAP_VREF_CTRL_50(pincap)) + sbuf_printf(sb, " 50"); + if (HDA_PARAM_PIN_CAP_VREF_CTRL_80(pincap)) + sbuf_printf(sb, " 80"); + if (HDA_PARAM_PIN_CAP_VREF_CTRL_100(pincap)) + sbuf_printf(sb, " 100"); + if (HDA_PARAM_PIN_CAP_VREF_CTRL_GROUND(pincap)) + sbuf_printf(sb, " GROUND"); + if (HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ(pincap)) + sbuf_printf(sb, " HIZ"); + sbuf_printf(sb, " ]"); + } + if (HDA_PARAM_PIN_CAP_EAPD_CAP(pincap)) + sbuf_printf(sb, " EAPD"); + if (HDA_PARAM_PIN_CAP_DP(pincap)) + sbuf_printf(sb, " DP"); + if (HDA_PARAM_PIN_CAP_HBR(pincap)) + sbuf_printf(sb, " HBR"); + sbuf_printf(sb, "\n"); + conf = w->wclass.pin.config; + sbuf_printf(sb, " Pin config: 0x%08x", conf); + sbuf_printf(sb, " as=%d seq=%d " + "device=%s conn=%s ctype=%s loc=%s color=%s misc=%d\n", + HDA_CONFIG_DEFAULTCONF_ASSOCIATION(conf), + HDA_CONFIG_DEFAULTCONF_SEQUENCE(conf), + HDA_DEVS[HDA_CONFIG_DEFAULTCONF_DEVICE(conf)], + HDA_CONNS[HDA_CONFIG_DEFAULTCONF_CONNECTIVITY(conf)], + HDA_CONNECTORS[HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE(conf)], + HDA_LOCS[HDA_CONFIG_DEFAULTCONF_LOCATION(conf)], + HDA_COLORS[HDA_CONFIG_DEFAULTCONF_COLOR(conf)], + HDA_CONFIG_DEFAULTCONF_MISC(conf)); + sbuf_printf(sb, " Pin control: 0x%08x", w->wclass.pin.ctrl); + if (w->wclass.pin.ctrl & HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE) + sbuf_printf(sb, " HP"); + if (w->wclass.pin.ctrl & HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE) + sbuf_printf(sb, " IN"); + if (w->wclass.pin.ctrl & HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE) + sbuf_printf(sb, " OUT"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { + if ((w->wclass.pin.ctrl & + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) == 0x03) + sbuf_printf(sb, " HBR"); + else if ((w->wclass.pin.ctrl & + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) != 0) + sbuf_printf(sb, " EPTs"); + } else { + if ((w->wclass.pin.ctrl & + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) != 0) + sbuf_printf(sb, " VREFs"); + } + sbuf_printf(sb, "\n"); +} + +static void +hdaa_dump_amp_sb(struct sbuf *sb, uint32_t cap, char *banner) +{ + int offset, size, step; + + offset = HDA_PARAM_OUTPUT_AMP_CAP_OFFSET(cap); + size = HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE(cap); + step = HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS(cap); + sbuf_printf(sb, " %s amp: 0x%08x " + "mute=%d step=%d size=%d offset=%d (%+d/%+ddB)\n", + banner, cap, + HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP(cap), + step, size, offset, + ((0 - offset) * (size + 1)) / 4, + ((step - offset) * (size + 1)) / 4); +} + + +static int +hdaa_sysctl_caps(SYSCTL_HANDLER_ARGS) +{ + struct hdaa_devinfo *devinfo; + struct hdaa_widget *w, *cw; + struct sbuf sb; + char buf[64]; + int error, j; + + w = (struct hdaa_widget *)oidp->oid_arg1; + devinfo = w->devinfo; + sbuf_new_for_sysctl(&sb, NULL, 256, req); + + sbuf_printf(&sb, "%s%s\n", w->name, + (w->enable == 0) ? " [DISABLED]" : ""); + sbuf_printf(&sb, " Widget cap: 0x%08x", + w->param.widget_cap); + if (w->param.widget_cap & 0x0ee1) { + if (HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP(w->param.widget_cap)) + sbuf_printf(&sb, " LRSWAP"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_POWER_CTRL(w->param.widget_cap)) + sbuf_printf(&sb, " PWR"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) + sbuf_printf(&sb, " DIGITAL"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) + sbuf_printf(&sb, " UNSOL"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_PROC_WIDGET(w->param.widget_cap)) + sbuf_printf(&sb, " PROC"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) + sbuf_printf(&sb, " STRIPE(x%d)", + 1 << (fls(w->wclass.conv.stripecap) - 1)); + j = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); + if (j == 1) + sbuf_printf(&sb, " STEREO"); + else if (j > 1) + sbuf_printf(&sb, " %dCH", j + 1); + } + sbuf_printf(&sb, "\n"); + if (w->bindas != -1) { + sbuf_printf(&sb, " Association: %d (0x%04x)\n", + w->bindas, w->bindseqmask); + } + if (w->ossmask != 0 || w->ossdev >= 0) { + sbuf_printf(&sb, " OSS: %s", + hdaa_audio_ctl_ossmixer_mask2allname(w->ossmask, buf, sizeof(buf))); + if (w->ossdev >= 0) + sbuf_printf(&sb, " (%s)", ossnames[w->ossdev]); + sbuf_printf(&sb, "\n"); + } + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_OUTPUT || + w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT) { + hdaa_dump_audio_formats_sb(&sb, + w->param.supp_stream_formats, + w->param.supp_pcm_size_rate); + } else if (w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX || w->waspin) + hdaa_dump_pin_sb(&sb, w); + if (w->param.eapdbtl != HDA_INVALID) { + sbuf_printf(&sb, " EAPD: 0x%08x%s%s%s\n", + w->param.eapdbtl, + (w->param.eapdbtl & HDA_CMD_SET_EAPD_BTL_ENABLE_LR_SWAP) ? + " LRSWAP" : "", + (w->param.eapdbtl & HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD) ? + " EAPD" : "", + (w->param.eapdbtl & HDA_CMD_SET_EAPD_BTL_ENABLE_BTL) ? + " BTL" : ""); + } + if (HDA_PARAM_AUDIO_WIDGET_CAP_OUT_AMP(w->param.widget_cap) && + w->param.outamp_cap != 0) + hdaa_dump_amp_sb(&sb, w->param.outamp_cap, "Output"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_IN_AMP(w->param.widget_cap) && + w->param.inamp_cap != 0) + hdaa_dump_amp_sb(&sb, w->param.inamp_cap, " Input"); + if (w->nconns > 0) + sbuf_printf(&sb, " Connections: %d\n", w->nconns); + for (j = 0; j < w->nconns; j++) { + cw = hdaa_widget_get(devinfo, w->conns[j]); + sbuf_printf(&sb, " + %s<- nid=%d [%s]", + (w->connsenable[j] == 0)?"[DISABLED] ":"", + w->conns[j], (cw == NULL) ? "GHOST!" : cw->name); + if (cw == NULL) + sbuf_printf(&sb, " [UNKNOWN]"); + else if (cw->enable == 0) + sbuf_printf(&sb, " [DISABLED]"); + if (w->nconns > 1 && w->selconn == j && w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_MIXER) + sbuf_printf(&sb, " (selected)"); + sbuf_printf(&sb, "\n"); + } + sbuf_trim(&sb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error); +} + static int hdaa_sysctl_config(SYSCTL_HANDLER_ARGS) { @@ -1301,8 +1548,16 @@ hdaa_widget_parse(struct hdaa_widget *w) w->param.eapdbtl |= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; } else w->param.eapdbtl = HDA_INVALID; + } + w->unsol = -1; - hdaa_unlock(w->devinfo); + hdaa_unlock(w->devinfo); + snprintf(buf, sizeof(buf), "nid%d", w->nid); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + w, sizeof(w), hdaa_sysctl_caps, "A", "Node capabilities"); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { snprintf(buf, sizeof(buf), "nid%d_config", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, @@ -1315,9 +1570,8 @@ hdaa_widget_parse(struct hdaa_widget *w) buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, &w->wclass.pin.original, sizeof(&w->wclass.pin.original), hdaa_sysctl_config, "A", "Original pin configuration"); - hdaa_lock(w->devinfo); } - w->unsol = -1; + hdaa_lock(w->devinfo); } static void @@ -5327,7 +5581,6 @@ hdaa_dump_ctls(struct hdaa_pcm_devinfo * continue; if (printed == 0) { - device_printf(pdevinfo->dev, "\n"); if (banner != NULL) { device_printf(pdevinfo->dev, "%s", banner); } else { @@ -5342,7 +5595,6 @@ hdaa_dump_ctls(struct hdaa_pcm_devinfo * pdevinfo->maxamp[j] / 4); } else printf("\n"); - device_printf(pdevinfo->dev, " |\n"); printed = 1; } device_printf(pdevinfo->dev, " +- ctl %2d (nid %3d %s", i, @@ -5362,6 +5614,8 @@ hdaa_dump_ctls(struct hdaa_pcm_devinfo * printf("%s\n", ctl->mute?"mute":""); } } + if (printed) + device_printf(pdevinfo->dev, "\n"); } static void @@ -5371,8 +5625,7 @@ hdaa_dump_audio_formats(device_t dev, ui cap = fcap; if (cap != 0) { - device_printf(dev, " Stream cap: 0x%08x\n", cap); - device_printf(dev, " "); + device_printf(dev, " Stream cap: 0x%08x", cap); if (HDA_PARAM_SUPP_STREAM_FORMATS_AC3(cap)) printf(" AC3"); if (HDA_PARAM_SUPP_STREAM_FORMATS_FLOAT32(cap)) @@ -5383,8 +5636,7 @@ hdaa_dump_audio_formats(device_t dev, ui } cap = pcmcap; if (cap != 0) { - device_printf(dev, " PCM cap: 0x%08x\n", cap); - device_printf(dev, " "); + device_printf(dev, " PCM cap: 0x%08x", cap); if (HDA_PARAM_SUPP_PCM_SIZE_RATE_8BIT(cap)) printf(" 8"); if (HDA_PARAM_SUPP_PCM_SIZE_RATE_16BIT(cap)) @@ -5428,8 +5680,7 @@ hdaa_dump_pin(struct hdaa_widget *w) pincap = w->wclass.pin.cap; - device_printf(w->devinfo->dev, " Pin cap: 0x%08x\n", pincap); - device_printf(w->devinfo->dev, " "); + device_printf(w->devinfo->dev, " Pin cap: 0x%08x", pincap); if (HDA_PARAM_PIN_CAP_IMP_SENSE_CAP(pincap)) printf(" ISC"); if (HDA_PARAM_PIN_CAP_TRIGGER_REQD(pincap)) @@ -5530,13 +5781,18 @@ hdaa_dump_pin_configs(struct hdaa_devinf static void hdaa_dump_amp(device_t dev, uint32_t cap, char *banner) { - device_printf(dev, " %s amp: 0x%08x\n", banner, cap); - device_printf(dev, " " - "mute=%d step=%d size=%d offset=%d\n", + int offset, size, step; + + offset = HDA_PARAM_OUTPUT_AMP_CAP_OFFSET(cap); + size = HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE(cap); + step = HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS(cap); + device_printf(dev, " %s amp: 0x%08x " + "mute=%d step=%d size=%d offset=%d (%+d/%+ddB)\n", + banner, cap, HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP(cap), - HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS(cap), - HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE(cap), - HDA_PARAM_OUTPUT_AMP_CAP_OFFSET(cap)); + step, size, offset, + ((0 - offset) * (size + 1)) / 4, + ((step - offset) * (size + 1)) / 4); } static void @@ -5547,15 +5803,12 @@ hdaa_dump_nodes(struct hdaa_devinfo *dev int i, j; device_printf(devinfo->dev, "\n"); - device_printf(devinfo->dev, "Default Parameter\n"); - device_printf(devinfo->dev, "-----------------\n"); + device_printf(devinfo->dev, "Default parameters:\n"); hdaa_dump_audio_formats(devinfo->dev, devinfo->supp_stream_formats, devinfo->supp_pcm_size_rate); - device_printf(devinfo->dev, " IN amp: 0x%08x\n", - devinfo->inamp_cap); - device_printf(devinfo->dev, " OUT amp: 0x%08x\n", - devinfo->outamp_cap); + hdaa_dump_amp(devinfo->dev, devinfo->inamp_cap, " Input"); + hdaa_dump_amp(devinfo->dev, devinfo->outamp_cap, "Output"); for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdaa_widget_get(devinfo, i); if (w == NULL) { @@ -5566,10 +5819,9 @@ hdaa_dump_nodes(struct hdaa_devinfo *dev device_printf(devinfo->dev, " nid: %d%s\n", w->nid, (w->enable == 0) ? " [DISABLED]" : ""); device_printf(devinfo->dev, " Name: %s\n", w->name); - device_printf(devinfo->dev, " Widget cap: 0x%08x\n", + device_printf(devinfo->dev, " Widget cap: 0x%08x", w->param.widget_cap); if (w->param.widget_cap & 0x0ee1) { - device_printf(devinfo->dev, " "); if (HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP(w->param.widget_cap)) printf(" LRSWAP"); if (HDA_PARAM_AUDIO_WIDGET_CAP_POWER_CTRL(w->param.widget_cap)) @@ -5588,10 +5840,10 @@ hdaa_dump_nodes(struct hdaa_devinfo *dev printf(" STEREO"); else if (j > 1) printf(" %dCH", j + 1); - printf("\n"); } + printf("\n"); if (w->bindas != -1) { - device_printf(devinfo->dev, " Association: %d (0x%08x)\n", + device_printf(devinfo->dev, " Association: %d (0x%04x)\n", w->bindas, w->bindseqmask); } if (w->ossmask != 0 || w->ossdev >= 0) { @@ -5618,10 +5870,8 @@ hdaa_dump_nodes(struct hdaa_devinfo *dev if (HDA_PARAM_AUDIO_WIDGET_CAP_IN_AMP(w->param.widget_cap) && w->param.inamp_cap != 0) hdaa_dump_amp(devinfo->dev, w->param.inamp_cap, " Input"); - if (w->nconns > 0) { - device_printf(devinfo->dev, " connections: %d\n", w->nconns); - device_printf(devinfo->dev, " |\n"); - } + if (w->nconns > 0) + device_printf(devinfo->dev, " Connections: %d\n", w->nconns); for (j = 0; j < w->nconns; j++) { cw = hdaa_widget_get(devinfo, w->conns[j]); device_printf(devinfo->dev, " + %s<- nid=%d [%s]", @@ -5646,7 +5896,7 @@ hdaa_dump_dst_nid(struct hdaa_pcm_devinf struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_widget *w, *cw; char buf[64]; - int i, printed = 0; + int i; if (depth > HDA_PARSE_MAXDEPTH) return; @@ -5682,10 +5932,6 @@ hdaa_dump_dst_nid(struct hdaa_pcm_devinf cw = hdaa_widget_get(devinfo, w->conns[i]); if (cw == NULL || cw->enable == 0 || cw->bindas == -1) continue; - if (printed == 0) { - device_printf(pdevinfo->dev, "%*s |\n", 4 + (depth) * 7, ""); - printed = 1; - } hdaa_dump_dst_nid(pdevinfo, w->conns[i], depth + 1); } @@ -5697,11 +5943,26 @@ hdaa_dump_dac(struct hdaa_pcm_devinfo *p struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_audio_as *as; struct hdaa_widget *w; - int i, printed = 0; + nid_t *nids; + int chid, i; if (pdevinfo->playas < 0) return; + device_printf(pdevinfo->dev, "Playback:\n"); + + chid = devinfo->as[pdevinfo->playas].chans[0]; + hdaa_dump_audio_formats(pdevinfo->dev, + devinfo->chans[chid].supp_stream_formats, + devinfo->chans[chid].supp_pcm_size_rate); + for (i = 0; i < devinfo->as[pdevinfo->playas].num_chans; i++) { + chid = devinfo->as[pdevinfo->playas].chans[i]; + device_printf(pdevinfo->dev, " DAC:"); + for (nids = devinfo->chans[chid].io; *nids != -1; nids++) + printf(" %d", *nids); + printf("\n"); + } + as = &devinfo->as[pdevinfo->playas]; for (i = 0; i < 16; i++) { if (as->pins[i] <= 0) @@ -5709,14 +5970,10 @@ hdaa_dump_dac(struct hdaa_pcm_devinfo *p w = hdaa_widget_get(devinfo, as->pins[i]); if (w == NULL || w->enable == 0) continue; - if (printed == 0) { - printed = 1; - device_printf(pdevinfo->dev, "\n"); - device_printf(pdevinfo->dev, "Playback:\n"); - } device_printf(pdevinfo->dev, "\n"); hdaa_dump_dst_nid(pdevinfo, as->pins[i], 0); } + device_printf(pdevinfo->dev, "\n"); } static void @@ -5724,12 +5981,26 @@ hdaa_dump_adc(struct hdaa_pcm_devinfo *p { struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_widget *w; - int i; - int printed = 0; + nid_t *nids; + int chid, i; if (pdevinfo->recas < 0) return; + device_printf(pdevinfo->dev, "Record:\n"); + + chid = devinfo->as[pdevinfo->recas].chans[0]; + hdaa_dump_audio_formats(pdevinfo->dev, + devinfo->chans[chid].supp_stream_formats, + devinfo->chans[chid].supp_pcm_size_rate); + for (i = 0; i < devinfo->as[pdevinfo->recas].num_chans; i++) { + chid = devinfo->as[pdevinfo->recas].chans[i]; + device_printf(pdevinfo->dev, " ADC:"); + for (nids = devinfo->chans[chid].io; *nids != -1; nids++) + printf(" %d", *nids); + printf("\n"); + } + for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0) @@ -5738,14 +6009,10 @@ hdaa_dump_adc(struct hdaa_pcm_devinfo *p continue; if (w->bindas != pdevinfo->recas) continue; - if (printed == 0) { - printed = 1; - device_printf(pdevinfo->dev, "\n"); - device_printf(pdevinfo->dev, "Record:\n"); - } device_printf(pdevinfo->dev, "\n"); hdaa_dump_dst_nid(pdevinfo, i, 0); } + device_printf(pdevinfo->dev, "\n"); } static void @@ -5766,53 +6033,13 @@ hdaa_dump_mix(struct hdaa_pcm_devinfo *p continue; if (printed == 0) { printed = 1; - device_printf(pdevinfo->dev, "\n"); device_printf(pdevinfo->dev, "Input Mix:\n"); } device_printf(pdevinfo->dev, "\n"); hdaa_dump_dst_nid(pdevinfo, i, 0); } -} - -static void -hdaa_dump_pcmchannels(struct hdaa_pcm_devinfo *pdevinfo) -{ - struct hdaa_devinfo *devinfo = pdevinfo->devinfo; - nid_t *nids; - int chid, i; - - if (pdevinfo->playas >= 0) { - device_printf(pdevinfo->dev, "\n"); - device_printf(pdevinfo->dev, "Playback:\n"); - device_printf(pdevinfo->dev, "\n"); - chid = devinfo->as[pdevinfo->playas].chans[0]; - hdaa_dump_audio_formats(pdevinfo->dev, - devinfo->chans[chid].supp_stream_formats, - devinfo->chans[chid].supp_pcm_size_rate); - for (i = 0; i < devinfo->as[pdevinfo->playas].num_chans; i++) { - chid = devinfo->as[pdevinfo->playas].chans[i]; - device_printf(pdevinfo->dev, " DAC:"); - for (nids = devinfo->chans[chid].io; *nids != -1; nids++) - printf(" %d", *nids); - printf("\n"); - } - } - if (pdevinfo->recas >= 0) { - device_printf(pdevinfo->dev, "\n"); - device_printf(pdevinfo->dev, "Record:\n"); + if (printed) device_printf(pdevinfo->dev, "\n"); - chid = devinfo->as[pdevinfo->recas].chans[0]; - hdaa_dump_audio_formats(pdevinfo->dev, - devinfo->chans[chid].supp_stream_formats, - devinfo->chans[chid].supp_pcm_size_rate); - for (i = 0; i < devinfo->as[pdevinfo->recas].num_chans; i++) { - chid = devinfo->as[pdevinfo->recas].chans[i]; - device_printf(pdevinfo->dev, " DAC:"); - for (nids = devinfo->chans[chid].io; *nids != -1; nids++) - printf(" %d", *nids); - printf("\n"); - } - } } static void @@ -5991,19 +6218,19 @@ hdaa_configure(device_t dev) } printf("\n"); } + ); + HDA_BOOTHVERBOSE( device_printf(dev, "\n"); - device_printf(dev, "+-------------------+\n"); - device_printf(dev, "| DUMPING HDA NODES |\n"); - device_printf(dev, "+-------------------+\n"); + device_printf(dev, "+-----------+\n"); + device_printf(dev, "| HDA NODES |\n"); + device_printf(dev, "+-----------+\n"); hdaa_dump_nodes(devinfo); - ); - HDA_BOOTHVERBOSE( device_printf(dev, "\n"); - device_printf(dev, "+------------------------+\n"); - device_printf(dev, "| DUMPING HDA AMPLIFIERS |\n"); - device_printf(dev, "+------------------------+\n"); + device_printf(dev, "+----------------+\n"); + device_printf(dev, "| HDA AMPLIFIERS |\n"); + device_printf(dev, "+----------------+\n"); device_printf(dev, "\n"); i = 0; while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { @@ -6024,9 +6251,6 @@ hdaa_configure(device_t dev) (ctl->enable == 0) ? " [DISABLED]" : ((ctl->ossmask == 0) ? " [UNUSED]" : "")); } - ); - - HDA_BOOTVERBOSE( device_printf(dev, "\n"); ); } @@ -6790,21 +7014,9 @@ hdaa_pcm_attach(device_t dev) HDA_BUFSZ_MIN, HDA_BUFSZ_DEFAULT, HDA_BUFSZ_MAX); HDA_BOOTVERBOSE( - device_printf(dev, "+--------------------------------------+\n"); - device_printf(dev, "| DUMPING PCM Playback/Record Channels |\n"); - device_printf(dev, "+--------------------------------------+\n"); - hdaa_dump_pcmchannels(pdevinfo); - device_printf(dev, "\n"); - device_printf(dev, "+-------------------------------+\n"); - device_printf(dev, "| DUMPING Playback/Record Paths |\n"); - device_printf(dev, "+-------------------------------+\n"); hdaa_dump_dac(pdevinfo); hdaa_dump_adc(pdevinfo); hdaa_dump_mix(pdevinfo); - device_printf(dev, "\n"); - device_printf(dev, "+-------------------------+\n"); - device_printf(dev, "| DUMPING Volume Controls |\n"); - device_printf(dev, "+-------------------------+\n"); hdaa_dump_ctls(pdevinfo, "Master Volume", SOUND_MASK_VOLUME); hdaa_dump_ctls(pdevinfo, "PCM Volume", SOUND_MASK_PCM); hdaa_dump_ctls(pdevinfo, "CD Volume", SOUND_MASK_CD); @@ -6816,7 +7028,6 @@ hdaa_pcm_attach(device_t dev) hdaa_dump_ctls(pdevinfo, "Input Mix Level", SOUND_MASK_IMIX); hdaa_dump_ctls(pdevinfo, "Input Monitoring Level", SOUND_MASK_IGAIN); hdaa_dump_ctls(pdevinfo, NULL, 0); - device_printf(dev, "\n"); ); if (resource_int_value(device_get_name(dev), From owner-svn-src-all@FreeBSD.ORG Sun Nov 25 21:32:13 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 C1BBCD50; Sun, 25 Nov 2012 21:32:13 +0000 (UTC) (envelope-from bar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A76108FC16; Sun, 25 Nov 2012 21:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAPLWDdA031087; Sun, 25 Nov 2012 21:32:13 GMT (envelope-from bar@svn.freebsd.org) Received: (from bar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAPLWDEi031086; Sun, 25 Nov 2012 21:32:13 GMT (envelope-from bar@svn.freebsd.org) Message-Id: <201211252132.qAPLWDEi031086@svn.freebsd.org> From: Barbara Guida Date: Sun, 25 Nov 2012 21:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243531 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 21:32:13 -0000 Author: bar (ports committer) Date: Sun Nov 25 21:32:13 2012 New Revision: 243531 URL: http://svnweb.freebsd.org/changeset/base/243531 Log: Add my mentor relationships to committers-ports.dot Approved by: flo (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Nov 25 20:06:01 2012 (r243530) +++ head/share/misc/committers-ports.dot Sun Nov 25 21:32:13 2012 (r243531) @@ -58,6 +58,7 @@ avilla [label="Alberto Villa\navilla@Fre avl [label="Alexander Logvinov\navl@FreeBSD.org\n2009/05/27"] az [label="Andrej Zverev\naz@FreeBSD.org\n2005/10/03"] bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2010/07/27"] +bar [label="Barbara Guida\nbar@FreeBSD.org\n2012/11/25"] bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2012/07/31"] beat [label="Beat Gaetzi\nbeat@FreeBSD.org\n2009/01/28"] beech [label="Beech Rintoul\nbeech@FreeBSD.org\n2007/05/30"] @@ -297,6 +298,7 @@ fjoe -> flo fjoe -> krion fjoe -> osa +flo -> bar flo -> jase flz -> garga @@ -437,6 +439,7 @@ philip -> koitsu rafan -> chinsan +rene -> bar rene -> crees rene -> jgh rene -> olivierd From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 00:06:56 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 3F4B0BF7; Mon, 26 Nov 2012 00:06:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 254518FC13; Mon, 26 Nov 2012 00:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ06uvA052749; Mon, 26 Nov 2012 00:06:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ06tfm052747; Mon, 26 Nov 2012 00:06:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211260006.qAQ06tfm052747@svn.freebsd.org> From: Adrian Chadd Date: Mon, 26 Nov 2012 00:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243532 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 00:06:56 -0000 Author: adrian Date: Mon Nov 26 00:06:55 2012 New Revision: 243532 URL: http://svnweb.freebsd.org/changeset/base/243532 Log: Add a primitive to check if a lock is not owned. Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Sun Nov 25 21:32:13 2012 (r243531) +++ head/sys/net80211/ieee80211_freebsd.h Mon Nov 26 00:06:55 2012 (r243532) @@ -53,6 +53,8 @@ typedef struct { #define IEEE80211_UNLOCK(_ic) mtx_unlock(IEEE80211_LOCK_OBJ(_ic)) #define IEEE80211_LOCK_ASSERT(_ic) \ mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_OWNED) +#define IEEE80211_UNLOCK_ASSERT(_ic) \ + mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_NOTOWNED) /* * Node locking definitions. From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 01:54:00 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 CDDA2A01; Mon, 26 Nov 2012 01:54:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF41D8FC14; Mon, 26 Nov 2012 01:54:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ1s063066932; Mon, 26 Nov 2012 01:54:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ1s0r7066931; Mon, 26 Nov 2012 01:54:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211260154.qAQ1s0r7066931@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Nov 2012 01:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243533 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 01:54:01 -0000 Author: mav Date: Mon Nov 26 01:54:00 2012 New Revision: 243533 URL: http://svnweb.freebsd.org/changeset/base/243533 Log: Remove extra sbuf_trim() copy/pasted into r243530. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Mon Nov 26 00:06:55 2012 (r243532) +++ head/sys/dev/sound/pci/hda/hdaa.c Mon Nov 26 01:54:00 2012 (r243533) @@ -1219,7 +1219,6 @@ hdaa_sysctl_caps(SYSCTL_HANDLER_ARGS) sbuf_printf(&sb, " (selected)"); sbuf_printf(&sb, "\n"); } - sbuf_trim(&sb); error = sbuf_finish(&sb); sbuf_delete(&sb); return (error); From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 01:57: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 94F92C98; Mon, 26 Nov 2012 01:57:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7974C8FC0C; Mon, 26 Nov 2012 01:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ1vMhM067470; Mon, 26 Nov 2012 01:57:22 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ1vMxE067469; Mon, 26 Nov 2012 01:57:22 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201211260157.qAQ1vMxE067469@svn.freebsd.org> From: Sean Bruno Date: Mon, 26 Nov 2012 01:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243534 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 01:57:22 -0000 Author: sbruno Date: Mon Nov 26 01:57:22 2012 New Revision: 243534 URL: http://svnweb.freebsd.org/changeset/base/243534 Log: MFC 242922 Update MAX_TASKS to scale a bit based on MAXCPU This alleviates issues on newer Sandy/Ivy Bridge gear that seems to require boatloads more ACPI resources than before. Modified: stable/9/sys/dev/acpica/acpivar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpivar.h ============================================================================== --- stable/9/sys/dev/acpica/acpivar.h Mon Nov 26 01:54:00 2012 (r243533) +++ stable/9/sys/dev/acpica/acpivar.h Mon Nov 26 01:57:22 2012 (r243534) @@ -476,7 +476,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Default maximum number of tasks to enqueue. */ #ifndef ACPI_MAX_TASKS -#define ACPI_MAX_TASKS 32 +#define ACPI_MAX_TASKS MAX(32, MAXCPU * 2) #endif /* Default number of task queue threads to start. */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 02:04:11 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 DE387F17; Mon, 26 Nov 2012 02:04:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C340F8FC0C; Mon, 26 Nov 2012 02:04:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ24BWZ068680; Mon, 26 Nov 2012 02:04:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ24B88068679; Mon, 26 Nov 2012 02:04:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211260204.qAQ24B88068679@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Nov 2012 02:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243535 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:04:12 -0000 Author: mav Date: Mon Nov 26 02:04:11 2012 New Revision: 243535 URL: http://svnweb.freebsd.org/changeset/base/243535 Log: Fix uninitialized variable reported by gcc, but not clang. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Mon Nov 26 01:57:22 2012 (r243534) +++ head/sys/dev/sound/pci/hda/hdaa.c Mon Nov 26 02:04:11 2012 (r243535) @@ -5552,7 +5552,7 @@ hdaa_dump_ctls(struct hdaa_pcm_devinfo * struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_audio_ctl *ctl; char buf[64]; - int i, j, printed; + int i, j, printed = 0; if (flag == 0) { flag = ~(SOUND_MASK_VOLUME | SOUND_MASK_PCM | From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 02:31: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 1AD306A5; Mon, 26 Nov 2012 02:31:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 001F18FC0C; Mon, 26 Nov 2012 02:31:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2VSW0073040; Mon, 26 Nov 2012 02:31:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2VSJ2073039; Mon, 26 Nov 2012 02:31:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260231.qAQ2VSJ2073039@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 02:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243536 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:31:29 -0000 Author: yongari Date: Mon Nov 26 02:31:28 2012 New Revision: 243536 URL: http://svnweb.freebsd.org/changeset/base/243536 Log: MFC r241215-241216,241219-241220,241341,241343: r241215: Don't touch EMAC Mode and TX/RX MAC Mode register when driver is not running. r241216: APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep the MAC connected to the outside world. So keep the accesses atomic. r241219: Add 40 microseconds delay after updating EMAC Mode register as recommended by Broadcom data sheet. r241220: Follow Broadcom datasheet: Delay 100 microseconds after enabling transmit MAC. Delay 10 microseconds after enabling receive MAC. r241341: Limit applying TX data corruption and FIFO workaround to BCM5719 A0. It's believed BCM5720 does not have the issue. r241343: Rework device detach. While here, move driver lock/callout initialization to the beginning of device attach for readability. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:04:11 2012 (r243535) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:31:28 2012 (r243536) @@ -896,7 +896,11 @@ bge_miibus_statchg(device_t dev) { struct bge_softc *sc; struct mii_data *mii; + uint32_t mac_mode, rx_mode, tx_mode; + sc = device_get_softc(dev); + if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; mii = device_get_softc(sc->bge_miibus); if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == @@ -922,30 +926,40 @@ bge_miibus_statchg(device_t dev) sc->bge_link = 0; if (sc->bge_link == 0) return; - BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); + + /* + * APE firmware touches these registers to keep the MAC + * connected to the outside world. Try to keep the + * accesses atomic. + */ + + /* Set the port mode (MII/GMII) to match the link speed. */ + mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & + ~(BGE_MACMODE_PORTMODE | BGE_MACMODE_HALF_DUPLEX); + tx_mode = CSR_READ_4(sc, BGE_TX_MODE); + rx_mode = CSR_READ_4(sc, BGE_RX_MODE); + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); + mac_mode |= BGE_PORTMODE_GMII; else - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); + mac_mode |= BGE_PORTMODE_MII; + /* Set MAC flow control behavior to match link flow control settings. */ + tx_mode &= ~BGE_TXMODE_FLOWCTL_ENABLE; + rx_mode &= ~BGE_RXMODE_FLOWCTL_ENABLE; if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { - BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_ETH_TXPAUSE) != 0) - BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - else - BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_ETH_RXPAUSE) != 0) - BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - else - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - } else { - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - } + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + tx_mode |= BGE_TXMODE_FLOWCTL_ENABLE; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + rx_mode |= BGE_RXMODE_FLOWCTL_ENABLE; + } else + mac_mode |= BGE_MACMODE_HALF_DUPLEX; + + CSR_WRITE_4(sc, BGE_MAC_MODE, mac_mode); + DELAY(40); + CSR_WRITE_4(sc, BGE_TX_MODE, tx_mode); + CSR_WRITE_4(sc, BGE_RX_MODE, rx_mode); } /* @@ -1421,6 +1435,7 @@ bge_chipinit(struct bge_softc *sc) /* Clear the MAC control register */ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + DELAY(40); /* * Clear the MAC statistics block in the NIC's @@ -2033,6 +2048,7 @@ bge_blockinit(struct bge_softc *sc) /* Turn on DMA, clear stats */ CSR_WRITE_4(sc, BGE_MAC_MODE, val); + DELAY(40); /* Set misc. local control, enable interrupts on attentions */ CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN); @@ -2105,8 +2121,8 @@ bge_blockinit(struct bge_softc *sc) * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || - sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2884,7 +2900,9 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + BGE_LOCK_INIT(sc, device_get_nameunit(dev)); TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); + callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); /* * Map control/status registers. @@ -3243,8 +3261,6 @@ bge_attach(device_t dev) bge_devinfo(sc); - BGE_LOCK_INIT(sc, device_get_nameunit(dev)); - /* Try to reset the chip. */ if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); @@ -3448,7 +3464,6 @@ again: * Call MI attach routine. */ ether_ifattach(ifp, eaddr); - callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); /* Tell upper layer we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); @@ -3465,7 +3480,7 @@ again: if (sc->bge_tq == NULL) { device_printf(dev, "could not create taskqueue.\n"); ether_ifdetach(ifp); - error = ENXIO; + error = ENOMEM; goto fail; } taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", @@ -3473,23 +3488,19 @@ again: error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, &sc->bge_intrhand); - if (error) - ether_ifdetach(ifp); } else error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, &sc->bge_intrhand); if (error) { - bge_detach(dev); + ether_ifdetach(ifp); device_printf(sc->bge_dev, "couldn't set up irq\n"); } - return (0); - fail: - bge_release_resources(sc); - + if (error) + bge_detach(dev); return (error); } @@ -3507,16 +3518,16 @@ bge_detach(device_t dev) ether_poll_deregister(ifp); #endif - BGE_LOCK(sc); - bge_stop(sc); - bge_reset(sc); - BGE_UNLOCK(sc); - - callout_drain(&sc->bge_stat_ch); + if (device_is_attached(dev)) { + ether_ifdetach(ifp); + BGE_LOCK(sc); + bge_stop(sc); + BGE_UNLOCK(sc); + callout_drain(&sc->bge_stat_ch); + } if (sc->bge_tq) taskqueue_drain(sc->bge_tq, &sc->bge_intr_task); - ether_ifdetach(ifp); if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_removeall(&sc->bge_ifmedia); @@ -3764,6 +3775,7 @@ bge_reset(struct bge_softc *sc) BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + DELAY(40); /* * The 5704 in TBI mode apparently needs some special @@ -5041,9 +5053,11 @@ bge_init_locked(struct bge_softc *sc) } /* Turn on transmitter. */ CSR_WRITE_4(sc, BGE_TX_MODE, mode | BGE_TXMODE_ENABLE); + DELAY(100); /* Turn on receiver. */ BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + DELAY(10); /* * Set the number of good frames to receive after RX MBUF @@ -5079,11 +5093,11 @@ bge_init_locked(struct bge_softc *sc) bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); } - bge_ifmedia_upd_locked(ifp); - ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + bge_ifmedia_upd_locked(ifp); + callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc); } @@ -5160,6 +5174,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); } + DELAY(40); break; default: return (EINVAL); @@ -5635,9 +5650,11 @@ bge_link_upd(struct bge_softc *sc) if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) { if (!sc->bge_link) { sc->bge_link++; - if (sc->bge_asicrev == BGE_ASICREV_BCM5704) + if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_TBI_SEND_CFGS); + DELAY(40); + } CSR_WRITE_4(sc, BGE_MAC_STS, 0xFFFFFFFF); if (bootverbose) if_printf(sc->bge_ifp, "link UP\n"); From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 02:32:33 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 59EE9815; Mon, 26 Nov 2012 02:32:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1DD8FC0C; Mon, 26 Nov 2012 02:32:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2WX6v073237; Mon, 26 Nov 2012 02:32:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2WXB7073236; Mon, 26 Nov 2012 02:32:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260232.qAQ2WXB7073236@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 02:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243537 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:32:33 -0000 Author: yongari Date: Mon Nov 26 02:32:32 2012 New Revision: 243537 URL: http://svnweb.freebsd.org/changeset/base/243537 Log: MFC r241215-241216,241219-241220,241341,241343: r241215: Don't touch EMAC Mode and TX/RX MAC Mode register when driver is not running. r241216: APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep the MAC connected to the outside world. So keep the accesses atomic. r241219: Add 40 microseconds delay after updating EMAC Mode register as recommended by Broadcom data sheet. r241220: Follow Broadcom datasheet: Delay 100 microseconds after enabling transmit MAC. Delay 10 microseconds after enabling receive MAC. r241341: Limit applying TX data corruption and FIFO workaround to BCM5719 A0. It's believed BCM5720 does not have the issue. r241343: Rework device detach. While here, move driver lock/callout initialization to the beginning of device attach for readability. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 26 02:31:28 2012 (r243536) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 26 02:32:32 2012 (r243537) @@ -896,7 +896,11 @@ bge_miibus_statchg(device_t dev) { struct bge_softc *sc; struct mii_data *mii; + uint32_t mac_mode, rx_mode, tx_mode; + sc = device_get_softc(dev); + if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; mii = device_get_softc(sc->bge_miibus); if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == @@ -922,30 +926,40 @@ bge_miibus_statchg(device_t dev) sc->bge_link = 0; if (sc->bge_link == 0) return; - BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); + + /* + * APE firmware touches these registers to keep the MAC + * connected to the outside world. Try to keep the + * accesses atomic. + */ + + /* Set the port mode (MII/GMII) to match the link speed. */ + mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & + ~(BGE_MACMODE_PORTMODE | BGE_MACMODE_HALF_DUPLEX); + tx_mode = CSR_READ_4(sc, BGE_TX_MODE); + rx_mode = CSR_READ_4(sc, BGE_RX_MODE); + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); + mac_mode |= BGE_PORTMODE_GMII; else - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); + mac_mode |= BGE_PORTMODE_MII; + /* Set MAC flow control behavior to match link flow control settings. */ + tx_mode &= ~BGE_TXMODE_FLOWCTL_ENABLE; + rx_mode &= ~BGE_RXMODE_FLOWCTL_ENABLE; if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { - BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_ETH_TXPAUSE) != 0) - BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - else - BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_ETH_RXPAUSE) != 0) - BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - else - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - } else { - BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); - } + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + tx_mode |= BGE_TXMODE_FLOWCTL_ENABLE; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + rx_mode |= BGE_RXMODE_FLOWCTL_ENABLE; + } else + mac_mode |= BGE_MACMODE_HALF_DUPLEX; + + CSR_WRITE_4(sc, BGE_MAC_MODE, mac_mode); + DELAY(40); + CSR_WRITE_4(sc, BGE_TX_MODE, tx_mode); + CSR_WRITE_4(sc, BGE_RX_MODE, rx_mode); } /* @@ -1421,6 +1435,7 @@ bge_chipinit(struct bge_softc *sc) /* Clear the MAC control register */ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + DELAY(40); /* * Clear the MAC statistics block in the NIC's @@ -2033,6 +2048,7 @@ bge_blockinit(struct bge_softc *sc) /* Turn on DMA, clear stats */ CSR_WRITE_4(sc, BGE_MAC_MODE, val); + DELAY(40); /* Set misc. local control, enable interrupts on attentions */ CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN); @@ -2105,8 +2121,8 @@ bge_blockinit(struct bge_softc *sc) * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || - sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2884,7 +2900,9 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + BGE_LOCK_INIT(sc, device_get_nameunit(dev)); TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); + callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); /* * Map control/status registers. @@ -3243,8 +3261,6 @@ bge_attach(device_t dev) bge_devinfo(sc); - BGE_LOCK_INIT(sc, device_get_nameunit(dev)); - /* Try to reset the chip. */ if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); @@ -3448,7 +3464,6 @@ again: * Call MI attach routine. */ ether_ifattach(ifp, eaddr); - callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); /* Tell upper layer we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); @@ -3465,7 +3480,7 @@ again: if (sc->bge_tq == NULL) { device_printf(dev, "could not create taskqueue.\n"); ether_ifdetach(ifp); - error = ENXIO; + error = ENOMEM; goto fail; } taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", @@ -3473,23 +3488,19 @@ again: error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, &sc->bge_intrhand); - if (error) - ether_ifdetach(ifp); } else error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, &sc->bge_intrhand); if (error) { - bge_detach(dev); + ether_ifdetach(ifp); device_printf(sc->bge_dev, "couldn't set up irq\n"); } - return (0); - fail: - bge_release_resources(sc); - + if (error) + bge_detach(dev); return (error); } @@ -3507,16 +3518,16 @@ bge_detach(device_t dev) ether_poll_deregister(ifp); #endif - BGE_LOCK(sc); - bge_stop(sc); - bge_reset(sc); - BGE_UNLOCK(sc); - - callout_drain(&sc->bge_stat_ch); + if (device_is_attached(dev)) { + ether_ifdetach(ifp); + BGE_LOCK(sc); + bge_stop(sc); + BGE_UNLOCK(sc); + callout_drain(&sc->bge_stat_ch); + } if (sc->bge_tq) taskqueue_drain(sc->bge_tq, &sc->bge_intr_task); - ether_ifdetach(ifp); if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_removeall(&sc->bge_ifmedia); @@ -3764,6 +3775,7 @@ bge_reset(struct bge_softc *sc) BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + DELAY(40); /* * The 5704 in TBI mode apparently needs some special @@ -5041,9 +5053,11 @@ bge_init_locked(struct bge_softc *sc) } /* Turn on transmitter. */ CSR_WRITE_4(sc, BGE_TX_MODE, mode | BGE_TXMODE_ENABLE); + DELAY(100); /* Turn on receiver. */ BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + DELAY(10); /* * Set the number of good frames to receive after RX MBUF @@ -5079,11 +5093,11 @@ bge_init_locked(struct bge_softc *sc) bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); } - bge_ifmedia_upd_locked(ifp); - ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + bge_ifmedia_upd_locked(ifp); + callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc); } @@ -5160,6 +5174,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); } + DELAY(40); break; default: return (EINVAL); @@ -5635,9 +5650,11 @@ bge_link_upd(struct bge_softc *sc) if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) { if (!sc->bge_link) { sc->bge_link++; - if (sc->bge_asicrev == BGE_ASICREV_BCM5704) + if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_TBI_SEND_CFGS); + DELAY(40); + } CSR_WRITE_4(sc, BGE_MAC_STS, 0xFFFFFFFF); if (bootverbose) if_printf(sc->bge_ifp, "link UP\n"); From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 02:41: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 2F07BBC3; Mon, 26 Nov 2012 02:41:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1452B8FC08; Mon, 26 Nov 2012 02:41:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2fUKa074746; Mon, 26 Nov 2012 02:41:30 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2fU7w074744; Mon, 26 Nov 2012 02:41:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260241.qAQ2fU7w074744@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 02:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243538 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:41:31 -0000 Author: yongari Date: Mon Nov 26 02:41:30 2012 New Revision: 243538 URL: http://svnweb.freebsd.org/changeset/base/243538 Log: MFC r241388-241393: r241388: If the maximum payload size is 256 bytes or more, set the DMA write water mark to 256 bytes. Otherwise controller will encounter DMA write under run errors and would result in RX DMA hang. If the maximum payload size is 128 bytes, the water mark is set to 128 bytes as usual. While here, set maximum read request size to 2048 for BCM5719/BCM5720. For other PCIe devices, use 4096. And reprogram the maximum read request size whenever device reset is performed. r241389: On PHY write error use hex number to show the value. Add more comments. r241390: Honor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720. r241391: Do not force PCIe 1.0a mode in device reset on BCM5717 and newer controllers. BCM5785 does not require PCI 1.0a mode as well during reset. r241392: Fix a long standing VCPU reset sequence bug on BCM5906. The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to control the bootcode execution and to pick up configuration data stored inside the EEPROM. The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET bit to decide which booting procedure to choose. Data sheet indicates the VCPU of BCM5906 should set BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset. r241393: Remove unnecessary delay. I don't see any comments in data sheet that requires 10ms delay after device reset. Because that code was there from day 1, I guess it was added to give enough settlement time after updating BGE_MAC_MODE register. The recommended delay time for BGE_MAC_MODE after updating is 40us and it was already done in r241219. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:32:32 2012 (r243537) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:41:30 2012 (r243538) @@ -885,7 +885,7 @@ bge_miibus_writereg(device_t dev, int ph if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, - "PHY write timed out (phy %d, reg %d, val %d)\n", + "PHY write timed out (phy %d, reg %d, val 0x%04x)\n", phy, reg, val); return (0); @@ -1466,8 +1466,10 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl = BGE_PCIDMARWCTL_RD_CMD_SHIFT(6) | BGE_PCIDMARWCTL_WR_CMD_SHIFT(7); if (sc->bge_flags & BGE_FLAG_PCIE) { - /* Read watermark not used, 128 bytes for write. */ - dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); + if (sc->bge_mps >= 256) + dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(7); + else + dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); } else if (sc->bge_flags & BGE_FLAG_PCIX) { if (BGE_IS_5714_FAMILY(sc)) { /* 256 bytes for read and write. */ @@ -2034,6 +2036,7 @@ bge_blockinit(struct bge_softc *sc) if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + /* Turn on DMA, clear stats. */ val = BGE_MACMODE_TXDMA_ENB | BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR | BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB | BGE_MACMODE_TX_STATS_ENB | @@ -2046,7 +2049,6 @@ bge_blockinit(struct bge_softc *sc) else val |= BGE_PORTMODE_MII; - /* Turn on DMA, clear stats */ CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); @@ -3186,11 +3188,16 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; + /* Extract supported maximum payload size. */ + sc->bge_mps = pci_read_config(dev, sc->bge_expcap + + PCIER_DEVICE_CAP, 2); + sc->bge_mps = 128 << (sc->bge_mps & PCIEM_CAP_MAX_PAYLOAD); if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || sc->bge_asicrev == BGE_ASICREV_BCM5720) - pci_set_max_read_req(dev, 2048); - else if (pci_get_max_read_req(dev) != 4096) - pci_set_max_read_req(dev, 4096); + sc->bge_expmrq = 2048; + else + sc->bge_expmrq = 4096; + pci_set_max_read_req(dev, sc->bge_expmrq); } else { /* * Check if the device is in PCI-X Mode. @@ -3399,7 +3406,7 @@ bge_attach(device_t dev) /* The SysKonnect SK-9D41 is a 1000baseSX card. */ if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { - if (BGE_IS_5714_FAMILY(sc)) + if (BGE_IS_5705_PLUS(sc)) sc->bge_flags |= BGE_FLAG_MII_SERDES; else sc->bge_flags |= BGE_FLAG_TBI; @@ -3622,8 +3629,11 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE) { - if (CSR_READ_4(sc, 0x7E2C) == 0x60) /* PCIE 1.0 */ - CSR_WRITE_4(sc, 0x7E2C, 0x20); + if (sc->bge_asicrev != BGE_ASICREV_BCM5785 && + (sc->bge_flags & BGE_FLAG_5717_PLUS) == 0) { + if (CSR_READ_4(sc, 0x7E2C) == 0x60) /* PCIE 1.0 */ + CSR_WRITE_4(sc, 0x7E2C, 0x20); + } if (sc->bge_chipid != BGE_CHIPID_BCM5750_A0) { /* Prevent PCIE link training during global reset */ CSR_WRITE_4(sc, BGE_MISC_CFG, 1 << 29); @@ -3631,6 +3641,15 @@ bge_reset(struct bge_softc *sc) } } + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { + val = CSR_READ_4(sc, BGE_VCPU_STATUS); + CSR_WRITE_4(sc, BGE_VCPU_STATUS, + val | BGE_VCPU_STATUS_DRV_RESET); + val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL); + CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL, + val & ~BGE_VCPU_EXT_CTRL_HALT_CPU); + } + /* * Set GPHY Power Down Override to leave GPHY * powered up in D0 uninitialized. @@ -3642,15 +3661,6 @@ bge_reset(struct bge_softc *sc) /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); - if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { - val = CSR_READ_4(sc, BGE_VCPU_STATUS); - CSR_WRITE_4(sc, BGE_VCPU_STATUS, - val | BGE_VCPU_STATUS_DRV_RESET); - val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL); - CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL, - val & ~BGE_VCPU_EXT_CTRL_HALT_CPU); - } - DELAY(1000); /* XXX: Broadcom Linux driver. */ @@ -3667,6 +3677,7 @@ bge_reset(struct bge_softc *sc) PCIEM_CTL_NOSNOOP_ENABLE); pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_CTL, devctl, 2); + pci_set_max_read_req(dev, sc->bge_expmrq); /* Clear error status. */ pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_STA, PCIEM_STA_CORRECTABLE_ERROR | @@ -3798,7 +3809,6 @@ bge_reset(struct bge_softc *sc) val = CSR_READ_4(sc, 0x7C00); CSR_WRITE_4(sc, 0x7C00, val | (1 << 25)); } - DELAY(10000); if (sc->bge_asicrev == BGE_ASICREV_BCM5720) BGE_CLRBIT(sc, BGE_CPMU_CLCK_ORIDE, @@ -4088,10 +4098,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* Fetch updates from the status block. */ rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; statusword = sc->bge_ldata.bge_status_block->bge_status; + /* Clear the status so the next pass only sees the changes. */ sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, @@ -4159,11 +4171,12 @@ bge_intr_task(void *arg, int pending) sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* Save producer/consumer indexess. */ + /* Save producer/consumer indices. */ rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; status = sc->bge_ldata.bge_status_block->bge_status; status_tag = sc->bge_ldata.bge_status_block->bge_status_tag << 24; + /* Dirty the status flag. */ sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, @@ -5703,7 +5716,7 @@ bge_link_upd(struct bge_softc *sc) bge_miibus_statchg(sc->bge_dev); } - /* Clear the attention. */ + /* Disable MAC attention when link is up. */ CSR_WRITE_4(sc, BGE_MAC_STS, BGE_MACSTAT_SYNC_CHANGED | BGE_MACSTAT_CFG_CHANGED | BGE_MACSTAT_MI_COMPLETE | BGE_MACSTAT_LINK_CHANGED); Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 02:32:32 2012 (r243537) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 02:41:30 2012 (r243538) @@ -2802,6 +2802,7 @@ struct bge_softc { struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ int bge_expcap; + int bge_expmrq; int bge_msicap; int bge_pcixcap; uint32_t bge_flags; @@ -2845,6 +2846,7 @@ struct bge_softc { uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; + uint16_t bge_mps; struct bge_ring_data bge_ldata; /* rings */ struct bge_chain_data bge_cdata; /* mbufs */ uint16_t bge_tx_saved_considx; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 02:42:19 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 8FA08D30; Mon, 26 Nov 2012 02:42:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 749398FC18; Mon, 26 Nov 2012 02:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2gJEL074901; Mon, 26 Nov 2012 02:42:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2gJNc074899; Mon, 26 Nov 2012 02:42:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260242.qAQ2gJNc074899@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 02:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243539 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:42:19 -0000 Author: yongari Date: Mon Nov 26 02:42:19 2012 New Revision: 243539 URL: http://svnweb.freebsd.org/changeset/base/243539 Log: MFC r241388-241393: r241388: If the maximum payload size is 256 bytes or more, set the DMA write water mark to 256 bytes. Otherwise controller will encounter DMA write under run errors and would result in RX DMA hang. If the maximum payload size is 128 bytes, the water mark is set to 128 bytes as usual. While here, set maximum read request size to 2048 for BCM5719/BCM5720. For other PCIe devices, use 4096. And reprogram the maximum read request size whenever device reset is performed. r241389: On PHY write error use hex number to show the value. Add more comments. r241390: Honor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720. r241391: Do not force PCIe 1.0a mode in device reset on BCM5717 and newer controllers. BCM5785 does not require PCI 1.0a mode as well during reset. r241392: Fix a long standing VCPU reset sequence bug on BCM5906. The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to control the bootcode execution and to pick up configuration data stored inside the EEPROM. The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET bit to decide which booting procedure to choose. Data sheet indicates the VCPU of BCM5906 should set BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset. r241393: Remove unnecessary delay. I don't see any comments in data sheet that requires 10ms delay after device reset. Because that code was there from day 1, I guess it was added to give enough settlement time after updating BGE_MAC_MODE register. The recommended delay time for BGE_MAC_MODE after updating is 40us and it was already done in r241219. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 26 02:41:30 2012 (r243538) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 26 02:42:19 2012 (r243539) @@ -885,7 +885,7 @@ bge_miibus_writereg(device_t dev, int ph if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, - "PHY write timed out (phy %d, reg %d, val %d)\n", + "PHY write timed out (phy %d, reg %d, val 0x%04x)\n", phy, reg, val); return (0); @@ -1466,8 +1466,10 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl = BGE_PCIDMARWCTL_RD_CMD_SHIFT(6) | BGE_PCIDMARWCTL_WR_CMD_SHIFT(7); if (sc->bge_flags & BGE_FLAG_PCIE) { - /* Read watermark not used, 128 bytes for write. */ - dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); + if (sc->bge_mps >= 256) + dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(7); + else + dma_rw_ctl |= BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); } else if (sc->bge_flags & BGE_FLAG_PCIX) { if (BGE_IS_5714_FAMILY(sc)) { /* 256 bytes for read and write. */ @@ -2034,6 +2036,7 @@ bge_blockinit(struct bge_softc *sc) if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + /* Turn on DMA, clear stats. */ val = BGE_MACMODE_TXDMA_ENB | BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR | BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB | BGE_MACMODE_TX_STATS_ENB | @@ -2046,7 +2049,6 @@ bge_blockinit(struct bge_softc *sc) else val |= BGE_PORTMODE_MII; - /* Turn on DMA, clear stats */ CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); @@ -3186,11 +3188,16 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; + /* Extract supported maximum payload size. */ + sc->bge_mps = pci_read_config(dev, sc->bge_expcap + + PCIER_DEVICE_CAP, 2); + sc->bge_mps = 128 << (sc->bge_mps & PCIEM_CAP_MAX_PAYLOAD); if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || sc->bge_asicrev == BGE_ASICREV_BCM5720) - pci_set_max_read_req(dev, 2048); - else if (pci_get_max_read_req(dev) != 4096) - pci_set_max_read_req(dev, 4096); + sc->bge_expmrq = 2048; + else + sc->bge_expmrq = 4096; + pci_set_max_read_req(dev, sc->bge_expmrq); } else { /* * Check if the device is in PCI-X Mode. @@ -3399,7 +3406,7 @@ bge_attach(device_t dev) /* The SysKonnect SK-9D41 is a 1000baseSX card. */ if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { - if (BGE_IS_5714_FAMILY(sc)) + if (BGE_IS_5705_PLUS(sc)) sc->bge_flags |= BGE_FLAG_MII_SERDES; else sc->bge_flags |= BGE_FLAG_TBI; @@ -3622,8 +3629,11 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE) { - if (CSR_READ_4(sc, 0x7E2C) == 0x60) /* PCIE 1.0 */ - CSR_WRITE_4(sc, 0x7E2C, 0x20); + if (sc->bge_asicrev != BGE_ASICREV_BCM5785 && + (sc->bge_flags & BGE_FLAG_5717_PLUS) == 0) { + if (CSR_READ_4(sc, 0x7E2C) == 0x60) /* PCIE 1.0 */ + CSR_WRITE_4(sc, 0x7E2C, 0x20); + } if (sc->bge_chipid != BGE_CHIPID_BCM5750_A0) { /* Prevent PCIE link training during global reset */ CSR_WRITE_4(sc, BGE_MISC_CFG, 1 << 29); @@ -3631,6 +3641,15 @@ bge_reset(struct bge_softc *sc) } } + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { + val = CSR_READ_4(sc, BGE_VCPU_STATUS); + CSR_WRITE_4(sc, BGE_VCPU_STATUS, + val | BGE_VCPU_STATUS_DRV_RESET); + val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL); + CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL, + val & ~BGE_VCPU_EXT_CTRL_HALT_CPU); + } + /* * Set GPHY Power Down Override to leave GPHY * powered up in D0 uninitialized. @@ -3642,15 +3661,6 @@ bge_reset(struct bge_softc *sc) /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); - if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { - val = CSR_READ_4(sc, BGE_VCPU_STATUS); - CSR_WRITE_4(sc, BGE_VCPU_STATUS, - val | BGE_VCPU_STATUS_DRV_RESET); - val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL); - CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL, - val & ~BGE_VCPU_EXT_CTRL_HALT_CPU); - } - DELAY(1000); /* XXX: Broadcom Linux driver. */ @@ -3667,6 +3677,7 @@ bge_reset(struct bge_softc *sc) PCIEM_CTL_NOSNOOP_ENABLE); pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_CTL, devctl, 2); + pci_set_max_read_req(dev, sc->bge_expmrq); /* Clear error status. */ pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_STA, PCIEM_STA_CORRECTABLE_ERROR | @@ -3798,7 +3809,6 @@ bge_reset(struct bge_softc *sc) val = CSR_READ_4(sc, 0x7C00); CSR_WRITE_4(sc, 0x7C00, val | (1 << 25)); } - DELAY(10000); if (sc->bge_asicrev == BGE_ASICREV_BCM5720) BGE_CLRBIT(sc, BGE_CPMU_CLCK_ORIDE, @@ -4088,10 +4098,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* Fetch updates from the status block. */ rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; statusword = sc->bge_ldata.bge_status_block->bge_status; + /* Clear the status so the next pass only sees the changes. */ sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, @@ -4159,11 +4171,12 @@ bge_intr_task(void *arg, int pending) sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* Save producer/consumer indexess. */ + /* Save producer/consumer indices. */ rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; status = sc->bge_ldata.bge_status_block->bge_status; status_tag = sc->bge_ldata.bge_status_block->bge_status_tag << 24; + /* Dirty the status flag. */ sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, @@ -5703,7 +5716,7 @@ bge_link_upd(struct bge_softc *sc) bge_miibus_statchg(sc->bge_dev); } - /* Clear the attention. */ + /* Disable MAC attention when link is up. */ CSR_WRITE_4(sc, BGE_MAC_STS, BGE_MACSTAT_SYNC_CHANGED | BGE_MACSTAT_CFG_CHANGED | BGE_MACSTAT_MI_COMPLETE | BGE_MACSTAT_LINK_CHANGED); Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 02:41:30 2012 (r243538) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 02:42:19 2012 (r243539) @@ -2802,6 +2802,7 @@ struct bge_softc { struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ int bge_expcap; + int bge_expmrq; int bge_msicap; int bge_pcixcap; uint32_t bge_flags; @@ -2845,6 +2846,7 @@ struct bge_softc { uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; + uint16_t bge_mps; struct bge_ring_data bge_ldata; /* rings */ struct bge_chain_data bge_cdata; /* mbufs */ uint16_t bge_tx_saved_considx; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 02:48: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 5D415EF6; Mon, 26 Nov 2012 02:48:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4183E8FC08; Mon, 26 Nov 2012 02:48:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ2mvLi075899; Mon, 26 Nov 2012 02:48:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ2mvow075898; Mon, 26 Nov 2012 02:48:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260248.qAQ2mvow075898@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 02:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243540 - stable/9/usr.bin/find X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 02:48:57 -0000 Author: eadler Date: Mon Nov 26 02:48:56 2012 New Revision: 243540 URL: http://svnweb.freebsd.org/changeset/base/243540 Log: MFC r243280: Use .Nm instead of a self xref Approved by: cperciva (implicit) Modified: stable/9/usr.bin/find/find.1 Directory Properties: stable/9/usr.bin/find/ (props changed) Modified: stable/9/usr.bin/find/find.1 ============================================================================== --- stable/9/usr.bin/find/find.1 Mon Nov 26 02:42:19 2012 (r243539) +++ stable/9/usr.bin/find/find.1 Mon Nov 26 02:48:56 2012 (r243540) @@ -285,7 +285,7 @@ Non-portable, BSD-specific version of .Ic depth . GNU find implements this as a primary in mistaken emulation of .Fx -.Xr find 1 . +.Nm . .It Ic -delete Delete found files and/or directories. Always returns true. @@ -457,7 +457,7 @@ for compatibility with GNU find. GNU find imposes a restriction that .Ar gname is numeric, while -.Xr find 1 +.Nm does not. .It Ic -group Ar gname True if the file belongs to the group @@ -620,7 +620,7 @@ This option is for GNU find compatibilit .It Ic -noleaf This option is for GNU find compatibility. In GNU find it disables an optimization not relevant to -.Xr find 1 , +.Nm , so it is ignored. .It Ic -nouser True if the file belongs to an unknown user. @@ -813,7 +813,7 @@ for compatibility with GNU find. GNU find imposes a restriction that .Ar uname is numeric, while -.Xr find 1 +.Nm does not. .It Ic -user Ar uname True if the file belongs to the user From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:10:28 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 18095C35; Mon, 26 Nov 2012 04:10:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F17748FC15; Mon, 26 Nov 2012 04:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4AR4l090227; Mon, 26 Nov 2012 04:10:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4ARTE090223; Mon, 26 Nov 2012 04:10:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260410.qAQ4ARTE090223@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243541 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:10:28 -0000 Author: yongari Date: Mon Nov 26 04:10:27 2012 New Revision: 243541 URL: http://svnweb.freebsd.org/changeset/base/243541 Log: MFC r241436: Rework controller reset procedure. Previously driver saved BGE_PCI_PCISTATE register before issuing global reset. After issuing reset, it reads BGE_PCI_PCISTATE register again and compares the saved register value and current value. It was used to know whether the global reset operation was completed or not. Unfortunately, this logic caused several issues on recent BCM5717/ 5718/5719 and BCM5720 controllers. It seems APE firmware accesses some registers while global reset is in progress such that reading BGE_PCI_PCISTATE register after reset does not yield old pre-reset state value. This resulted in consuming too much time in global reset and sometimes it couldn't successfully complete reset. The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is self-clearing bit so driver is able to know the reset completion. But the core-lock reset will disable indirect/flat/standard access modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS bit of BGE_MISC_CFG register. So just wait enough time for core-clock reset to complete. Data sheet says driver should wait 100us for PCI/PCI-X devices and 100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value was used for many years in bge(4). For PCIe devices, use 100ms as recommended by data sheet. bge_chipinit() also cleared BGE_MAC_MODE register which shall clear firmware configured mode information. I think this will result in losing ASF/IPMI link in device attachment. Let bge_reset() honor firmware configured BGE_MAC_MODE register and don't announce driver is UP in bge_reset(). Firmware should have control over driver until it's fully initialized by driver. While I'm here, enable workaround for PCI-X BCM5704 A0 in bge_reset(). This will prevent internal arbitration logic from switching to the other DMA engine after a retry cycle. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 02:48:56 2012 (r243540) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:10:27 2012 (r243541) @@ -1433,10 +1433,6 @@ bge_chipinit(struct bge_softc *sc) misc_ctl |= BGE_PCIMISCCTL_TAGGED_STATUS; pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, misc_ctl, 4); - /* Clear the MAC control register */ - CSR_WRITE_4(sc, BGE_MAC_MODE, 0); - DELAY(40); - /* * Clear the MAC statistics block in the NIC's * internal memory. @@ -3585,13 +3581,16 @@ static int bge_reset(struct bge_softc *sc) { device_t dev; - uint32_t cachesize, command, pcistate, reset, val; + uint32_t cachesize, command, mac_mode, mac_mode_mask, reset, val; void (*write_op)(struct bge_softc *, int, int); uint16_t devctl; int i; dev = sc->bge_dev; + mac_mode_mask = BGE_MACMODE_HALF_DUPLEX | BGE_MACMODE_PORTMODE; + mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & mac_mode_mask; + if (BGE_IS_575X_PLUS(sc) && !BGE_IS_5714_FAMILY(sc) && (sc->bge_asicrev != BGE_ASICREV_BCM5906)) { if (sc->bge_flags & BGE_FLAG_PCIE) @@ -3604,7 +3603,6 @@ bge_reset(struct bge_softc *sc) /* Save some important PCI state. */ cachesize = pci_read_config(dev, BGE_PCI_CACHESZ, 4); command = pci_read_config(dev, BGE_PCI_CMD, 4); - pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); pci_write_config(dev, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_INDIRECT_ACCESS | BGE_PCIMISCCTL_MASK_PCI_INTR | @@ -3661,7 +3659,10 @@ bge_reset(struct bge_softc *sc) /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); - DELAY(1000); + if (sc->bge_flags & BGE_FLAG_PCIE) + DELAY(100 * 1000); + else + DELAY(1000); /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE) { @@ -3689,9 +3690,13 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_INDIRECT_ACCESS | BGE_PCIMISCCTL_MASK_PCI_INTR | BGE_HIF_SWAP_OPTIONS | BGE_PCIMISCCTL_PCISTATE_RW, 4); + val = BGE_PCISTATE_ROM_ENABLE | BGE_PCISTATE_ROM_RETRY_ENABLE; + if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0 && + (sc->bge_flags & BGE_FLAG_PCIX) != 0) + val |= BGE_PCISTATE_RETRY_SAME_DMA; + pci_write_config(dev, BGE_PCI_PCISTATE, val, 4); pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); - write_op(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); /* * Disable PCI-X relaxed ordering to ensure status block update * comes first then packet buffer DMA. Otherwise driver may @@ -3730,6 +3735,14 @@ bge_reset(struct bge_softc *sc) } else CSR_WRITE_4(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE); + /* Fix up byte swapping. */ + CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc)); + + val = CSR_READ_4(sc, BGE_MAC_MODE); + val = (val & ~mac_mode_mask) | mac_mode; + CSR_WRITE_4(sc, BGE_MAC_MODE, val); + DELAY(40); + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { for (i = 0; i < BGE_TIMEOUT; i++) { val = CSR_READ_4(sc, BGE_VCPU_STATUS); @@ -3765,30 +3778,6 @@ bge_reset(struct bge_softc *sc) } /* - * XXX Wait for the value of the PCISTATE register to - * return to its original pre-reset state. This is a - * fairly good indicator of reset completion. If we don't - * wait for the reset to fully complete, trying to read - * from the device's non-PCI registers may yield garbage - * results. - */ - for (i = 0; i < BGE_TIMEOUT; i++) { - if (pci_read_config(dev, BGE_PCI_PCISTATE, 4) == pcistate) - break; - DELAY(10); - } - - /* Fix up byte swapping. */ - CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc)); - - /* Tell the ASF firmware we are up */ - if (sc->bge_asf_mode & ASF_STACKUP) - BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); - - CSR_WRITE_4(sc, BGE_MAC_MODE, 0); - DELAY(40); - - /* * The 5704 in TBI mode apparently needs some special * adjustment to insure the SERDES drive level is set * to 1.2V. Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 02:48:56 2012 (r243540) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:10:27 2012 (r243541) @@ -430,10 +430,11 @@ #define BGE_PCISTATE_PCI_BUSMODE 0x00000004 /* 1 = PCI, 0 = PCI-X */ #define BGE_PCISTATE_PCI_BUSSPEED 0x00000008 /* 1 = 66/133, 0 = 33/66 */ #define BGE_PCISTATE_32BIT_BUS 0x00000010 /* 1 = 32bit, 0 = 64bit */ -#define BGE_PCISTATE_WANT_EXPROM 0x00000020 -#define BGE_PCISTATE_EXPROM_RETRY 0x00000040 +#define BGE_PCISTATE_ROM_ENABLE 0x00000020 +#define BGE_PCISTATE_ROM_RETRY_ENABLE 0x00000040 #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 +#define BGE_PCISTATE_RETRY_SAME_DMA 0x00002000 /* * PCI Clock Control register -- note, this register is read only From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:11:13 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 28ADCDA0; Mon, 26 Nov 2012 04:11:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0678FC08; Mon, 26 Nov 2012 04:11:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4BC3P090470; Mon, 26 Nov 2012 04:11:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4BCik090467; Mon, 26 Nov 2012 04:11:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260411.qAQ4BCik090467@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243542 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:11:13 -0000 Author: yongari Date: Mon Nov 26 04:11:12 2012 New Revision: 243542 URL: http://svnweb.freebsd.org/changeset/base/243542 Log: MFC r241436: Rework controller reset procedure. Previously driver saved BGE_PCI_PCISTATE register before issuing global reset. After issuing reset, it reads BGE_PCI_PCISTATE register again and compares the saved register value and current value. It was used to know whether the global reset operation was completed or not. Unfortunately, this logic caused several issues on recent BCM5717/ 5718/5719 and BCM5720 controllers. It seems APE firmware accesses some registers while global reset is in progress such that reading BGE_PCI_PCISTATE register after reset does not yield old pre-reset state value. This resulted in consuming too much time in global reset and sometimes it couldn't successfully complete reset. The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is self-clearing bit so driver is able to know the reset completion. But the core-lock reset will disable indirect/flat/standard access modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS bit of BGE_MISC_CFG register. So just wait enough time for core-clock reset to complete. Data sheet says driver should wait 100us for PCI/PCI-X devices and 100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value was used for many years in bge(4). For PCIe devices, use 100ms as recommended by data sheet. bge_chipinit() also cleared BGE_MAC_MODE register which shall clear firmware configured mode information. I think this will result in losing ASF/IPMI link in device attachment. Let bge_reset() honor firmware configured BGE_MAC_MODE register and don't announce driver is UP in bge_reset(). Firmware should have control over driver until it's fully initialized by driver. While I'm here, enable workaround for PCI-X BCM5704 A0 in bge_reset(). This will prevent internal arbitration logic from switching to the other DMA engine after a retry cycle. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:10:27 2012 (r243541) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:11:12 2012 (r243542) @@ -1433,10 +1433,6 @@ bge_chipinit(struct bge_softc *sc) misc_ctl |= BGE_PCIMISCCTL_TAGGED_STATUS; pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, misc_ctl, 4); - /* Clear the MAC control register */ - CSR_WRITE_4(sc, BGE_MAC_MODE, 0); - DELAY(40); - /* * Clear the MAC statistics block in the NIC's * internal memory. @@ -3585,13 +3581,16 @@ static int bge_reset(struct bge_softc *sc) { device_t dev; - uint32_t cachesize, command, pcistate, reset, val; + uint32_t cachesize, command, mac_mode, mac_mode_mask, reset, val; void (*write_op)(struct bge_softc *, int, int); uint16_t devctl; int i; dev = sc->bge_dev; + mac_mode_mask = BGE_MACMODE_HALF_DUPLEX | BGE_MACMODE_PORTMODE; + mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & mac_mode_mask; + if (BGE_IS_575X_PLUS(sc) && !BGE_IS_5714_FAMILY(sc) && (sc->bge_asicrev != BGE_ASICREV_BCM5906)) { if (sc->bge_flags & BGE_FLAG_PCIE) @@ -3604,7 +3603,6 @@ bge_reset(struct bge_softc *sc) /* Save some important PCI state. */ cachesize = pci_read_config(dev, BGE_PCI_CACHESZ, 4); command = pci_read_config(dev, BGE_PCI_CMD, 4); - pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); pci_write_config(dev, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_INDIRECT_ACCESS | BGE_PCIMISCCTL_MASK_PCI_INTR | @@ -3661,7 +3659,10 @@ bge_reset(struct bge_softc *sc) /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); - DELAY(1000); + if (sc->bge_flags & BGE_FLAG_PCIE) + DELAY(100 * 1000); + else + DELAY(1000); /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE) { @@ -3689,9 +3690,13 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_INDIRECT_ACCESS | BGE_PCIMISCCTL_MASK_PCI_INTR | BGE_HIF_SWAP_OPTIONS | BGE_PCIMISCCTL_PCISTATE_RW, 4); + val = BGE_PCISTATE_ROM_ENABLE | BGE_PCISTATE_ROM_RETRY_ENABLE; + if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0 && + (sc->bge_flags & BGE_FLAG_PCIX) != 0) + val |= BGE_PCISTATE_RETRY_SAME_DMA; + pci_write_config(dev, BGE_PCI_PCISTATE, val, 4); pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); - write_op(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); /* * Disable PCI-X relaxed ordering to ensure status block update * comes first then packet buffer DMA. Otherwise driver may @@ -3730,6 +3735,14 @@ bge_reset(struct bge_softc *sc) } else CSR_WRITE_4(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE); + /* Fix up byte swapping. */ + CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc)); + + val = CSR_READ_4(sc, BGE_MAC_MODE); + val = (val & ~mac_mode_mask) | mac_mode; + CSR_WRITE_4(sc, BGE_MAC_MODE, val); + DELAY(40); + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { for (i = 0; i < BGE_TIMEOUT; i++) { val = CSR_READ_4(sc, BGE_VCPU_STATUS); @@ -3765,30 +3778,6 @@ bge_reset(struct bge_softc *sc) } /* - * XXX Wait for the value of the PCISTATE register to - * return to its original pre-reset state. This is a - * fairly good indicator of reset completion. If we don't - * wait for the reset to fully complete, trying to read - * from the device's non-PCI registers may yield garbage - * results. - */ - for (i = 0; i < BGE_TIMEOUT; i++) { - if (pci_read_config(dev, BGE_PCI_PCISTATE, 4) == pcistate) - break; - DELAY(10); - } - - /* Fix up byte swapping. */ - CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc)); - - /* Tell the ASF firmware we are up */ - if (sc->bge_asf_mode & ASF_STACKUP) - BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); - - CSR_WRITE_4(sc, BGE_MAC_MODE, 0); - DELAY(40); - - /* * The 5704 in TBI mode apparently needs some special * adjustment to insure the SERDES drive level is set * to 1.2V. Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 04:10:27 2012 (r243541) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 04:11:12 2012 (r243542) @@ -430,10 +430,11 @@ #define BGE_PCISTATE_PCI_BUSMODE 0x00000004 /* 1 = PCI, 0 = PCI-X */ #define BGE_PCISTATE_PCI_BUSSPEED 0x00000008 /* 1 = 66/133, 0 = 33/66 */ #define BGE_PCISTATE_32BIT_BUS 0x00000010 /* 1 = 32bit, 0 = 64bit */ -#define BGE_PCISTATE_WANT_EXPROM 0x00000020 -#define BGE_PCISTATE_EXPROM_RETRY 0x00000040 +#define BGE_PCISTATE_ROM_ENABLE 0x00000020 +#define BGE_PCISTATE_ROM_RETRY_ENABLE 0x00000040 #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 +#define BGE_PCISTATE_RETRY_SAME_DMA 0x00002000 /* * PCI Clock Control register -- note, this register is read only From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:20:11 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 DF8C028E; Mon, 26 Nov 2012 04:20:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4F108FC14; Mon, 26 Nov 2012 04:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4KB3t092185; Mon, 26 Nov 2012 04:20:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4KBdJ092184; Mon, 26 Nov 2012 04:20:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260420.qAQ4KBdJ092184@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243544 - stable/9/sys/dev/mii X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:20:12 -0000 Author: yongari Date: Mon Nov 26 04:20:11 2012 New Revision: 243544 URL: http://svnweb.freebsd.org/changeset/base/243544 Log: MFC r241437: For 5717C/5719C/5720C and 57765 PHYs, do not perform any special handling(jumbo, wire speed etc) in brgphy_reset(). Touching BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that it couldn't establish a link. Modified: stable/9/sys/dev/mii/brgphy.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mii/brgphy.c ============================================================================== --- stable/9/sys/dev/mii/brgphy.c Mon Nov 26 04:18:58 2012 (r243543) +++ stable/9/sys/dev/mii/brgphy.c Mon Nov 26 04:20:11 2012 (r243544) @@ -918,6 +918,15 @@ brgphy_reset(struct mii_softc *sc) break; } break; + case MII_OUI_BROADCOM3: + switch (sc->mii_mpd_model) { + case MII_MODEL_BROADCOM3_BCM5717C: + case MII_MODEL_BROADCOM3_BCM5719C: + case MII_MODEL_BROADCOM3_BCM5720C: + case MII_MODEL_BROADCOM3_BCM57765: + return; + } + break; } ifp = sc->mii_pdata->mii_ifp; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:20:59 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 D59EA3FC; Mon, 26 Nov 2012 04:20:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC0F88FC0C; Mon, 26 Nov 2012 04:20:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4KxLU092344; Mon, 26 Nov 2012 04:20:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4KxrQ092343; Mon, 26 Nov 2012 04:20:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260420.qAQ4KxrQ092343@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243545 - stable/8/sys/dev/mii X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:20:59 -0000 Author: yongari Date: Mon Nov 26 04:20:59 2012 New Revision: 243545 URL: http://svnweb.freebsd.org/changeset/base/243545 Log: MFC r241437: For 5717C/5719C/5720C and 57765 PHYs, do not perform any special handling(jumbo, wire speed etc) in brgphy_reset(). Touching BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that it couldn't establish a link. Modified: stable/8/sys/dev/mii/brgphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mii/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Mon Nov 26 04:20:11 2012 (r243544) +++ stable/8/sys/dev/mii/brgphy.c Mon Nov 26 04:20:59 2012 (r243545) @@ -940,6 +940,15 @@ brgphy_reset(struct mii_softc *sc) break; } break; + case MII_OUI_xxBROADCOM_ALT2: + switch (bsc->mii_model) { + case MII_MODEL_xxBROADCOM_ALT2_BCM5717C: + case MII_MODEL_xxBROADCOM_ALT2_BCM5719C: + case MII_MODEL_xxBROADCOM_ALT2_BCM5720C: + case MII_MODEL_xxBROADCOM_ALT2_BCM57765: + return; + } + break; } ifp = sc->mii_pdata->mii_ifp; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:25:41 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 C2564593; Mon, 26 Nov 2012 04:25:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4EB78FC0C; Mon, 26 Nov 2012 04:25:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4Pf5i093179; Mon, 26 Nov 2012 04:25:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4PfJG093177; Mon, 26 Nov 2012 04:25:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260425.qAQ4PfJG093177@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243546 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:25:41 -0000 Author: yongari Date: Mon Nov 26 04:25:41 2012 New Revision: 243546 URL: http://svnweb.freebsd.org/changeset/base/243546 Log: MFC r241438: Add APE firmware support and improve firmware handshake procedure. This change will enable IPMI access on 5717/5718/5719/5720 and 5761 controllers. Because ASF is not available when APE firmware is present, bge_allow_asf tunable is ignored when driver detects APE firmware. Also bge(4) no longer performs two resets(one blind reset and the other reset with firmware in mind) in device attach. Now bge(4) performs a reset with enough information in bge_reset(). The APE firmware also needs special handling to make suspend/resume work but it was not implemented yet. With this change, bge(4) should work on any 5717/5718/5719/5720 controllers. Special thanks to Mike Hibler at Emulab who setup remote debugging on Dell R820. Without his help I couldn't be able to address several issues happened on Dell Rx20 systems. And many thanks to Broadcom for continuing to support FreeBSD! Submitted by: davidch (initial version) H/W donated by: Broadcom Tested by: many Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8 Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:20:59 2012 (r243545) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:25:41 2012 (r243546) @@ -461,8 +461,9 @@ static void bge_miibus_statchg(device_t) static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); #endif -#define BGE_RESET_START 1 -#define BGE_RESET_STOP 2 +#define BGE_RESET_SHUTDOWN 0 +#define BGE_RESET_START 1 +#define BGE_RESET_SUSPEND 2 static void bge_sig_post_reset(struct bge_softc *, int); static void bge_sig_legacy(struct bge_softc *, int); static void bge_sig_pre_reset(struct bge_softc *, int); @@ -470,6 +471,13 @@ static void bge_stop_fw(struct bge_softc static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); +static void bge_ape_lock_init(struct bge_softc *); +static void bge_ape_read_fw_ver(struct bge_softc *); +static int bge_ape_lock(struct bge_softc *, int); +static void bge_ape_unlock(struct bge_softc *, int); +static void bge_ape_send_event(struct bge_softc *, uint32_t); +static void bge_ape_driver_state_change(struct bge_softc *, int); + /* * The BGE_REGISTER_DEBUG option is only for low-level debugging. It may * leak information to untrusted users. It is also known to cause alignment @@ -478,6 +486,7 @@ static void bge_link_upd(struct bge_soft #ifdef BGE_REGISTER_DEBUG static int bge_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_ape_read(SYSCTL_HANDLER_ARGS); static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS); #endif static void bge_add_sysctls(struct bge_softc *); @@ -643,6 +652,318 @@ bge_writembx(struct bge_softc *sc, int o } /* + * Clear all stale locks and select the lock for this driver instance. + */ +static void +bge_ape_lock_init(struct bge_softc *sc) +{ + uint32_t bit, regbase; + int i; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + regbase = BGE_APE_LOCK_GRANT; + else + regbase = BGE_APE_PER_LOCK_GRANT; + + /* Clear any stale locks. */ + for (i = BGE_APE_LOCK_PHY0; i <= BGE_APE_LOCK_GPIO; i++) { + switch (i) { + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + bit = BGE_APE_LOCK_GRANT_DRIVER0; + break; + default: + if (sc->bge_func_addr != 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + } + APE_WRITE_4(sc, regbase + 4 * i, bit); + } + + /* Select the PHY lock based on the device's function number. */ + switch (sc->bge_func_addr) { + case 0: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY0; + break; + case 1: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY1; + break; + case 2: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY2; + break; + case 3: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY3; + break; + default: + device_printf(sc->bge_dev, + "PHY lock not supported on this function\n"); + } +} + +/* + * Check for APE firmware, set flags, and print version info. + */ +static void +bge_ape_read_fw_ver(struct bge_softc *sc) +{ + const char *fwtype; + uint32_t apedata, features; + + /* Check for a valid APE signature in shared memory. */ + apedata = APE_READ_4(sc, BGE_APE_SEG_SIG); + if (apedata != BGE_APE_SEG_SIG_MAGIC) { + sc->bge_mfw_flags &= ~ BGE_MFW_ON_APE; + return; + } + + /* Check if APE firmware is running. */ + apedata = APE_READ_4(sc, BGE_APE_FW_STATUS); + if ((apedata & BGE_APE_FW_STATUS_READY) == 0) { + device_printf(sc->bge_dev, "APE signature found " + "but FW status not ready! 0x%08x\n", apedata); + return; + } + + sc->bge_mfw_flags |= BGE_MFW_ON_APE; + + /* Fetch the APE firwmare type and version. */ + apedata = APE_READ_4(sc, BGE_APE_FW_VERSION); + features = APE_READ_4(sc, BGE_APE_FW_FEATURES); + if ((features & BGE_APE_FW_FEATURE_NCSI) != 0) { + sc->bge_mfw_flags |= BGE_MFW_TYPE_NCSI; + fwtype = "NCSI"; + } else if ((features & BGE_APE_FW_FEATURE_DASH) != 0) { + sc->bge_mfw_flags |= BGE_MFW_TYPE_DASH; + fwtype = "DASH"; + } else + fwtype = "UNKN"; + + /* Print the APE firmware version. */ + device_printf(sc->bge_dev, "APE FW version: %s v%d.%d.%d.%d\n", + fwtype, + (apedata & BGE_APE_FW_VERSION_MAJMSK) >> BGE_APE_FW_VERSION_MAJSFT, + (apedata & BGE_APE_FW_VERSION_MINMSK) >> BGE_APE_FW_VERSION_MINSFT, + (apedata & BGE_APE_FW_VERSION_REVMSK) >> BGE_APE_FW_VERSION_REVSFT, + (apedata & BGE_APE_FW_VERSION_BLDMSK)); +} + +static int +bge_ape_lock(struct bge_softc *sc, int locknum) +{ + uint32_t bit, gnt, req, status; + int i, off; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return (0); + + /* Lock request/grant registers have different bases. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) { + req = BGE_APE_LOCK_REQ; + gnt = BGE_APE_LOCK_GRANT; + } else { + req = BGE_APE_PER_LOCK_REQ; + gnt = BGE_APE_PER_LOCK_GRANT; + } + + off = 4 * locknum; + + switch (locknum) { + case BGE_APE_LOCK_GPIO: + /* Lock required when using GPIO. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + return (0); + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_GRC: + /* Lock required to reset the device. */ + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_MEM: + /* Lock required when accessing certain APE memory. */ + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + /* Lock required when accessing PHYs. */ + bit = BGE_APE_LOCK_REQ_DRIVER0; + break; + default: + return (EINVAL); + } + + /* Request a lock. */ + APE_WRITE_4(sc, req + off, bit); + + /* Wait up to 1 second to acquire lock. */ + for (i = 0; i < 20000; i++) { + status = APE_READ_4(sc, gnt + off); + if (status == bit) + break; + DELAY(50); + } + + /* Handle any errors. */ + if (status != bit) { + device_printf(sc->bge_dev, "APE lock %d request failed! " + "request = 0x%04x[0x%04x], status = 0x%04x[0x%04x]\n", + locknum, req + off, bit & 0xFFFF, gnt + off, + status & 0xFFFF); + /* Revoke the lock request. */ + APE_WRITE_4(sc, gnt + off, bit); + return (EBUSY); + } + + return (0); +} + +static void +bge_ape_unlock(struct bge_softc *sc, int locknum) +{ + uint32_t bit, gnt; + int off; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + gnt = BGE_APE_LOCK_GRANT; + else + gnt = BGE_APE_PER_LOCK_GRANT; + + off = 4 * locknum; + + switch (locknum) { + case BGE_APE_LOCK_GPIO: + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + return; + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_GRC: + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_MEM: + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + bit = BGE_APE_LOCK_GRANT_DRIVER0; + break; + default: + return; + } + + APE_WRITE_4(sc, gnt + off, bit); +} + +/* + * Send an event to the APE firmware. + */ +static void +bge_ape_send_event(struct bge_softc *sc, uint32_t event) +{ + uint32_t apedata; + int i; + + /* NCSI does not support APE events. */ + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + /* Wait up to 1ms for APE to service previous event. */ + for (i = 10; i > 0; i--) { + if (bge_ape_lock(sc, BGE_APE_LOCK_MEM) != 0) + break; + apedata = APE_READ_4(sc, BGE_APE_EVENT_STATUS); + if ((apedata & BGE_APE_EVENT_STATUS_EVENT_PENDING) == 0) { + APE_WRITE_4(sc, BGE_APE_EVENT_STATUS, event | + BGE_APE_EVENT_STATUS_EVENT_PENDING); + bge_ape_unlock(sc, BGE_APE_LOCK_MEM); + APE_WRITE_4(sc, BGE_APE_EVENT, BGE_APE_EVENT_1); + break; + } + bge_ape_unlock(sc, BGE_APE_LOCK_MEM); + DELAY(100); + } + if (i == 0) + device_printf(sc->bge_dev, "APE event 0x%08x send timed out\n", + event); +} + +static void +bge_ape_driver_state_change(struct bge_softc *sc, int kind) +{ + uint32_t apedata, event; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + switch (kind) { + case BGE_RESET_START: + /* If this is the first load, clear the load counter. */ + apedata = APE_READ_4(sc, BGE_APE_HOST_SEG_SIG); + if (apedata != BGE_APE_HOST_SEG_SIG_MAGIC) + APE_WRITE_4(sc, BGE_APE_HOST_INIT_COUNT, 0); + else { + apedata = APE_READ_4(sc, BGE_APE_HOST_INIT_COUNT); + APE_WRITE_4(sc, BGE_APE_HOST_INIT_COUNT, ++apedata); + } + APE_WRITE_4(sc, BGE_APE_HOST_SEG_SIG, + BGE_APE_HOST_SEG_SIG_MAGIC); + APE_WRITE_4(sc, BGE_APE_HOST_SEG_LEN, + BGE_APE_HOST_SEG_LEN_MAGIC); + + /* Add some version info if bge(4) supports it. */ + APE_WRITE_4(sc, BGE_APE_HOST_DRIVER_ID, + BGE_APE_HOST_DRIVER_ID_MAGIC(1, 0)); + APE_WRITE_4(sc, BGE_APE_HOST_BEHAVIOR, + BGE_APE_HOST_BEHAV_NO_PHYLOCK); + APE_WRITE_4(sc, BGE_APE_HOST_HEARTBEAT_INT_MS, + BGE_APE_HOST_HEARTBEAT_INT_DISABLE); + APE_WRITE_4(sc, BGE_APE_HOST_DRVR_STATE, + BGE_APE_HOST_DRVR_STATE_START); + event = BGE_APE_EVENT_STATUS_STATE_START; + break; + case BGE_RESET_SHUTDOWN: + APE_WRITE_4(sc, BGE_APE_HOST_DRVR_STATE, + BGE_APE_HOST_DRVR_STATE_UNLOAD); + event = BGE_APE_EVENT_STATUS_STATE_UNLOAD; + break; + case BGE_RESET_SUSPEND: + event = BGE_APE_EVENT_STATUS_STATE_SUSPEND; + break; + default: + return; + } + + bge_ape_send_event(sc, event | BGE_APE_EVENT_STATUS_DRIVER_EVNT | + BGE_APE_EVENT_STATUS_STATE_CHNGE); +} + +/* * Map a single buffer address. */ @@ -806,6 +1127,9 @@ bge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return (0); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -840,6 +1164,8 @@ bge_miibus_readreg(device_t dev, int phy DELAY(80); } + bge_ape_unlock(sc, sc->bge_phy_ape_lock); + if (val & BGE_MICOMM_READFAIL) return (0); @@ -858,6 +1184,9 @@ bge_miibus_writereg(device_t dev, int ph (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) return (0); + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return (0); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -883,6 +1212,8 @@ bge_miibus_writereg(device_t dev, int ph DELAY(80); } + bge_ape_unlock(sc, sc->bge_phy_ape_lock); + if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, "PHY write timed out (phy %d, reg %d, val 0x%04x)\n", @@ -1335,12 +1666,19 @@ bge_sig_pre_reset(struct bge_softc *sc, bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_START); break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD); break; + case BGE_RESET_SUSPEND: + bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, + BGE_FW_DRV_STATE_SUSPEND); + break; } } + + if (type == BGE_RESET_START || type == BGE_RESET_SUSPEND) + bge_ape_driver_state_change(sc, type); } static void @@ -1354,12 +1692,14 @@ bge_sig_post_reset(struct bge_softc *sc, BGE_FW_DRV_STATE_START_DONE); /* START DONE */ break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD_DONE); break; } } + if (type == BGE_RESET_SHUTDOWN) + bge_ape_driver_state_change(sc, type); } static void @@ -1372,7 +1712,7 @@ bge_sig_legacy(struct bge_softc *sc, int bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_START); break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD); break; @@ -1409,11 +1749,6 @@ bge_dma_swap_options(struct bge_softc *s #if BYTE_ORDER == BIG_ENDIAN dma_options |= BGE_MODECTL_BYTESWAP_NONFRAME; #endif - if ((sc)->bge_asicrev == BGE_ASICREV_BCM5720) - dma_options |= BGE_MODECTL_BYTESWAP_B2HRX_DATA | - BGE_MODECTL_WORDSWAP_B2HRX_DATA | BGE_MODECTL_B2HRX_ENABLE | - BGE_MODECTL_HTX2B_ENABLE; - return (dma_options); } @@ -1540,8 +1875,16 @@ bge_chipinit(struct bge_softc *sc) /* * Set up general mode register. */ - mode_ctl = bge_dma_swap_options(sc) | BGE_MODECTL_MAC_ATTN_INTR | - BGE_MODECTL_HOST_SEND_BDS | BGE_MODECTL_TX_NO_PHDR_CSUM; + mode_ctl = bge_dma_swap_options(sc); + if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + /* Retain Host-2-BMC settings written by APE firmware. */ + mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & + (BGE_MODECTL_BYTESWAP_B2HRX_DATA | + BGE_MODECTL_WORDSWAP_B2HRX_DATA | + BGE_MODECTL_B2HRX_ENABLE | BGE_MODECTL_HTX2B_ENABLE); + } + mode_ctl |= BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS | + BGE_MODECTL_TX_NO_PHDR_CSUM; /* * BCM5701 B5 have a bug causing data corruption when using @@ -2045,6 +2388,10 @@ bge_blockinit(struct bge_softc *sc) else val |= BGE_PORTMODE_MII; + /* Allow APE to send/receive frames. */ + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + val |= BGE_MACMODE_APE_RX_EN | BGE_MACMODE_APE_TX_EN; + CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); @@ -2891,9 +3238,9 @@ bge_attach(device_t dev) { struct ifnet *ifp; struct bge_softc *sc; - uint32_t hwcfg = 0, misccfg; + uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, f, msicount, phy_addr, reg, rid, trys; + int capmask, error, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2912,12 +3259,13 @@ bge_attach(device_t dev) RF_ACTIVE); if (sc->bge_res == NULL) { - device_printf (sc->bge_dev, "couldn't map memory\n"); + device_printf (sc->bge_dev, "couldn't map BAR0 memory\n"); error = ENXIO; goto fail; } /* Save various chip information. */ + sc->bge_func_addr = pci_get_function(dev); sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; @@ -2964,25 +3312,32 @@ bge_attach(device_t dev) * BCM5719 | 1 | 8 | 2 | 9 | * BCM5720 | 1 | 8 | 2 | 9 | * + * | F2 Cu | F2 Sr | F3 Cu | F3 Sr | + * ---------+-------+-------+-------+-------+ + * BCM57XX | X | X | X | X | + * BCM5704 | X | X | X | X | + * BCM5717 | X | X | X | X | + * BCM5719 | 3 | 10 | 4 | 11 | + * BCM5720 | X | X | X | X | + * * Other addresses may respond but they are not * IEEE compliant PHYs and should be ignored. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || sc->bge_asicrev == BGE_ASICREV_BCM5719 || sc->bge_asicrev == BGE_ASICREV_BCM5720) { - f = pci_get_function(dev); - if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { + if (sc->bge_chipid != BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & BGE_SGDIGSTS_IS_SERDES) - phy_addr = f + 8; + phy_addr = sc->bge_func_addr + 8; else - phy_addr = f + 1; + phy_addr = sc->bge_func_addr + 1; } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) - phy_addr = f + 8; + phy_addr = sc->bge_func_addr + 8; else - phy_addr = f + 1; + phy_addr = sc->bge_func_addr + 1; } } @@ -3045,6 +3400,39 @@ bge_attach(device_t dev) break; } + /* Identify chips with APE processor. */ + switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5717: + case BGE_ASICREV_BCM5719: + case BGE_ASICREV_BCM5720: + case BGE_ASICREV_BCM5761: + sc->bge_flags |= BGE_FLAG_APE; + break; + } + + /* Chips with APE need BAR2 access for APE registers/memory. */ + if ((sc->bge_flags & BGE_FLAG_APE) != 0) { + rid = PCIR_BAR(2); + sc->bge_res2 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->bge_res2 == NULL) { + device_printf (sc->bge_dev, + "couldn't map BAR2 memory\n"); + error = ENXIO; + goto fail; + } + + /* Enable APE register/memory access by host driver. */ + pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); + pcistate |= BGE_PCISTATE_ALLOW_APE_CTLSPC_WR | + BGE_PCISTATE_ALLOW_APE_SHMEM_WR | + BGE_PCISTATE_ALLOW_APE_PSPACE_WR; + pci_write_config(dev, BGE_PCI_PCISTATE, pcistate, 4); + + bge_ape_lock_init(sc); + bge_ape_read_fw_ver(sc); + } + /* Add SYSCTLs, requires the chipset family to be set. */ bge_add_sysctls(sc); @@ -3264,36 +3652,31 @@ bge_attach(device_t dev) bge_devinfo(sc); - /* Try to reset the chip. */ - if (bge_reset(sc)) { - device_printf(sc->bge_dev, "chip reset failed\n"); - error = ENXIO; - goto fail; - } - sc->bge_asf_mode = 0; - if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == - BGE_SRAM_DATA_SIG_MAGIC)) { - if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG) - & BGE_HWCFG_ASF) { - sc->bge_asf_mode |= ASF_ENABLE; - sc->bge_asf_mode |= ASF_STACKUP; - if (BGE_IS_575X_PLUS(sc)) - sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + /* No ASF if APE present. */ + if ((sc->bge_flags & BGE_FLAG_APE) == 0) { + if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == + BGE_SRAM_DATA_SIG_MAGIC)) { + if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG) & + BGE_HWCFG_ASF) { + sc->bge_asf_mode |= ASF_ENABLE; + sc->bge_asf_mode |= ASF_STACKUP; + if (BGE_IS_575X_PLUS(sc)) + sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + } } } - /* Try to reset the chip again the nice way. */ bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_sig_pre_reset(sc, BGE_RESET_START); if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); error = ENXIO; goto fail; } - bge_sig_legacy(sc, BGE_RESET_STOP); - bge_sig_post_reset(sc, BGE_RESET_STOP); + bge_sig_legacy(sc, BGE_RESET_START); + bge_sig_post_reset(sc, BGE_RESET_START); if (bge_chipinit(sc)) { device_printf(sc->bge_dev, "chip initialization failed\n"); @@ -3568,6 +3951,10 @@ bge_release_resources(struct bge_softc * bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->bge_res); + if (sc->bge_res2 != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(2), sc->bge_res2); + if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); @@ -3589,6 +3976,8 @@ bge_reset(struct bge_softc *sc) dev = sc->bge_dev; mac_mode_mask = BGE_MACMODE_HALF_DUPLEX | BGE_MACMODE_PORTMODE; + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + mac_mode_mask |= BGE_MACMODE_APE_RX_EN | BGE_MACMODE_APE_TX_EN; mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & mac_mode_mask; if (BGE_IS_575X_PLUS(sc) && !BGE_IS_5714_FAMILY(sc) && @@ -3600,6 +3989,9 @@ bge_reset(struct bge_softc *sc) } else write_op = bge_writereg_ind; + /* Take APE lock when performing reset. */ + bge_ape_lock(sc, BGE_APE_LOCK_GRC); + /* Save some important PCI state. */ cachesize = pci_read_config(dev, BGE_PCI_CACHESZ, 4); command = pci_read_config(dev, BGE_PCI_CMD, 4); @@ -3694,6 +4086,10 @@ bge_reset(struct bge_softc *sc) if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0 && (sc->bge_flags & BGE_FLAG_PCIX) != 0) val |= BGE_PCISTATE_RETRY_SAME_DMA; + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + val |= BGE_PCISTATE_ALLOW_APE_CTLSPC_WR | + BGE_PCISTATE_ALLOW_APE_SHMEM_WR | + BGE_PCISTATE_ALLOW_APE_PSPACE_WR; pci_write_config(dev, BGE_PCI_PCISTATE, val, 4); pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); @@ -3743,6 +4139,8 @@ bge_reset(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); + bge_ape_unlock(sc, BGE_APE_LOCK_GRC); + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { for (i = 0; i < BGE_TIMEOUT; i++) { val = CSR_READ_4(sc, BGE_VCPU_STATUS); @@ -4315,6 +4713,8 @@ bge_tick(void *xsc) else bge_stats_update(sc); + /* XXX Add APE heartbeat check here? */ + if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { mii = device_get_softc(sc->bge_miibus); /* @@ -5058,7 +5458,10 @@ bge_init_locked(struct bge_softc *sc) DELAY(100); /* Turn on receiver. */ - BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + mode = CSR_READ_4(sc, BGE_RX_MODE); + if (BGE_IS_5755_PLUS(sc)) + mode |= BGE_RXMODE_IPV6_ENABLE; + CSR_WRITE_4(sc,BGE_RX_MODE, mode | BGE_RXMODE_ENABLE); DELAY(10); /* @@ -5464,7 +5867,7 @@ bge_stop(struct bge_softc *sc) * Tell firmware we're shutting down. */ bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN); /* * Disable all of the receiver blocks. @@ -5510,8 +5913,8 @@ bge_stop(struct bge_softc *sc) bge_stats_update_regs(sc); bge_reset(sc); - bge_sig_legacy(sc, BGE_RESET_STOP); - bge_sig_post_reset(sc, BGE_RESET_STOP); + bge_sig_legacy(sc, BGE_RESET_SHUTDOWN); + bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN); /* * Keep the ASF firmware running if up. @@ -5553,7 +5956,6 @@ bge_shutdown(device_t dev) sc = device_get_softc(dev); BGE_LOCK(sc); bge_stop(sc); - bge_reset(sc); BGE_UNLOCK(sc); return (0); @@ -5729,7 +6131,11 @@ bge_add_sysctls(struct bge_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reg_read", CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_reg_read, "I", - "Register Read"); + "MAC Register Read"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ape_read", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_ape_read, "I", + "APE Register Read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mem_read", CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_mem_read, "I", @@ -6128,6 +6534,28 @@ bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS) } static int +bge_sysctl_ape_read(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + uint16_t result; + uint32_t val; + + result = -1; + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || (req->newptr == NULL)) + return (error); + + if (result < 0x8000) { + sc = (struct bge_softc *)arg1; + val = APE_READ_4(sc, result); + printf("reg 0x%06X = 0x%08X\n", result, val); + } + + return (error); +} + +static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS) { struct bge_softc *sc; Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:20:59 2012 (r243545) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:25:41 2012 (r243546) @@ -435,6 +435,9 @@ #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 #define BGE_PCISTATE_RETRY_SAME_DMA 0x00002000 +#define BGE_PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000 +#define BGE_PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000 +#define BGE_PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000 /* * PCI Clock Control register -- note, this register is read only @@ -460,6 +463,8 @@ #define PCIM_CMD_INTxDIS 0x0400 #endif +/* BAR0 (MAC) Register Definitions */ + /* * High priority mailbox registers * Each mailbox is 64-bits wide, though we only use the @@ -742,6 +747,8 @@ #define BGE_MACMODE_TXDMA_ENB 0x00200000 #define BGE_MACMODE_RXDMA_ENB 0x00400000 #define BGE_MACMODE_FRMHDR_DMA_ENB 0x00800000 +#define BGE_MACMODE_APE_RX_EN 0x08000000 +#define BGE_MACMODE_APE_TX_EN 0x10000000 #define BGE_PORTMODE_NONE 0x00000000 #define BGE_PORTMODE_MII 0x00000004 @@ -829,6 +836,7 @@ #define BGE_RXMODE_RX_PROMISC 0x00000100 #define BGE_RXMODE_RX_NO_CRC_CHECK 0x00000200 #define BGE_RXMODE_RX_KEEP_VLAN_DIAG 0x00000400 +#define BGE_RXMODE_IPV6_ENABLE 0x01000000 /* Receive MAC status register */ #define BGE_RXSTAT_REMOTE_XOFFED 0x00000001 @@ -1578,6 +1586,22 @@ #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 +/* BD Read DMA Mode register */ +#define BGE_RDMA_BD_MODE 0x4A00 +/* BD Read DMA Mode status register */ +#define BGE_RDMA_BD_STATUS 0x4A04 + +#define BGE_RDMA_BD_MODE_RESET 0x00000001 +#define BGE_RDMA_BD_MODE_ENABLE 0x00000002 + +/* Non-LSO Read DMA Mode register */ +#define BGE_RDMA_NON_LSO_MODE 0x4B00 +/* Non-LSO Read DMA Mode status register */ +#define BGE_RDMA_NON_LSO_STATUS 0x4B04 + +#define BGE_RDMA_NON_LSO_MODE_RESET 0x00000001 +#define BGE_RDMA_NON_LSO_MODE_ENABLE 0x00000002 + /* * Write DMA control registers */ @@ -2065,6 +2089,112 @@ #define BGE_MEMWIN_START 0x00008000 #define BGE_MEMWIN_END 0x0000FFFF +/* BAR1 (APE) Register Definitions */ + +#define BGE_APE_GPIO_MSG 0x0008 +#define BGE_APE_EVENT 0x000C +#define BGE_APE_LOCK_REQ 0x002C +#define BGE_APE_LOCK_GRANT 0x004C + +#define BGE_APE_GPIO_MSG_SHIFT 4 + +#define BGE_APE_EVENT_1 0x00000001 + +#define BGE_APE_LOCK_REQ_DRIVER0 0x00001000 + +#define BGE_APE_LOCK_GRANT_DRIVER0 0x00001000 + +/* APE Shared Memory block (writable by APE only) */ +#define BGE_APE_SEG_SIG 0x4000 +#define BGE_APE_FW_STATUS 0x400C +#define BGE_APE_FW_FEATURES 0x4010 +#define BGE_APE_FW_BEHAVIOR 0x4014 +#define BGE_APE_FW_VERSION 0x4018 +#define BGE_APE_FW_HEARTBEAT_INTERVAL 0x4024 +#define BGE_APE_FW_HEARTBEAT 0x4028 +#define BGE_APE_FW_ERROR_FLAGS 0x4074 + +#define BGE_APE_SEG_SIG_MAGIC 0x41504521 + +#define BGE_APE_FW_STATUS_READY 0x00000100 + +#define BGE_APE_FW_FEATURE_DASH 0x00000001 +#define BGE_APE_FW_FEATURE_NCSI 0x00000002 + +#define BGE_APE_FW_VERSION_MAJMSK 0xFF000000 +#define BGE_APE_FW_VERSION_MAJSFT 24 +#define BGE_APE_FW_VERSION_MINMSK 0x00FF0000 +#define BGE_APE_FW_VERSION_MINSFT 16 +#define BGE_APE_FW_VERSION_REVMSK 0x0000FF00 +#define BGE_APE_FW_VERSION_REVSFT 8 +#define BGE_APE_FW_VERSION_BLDMSK 0x000000FF + +/* Host Shared Memory block (writable by host only) */ +#define BGE_APE_HOST_SEG_SIG 0x4200 +#define BGE_APE_HOST_SEG_LEN 0x4204 +#define BGE_APE_HOST_INIT_COUNT 0x4208 +#define BGE_APE_HOST_DRIVER_ID 0x420C +#define BGE_APE_HOST_BEHAVIOR 0x4210 +#define BGE_APE_HOST_HEARTBEAT_INT_MS 0x4214 +#define BGE_APE_HOST_HEARTBEAT_COUNT 0x4218 +#define BGE_APE_HOST_DRVR_STATE 0x421C +#define BGE_APE_HOST_WOL_SPEED 0x4224 + +#define BGE_APE_HOST_SEG_SIG_MAGIC 0x484F5354 + +#define BGE_APE_HOST_SEG_LEN_MAGIC 0x00000020 + +#define BGE_APE_HOST_DRIVER_ID_FBSD 0xF6000000 +#define BGE_APE_HOST_DRIVER_ID_MAGIC(maj, min) \ + (BGE_APE_HOST_DRIVER_ID_FBSD | \ + ((maj) & 0xffd) << 16 | ((min) & 0xff) << 8) + +#define BGE_APE_HOST_BEHAV_NO_PHYLOCK 0x00000001 + +#define BGE_APE_HOST_HEARTBEAT_INT_DISABLE 0 +#define BGE_APE_HOST_HEARTBEAT_INT_5SEC 5000 + +#define BGE_APE_HOST_DRVR_STATE_START 0x00000001 +#define BGE_APE_HOST_DRVR_STATE_UNLOAD 0x00000002 +#define BGE_APE_HOST_DRVR_STATE_WOL 0x00000003 +#define BGE_APE_HOST_DRVR_STATE_SUSPEND 0x00000004 + +#define BGE_APE_HOST_WOL_SPEED_AUTO 0x00008000 + +#define BGE_APE_EVENT_STATUS 0x4300 + +#define BGE_APE_EVENT_STATUS_DRIVER_EVNT 0x00000010 +#define BGE_APE_EVENT_STATUS_STATE_CHNGE 0x00000500 +#define BGE_APE_EVENT_STATUS_STATE_START 0x00010000 +#define BGE_APE_EVENT_STATUS_STATE_UNLOAD 0x00020000 +#define BGE_APE_EVENT_STATUS_STATE_WOL 0x00030000 +#define BGE_APE_EVENT_STATUS_STATE_SUSPEND 0x00040000 +#define BGE_APE_EVENT_STATUS_EVENT_PENDING 0x80000000 + +#define BGE_APE_DEBUG_LOG 0x4E00 +#define BGE_APE_DEBUG_LOG_LEN 0x0100 + +#define BGE_APE_PER_LOCK_REQ 0x8400 +#define BGE_APE_PER_LOCK_GRANT 0x8420 + +#define BGE_APE_LOCK_PER_REQ_DRIVER0 0x00001000 +#define BGE_APE_LOCK_PER_REQ_DRIVER1 0x00000002 +#define BGE_APE_LOCK_PER_REQ_DRIVER2 0x00000004 +#define BGE_APE_LOCK_PER_REQ_DRIVER3 0x00000008 + +#define BGE_APE_PER_LOCK_GRANT_DRIVER0 0x00001000 +#define BGE_APE_PER_LOCK_GRANT_DRIVER1 0x00000002 +#define BGE_APE_PER_LOCK_GRANT_DRIVER2 0x00000004 +#define BGE_APE_PER_LOCK_GRANT_DRIVER3 0x00000008 + +/* APE Mutex Resources */ +#define BGE_APE_LOCK_PHY0 0 +#define BGE_APE_LOCK_GRC 1 +#define BGE_APE_LOCK_PHY1 2 +#define BGE_APE_LOCK_PHY2 3 +#define BGE_APE_LOCK_MEM 4 +#define BGE_APE_LOCK_PHY3 5 +#define BGE_APE_LOCK_GPIO 7 #define BGE_MEMWIN_READ(sc, x, val) \ do { \ @@ -2659,7 +2789,7 @@ struct bge_gib { #define BGE_INC(x, y) (x) = (x + 1) % y /* - * Register access macros. The Tigon always uses memory mapped register + * BAR0 MAC register access macros. The Tigon always uses memory mapped register * accesses and all registers must be accessed with 32 bit operations. */ @@ -2674,6 +2804,18 @@ struct bge_gib { #define BGE_CLRBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) & ~(x))) +/* BAR2 APE register access macros. */ +#define APE_WRITE_4(sc, reg, val) \ + bus_write_4(sc->bge_res2, reg, val) + +#define APE_READ_4(sc, reg) \ + bus_read_4(sc->bge_res2, reg) + +#define APE_SETBIT(sc, reg, x) \ + APE_WRITE_4(sc, reg, (APE_READ_4(sc, reg) | (x))) +#define APE_CLRBIT(sc, reg, x) \ + APE_WRITE_4(sc, reg, (APE_READ_4(sc, reg) & ~(x))) + #define PCI_SETBIT(dev, reg, x, s) \ pci_write_config(dev, reg, (pci_read_config(dev, reg, s) | (x)), s) #define PCI_CLRBIT(dev, reg, x, s) \ @@ -2800,7 +2942,8 @@ struct bge_softc { device_t bge_miibus; void *bge_intrhand; struct resource *bge_irq; - struct resource *bge_res; + struct resource *bge_res; /* MAC mapped I/O */ + struct resource *bge_res2; /* APE mapped I/O */ struct ifmedia bge_ifmedia; /* TBI media info */ int bge_expcap; int bge_expmrq; @@ -2814,6 +2957,7 @@ struct bge_softc { #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_CPMU_PRESENT 0x00000020 #define BGE_FLAG_TAGGED_STATUS 0x00000040 +#define BGE_FLAG_APE 0x00000080 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 @@ -2833,6 +2977,13 @@ struct bge_softc { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:26: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 D18F66F5; Mon, 26 Nov 2012 04:26:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4DC38FC08; Mon, 26 Nov 2012 04:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4QRPv093359; Mon, 26 Nov 2012 04:26:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4QRKK093356; Mon, 26 Nov 2012 04:26:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260426.qAQ4QRKK093356@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243547 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:26:28 -0000 Author: yongari Date: Mon Nov 26 04:26:27 2012 New Revision: 243547 URL: http://svnweb.freebsd.org/changeset/base/243547 Log: MFC r241438: Add APE firmware support and improve firmware handshake procedure. This change will enable IPMI access on 5717/5718/5719/5720 and 5761 controllers. Because ASF is not available when APE firmware is present, bge_allow_asf tunable is ignored when driver detects APE firmware. Also bge(4) no longer performs two resets(one blind reset and the other reset with firmware in mind) in device attach. Now bge(4) performs a reset with enough information in bge_reset(). The APE firmware also needs special handling to make suspend/resume work but it was not implemented yet. With this change, bge(4) should work on any 5717/5718/5719/5720 controllers. Special thanks to Mike Hibler at Emulab who setup remote debugging on Dell R820. Without his help I couldn't be able to address several issues happened on Dell Rx20 systems. And many thanks to Broadcom for continuing to support FreeBSD! Submitted by: davidch (initial version) H/W donated by: Broadcom Tested by: many Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8 Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:25:41 2012 (r243546) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:26:27 2012 (r243547) @@ -461,8 +461,9 @@ static void bge_miibus_statchg(device_t) static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); #endif -#define BGE_RESET_START 1 -#define BGE_RESET_STOP 2 +#define BGE_RESET_SHUTDOWN 0 +#define BGE_RESET_START 1 +#define BGE_RESET_SUSPEND 2 static void bge_sig_post_reset(struct bge_softc *, int); static void bge_sig_legacy(struct bge_softc *, int); static void bge_sig_pre_reset(struct bge_softc *, int); @@ -470,6 +471,13 @@ static void bge_stop_fw(struct bge_softc static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); +static void bge_ape_lock_init(struct bge_softc *); +static void bge_ape_read_fw_ver(struct bge_softc *); +static int bge_ape_lock(struct bge_softc *, int); +static void bge_ape_unlock(struct bge_softc *, int); +static void bge_ape_send_event(struct bge_softc *, uint32_t); +static void bge_ape_driver_state_change(struct bge_softc *, int); + /* * The BGE_REGISTER_DEBUG option is only for low-level debugging. It may * leak information to untrusted users. It is also known to cause alignment @@ -478,6 +486,7 @@ static void bge_link_upd(struct bge_soft #ifdef BGE_REGISTER_DEBUG static int bge_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_ape_read(SYSCTL_HANDLER_ARGS); static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS); #endif static void bge_add_sysctls(struct bge_softc *); @@ -643,6 +652,318 @@ bge_writembx(struct bge_softc *sc, int o } /* + * Clear all stale locks and select the lock for this driver instance. + */ +static void +bge_ape_lock_init(struct bge_softc *sc) +{ + uint32_t bit, regbase; + int i; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + regbase = BGE_APE_LOCK_GRANT; + else + regbase = BGE_APE_PER_LOCK_GRANT; + + /* Clear any stale locks. */ + for (i = BGE_APE_LOCK_PHY0; i <= BGE_APE_LOCK_GPIO; i++) { + switch (i) { + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + bit = BGE_APE_LOCK_GRANT_DRIVER0; + break; + default: + if (sc->bge_func_addr != 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + } + APE_WRITE_4(sc, regbase + 4 * i, bit); + } + + /* Select the PHY lock based on the device's function number. */ + switch (sc->bge_func_addr) { + case 0: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY0; + break; + case 1: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY1; + break; + case 2: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY2; + break; + case 3: + sc->bge_phy_ape_lock = BGE_APE_LOCK_PHY3; + break; + default: + device_printf(sc->bge_dev, + "PHY lock not supported on this function\n"); + } +} + +/* + * Check for APE firmware, set flags, and print version info. + */ +static void +bge_ape_read_fw_ver(struct bge_softc *sc) +{ + const char *fwtype; + uint32_t apedata, features; + + /* Check for a valid APE signature in shared memory. */ + apedata = APE_READ_4(sc, BGE_APE_SEG_SIG); + if (apedata != BGE_APE_SEG_SIG_MAGIC) { + sc->bge_mfw_flags &= ~ BGE_MFW_ON_APE; + return; + } + + /* Check if APE firmware is running. */ + apedata = APE_READ_4(sc, BGE_APE_FW_STATUS); + if ((apedata & BGE_APE_FW_STATUS_READY) == 0) { + device_printf(sc->bge_dev, "APE signature found " + "but FW status not ready! 0x%08x\n", apedata); + return; + } + + sc->bge_mfw_flags |= BGE_MFW_ON_APE; + + /* Fetch the APE firwmare type and version. */ + apedata = APE_READ_4(sc, BGE_APE_FW_VERSION); + features = APE_READ_4(sc, BGE_APE_FW_FEATURES); + if ((features & BGE_APE_FW_FEATURE_NCSI) != 0) { + sc->bge_mfw_flags |= BGE_MFW_TYPE_NCSI; + fwtype = "NCSI"; + } else if ((features & BGE_APE_FW_FEATURE_DASH) != 0) { + sc->bge_mfw_flags |= BGE_MFW_TYPE_DASH; + fwtype = "DASH"; + } else + fwtype = "UNKN"; + + /* Print the APE firmware version. */ + device_printf(sc->bge_dev, "APE FW version: %s v%d.%d.%d.%d\n", + fwtype, + (apedata & BGE_APE_FW_VERSION_MAJMSK) >> BGE_APE_FW_VERSION_MAJSFT, + (apedata & BGE_APE_FW_VERSION_MINMSK) >> BGE_APE_FW_VERSION_MINSFT, + (apedata & BGE_APE_FW_VERSION_REVMSK) >> BGE_APE_FW_VERSION_REVSFT, + (apedata & BGE_APE_FW_VERSION_BLDMSK)); +} + +static int +bge_ape_lock(struct bge_softc *sc, int locknum) +{ + uint32_t bit, gnt, req, status; + int i, off; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return (0); + + /* Lock request/grant registers have different bases. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) { + req = BGE_APE_LOCK_REQ; + gnt = BGE_APE_LOCK_GRANT; + } else { + req = BGE_APE_PER_LOCK_REQ; + gnt = BGE_APE_PER_LOCK_GRANT; + } + + off = 4 * locknum; + + switch (locknum) { + case BGE_APE_LOCK_GPIO: + /* Lock required when using GPIO. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + return (0); + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_GRC: + /* Lock required to reset the device. */ + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_MEM: + /* Lock required when accessing certain APE memory. */ + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_REQ_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + /* Lock required when accessing PHYs. */ + bit = BGE_APE_LOCK_REQ_DRIVER0; + break; + default: + return (EINVAL); + } + + /* Request a lock. */ + APE_WRITE_4(sc, req + off, bit); + + /* Wait up to 1 second to acquire lock. */ + for (i = 0; i < 20000; i++) { + status = APE_READ_4(sc, gnt + off); + if (status == bit) + break; + DELAY(50); + } + + /* Handle any errors. */ + if (status != bit) { + device_printf(sc->bge_dev, "APE lock %d request failed! " + "request = 0x%04x[0x%04x], status = 0x%04x[0x%04x]\n", + locknum, req + off, bit & 0xFFFF, gnt + off, + status & 0xFFFF); + /* Revoke the lock request. */ + APE_WRITE_4(sc, gnt + off, bit); + return (EBUSY); + } + + return (0); +} + +static void +bge_ape_unlock(struct bge_softc *sc, int locknum) +{ + uint32_t bit, gnt; + int off; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + gnt = BGE_APE_LOCK_GRANT; + else + gnt = BGE_APE_PER_LOCK_GRANT; + + off = 4 * locknum; + + switch (locknum) { + case BGE_APE_LOCK_GPIO: + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + return; + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_GRC: + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_MEM: + if (sc->bge_func_addr == 0) + bit = BGE_APE_LOCK_GRANT_DRIVER0; + else + bit = (1 << sc->bge_func_addr); + break; + case BGE_APE_LOCK_PHY0: + case BGE_APE_LOCK_PHY1: + case BGE_APE_LOCK_PHY2: + case BGE_APE_LOCK_PHY3: + bit = BGE_APE_LOCK_GRANT_DRIVER0; + break; + default: + return; + } + + APE_WRITE_4(sc, gnt + off, bit); +} + +/* + * Send an event to the APE firmware. + */ +static void +bge_ape_send_event(struct bge_softc *sc, uint32_t event) +{ + uint32_t apedata; + int i; + + /* NCSI does not support APE events. */ + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + /* Wait up to 1ms for APE to service previous event. */ + for (i = 10; i > 0; i--) { + if (bge_ape_lock(sc, BGE_APE_LOCK_MEM) != 0) + break; + apedata = APE_READ_4(sc, BGE_APE_EVENT_STATUS); + if ((apedata & BGE_APE_EVENT_STATUS_EVENT_PENDING) == 0) { + APE_WRITE_4(sc, BGE_APE_EVENT_STATUS, event | + BGE_APE_EVENT_STATUS_EVENT_PENDING); + bge_ape_unlock(sc, BGE_APE_LOCK_MEM); + APE_WRITE_4(sc, BGE_APE_EVENT, BGE_APE_EVENT_1); + break; + } + bge_ape_unlock(sc, BGE_APE_LOCK_MEM); + DELAY(100); + } + if (i == 0) + device_printf(sc->bge_dev, "APE event 0x%08x send timed out\n", + event); +} + +static void +bge_ape_driver_state_change(struct bge_softc *sc, int kind) +{ + uint32_t apedata, event; + + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) == 0) + return; + + switch (kind) { + case BGE_RESET_START: + /* If this is the first load, clear the load counter. */ + apedata = APE_READ_4(sc, BGE_APE_HOST_SEG_SIG); + if (apedata != BGE_APE_HOST_SEG_SIG_MAGIC) + APE_WRITE_4(sc, BGE_APE_HOST_INIT_COUNT, 0); + else { + apedata = APE_READ_4(sc, BGE_APE_HOST_INIT_COUNT); + APE_WRITE_4(sc, BGE_APE_HOST_INIT_COUNT, ++apedata); + } + APE_WRITE_4(sc, BGE_APE_HOST_SEG_SIG, + BGE_APE_HOST_SEG_SIG_MAGIC); + APE_WRITE_4(sc, BGE_APE_HOST_SEG_LEN, + BGE_APE_HOST_SEG_LEN_MAGIC); + + /* Add some version info if bge(4) supports it. */ + APE_WRITE_4(sc, BGE_APE_HOST_DRIVER_ID, + BGE_APE_HOST_DRIVER_ID_MAGIC(1, 0)); + APE_WRITE_4(sc, BGE_APE_HOST_BEHAVIOR, + BGE_APE_HOST_BEHAV_NO_PHYLOCK); + APE_WRITE_4(sc, BGE_APE_HOST_HEARTBEAT_INT_MS, + BGE_APE_HOST_HEARTBEAT_INT_DISABLE); + APE_WRITE_4(sc, BGE_APE_HOST_DRVR_STATE, + BGE_APE_HOST_DRVR_STATE_START); + event = BGE_APE_EVENT_STATUS_STATE_START; + break; + case BGE_RESET_SHUTDOWN: + APE_WRITE_4(sc, BGE_APE_HOST_DRVR_STATE, + BGE_APE_HOST_DRVR_STATE_UNLOAD); + event = BGE_APE_EVENT_STATUS_STATE_UNLOAD; + break; + case BGE_RESET_SUSPEND: + event = BGE_APE_EVENT_STATUS_STATE_SUSPEND; + break; + default: + return; + } + + bge_ape_send_event(sc, event | BGE_APE_EVENT_STATUS_DRIVER_EVNT | + BGE_APE_EVENT_STATUS_STATE_CHNGE); +} + +/* * Map a single buffer address. */ @@ -806,6 +1127,9 @@ bge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return (0); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -840,6 +1164,8 @@ bge_miibus_readreg(device_t dev, int phy DELAY(80); } + bge_ape_unlock(sc, sc->bge_phy_ape_lock); + if (val & BGE_MICOMM_READFAIL) return (0); @@ -858,6 +1184,9 @@ bge_miibus_writereg(device_t dev, int ph (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) return (0); + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return (0); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -883,6 +1212,8 @@ bge_miibus_writereg(device_t dev, int ph DELAY(80); } + bge_ape_unlock(sc, sc->bge_phy_ape_lock); + if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, "PHY write timed out (phy %d, reg %d, val 0x%04x)\n", @@ -1335,12 +1666,19 @@ bge_sig_pre_reset(struct bge_softc *sc, bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_START); break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD); break; + case BGE_RESET_SUSPEND: + bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, + BGE_FW_DRV_STATE_SUSPEND); + break; } } + + if (type == BGE_RESET_START || type == BGE_RESET_SUSPEND) + bge_ape_driver_state_change(sc, type); } static void @@ -1354,12 +1692,14 @@ bge_sig_post_reset(struct bge_softc *sc, BGE_FW_DRV_STATE_START_DONE); /* START DONE */ break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD_DONE); break; } } + if (type == BGE_RESET_SHUTDOWN) + bge_ape_driver_state_change(sc, type); } static void @@ -1372,7 +1712,7 @@ bge_sig_legacy(struct bge_softc *sc, int bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_START); break; - case BGE_RESET_STOP: + case BGE_RESET_SHUTDOWN: bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB, BGE_FW_DRV_STATE_UNLOAD); break; @@ -1409,11 +1749,6 @@ bge_dma_swap_options(struct bge_softc *s #if BYTE_ORDER == BIG_ENDIAN dma_options |= BGE_MODECTL_BYTESWAP_NONFRAME; #endif - if ((sc)->bge_asicrev == BGE_ASICREV_BCM5720) - dma_options |= BGE_MODECTL_BYTESWAP_B2HRX_DATA | - BGE_MODECTL_WORDSWAP_B2HRX_DATA | BGE_MODECTL_B2HRX_ENABLE | - BGE_MODECTL_HTX2B_ENABLE; - return (dma_options); } @@ -1540,8 +1875,16 @@ bge_chipinit(struct bge_softc *sc) /* * Set up general mode register. */ - mode_ctl = bge_dma_swap_options(sc) | BGE_MODECTL_MAC_ATTN_INTR | - BGE_MODECTL_HOST_SEND_BDS | BGE_MODECTL_TX_NO_PHDR_CSUM; + mode_ctl = bge_dma_swap_options(sc); + if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + /* Retain Host-2-BMC settings written by APE firmware. */ + mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & + (BGE_MODECTL_BYTESWAP_B2HRX_DATA | + BGE_MODECTL_WORDSWAP_B2HRX_DATA | + BGE_MODECTL_B2HRX_ENABLE | BGE_MODECTL_HTX2B_ENABLE); + } + mode_ctl |= BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS | + BGE_MODECTL_TX_NO_PHDR_CSUM; /* * BCM5701 B5 have a bug causing data corruption when using @@ -2045,6 +2388,10 @@ bge_blockinit(struct bge_softc *sc) else val |= BGE_PORTMODE_MII; + /* Allow APE to send/receive frames. */ + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + val |= BGE_MACMODE_APE_RX_EN | BGE_MACMODE_APE_TX_EN; + CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); @@ -2891,9 +3238,9 @@ bge_attach(device_t dev) { struct ifnet *ifp; struct bge_softc *sc; - uint32_t hwcfg = 0, misccfg; + uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, f, msicount, phy_addr, reg, rid, trys; + int capmask, error, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2912,12 +3259,13 @@ bge_attach(device_t dev) RF_ACTIVE); if (sc->bge_res == NULL) { - device_printf (sc->bge_dev, "couldn't map memory\n"); + device_printf (sc->bge_dev, "couldn't map BAR0 memory\n"); error = ENXIO; goto fail; } /* Save various chip information. */ + sc->bge_func_addr = pci_get_function(dev); sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; @@ -2964,25 +3312,32 @@ bge_attach(device_t dev) * BCM5719 | 1 | 8 | 2 | 9 | * BCM5720 | 1 | 8 | 2 | 9 | * + * | F2 Cu | F2 Sr | F3 Cu | F3 Sr | + * ---------+-------+-------+-------+-------+ + * BCM57XX | X | X | X | X | + * BCM5704 | X | X | X | X | + * BCM5717 | X | X | X | X | + * BCM5719 | 3 | 10 | 4 | 11 | + * BCM5720 | X | X | X | X | + * * Other addresses may respond but they are not * IEEE compliant PHYs and should be ignored. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || sc->bge_asicrev == BGE_ASICREV_BCM5719 || sc->bge_asicrev == BGE_ASICREV_BCM5720) { - f = pci_get_function(dev); - if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { + if (sc->bge_chipid != BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & BGE_SGDIGSTS_IS_SERDES) - phy_addr = f + 8; + phy_addr = sc->bge_func_addr + 8; else - phy_addr = f + 1; + phy_addr = sc->bge_func_addr + 1; } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) - phy_addr = f + 8; + phy_addr = sc->bge_func_addr + 8; else - phy_addr = f + 1; + phy_addr = sc->bge_func_addr + 1; } } @@ -3045,6 +3400,39 @@ bge_attach(device_t dev) break; } + /* Identify chips with APE processor. */ + switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5717: + case BGE_ASICREV_BCM5719: + case BGE_ASICREV_BCM5720: + case BGE_ASICREV_BCM5761: + sc->bge_flags |= BGE_FLAG_APE; + break; + } + + /* Chips with APE need BAR2 access for APE registers/memory. */ + if ((sc->bge_flags & BGE_FLAG_APE) != 0) { + rid = PCIR_BAR(2); + sc->bge_res2 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->bge_res2 == NULL) { + device_printf (sc->bge_dev, + "couldn't map BAR2 memory\n"); + error = ENXIO; + goto fail; + } + + /* Enable APE register/memory access by host driver. */ + pcistate = pci_read_config(dev, BGE_PCI_PCISTATE, 4); + pcistate |= BGE_PCISTATE_ALLOW_APE_CTLSPC_WR | + BGE_PCISTATE_ALLOW_APE_SHMEM_WR | + BGE_PCISTATE_ALLOW_APE_PSPACE_WR; + pci_write_config(dev, BGE_PCI_PCISTATE, pcistate, 4); + + bge_ape_lock_init(sc); + bge_ape_read_fw_ver(sc); + } + /* Add SYSCTLs, requires the chipset family to be set. */ bge_add_sysctls(sc); @@ -3264,36 +3652,31 @@ bge_attach(device_t dev) bge_devinfo(sc); - /* Try to reset the chip. */ - if (bge_reset(sc)) { - device_printf(sc->bge_dev, "chip reset failed\n"); - error = ENXIO; - goto fail; - } - sc->bge_asf_mode = 0; - if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == - BGE_SRAM_DATA_SIG_MAGIC)) { - if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG) - & BGE_HWCFG_ASF) { - sc->bge_asf_mode |= ASF_ENABLE; - sc->bge_asf_mode |= ASF_STACKUP; - if (BGE_IS_575X_PLUS(sc)) - sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + /* No ASF if APE present. */ + if ((sc->bge_flags & BGE_FLAG_APE) == 0) { + if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == + BGE_SRAM_DATA_SIG_MAGIC)) { + if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG) & + BGE_HWCFG_ASF) { + sc->bge_asf_mode |= ASF_ENABLE; + sc->bge_asf_mode |= ASF_STACKUP; + if (BGE_IS_575X_PLUS(sc)) + sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + } } } - /* Try to reset the chip again the nice way. */ bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_sig_pre_reset(sc, BGE_RESET_START); if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); error = ENXIO; goto fail; } - bge_sig_legacy(sc, BGE_RESET_STOP); - bge_sig_post_reset(sc, BGE_RESET_STOP); + bge_sig_legacy(sc, BGE_RESET_START); + bge_sig_post_reset(sc, BGE_RESET_START); if (bge_chipinit(sc)) { device_printf(sc->bge_dev, "chip initialization failed\n"); @@ -3568,6 +3951,10 @@ bge_release_resources(struct bge_softc * bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->bge_res); + if (sc->bge_res2 != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(2), sc->bge_res2); + if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); @@ -3589,6 +3976,8 @@ bge_reset(struct bge_softc *sc) dev = sc->bge_dev; mac_mode_mask = BGE_MACMODE_HALF_DUPLEX | BGE_MACMODE_PORTMODE; + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + mac_mode_mask |= BGE_MACMODE_APE_RX_EN | BGE_MACMODE_APE_TX_EN; mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) & mac_mode_mask; if (BGE_IS_575X_PLUS(sc) && !BGE_IS_5714_FAMILY(sc) && @@ -3600,6 +3989,9 @@ bge_reset(struct bge_softc *sc) } else write_op = bge_writereg_ind; + /* Take APE lock when performing reset. */ + bge_ape_lock(sc, BGE_APE_LOCK_GRC); + /* Save some important PCI state. */ cachesize = pci_read_config(dev, BGE_PCI_CACHESZ, 4); command = pci_read_config(dev, BGE_PCI_CMD, 4); @@ -3694,6 +4086,10 @@ bge_reset(struct bge_softc *sc) if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0 && (sc->bge_flags & BGE_FLAG_PCIX) != 0) val |= BGE_PCISTATE_RETRY_SAME_DMA; + if ((sc->bge_mfw_flags & BGE_MFW_ON_APE) != 0) + val |= BGE_PCISTATE_ALLOW_APE_CTLSPC_WR | + BGE_PCISTATE_ALLOW_APE_SHMEM_WR | + BGE_PCISTATE_ALLOW_APE_PSPACE_WR; pci_write_config(dev, BGE_PCI_PCISTATE, val, 4); pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); @@ -3743,6 +4139,8 @@ bge_reset(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_MAC_MODE, val); DELAY(40); + bge_ape_unlock(sc, BGE_APE_LOCK_GRC); + if (sc->bge_asicrev == BGE_ASICREV_BCM5906) { for (i = 0; i < BGE_TIMEOUT; i++) { val = CSR_READ_4(sc, BGE_VCPU_STATUS); @@ -4315,6 +4713,8 @@ bge_tick(void *xsc) else bge_stats_update(sc); + /* XXX Add APE heartbeat check here? */ + if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { mii = device_get_softc(sc->bge_miibus); /* @@ -5058,7 +5458,10 @@ bge_init_locked(struct bge_softc *sc) DELAY(100); /* Turn on receiver. */ - BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + mode = CSR_READ_4(sc, BGE_RX_MODE); + if (BGE_IS_5755_PLUS(sc)) + mode |= BGE_RXMODE_IPV6_ENABLE; + CSR_WRITE_4(sc,BGE_RX_MODE, mode | BGE_RXMODE_ENABLE); DELAY(10); /* @@ -5464,7 +5867,7 @@ bge_stop(struct bge_softc *sc) * Tell firmware we're shutting down. */ bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN); /* * Disable all of the receiver blocks. @@ -5510,8 +5913,8 @@ bge_stop(struct bge_softc *sc) bge_stats_update_regs(sc); bge_reset(sc); - bge_sig_legacy(sc, BGE_RESET_STOP); - bge_sig_post_reset(sc, BGE_RESET_STOP); + bge_sig_legacy(sc, BGE_RESET_SHUTDOWN); + bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN); /* * Keep the ASF firmware running if up. @@ -5553,7 +5956,6 @@ bge_shutdown(device_t dev) sc = device_get_softc(dev); BGE_LOCK(sc); bge_stop(sc); - bge_reset(sc); BGE_UNLOCK(sc); return (0); @@ -5729,7 +6131,11 @@ bge_add_sysctls(struct bge_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reg_read", CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_reg_read, "I", - "Register Read"); + "MAC Register Read"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ape_read", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_ape_read, "I", + "APE Register Read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mem_read", CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_mem_read, "I", @@ -6128,6 +6534,28 @@ bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS) } static int +bge_sysctl_ape_read(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + uint16_t result; + uint32_t val; + + result = -1; + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || (req->newptr == NULL)) + return (error); + + if (result < 0x8000) { + sc = (struct bge_softc *)arg1; + val = APE_READ_4(sc, result); + printf("reg 0x%06X = 0x%08X\n", result, val); + } + + return (error); +} + +static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS) { struct bge_softc *sc; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 04:25:41 2012 (r243546) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 04:26:27 2012 (r243547) @@ -435,6 +435,9 @@ #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 #define BGE_PCISTATE_RETRY_SAME_DMA 0x00002000 +#define BGE_PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000 +#define BGE_PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000 +#define BGE_PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000 /* * PCI Clock Control register -- note, this register is read only @@ -460,6 +463,8 @@ #define PCIM_CMD_INTxDIS 0x0400 #endif +/* BAR0 (MAC) Register Definitions */ + /* * High priority mailbox registers * Each mailbox is 64-bits wide, though we only use the @@ -742,6 +747,8 @@ #define BGE_MACMODE_TXDMA_ENB 0x00200000 #define BGE_MACMODE_RXDMA_ENB 0x00400000 #define BGE_MACMODE_FRMHDR_DMA_ENB 0x00800000 +#define BGE_MACMODE_APE_RX_EN 0x08000000 +#define BGE_MACMODE_APE_TX_EN 0x10000000 #define BGE_PORTMODE_NONE 0x00000000 #define BGE_PORTMODE_MII 0x00000004 @@ -829,6 +836,7 @@ #define BGE_RXMODE_RX_PROMISC 0x00000100 #define BGE_RXMODE_RX_NO_CRC_CHECK 0x00000200 #define BGE_RXMODE_RX_KEEP_VLAN_DIAG 0x00000400 +#define BGE_RXMODE_IPV6_ENABLE 0x01000000 /* Receive MAC status register */ #define BGE_RXSTAT_REMOTE_XOFFED 0x00000001 @@ -1578,6 +1586,22 @@ #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 +/* BD Read DMA Mode register */ +#define BGE_RDMA_BD_MODE 0x4A00 +/* BD Read DMA Mode status register */ +#define BGE_RDMA_BD_STATUS 0x4A04 + +#define BGE_RDMA_BD_MODE_RESET 0x00000001 +#define BGE_RDMA_BD_MODE_ENABLE 0x00000002 + +/* Non-LSO Read DMA Mode register */ +#define BGE_RDMA_NON_LSO_MODE 0x4B00 +/* Non-LSO Read DMA Mode status register */ +#define BGE_RDMA_NON_LSO_STATUS 0x4B04 + +#define BGE_RDMA_NON_LSO_MODE_RESET 0x00000001 +#define BGE_RDMA_NON_LSO_MODE_ENABLE 0x00000002 + /* * Write DMA control registers */ @@ -2065,6 +2089,112 @@ #define BGE_MEMWIN_START 0x00008000 #define BGE_MEMWIN_END 0x0000FFFF +/* BAR1 (APE) Register Definitions */ + +#define BGE_APE_GPIO_MSG 0x0008 +#define BGE_APE_EVENT 0x000C +#define BGE_APE_LOCK_REQ 0x002C +#define BGE_APE_LOCK_GRANT 0x004C + +#define BGE_APE_GPIO_MSG_SHIFT 4 + +#define BGE_APE_EVENT_1 0x00000001 + +#define BGE_APE_LOCK_REQ_DRIVER0 0x00001000 + +#define BGE_APE_LOCK_GRANT_DRIVER0 0x00001000 + +/* APE Shared Memory block (writable by APE only) */ +#define BGE_APE_SEG_SIG 0x4000 +#define BGE_APE_FW_STATUS 0x400C +#define BGE_APE_FW_FEATURES 0x4010 +#define BGE_APE_FW_BEHAVIOR 0x4014 +#define BGE_APE_FW_VERSION 0x4018 +#define BGE_APE_FW_HEARTBEAT_INTERVAL 0x4024 +#define BGE_APE_FW_HEARTBEAT 0x4028 +#define BGE_APE_FW_ERROR_FLAGS 0x4074 + +#define BGE_APE_SEG_SIG_MAGIC 0x41504521 + +#define BGE_APE_FW_STATUS_READY 0x00000100 + +#define BGE_APE_FW_FEATURE_DASH 0x00000001 +#define BGE_APE_FW_FEATURE_NCSI 0x00000002 + +#define BGE_APE_FW_VERSION_MAJMSK 0xFF000000 +#define BGE_APE_FW_VERSION_MAJSFT 24 +#define BGE_APE_FW_VERSION_MINMSK 0x00FF0000 +#define BGE_APE_FW_VERSION_MINSFT 16 +#define BGE_APE_FW_VERSION_REVMSK 0x0000FF00 +#define BGE_APE_FW_VERSION_REVSFT 8 +#define BGE_APE_FW_VERSION_BLDMSK 0x000000FF + +/* Host Shared Memory block (writable by host only) */ +#define BGE_APE_HOST_SEG_SIG 0x4200 +#define BGE_APE_HOST_SEG_LEN 0x4204 +#define BGE_APE_HOST_INIT_COUNT 0x4208 +#define BGE_APE_HOST_DRIVER_ID 0x420C +#define BGE_APE_HOST_BEHAVIOR 0x4210 +#define BGE_APE_HOST_HEARTBEAT_INT_MS 0x4214 +#define BGE_APE_HOST_HEARTBEAT_COUNT 0x4218 +#define BGE_APE_HOST_DRVR_STATE 0x421C +#define BGE_APE_HOST_WOL_SPEED 0x4224 + +#define BGE_APE_HOST_SEG_SIG_MAGIC 0x484F5354 + +#define BGE_APE_HOST_SEG_LEN_MAGIC 0x00000020 + +#define BGE_APE_HOST_DRIVER_ID_FBSD 0xF6000000 +#define BGE_APE_HOST_DRIVER_ID_MAGIC(maj, min) \ + (BGE_APE_HOST_DRIVER_ID_FBSD | \ + ((maj) & 0xffd) << 16 | ((min) & 0xff) << 8) + +#define BGE_APE_HOST_BEHAV_NO_PHYLOCK 0x00000001 + +#define BGE_APE_HOST_HEARTBEAT_INT_DISABLE 0 +#define BGE_APE_HOST_HEARTBEAT_INT_5SEC 5000 + +#define BGE_APE_HOST_DRVR_STATE_START 0x00000001 +#define BGE_APE_HOST_DRVR_STATE_UNLOAD 0x00000002 +#define BGE_APE_HOST_DRVR_STATE_WOL 0x00000003 +#define BGE_APE_HOST_DRVR_STATE_SUSPEND 0x00000004 + +#define BGE_APE_HOST_WOL_SPEED_AUTO 0x00008000 + +#define BGE_APE_EVENT_STATUS 0x4300 + +#define BGE_APE_EVENT_STATUS_DRIVER_EVNT 0x00000010 +#define BGE_APE_EVENT_STATUS_STATE_CHNGE 0x00000500 +#define BGE_APE_EVENT_STATUS_STATE_START 0x00010000 +#define BGE_APE_EVENT_STATUS_STATE_UNLOAD 0x00020000 +#define BGE_APE_EVENT_STATUS_STATE_WOL 0x00030000 +#define BGE_APE_EVENT_STATUS_STATE_SUSPEND 0x00040000 +#define BGE_APE_EVENT_STATUS_EVENT_PENDING 0x80000000 + +#define BGE_APE_DEBUG_LOG 0x4E00 +#define BGE_APE_DEBUG_LOG_LEN 0x0100 + +#define BGE_APE_PER_LOCK_REQ 0x8400 +#define BGE_APE_PER_LOCK_GRANT 0x8420 + +#define BGE_APE_LOCK_PER_REQ_DRIVER0 0x00001000 +#define BGE_APE_LOCK_PER_REQ_DRIVER1 0x00000002 +#define BGE_APE_LOCK_PER_REQ_DRIVER2 0x00000004 +#define BGE_APE_LOCK_PER_REQ_DRIVER3 0x00000008 + +#define BGE_APE_PER_LOCK_GRANT_DRIVER0 0x00001000 +#define BGE_APE_PER_LOCK_GRANT_DRIVER1 0x00000002 +#define BGE_APE_PER_LOCK_GRANT_DRIVER2 0x00000004 +#define BGE_APE_PER_LOCK_GRANT_DRIVER3 0x00000008 + +/* APE Mutex Resources */ +#define BGE_APE_LOCK_PHY0 0 +#define BGE_APE_LOCK_GRC 1 +#define BGE_APE_LOCK_PHY1 2 +#define BGE_APE_LOCK_PHY2 3 +#define BGE_APE_LOCK_MEM 4 +#define BGE_APE_LOCK_PHY3 5 +#define BGE_APE_LOCK_GPIO 7 #define BGE_MEMWIN_READ(sc, x, val) \ do { \ @@ -2659,7 +2789,7 @@ struct bge_gib { #define BGE_INC(x, y) (x) = (x + 1) % y /* - * Register access macros. The Tigon always uses memory mapped register + * BAR0 MAC register access macros. The Tigon always uses memory mapped register * accesses and all registers must be accessed with 32 bit operations. */ @@ -2674,6 +2804,18 @@ struct bge_gib { #define BGE_CLRBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) & ~(x))) +/* BAR2 APE register access macros. */ +#define APE_WRITE_4(sc, reg, val) \ + bus_write_4(sc->bge_res2, reg, val) + +#define APE_READ_4(sc, reg) \ + bus_read_4(sc->bge_res2, reg) + +#define APE_SETBIT(sc, reg, x) \ + APE_WRITE_4(sc, reg, (APE_READ_4(sc, reg) | (x))) +#define APE_CLRBIT(sc, reg, x) \ + APE_WRITE_4(sc, reg, (APE_READ_4(sc, reg) & ~(x))) + #define PCI_SETBIT(dev, reg, x, s) \ pci_write_config(dev, reg, (pci_read_config(dev, reg, s) | (x)), s) #define PCI_CLRBIT(dev, reg, x, s) \ @@ -2800,7 +2942,8 @@ struct bge_softc { device_t bge_miibus; void *bge_intrhand; struct resource *bge_irq; - struct resource *bge_res; + struct resource *bge_res; /* MAC mapped I/O */ + struct resource *bge_res2; /* APE mapped I/O */ struct ifmedia bge_ifmedia; /* TBI media info */ int bge_expcap; int bge_expmrq; @@ -2814,6 +2957,7 @@ struct bge_softc { #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_CPMU_PRESENT 0x00000020 #define BGE_FLAG_TAGGED_STATUS 0x00000040 +#define BGE_FLAG_APE 0x00000080 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 @@ -2833,6 +2977,13 @@ struct bge_softc { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:29: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 2D5F588D; Mon, 26 Nov 2012 04:29:48 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1273D8FC15; Mon, 26 Nov 2012 04:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4TlpY093988; Mon, 26 Nov 2012 04:29:47 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4Tlqw093986; Mon, 26 Nov 2012 04:29:47 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201211260429.qAQ4Tlqw093986@svn.freebsd.org> From: Davide Italiano Date: Mon, 26 Nov 2012 04:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243548 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:29:48 -0000 Author: davide Date: Mon Nov 26 04:29:47 2012 New Revision: 243548 URL: http://svnweb.freebsd.org/changeset/base/243548 Log: - smbfs_rename() might return an error value without correctly upgrading the vnode use count, and this might cause the kernel to panic if compiled with WITNESS enable. - Be sure to put the '\0' terminator to the rpath string. Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Mon Nov 26 04:26:27 2012 (r243547) +++ head/sys/fs/smbfs/smbfs_node.c Mon Nov 26 04:29:47 2012 (r243548) @@ -187,6 +187,7 @@ smbfs_node_alloc(struct mount *mp, struc bcopy(name, p, nmlen); p += nmlen; } + *p = '\0'; MPASS(p == rpath + rplen); lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); /* Vnode initialization */ Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Mon Nov 26 04:26:27 2012 (r243547) +++ head/sys/fs/smbfs/smbfs_vnops.c Mon Nov 26 04:29:47 2012 (r243548) @@ -583,12 +583,12 @@ smbfs_rename(ap) /* Check for cross-device rename */ if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { - return EXDEV; + error = EXDEV; goto out; } if (tvp && vrefcnt(tvp) > 1) { - return EBUSY; + error = EBUSY; goto out; } flags = 0x10; /* verify all writes */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:34:06 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 62426A41; Mon, 26 Nov 2012 04:34:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF788FC15; Mon, 26 Nov 2012 04:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4Y6wZ094861; Mon, 26 Nov 2012 04:34:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4Y6Cx094859; Mon, 26 Nov 2012 04:34:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260434.qAQ4Y6Cx094859@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243549 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:34:06 -0000 Author: yongari Date: Mon Nov 26 04:34:05 2012 New Revision: 243549 URL: http://svnweb.freebsd.org/changeset/base/243549 Log: MFC r241983-241985: r241983: Do not hardcode phy address. Multi-port controllers use different phy address. r241984: Ethernet@WireSpeed is defined for 1000baseT adapter to establish a link at a lower speed so enabling it for fiber adapters is wrong. Fix the issue by setting BGE_PHY_NO_WIRESPEED such that brgphy(4) wouldn't enable the feature. While I'm here move PHY specific feature/bug configuration to new location(just before mii attach) for readability. r241985: For fast ethernet controllers, Ethernet@WireSpeed is not defined so explicitly set BGE_PHY_NO_WIRESPEED flag. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:29:47 2012 (r243548) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:34:05 2012 (r243549) @@ -3240,7 +3240,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, msicount, phy_addr, reg, rid, trys; + int capmask, error, msicount, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -3300,7 +3300,7 @@ bge_attach(device_t dev) sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ - phy_addr = 1; + sc->bge_phy_addr = 1; /* * PHY address mapping for various devices. * @@ -3329,29 +3329,18 @@ bge_attach(device_t dev) if (sc->bge_chipid != BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & BGE_SGDIGSTS_IS_SERDES) - phy_addr = sc->bge_func_addr + 8; + sc->bge_phy_addr = sc->bge_func_addr + 8; else - phy_addr = sc->bge_func_addr + 1; + sc->bge_phy_addr = sc->bge_func_addr + 1; } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) - phy_addr = sc->bge_func_addr + 8; + sc->bge_phy_addr = sc->bge_func_addr + 8; else - phy_addr = sc->bge_func_addr + 1; + sc->bge_phy_addr = sc->bge_func_addr + 1; } } - /* - * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the - * 5705 A0 and A1 chips. - */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || - (sc->bge_asicrev == BGE_ASICREV_BCM5705 && - (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A1)) || - sc->bge_asicrev == BGE_ASICREV_BCM5906) - sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; - if (bge_has_eaddr(sc)) sc->bge_flags |= BGE_FLAG_EADDR; @@ -3436,38 +3425,6 @@ bge_attach(device_t dev) /* Add SYSCTLs, requires the chipset family to be set. */ bge_add_sysctls(sc); - /* Set various PHY bug flags. */ - if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || - sc->bge_chipid == BGE_CHIPID_BCM5701_B0) - sc->bge_phy_flags |= BGE_PHY_CRC_BUG; - if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || - sc->bge_chiprev == BGE_CHIPREV_5704_AX) - sc->bge_phy_flags |= BGE_PHY_ADC_BUG; - if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) - sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; - if (pci_get_subvendor(dev) == DELL_VENDORID) - sc->bge_phy_flags |= BGE_PHY_NO_3LED; - if ((BGE_IS_5705_PLUS(sc)) && - sc->bge_asicrev != BGE_ASICREV_BCM5906 && - sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM5719 && - sc->bge_asicrev != BGE_ASICREV_BCM5720 && - sc->bge_asicrev != BGE_ASICREV_BCM5785 && - sc->bge_asicrev != BGE_ASICREV_BCM57765 && - sc->bge_asicrev != BGE_ASICREV_BCM57780) { - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5761 || - sc->bge_asicrev == BGE_ASICREV_BCM5784 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { - if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && - pci_get_device(dev) != BCOM_DEVICEID_BCM5756) - sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; - if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) - sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; - } else - sc->bge_phy_flags |= BGE_PHY_BER_BUG; - } - /* Identify the chips that use an CPMU. */ if (BGE_IS_5717_PLUS(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -3528,6 +3485,7 @@ bge_attach(device_t dev) sc->bge_asicrev == BGE_ASICREV_BCM5906) { /* These chips are 10/100 only. */ capmask &= ~BMSR_EXTSTAT; + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; } /* @@ -3785,12 +3743,55 @@ bge_attach(device_t dev) /* The SysKonnect SK-9D41 is a 1000baseSX card. */ if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { - if (BGE_IS_5705_PLUS(sc)) + if (BGE_IS_5705_PLUS(sc)) { sc->bge_flags |= BGE_FLAG_MII_SERDES; - else + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; + } else sc->bge_flags |= BGE_FLAG_TBI; } + /* Set various PHY bug flags. */ + if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || + sc->bge_chipid == BGE_CHIPID_BCM5701_B0) + sc->bge_phy_flags |= BGE_PHY_CRC_BUG; + if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || + sc->bge_chiprev == BGE_CHIPREV_5704_AX) + sc->bge_phy_flags |= BGE_PHY_ADC_BUG; + if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) + sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; + if (pci_get_subvendor(dev) == DELL_VENDORID) + sc->bge_phy_flags |= BGE_PHY_NO_3LED; + if ((BGE_IS_5705_PLUS(sc)) && + sc->bge_asicrev != BGE_ASICREV_BCM5906 && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5719 && + sc->bge_asicrev != BGE_ASICREV_BCM5720 && + sc->bge_asicrev != BGE_ASICREV_BCM5785 && + sc->bge_asicrev != BGE_ASICREV_BCM57765 && + sc->bge_asicrev != BGE_ASICREV_BCM57780) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5787) { + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5756) + sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; + if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) + sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; + } else + sc->bge_phy_flags |= BGE_PHY_BER_BUG; + } + + /* + * Don't enable Ethernet@WireSpeed for the 5700 or the + * 5705 A0 and A1 chips. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || + (sc->bge_asicrev == BGE_ASICREV_BCM5705 && + (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && + sc->bge_chipid != BGE_CHIPID_BCM5705_A1))) + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; + if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, bge_ifmedia_sts); @@ -3814,13 +3815,13 @@ again: bge_asf_driver_up(sc); error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd, - bge_ifmedia_sts, capmask, phy_addr, MII_OFFSET_ANY, + bge_ifmedia_sts, capmask, sc->bge_phy_addr, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); - bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, - BMCR_RESET); + bge_miibus_writereg(sc->bge_dev, + sc->bge_phy_addr, MII_BMCR, BMCR_RESET); goto again; } device_printf(sc->bge_dev, "attaching PHYs failed\n"); @@ -6042,9 +6043,10 @@ bge_link_upd(struct bge_softc *sc) /* Clear the interrupt. */ CSR_WRITE_4(sc, BGE_MAC_EVT_ENB, BGE_EVTENB_MI_INTERRUPT); - bge_miibus_readreg(sc->bge_dev, 1, BRGPHY_MII_ISR); - bge_miibus_writereg(sc->bge_dev, 1, BRGPHY_MII_IMR, - BRGPHY_INTRS); + bge_miibus_readreg(sc->bge_dev, sc->bge_phy_addr, + BRGPHY_MII_ISR); + bge_miibus_writereg(sc->bge_dev, sc->bge_phy_addr, + BRGPHY_MII_IMR, BRGPHY_INTRS); } return; } Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:29:47 2012 (r243548) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Nov 26 04:34:05 2012 (r243549) @@ -2984,6 +2984,7 @@ struct bge_softc { #define BGE_MFW_TYPE_DASH 0x00000008 int bge_phy_ape_lock; int bge_func_addr; + int bge_phy_addr; uint32_t bge_phy_flags; #define BGE_PHY_NO_WIRESPEED 0x00000001 #define BGE_PHY_ADC_BUG 0x00000002 From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:34: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 20E6FBAA; Mon, 26 Nov 2012 04:34:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 064158FC13; Mon, 26 Nov 2012 04:34:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4Yrps095030; Mon, 26 Nov 2012 04:34:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4YrDV095028; Mon, 26 Nov 2012 04:34:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260434.qAQ4YrDV095028@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243550 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:34:54 -0000 Author: yongari Date: Mon Nov 26 04:34:53 2012 New Revision: 243550 URL: http://svnweb.freebsd.org/changeset/base/243550 Log: MFC r241983-241985: r241983: Do not hardcode phy address. Multi-port controllers use different phy address. r241984: Ethernet@WireSpeed is defined for 1000baseT adapter to establish a link at a lower speed so enabling it for fiber adapters is wrong. Fix the issue by setting BGE_PHY_NO_WIRESPEED such that brgphy(4) wouldn't enable the feature. While I'm here move PHY specific feature/bug configuration to new location(just before mii attach) for readability. r241985: For fast ethernet controllers, Ethernet@WireSpeed is not defined so explicitly set BGE_PHY_NO_WIRESPEED flag. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:34:05 2012 (r243549) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:34:53 2012 (r243550) @@ -3240,7 +3240,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, msicount, phy_addr, reg, rid, trys; + int capmask, error, msicount, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -3300,7 +3300,7 @@ bge_attach(device_t dev) sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ - phy_addr = 1; + sc->bge_phy_addr = 1; /* * PHY address mapping for various devices. * @@ -3329,29 +3329,18 @@ bge_attach(device_t dev) if (sc->bge_chipid != BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & BGE_SGDIGSTS_IS_SERDES) - phy_addr = sc->bge_func_addr + 8; + sc->bge_phy_addr = sc->bge_func_addr + 8; else - phy_addr = sc->bge_func_addr + 1; + sc->bge_phy_addr = sc->bge_func_addr + 1; } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) - phy_addr = sc->bge_func_addr + 8; + sc->bge_phy_addr = sc->bge_func_addr + 8; else - phy_addr = sc->bge_func_addr + 1; + sc->bge_phy_addr = sc->bge_func_addr + 1; } } - /* - * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the - * 5705 A0 and A1 chips. - */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || - (sc->bge_asicrev == BGE_ASICREV_BCM5705 && - (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A1)) || - sc->bge_asicrev == BGE_ASICREV_BCM5906) - sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; - if (bge_has_eaddr(sc)) sc->bge_flags |= BGE_FLAG_EADDR; @@ -3436,38 +3425,6 @@ bge_attach(device_t dev) /* Add SYSCTLs, requires the chipset family to be set. */ bge_add_sysctls(sc); - /* Set various PHY bug flags. */ - if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || - sc->bge_chipid == BGE_CHIPID_BCM5701_B0) - sc->bge_phy_flags |= BGE_PHY_CRC_BUG; - if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || - sc->bge_chiprev == BGE_CHIPREV_5704_AX) - sc->bge_phy_flags |= BGE_PHY_ADC_BUG; - if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) - sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; - if (pci_get_subvendor(dev) == DELL_VENDORID) - sc->bge_phy_flags |= BGE_PHY_NO_3LED; - if ((BGE_IS_5705_PLUS(sc)) && - sc->bge_asicrev != BGE_ASICREV_BCM5906 && - sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM5719 && - sc->bge_asicrev != BGE_ASICREV_BCM5720 && - sc->bge_asicrev != BGE_ASICREV_BCM5785 && - sc->bge_asicrev != BGE_ASICREV_BCM57765 && - sc->bge_asicrev != BGE_ASICREV_BCM57780) { - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5761 || - sc->bge_asicrev == BGE_ASICREV_BCM5784 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { - if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && - pci_get_device(dev) != BCOM_DEVICEID_BCM5756) - sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; - if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) - sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; - } else - sc->bge_phy_flags |= BGE_PHY_BER_BUG; - } - /* Identify the chips that use an CPMU. */ if (BGE_IS_5717_PLUS(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -3528,6 +3485,7 @@ bge_attach(device_t dev) sc->bge_asicrev == BGE_ASICREV_BCM5906) { /* These chips are 10/100 only. */ capmask &= ~BMSR_EXTSTAT; + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; } /* @@ -3785,12 +3743,55 @@ bge_attach(device_t dev) /* The SysKonnect SK-9D41 is a 1000baseSX card. */ if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { - if (BGE_IS_5705_PLUS(sc)) + if (BGE_IS_5705_PLUS(sc)) { sc->bge_flags |= BGE_FLAG_MII_SERDES; - else + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; + } else sc->bge_flags |= BGE_FLAG_TBI; } + /* Set various PHY bug flags. */ + if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || + sc->bge_chipid == BGE_CHIPID_BCM5701_B0) + sc->bge_phy_flags |= BGE_PHY_CRC_BUG; + if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || + sc->bge_chiprev == BGE_CHIPREV_5704_AX) + sc->bge_phy_flags |= BGE_PHY_ADC_BUG; + if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) + sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; + if (pci_get_subvendor(dev) == DELL_VENDORID) + sc->bge_phy_flags |= BGE_PHY_NO_3LED; + if ((BGE_IS_5705_PLUS(sc)) && + sc->bge_asicrev != BGE_ASICREV_BCM5906 && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5719 && + sc->bge_asicrev != BGE_ASICREV_BCM5720 && + sc->bge_asicrev != BGE_ASICREV_BCM5785 && + sc->bge_asicrev != BGE_ASICREV_BCM57765 && + sc->bge_asicrev != BGE_ASICREV_BCM57780) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5787) { + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5756) + sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; + if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) + sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; + } else + sc->bge_phy_flags |= BGE_PHY_BER_BUG; + } + + /* + * Don't enable Ethernet@WireSpeed for the 5700 or the + * 5705 A0 and A1 chips. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || + (sc->bge_asicrev == BGE_ASICREV_BCM5705 && + (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && + sc->bge_chipid != BGE_CHIPID_BCM5705_A1))) + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; + if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, bge_ifmedia_sts); @@ -3814,13 +3815,13 @@ again: bge_asf_driver_up(sc); error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd, - bge_ifmedia_sts, capmask, phy_addr, MII_OFFSET_ANY, + bge_ifmedia_sts, capmask, sc->bge_phy_addr, MII_OFFSET_ANY, MIIF_DOPAUSE | MIIF_FORCEPAUSE); if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); - bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, - BMCR_RESET); + bge_miibus_writereg(sc->bge_dev, + sc->bge_phy_addr, MII_BMCR, BMCR_RESET); goto again; } device_printf(sc->bge_dev, "attaching PHYs failed\n"); @@ -6042,9 +6043,10 @@ bge_link_upd(struct bge_softc *sc) /* Clear the interrupt. */ CSR_WRITE_4(sc, BGE_MAC_EVT_ENB, BGE_EVTENB_MI_INTERRUPT); - bge_miibus_readreg(sc->bge_dev, 1, BRGPHY_MII_ISR); - bge_miibus_writereg(sc->bge_dev, 1, BRGPHY_MII_IMR, - BRGPHY_INTRS); + bge_miibus_readreg(sc->bge_dev, sc->bge_phy_addr, + BRGPHY_MII_ISR); + bge_miibus_writereg(sc->bge_dev, sc->bge_phy_addr, + BRGPHY_MII_IMR, BRGPHY_INTRS); } return; } Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 04:34:05 2012 (r243549) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Nov 26 04:34:53 2012 (r243550) @@ -2984,6 +2984,7 @@ struct bge_softc { #define BGE_MFW_TYPE_DASH 0x00000008 int bge_phy_ape_lock; int bge_func_addr; + int bge_phy_addr; uint32_t bge_phy_flags; #define BGE_PHY_NO_WIRESPEED 0x00000001 #define BGE_PHY_ADC_BUG 0x00000002 From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:39: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 122F6DF7; Mon, 26 Nov 2012 04:39:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D16918FC13; Mon, 26 Nov 2012 04:39:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4dfNb095976; Mon, 26 Nov 2012 04:39:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4df9d095975; Mon, 26 Nov 2012 04:39:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260439.qAQ4df9d095975@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243551 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:39:42 -0000 Author: yongari Date: Mon Nov 26 04:39:41 2012 New Revision: 243551 URL: http://svnweb.freebsd.org/changeset/base/243551 Log: MFC r242426: TCP/UDP checksum offloading feature for IP fragmented datagram was removed in r99417. bge(4) controllers can do TCP checksum offload for IP fragmented datagrams but unlike ti(4), it lacks UDP checksum offloading for IP fragmented datagrams. The problem was bge(4) blindly requested TCP/UDP checksum for IP fragmented datagrams such that it resulted in corrupted UDP datagrams before r99417. Remove remaining code for TCP checksum offloading for IP fragmented datagrams which should have been removed in r99417. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:34:53 2012 (r243550) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 26 04:39:41 2012 (r243551) @@ -5128,10 +5128,6 @@ bge_encap(struct bge_softc *sc, struct m return (error); } } - if (m->m_flags & M_LASTFRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { @@ -5253,29 +5249,6 @@ bge_start_locked(struct ifnet *ifp) break; /* - * XXX - * The code inside the if() block is never reached since we - * must mark CSUM_IP_FRAGS in our if_hwassist to start getting - * requests to checksum TCP/UDP in a fragmented packet. - * - * XXX - * safety overkill. If this is a fragmented packet chain - * with delayed TCP/UDP checksums, then only encapsulate - * it if we have enough descriptors to handle the entire - * chain at once. - * (paranoia -- may not actually be needed) - */ - if (m_head->m_flags & M_FIRSTFRAG && - m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { - if ((BGE_TX_RING_CNT - sc->bge_txcnt) < - m_head->m_pkthdr.csum_data + 16) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - } - - /* * Pack the data into the transmit ring. If we * don't have room, set the OACTIVE flag and wait * for the NIC to drain the ring. From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 04:40: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 5FBB0F99; Mon, 26 Nov 2012 04:40:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6C18FC08; Mon, 26 Nov 2012 04:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ4eR2W096156; Mon, 26 Nov 2012 04:40:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ4eRXj096155; Mon, 26 Nov 2012 04:40:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211260440.qAQ4eRXj096155@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Nov 2012 04:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243552 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 04:40:27 -0000 Author: yongari Date: Mon Nov 26 04:40:26 2012 New Revision: 243552 URL: http://svnweb.freebsd.org/changeset/base/243552 Log: MFC r242426: TCP/UDP checksum offloading feature for IP fragmented datagram was removed in r99417. bge(4) controllers can do TCP checksum offload for IP fragmented datagrams but unlike ti(4), it lacks UDP checksum offloading for IP fragmented datagrams. The problem was bge(4) blindly requested TCP/UDP checksum for IP fragmented datagrams such that it resulted in corrupted UDP datagrams before r99417. Remove remaining code for TCP checksum offloading for IP fragmented datagrams which should have been removed in r99417. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:39:41 2012 (r243551) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 26 04:40:26 2012 (r243552) @@ -5128,10 +5128,6 @@ bge_encap(struct bge_softc *sc, struct m return (error); } } - if (m->m_flags & M_LASTFRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { @@ -5253,29 +5249,6 @@ bge_start_locked(struct ifnet *ifp) break; /* - * XXX - * The code inside the if() block is never reached since we - * must mark CSUM_IP_FRAGS in our if_hwassist to start getting - * requests to checksum TCP/UDP in a fragmented packet. - * - * XXX - * safety overkill. If this is a fragmented packet chain - * with delayed TCP/UDP checksums, then only encapsulate - * it if we have enough descriptors to handle the entire - * chain at once. - * (paranoia -- may not actually be needed) - */ - if (m_head->m_flags & M_FIRSTFRAG && - m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { - if ((BGE_TX_RING_CNT - sc->bge_txcnt) < - m_head->m_pkthdr.csum_data + 16) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - } - - /* * Pack the data into the transmit ring. If we * don't have room, set the OACTIVE flag and wait * for the NIC to drain the ring. From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 05:11:04 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 309053EA; Mon, 26 Nov 2012 05:11:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 090BA8FC14; Mon, 26 Nov 2012 05:11:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ5B3Km002299; Mon, 26 Nov 2012 05:11:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ5B3Dm002296; Mon, 26 Nov 2012 05:11:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260511.qAQ5B3Dm002296@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 05:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243553 - in head/usr.sbin/pkg_install: add lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 05:11:04 -0000 Author: eadler Date: Mon Nov 26 05:11:03 2012 New Revision: 243553 URL: http://svnweb.freebsd.org/changeset/base/243553 Log: Use modern license instead of being consistent with the other pkg_ tools Use a more informative message Fix some style(9) nits. Bump version number In pkg_add only warn users after the chroot is performed. Submitted by: gavin, jilles Reviewed by: beat, bapt Approved by: cperciva MFC after: 1 month Modified: head/usr.sbin/pkg_install/add/main.c head/usr.sbin/pkg_install/lib/lib.h head/usr.sbin/pkg_install/lib/pkgng.c Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Mon Nov 26 04:40:26 2012 (r243552) +++ head/usr.sbin/pkg_install/add/main.c Mon Nov 26 05:11:03 2012 (r243553) @@ -136,7 +136,6 @@ main(int argc, char **argv) static char temppackageroot[MAXPATHLEN]; static char pkgaddpath[MAXPATHLEN]; - warnpkgng(); if (*argv[0] != '/' && strchr(argv[0], '/') != NULL) PkgAddCmd = realpath(argv[0], pkgaddpath); else @@ -295,6 +294,7 @@ main(int argc, char **argv) if (chroot(".")) errx(1, "chroot to %s failed", Chroot); } + warnpkgng(); /* Make sure the sub-execs we invoke get found */ setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", Modified: head/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- head/usr.sbin/pkg_install/lib/lib.h Mon Nov 26 04:40:26 2012 (r243552) +++ head/usr.sbin/pkg_install/lib/lib.h Mon Nov 26 05:11:03 2012 (r243553) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20120918 +#define PKG_INSTALL_VERSION 20121024 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: head/usr.sbin/pkg_install/lib/pkgng.c ============================================================================== --- head/usr.sbin/pkg_install/lib/pkgng.c Mon Nov 26 04:40:26 2012 (r243552) +++ head/usr.sbin/pkg_install/lib/pkgng.c Mon Nov 26 05:11:03 2012 (r243553) @@ -1,6 +1,6 @@ -/* - * FreeBSD install - a package for the installation and maintenance - * of non-core utilities. +/*- + * Copyright (c) 2012 Eitan Adler + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,19 +11,33 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * Eitan Adler - * - * detect pkgng's existence and warn + * 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 "lib.h" #include -void warnpkgng(void) { +static const char message[] = "You appear to be using the newer pkg(1) tool on \ +this system for package management, rather than the legacy package \ +management tools (pkg_*). The legacy tools should no longer be used on \ +this system."; + +void warnpkgng(void) +{ char pkgngpath[MAXPATHLEN]; char *pkgngdir; @@ -34,5 +48,5 @@ void warnpkgng(void) { strcat(pkgngpath, "/local.sqlite"); if (access(pkgngpath, F_OK) == 0) - warnx("Don't use the pkg_ tools if you are using pkgng"); + warnx(message); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 05:11:07 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 E5CCA3EE; Mon, 26 Nov 2012 05:11:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBD898FC12; Mon, 26 Nov 2012 05:11:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ5B7Ch002354; Mon, 26 Nov 2012 05:11:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ5B7DQ002346; Mon, 26 Nov 2012 05:11:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 05:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 05:11:08 -0000 Author: eadler Date: Mon Nov 26 05:11:07 2012 New Revision: 243554 URL: http://svnweb.freebsd.org/changeset/base/243554 Log: Provide an option to users to shoot themselves in the foot. Reviewed by: bapt Approved by: cperciva MFC after: 1 month Modified: head/usr.sbin/pkg_install/add/pkg_add.1 head/usr.sbin/pkg_install/create/pkg_create.1 head/usr.sbin/pkg_install/delete/pkg_delete.1 head/usr.sbin/pkg_install/info/pkg_info.1 head/usr.sbin/pkg_install/lib/lib.h head/usr.sbin/pkg_install/lib/pkgng.c head/usr.sbin/pkg_install/updating/pkg_updating.1 head/usr.sbin/pkg_install/version/pkg_version.1 Modified: head/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- head/usr.sbin/pkg_install/add/pkg_add.1 Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/add/pkg_add.1 Mon Nov 26 05:11:07 2012 (r243554) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2009 +.Dd November 9, 2012 .Dt PKG_ADD 1 .Os .Sh NAME @@ -578,6 +578,10 @@ and are not suitable for creating the staging area. .It Pa /var/db/pkg Default location of the installed package database. +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. .El .Sh SEE ALSO .Xr pkg_create 1 , Modified: head/usr.sbin/pkg_install/create/pkg_create.1 ============================================================================== --- head/usr.sbin/pkg_install/create/pkg_create.1 Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/create/pkg_create.1 Mon Nov 26 05:11:07 2012 (r243554) @@ -23,7 +23,7 @@ .\" [jkh] Took John's changes back and made some additional extensions for .\" better integration with FreeBSD's new ports collection. .\" -.Dd Oct 12, 2010 +.Dd November 9, 2012 .Dt PKG_CREATE 1 .Os .Sh NAME @@ -635,6 +635,10 @@ does not exist. The last choice if .Pa /tmp is unsuitable. +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. .El .Sh SEE ALSO .Xr pkg_add 1 , Modified: head/usr.sbin/pkg_install/delete/pkg_delete.1 ============================================================================== --- head/usr.sbin/pkg_install/delete/pkg_delete.1 Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/delete/pkg_delete.1 Mon Nov 26 05:11:07 2012 (r243554) @@ -17,7 +17,7 @@ .\" @(#)pkg_delete.1 .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd November 9, 2012 .Dt PKG_DELETE 1 .Os .Sh NAME @@ -276,6 +276,10 @@ specifies an alternative location for th .Bl -tag -width /var/db/pkg -compact .It Pa /var/db/pkg Default location of the installed package database. +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. .El .Sh SEE ALSO .Xr pkg_add 1 , Modified: head/usr.sbin/pkg_install/info/pkg_info.1 ============================================================================== --- head/usr.sbin/pkg_install/info/pkg_info.1 Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/info/pkg_info.1 Mon Nov 26 05:11:07 2012 (r243554) @@ -17,7 +17,7 @@ .\" @(#)pkg_info.1 .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd November 9, 2012 .Dt PKG_INFO 1 .Os .Sh NAME @@ -258,6 +258,10 @@ Specifies an alternative package locatio found. .It Ev PKGDIR Specifies an alternative location to save downloaded packages to. +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. .El .Sh FILES .Bl -tag -width ".Pa /var/db/pkg" -compact @@ -277,6 +281,10 @@ The last choice if is unsuitable. .It Pa /var/db/pkg Default location of the installed package database. +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. .El .Sh SEE ALSO .Xr pkg_add 1 , Modified: head/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- head/usr.sbin/pkg_install/lib/lib.h Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/lib/lib.h Mon Nov 26 05:11:07 2012 (r243554) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20121024 +#define PKG_INSTALL_VERSION 20121109 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: head/usr.sbin/pkg_install/lib/pkgng.c ============================================================================== --- head/usr.sbin/pkg_install/lib/pkgng.c Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/lib/pkgng.c Mon Nov 26 05:11:07 2012 (r243554) @@ -40,7 +40,11 @@ void warnpkgng(void) { char pkgngpath[MAXPATHLEN]; char *pkgngdir; + char *dontwarn; + dontwarn = getenv("PKG_OLD_NOWARN"); + if (dontwarn != NULL) + return; pkgngdir = getenv("PKG_DBDIR"); if (pkgngdir == NULL) pkgngdir = "/var/db/pkg"; Modified: head/usr.sbin/pkg_install/updating/pkg_updating.1 ============================================================================== --- head/usr.sbin/pkg_install/updating/pkg_updating.1 Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/updating/pkg_updating.1 Mon Nov 26 05:11:07 2012 (r243554) @@ -10,7 +10,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd November 9, 2012 .Dt PKG_UPDATING 1 .Os .Sh NAME @@ -77,6 +77,13 @@ installed ports: Fetch UPDATING file from ftp mirror and show all entries of all installed ports: .Dl % pkg_updating -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/UPDATING +.Sh ENVRIOMENT +.Bl -tag -width indent +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. +.El .Sh SEE ALSO .Xr pkg_add 1 , .Xr pkg_create 1 , Modified: head/usr.sbin/pkg_install/version/pkg_version.1 ============================================================================== --- head/usr.sbin/pkg_install/version/pkg_version.1 Mon Nov 26 05:11:03 2012 (r243553) +++ head/usr.sbin/pkg_install/version/pkg_version.1 Mon Nov 26 05:11:07 2012 (r243554) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd November 9, 2012 .Dt PKG_VERSION 1 .Os .Sh NAME @@ -233,6 +233,13 @@ The following command compares two packa The .Fl c option has been deprecated and is no longer supported. +.Sh ENVRIOMENT +.Bl -tag -width indent +.It Ev PKG_OLD_NOWARN +If set +.Nm +will not warn about its use in the presence of pkgng databases. +.El .Sh SEE ALSO .Xr fetch 1 , .Xr pkg_add 1 , From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 05:13: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 9D3336D8; Mon, 26 Nov 2012 05:13:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 809928FC08; Mon, 26 Nov 2012 05:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ5Dv02003018; Mon, 26 Nov 2012 05:13:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ5DvRe003017; Mon, 26 Nov 2012 05:13:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260513.qAQ5DvRe003017@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 05:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243555 - stable/8/bin/mv X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 05:13:57 -0000 Author: eadler Date: Mon Nov 26 05:13:57 2012 New Revision: 243555 URL: http://svnweb.freebsd.org/changeset/base/243555 Log: MFC r243072: Follow the behavior as specified in POSIX: if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Approved by: cperciva (implicit) Modified: stable/8/bin/mv/mv.c Directory Properties: stable/8/bin/mv/ (props changed) Modified: stable/8/bin/mv/mv.c ============================================================================== --- stable/8/bin/mv/mv.c Mon Nov 26 05:11:07 2012 (r243554) +++ stable/8/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243555) @@ -199,7 +199,7 @@ do_move(const char *from, const char *to } else if (iflg) { (void)fprintf(stderr, "overwrite %s? %s", to, YESNO); ask = 1; - } else if (access(to, W_OK) && !stat(to, &sb)) { + } else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) { strmode(sb.st_mode, modep); (void)fprintf(stderr, "override %s%s%s/%s for %s? %s", modep + 1, modep[9] == ' ' ? "" : " ", From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 05:13: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 C26A66D9; Mon, 26 Nov 2012 05:13:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A57EE8FC0C; Mon, 26 Nov 2012 05:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ5DvQp003030; Mon, 26 Nov 2012 05:13:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ5Dvc9003024; Mon, 26 Nov 2012 05:13:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260513.qAQ5Dvc9003024@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 05:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243556 - stable/7/bin/mv X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 05:13:57 -0000 Author: eadler Date: Mon Nov 26 05:13:57 2012 New Revision: 243556 URL: http://svnweb.freebsd.org/changeset/base/243556 Log: MFC r243072: Follow the behavior as specified in POSIX: if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Approved by: cperciva (implicit) Modified: stable/7/bin/mv/mv.c Directory Properties: stable/7/bin/mv/ (props changed) Modified: stable/7/bin/mv/mv.c ============================================================================== --- stable/7/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243555) +++ stable/7/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243556) @@ -183,7 +183,7 @@ do_move(char *from, char *to) } else if (iflg) { (void)fprintf(stderr, "overwrite %s? %s", to, YESNO); ask = 1; - } else if (access(to, W_OK) && !stat(to, &sb)) { + } else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) { strmode(sb.st_mode, modep); (void)fprintf(stderr, "override %s%s%s/%s for %s? %s", modep + 1, modep[9] == ' ' ? "" : " ", From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 05:13: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 47F876DA; Mon, 26 Nov 2012 05:13:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE738FC12; Mon, 26 Nov 2012 05:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ5Dwfw003049; Mon, 26 Nov 2012 05:13:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ5DwZV003048; Mon, 26 Nov 2012 05:13:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211260513.qAQ5DwZV003048@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 Nov 2012 05:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243557 - stable/9/bin/mv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 05:13:58 -0000 Author: eadler Date: Mon Nov 26 05:13:57 2012 New Revision: 243557 URL: http://svnweb.freebsd.org/changeset/base/243557 Log: MFC r243072: Follow the behavior as specified in POSIX: if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Approved by: cperciva (implicit) Modified: stable/9/bin/mv/mv.c Directory Properties: stable/9/bin/mv/ (props changed) Modified: stable/9/bin/mv/mv.c ============================================================================== --- stable/9/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243556) +++ stable/9/bin/mv/mv.c Mon Nov 26 05:13:57 2012 (r243557) @@ -199,7 +199,7 @@ do_move(const char *from, const char *to } else if (iflg) { (void)fprintf(stderr, "overwrite %s? %s", to, YESNO); ask = 1; - } else if (access(to, W_OK) && !stat(to, &sb)) { + } else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) { strmode(sb.st_mode, modep); (void)fprintf(stderr, "override %s%s%s/%s for %s? %s", modep + 1, modep[9] == ' ' ? "" : " ", From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 08:50:01 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 1226A722; Mon, 26 Nov 2012 08:50:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC7BC8FC13; Mon, 26 Nov 2012 08:50:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ8o06o042208; Mon, 26 Nov 2012 08:50:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQ8o05Z042207; Mon, 26 Nov 2012 08:50:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211260850.qAQ8o05Z042207@svn.freebsd.org> From: Michael Tuexen Date: Mon, 26 Nov 2012 08:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243558 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 08:50:01 -0000 Author: tuexen Date: Mon Nov 26 08:50:00 2012 New Revision: 243558 URL: http://svnweb.freebsd.org/changeset/base/243558 Log: Allow shutdown() to be used on fds returned from sctp_peeloff(). MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Nov 26 05:13:57 2012 (r243557) +++ head/sys/netinet/sctp_usrreq.c Mon Nov 26 08:50:00 2012 (r243558) @@ -971,7 +971,8 @@ sctp_shutdown(struct socket *so) } SCTP_INP_RLOCK(inp); /* For UDP model this is a invalid call */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { + if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { /* Restore the flags that the soshutdown took away. */ SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 10:27:41 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 7E4C2825; Mon, 26 Nov 2012 10:27:41 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id 2907B8FC13; Mon, 26 Nov 2012 10:27:40 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Tcvfu-0006OW-W0; Mon, 26 Nov 2012 11:12:27 +0100 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Tcvfu-0003kq-L8; Mon, 26 Nov 2012 11:12:26 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "Martin Matuska" , "Pawel Jakub Dawidek" Subject: Re: svn commit: r243524 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys References: <201211251632.qAPGW8wd091581@svn.freebsd.org> <20121125163924.GM1460@garage.freebsd.pl> Date: Mon, 26 Nov 2012 11:12:26 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <20121125163924.GM1460@garage.freebsd.pl> User-Agent: Opera Mail/12.11 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.1 X-Scan-Signature: 919fae14bc17c74543a025539baad412 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 10:27:41 -0000 On Sun, 25 Nov 2012 17:39:24 +0100, Pawel Jakub Dawidek wrote: > On Sun, Nov 25, 2012 at 04:32:08PM +0000, Martin Matuska wrote: >> Author: mm >> Date: Sun Nov 25 16:32:07 2012 >> New Revision: 243524 >> URL: http://svnweb.freebsd.org/changeset/base/243524 >> >> Log: >> MFV r243013 and r243267: >> >> Import the zio nop-write improvement from Illumos. To reduce I/O, >> nop-write omits overwriting data if the checksum (cryptographically >> secure) of new data matches the checksum of existing data. >> It also saves space if snapshots are in use. >> >> It currently works only on datasets with enabled compression, disabled >> deduplication and sha256 checksums. >> >> IllumOS 13887:196932ec9e6a and 13888:7204b3392a58 >> 3236 zio nop-write > > This is a nice change, although I don't understand why it depends on > compression being turned on. It won't save any space. > This question is also discussed here. http://comments.gmane.org/gmane.os.illumos.zfs/200 From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 12:24:40 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 F08ADA29; Mon, 26 Nov 2012 12:24:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D32848FC08; Mon, 26 Nov 2012 12:24:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQCOdxR082857; Mon, 26 Nov 2012 12:24:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQCOd0a082854; Mon, 26 Nov 2012 12:24:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211261224.qAQCOd0a082854@svn.freebsd.org> From: Martin Matuska Date: Mon, 26 Nov 2012 12:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243560 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 12:24:40 -0000 Author: mm Date: Mon Nov 26 12:24:39 2012 New Revision: 243560 URL: http://svnweb.freebsd.org/changeset/base/243560 Log: MFV r243395: Introduce a new dataset aclmode setting "restricted" to protect ACL's being destroyed or corrupted by a drive-by chmod. illumos-gate 13889:a67716f16746 3254 add support in zfs for aclmode=restricted References: https://www.illumos.org/issues/3254 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 26 09:03:21 2012 (r243559) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 26 12:24:39 2012 (r243560) @@ -760,7 +760,7 @@ If no inheritable .Tn ACE Ns s exist that affect the mode, then the mode is set in accordance to the requested mode from the application. -.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough +.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough | restricted Controls how an .Tn ACL is modified during @@ -790,6 +790,32 @@ indicates that no changes are made to th other than creating or updating the necessary .Tn ACL entries to represent the new mode of the file or directory. +An +.Sy aclmode +property of +.Cm restricted +will cause the +.Xr chmod 2 +operation to return an error when used on any file or directory which has +a non-trivial +.Tn ACL +whose entries can not be represented by a mode. +.Xr chmod 2 +is required to change the set user ID, set group ID, or sticky bits on a file +or directory, as they do not have equivalent +.Tn ACL +entries. +In order to use +.Xr chmod 2 +on a file or directory with a non-trivial +.Tn ACL +when +.Sy aclmode +is set to +.Cm restricted , +you must first remove all +.Tn ACL +entries which do not represent the current mode. .It Sy atime Ns = Ns Cm on | off Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Nov 26 09:03:21 2012 (r243559) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Nov 26 12:24:39 2012 (r243560) @@ -109,6 +109,7 @@ zfs_prop_init(void) { "discard", ZFS_ACL_DISCARD }, { "groupmask", ZFS_ACL_GROUPMASK }, { "passthrough", ZFS_ACL_PASSTHROUGH }, + { "restricted", ZFS_ACL_RESTRICTED }, { NULL } }; @@ -217,7 +218,8 @@ zfs_prop_init(void) "hidden | visible", "SNAPDIR", snapdir_table); zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); + "discard | groupmask | passthrough | restricted", "ACLMODE", + acl_mode_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 26 09:03:21 2012 (r243559) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 26 12:24:39 2012 (r243560) @@ -3257,6 +3257,12 @@ top: uint64_t acl_obj; new_mode = (pmode & S_IFMT) | (vap->va_mode & ~S_IFMT); + if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED && + !(zp->z_pflags & ZFS_ACL_TRIVIAL)) { + err = EPERM; + goto out; + } + if (err = zfs_acl_chmod_setattr(zp, &aclp, new_mode)) goto out; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 13:16:55 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 AC63083F; Mon, 26 Nov 2012 13:16:55 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 926988FC08; Mon, 26 Nov 2012 13:16:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQDGtdw092897; Mon, 26 Nov 2012 13:16:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQDGtte092895; Mon, 26 Nov 2012 13:16:55 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211261316.qAQDGtte092895@svn.freebsd.org> From: Martin Matuska Date: Mon, 26 Nov 2012 13:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243561 - in head/cddl/contrib/opensolaris/cmd: zfs zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 13:16:55 -0000 Author: mm Date: Mon Nov 26 13:16:55 2012 New Revision: 243561 URL: http://svnweb.freebsd.org/changeset/base/243561 Log: Update manpage dates in zfs.8 and zpool.8 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 26 12:24:39 2012 (r243560) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 26 13:16:55 2012 (r243561) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2012 +.Dd November 26, 2012 .Dt ZFS 8 .Os .Sh NAME Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 26 12:24:39 2012 (r243560) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 26 13:16:55 2012 (r243561) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 28, 2011 +.Dd November 15, 2012 .Dt ZPOOL 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 15:34: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 DC1DB6DD; Mon, 26 Nov 2012 15:34:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6C408FC14; Mon, 26 Nov 2012 15:34:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQFYSft018239; Mon, 26 Nov 2012 15:34:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQFYS2i018238; Mon, 26 Nov 2012 15:34:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211261534.qAQFYS2i018238@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Nov 2012 15:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243562 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 15:34:29 -0000 Author: mav Date: Mon Nov 26 15:34:28 2012 New Revision: 243562 URL: http://svnweb.freebsd.org/changeset/base/243562 Log: MFC r238943: Add several performance optimizations to acpi_cpu_idle(). For C1 and C2 states use cpu_ticks() to measure sleep time instead of much slower ACPI timer. We can't do it for C3, as TSC may stop there. But it is less important there as wake up latency is high any way. For C1 and C2 states do not check/clear bus mastering activity status, as it is important only for C3. As side effect it can make CPU enter C2 instead of C3 if last BM activity was two sleeps back (unlike one before), but that may be even good because of collecting more statistics. Premature BM wakeup from C3, entered because of overestimation, can easily be worse then entering C2 from both performance and power consumption points of view. Together on dual Xeon E5645 system on sequential 512 bytes read test this change makes cpu_idle_acpi() as fast as simplest cpu_idle_hlt() and only few percents slower then cpu_idle_mwait(), while deeper states are still actively used during idle periods. To help with diagnostics, add C-state type into dev.cpu.X.cx_supported. PR: kern/170021 Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Mon Nov 26 13:16:55 2012 (r243561) +++ stable/9/sys/dev/acpica/acpi_cpu.c Mon Nov 26 15:34:28 2012 (r243562) @@ -876,7 +876,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); for (i = 0; i < sc->cpu_cx_count; i++) - sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); + sbuf_printf(&sb, "C%d/%d/%d ", i + 1, sc->cpu_cx_states[i].type, + sc->cpu_cx_states[i].trans_lat); sbuf_trim(&sb); sbuf_finish(&sb); } @@ -921,6 +922,7 @@ acpi_cpu_idle() { struct acpi_cpu_softc *sc; struct acpi_cx *cx_next; + uint64_t cputicks; uint32_t start_time, end_time; int bm_active, cx_next_idx, i; @@ -960,11 +962,12 @@ acpi_cpu_idle() * driver polling for new devices keeps this bit set all the * time if USB is loaded. */ - if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { + if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0 && + cx_next_idx > sc->cpu_non_c3) { AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); if (bm_active != 0) { AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); - cx_next_idx = min(cx_next_idx, sc->cpu_non_c3); + cx_next_idx = sc->cpu_non_c3; } } @@ -980,11 +983,10 @@ acpi_cpu_idle() * we are called inside critical section, delaying context switch. */ if (cx_next->type == ACPI_STATE_C1) { - AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + cputicks = cpu_ticks(); acpi_cpu_c1(); - AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - end_time = PM_USEC(acpi_TimerDelta(end_time, start_time)); - if (curthread->td_critnest == 0) + end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); + if (curthread->td_critnest == 0) end_time = min(end_time, 500000 / hz); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4; return; @@ -1008,7 +1010,13 @@ acpi_cpu_idle() * get the time very close to the CPU start/stop clock logic, this * is the only reliable time source. */ - AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + if (cx_next->type == ACPI_STATE_C3) { + AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + cputicks = 0; + } else { + start_time = 0; + cputicks = cpu_ticks(); + } CPU_GET_REG(cx_next->p_lvlx, 1); /* @@ -1018,7 +1026,11 @@ acpi_cpu_idle() * margin that we are certain to have a correct value. */ AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + if (cx_next->type == ACPI_STATE_C3) { + AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + end_time = acpi_TimerDelta(end_time, start_time); + } else + end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && @@ -1028,8 +1040,6 @@ acpi_cpu_idle() } ACPI_ENABLE_IRQS(); - /* Find the actual time asleep in microseconds. */ - end_time = acpi_TimerDelta(end_time, start_time); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 16:19: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 8BDB524D; Mon, 26 Nov 2012 16:19:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64D4C8FC14; Mon, 26 Nov 2012 16:19:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQGJSki026973; Mon, 26 Nov 2012 16:19:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQGJS3X026972; Mon, 26 Nov 2012 16:19:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211261619.qAQGJS3X026972@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Nov 2012 16:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243563 - stable/8/sys/dev/acpica X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 16:19:29 -0000 Author: mav Date: Mon Nov 26 16:19:27 2012 New Revision: 243563 URL: http://svnweb.freebsd.org/changeset/base/243563 Log: MFC r238943: Add several performance optimizations to acpi_cpu_idle(). For C1 and C2 states use cpu_ticks() to measure sleep time instead of much slower ACPI timer. We can't do it for C3, as TSC may stop there. But it is less important there as wake up latency is high any way. For C1 and C2 states do not check/clear bus mastering activity status, as it is important only for C3. As side effect it can make CPU enter C2 instead of C3 if last BM activity was two sleeps back (unlike one before), but that may be even good because of collecting more statistics. Premature BM wakeup from C3, entered because of overestimation, can easily be worse then entering C2 from both performance and power consumption points of view. Together on dual Xeon E5645 system on sequential 512 bytes read test this change makes cpu_idle_acpi() as fast as simplest cpu_idle_hlt() and only few percents slower then cpu_idle_mwait(), while deeper states are still actively used during idle periods. To help with diagnostics, add C-state type into dev.cpu.X.cx_supported. PR: kern/170021 Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/acpica/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Mon Nov 26 15:34:28 2012 (r243562) +++ stable/8/sys/dev/acpica/acpi_cpu.c Mon Nov 26 16:19:27 2012 (r243563) @@ -864,7 +864,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); for (i = 0; i < sc->cpu_cx_count; i++) { - sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); + sbuf_printf(&sb, "C%d/%d/%d ", i + 1, sc->cpu_cx_states[i].type, + sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; } @@ -912,6 +913,7 @@ acpi_cpu_idle() { struct acpi_cpu_softc *sc; struct acpi_cx *cx_next; + uint64_t cputicks; uint32_t start_time, end_time; int bm_active, cx_next_idx, i; @@ -947,11 +949,12 @@ acpi_cpu_idle() * driver polling for new devices keeps this bit set all the * time if USB is loaded. */ - if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { + if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0 && + cx_next_idx > sc->cpu_non_c3) { AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); if (bm_active != 0) { AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); - cx_next_idx = min(cx_next_idx, sc->cpu_non_c3); + cx_next_idx = sc->cpu_non_c3; } } @@ -966,12 +969,12 @@ acpi_cpu_idle() * is an ISR. Assume we slept no more then half of quantum. */ if (cx_next->type == ACPI_STATE_C1) { - AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + cputicks = cpu_ticks(); acpi_cpu_c1(); - AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - end_time = acpi_TimerDelta(end_time, start_time); - sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + - min(PM_USEC(end_time), 500000 / hz)) / 4; + end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); + if (curthread->td_critnest == 0) + end_time = min(end_time, 500000 / hz); + sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4; return; } @@ -993,7 +996,13 @@ acpi_cpu_idle() * get the time very close to the CPU start/stop clock logic, this * is the only reliable time source. */ - AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + if (cx_next->type == ACPI_STATE_C3) { + AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + cputicks = 0; + } else { + start_time = 0; + cputicks = cpu_ticks(); + } CPU_GET_REG(cx_next->p_lvlx, 1); /* @@ -1003,7 +1012,11 @@ acpi_cpu_idle() * margin that we are certain to have a correct value. */ AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + if (cx_next->type == ACPI_STATE_C3) { + AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + end_time = acpi_TimerDelta(end_time, start_time); + } else + end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && @@ -1013,8 +1026,6 @@ acpi_cpu_idle() } ACPI_ENABLE_IRQS(); - /* Find the actual time asleep in microseconds. */ - end_time = acpi_TimerDelta(end_time, start_time); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 16:43:33 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 5A52FC07; Mon, 26 Nov 2012 16:43:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 401848FC15; Mon, 26 Nov 2012 16:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQGhXPG031696; Mon, 26 Nov 2012 16:43:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQGhXnV031694; Mon, 26 Nov 2012 16:43:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211261643.qAQGhXnV031694@svn.freebsd.org> From: Michael Tuexen Date: Mon, 26 Nov 2012 16:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243564 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 16:43:33 -0000 Author: tuexen Date: Mon Nov 26 16:43:32 2012 New Revision: 243564 URL: http://svnweb.freebsd.org/changeset/base/243564 Log: Find the endpoint for an incoming packet also if the endpoint comes from sctp_peeloff(). MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Nov 26 16:19:27 2012 (r243563) +++ head/sys/netinet/sctp_pcb.c Mon Nov 26 16:43:32 2012 (r243564) @@ -1226,7 +1226,8 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(locked_tcb); } SCTP_INP_INFO_RLOCK(); - if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /*- * Now either this guy is our listener or it's the * connector. If it is the one that issued the connect, then From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 16:44:03 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 A295BD78; Mon, 26 Nov 2012 16:44:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 882898FC12; Mon, 26 Nov 2012 16:44:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQGi3rm031815; Mon, 26 Nov 2012 16:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQGi306031813; Mon, 26 Nov 2012 16:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211261644.qAQGi306031813@svn.freebsd.org> From: Michael Tuexen Date: Mon, 26 Nov 2012 16:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243565 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 16:44:03 -0000 Author: tuexen Date: Mon Nov 26 16:44:03 2012 New Revision: 243565 URL: http://svnweb.freebsd.org/changeset/base/243565 Log: Add support for sctp_peeloff() also in the front states of the association. MFC after: 3 days Modified: head/sys/netinet/sctp_peeloff.c Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Mon Nov 26 16:43:32 2012 (r243564) +++ head/sys/netinet/sctp_peeloff.c Mon Nov 26 16:44:03 2012 (r243565) @@ -74,9 +74,7 @@ sctp_can_peel_off(struct socket *head, s } state = SCTP_GET_STATE((&stcb->asoc)); if ((state == SCTP_STATE_EMPTY) || - (state == SCTP_STATE_INUSE) || - (state == SCTP_STATE_COOKIE_WAIT) || - (state == SCTP_STATE_COOKIE_ECHOED)) { + (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); return (ENOTCONN); @@ -105,9 +103,7 @@ sctp_do_peeloff(struct socket *head, str } state = SCTP_GET_STATE((&stcb->asoc)); if ((state == SCTP_STATE_EMPTY) || - (state == SCTP_STATE_INUSE) || - (state == SCTP_STATE_COOKIE_WAIT) || - (state == SCTP_STATE_COOKIE_ECHOED)) { + (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); return (ENOTCONN); From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 18:10:15 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 830E3DF5; Mon, 26 Nov 2012 18:10:15 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6769A8FC15; Mon, 26 Nov 2012 18:10:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQIAFRY043493; Mon, 26 Nov 2012 18:10:15 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQIAFRE043492; Mon, 26 Nov 2012 18:10:15 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211261810.qAQIAFRE043492@svn.freebsd.org> From: Warren Block Date: Mon, 26 Nov 2012 18:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243566 - stable/9/sbin/mdconfig X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 18:10:15 -0000 Author: wblock (doc committer) Date: Mon Nov 26 18:10:15 2012 New Revision: 243566 URL: http://svnweb.freebsd.org/changeset/base/243566 Log: MFC r242546: Add an example showing the use of gnop(8) to skip over header data. PR: kern/145999 Reviewed by: mjg Modified: stable/9/sbin/mdconfig/mdconfig.8 Directory Properties: stable/9/sbin/mdconfig/ (props changed) Modified: stable/9/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/9/sbin/mdconfig/mdconfig.8 Mon Nov 26 16:44:03 2012 (r243565) +++ stable/9/sbin/mdconfig/mdconfig.8 Mon Nov 26 18:10:15 2012 (r243566) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd November 3, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -253,6 +253,18 @@ are implied), using the first available device, and then mount the new memory disk: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt +.Pp +.Ed +Create a file-backed device from a hard disk image that begins +with 512K of raw header information. +.Xr gnop 8 +is used to skip over the header information, positioning +.Pa md1.nop +to the start of the filesystem in the image. +.Bd -literal -offset indent +mdconfig -f diskimage.img -u 1 +gnop create -o 512K md1 +mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 18:11:41 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 E001CF94; Mon, 26 Nov 2012 18:11:41 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C31138FC14; Mon, 26 Nov 2012 18:11:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQIBftT043792; Mon, 26 Nov 2012 18:11:41 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQIBfF6043791; Mon, 26 Nov 2012 18:11:41 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211261811.qAQIBfF6043791@svn.freebsd.org> From: Warren Block Date: Mon, 26 Nov 2012 18:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243567 - stable/8/sbin/mdconfig X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 18:11:42 -0000 Author: wblock (doc committer) Date: Mon Nov 26 18:11:41 2012 New Revision: 243567 URL: http://svnweb.freebsd.org/changeset/base/243567 Log: MFC r242546: Add an example showing the use of gnop(8) to skip over header data. PR: kern/145999 Reviewed by: mjg Modified: stable/8/sbin/mdconfig/mdconfig.8 Directory Properties: stable/8/sbin/mdconfig/ (props changed) Modified: stable/8/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/8/sbin/mdconfig/mdconfig.8 Mon Nov 26 18:10:15 2012 (r243566) +++ stable/8/sbin/mdconfig/mdconfig.8 Mon Nov 26 18:11:41 2012 (r243567) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd November 3, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -253,6 +253,18 @@ are implied), using the first available device, and then mount the new memory disk: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt +.Pp +.Ed +Create a file-backed device from a hard disk image that begins +with 512K of raw header information. +.Xr gnop 8 +is used to skip over the header information, positioning +.Pa md1.nop +to the start of the filesystem in the image. +.Bd -literal -offset indent +mdconfig -f diskimage.img -u 1 +gnop create -o 512K md1 +mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 19:42:39 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 7263678C; Mon, 26 Nov 2012 19:42:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5618B8FC08; Mon, 26 Nov 2012 19:42:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQJgdrX059274; Mon, 26 Nov 2012 19:42:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQJgdVQ059273; Mon, 26 Nov 2012 19:42:39 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211261942.qAQJgdVQ059273@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 26 Nov 2012 19:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243568 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 19:42:39 -0000 Author: glebius Date: Mon Nov 26 19:42:38 2012 New Revision: 243568 URL: http://svnweb.freebsd.org/changeset/base/243568 Log: Fix typo in weekly line which made it to rotated after reaching > 1 Kb. PR: conf/173857 Submitted by: Matt Smith Modified: head/etc/newsyslog.conf Modified: head/etc/newsyslog.conf ============================================================================== --- head/etc/newsyslog.conf Mon Nov 26 18:11:41 2012 (r243567) +++ head/etc/newsyslog.conf Mon Nov 26 19:42:38 2012 (r243568) @@ -35,5 +35,5 @@ /var/log/security 600 10 100 * JC /var/log/sendmail.st 640 10 * 168 B /var/log/utx.log 644 3 * @01T05 B -/var/log/weekly.log 640 5 1 $W6D0 JN +/var/log/weekly.log 640 5 * $W6D0 JN /var/log/xferlog 600 7 100 * JC From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 19:45:01 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 A9AFE995; Mon, 26 Nov 2012 19:45:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F55C8FC19; Mon, 26 Nov 2012 19:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQJj14j059729; Mon, 26 Nov 2012 19:45:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQJj1Cw059728; Mon, 26 Nov 2012 19:45:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211261945.qAQJj1Cw059728@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 26 Nov 2012 19:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243569 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 19:45:01 -0000 Author: glebius Date: Mon Nov 26 19:45:01 2012 New Revision: 243569 URL: http://svnweb.freebsd.org/changeset/base/243569 Log: Re-initialize eh pointer after m_adj() Submitted by: Kohji Okuno Reviewed by: yongari Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Nov 26 19:42:38 2012 (r243568) +++ head/sys/net/if_ethersubr.c Mon Nov 26 19:45:01 2012 (r243569) @@ -578,6 +578,7 @@ ether_input_internal(struct ifnet *ifp, bcopy((char *)evl, (char *)evl + ETHER_VLAN_ENCAP_LEN, ETHER_HDR_LEN - ETHER_TYPE_LEN); m_adj(m, ETHER_VLAN_ENCAP_LEN); + eh = mtod(m, struct ether_header *); } M_SETFIB(m, ifp->if_fib); From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 20:03: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 3F4AC146; Mon, 26 Nov 2012 20:03:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 191F88FC16; Mon, 26 Nov 2012 20:03:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQK3vQr063355; Mon, 26 Nov 2012 20:03:57 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQK3vsU063354; Mon, 26 Nov 2012 20:03:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211262003.qAQK3vsU063354@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 26 Nov 2012 20:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243570 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 20:03:58 -0000 Author: glebius Date: Mon Nov 26 20:03:57 2012 New Revision: 243570 URL: http://svnweb.freebsd.org/changeset/base/243570 Log: drbr_enqueue() awlays consumes mbuf, no matter did it fail or not. The mbuf pointer is no longer valid, so can't be reused after. Fix igb_mq_start() where mbuf pointer was used after drbr_enqueue(). This eventually leads us to all invocations of igb_mq_start_locked() called with third argument as NULL. This allows us to simplify this function. Submitted by: Karim Fodil-Lemelin Reviewed by: jfv Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Nov 26 19:45:01 2012 (r243569) +++ head/sys/dev/e1000/if_igb.c Mon Nov 26 20:03:57 2012 (r243570) @@ -181,8 +181,7 @@ static int igb_suspend(device_t); static int igb_resume(device_t); #if __FreeBSD_version >= 800000 static int igb_mq_start(struct ifnet *, struct mbuf *); -static int igb_mq_start_locked(struct ifnet *, - struct tx_ring *, struct mbuf *); +static int igb_mq_start_locked(struct ifnet *, struct tx_ring *); static void igb_qflush(struct ifnet *); static void igb_deferred_mq_start(void *, int); #else @@ -845,7 +844,7 @@ igb_resume(device_t dev) /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); + igb_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) igb_start_locked(txr, ifp); @@ -961,15 +960,14 @@ igb_mq_start(struct ifnet *ifp, struct m que = &adapter->queues[i]; if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && IGB_TX_TRYLOCK(txr)) { - struct mbuf *pm = NULL; /* ** Try to queue first to avoid ** out-of-order delivery, but ** settle for it if that fails */ - if (m && drbr_enqueue(ifp, txr->br, m)) - pm = m; - err = igb_mq_start_locked(ifp, txr, pm); + if (m) + drbr_enqueue(ifp, txr->br, m); + err = igb_mq_start_locked(ifp, txr); IGB_TX_UNLOCK(txr); } else { err = drbr_enqueue(ifp, txr->br, m); @@ -980,7 +978,7 @@ igb_mq_start(struct ifnet *ifp, struct m } static int -igb_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m) +igb_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr) { struct adapter *adapter = txr->adapter; struct mbuf *next; @@ -990,24 +988,13 @@ igb_mq_start_locked(struct ifnet *ifp, s if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || (txr->queue_status & IGB_QUEUE_DEPLETED) || - adapter->link_active == 0) { - if (m != NULL) - err = drbr_enqueue(ifp, txr->br, m); + adapter->link_active == 0) return (err); - } enq = 0; - if (m == NULL) { - next = drbr_dequeue(ifp, txr->br); - } else if (drbr_needs_enqueue(ifp, txr->br)) { - if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) - return (err); - next = drbr_dequeue(ifp, txr->br); - } else - next = m; /* Process the queue */ - while (next != NULL) { + while ((next = drbr_dequeue(ifp, txr->br)) != NULL) { if ((err = igb_xmit(txr, &next)) != 0) { if (next != NULL) err = drbr_enqueue(ifp, txr->br, next); @@ -1020,7 +1007,6 @@ igb_mq_start_locked(struct ifnet *ifp, s ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - next = drbr_dequeue(ifp, txr->br); } if (enq > 0) { /* Set the watchdog */ @@ -1046,7 +1032,7 @@ igb_deferred_mq_start(void *arg, int pen IGB_TX_LOCK(txr); if (!drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); + igb_mq_start_locked(ifp, txr); IGB_TX_UNLOCK(txr); } @@ -1398,7 +1384,7 @@ igb_handle_que(void *context, int pendin /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); + igb_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) igb_start_locked(txr, ifp); @@ -1449,7 +1435,7 @@ igb_handle_link_locked(struct adapter *a /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); + igb_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) igb_start_locked(txr, ifp); @@ -1549,7 +1535,7 @@ igb_poll(struct ifnet *ifp, enum poll_cm } while (loop-- && more); #if __FreeBSD_version >= 800000 if (!drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); + igb_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) igb_start_locked(txr, ifp); @@ -1586,7 +1572,7 @@ igb_msix_que(void *arg) /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) - igb_mq_start_locked(ifp, txr, NULL); + igb_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) igb_start_locked(txr, ifp); From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 20:07:11 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 5C2D03B6; Mon, 26 Nov 2012 20:07:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41BBA8FC15; Mon, 26 Nov 2012 20:07:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQK7B5c064110; Mon, 26 Nov 2012 20:07:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQK7Bop064109; Mon, 26 Nov 2012 20:07:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211262007.qAQK7Bop064109@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Nov 2012 20:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243571 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 20:07:11 -0000 Author: mav Date: Mon Nov 26 20:07:10 2012 New Revision: 243571 URL: http://svnweb.freebsd.org/changeset/base/243571 Log: Fix problem with the Samsung 840 PRO series SSD detection. The device reports support for SATA Asynchronous Notification in its IDENTIFY data, but returns error on attempt to enable that feature. Make SATA XPT of CAM only report these errors, but not fail the device. MFC after: 1 week Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Nov 26 20:03:57 2012 (r243570) +++ head/sys/cam/ata/ata_xpt.c Mon Nov 26 20:07:10 2012 (r243571) @@ -751,6 +751,14 @@ probedone(struct cam_periph *periph, uni goto noerror; /* + * Some Samsung SSDs report supported Asynchronous Notification, + * but return ABORT on attempt to enable it. + */ + } else if (softc->action == PROBE_SETAN && + status == CAM_ATA_STATUS_ERROR) { + goto noerror; + + /* * SES and SAF-TE SEPs have different IDENTIFY commands, * but SATA specification doesn't tell how to identify them. * Until better way found, just try another if first fail. From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 21:32: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 EE81EE39; Mon, 26 Nov 2012 21:32:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CAB578FC14; Mon, 26 Nov 2012 21:32:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQLWVhl080045; Mon, 26 Nov 2012 21:32:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQLWVlS080042; Mon, 26 Nov 2012 21:32:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211262132.qAQLWVlS080042@svn.freebsd.org> From: Dimitry Andric Date: Mon, 26 Nov 2012 21:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243572 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 21:32:32 -0000 Author: dim Date: Mon Nov 26 21:32:31 2012 New Revision: 243572 URL: http://svnweb.freebsd.org/changeset/base/243572 Log: Pull in r168610 from upstream libc++: When using libc++ headers on FreeBSD, in combination with -std=c++98, -ansi or -std=c++03, the long long type is not supported. So in this case, several functions and types, like lldiv_t, strtoll(), are not declared. This should make it possible to use the libc++ headers in c++98 mode. Note: libc++ is originally designed as a c++0x or higher library, so you should still take care when using it with c++98 or c++03. Noted by: Yamaya Takashi MFC after: 1 week Modified: head/contrib/libc++/include/__config head/contrib/libc++/include/cstdlib head/contrib/libc++/include/cwchar Modified: head/contrib/libc++/include/__config ============================================================================== --- head/contrib/libc++/include/__config Mon Nov 26 20:07:10 2012 (r243571) +++ head/contrib/libc++/include/__config Mon Nov 26 21:32:31 2012 (r243572) @@ -51,6 +51,9 @@ # define _LIBCPP_LITTLE_ENDIAN 0 # define _LIBCPP_BIG_ENDIAN 1 # endif // _BYTE_ORDER == _LITTLE_ENDIAN +# ifndef __LONG_LONG_SUPPORTED +# define _LIBCPP_HAS_NO_LONG_LONG +# endif // __LONG_LONG_SUPPORTED #endif // __FreeBSD__ #ifdef _WIN32 Modified: head/contrib/libc++/include/cstdlib ============================================================================== --- head/contrib/libc++/include/cstdlib Mon Nov 26 20:07:10 2012 (r243571) +++ head/contrib/libc++/include/cstdlib Mon Nov 26 21:32:31 2012 (r243572) @@ -97,18 +97,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD using ::size_t; using ::div_t; using ::ldiv_t; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::lldiv_t; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::atof; using ::atoi; using ::atol; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::atoll; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::strtod; using ::strtof; using ::strtold; using ::strtol; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::strtoll; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::strtoul; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::strtoull; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::rand; using ::srand; using ::calloc; @@ -125,10 +133,14 @@ using ::bsearch; using ::qsort; using ::abs; using ::labs; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::llabs; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::div; using ::ldiv; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::lldiv; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::mblen; using ::mbtowc; using ::wctomb; @@ -145,10 +157,14 @@ using ::aligned_alloc; // MSVC already has the correct prototype in #ifdef __cplusplus #if !defined(_MSC_VER) && !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} +#ifndef _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} +#endif // _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} +#ifndef _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} +#endif // _LIBCPP_HAS_NO_LONG_LONG #endif // _MSC_VER _LIBCPP_END_NAMESPACE_STD Modified: head/contrib/libc++/include/cwchar ============================================================================== --- head/contrib/libc++/include/cwchar Mon Nov 26 20:07:10 2012 (r243571) +++ head/contrib/libc++/include/cwchar Mon Nov 26 21:32:31 2012 (r243572) @@ -151,9 +151,13 @@ using ::wcstof; using ::wcstold; #endif // _MSC_VER using ::wcstol; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::wcstoll; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::wcstoul; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::wcstoull; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::wcscpy; using ::wcsncpy; using ::wcscat; From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 21:55:16 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 4ADCE527; Mon, 26 Nov 2012 21:55:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 308718FC12; Mon, 26 Nov 2012 21:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQLtGhD083629; Mon, 26 Nov 2012 21:55:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQLtGSg083627; Mon, 26 Nov 2012 21:55:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201211262155.qAQLtGSg083627@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 26 Nov 2012 21:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r243573 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 21:55:16 -0000 Author: trasz Date: Mon Nov 26 21:55:15 2012 New Revision: 243573 URL: http://svnweb.freebsd.org/changeset/base/243573 Log: Release Mateusz Guzik from mentorship. Reviewed by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Nov 26 21:32:31 2012 (r243572) +++ svnadmin/conf/mentors Mon Nov 26 21:55:15 2012 (r243573) @@ -26,7 +26,6 @@ jonathan rwatson jwd rmacklem kargl das miwi rwatson -mjg trasz monthadar adrian nork imp peterj jhb Co-mentor: grog From owner-svn-src-all@FreeBSD.ORG Mon Nov 26 23:30: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 66A35D4B; Mon, 26 Nov 2012 23:30:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C7F38FC12; Mon, 26 Nov 2012 23:30:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQNUmDO004131; Mon, 26 Nov 2012 23:30:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAQNUmba004129; Mon, 26 Nov 2012 23:30:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211262330.qAQNUmba004129@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 26 Nov 2012 23:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243575 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 23:30:48 -0000 Author: marcel Date: Mon Nov 26 23:30:47 2012 New Revision: 243575 URL: http://svnweb.freebsd.org/changeset/base/243575 Log: Unbreak building a kernel with EHCI: there's no ehci_atmelarm.c. Modified: head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Mon Nov 26 23:23:36 2012 (r243574) +++ head/sys/arm/at91/files.at91 Mon Nov 26 23:30:47 2012 (r243575) @@ -55,4 +55,3 @@ arm/at91/board_tsc4370.c optional at91_b dev/usb/controller/at91dci.c optional at91_dci dev/usb/controller/at91dci_atmelarm.c optional at91_dci dev/usb/controller/ohci_atmelarm.c optional ohci -dev/usb/controller/ehci_atmelarm.c optional ehci From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 00:02:39 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 D0B346E6; Tue, 27 Nov 2012 00:02:39 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8438FC08; Tue, 27 Nov 2012 00:02:39 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qAR02cfU096495; Mon, 26 Nov 2012 17:02:38 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qAR02ZtU037804; Mon, 26 Nov 2012 17:02:35 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r243575 - head/sys/arm/at91 From: Ian Lepore To: Marcel Moolenaar In-Reply-To: <201211262330.qAQNUmba004129@svn.freebsd.org> References: <201211262330.qAQNUmba004129@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 26 Nov 2012 17:02:35 -0700 Message-ID: <1353974555.69940.128.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 00:02:39 -0000 On Mon, 2012-11-26 at 23:30 +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Nov 26 23:30:47 2012 > New Revision: 243575 > URL: http://svnweb.freebsd.org/changeset/base/243575 > > Log: > Unbreak building a kernel with EHCI: there's no ehci_atmelarm.c. > > Modified: > head/sys/arm/at91/files.at91 > > Modified: head/sys/arm/at91/files.at91 > ============================================================================== > --- head/sys/arm/at91/files.at91 Mon Nov 26 23:23:36 2012 (r243574) > +++ head/sys/arm/at91/files.at91 Mon Nov 26 23:30:47 2012 (r243575) > @@ -55,4 +55,3 @@ arm/at91/board_tsc4370.c optional at91_b > dev/usb/controller/at91dci.c optional at91_dci > dev/usb/controller/at91dci_atmelarm.c optional at91_dci > dev/usb/controller/ohci_atmelarm.c optional ohci > -dev/usb/controller/ehci_atmelarm.c optional ehci FWIW, I do have a working ehci_atmelarm.c if anybody needs it. It's not quite ready to commit, because it relies on some other at91 changes that are also not quite ready to commit, but with a bit of manual fussing it can be made to work if you've got a need for it. -- Ian From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 00:41:40 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 4C10DE33; Tue, 27 Nov 2012 00:41:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 155358FC08; Tue, 27 Nov 2012 00:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR0fdSp022867; Tue, 27 Nov 2012 00:41:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR0fdvE022866; Tue, 27 Nov 2012 00:41:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211270041.qAR0fdvE022866@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 27 Nov 2012 00:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243576 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 00:41:40 -0000 Author: marcel Date: Tue Nov 27 00:41:39 2012 New Revision: 243576 URL: http://svnweb.freebsd.org/changeset/base/243576 Log: Don't define intr_disable and intr_restore as macros. The macros interfere with structure fields of the same name in drivers, like the intr_disable function pointer in struct cphy_ops in cxgb(4). Instead define intr_disable and intr_restore as inline functions. With intr_disable() an inline function, the I32_bit and F32_bit macros now need to be visible in MI code and given the rather poor names, this is not at all good. Define ARM_CPSR_F32 and ARM_CPSR_I32 and use that instead of F32_bit and I32_bit (resp) for now. Modified: head/sys/arm/include/cpufunc.h Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Mon Nov 26 23:30:47 2012 (r243575) +++ head/sys/arm/include/cpufunc.h Tue Nov 27 00:41:39 2012 (r243576) @@ -681,20 +681,36 @@ __set_cpsr_c(u_int bic, u_int eor) return ret; } +#define ARM_CPSR_F32 (1 << 6) /* FIQ disable */ +#define ARM_CPSR_I32 (1 << 7) /* IRQ disable */ + #define disable_interrupts(mask) \ - (__set_cpsr_c((mask) & (I32_bit | F32_bit), \ - (mask) & (I32_bit | F32_bit))) + (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), \ + (mask) & (ARM_CPSR_I32 | ARM_CPSR_F32))) #define enable_interrupts(mask) \ - (__set_cpsr_c((mask) & (I32_bit | F32_bit), 0)) + (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), 0)) #define restore_interrupts(old_cpsr) \ - (__set_cpsr_c((I32_bit | F32_bit), (old_cpsr) & (I32_bit | F32_bit))) + (__set_cpsr_c((ARM_CPSR_I32 | ARM_CPSR_F32), \ + (old_cpsr) & (ARM_CPSR_I32 | ARM_CPSR_F32))) + +static __inline register_t +intr_disable(void) +{ + register_t s; + + s = disable_interrupts(ARM_CPSR_I32 | ARM_CPSR_F32); + return (s); +} + +static __inline void +intr_restore(register_t s) +{ + + restore_interrupts(s); +} -#define intr_disable() \ - disable_interrupts(I32_bit | F32_bit) -#define intr_restore(s) \ - restore_interrupts(s) /* Functions to manipulate the CPSR. */ u_int SetCPSR(u_int bic, u_int eor); u_int GetCPSR(void); From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:05:07 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 C6446351; Tue, 27 Nov 2012 01:05:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A99C48FC13; Tue, 27 Nov 2012 01:05:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR157KO028882; Tue, 27 Nov 2012 01:05:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR157iu028881; Tue, 27 Nov 2012 01:05:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211270105.qAR157iu028881@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 27 Nov 2012 01:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243578 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:05:07 -0000 Author: marcel Date: Tue Nov 27 01:05:07 2012 New Revision: 243578 URL: http://svnweb.freebsd.org/changeset/base/243578 Log: Remove print_kernel_section_addr(). All statements in that function expand to uncompilable code when the kernel configuration contains "options DEBUG", such as it is for LINT. The toolchain is often a better approach to figure this out, as it doesn't require one to boot the kernel. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Tue Nov 27 00:42:30 2012 (r243577) +++ head/sys/arm/arm/machdep.c Tue Nov 27 01:05:07 2012 (r243578) @@ -1038,18 +1038,6 @@ print_kenv(void) } static void -print_kernel_section_addr(void) -{ - - debugf("kernel image addresses:\n"); - debugf(" kernbase = 0x%08x\n", (uint32_t)kernbase); - debugf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext); - debugf(" _edata = 0x%08x\n", (uint32_t)_edata); - debugf(" __bss_start = 0x%08x\n", (uint32_t)__bss_start); - debugf(" _end = 0x%08x\n", (uint32_t)_end); -} - -static void physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz) { int i, j, cnt; @@ -1344,7 +1332,6 @@ initarm(struct arm_boot_params *abp) debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); debugf(" boothowto = 0x%08x\n", boothowto); debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); - print_kernel_section_addr(); print_kenv(); env = getenv("kernelname"); From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:08: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 E9D134E9; Tue, 27 Nov 2012 01:08:05 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C86548FC08; Tue, 27 Nov 2012 01:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR185JT029539; Tue, 27 Nov 2012 01:08:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR185pF029538; Tue, 27 Nov 2012 01:08:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211270108.qAR185pF029538@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 27 Nov 2012 01:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243579 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:08:06 -0000 Author: marcel Date: Tue Nov 27 01:08:05 2012 New Revision: 243579 URL: http://svnweb.freebsd.org/changeset/base/243579 Log: Don't include arm/xscale/i8134x/i81342reg.h when we're compiling LINT. The definitions in i81342reg.h clash with those in i80321reg.h. Modified: head/sys/arm/arm/cpufunc.c Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Tue Nov 27 01:05:07 2012 (r243578) +++ head/sys/arm/arm/cpufunc.c Tue Nov 27 01:08:05 2012 (r243579) @@ -74,7 +74,13 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(CPU_XSCALE_81342) +/* + * Some definitions in i81342reg.h clash with i80321reg.h. + * This only happens for the LINT kernel. As it happens, + * we don't need anything from i81342reg.h that we already + * got from somewhere else during a LINT compile. + */ +#if defined(CPU_XSCALE_81342) && !defined(COMPILING_LINT) #include #endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:10:59 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 18C75675; Tue, 27 Nov 2012 01:10:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F083B8FC15; Tue, 27 Nov 2012 01:10:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1Aw9G030133; Tue, 27 Nov 2012 01:10:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1Aw7B030132; Tue, 27 Nov 2012 01:10:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211270110.qAR1Aw7B030132@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 27 Nov 2012 01:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243580 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:10:59 -0000 Author: marcel Date: Tue Nov 27 01:10:58 2012 New Revision: 243580 URL: http://svnweb.freebsd.org/changeset/base/243580 Log: Allow building LINT by defining both SAMPLE_AT_RESET on the one hand and SAMPLE_AT_RESET_{LO|HI} on the other. It doesn't matter which values they take, as long as they are defined. Modified: head/sys/arm/mv/mvreg.h Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Tue Nov 27 01:08:05 2012 (r243579) +++ head/sys/arm/mv/mvreg.h Tue Nov 27 01:10:58 2012 (r243580) @@ -336,14 +336,15 @@ #define SAMPLE_AT_RESET 0x10 #elif defined(SOC_MV_KIRKWOOD) #define SAMPLE_AT_RESET 0x30 -#elif defined(SOC_MV_DISCOVERY) +#elif defined(SOC_MV_FREY) +#define SAMPLE_AT_RESET 0x100 +#endif +#if defined(SOC_MV_DISCOVERY) #define SAMPLE_AT_RESET_LO 0x30 #define SAMPLE_AT_RESET_HI 0x34 #elif defined(SOC_MV_DOVE) #define SAMPLE_AT_RESET_LO 0x14 #define SAMPLE_AT_RESET_HI 0x18 -#elif defined(SOC_MV_FREY) -#define SAMPLE_AT_RESET 0x100 #elif defined(SOC_MV_ARMADAXP) #define SAMPLE_AT_RESET_LO 0x30 #define SAMPLE_AT_RESET_HI 0x34 From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:17:50 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 990D2844; Tue, 27 Nov 2012 01:17:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8DA8FC13; Tue, 27 Nov 2012 01:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1HoX9031357; Tue, 27 Nov 2012 01:17:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1HoAh031355; Tue, 27 Nov 2012 01:17:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211270117.qAR1HoAh031355@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 27 Nov 2012 01:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243581 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:17:50 -0000 Author: marcel Date: Tue Nov 27 01:17:50 2012 New Revision: 243581 URL: http://svnweb.freebsd.org/changeset/base/243581 Log: Add NOTES and Makefile in order to generate LINT. NOTES contains pretty much all the union of all the kernel configuration files, including all the CPU types, Marvell SOC types and at91 board types. Any device not supported (read: does not compile) has been removed, which is a fairly small set actually. As such, LINT gives us very good coverage without having to build a zillion kernels. Added: head/sys/arm/conf/Makefile (contents, props changed) head/sys/arm/conf/NOTES (contents, props changed) Added: head/sys/arm/conf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/Makefile Tue Nov 27 01:17:50 2012 (r243581) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +TARGET=arm + +.include "${.CURDIR}/../../conf/makeLINT.mk" Added: head/sys/arm/conf/NOTES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/NOTES Tue Nov 27 01:17:50 2012 (r243581) @@ -0,0 +1,90 @@ +# $FreeBSD$ + +machine arm + +cpu CPU_ARM9 +cpu CPU_ARM9E +cpu CPU_FA526 +cpu CPU_SA1100 +cpu CPU_SA1110 +cpu CPU_XSCALE_80219 +cpu CPU_XSCALE_80321 +cpu CPU_XSCALE_81342 +cpu CPU_XSCALE_IXP425 +cpu CPU_XSCALE_IXP435 +cpu CPU_XSCALE_PXA2X0 + +files "../at91/files.at91" +files "../econa/files.econa" +files "../mv/files.mv" +files "../mv/discovery/files.db78xxx" +files "../mv/kirkwood/files.kirkwood" +files "../mv/kirkwood/files.sheevaplug" +files "../mv/orion/files.db88f5xxx" +files "../mv/orion/files.ts7800" +files "../s3c2xx0/files.s3c2xx0" +files "../sa11x0/files.sa11x0" +files "../xscale/i80321/files.ep80219" +files "../xscale/i80321/files.i80219" +files "../xscale/i80321/files.i80321" +files "../xscale/i80321/files.iq31244" +files "../xscale/i8134x/files.crb" +files "../xscale/i8134x/files.i81342" +files "../xscale/ixp425/files.avila" +files "../xscale/ixp425/files.ixp425" +files "../xscale/pxa/files.pxa" + +options PHYSADDR=0x00000000 +options KERNPHYSADDR=0x00000000 +options KERNVIRTADDR=0xc0000000 + +makeoptions LDFLAGS="-zmuldefs" +makeoptions KERNPHYSADDR=0x00000000 +makeoptions KERNVIRTADDR=0xc0000000 + +options FDT + +options SOC_MV_DISCOVERY +options SOC_MV_KIRKWOOD +options SOC_MV_ORION + +device pci + +device at91_board_bwct +device at91_board_ethernut5 +device at91_board_hl200 +device at91_board_hl201 +device at91_board_kb920x +device at91_board_qila9g20 +device at91_board_sam9260ek +device at91_board_sam9g20ek +device at91_board_sam9x25ek +device at91_board_tsc4370 +device at91rm9200 +device board_ln2410sbc + +nooptions SMP +nooptions MAXCPU + +nooptions COMPAT_FREEBSD4 + +nodevice fdc +nodevice sym +nodevice ukbd + +nodevice sc +nodevice blank_saver +nodevice daemon_saver +nodevice dragon_saver +nodevice fade_saver +nodevice fire_saver +nodevice green_saver +nodevice logo_saver +nodevice rain_saver +nodevice snake_saver +nodevice star_saver +nodevice warp_saver + +nodevice pcii +nodevice snd_cmi +nodevice tnt4882 From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:28:35 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 A85B3B52; Tue, 27 Nov 2012 01:28:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B7F38FC27; Tue, 27 Nov 2012 01:28:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1SZh9033797; Tue, 27 Nov 2012 01:28:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1SZ6w033796; Tue, 27 Nov 2012 01:28:35 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211270128.qAR1SZ6w033796@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Nov 2012 01:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243582 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:28:35 -0000 Author: mjg Date: Tue Nov 27 01:28:35 2012 New Revision: 243582 URL: http://svnweb.freebsd.org/changeset/base/243582 Log: MFC r243007: enterpgrp: get rid of pgrp2 variable and use KASSERT directly on pgfind result. pgrp2 was used only for debugging, but pgrp2 = pgfind(..) was present in compiled code Modified: stable/9/sys/kern/kern_proc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Tue Nov 27 01:17:50 2012 (r243581) +++ stable/9/sys/kern/kern_proc.c Tue Nov 27 01:28:35 2012 (r243582) @@ -421,17 +421,13 @@ enterpgrp(p, pgid, pgrp, sess) struct pgrp *pgrp; struct session *sess; { - struct pgrp *pgrp2; sx_assert(&proctree_lock, SX_XLOCKED); KASSERT(pgrp != NULL, ("enterpgrp: pgrp == NULL")); KASSERT(p->p_pid == pgid, ("enterpgrp: new pgrp and pid != pgid")); - - pgrp2 = pgfind(pgid); - - KASSERT(pgrp2 == NULL, + KASSERT(pgfind(pgid) == NULL, ("enterpgrp: pgrp with pgid exists")); KASSERT(!SESS_LEADER(p), ("enterpgrp: session leader attempted setpgrp")); From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:30:13 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 3CF3ACBD; Tue, 27 Nov 2012 01:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 213F78FC0C; Tue, 27 Nov 2012 01:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1UDuf034226; Tue, 27 Nov 2012 01:30:13 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1UCnr034225; Tue, 27 Nov 2012 01:30:12 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211270130.qAR1UCnr034225@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Nov 2012 01:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243583 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:30:13 -0000 Author: mjg Date: Tue Nov 27 01:30:12 2012 New Revision: 243583 URL: http://svnweb.freebsd.org/changeset/base/243583 Log: MFC r243007: enterpgrp: get rid of pgrp2 variable and use KASSERT directly on pgfind result. pgrp2 was used only for debugging, but pgrp2 = pgfind(..) was present in compiled code Modified: stable/8/sys/kern/kern_proc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Tue Nov 27 01:28:35 2012 (r243582) +++ stable/8/sys/kern/kern_proc.c Tue Nov 27 01:30:12 2012 (r243583) @@ -414,17 +414,13 @@ enterpgrp(p, pgid, pgrp, sess) struct pgrp *pgrp; struct session *sess; { - struct pgrp *pgrp2; sx_assert(&proctree_lock, SX_XLOCKED); KASSERT(pgrp != NULL, ("enterpgrp: pgrp == NULL")); KASSERT(p->p_pid == pgid, ("enterpgrp: new pgrp and pid != pgid")); - - pgrp2 = pgfind(pgid); - - KASSERT(pgrp2 == NULL, + KASSERT(pgfind(pgid) == NULL, ("enterpgrp: pgrp with pgid exists")); KASSERT(!SESS_LEADER(p), ("enterpgrp: session leader attempted setpgrp")); From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:33:23 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 A9216E3B; Tue, 27 Nov 2012 01:33:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D05B8FC08; Tue, 27 Nov 2012 01:33:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1XNUC034989; Tue, 27 Nov 2012 01:33:23 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1XNx4034987; Tue, 27 Nov 2012 01:33:23 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211270133.qAR1XNx4034987@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Nov 2012 01:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243584 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:33:23 -0000 Author: mjg Date: Tue Nov 27 01:33:23 2012 New Revision: 243584 URL: http://svnweb.freebsd.org/changeset/base/243584 Log: MFC r243234: Fix possible fp reference leak in posix_openpt Modified: stable/9/sys/kern/tty_pts.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/tty_pts.c ============================================================================== --- stable/9/sys/kern/tty_pts.c Tue Nov 27 01:30:12 2012 (r243583) +++ stable/9/sys/kern/tty_pts.c Tue Nov 27 01:33:23 2012 (r243584) @@ -836,6 +836,7 @@ sys_posix_openpt(struct thread *td, stru error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp); if (error != 0) { fdclose(td->td_proc->p_fd, fp, fd, td); + fdrop(fp, td); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:35:30 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 6FDEDFC4; Tue, 27 Nov 2012 01:35:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5233C8FC13; Tue, 27 Nov 2012 01:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1ZUcu035538; Tue, 27 Nov 2012 01:35:30 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1ZUwf035537; Tue, 27 Nov 2012 01:35:30 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211270135.qAR1ZUwf035537@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Nov 2012 01:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243585 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:35:30 -0000 Author: mjg Date: Tue Nov 27 01:35:29 2012 New Revision: 243585 URL: http://svnweb.freebsd.org/changeset/base/243585 Log: MFC r243234: Fix possible fp reference leak in posix_openpt Modified: stable/8/sys/kern/tty_pts.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/tty_pts.c ============================================================================== --- stable/8/sys/kern/tty_pts.c Tue Nov 27 01:33:23 2012 (r243584) +++ stable/8/sys/kern/tty_pts.c Tue Nov 27 01:35:29 2012 (r243585) @@ -833,6 +833,7 @@ posix_openpt(struct thread *td, struct p error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp); if (error != 0) { fdclose(td->td_proc->p_fd, fp, fd, td); + fdrop(fp, td); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 01:59:52 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 2E9943E5; Tue, 27 Nov 2012 01:59:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11C9C8FC13; Tue, 27 Nov 2012 01:59:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR1xqkl041028; Tue, 27 Nov 2012 01:59:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR1xpsX041008; Tue, 27 Nov 2012 01:59:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211270159.qAR1xpsX041008@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 27 Nov 2012 01:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243586 - in stable/9: . sbin/ipfw share/man/man4 sys/conf sys/netinet sys/netinet6 sys/netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 01:59:52 -0000 Author: ae Date: Tue Nov 27 01:59:51 2012 New Revision: 243586 URL: http://svnweb.freebsd.org/changeset/base/243586 Log: MFC r242079: Remove the IPFIREWALL_FORWARD kernel option and make possible to turn on the related functionality in the runtime via the sysctl variable net.pfil.forward. It is turned off by default. MFC r242082: Note the removal of the IPFIREWALL_FORWARD kernel option. MFC r242463: Remove the recently added sysctl variable net.pfil.forward. Instead, add protocol specific mbuf flags M_IP_NEXTHOP and M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup only when this flag is set. Modified: stable/9/UPDATING (contents, props changed) stable/9/sbin/ipfw/ipfw.8 stable/9/share/man/man4/ipfirewall.4 stable/9/sys/conf/NOTES stable/9/sys/conf/options stable/9/sys/netinet/ip_fastfwd.c stable/9/sys/netinet/ip_input.c stable/9/sys/netinet/ip_output.c stable/9/sys/netinet/ip_var.h stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/udp_usrreq.c stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h stable/9/sys/netinet6/udp6_usrreq.c stable/9/sys/netpfil/ipfw/ip_fw2.c stable/9/sys/netpfil/ipfw/ip_fw_pfil.c stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/9/sbin/ipfw/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/UPDATING Tue Nov 27 01:59:51 2012 (r243586) @@ -10,6 +10,10 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20121102: + The IPFIREWALL_FORWARD kernel option has been removed. Its + functionality now turned on by default. + 20120913: The random(4) support for the VIA hardware random number generator (`PADLOCK') is no longer enabled unconditionally. Modified: stable/9/sbin/ipfw/ipfw.8 ============================================================================== --- stable/9/sbin/ipfw/ipfw.8 Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sbin/ipfw/ipfw.8 Tue Nov 27 01:59:51 2012 (r243586) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2012 +.Dd October 25, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -764,11 +764,6 @@ This makes the .Xr netstat 1 entry look rather weird but is intended for use with transparent proxy servers. -.Pp -To enable -.Cm fwd -a custom kernel needs to be compiled with the option -.Cd "options IPFIREWALL_FORWARD" . .It Cm nat Ar nat_nr | tablearg Pass packet to a nat instance Modified: stable/9/share/man/man4/ipfirewall.4 ============================================================================== --- stable/9/share/man/man4/ipfirewall.4 Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/share/man/man4/ipfirewall.4 Tue Nov 27 01:59:51 2012 (r243586) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2006 +.Dd October 25, 2012 .Dt IPFW 4 .Os .Sh NAME @@ -21,7 +21,6 @@ Other kernel options related to which may also be useful are: .Bd -ragged -offset indent .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT" -.Cd "options IPFIREWALL_FORWARD" .Cd "options IPFIREWALL_VERBOSE" .Cd "options IPFIREWALL_VERBOSE_LIMIT=100" .Ed @@ -72,12 +71,6 @@ from flooding system logs or causing loc This option may be set to the number of packets which will be logged on a per-entry basis before the entry is rate-limited. .Pp -Policy routing and transparent forwarding features of -.Nm -can be enabled by -.Dv IPFIREWALL_FORWARD -kernel option. -.Pp The user interface for .Nm is implemented by the Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/conf/NOTES Tue Nov 27 01:59:51 2012 (r243586) @@ -903,12 +903,6 @@ device lagg # IPDIVERT enables the divert IP sockets, used by ``ipfw divert''. It # depends on IPFIREWALL if compiled into the kernel. # -# IPFIREWALL_FORWARD enables changing of the packet destination either -# to do some sort of policy routing or transparent proxying. Used by -# ``ipfw forward''. All redirections apply to locally generated -# packets too. Because of this great care is required when -# crafting the ruleset. -# # IPFIREWALL_NAT adds support for in kernel nat in ipfw, and it requires # LIBALIAS. # @@ -925,7 +919,6 @@ options IPFIREWALL #firewall options IPFIREWALL_VERBOSE #enable logging to syslogd(8) options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default -options IPFIREWALL_FORWARD #packet destination changes options IPFIREWALL_NAT #ipfw kernel nat support options IPDIVERT #divert sockets options IPFILTER #ipfilter support Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/conf/options Tue Nov 27 01:59:51 2012 (r243586) @@ -405,7 +405,7 @@ IPFILTER_LOG opt_ipfilter.h IPFILTER_LOOKUP opt_ipfilter.h IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h -IPFIREWALL_FORWARD opt_ipfw.h +IPFIREWALL_FORWARD IPFIREWALL_NAT opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h Modified: stable/9/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/9/sys/netinet/ip_fastfwd.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_fastfwd.c Tue Nov 27 01:59:51 2012 (r243586) @@ -167,9 +167,7 @@ ip_fastforward(struct mbuf *m) u_short sum, ip_len; int error = 0; int hlen, mtu; -#ifdef IPFIREWALL_FORWARD - struct m_tag *fwd_tag; -#endif + struct m_tag *fwd_tag = NULL; /* * Are we active and forwarding packets? @@ -378,14 +376,13 @@ ip_fastforward(struct mbuf *m) * Go on with new destination address */ } -#ifdef IPFIREWALL_FORWARD + if (m->m_flags & M_FASTFWD_OURS) { /* * ipfw changed it for a local address on this host. */ goto forwardlocal; } -#endif /* IPFIREWALL_FORWARD */ passin: /* @@ -455,20 +452,13 @@ passin: /* * Destination address changed? */ -#ifndef IPFIREWALL_FORWARD - if (odest.s_addr != dest.s_addr) { -#else - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); + if (m->m_flags & M_IP_NEXTHOP) + fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); if (odest.s_addr != dest.s_addr || fwd_tag != NULL) { -#endif /* IPFIREWALL_FORWARD */ /* * Is it now for a local address on this host? */ -#ifndef IPFIREWALL_FORWARD - if (in_localip(dest)) { -#else if (m->m_flags & M_FASTFWD_OURS || in_localip(dest)) { -#endif /* IPFIREWALL_FORWARD */ forwardlocal: /* * Return packet for processing by ip_input(). @@ -483,13 +473,12 @@ forwardlocal: /* * Redo route lookup with new destination address */ -#ifdef IPFIREWALL_FORWARD if (fwd_tag) { dest.s_addr = ((struct sockaddr_in *) (fwd_tag + 1))->sin_addr.s_addr; m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } -#endif /* IPFIREWALL_FORWARD */ RTFREE(ro.ro_rt); if ((dst = ip_findroute(&ro, dest, m)) == NULL) return NULL; /* icmp unreach already sent */ Modified: stable/9/sys/netinet/ip_input.c ============================================================================== --- stable/9/sys/netinet/ip_input.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_input.c Tue Nov 27 01:59:51 2012 (r243586) @@ -516,22 +516,22 @@ tooshort: dchg = (odst.s_addr != ip->ip_dst.s_addr); ifp = m->m_pkthdr.rcvif; -#ifdef IPFIREWALL_FORWARD if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; goto ours; } - if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { - /* - * Directly ship the packet on. This allows forwarding - * packets originally destined to us to some other directly - * connected host. - */ - ip_forward(m, dchg); - return; + if (m->m_flags & M_IP_NEXTHOP) { + dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL); + if (dchg != 0) { + /* + * Directly ship the packet on. This allows + * forwarding packets originally destined to us + * to some other directly connected host. + */ + ip_forward(m, 1); + return; + } } -#endif /* IPFIREWALL_FORWARD */ - passin: /* * Process options and, if not destined for us, Modified: stable/9/sys/netinet/ip_output.c ============================================================================== --- stable/9/sys/netinet/ip_output.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_output.c Tue Nov 27 01:59:51 2012 (r243586) @@ -129,9 +129,7 @@ ip_output(struct mbuf *m, struct mbuf *o struct route iproute; struct rtentry *rte; /* cache for ro->ro_rt */ struct in_addr odst; -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag = NULL; -#endif #ifdef IPSEC int no_route_but_check_spd = 0; #endif @@ -216,11 +214,7 @@ again: ro->ro_lle = NULL; rte = NULL; } -#ifdef IPFIREWALL_FORWARD if (rte == NULL && fwd_tag == NULL) { -#else - if (rte == NULL) { -#endif bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); @@ -541,7 +535,6 @@ sendit: } } -#ifdef IPFIREWALL_FORWARD /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -562,17 +555,17 @@ sendit: goto done; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); if (ia != NULL) ifa_free(&ia->ia_ifa); goto again; } -#endif /* IPFIREWALL_FORWARD */ passout: /* 127/8 must not appear on wire - RFC1122. */ Modified: stable/9/sys/netinet/ip_var.h ============================================================================== --- stable/9/sys/netinet/ip_var.h Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/ip_var.h Tue Nov 27 01:59:51 2012 (r243586) @@ -162,6 +162,7 @@ void kmod_ipstat_dec(int statnum); * mbuf flag used by ip_fastfwd */ #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/tcp_input.c Tue Nov 27 01:59:51 2012 (r243586) @@ -575,9 +575,7 @@ tcp_input(struct mbuf *m, int off0) uint8_t sig_checked = 0; #endif uint8_t iptos = 0; -#ifdef IPFIREWALL_FORWARD - struct m_tag *fwd_tag; -#endif + struct m_tag *fwd_tag = NULL; #ifdef INET6 struct ip6_hdr *ip6 = NULL; int isipv6; @@ -791,15 +789,13 @@ findpcb: } #endif -#ifdef IPFIREWALL_FORWARD /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); -#endif /* IPFIREWALL_FORWARD */ + if (m->m_flags & M_IP_NEXTHOP) + fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); #ifdef INET6 -#ifdef IPFIREWALL_FORWARD if (isipv6 && fwd_tag != NULL) { struct sockaddr_in6 *next_hop6; @@ -825,9 +821,8 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); - } else -#endif /* IPFIREWALL_FORWARD */ - if (isipv6) { + m->m_flags &= ~M_IP_NEXTHOP; + } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, @@ -838,7 +833,6 @@ findpcb: else #endif #ifdef INET -#ifdef IPFIREWALL_FORWARD if (fwd_tag != NULL) { struct sockaddr_in *next_hop; @@ -864,8 +858,8 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else -#endif /* IPFIREWALL_FORWARD */ inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, Modified: stable/9/sys/netinet/udp_usrreq.c ============================================================================== --- stable/9/sys/netinet/udp_usrreq.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet/udp_usrreq.c Tue Nov 27 01:59:51 2012 (r243586) @@ -341,9 +341,7 @@ udp_input(struct mbuf *m, int off) int len; struct ip save_ip; struct sockaddr_in udp_in; -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif ifp = m->m_pkthdr.rcvif; UDPSTAT_INC(udps_ipackets); @@ -546,12 +544,12 @@ udp_input(struct mbuf *m, int off) /* * Locate pcb for datagram. */ -#ifdef IPFIREWALL_FORWARD + /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag != NULL) { + if ((m->m_flags & M_IP_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { struct sockaddr_in *next_hop; next_hop = (struct sockaddr_in *)(fwd_tag + 1); @@ -576,8 +574,8 @@ udp_input(struct mbuf *m, int off) } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else -#endif /* IPFIREWALL_FORWARD */ inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, ifp, m); Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_forward.c Tue Nov 27 01:59:51 2012 (r243586) @@ -108,9 +108,7 @@ ip6_forward(struct mbuf *m, int srcrt) #ifdef SCTP int sw_csum; #endif -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; #ifdef IPSEC @@ -359,9 +357,7 @@ again: dst->sin6_len = sizeof(struct sockaddr_in6); dst->sin6_family = AF_INET6; dst->sin6_addr = ip6->ip6_dst; -#ifdef IPFIREWALL_FORWARD again2: -#endif rin6.ro_rt = in6_rtalloc1((struct sockaddr *)dst, 0, 0, M_GETFIB(m)); if (rin6.ro_rt != NULL) RT_UNLOCK(rin6.ro_rt); @@ -596,7 +592,6 @@ skip_routing: goto again; /* Redo the routing table lookup. */ } -#ifdef IPFIREWALL_FORWARD /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -614,15 +609,15 @@ skip_routing: goto out; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in6 *)&rin6.ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP6_NEXTHOP; m_tag_delete(m, fwd_tag); goto again2; } -#endif /* IPFIREWALL_FORWARD */ pass: error = nd6_output(rt->rt_ifp, origifp, m, dst, rt); Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_input.c Tue Nov 27 01:59:51 2012 (r243586) @@ -626,14 +626,14 @@ ip6_input(struct mbuf *m) ip6 = mtod(m, struct ip6_hdr *); srcrt = !IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst); -#ifdef IPFIREWALL_FORWARD if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; ours = 1; deliverifp = m->m_pkthdr.rcvif; goto hbhcheck; } - if (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { + if ((m->m_flags & M_IP6_NEXTHOP) && + m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { /* * Directly ship the packet on. This allows forwarding * packets originally destined to us to some other directly @@ -642,7 +642,6 @@ ip6_input(struct mbuf *m) ip6_forward(m, 1); goto out; } -#endif /* IPFIREWALL_FORWARD */ passin: /* Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_output.c Tue Nov 27 01:59:51 2012 (r243586) @@ -257,9 +257,7 @@ ip6_output(struct mbuf *m0, struct ip6_p int segleft_org = 0; struct secpolicy *sp = NULL; #endif /* IPSEC */ -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif ip6 = mtod(m, struct ip6_hdr *); if (ip6 == NULL) { @@ -915,7 +913,6 @@ again: goto again; /* Redo the routing table lookup. */ } -#ifdef IPFIREWALL_FORWARD /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -933,15 +930,15 @@ again: goto done; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in6 *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP6_NEXTHOP; m_tag_delete(m, fwd_tag); goto again; } -#endif /* IPFIREWALL_FORWARD */ passout: /* Modified: stable/9/sys/netinet6/ip6_var.h ============================================================================== --- stable/9/sys/netinet6/ip6_var.h Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/ip6_var.h Tue Nov 27 01:59:51 2012 (r243586) @@ -285,6 +285,8 @@ struct ip6aux { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ + #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 #else Modified: stable/9/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/udp6_usrreq.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netinet6/udp6_usrreq.c Tue Nov 27 01:59:51 2012 (r243586) @@ -182,9 +182,7 @@ udp6_input(struct mbuf **mp, int *offp, int off = *offp; int plen, ulen; struct sockaddr_in6 fromsa; -#ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; -#endif uint16_t uh_sum; ifp = m->m_pkthdr.rcvif; @@ -393,12 +391,12 @@ udp6_input(struct mbuf **mp, int *offp, /* * Locate pcb for datagram. */ -#ifdef IPFIREWALL_FORWARD + /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag != NULL) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { struct sockaddr_in6 *next_hop6; next_hop6 = (struct sockaddr_in6 *)(fwd_tag + 1); @@ -424,8 +422,8 @@ udp6_input(struct mbuf **mp, int *offp, } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP6_NEXTHOP; } else -#endif /* IPFIREWALL_FORWARD */ inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src, uh->uh_sport, &ip6->ip6_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw2.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netpfil/ipfw/ip_fw2.c Tue Nov 27 01:59:51 2012 (r243586) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2532,12 +2533,6 @@ ipfw_init(void) "(+ipv6) " #endif "initialized, divert %s, nat %s, " - "rule-based forwarding " -#ifdef IPFIREWALL_FORWARD - "enabled, " -#else - "disabled, " -#endif "default to %s, logging ", #ifdef IPDIVERT "enabled", Modified: stable/9/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_pfil.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netpfil/ipfw/ip_fw_pfil.c Tue Nov 27 01:59:51 2012 (r243586) @@ -153,7 +153,7 @@ again: /* next_hop may be set by ipfw_chk */ if (args.next_hop == NULL && args.next_hop6 == NULL) break; /* pass */ -#if !defined(IPFIREWALL_FORWARD) || (!defined(INET6) && !defined(INET)) +#if (!defined(INET6) && !defined(INET)) ret = EACCES; #else { @@ -193,6 +193,7 @@ again: bcopy(args.next_hop6, (fwd_tag+1), len); if (in6_localip(&args.next_hop6->sin6_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; + (*m0)->m_flags |= M_IP6_NEXTHOP; } #endif #ifdef INET @@ -200,11 +201,12 @@ again: bcopy(args.next_hop, (fwd_tag+1), len); if (in_localip(args.next_hop->sin_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; + (*m0)->m_flags |= M_IP_NEXTHOP; } #endif m_tag_prepend(*m0, fwd_tag); } -#endif /* IPFIREWALL_FORWARD */ +#endif /* INET || INET6 */ break; case IP_FW_DENY: Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Tue Nov 27 01:35:29 2012 (r243585) +++ stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Tue Nov 27 01:59:51 2012 (r243586) @@ -710,23 +710,14 @@ check_ipfw_struct(struct ip_fw *rule, in goto check_action; case O_FORWARD_IP: -#ifdef IPFIREWALL_FORWARD if (cmdlen != F_INSN_SIZE(ipfw_insn_sa)) goto bad_size; goto check_action; -#else - return EINVAL; -#endif - #ifdef INET6 case O_FORWARD_IP6: -#ifdef IPFIREWALL_FORWARD if (cmdlen != F_INSN_SIZE(ipfw_insn_sa6)) goto bad_size; goto check_action; -#else - return (EINVAL); -#endif #endif /* INET6 */ case O_DIVERT: From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:03: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 5B2B55DF; Tue, 27 Nov 2012 02:03:42 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4005E8FC1F; Tue, 27 Nov 2012 02:03:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR23gU7042072; Tue, 27 Nov 2012 02:03:42 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR23gBR042071; Tue, 27 Nov 2012 02:03:42 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211270203.qAR23gBR042071@svn.freebsd.org> From: Juli Mallett Date: Tue, 27 Nov 2012 02:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243587 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:03:42 -0000 Author: jmallett Date: Tue Nov 27 02:03:41 2012 New Revision: 243587 URL: http://svnweb.freebsd.org/changeset/base/243587 Log: Allow this file to build on FreeBSD. Modified: head/sys/contrib/octeon-sdk/cvmx-dma-engine.c Modified: head/sys/contrib/octeon-sdk/cvmx-dma-engine.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-dma-engine.c Tue Nov 27 01:59:51 2012 (r243586) +++ head/sys/contrib/octeon-sdk/cvmx-dma-engine.c Tue Nov 27 02:03:41 2012 (r243587) @@ -65,8 +65,10 @@ #include #include #else +#if !defined(__FreeBSD__) || !defined(_KERNEL) #include "executive-config.h" #include "cvmx-config.h" +#endif #include "cvmx.h" #include "cvmx-cmd-queue.h" #include "cvmx-dma-engine.h" From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:18:41 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 AC563BB4; Tue, 27 Nov 2012 02:18:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 762648FC14; Tue, 27 Nov 2012 02:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR2Ifj0045670; Tue, 27 Nov 2012 02:18:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR2IfNF045669; Tue, 27 Nov 2012 02:18:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270218.qAR2IfNF045669@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 02:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243588 - head/sys/dev/ath/ath_hal/ar5212 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:18:41 -0000 Author: adrian Date: Tue Nov 27 02:18:41 2012 New Revision: 243588 URL: http://svnweb.freebsd.org/changeset/base/243588 Log: When programming the beacon timer configuration, be very explicit about what the maximum legal values are. The current beacon timer configuration from TDMA wraps things at HAL_BEACON_PERIOD-1 TU. For the 11a chips this is fine, but for the 11n chips it's not enough resolution. Since the 11a chips have a limit on what's "valid", just enforce this so when I do write larger values in, they get suitably wrapped before programming. Tested: * AR5413, TDMA slave Todo: * Run it for a (lot) longer on a clear channel, ensure that no strange slippages occur. * Re-validate this on STA configurations, just to be sure. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Tue Nov 27 02:03:41 2012 (r243587) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Tue Nov 27 02:18:41 2012 (r243588) @@ -46,10 +46,19 @@ ar5212SetBeaconTimers(struct ath_hal *ah { struct ath_hal_5212 *ahp = AH5212(ah); - OS_REG_WRITE(ah, AR_TIMER0, bt->bt_nexttbtt); - OS_REG_WRITE(ah, AR_TIMER1, bt->bt_nextdba); - OS_REG_WRITE(ah, AR_TIMER2, bt->bt_nextswba); - OS_REG_WRITE(ah, AR_TIMER3, bt->bt_nextatim); + /* + * Limit the timers to their specific resolutions: + * + * + Timer 0 - 0..15 0xffff TU + * + Timer 1 - 0..18 0x7ffff TU/8 + * + Timer 2 - 0..24 0x1ffffff TU/8 + * + Timer 3 - 0..15 0xffff TU + */ + OS_REG_WRITE(ah, AR_TIMER0, bt->bt_nexttbtt & 0xffff); + OS_REG_WRITE(ah, AR_TIMER1, bt->bt_nextdba & 0x7ffff); + OS_REG_WRITE(ah, AR_TIMER2, bt->bt_nextswba & 0x1ffffff); + /* XXX force nextatim to be non-zero? */ + OS_REG_WRITE(ah, AR_TIMER3, bt->bt_nextatim & 0xffff); /* * Set the Beacon register after setting all timers. */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:19:35 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 D2A74D34; Tue, 27 Nov 2012 02:19:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7A998FC12; Tue, 27 Nov 2012 02:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR2JZV0045894; Tue, 27 Nov 2012 02:19:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR2JZO6045893; Tue, 27 Nov 2012 02:19:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270219.qAR2JZO6045893@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 02:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243589 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:19:35 -0000 Author: adrian Date: Tue Nov 27 02:19:35 2012 New Revision: 243589 URL: http://svnweb.freebsd.org/changeset/base/243589 Log: Add a note about the magic values here; don't change them. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Nov 27 02:18:41 2012 (r243588) +++ head/sys/dev/ath/ath_hal/ah.h Tue Nov 27 02:19:35 2012 (r243589) @@ -777,6 +777,11 @@ typedef struct { uint32_t bs_nexttbtt; /* next beacon in TU */ uint32_t bs_nextdtim; /* next DTIM in TU */ uint32_t bs_intval; /* beacon interval+flags */ +/* + * HAL_BEACON_PERIOD, HAL_BEACON_ENA and HAL_BEACON_RESET_TSF + * are all 1:1 correspondances with the pre-11n chip AR_BEACON + * register. + */ #define HAL_BEACON_PERIOD 0x0000ffff /* beacon interval period */ #define HAL_BEACON_PERIOD_TU8 0x0007ffff /* beacon interval, tu/8 */ #define HAL_BEACON_ENA 0x00800000 /* beacon xmit enable */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:23:46 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 E3A64FC6; Tue, 27 Nov 2012 02:23:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BEC918FC08; Tue, 27 Nov 2012 02:23:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR2NjDs046879; Tue, 27 Nov 2012 02:23:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR2Nj3B046878; Tue, 27 Nov 2012 02:23:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270223.qAR2Nj3B046878@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 02:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243590 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:23:46 -0000 Author: adrian Date: Tue Nov 27 02:23:45 2012 New Revision: 243590 URL: http://svnweb.freebsd.org/changeset/base/243590 Log: Fix the TDMA nexttbtt programming for 802.11n chips. The existing logic wrapped programming nexttbtt at 65535 TU. This is not good enough for the 11n chips, whose nexttbtt register (GENERIC_TIMER_0) has an initial value from 0..2^31-1 TSF. So converting the TU to TSF had the counter wrap at (65535 << 10) TSF. Once this wrap occured, the nexttbtt value was very very low, much lower than the current TSF value. At this point, the nexttbtt timer would constantly fire, leading to the TX queue being constantly gated open.. and when this occured, the sender was not correctly transmitting in its slot but just able to continuously transmit. The master would then delay transmitting its beacon until after the air became free (which I guess would be after the burst interval, before the next burst interval would quickly follow) and that big delta in master beacon TX would start causing big swings in the slot timing adjustment. With this change, the nexttbtt value is allowed to go all the way up to the maximum value permissable by the 32 bit representation. I haven't yet tested it to that point; I really should. The AR5212 HAL now filters out values above 65535 TU for the beacon configuration (and the relevant legal values for SWBA, DBA and NEXTATIM) and the AR5416 HAL just dutifully programs in what it should. With this, TDMA is now useful on the 802.11n chips. Tested: * AR5416, AR9280 TDMA slave * AR5413 TDMA slave Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 02:19:35 2012 (r243589) +++ head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 02:23:45 2012 (r243590) @@ -281,7 +281,7 @@ ath_tdma_update(struct ieee80211_node *n struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_hal *ah = sc->sc_ah; const HAL_RATE_TABLE *rt = sc->sc_currates; - u_int64_t tsf, rstamp, nextslot, nexttbtt; + u_int64_t tsf, rstamp, nextslot, nexttbtt, nexttbtt_full; u_int32_t txtime, nextslottu; int32_t tudelta, tsfdelta; const struct ath_rx_status *rs; @@ -326,7 +326,11 @@ ath_tdma_update(struct ieee80211_node *n rt->info[rix].shortPreamble); /* NB: << 9 is to cvt to TU and /2 */ nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); - nextslottu = TSF_TO_TU(nextslot>>32, nextslot) & HAL_BEACON_PERIOD; + /* + * For 802.11n chips: nextslottu needs to be the full TSF space, + * not just 0..65535 TU. + */ + nextslottu = TSF_TO_TU(nextslot>>32, nextslot); /* * Retrieve the hardware NextTBTT in usecs @@ -350,7 +354,16 @@ ath_tdma_update(struct ieee80211_node *n * value, tsfdelta ends up becoming very negative and all * of the adjustments get very messed up. */ - nexttbtt = ath_hal_getnexttbtt(ah) % (TU_TO_TSF(HAL_BEACON_PERIOD + 1)); + + /* + * We need to track the full nexttbtt rather than having it + * truncated at HAL_BEACON_PERIOD, as programming the + * nexttbtt (and related) registers for the 11n chips is + * actually going to take the full 32 bit space, rather than + * just 0..65535 TU. + */ + nexttbtt_full = ath_hal_getnexttbtt(ah); + nexttbtt = nexttbtt_full % (TU_TO_TSF(HAL_BEACON_PERIOD + 1)); tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, @@ -371,7 +384,7 @@ ath_tdma_update(struct ieee80211_node *n TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); } - tudelta = nextslottu - TSF_TO_TU(nexttbtt >> 32, nexttbtt); + tudelta = nextslottu - TSF_TO_TU(nexttbtt_full >> 32, nexttbtt_full); /* * Copy sender's timetstamp into tdma ie so they can From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:24:06 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 708331AE; Tue, 27 Nov 2012 02:24:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BEAF8FC15; Tue, 27 Nov 2012 02:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR2O6SD047002; Tue, 27 Nov 2012 02:24:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR2O6gN047001; Tue, 27 Nov 2012 02:24:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270224.qAR2O6gN047001@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 02:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243591 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:24:06 -0000 Author: adrian Date: Tue Nov 27 02:24:05 2012 New Revision: 243591 URL: http://svnweb.freebsd.org/changeset/base/243591 Log: Add in specific TDMA logging types. Modified: head/sys/dev/ath/if_ath_alq.h Modified: head/sys/dev/ath/if_ath_alq.h ============================================================================== --- head/sys/dev/ath/if_ath_alq.h Tue Nov 27 02:23:45 2012 (r243590) +++ head/sys/dev/ath/if_ath_alq.h Tue Nov 27 02:24:05 2012 (r243591) @@ -43,6 +43,55 @@ struct if_ath_alq_init_state { #define ATH_ALQ_EDMA_RXSTATUS 3 #define ATH_ALQ_EDMA_TXDESC 4 +#define ATH_ALQ_TDMA_BEACON_STATE 5 +struct if_ath_alq_tdma_beacon_state { + uint64_t rx_tsf; /* RX TSF of beacon frame */ + uint64_t beacon_tsf; /* TSF inside beacon frame */ + uint64_t tsf64; + uint64_t nextslot_tsf; + uint32_t nextslot_tu; + uint32_t txtime; +}; + +#define ATH_ALQ_TDMA_TIMER_CONFIG 6 +struct if_ath_alq_tdma_timer_config { + uint32_t tdma_slot; + uint32_t tdma_slotlen; + uint32_t tdma_slotcnt; + uint32_t tdma_bintval; + uint32_t tdma_guard; + uint32_t tdma_scbintval; + uint32_t tdma_dbaprep; +}; + +#define ATH_ALQ_TDMA_SLOT_CALC 7 +struct if_ath_alq_tdma_slot_calc { + uint64_t nexttbtt; + uint64_t next_slot; + int32_t tsfdelta; + int32_t avg_plus; + int32_t avg_minus; +}; + +#define ATH_ALQ_TDMA_TSF_ADJUST 8 +struct if_ath_alq_tdma_tsf_adjust { + uint64_t tsf64_old; + uint64_t tsf64_new; + int32_t tsfdelta; +}; + +#define ATH_ALQ_TDMA_TIMER_SET 9 +struct if_ath_alq_tdma_timer_set { + uint32_t bt_intval; + uint32_t bt_nexttbtt; + uint32_t bt_nextdba; + uint32_t bt_nextswba; + uint32_t bt_nextatim; + uint32_t bt_flags; + uint32_t sc_tdmadbaprep; + uint32_t sc_tdmaswbaprep; +}; + /* * These will always be logged, regardless. */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:27: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 40B29341; Tue, 27 Nov 2012 02:27:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22D4A8FC13; Tue, 27 Nov 2012 02:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR2RVQv047760; Tue, 27 Nov 2012 02:27:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR2RUEB047759; Tue, 27 Nov 2012 02:27:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270227.qAR2RUEB047759@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 02:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243592 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:27:31 -0000 Author: adrian Date: Tue Nov 27 02:27:30 2012 New Revision: 243592 URL: http://svnweb.freebsd.org/changeset/base/243592 Log: Improve the TDMA debugging: * add some further debugging prints, which are quite nice to have * add in ALQ hooks (optional!) to allow for the TDMA information to be logged in-line with the TX and RX descriptor information. Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 02:24:05 2012 (r243591) +++ head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 02:27:30 2012 (r243592) @@ -115,6 +115,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ATH_DEBUG_ALQ +#include +#endif + #ifdef IEEE80211_SUPPORT_TDMA #include @@ -138,6 +142,43 @@ ath_tdma_settimers(struct ath_softc *sc, bt.bt_nextatim = nexttbtt+1; /* Enables TBTT, DBA, SWBA timers by default */ bt.bt_flags = 0; +#if 0 + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "%s: intval=%d (0x%08x) nexttbtt=%u (0x%08x), nextdba=%u (0x%08x), nextswba=%u (0x%08x),nextatim=%u (0x%08x)\n", + __func__, + bt.bt_intval, + bt.bt_intval, + bt.bt_nexttbtt, + bt.bt_nexttbtt, + bt.bt_nextdba, + bt.bt_nextdba, + bt.bt_nextswba, + bt.bt_nextswba, + bt.bt_nextatim, + bt.bt_nextatim); +#endif + + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_TIMER_SET)) { + struct if_ath_alq_tdma_timer_set t; + t.bt_intval = htobe32(bt.bt_intval); + t.bt_nexttbtt = htobe32(bt.bt_nexttbtt); + t.bt_nextdba = htobe32(bt.bt_nextdba); + t.bt_nextswba = htobe32(bt.bt_nextswba); + t.bt_nextatim = htobe32(bt.bt_nextatim); + t.bt_flags = htobe32(bt.bt_flags); + t.sc_tdmadbaprep = htobe32(sc->sc_tdmadbaprep); + t.sc_tdmaswbaprep = htobe32(sc->sc_tdmaswbaprep); + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_TIMER_SET, + sizeof(t), (char *) &t); + } + + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "%s: nexttbtt=%u (0x%08x), nexttbtt tsf=%lld (0x%08llx)\n", + __func__, + bt.bt_nexttbtt, + bt.bt_nexttbtt, + (long long) ( ((u_int64_t) (bt.bt_nexttbtt)) << 10), + (long long) ( ((u_int64_t) (bt.bt_nexttbtt)) << 10)); ath_hal_beaconsettimers(ah, &bt); } @@ -258,6 +299,23 @@ ath_tdma_config(struct ath_softc *sc, st tdma->tdma_slot, tdma->tdma_slotlen, tdma->tdma_slotcnt, tdma->tdma_bintval, sc->sc_tdmaguard, sc->sc_tdmabintval, sc->sc_tdmadbaprep); + +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_TIMER_CONFIG)) { + struct if_ath_alq_tdma_timer_config t; + + t.tdma_slot = htobe32(tdma->tdma_slot); + t.tdma_slotlen = htobe32(tdma->tdma_slotlen); + t.tdma_slotcnt = htobe32(tdma->tdma_slotcnt); + t.tdma_bintval = htobe32(tdma->tdma_bintval); + t.tdma_guard = htobe32(sc->sc_tdmaguard); + t.tdma_scbintval = htobe32(sc->sc_tdmabintval); + t.tdma_dbaprep = htobe32(sc->sc_tdmadbaprep); + + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_TIMER_CONFIG, + sizeof(t), (char *) &t); + } +#endif /* ATH_DEBUG_ALQ */ } /* @@ -326,11 +384,33 @@ ath_tdma_update(struct ieee80211_node *n rt->info[rix].shortPreamble); /* NB: << 9 is to cvt to TU and /2 */ nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); + /* * For 802.11n chips: nextslottu needs to be the full TSF space, * not just 0..65535 TU. */ nextslottu = TSF_TO_TU(nextslot>>32, nextslot); + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "rs->rstamp %llu rstamp %llu tsf %llu txtime %d, nextslot %llu, nextslottu %d, nextslottume %d\n", + (unsigned long long) rs->rs_tstamp, rstamp, tsf, txtime, nextslot, nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); + DPRINTF(sc, ATH_DEBUG_TDMA, + " beacon tstamp: %llu (0x%016llx)\n", + le64toh(ni->ni_tstamp.tsf), + le64toh(ni->ni_tstamp.tsf)); + +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE)) { + struct if_ath_alq_tdma_beacon_state t; + t.rx_tsf = htobe64(rstamp); + t.beacon_tsf = htobe64(le64toh(ni->ni_tstamp.tsf)); + t.tsf64 = htobe64(tsf); + t.nextslot_tsf = htobe64(nextslot); + t.nextslot_tu = htobe32(nextslottu); + t.txtime = htobe32(txtime); + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE, + sizeof(t), (char *) &t); + } +#endif /* * Retrieve the hardware NextTBTT in usecs @@ -354,7 +434,7 @@ ath_tdma_update(struct ieee80211_node *n * value, tsfdelta ends up becoming very negative and all * of the adjustments get very messed up. */ - + /* * We need to track the full nexttbtt rather than having it * truncated at HAL_BEACON_PERIOD, as programming the @@ -367,9 +447,27 @@ ath_tdma_update(struct ieee80211_node *n tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "tsfdelta %d avg +%d/-%d\n", tsfdelta, + "nexttbtt %llu (0x%08llx) tsfdelta %d avg +%d/-%d\n", + nexttbtt, + (long long) nexttbtt, + tsfdelta, TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC)) { + struct if_ath_alq_tdma_slot_calc t; + + t.nexttbtt = htobe64(nexttbtt_full); + t.next_slot = htobe64(nextslot); + t.tsfdelta = htobe32(tsfdelta); + t.avg_plus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltap)); + t.avg_minus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltam)); + + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC, + sizeof(t), (char *) &t); + } +#endif + if (tsfdelta < 0) { TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); @@ -415,6 +513,11 @@ ath_tdma_update(struct ieee80211_node *n * This basically filters out jumps due to missed beacons. */ if (tudelta != 0 && (tudelta > 0 || -tudelta < sc->sc_tdmabintval)) { + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "%s: calling ath_tdma_settimers; nextslottu=%d, bintval=%d\n", + __func__, + nextslottu, + sc->sc_tdmabintval); ath_tdma_settimers(sc, nextslottu, sc->sc_tdmabintval); sc->sc_stats.ast_tdma_timers++; } @@ -424,6 +527,24 @@ ath_tdma_update(struct ieee80211_node *n /* XXX should just teach ath_hal_adjusttsf() to do this */ tsf = ath_hal_gettsf64(ah); ath_hal_settsf64(ah, tsf + tsfdelta); + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "%s: calling ath_hal_adjusttsf: TSF=%llu, tsfdelta=%d\n", + __func__, + tsf_1, + tsfdelta); + +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, + ATH_ALQ_TDMA_TSF_ADJUST)) { + struct if_ath_alq_tdma_tsf_adjust t; + + t.tsfdelta = htobe32(tsfdelta); + t.tsf64_old = htobe64(tsf_1); + t.tsf64_new = htobe64(tsf_1 + tsfdelta); + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_TSF_ADJUST, + sizeof(t), (char *) &t); + } +#endif /* ATH_DEBUG_ALQ */ sc->sc_stats.ast_tdma_tsf++; } ath_tdma_beacon_send(sc, vap); /* prepare response */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 02:28:43 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 1652A4C8; Tue, 27 Nov 2012 02:28:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED68F8FC16; Tue, 27 Nov 2012 02:28:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR2SgQ2048045; Tue, 27 Nov 2012 02:28:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR2SgGL048044; Tue, 27 Nov 2012 02:28:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270228.qAR2SgGL048044@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 02:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243593 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 02:28:43 -0000 Author: adrian Date: Tue Nov 27 02:28:42 2012 New Revision: 243593 URL: http://svnweb.freebsd.org/changeset/base/243593 Log: Add in a totally hacked up copy of the AR5416 descriptor decoding stuff, as well as TDMA related things. I used this to debug TDMA related issues in -HEAD. Added: head/tools/tools/ath/athalq/ar5416_ds_tdma.c (contents, props changed) Added: head/tools/tools/ath/athalq/ar5416_ds_tdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athalq/ar5416_ds_tdma.c Tue Nov 27 02:28:42 2012 (r243593) @@ -0,0 +1,470 @@ +/* + * Copyright (c) 2012 Adrian Chadd + * All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "ar5416_ds.h" + +#define MS(_v, _f) ( ((_v) & (_f)) >> _f##_S ) +#define MF(_v, _f) ( !! ((_v) & (_f))) + +static void +ar5416_decode_txstatus(struct if_ath_alq_payload *a) +{ + struct ar5416_desc txs; + static uint64_t tx_tsf = 0; + + /* XXX assumes txs is smaller than PAYLOAD_LEN! */ + memcpy(&txs, &a->payload, sizeof(struct ar5416_desc)); + + if (MF(txs.u.tx.status[9], AR_TxDone) == 0) + return; + + printf("[%u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x (delta %d)\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid), + MF(txs.u.tx.status[9], AR_TxDone), + txs.u.tx.status[2], + txs.u.tx.status[2] - tx_tsf); + + tx_tsf = txs.u.tx.status[2]; + +#if 0 + /* ds_txstatus0 */ + printf(" RX RSSI 0 [%d %d %d]\n", + MS(txs.u.tx.status[0], AR_TxRSSIAnt00), + MS(txs.u.tx.status[0], AR_TxRSSIAnt01), + MS(txs.u.tx.status[0], AR_TxRSSIAnt02)); + printf(" BA Valid=%d\n", + MF(txs.u.tx.status[0], AR_TxBaStatus)); + + /* ds_txstatus1 */ + printf(" Frmok=%d, xretries=%d, fifounderrun=%d, filt=%d\n", + MF(txs.u.tx.status[1], AR_FrmXmitOK), + MF(txs.u.tx.status[1], AR_ExcessiveRetries), + MF(txs.u.tx.status[1], AR_FIFOUnderrun), + MF(txs.u.tx.status[1], AR_Filtered)); + printf(" DelimUnderrun=%d, DataUnderun=%d, DescCfgErr=%d," + " TxTimerExceeded=%d\n", + MF(txs.u.tx.status[1], AR_TxDelimUnderrun), + MF(txs.u.tx.status[1], AR_TxDataUnderrun), + MF(txs.u.tx.status[1], AR_DescCfgErr), + MF(txs.u.tx.status[1], AR_TxTimerExpired)); + + printf(" RTScnt=%d, FailCnt=%d, VRetryCnt=%d\n", + MS(txs.u.tx.status[1], AR_RTSFailCnt), + MS(txs.u.tx.status[1], AR_DataFailCnt), + MS(txs.u.tx.status[1], AR_VirtRetryCnt)); + + /* ds_txstatus2 */ + printf(" TxTimestamp=0x%08x\n", txs.u.tx.status[2]); + + /* ds_txstatus3 */ + /* ds_txstatus4 */ + printf(" BALow=0x%08x\n", txs.u.tx.status[3]); + printf(" BAHigh=0x%08x\n", txs.u.tx.status[4]); + + /* ds_txstatus5 */ + printf(" RX RSSI 1 [%d %d %d] Comb=%d\n", + MS(txs.u.tx.status[5], AR_TxRSSIAnt10), + MS(txs.u.tx.status[5], AR_TxRSSIAnt11), + MS(txs.u.tx.status[5], AR_TxRSSIAnt12), + MS(txs.u.tx.status[5], AR_TxRSSICombined)); + + /* ds_txstatus6 */ + /* ds_txstatus7 */ + /* ds_txstatus8 */ + printf(" TxEVM[0]=0x%08x, TxEVM[1]=0x%08x, TxEVM[2]=0x%08x\n", + txs.u.tx.status[6], + txs.u.tx.status[7], + txs.u.tx.status[8]); + + /* ds_txstatus9 */ + printf(" TxDone=%d, SeqNum=0x%04x, TxOpExceeded=%d, FinalTsIdx=%d\n", + MF(txs.u.tx.status[9], AR_TxDone), + MS(txs.u.tx.status[9], AR_SeqNum), + MF(txs.u.tx.status[9], AR_TxOpExceeded), + MS(txs.u.tx.status[9], AR_FinalTxIdx)); + printf(" PowerMgmt=%d, TxTid=%d\n", + MF(txs.u.tx.status[9], AR_PowerMgmt), + MS(txs.u.tx.status[9], AR_TxTid)); + + printf("\n ------\n"); +#endif +} + +static void +ar5416_decode_txdesc(struct if_ath_alq_payload *a) +{ + struct ar5416_desc txc; + + /* XXX assumes txs is smaller than PAYLOAD_LEN! */ + memcpy(&txc, &a->payload, sizeof(struct ar5416_desc)); + + printf("[%u] [%llu] TXD\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid)); + +#if 0 + printf(" link=0x%08x, data=0x%08x\n", + txc.ds_link, + txc.ds_data); + + /* ds_ctl0 */ + printf(" Frame Len=%d, VMF=%d\n", + txc.ds_ctl0 & AR_FrameLen, + MF(txc.ds_ctl0, AR_VirtMoreFrag)); + printf(" TX power0=%d, RtsEna=%d, Veol=%d, ClrDstMask=%d\n", + MS(txc.ds_ctl0, AR_XmitPower), + MF(txc.ds_ctl0, AR_RTSEnable), + MF(txc.ds_ctl0, AR_VEOL), + MF(txc.ds_ctl0, AR_ClrDestMask)); + printf(" TxIntrReq=%d, DestIdxValid=%d, CtsEnable=%d\n", + MF(txc.ds_ctl0, AR_TxIntrReq), + MF(txc.ds_ctl0, AR_DestIdxValid), + MF(txc.ds_ctl0, AR_CTSEnable)); + + /* ds_ctl1 */ + printf(" BufLen=%d, TxMore=%d, DestIdx=%d," + " FrType=0x%x\n", + txc.ds_ctl1 & AR_BufLen, + MF(txc.ds_ctl1, AR_TxMore), + MS(txc.ds_ctl1, AR_DestIdx), + MS(txc.ds_ctl1, AR_FrameType)); + printf(" NoAck=%d, InsertTs=%d, CorruptFcs=%d, ExtOnly=%d," + " ExtAndCtl=%d\n", + MF(txc.ds_ctl1, AR_NoAck), + MF(txc.ds_ctl1, AR_InsertTS), + MF(txc.ds_ctl1, AR_CorruptFCS), + MF(txc.ds_ctl1, AR_ExtOnly), + MF(txc.ds_ctl1, AR_ExtAndCtl)); + printf(" MoreAggr=%d, IsAggr=%d, MoreRifs=%d\n", + MF(txc.ds_ctl1, AR_MoreAggr), + MF(txc.ds_ctl1, AR_IsAggr), + MF(txc.ds_ctl1, AR_MoreRifs)); + + /* ds_ctl2 */ + printf(" DurUpEna=%d, Burstdur=0x%04x\n", + MF(txc.ds_ctl2, AR_DurUpdateEn), + MS(txc.ds_ctl2, AR_BurstDur)); + printf(" Try0=%d, Try1=%d, Try2=%d, Try3=%d\n", + MS(txc.ds_ctl2, AR_XmitDataTries0), + MS(txc.ds_ctl2, AR_XmitDataTries1), + MS(txc.ds_ctl2, AR_XmitDataTries2), + MS(txc.ds_ctl2, AR_XmitDataTries3)); + + /* ds_ctl3 */ + printf(" rate0=0x%02x, rate1=0x%02x, rate2=0x%02x, rate3=0x%02x\n", + MS(txc.ds_ctl3, AR_XmitRate0), + MS(txc.ds_ctl3, AR_XmitRate1), + MS(txc.ds_ctl3, AR_XmitRate2), + MS(txc.ds_ctl3, AR_XmitRate3)); + + /* ds_ctl4 */ + printf(" try 0: PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl4, AR_PacketDur0), + MF(txc.ds_ctl4, AR_RTSCTSQual0)); + printf(" try 1: PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl4, AR_PacketDur1), + MF(txc.ds_ctl4, AR_RTSCTSQual1)); + + /* ds_ctl5 */ + printf(" try 2: PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl5, AR_PacketDur2), + MF(txc.ds_ctl5, AR_RTSCTSQual2)); + printf(" try 3: PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl5, AR_PacketDur3), + MF(txc.ds_ctl5, AR_RTSCTSQual3)); + + /* ds_ctl6 */ + printf(" AggrLen=%d, PadDelim=%d, EncrType=%d\n", + MS(txc.ds_ctl6, AR_AggrLen), + MS(txc.ds_ctl6, AR_PadDelim), + MS(txc.ds_ctl6, AR_EncrType)); + + /* ds_ctl7 */ + printf(" try 0: chainMask=0x%x, GI=%d, 2040=%d, STBC=%d\n", + MS(txc.ds_ctl7, AR_ChainSel0), + MF(txc.ds_ctl7, AR_GI0), + MF(txc.ds_ctl7, AR_2040_0), + MF(txc.ds_ctl7, AR_STBC0)); + printf(" try 1: chainMask=0x%x, GI=%d, 2040=%d, STBC=%d\n", + MS(txc.ds_ctl7, AR_ChainSel1), + MF(txc.ds_ctl7, AR_GI1), + MF(txc.ds_ctl7, AR_2040_1), + MF(txc.ds_ctl7, AR_STBC1)); + printf(" try 2: chainMask=0x%x, GI=%d, 2040=%d, STBC=%d\n", + MS(txc.ds_ctl7, AR_ChainSel2), + MF(txc.ds_ctl7, AR_GI2), + MF(txc.ds_ctl7, AR_2040_2), + MF(txc.ds_ctl7, AR_STBC2)); + printf(" try 3: chainMask=0x%x, GI=%d, 2040=%d, STBC=%d\n", + MS(txc.ds_ctl7, AR_ChainSel3), + MF(txc.ds_ctl7, AR_GI3), + MF(txc.ds_ctl7, AR_2040_3), + MF(txc.ds_ctl7, AR_STBC3)); + + /* ds_ctl8 */ + printf(" try 0: ant=0x%08x\n", txc.ds_ctl8 & AR_AntCtl0); + + /* ds_ctl9 */ + printf(" try 1: TxPower=%d, ant=0x%08x\n", + MS(txc.ds_ctl9, AR_XmitPower1), + txc.ds_ctl9 & AR_AntCtl1); + + /* ds_ctl10 */ + printf(" try 2: TxPower=%d, ant=0x%08x\n", + MS(txc.ds_ctl10, AR_XmitPower2), + txc.ds_ctl10 & AR_AntCtl2); + + /* ds_ctl11 */ + printf(" try 3: TxPower=%d, ant=0x%08x\n", + MS(txc.ds_ctl11, AR_XmitPower3), + txc.ds_ctl11 & AR_AntCtl3); + + printf("\n ------ \n"); +#endif +} + +static void +ar5416_decode_rxstatus(struct if_ath_alq_payload *a) +{ + struct ar5416_desc rxs; + static uint64_t rx_tsf = 0; + + /* XXX assumes rxs is smaller than PAYLOAD_LEN! */ + memcpy(&rxs, &a->payload, sizeof(struct ar5416_desc)); + + if (MF(rxs.ds_rxstatus8, AR_RxDone) == 0) + return; + + printf("[%u] [%llu] RXSTATUS: RxDone=%d, TS=0x%08x (delta %d)\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid), + MF(rxs.ds_rxstatus8, AR_RxDone), + rxs.ds_rxstatus2, + rxs.ds_rxstatus2 - rx_tsf); + + rx_tsf = rxs.ds_rxstatus2; + +#if 0 + printf(" link=0x%08x, data=0x%08x, ctl0=0x%08x, ctl2=0x%08x\n", + rxs.ds_link, + rxs.ds_data, + rxs.ds_ctl0, + rxs.ds_ctl1); + + /* status0 */ + /* + * XXX TODO: For AR9285, the chain 1 and chain 2 RSSI values + * acutally contain the RX mixer configuration + */ + printf(" RSSICtl[0]=%d, RSSICtl[1]=%d, RSSICtl[2]=%d\n", + MS(rxs.ds_rxstatus0, AR_RxRSSIAnt00), + MS(rxs.ds_rxstatus0, AR_RxRSSIAnt01), + MS(rxs.ds_rxstatus0, AR_RxRSSIAnt02)); + + /* status1 */ + printf(" DataLen=%d, RxMore=%d, NumDelim=%d\n", + rxs.ds_rxstatus1 & AR_DataLen, + MF(rxs.ds_rxstatus1, AR_RxMore), + MS(rxs.ds_rxstatus1, AR_NumDelim)); + + /* status2 */ + printf(" RxTimestamp=0x%08x\n", rxs.ds_rxstatus2); + + /* status3 - RxRate however is for Owl 2.0 */ + printf(" GI=%d, 2040=%d, RxRate=0x%02x, DupFrame=%d, RxAnt=0x%08x\n", + MF(rxs.ds_rxstatus3, AR_GI), + MF(rxs.ds_rxstatus3, AR_2040), + MS(rxs.ds_rxstatus0, AR_RxRate), + MF(rxs.ds_rxstatus3, AR_DupFrame), + MS(rxs.ds_rxstatus3, AR_RxAntenna)); + + /* status4 */ + printf(" RSSIExt[0]=%d, RSSIExt[1]=%d, RSSIExt[2]=%d, RSSIComb=%d\n", + MS(rxs.ds_rxstatus4, AR_RxRSSIAnt10), + MS(rxs.ds_rxstatus4, AR_RxRSSIAnt11), + MS(rxs.ds_rxstatus4, AR_RxRSSIAnt12), + MS(rxs.ds_rxstatus4, AR_RxRSSICombined)); + + /* status5 */ + /* status6 */ + /* status7 */ + printf(" RxEvm0=0x%08x, RxEvm1=0x%08x, RxEvm2=0x%08x\n", + rxs.ds_rxstatus5, + rxs.ds_rxstatus6, + rxs.ds_rxstatus7); + + /* status8 */ + printf(" RxDone=%d, RxFrameOk=%d, CrcErr=%d, DecryptCrcErr=%d\n", + MF(rxs.ds_rxstatus8, AR_RxDone), + MF(rxs.ds_rxstatus8, AR_RxFrameOK), + MF(rxs.ds_rxstatus8, AR_CRCErr), + MF(rxs.ds_rxstatus8, AR_DecryptCRCErr)); + printf(" PhyErr=%d, MichaelErr=%d, PreDelimCRCErr=%d, KeyIdxValid=%d\n", + MF(rxs.ds_rxstatus8, AR_PHYErr), + MF(rxs.ds_rxstatus8, AR_MichaelErr), + MF(rxs.ds_rxstatus8, AR_PreDelimCRCErr), + MF(rxs.ds_rxstatus8, AR_RxKeyIdxValid)); + + /* If PHY error, print that out. Otherwise, the key index */ + if (MF(rxs.ds_rxstatus8, AR_PHYErr)) + printf(" PhyErrCode=0x%02x\n", + MS(rxs.ds_rxstatus8, AR_PHYErrCode)); + else + printf(" KeyIdx=0x%02x\n", + MS(rxs.ds_rxstatus8, AR_KeyIdx)); + + printf(" RxMoreAggr=%d, RxAggr=%d, PostDelimCRCErr=%d, HiRxChain=%d\n", + MF(rxs.ds_rxstatus8, AR_RxMoreAggr), + MF(rxs.ds_rxstatus8, AR_RxAggr), + MF(rxs.ds_rxstatus8, AR_PostDelimCRCErr), + MF(rxs.ds_rxstatus8, AR_HiRxChain)); + printf(" KeyMiss=%d\n", + MF(rxs.ds_rxstatus8, AR_KeyMiss)); + + printf("\n ------\n"); +#endif +} + +static void +ath_tdma_beacon_state(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_beacon_state t; + static uint64_t last_beacon_tx = 0; + + memcpy(&t, &a->payload, sizeof(t)); + + printf("[%u] [%llu] BEACON: RX TSF=%llu Beacon TSF=%llu (%d)\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid), + (unsigned long long) be64toh(t.rx_tsf), + (unsigned long long) be64toh(t.beacon_tsf), + be64toh(t.beacon_tsf) - last_beacon_tx); + + last_beacon_tx = be64toh(t.beacon_tsf); +} + +static void +ath_tdma_timer_config(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_timer_config t; + + memcpy(&t, &a->payload, sizeof(t)); +} + +static void +ath_tdma_slot_calc(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_slot_calc t; + + memcpy(&t, &a->payload, sizeof(t)); + printf("[%u] [%llu] SLOTCALC: NEXTTBTT=%llu nextslot=%llu tsfdelta=%d avg (%d/%d)\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid), + (unsigned long long) be64toh(t.nexttbtt), + (unsigned long long) be64toh(t.next_slot), + (int) be32toh(t.tsfdelta), + (int) be32toh(t.avg_plus), + (int) be32toh(t.avg_minus)); +} + +static void +ath_tdma_tsf_adjust(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_tsf_adjust t; + + memcpy(&t, &a->payload, sizeof(t)); + printf("[%u] [%llu] TSFADJUST: TSF64 was %llu, adj=%d, now %llu\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid), + (unsigned long long) be64toh(t.tsf64_old), + (int) be32toh(t.tsfdelta), + (unsigned long long) be64toh(t.tsf64_new)); +} + +static void +ath_tdma_timer_set(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_timer_set t; + + memcpy(&t, &a->payload, sizeof(t)); + printf("[%u] [%llu] TIMERSET: bt_intval=%d nexttbtt=%d nextdba=%d nextswba=%d nextatim=%d flags=0x%x tdmadbaprep=%d tdmaswbaprep=%d\n", + (unsigned int) be32toh(a->hdr.tstamp), + (unsigned long long) be64toh(a->hdr.threadid), + be32toh(t.bt_intval), + be32toh(t.bt_nexttbtt), + be32toh(t.bt_nextdba), + be32toh(t.bt_nextswba), + be32toh(t.bt_nextatim), + be32toh(t.bt_flags), + be32toh(t.sc_tdmadbaprep), + be32toh(t.sc_tdmaswbaprep)); +} + +void +ar5416_alq_payload(struct if_ath_alq_payload *a) +{ + + switch (be16toh(a->hdr.op)) { + case ATH_ALQ_EDMA_TXSTATUS: /* TXSTATUS */ + ar5416_decode_txstatus(a); + break; + case ATH_ALQ_EDMA_RXSTATUS: /* RXSTATUS */ + ar5416_decode_rxstatus(a); + break; + case ATH_ALQ_EDMA_TXDESC: /* TXDESC */ + ar5416_decode_txdesc(a); + break; + case ATH_ALQ_TDMA_BEACON_STATE: + ath_tdma_beacon_state(a); + break; + case ATH_ALQ_TDMA_TIMER_CONFIG: + ath_tdma_timer_config(a); + break; + case ATH_ALQ_TDMA_SLOT_CALC: + ath_tdma_slot_calc(a); + break; + case ATH_ALQ_TDMA_TSF_ADJUST: + ath_tdma_tsf_adjust(a); + break; + case ATH_ALQ_TDMA_TIMER_SET: + ath_tdma_timer_set(a); + break; + default: + printf("[%d] [%lld] op: %d; len %d\n", + be32toh(a->hdr.tstamp), + be64toh(a->hdr.threadid), + be16toh(a->hdr.op), be16toh(a->hdr.len)); + } +} From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 03:04:25 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 540E3CF1; Tue, 27 Nov 2012 03:04:25 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39A768FC08; Tue, 27 Nov 2012 03:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR34PtI056692; Tue, 27 Nov 2012 03:04:25 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR34PfD056691; Tue, 27 Nov 2012 03:04:25 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211270304.qAR34PfD056691@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 27 Nov 2012 03:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243594 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 03:04:25 -0000 Author: alfred Date: Tue Nov 27 03:04:24 2012 New Revision: 243594 URL: http://svnweb.freebsd.org/changeset/base/243594 Log: Auto size the tcbhashsize structure based on max sockets. While here, also make the code that enforces power-of-two more forgiving, instead of just resetting to 512, graciously round-down to the next lower power of two. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Nov 27 02:28:42 2012 (r243593) +++ head/sys/netinet/tcp_subr.c Tue Nov 27 03:04:24 2012 (r243594) @@ -235,7 +235,7 @@ static char * tcp_log_addr(struct in_con * variable net.inet.tcp.tcbhashsize */ #ifndef TCBHASHSIZE -#define TCBHASHSIZE 512 +#define TCBHASHSIZE 0 #endif /* @@ -282,11 +282,35 @@ tcp_inpcb_init(void *mem, int size, int return (0); } +/* + * Take a value and get the next power of 2 that doesn't overflow. + * Used to size the tcp_inpcb hash buckets. + */ +static int +maketcp_hashsize(int size) +{ + int hashsize; + + /* + * auto tune. + * get the next power of 2 higher than maxsockets. + */ + hashsize = 1 << fls(size); + /* catch overflow, and just go one power of 2 smaller */ + if (hashsize < size) { + hashsize = 1 << (fls(size) - 1); + } + return (hashsize); +} + void tcp_init(void) { + const char *tcbhash_tuneable; int hashsize; + tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; + if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, &V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); @@ -295,10 +319,43 @@ tcp_init(void) printf("%s: WARNING: unable to register helper hook\n", __func__); hashsize = TCBHASHSIZE; - TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize); + TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); + if (hashsize == 0) { + /* + * Auto tune the hash size based on maxsockets. + * A perfect hash would have a 1:1 mapping + * (hashsize = maxsockets) however it's been + * suggested that O(2) average is better. + */ + hashsize = maketcp_hashsize(maxsockets / 4); + /* + * Our historical default is 512, + * do not autotune lower than this. + */ + if (hashsize < 512) + hashsize = 512; + if (bootverbose) + printf("%s: %s auto tuned to %d\n", __func__, + tcbhash_tuneable, hashsize); + } + /* + * We require a hashsize to be a power of two. + * Previously if it was not a power of two we would just reset it + * back to 512, which could be a nasty surprise if you did not notice + * the error message. + * Instead what we do is clip it to the closest power of two lower + * than the specified hash value. + */ if (!powerof2(hashsize)) { - printf("WARNING: TCB hash size not a power of 2\n"); - hashsize = 512; /* safe default */ + int oldhashsize = hashsize; + + hashsize = maketcp_hashsize(hashsize); + /* prevent absurdly low value */ + if (hashsize < 16) + hashsize = 16; + printf("%s: WARNING: TCB hash size not a power of 2, " + "clipped from %d to %d.\n", __func__, oldhashsize, + hashsize); } in_pcbinfo_init(&V_tcbinfo, "tcp", &V_tcb, hashsize, hashsize, "tcp_inpcb", tcp_inpcb_init, NULL, UMA_ZONE_NOFREE, From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 05:52: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 0684EB9; Tue, 27 Nov 2012 05:52:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD0B48FC08; Tue, 27 Nov 2012 05:52:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR5q8FX090942; Tue, 27 Nov 2012 05:52:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR5q8jt090941; Tue, 27 Nov 2012 05:52:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270552.qAR5q8jt090941@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 05:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243597 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 05:52:09 -0000 Author: adrian Date: Tue Nov 27 05:52:08 2012 New Revision: 243597 URL: http://svnweb.freebsd.org/changeset/base/243597 Log: Fix build Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 05:48:36 2012 (r243596) +++ head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 05:52:08 2012 (r243597) @@ -158,6 +158,7 @@ ath_tdma_settimers(struct ath_softc *sc, bt.bt_nextatim); #endif +#ifdef ATH_DEBUG_ALQ if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_TIMER_SET)) { struct if_ath_alq_tdma_timer_set t; t.bt_intval = htobe32(bt.bt_intval); @@ -171,6 +172,7 @@ ath_tdma_settimers(struct ath_softc *sc, if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_TIMER_SET, sizeof(t), (char *) &t); } +#endif DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "%s: nexttbtt=%u (0x%08x), nexttbtt tsf=%lld (0x%08llx)\n", From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 06:08:00 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 0F11A8AD; Tue, 27 Nov 2012 06:07:58 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF8358FC0C; Tue, 27 Nov 2012 06:07:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR67wKt094154; Tue, 27 Nov 2012 06:07:58 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR67w6O094153; Tue, 27 Nov 2012 06:07:58 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201211270607.qAR67w6O094153@svn.freebsd.org> From: David Xu Date: Tue, 27 Nov 2012 06:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243599 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 06:08:00 -0000 Author: davidxu Date: Tue Nov 27 06:07:58 2012 New Revision: 243599 URL: http://svnweb.freebsd.org/changeset/base/243599 Log: Take first active vnode correctly. Reviewed by: kib MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Nov 27 06:01:02 2012 (r243598) +++ head/sys/kern/vfs_subr.c Tue Nov 27 06:07:58 2012 (r243599) @@ -4755,7 +4755,7 @@ __mnt_vnode_first_active(struct vnode ** MNT_REF(mp); (*mvp)->v_type = VMARKER; - vp = TAILQ_NEXT(*mvp, v_actfreelist); + vp = TAILQ_FIRST(&mp->mnt_activevnodelist); while (vp != NULL) { VI_LOCK(vp); if (vp->v_mount == mp && vp->v_type != VMARKER && From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 06:35:26 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 E779CDE3; Tue, 27 Nov 2012 06:35:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C35EC8FC14; Tue, 27 Nov 2012 06:35:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR6ZQLA099492; Tue, 27 Nov 2012 06:35:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR6ZQPE099491; Tue, 27 Nov 2012 06:35:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211270635.qAR6ZQPE099491@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 27 Nov 2012 06:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243601 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 06:35:27 -0000 Author: glebius Date: Tue Nov 27 06:35:26 2012 New Revision: 243601 URL: http://svnweb.freebsd.org/changeset/base/243601 Log: Better safe than sorry: reinitialize eh after ng_ether(4) and if_bridge(4) processing, since mbuf may be modified there. Submitted by: youngari Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Nov 27 06:20:40 2012 (r243600) +++ head/sys/net/if_ethersubr.c Tue Nov 27 06:35:26 2012 (r243601) @@ -593,6 +593,7 @@ ether_input_internal(struct ifnet *ifp, CURVNET_RESTORE(); return; } + eh = mtod(m, struct ether_header *); } /* @@ -607,6 +608,7 @@ ether_input_internal(struct ifnet *ifp, CURVNET_RESTORE(); return; } + eh = mtod(m, struct ether_header *); } #if defined(INET) || defined(INET6) From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 06:39:33 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 58AD493; Tue, 27 Nov 2012 06:39:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4548FC08; Tue, 27 Nov 2012 06:39:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR6dXG4000342; Tue, 27 Nov 2012 06:39:33 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR6dXMD000341; Tue, 27 Nov 2012 06:39:33 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211270639.qAR6dXMD000341@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 27 Nov 2012 06:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243602 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 06:39:33 -0000 Author: gonzo Date: Tue Nov 27 06:39:32 2012 New Revision: 243602 URL: http://svnweb.freebsd.org/changeset/base/243602 Log: Do not enable data cache until later in kernel init. Stale bits in cache might cause erroneus behavior on early stage. Submitted by: Ian Lepore Tested on: Atmel, Marvell, and Eyxnos Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Tue Nov 27 06:35:26 2012 (r243601) +++ head/sys/arm/arm/locore.S Tue Nov 27 06:39:32 2012 (r243602) @@ -181,7 +181,7 @@ Lunmapped: #if defined(CPU_ARM11) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) orr r0, r0, #CPU_CONTROL_V6_EXTPAGE #endif - orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE) + orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) mcr p15, 0, r0, c1, c0, 0 nop nop From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 06:42:45 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 7A5EA3FD; Tue, 27 Nov 2012 06:42:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6188FC15; Tue, 27 Nov 2012 06:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR6gjkH001057; Tue, 27 Nov 2012 06:42:45 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR6gjSn001056; Tue, 27 Nov 2012 06:42:45 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211270642.qAR6gjSn001056@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 27 Nov 2012 06:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243603 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 06:42:45 -0000 Author: np Date: Tue Nov 27 06:42:44 2012 New Revision: 243603 URL: http://svnweb.freebsd.org/changeset/base/243603 Log: Make sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not). Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Nov 27 06:39:32 2012 (r243602) +++ head/sys/netinet/tcp_timer.c Tue Nov 27 06:42:44 2012 (r243603) @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_inet6.h" #include "opt_tcpdebug.h" From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 08:32:13 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 24CBC782; Tue, 27 Nov 2012 08:32:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 091848FC08; Tue, 27 Nov 2012 08:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR8WC9r021181; Tue, 27 Nov 2012 08:32:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR8WCi1021180; Tue, 27 Nov 2012 08:32:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211270832.qAR8WCi1021180@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 27 Nov 2012 08:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243605 - stable/9/sys/dev/cxgbe/tom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 08:32:13 -0000 Author: np Date: Tue Nov 27 08:32:12 2012 New Revision: 243605 URL: http://svnweb.freebsd.org/changeset/base/243605 Log: MFC r243110: cxgbe/tom: Plug mbuf leak. Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Tue Nov 27 06:50:24 2012 (r243604) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Tue Nov 27 08:32:12 2012 (r243605) @@ -559,8 +559,10 @@ t4_syncache_respond(struct toedev *tod, struct tcphdr *th = (void *)(ip + 1); wr = (struct wrqe *)atomic_readandclear_ptr(&synqe->wr); - if (wr == NULL) + if (wr == NULL) { + m_freem(m); return (EALREADY); + } bzero(&to, sizeof(to)); tcp_dooptions(&to, (void *)(th + 1), (th->th_off << 2) - sizeof(*th), From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 08:40:49 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 7A90ACDE; Tue, 27 Nov 2012 08:40:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60B1C8FC0C; Tue, 27 Nov 2012 08:40:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAR8ensr022856; Tue, 27 Nov 2012 08:40:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAR8enm5022855; Tue, 27 Nov 2012 08:40:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211270840.qAR8enm5022855@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 08:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243606 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 08:40:49 -0000 Author: adrian Date: Tue Nov 27 08:40:48 2012 New Revision: 243606 URL: http://svnweb.freebsd.org/changeset/base/243606 Log: Correct some debugging output. Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 08:32:12 2012 (r243605) +++ head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 08:40:48 2012 (r243606) @@ -532,7 +532,7 @@ ath_tdma_update(struct ieee80211_node *n DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "%s: calling ath_hal_adjusttsf: TSF=%llu, tsfdelta=%d\n", __func__, - tsf_1, + tsf, tsfdelta); #ifdef ATH_DEBUG_ALQ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 09:59:16 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 E637B152; Tue, 27 Nov 2012 09:59:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB228FC13; Tue, 27 Nov 2012 09:59:15 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA10777; Tue, 27 Nov 2012 11:59:07 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TdHwZ-000NPL-Iv; Tue, 27 Nov 2012 11:59:07 +0200 Message-ID: <50B48EE9.1090506@FreeBSD.org> Date: Tue, 27 Nov 2012 11:59:05 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: David Xu Subject: Re: svn commit: r243599 - head/sys/kern References: <201211270607.qAR67w6O094153@svn.freebsd.org> In-Reply-To: <201211270607.qAR67w6O094153@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Mail-Followup-To: David Xu , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 09:59:17 -0000 on 27/11/2012 08:07 David Xu said the following: > Author: davidxu > Date: Tue Nov 27 06:07:58 2012 > New Revision: 243599 > URL: http://svnweb.freebsd.org/changeset/base/243599 > > Log: > Take first active vnode correctly. > > Reviewed by: kib > MFC after: 3 days > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Tue Nov 27 06:01:02 2012 (r243598) > +++ head/sys/kern/vfs_subr.c Tue Nov 27 06:07:58 2012 (r243599) > @@ -4755,7 +4755,7 @@ __mnt_vnode_first_active(struct vnode ** > MNT_REF(mp); > (*mvp)->v_type = VMARKER; > > - vp = TAILQ_NEXT(*mvp, v_actfreelist); > + vp = TAILQ_FIRST(&mp->mnt_activevnodelist); > while (vp != NULL) { > VI_LOCK(vp); > if (vp->v_mount == mp && vp->v_type != VMARKER && > Oh, wow, did this even work before? Did it always just return NULL and no active list iteration happened? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:11: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 8627AA4D; Tue, 27 Nov 2012 10:11:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BED48FC0C; Tue, 27 Nov 2012 10:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARABso0039677; Tue, 27 Nov 2012 10:11:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARABsUZ039675; Tue, 27 Nov 2012 10:11:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271011.qARABsUZ039675@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243607 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:11:54 -0000 Author: pjd Date: Tue Nov 27 10:11:54 2012 New Revision: 243607 URL: http://svnweb.freebsd.org/changeset/base/243607 Log: Style fixes (mostly whitespaces). Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 27 08:40:48 2012 (r243606) +++ head/sys/kern/kern_sig.c Tue Nov 27 10:11:54 2012 (r243607) @@ -128,8 +128,8 @@ struct filterops sig_filtops = { }; static int kern_logsigexit = 1; -SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, - &kern_logsigexit, 0, +SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, + &kern_logsigexit, 0, "Log processes quitting on abnormal signals to syslog(3)"); static int kern_forcesigexit = 1; @@ -171,7 +171,7 @@ SYSINIT(signal, SI_SUB_P1003_1B, SI_ORDE (cr1)->cr_uid == (cr2)->cr_uid) static int sugid_coredump; -SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, +SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "Allow setuid and setgid processes to dump core"); static int do_coredump = 1; @@ -284,9 +284,9 @@ sigqueue_init(sigqueue_t *list, struct p /* * Get a signal's ksiginfo. * Return: - * 0 - signal not found + * 0 - signal not found * others - signal number - */ + */ static int sigqueue_get(sigqueue_t *sq, int signo, ksiginfo_t *si) { @@ -357,7 +357,7 @@ sigqueue_add(sigqueue_t *sq, int signo, int ret = 0; KASSERT(sq->sq_flags & SQ_INIT, ("sigqueue not inited")); - + if (signo == SIGKILL || signo == SIGSTOP || si == NULL) { SIGADDSET(sq->sq_kill, signo); goto out_set_bit; @@ -377,7 +377,7 @@ sigqueue_add(sigqueue_t *sq, int signo, SIGADDSET(sq->sq_kill, signo); goto out_set_bit; } - + if (p != NULL && p->p_pendingcnt >= max_pending_per_proc) { signal_overflow++; ret = EAGAIN; @@ -406,7 +406,7 @@ sigqueue_add(sigqueue_t *sq, int signo, if (ret != 0) return (ret); - + out_set_bit: SIGADDSET(sq->sq_signals, signo); return (ret); @@ -1158,7 +1158,7 @@ sys_sigwaitinfo(struct thread *td, struc if (uap->info) error = copyout(&ksi.ksi_info, uap->info, sizeof(siginfo_t)); - + if (error == 0) td->td_retval[0] = ksi.ksi_signo; return (error); @@ -1184,7 +1184,7 @@ kern_sigtimedwait(struct thread *td, sig if (timeout->tv_nsec >= 0 && timeout->tv_nsec < 1000000000) { timevalid = 1; getnanouptime(&rts); - ets = rts; + ets = rts; timespecadd(&ets, timeout); } } @@ -1201,7 +1201,7 @@ kern_sigtimedwait(struct thread *td, sig mtx_unlock(&ps->ps_mtx); if (sig != 0 && SIGISMEMBER(waitset, sig)) { if (sigqueue_get(&td->td_sigqueue, sig, ksi) != 0 || - sigqueue_get(&p->p_sigqueue, sig, ksi) != 0) { + sigqueue_get(&p->p_sigqueue, sig, ksi) != 0) { error = 0; break; } @@ -1257,7 +1257,7 @@ kern_sigtimedwait(struct thread *td, sig if (error == 0) { SDT_PROBE(proc, kernel, , signal_clear, sig, ksi, 0, 0, 0); - + if (ksi->ksi_code == SI_TIMER) itimer_accept(p, ksi->ksi_timerid, ksi); @@ -1407,7 +1407,7 @@ osigsetmask(td, uap) /* * Suspend calling thread until signal, providing mask to be set in the - * meantime. + * meantime. */ #ifndef _SYS_SYSPROTO_H_ struct sigsuspend_args { @@ -1643,7 +1643,7 @@ killpg1(struct thread *td, int sig, int } sx_sunlock(&proctree_lock); LIST_FOREACH(p, &pgrp->pg_members, p_pglist) { - PROC_LOCK(p); + PROC_LOCK(p); if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || p->p_state == PRS_NEW) { PROC_UNLOCK(p); @@ -1881,7 +1881,7 @@ trapsignal(struct thread *td, ksiginfo_t ktrpsig(sig, ps->ps_sigact[_SIG_IDX(sig)], &td->td_sigmask, code); #endif - (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], + (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); mask = ps->ps_catchmask[_SIG_IDX(sig)]; if (!SIGISMEMBER(ps->ps_signodefer, sig)) @@ -1958,7 +1958,7 @@ sigtd(struct proc *p, int sig, int prop) * regardless of the signal action (eg, blocked or ignored). * * Other ignored signals are discarded immediately. - * + * * NB: This function may be entered from the debugger via the "kill" DDB * command. There is little that can be done to mitigate the possibly messy * side effects of this unwise possibility. @@ -2593,14 +2593,15 @@ issignal(struct thread *td, int stop_all * If parent wants us to take the signal, * then it will leave it in p->p_xstat; * otherwise we just look for signals again. - */ + */ if (newsig == 0) continue; sig = newsig; /* * Put the new signal into td_sigqueue. If the - * signal is being masked, look for other signals. + * signal is being masked, look for other + * signals. */ sigqueue_add(queue, sig, NULL); if (SIGISMEMBER(td->td_sigmask, sig)) @@ -2660,7 +2661,7 @@ issignal(struct thread *td, int stop_all */ if (prop & SA_STOP) { if (p->p_flag & (P_TRACED|P_WEXIT) || - (p->p_pgrp->pg_jobc == 0 && + (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ @@ -2706,7 +2707,7 @@ issignal(struct thread *td, int stop_all */ return (sig); } - sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ + sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ sigqueue_delete(&p->p_sigqueue, sig); } /* NOTREACHED */ @@ -2732,7 +2733,7 @@ thread_stopped(struct proc *p) PROC_SLOCK(p); } } - + /* * Take the action for the specified signal * from the current set of pending signals. @@ -2997,7 +2998,7 @@ sysctl_debug_num_cores_check (SYSCTL_HAN num_cores = new_val; return (0); } -SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLFLAG_RW, 0, sizeof(int), sysctl_debug_num_cores_check, "I", ""); #if defined(COMPRESS_USER_CORES) @@ -3009,8 +3010,8 @@ int compress_user_cores_gzlevel = -1; /* SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_gzlevel, CTLFLAG_RW, &compress_user_cores_gzlevel, -1, "user core gz compression level"); -#define GZ_SUFFIX ".gz" -#define GZ_SUFFIX_LEN 3 +#define GZ_SUFFIX ".gz" +#define GZ_SUFFIX_LEN 3 #endif static char corefilename[MAXPATHLEN] = {"%N.core"}; @@ -3038,7 +3039,7 @@ expand_name(const char *name, uid_t uid, size_t i; int indexpos; char *hostname; - + hostname = NULL; format = corefilename; temp = malloc(MAXPATHLEN, M_TEMP, M_NOWAIT | M_ZERO); @@ -3086,7 +3087,7 @@ expand_name(const char *name, uid_t uid, sbuf_printf(&sb, "%u", uid); break; default: - log(LOG_ERR, + log(LOG_ERR, "Unknown format character %c in " "corename `%s'\n", format[i], format); } @@ -3127,12 +3128,11 @@ nomem: for (n = 0; n < num_cores; n++) { temp[indexpos] = '0' + n; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, - temp, td); + temp, td); error = vn_open(&nd, &flags, cmode, NULL); if (error) { - if (error == EEXIST) { + if (error == EEXIST) continue; - } log(LOG_ERR, "pid %d (%s), uid (%u): Path `%s' failed " "on initial open test, error = %d\n", @@ -3199,7 +3199,8 @@ coredump(struct thread *td) #endif return (EINVAL); } - if (((sugid_coredump == 0) && p->p_flag & P_SUGID) || do_coredump == 0) { + if (((sugid_coredump == 0) && p->p_flag & P_SUGID) || + do_coredump == 0) { PROC_UNLOCK(p); #ifdef AUDIT audit_proc_coredump(td, name, EFAULT); @@ -3207,7 +3208,7 @@ coredump(struct thread *td) free(name, M_TEMP); return (EFAULT); } - + /* * Note that the bulk of limit checking is done after * the corefile is created. The exception is if the limit @@ -3280,9 +3281,12 @@ restart: p->p_acflag |= ACORE; PROC_UNLOCK(p); - error = p->p_sysent->sv_coredump ? - p->p_sysent->sv_coredump(td, vp, limit, compress ? IMGACT_CORE_COMPRESS : 0) : - ENOSYS; + if (p->p_sysent->sv_coredump != NULL) { + error = p->p_sysent->sv_coredump(td, vp, limit, + compress ? IMGACT_CORE_COMPRESS : 0); + } else { + error = ENOSYS; + } if (locked) { lf.l_type = F_UNLCK; @@ -3389,7 +3393,7 @@ filt_sigdetach(struct knote *kn) } /* - * signal knotes are shared with proc knotes, so we apply a mask to + * signal knotes are shared with proc knotes, so we apply a mask to * the hint in order to differentiate them from process hints. This * could be avoided by using a signal-specific knote list, but probably * isn't worth the trouble. From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:15: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 C78BAC0B; Tue, 27 Nov 2012 10:15:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ACB2C8FC13; Tue, 27 Nov 2012 10:15:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARAFwIO040469; Tue, 27 Nov 2012 10:15:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARAFwr1040468; Tue, 27 Nov 2012 10:15:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271015.qARAFwr1040468@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243608 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:15:58 -0000 Author: pjd Date: Tue Nov 27 10:15:58 2012 New Revision: 243608 URL: http://svnweb.freebsd.org/changeset/base/243608 Log: More style fixes. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 27 10:11:54 2012 (r243607) +++ head/sys/kern/kern_sig.c Tue Nov 27 10:15:58 2012 (r243608) @@ -2838,10 +2838,10 @@ killproc(p, why) { PROC_LOCK_ASSERT(p, MA_OWNED); - CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", - p, p->p_pid, p->p_comm); - log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, p->p_comm, - p->p_ucred ? p->p_ucred->cr_uid : -1, why); + CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, + p->p_comm); + log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, + p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why); p->p_flag |= P_WKILLED; kern_psignal(p, SIGKILL); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:16: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 C028ED88; Tue, 27 Nov 2012 10:16:48 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4F628FC12; Tue, 27 Nov 2012 10:16:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARAGm6Y040648; Tue, 27 Nov 2012 10:16:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARAGmT5040647; Tue, 27 Nov 2012 10:16:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271016.qARAGmT5040647@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243609 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:16:48 -0000 Author: pjd Date: Tue Nov 27 10:16:48 2012 New Revision: 243609 URL: http://svnweb.freebsd.org/changeset/base/243609 Log: Allow to modify kern.sugid_coredump and kern.corefile from loader.conf. Obtained from: WHEEL Systems Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 27 10:15:58 2012 (r243608) +++ head/sys/kern/kern_sig.c Tue Nov 27 10:16:48 2012 (r243609) @@ -171,6 +171,7 @@ SYSINIT(signal, SI_SUB_P1003_1B, SI_ORDE (cr1)->cr_uid == (cr2)->cr_uid) static int sugid_coredump; +TUNABLE_INT("kern.sugid_coredump", &sugid_coredump); SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "Allow setuid and setgid processes to dump core"); @@ -3015,6 +3016,7 @@ SYSCTL_INT(_kern, OID_AUTO, compress_use #endif static char corefilename[MAXPATHLEN] = {"%N.core"}; +TUNABLE_STR("kern.corefile", corefilename, sizeof(corefilename)); SYSCTL_STRING(_kern, OID_AUTO, corefile, CTLFLAG_RW, corefilename, sizeof(corefilename), "process corefile name format string"); From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:22:41 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 98268F60; Tue, 27 Nov 2012 10:22:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FBCD8FC08; Tue, 27 Nov 2012 10:22:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARAMfFO041663; Tue, 27 Nov 2012 10:22:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARAMfUi041661; Tue, 27 Nov 2012 10:22:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271022.qARAMfUi041661@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243610 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:22:41 -0000 Author: pjd Date: Tue Nov 27 10:22:40 2012 New Revision: 243610 URL: http://svnweb.freebsd.org/changeset/base/243610 Log: Allow to use kill(2) in capability mode, but process can send a signal only to himself. For example abort(3) at first tries to do kill(getpid(), SIGABRT) which was failing in capability mode, so the code was failing back to exit(1). Reviewed by: rwatson Obtained from: WHEEL Systems MFC after: 2 weeks Modified: head/sys/kern/capabilities.conf head/sys/kern/kern_sig.c Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Tue Nov 27 10:16:48 2012 (r243609) +++ head/sys/kern/capabilities.conf Tue Nov 27 10:22:40 2012 (r243610) @@ -337,6 +337,11 @@ issetugid kevent ## +## Allow kill(2), as we allow the process to send signals only to himself. +## +kill + +## ## Allow message queue operations on file descriptors, subject to capability ## rights. ## Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 27 10:16:48 2012 (r243609) +++ head/sys/kern/kern_sig.c Tue Nov 27 10:22:40 2012 (r243610) @@ -1679,6 +1679,14 @@ sys_kill(struct thread *td, struct kill_ struct proc *p; int error; + /* + * A process in capability mode can send signals only to himself. + * The main rationale behind this is that abort(3) is implemented as + * kill(getpid(), SIGABRT). + */ + if (IN_CAPABILITY_MODE(td) && uap->pid != td->td_proc->p_pid) + return (ECAPMODE); + AUDIT_ARG_SIGNUM(uap->signum); AUDIT_ARG_PID(uap->pid); if ((u_int)uap->signum > _SIG_MAXSIG) From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:25:04 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 576F4165; Tue, 27 Nov 2012 10:25:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C76B8FC13; Tue, 27 Nov 2012 10:25:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARAP4kr042117; Tue, 27 Nov 2012 10:25:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARAP4Z3042116; Tue, 27 Nov 2012 10:25:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271025.qARAP4Z3042116@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243611 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:25:04 -0000 Author: pjd Date: Tue Nov 27 10:25:03 2012 New Revision: 243611 URL: http://svnweb.freebsd.org/changeset/base/243611 Log: Regenerate after r243610. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue Nov 27 10:22:40 2012 (r243610) +++ head/sys/kern/init_sysent.c Tue Nov 27 10:25:03 2012 (r243611) @@ -71,7 +71,7 @@ struct sysent sysent[] = { { AS(chflags_args), (sy_call_t *)sys_chflags, AUE_CHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = chflags */ { AS(fchflags_args), (sy_call_t *)sys_fchflags, AUE_FCHFLAGS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = fchflags */ { 0, (sy_call_t *)sys_sync, AUE_SYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = sync */ - { AS(kill_args), (sy_call_t *)sys_kill, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = kill */ + { AS(kill_args), (sy_call_t *)sys_kill, AUE_KILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = kill */ { compat(AS(ostat_args),stat), AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 38 = old stat */ { 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = getppid */ { compat(AS(olstat_args),lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = old lstat */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:32:35 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 A207E4D9; Tue, 27 Nov 2012 10:32:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 894E18FC12; Tue, 27 Nov 2012 10:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARAWZvB043510; Tue, 27 Nov 2012 10:32:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARAWZDR043506; Tue, 27 Nov 2012 10:32:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271032.qARAWZDR043506@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243612 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:32:35 -0000 Author: pjd Date: Tue Nov 27 10:32:35 2012 New Revision: 243612 URL: http://svnweb.freebsd.org/changeset/base/243612 Log: - Add NOCAPCHECK flag to namei that allows lookup to work even if the process is in capability mode. - Add VN_OPEN_NOCAPCHECK flag for vn_open_cred() to will ne converted into NOCAPCHECK namei flag. This functionality will be used to enable core dumps for sandboxed processes. Reviewed by: rwatson Obtained from: WHEEL Systems MFC after: 2 weeks Modified: head/sys/kern/vfs_lookup.c head/sys/kern/vfs_vnops.c head/sys/sys/namei.h head/sys/sys/vnode.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Tue Nov 27 10:25:03 2012 (r243611) +++ head/sys/kern/vfs_lookup.c Tue Nov 27 10:32:35 2012 (r243612) @@ -183,7 +183,7 @@ namei(struct nameidata *ndp) * not an absolute path, and not containing '..' components) to * a real file descriptor, not the pseudo-descriptor AT_FDCWD. */ - if (IN_CAPABILITY_MODE(td)) { + if (IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) { ndp->ni_strictrelative = 1; if (ndp->ni_dirfd == AT_FDCWD) { #ifdef KTRACE Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Nov 27 10:25:03 2012 (r243611) +++ head/sys/kern/vfs_vnops.c Tue Nov 27 10:32:35 2012 (r243612) @@ -135,6 +135,8 @@ restart: ndp->ni_cnd.cn_flags |= FOLLOW; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) ndp->ni_cnd.cn_flags |= AUDITVNODE1; + if (vn_open_flags & VN_OPEN_NOCAPCHECK) + ndp->ni_cnd.cn_flags |= NOCAPCHECK; bwillwrite(); if ((error = namei(ndp)) != 0) return (error); @@ -188,6 +190,8 @@ restart: ndp->ni_cnd.cn_flags |= LOCKSHARED; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) ndp->ni_cnd.cn_flags |= AUDITVNODE1; + if (vn_open_flags & VN_OPEN_NOCAPCHECK) + ndp->ni_cnd.cn_flags |= NOCAPCHECK; if ((error = namei(ndp)) != 0) return (error); vp = ndp->ni_vp; Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Tue Nov 27 10:25:03 2012 (r243611) +++ head/sys/sys/namei.h Tue Nov 27 10:32:35 2012 (r243612) @@ -147,7 +147,8 @@ struct nameidata { #define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ #define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ #define TRAILINGSLASH 0x10000000 /* path ended in a slash */ -#define PARAMASK 0x1ffffe00 /* mask of parameter descriptors */ +#define NOCAPCHECK 0x20000000 /* do not perform capability checks */ +#define PARAMASK 0x3ffffe00 /* mask of parameter descriptors */ /* * Initialization of a nameidata structure. Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Nov 27 10:25:03 2012 (r243611) +++ head/sys/sys/vnode.h Tue Nov 27 10:32:35 2012 (r243612) @@ -565,6 +565,7 @@ vn_canvmio(struct vnode *vp) /* vn_open_flags */ #define VN_OPEN_NOAUDIT 0x00000001 +#define VN_OPEN_NOCAPCHECK 0x00000002 /* * Public vnode manipulation functions. From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 10:38:11 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 A6DCF692; Tue, 27 Nov 2012 10:38:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 731648FC08; Tue, 27 Nov 2012 10:38:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARAcBEd044426; Tue, 27 Nov 2012 10:38:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARAcBeX044425; Tue, 27 Nov 2012 10:38:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271038.qARAcBeX044425@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 10:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243613 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 10:38:11 -0000 Author: pjd Date: Tue Nov 27 10:38:11 2012 New Revision: 243613 URL: http://svnweb.freebsd.org/changeset/base/243613 Log: Add kern.capmode_coredump sysctl/tunable to allow processes in capability mode to dump core. Reviewed by: rwatson Obtained from: WHEEL Systems MFC after: 2 weeks Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 27 10:32:35 2012 (r243612) +++ head/sys/kern/kern_sig.c Tue Nov 27 10:38:11 2012 (r243613) @@ -175,6 +175,11 @@ TUNABLE_INT("kern.sugid_coredump", &sugi SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "Allow setuid and setgid processes to dump core"); +static int capmode_coredump; +TUNABLE_INT("kern.capmode_coredump", &capmode_coredump); +SYSCTL_INT(_kern, OID_AUTO, capmode_coredump, CTLFLAG_RW, + &capmode_coredump, 0, "Allow processes in capability mode to dump core"); + static int do_coredump = 1; SYSCTL_INT(_kern, OID_AUTO, coredump, CTLFLAG_RW, &do_coredump, 0, "Enable/Disable coredumps"); @@ -3134,12 +3139,17 @@ nomem: int error, n; int flags = O_CREAT | O_EXCL | FWRITE | O_NOFOLLOW; int cmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; + int oflags = 0; + + if (capmode_coredump) + oflags = VN_OPEN_NOCAPCHECK; for (n = 0; n < num_cores; n++) { temp[indexpos] = '0' + n; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, temp, td); - error = vn_open(&nd, &flags, cmode, NULL); + error = vn_open_cred(&nd, &flags, cmode, oflags, + td->td_ucred, NULL); if (error) { if (error == EEXIST) continue; @@ -3241,7 +3251,8 @@ coredump(struct thread *td) restart: NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); flags = O_CREAT | FWRITE | O_NOFOLLOW; - error = vn_open_cred(&nd, &flags, S_IRUSR | S_IWUSR, VN_OPEN_NOAUDIT, + error = vn_open_cred(&nd, &flags, S_IRUSR | S_IWUSR, + VN_OPEN_NOAUDIT | (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0), cred, NULL); if (error) { #ifdef AUDIT From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 11:30:39 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 CB6FB5E9; Tue, 27 Nov 2012 11:30:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94D458FC08; Tue, 27 Nov 2012 11:30:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARBUdsf054210; Tue, 27 Nov 2012 11:30:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARBUdGm054209; Tue, 27 Nov 2012 11:30:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211271130.qARBUdGm054209@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 Nov 2012 11:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243614 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 11:30:40 -0000 Author: adrian Date: Tue Nov 27 11:30:39 2012 New Revision: 243614 URL: http://svnweb.freebsd.org/changeset/base/243614 Log: * Fix another culprit of my "committed from the wrong directory" nonsense; now this works for non-debug and debug builds. * Add a comment reminding me (or someone) to audit all of the relevant math to ensure there's no weird wrapping issues still lurking about. But yes, this does seem to be mostly working. Pointy-hat-to: adrian, yet again Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 10:38:11 2012 (r243613) +++ head/sys/dev/ath/if_ath_tdma.c Tue Nov 27 11:30:39 2012 (r243614) @@ -328,6 +328,16 @@ ath_tdma_config(struct ath_softc *sc, st * beacon timers so we follow their schedule. Note that * by using the rx timestamp we implicitly include the * propagation delay in our schedule. + * + * XXX TODO: since the changes for the AR5416 and later chips + * involved changing the TSF/TU calculations, we need to make + * sure that various calculations wrap consistently. + * + * A lot of the problems stemmed from the calculations wrapping + * at 65,535 TU. Since a lot of the math is still being done in + * TU, please audit it to ensure that when the TU values programmed + * into the timers wrap at (2^31)-1 TSF, all the various terms + * wrap consistently. */ void ath_tdma_update(struct ieee80211_node *ni, @@ -541,8 +551,8 @@ ath_tdma_update(struct ieee80211_node *n struct if_ath_alq_tdma_tsf_adjust t; t.tsfdelta = htobe32(tsfdelta); - t.tsf64_old = htobe64(tsf_1); - t.tsf64_new = htobe64(tsf_1 + tsfdelta); + t.tsf64_old = htobe64(tsf); + t.tsf64_new = htobe64(tsf + tsfdelta); if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_TSF_ADJUST, sizeof(t), (char *) &t); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 12:23: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 826DC3EE; Tue, 27 Nov 2012 12:23:57 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 67F6A8FC08; Tue, 27 Nov 2012 12:23:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARCNvLR063756; Tue, 27 Nov 2012 12:23:57 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARCNvcf063755; Tue, 27 Nov 2012 12:23:57 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201211271223.qARCNvcf063755@svn.freebsd.org> From: David Xu Date: Tue, 27 Nov 2012 12:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243615 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 12:23:57 -0000 Author: davidxu Date: Tue Nov 27 12:23:57 2012 New Revision: 243615 URL: http://svnweb.freebsd.org/changeset/base/243615 Log: Pass allocated unit number to make_dev, otherwise kernel panics later while cloning second tap. Reviewed by: kevlo,ed Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Tue Nov 27 11:30:39 2012 (r243614) +++ head/sys/net/if_tap.c Tue Nov 27 12:23:57 2012 (r243615) @@ -186,7 +186,7 @@ tap_clone_create(struct if_clone *ifc, i /* Find any existing device, or allocate new unit number. */ i = clone_create(&tapclones, &tap_cdevsw, &unit, &dev, 0); if (i) { - dev = make_dev(&tap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + dev = make_dev(&tap_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "%s%d", tapname, unit); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 13:52:47 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 1039BCF6; Tue, 27 Nov 2012 13:52:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id ECD318FC16; Tue, 27 Nov 2012 13:52:45 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so11869778lah.13 for ; Tue, 27 Nov 2012 05:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ctU8CmS6/WFrX5ze21tYFV8bk0yeLBnh7QGmNSgAKXA=; b=MOyNimEdqVsgfSvPd2gF/GAbdE6zUbFQuxOlJoWUbYroteSvBeyPFKtpsc8SUNMR8a Sj9mYSSMv+HH5+Cz/OO5dbQzKdGJxvxp9aeEKAM4tAUpgh17esOJLRQ40PKEj305ilw4 OMEoWwi+wku8Wx5kSankUu4zfSjZ7oQBlBKZ3kRlZKQ1lPPWPXwwSib1X1Z4Klg/iP5O O5FlhtbIKEVqH4QSV0ECsY9sE2xzQIVSCxqpiUuROUEaFoRC/7sof6ddPlKGeo6jzz7S uB6rCuwL1g2NIrcHpN/YQ6uckmVuZpEZD7vfaLHlKFx6vnRYrtgWnIJeDvsbEATw5ohw 2AKQ== MIME-Version: 1.0 Received: by 10.152.162.1 with SMTP id xw1mr14830537lab.3.1354024364928; Tue, 27 Nov 2012 05:52:44 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 27 Nov 2012 05:52:44 -0800 (PST) In-Reply-To: <201211270607.qAR67w6O094153@svn.freebsd.org> References: <201211270607.qAR67w6O094153@svn.freebsd.org> Date: Tue, 27 Nov 2012 13:52:44 +0000 X-Google-Sender-Auth: EaD7uY28DWicFYm97kElno4zcTg Message-ID: Subject: Re: svn commit: r243599 - head/sys/kern From: Attilio Rao To: David Xu Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 27 Nov 2012 13:52:47 -0000 On Tue, Nov 27, 2012 at 6:07 AM, David Xu wrote: > Author: davidxu > Date: Tue Nov 27 06:07:58 2012 > New Revision: 243599 > URL: http://svnweb.freebsd.org/changeset/base/243599 > > Log: > Take first active vnode correctly. Thanks. I had send the exact same report to Kirk and Jeff one week ago, and I was still waiting for responses. Please note that vfs_msync() was completely broken because of this change (as not happening at all). I think that vinactive() and umount were enough to make the issue not really visible. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 14:35: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 C954E9ED; Tue, 27 Nov 2012 14:35:27 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF588FC13; Tue, 27 Nov 2012 14:35:27 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so3538173dad.13 for ; Tue, 27 Nov 2012 06:35:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=hPxZAq2FzERI584lVf7p9WLEjzKy/5u2n/O7uolhcGY=; b=09RUAbNGiclj8gvnfCzyI9woVXPnragsIZsoBprljaQlkSLwh5NU0xdFIMb5/yzr3N 2m/ouybLCicoM3KzhF3KdG3j9j/elYhBcXRtrtMVu6RCCMvws0ipxvSCRAmmdUkxZska 01n0Cz27x2ZEfoyjKyTYjByZkpUahuKD23eScsFQuB8SWMddnsbw/168LcrpTHSkaDWS aU1J8AkricKucNfZGEk9+8IviuBywRYxKu5VmhLHQpZFYaKWQ0/q7o6NSK3kaBK1KYNC 3ex3dk3m/kVvd+1M/e6yGQMd4tQ6nfWYe0NeQjQgKppurh5JvazWqVmk8ZkktuD6l67c CqgQ== Received: by 10.68.136.9 with SMTP id pw9mr48363795pbb.155.1354026927067; Tue, 27 Nov 2012 06:35:27 -0800 (PST) Received: from xp5k.my.domain ([115.192.135.126]) by mx.google.com with ESMTPS id qj6sm10714698pbb.69.2012.11.27.06.35.20 (version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 06:35:25 -0800 (PST) Message-ID: <50B4CFA5.7040200@gmail.com> Date: Tue, 27 Nov 2012 22:35:17 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r243599 - head/sys/kern References: <201211270607.qAR67w6O094153@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: davidxu@freebsd.org 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: Tue, 27 Nov 2012 14:35:27 -0000 On 2012/11/27 21:52, Attilio Rao wrote: > On Tue, Nov 27, 2012 at 6:07 AM, David Xu wrote: >> Author: davidxu >> Date: Tue Nov 27 06:07:58 2012 >> New Revision: 243599 >> URL: http://svnweb.freebsd.org/changeset/base/243599 >> >> Log: >> Take first active vnode correctly. > Thanks. > I had send the exact same report to Kirk and Jeff one week ago, and I > was still waiting for responses. > > Please note that vfs_msync() was completely broken because of this > change (as not happening at all). > I think that vinactive() and umount were enough to make the issue not > really visible. Yes, I think so, except quota data ? > Attilio > > From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 14:50:52 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 338F678; Tue, 27 Nov 2012 14:50:52 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id F23108FC08; Tue, 27 Nov 2012 14:50:50 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so9357100lbb.13 for ; Tue, 27 Nov 2012 06:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=P/SCCXFUAWfAY70xVUBSl/+hyWkppnYlEW3RmJixOMQ=; b=XmxYlWXZNr64oRU+zHtbUjOqUjed/0PcStCdJEIBpXtzT88Lpo+3bWICb4WRSwJyQ1 rENpnCSmJc0MJMJLzpPNBGG+S3cFqVu+71XCzxZXBkJmwP68NQZVRPwkby1+ILkj+2zB L870G8L+l8VEDEc5ocCTuymMGZLJj0HmU9oW63pB5wolBKdsS3oZAhjF8ra7H4ictUzd UAdPjd8e1ONF31eeJK9lwg6+WuS1Wb5ReFkQVuJyk1K/Q+hHYwN2JNkx3OEjZxB/jRxq LIyRZjLMV/MZhqV2xFADkfIZfUbGjtrrAjCWEqIRYN3krrHnq7rWb47bsJ0SR+0z7q3c XKZA== MIME-Version: 1.0 Received: by 10.152.129.197 with SMTP id ny5mr14902859lab.43.1354027849656; Tue, 27 Nov 2012 06:50:49 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 27 Nov 2012 06:50:49 -0800 (PST) In-Reply-To: <50B4CFA5.7040200@gmail.com> References: <201211270607.qAR67w6O094153@svn.freebsd.org> <50B4CFA5.7040200@gmail.com> Date: Tue, 27 Nov 2012 14:50:49 +0000 X-Google-Sender-Auth: 05aVGLVjmzvJWg7cdKwAXNfuidg Message-ID: Subject: Re: svn commit: r243599 - head/sys/kern From: Attilio Rao To: davidxu@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 27 Nov 2012 14:50:52 -0000 On Tue, Nov 27, 2012 at 2:35 PM, David Xu wrote: > On 2012/11/27 21:52, Attilio Rao wrote: >> On Tue, Nov 27, 2012 at 6:07 AM, David Xu wrote: >>> Author: davidxu >>> Date: Tue Nov 27 06:07:58 2012 >>> New Revision: 243599 >>> URL: http://svnweb.freebsd.org/changeset/base/243599 >>> >>> Log: >>> Take first active vnode correctly. >> Thanks. >> I had send the exact same report to Kirk and Jeff one week ago, and I >> was still waiting for responses. >> >> Please note that vfs_msync() was completely broken because of this >> change (as not happening at all). >> I think that vinactive() and umount were enough to make the issue not >> really visible. > > Yes, I think so, except quota data ? Yeah, although I don't think many people use QUOTA out of servers/production ready machines (which also usually don't run -CURRENT) and likely only people using QUOTA on STABLE_9 machines could have really experienced problems with this. I think this bug fix must be absolutely included into 9.1-REL. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 15:08:39 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 3431D6F7; Tue, 27 Nov 2012 15:08:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3A08FC16; Tue, 27 Nov 2012 15:08:38 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qARF8VVN077155; Tue, 27 Nov 2012 17:08:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qARF8VVN077155 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qARF8V75077154; Tue, 27 Nov 2012 17:08:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 Nov 2012 17:08:31 +0200 From: Konstantin Belousov To: Andriy Gapon Subject: Re: svn commit: r243599 - head/sys/kern Message-ID: <20121127150831.GK3013@kib.kiev.ua> References: <201211270607.qAR67w6O094153@svn.freebsd.org> <50B48EE9.1090506@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sCNd3Ivk/oijKKf1" Content-Disposition: inline In-Reply-To: <50B48EE9.1090506@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 15:08:39 -0000 --sCNd3Ivk/oijKKf1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 27, 2012 at 11:59:05AM +0200, Andriy Gapon wrote: > on 27/11/2012 08:07 David Xu said the following: > > Author: davidxu > > Date: Tue Nov 27 06:07:58 2012 > > New Revision: 243599 > > URL: http://svnweb.freebsd.org/changeset/base/243599 > >=20 > > Log: > > Take first active vnode correctly. > > =20 > > Reviewed by: kib > > MFC after: 3 days > >=20 > > Modified: > > head/sys/kern/vfs_subr.c > >=20 > > Modified: head/sys/kern/vfs_subr.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/kern/vfs_subr.c Tue Nov 27 06:01:02 2012 (r243598) > > +++ head/sys/kern/vfs_subr.c Tue Nov 27 06:07:58 2012 (r243599) > > @@ -4755,7 +4755,7 @@ __mnt_vnode_first_active(struct vnode ** > > MNT_REF(mp); > > (*mvp)->v_type =3D VMARKER; > > =20 > > - vp =3D TAILQ_NEXT(*mvp, v_actfreelist); > > + vp =3D TAILQ_FIRST(&mp->mnt_activevnodelist); > > while (vp !=3D NULL) { > > VI_LOCK(vp); > > if (vp->v_mount =3D=3D mp && vp->v_type !=3D VMARKER && > >=20 >=20 > Oh, wow, did this even work before? > Did it always just return NULL and no active list iteration happened? Yes. Due to some redundancy in the VFS, the consequences were much less fatal than it could be. --sCNd3Ivk/oijKKf1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC0124ACgkQC3+MBN1Mb4gGvQCfTPP6l/tIlnZiC7jh8URJEART CT4AoImg06M5EDKf960V1RC0gfiQWiNZ =Oqaj -----END PGP SIGNATURE----- --sCNd3Ivk/oijKKf1-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 16:20:44 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 E572B585; Tue, 27 Nov 2012 16:20:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C74748FC16; Tue, 27 Nov 2012 16:20:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARGKiO0006554; Tue, 27 Nov 2012 16:20:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARGKiSq006553; Tue, 27 Nov 2012 16:20:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211271620.qARGKiSq006553@svn.freebsd.org> From: Ed Maste Date: Tue, 27 Nov 2012 16:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243616 - stable/9/sys/dev/mmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 16:20:45 -0000 Author: emaste Date: Tue Nov 27 16:20:44 2012 New Revision: 243616 URL: http://svnweb.freebsd.org/changeset/base/243616 Log: MFC r243387: Use %u for unsigned serial number Modified: stable/9/sys/dev/mmc/mmc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mmc/mmc.c ============================================================================== --- stable/9/sys/dev/mmc/mmc.c Tue Nov 27 12:23:57 2012 (r243615) +++ stable/9/sys/dev/mmc/mmc.c Tue Nov 27 16:20:44 2012 (r243616) @@ -878,7 +878,7 @@ mmc_format_card_id_string(struct mmc_iva else snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), - "%s%s %s %d.%d SN %d MFG %02d/%04d by %d %s", + "%s%s %s %d.%d SN %u MFG %02d/%04d by %d %s", ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 16:23:13 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 2E7E374F; Tue, 27 Nov 2012 16:23:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11DDB8FC08; Tue, 27 Nov 2012 16:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARGNCH4007018; Tue, 27 Nov 2012 16:23:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARGNCMH007017; Tue, 27 Nov 2012 16:23:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211271623.qARGNCMH007017@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Nov 2012 16:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243617 - head/usr.bin/passwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 16:23:13 -0000 Author: pjd Date: Tue Nov 27 16:23:12 2012 New Revision: 243617 URL: http://svnweb.freebsd.org/changeset/base/243617 Log: Respect NO_FSCHG and don't set 'schg' flag on passwd/yppasswd is defined. MFC after: 2 weeks Modified: head/usr.bin/passwd/Makefile Modified: head/usr.bin/passwd/Makefile ============================================================================== --- head/usr.bin/passwd/Makefile Tue Nov 27 16:20:44 2012 (r243616) +++ head/usr.bin/passwd/Makefile Tue Nov 27 16:23:12 2012 (r243617) @@ -19,7 +19,9 @@ beforeinstall: chflags noschg ${DESTDIR}${BINDIR}/$i || true .endfor +.if !defined(NO_FSCHG) afterinstall: -chflags schg ${DESTDIR}${BINDIR}/passwd +.endif .include From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 16:37:37 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 0DA73A63; Tue, 27 Nov 2012 16:37:37 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CAF058FC08; Tue, 27 Nov 2012 16:37:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARGbaUR009278; Tue, 27 Nov 2012 16:37:36 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARGbaGn009277; Tue, 27 Nov 2012 16:37:36 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211271637.qARGbaGn009277@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 27 Nov 2012 16:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243618 - stable/8/sys/dev/md X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 16:37:37 -0000 Author: jh Date: Tue Nov 27 16:37:36 2012 New Revision: 243618 URL: http://svnweb.freebsd.org/changeset/base/243618 Log: MFC r238991: Disallow sectorsize larger than MAXPHYS and mediasize smaller than sectorsize. PR: 169947 Modified: stable/8/sys/dev/md/md.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/md/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Tue Nov 27 16:23:12 2012 (r243617) +++ stable/8/sys/dev/md/md.c Tue Nov 27 16:37:36 2012 (r243618) @@ -1032,7 +1032,7 @@ mdcreate_swap(struct md_s *sc, struct md * Range check. Disallow negative sizes or any size less then the * size of a page. Then round to a page. */ - if (sc->mediasize == 0 || (sc->mediasize % PAGE_SIZE) != 0) + if (sc->mediasize <= 0 || (sc->mediasize % PAGE_SIZE) != 0) return (EDOM); /* @@ -1073,6 +1073,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd struct md_ioctl *mdio; struct md_s *sc; int error, i; + unsigned sectsize; if (md_debug) printf("mdctlioctl(%s %lx %p %x %p)\n", @@ -1101,6 +1102,12 @@ xmdctlioctl(struct cdev *dev, u_long cmd default: return (EINVAL); } + if (mdio->md_sectorsize == 0) + sectsize = DEV_BSIZE; + else + sectsize = mdio->md_sectorsize; + if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize) + return (EINVAL); if (mdio->md_options & MD_AUTOUNIT) sc = mdnew(-1, &error, mdio->md_type); else { @@ -1113,10 +1120,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd if (mdio->md_options & MD_AUTOUNIT) mdio->md_unit = sc->unit; sc->mediasize = mdio->md_mediasize; - if (mdio->md_sectorsize == 0) - sc->sectorsize = DEV_BSIZE; - else - sc->sectorsize = mdio->md_sectorsize; + sc->sectorsize = sectsize; error = EDOOFUS; switch (sc->type) { case MD_MALLOC: From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 19:07: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 6ED8D9B6; Tue, 27 Nov 2012 19:07:29 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52AF38FC14; Tue, 27 Nov 2012 19:07:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJ7TJR036037; Tue, 27 Nov 2012 19:07:29 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJ7Tma036036; Tue, 27 Nov 2012 19:07:29 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211271907.qARJ7Tma036036@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 19:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243621 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:07:29 -0000 Author: andre Date: Tue Nov 27 19:07:28 2012 New Revision: 243621 URL: http://svnweb.freebsd.org/changeset/base/243621 Log: Add DELACK to list of timers. MFC after: 1 week Modified: head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Tue Nov 27 19:00:44 2012 (r243620) +++ head/sys/netinet/tcp_timer.h Tue Nov 27 19:07:28 2012 (r243621) @@ -122,7 +122,7 @@ #ifdef TCPTIMERS static const char *tcptimers[] = - { "REXMT", "PERSIST", "KEEP", "2MSL" }; + { "REXMT", "PERSIST", "KEEP", "2MSL", "DELACK" }; #endif /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 19:09:37 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 6034EB45; Tue, 27 Nov 2012 19:09:37 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4551F8FC15; Tue, 27 Nov 2012 19:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJ9bPY036523; Tue, 27 Nov 2012 19:09:37 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJ9bST036522; Tue, 27 Nov 2012 19:09:37 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201211271909.qARJ9bST036522@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 27 Nov 2012 19:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243622 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:09:37 -0000 Author: bschmidt Date: Tue Nov 27 19:09:36 2012 New Revision: 243622 URL: http://svnweb.freebsd.org/changeset/base/243622 Log: fix a panic resulting from a stray '&' MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Nov 27 19:07:28 2012 (r243621) +++ head/sys/dev/iwn/if_iwn.c Tue Nov 27 19:09:36 2012 (r243622) @@ -1253,7 +1253,7 @@ iwn_dma_contig_free(struct iwn_dma_info bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(dma->tag, dma->map); - bus_dmamem_free(dma->tag, &dma->vaddr, dma->map); + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); dma->vaddr = NULL; } bus_dmamap_destroy(dma->tag, dma->map); From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 19:23:55 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 3928825E; Tue, 27 Nov 2012 19:23:55 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC318FC08; Tue, 27 Nov 2012 19:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJNsYb039481; Tue, 27 Nov 2012 19:23:54 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJNsbM039480; Tue, 27 Nov 2012 19:23:54 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201211271923.qARJNsbM039480@svn.freebsd.org> From: Peter Jeremy Date: Tue, 27 Nov 2012 19:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243623 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:23:55 -0000 Author: peterj Date: Tue Nov 27 19:23:54 2012 New Revision: 243623 URL: http://svnweb.freebsd.org/changeset/base/243623 Log: MFC r241708: Explicitly specify 'np' so that getty(8) does not simulate even parity on local.9600. PR: 76226 Approved by: jhb (mentor) Modified: stable/9/etc/gettytab Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/gettytab ============================================================================== --- stable/9/etc/gettytab Tue Nov 27 19:09:36 2012 (r243622) +++ stable/9/etc/gettytab Tue Nov 27 19:23:54 2012 (r243623) @@ -96,7 +96,7 @@ local.9600|CLOCAL tty @ 9600 Bd:\ :o0#0x00000007:o1#0x00000002:o2#0x00000007:\ :i0#0x00000704:i1#0x00000000:i2#0x00000704:\ :l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\ - :sp#9600: + :sp#9600:np: # # Dial in rotary tables, speed selection via 'break' From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 19:31:49 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 DAB32973; Tue, 27 Nov 2012 19:31:49 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7BAB8FC13; Tue, 27 Nov 2012 19:31:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJVnHx040851; Tue, 27 Nov 2012 19:31:49 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJVnxF040845; Tue, 27 Nov 2012 19:31:49 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211271931.qARJVnxF040845@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 19:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243624 - in head/sys: dev/bce dev/bxe net netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:31:49 -0000 Author: andre Date: Tue Nov 27 19:31:49 2012 New Revision: 243624 URL: http://svnweb.freebsd.org/changeset/base/243624 Log: Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability. Checksumming the IP header of fragments is no different from doing normal IP headers. Discussed with: yongari MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bxe/if_bxe.c head/sys/net/if_vlan.c head/sys/netinet/ip_output.c head/sys/sys/mbuf.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue Nov 27 19:23:54 2012 (r243623) +++ head/sys/dev/bce/if_bce.c Tue Nov 27 19:31:49 2012 (r243624) @@ -9880,7 +9880,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" "\22M_PROMISC\23M_NOFREE", mp->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Tue Nov 27 19:23:54 2012 (r243623) +++ head/sys/dev/bxe/if_bxe.c Tue Nov 27 19:31:49 2012 (r243624) @@ -16281,7 +16281,7 @@ void bxe_dump_mbuf(struct bxe_softc *sc, "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" "\22M_PROMISC\23M_NOFREE", m->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Nov 27 19:23:54 2012 (r243623) +++ head/sys/net/if_vlan.c Tue Nov 27 19:31:49 2012 (r243624) @@ -1493,7 +1493,7 @@ vlan_capabilities(struct ifvlan *ifv) p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT); + CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Nov 27 19:23:54 2012 (r243623) +++ head/sys/netinet/ip_output.c Tue Nov 27 19:31:49 2012 (r243624) @@ -722,14 +722,12 @@ ip_fragment(struct ip *ip, struct mbuf * * If the interface will not calculate checksums on * fragmented packets, then do it here. */ - if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP - if (m0->m_pkthdr.csum_flags & CSUM_SCTP && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { sctp_delayed_cksum(m0, hlen); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Nov 27 19:23:54 2012 (r243623) +++ head/sys/sys/mbuf.h Tue Nov 27 19:31:49 2012 (r243624) @@ -279,7 +279,6 @@ struct mbuf { #define CSUM_IP 0x0001 /* will csum IP */ #define CSUM_TCP 0x0002 /* will csum TCP */ #define CSUM_UDP 0x0004 /* will csum UDP */ -#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 19:33:25 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 C8AFDD7C; Tue, 27 Nov 2012 19:33:25 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD6938FC08; Tue, 27 Nov 2012 19:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJXPhi041251; Tue, 27 Nov 2012 19:33:25 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJXP1Z041250; Tue, 27 Nov 2012 19:33:25 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201211271933.qARJXP1Z041250@svn.freebsd.org> From: Peter Jeremy Date: Tue, 27 Nov 2012 19:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243625 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:33:25 -0000 Author: peterj Date: Tue Nov 27 19:33:25 2012 New Revision: 243625 URL: http://svnweb.freebsd.org/changeset/base/243625 Log: MFC r241708: Explicitly specify 'np' so that getty(8) does not simulate even parity on local.9600. PR: 76226 Approved by: jhb (mentor) Modified: stable/8/etc/gettytab Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/gettytab ============================================================================== --- stable/8/etc/gettytab Tue Nov 27 19:31:49 2012 (r243624) +++ stable/8/etc/gettytab Tue Nov 27 19:33:25 2012 (r243625) @@ -96,7 +96,7 @@ local.9600|CLOCAL tty @ 9600 Bd:\ :o0#0x00000007:o1#0x00000002:o2#0x00000007:\ :i0#0x00000704:i1#0x00000000:i2#0x00000704:\ :l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\ - :sp#9600: + :sp#9600:np: # # Dial in rotary tables, speed selection via 'break' From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 19:35: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 CF6B7CE; Tue, 27 Nov 2012 19:35:21 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B49768FC15; Tue, 27 Nov 2012 19:35:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARJZLPS041652; Tue, 27 Nov 2012 19:35:21 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARJZLgG041651; Tue, 27 Nov 2012 19:35:21 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201211271935.qARJZLgG041651@svn.freebsd.org> From: Peter Jeremy Date: Tue, 27 Nov 2012 19:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243626 - stable/7/etc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 19:35:21 -0000 Author: peterj Date: Tue Nov 27 19:35:21 2012 New Revision: 243626 URL: http://svnweb.freebsd.org/changeset/base/243626 Log: MFC r241708: Explicitly specify 'np' so that getty(8) does not simulate even parity on local.9600. PR: 76226 Approved by: jhb (mentor) Modified: stable/7/etc/gettytab Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/gettytab ============================================================================== --- stable/7/etc/gettytab Tue Nov 27 19:33:25 2012 (r243625) +++ stable/7/etc/gettytab Tue Nov 27 19:35:21 2012 (r243626) @@ -96,7 +96,7 @@ local.9600|CLOCAL tty @ 9600 Bd:\ :o0#0x00000007:o1#0x00000002:o2#0x00000007:\ :i0#0x00000704:i1#0x00000000:i2#0x00000704:\ :l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\ - :sp#9600: + :sp#9600:np: # # Dial in rotary tables, speed selection via 'break' From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 20:04: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 F238F9D0; Tue, 27 Nov 2012 20:04:52 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD6D28FC13; Tue, 27 Nov 2012 20:04:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARK4qHT047210; Tue, 27 Nov 2012 20:04:52 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARK4qS8047209; Tue, 27 Nov 2012 20:04:52 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211272004.qARK4qS8047209@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 20:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243627 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 20:04:53 -0000 Author: andre Date: Tue Nov 27 20:04:52 2012 New Revision: 243627 URL: http://svnweb.freebsd.org/changeset/base/243627 Log: Fix a race on listen socket teardown where while draining the accept queues a new socket/connection may be added to the queue due to a race on the ACCEPT_LOCK. The submitted patch is slightly changed in comments, teardown and locking order and extended with KASSERT's. Submitted by: Vijay Singh Found by: His team. MFC after: 1 week Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Nov 27 19:35:21 2012 (r243626) +++ head/sys/kern/uipc_socket.c Tue Nov 27 20:04:52 2012 (r243627) @@ -555,6 +555,16 @@ sonewconn(struct socket *head, int conns so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; so->so_state |= connstatus; ACCEPT_LOCK(); + /* + * The accept socket may be tearing down but we just + * won a race on the ACCEPT_LOCK. + */ + if (!(so->so_options & SO_ACCEPTCONN)) { + SOCK_LOCK(so); + so->so_head = NULL; + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ + return (NULL); + } if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); so->so_qstate |= SQ_COMP; @@ -780,9 +790,14 @@ soclose(struct socket *so) drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + ACCEPT_LOCK(); if (so->so_options & SO_ACCEPTCONN) { struct socket *sp; - ACCEPT_LOCK(); + /* + * Prevent new additions to the accept queues due + * to ACCEPT_LOCK races while we are draining them. + */ + so->so_options &= ~SO_ACCEPTCONN; while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { TAILQ_REMOVE(&so->so_incomp, sp, so_list); so->so_incqlen--; @@ -801,13 +816,15 @@ drop: soabort(sp); ACCEPT_LOCK(); } - ACCEPT_UNLOCK(); + KASSERT((TAILQ_EMPTY(&so->so_comp)), + ("%s: so_comp populated", __func__)); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), + ("%s: so_incomp populated", __func__)); } - ACCEPT_LOCK(); SOCK_LOCK(so); KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; - sorele(so); + sorele(so); /* NB: Returns with ACCEPT_UNLOCK(). */ CURVNET_RESTORE(); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 20:16: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 712D2DAB; Tue, 27 Nov 2012 20:16:02 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56B568FC16; Tue, 27 Nov 2012 20:16:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARKG2lb049492; Tue, 27 Nov 2012 20:16:02 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARKG221049491; Tue, 27 Nov 2012 20:16:02 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211272016.qARKG221049491@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 20:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243628 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 20:16:02 -0000 Author: andre Date: Tue Nov 27 20:16:01 2012 New Revision: 243628 URL: http://svnweb.freebsd.org/changeset/base/243628 Log: Update comment to prefer M_NOWAIT over M_DONTWAIT and M_WAITOK over M_WAIT. MFC after: 1 week Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Nov 27 20:04:52 2012 (r243627) +++ head/sys/sys/mbuf.h Tue Nov 27 20:16:01 2012 (r243628) @@ -349,8 +349,8 @@ struct mbstat { * Flags specifying how an allocation should be made. * * The flag to use is as follows: - * - M_DONTWAIT or M_NOWAIT from an interrupt handler to not block allocation. - * - M_WAIT or M_WAITOK from wherever it is safe to block. + * - M_NOWAIT (M_DONTWAIT) from an interrupt handler to not block allocation. + * - M_WAITOK (M_WAIT) from wherever it is safe to block. * * M_DONTWAIT/M_NOWAIT means that we will not block the thread explicitly and * if we cannot allocate immediately we may return NULL, whereas From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 20:16:37 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 C46EFF18; Tue, 27 Nov 2012 20:16:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1A18FC19; Tue, 27 Nov 2012 20:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARKGb9W049654; Tue, 27 Nov 2012 20:16:37 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARKGbQH049649; Tue, 27 Nov 2012 20:16:37 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211272016.qARKGbQH049649@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 27 Nov 2012 20:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243629 - in stable/8/sys: netinet netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 20:16:37 -0000 Author: melifaro Date: Tue Nov 27 20:16:37 2012 New Revision: 243629 URL: http://svnweb.freebsd.org/changeset/base/243629 Log: MFC r241406, r241502, r241884. Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is enabled. This eliminates one mtx_lock() per each routing lookup thus improving performance in several cases (routing to directly connected interface or routing to default gateway). Icmp redirects should not be used to provide routing direction nowadays, even for end hosts. Routers should not use them too (and this is explicitly restricted in IPv6, see RFC 4861, clause 8.2). Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every AF_INET routing table in given VNET instance on drop_redirect sysctl change. Eliminate code checking if found IPv6 rte is dynamic. IPv6 redirects are using (different) ND-based approach described in RFC 4861. This change is similar to r241406 which conditionally skips the same check in IPv4. Cleanup documentation: cloning route support has been removed in r186119. This change is part of bigger patch eliminating rte locking. Sponsored by: Yandex LLC Modified: stable/8/sys/netinet/in_rmx.c stable/8/sys/netinet/in_var.h stable/8/sys/netinet/ip_icmp.c stable/8/sys/netinet/ip_var.h stable/8/sys/netinet6/in6_rmx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/in_rmx.c ============================================================================== --- stable/8/sys/netinet/in_rmx.c Tue Nov 27 20:16:01 2012 (r243628) +++ stable/8/sys/netinet/in_rmx.c Tue Nov 27 20:16:37 2012 (r243629) @@ -27,19 +27,6 @@ * SUCH DAMAGE. */ -/* - * This code does two things necessary for the enhanced TCP metrics to - * function in a useful manner: - * 1) It marks all non-host routes as `cloning', thus ensuring that - * every actual reference to such a route actually gets turned - * into a reference to a host route to the specific destination - * requested. - * 2) When such routes lose all their references, it arranges for them - * to be deleted in some random collection of circumstances, so that - * a large quantity of stale routing data is not kept in kernel memory - * indefinitely. See in_rtqtimo() below for the exact mechanism. - */ - #include __FBSDID("$FreeBSD$"); @@ -58,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include extern int in_inithead(void **head, int off); @@ -340,6 +329,13 @@ in_rtqdrain(void) VNET_LIST_RUNLOCK_NOSLEEP(); } +void +in_setmatchfunc(struct radix_node_head *rnh, int val) +{ + + rnh->rnh_matchaddr = (val != 0) ? rn_match : in_matroute; +} + static int _in_rt_was_here; /* * Initialize our routing tree. @@ -365,7 +361,7 @@ in_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in_addroute; - rnh->rnh_matchaddr = in_matroute; + in_setmatchfunc(rnh, V_drop_redirect); rnh->rnh_close = in_clsroute; if (_in_rt_was_here == 0 ) { callout_init(&V_rtq_timer, CALLOUT_MPSAFE); Modified: stable/8/sys/netinet/in_var.h ============================================================================== --- stable/8/sys/netinet/in_var.h Tue Nov 27 20:16:01 2012 (r243628) +++ stable/8/sys/netinet/in_var.h Tue Nov 27 20:16:37 2012 (r243629) @@ -423,6 +423,7 @@ inm_acquire_locked(struct in_multi *inm) struct rtentry; struct route; struct ip_moptions; +struct radix_node_head; int imo_multi_filter(const struct ip_moptions *, const struct ifnet *, const struct sockaddr *, const struct sockaddr *); @@ -461,6 +462,7 @@ void in_rtredirect(struct sockaddr *, s struct sockaddr *, int, struct sockaddr *, u_int); int in_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); +void in_setmatchfunc(struct radix_node_head *, int); #if 0 int in_rt_getifa(struct rt_addrinfo *, u_int fibnum); Modified: stable/8/sys/netinet/ip_icmp.c ============================================================================== --- stable/8/sys/netinet/ip_icmp.c Tue Nov 27 20:16:01 2012 (r243628) +++ stable/8/sys/netinet/ip_icmp.c Tue Nov 27 20:16:37 2012 (r243629) @@ -92,11 +92,7 @@ SYSCTL_VNET_UINT(_net_inet_icmp, OID_AUT &VNET_NAME(icmpmaskfake), 0, "Fake reply to ICMP Address Mask Request packets."); -static VNET_DEFINE(int, drop_redirect) = 0; -#define V_drop_redirect VNET(drop_redirect) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, - &VNET_NAME(drop_redirect), 0, - "Ignore ICMP redirects"); +VNET_DEFINE(int, drop_redirect) = 0; static VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) @@ -153,6 +149,39 @@ static void icmp_send(struct mbuf *, str extern struct protosw inetsw[]; +static int +sysctl_net_icmp_drop_redir(SYSCTL_HANDLER_ARGS) +{ + int error, new; + int i; + struct radix_node_head *rnh; + + new = V_drop_redirect; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + new = (new != 0) ? 1 : 0; + + if (new == V_drop_redirect) + return (0); + + for (i = 0; i < rt_numfibs; i++) { + if ((rnh = rt_tables_get_rnh(i, AF_INET)) == NULL) + continue; + RADIX_NODE_HEAD_LOCK(rnh); + in_setmatchfunc(rnh, new); + RADIX_NODE_HEAD_UNLOCK(rnh); + } + + V_drop_redirect = new; + } + + return (error); +} + +SYSCTL_VNET_PROC(_net_inet_icmp, OID_AUTO, drop_redirect, + CTLTYPE_INT|CTLFLAG_RW, 0, 0, + sysctl_net_icmp_drop_redir, "I", "Ignore ICMP redirects"); + /* * Kernel module interface for updating icmpstat. The argument is an index * into icmpstat treated as an array of u_long. While this encodes the Modified: stable/8/sys/netinet/ip_var.h ============================================================================== --- stable/8/sys/netinet/ip_var.h Tue Nov 27 20:16:01 2012 (r243628) +++ stable/8/sys/netinet/ip_var.h Tue Nov 27 20:16:37 2012 (r243629) @@ -187,6 +187,7 @@ VNET_DECLARE(struct socket *, ip_mrouter extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); VNET_DECLARE(int, rsvp_on); +VNET_DECLARE(int, drop_redirect); extern struct pr_usrreqs rip_usrreqs; #define V_ipstat VNET(ipstat) @@ -199,6 +200,7 @@ extern struct pr_usrreqs rip_usrreqs; #define V_ip_rsvpd VNET(ip_rsvpd) #define V_ip_mrouter VNET(ip_mrouter) #define V_rsvp_on VNET(rsvp_on) +#define V_drop_redirect VNET(drop_redirect) void inp_freemoptions(struct ip_moptions *); int inp_getmoptions(struct inpcb *, struct sockopt *); Modified: stable/8/sys/netinet6/in6_rmx.c ============================================================================== --- stable/8/sys/netinet6/in6_rmx.c Tue Nov 27 20:16:01 2012 (r243628) +++ stable/8/sys/netinet6/in6_rmx.c Tue Nov 27 20:16:37 2012 (r243629) @@ -59,19 +59,6 @@ * */ -/* - * This code does two things necessary for the enhanced TCP metrics to - * function in a useful manner: - * 1) It marks all non-host routes as `cloning', thus ensuring that - * every actual reference to such a route actually gets turned - * into a reference to a host route to the specific destination - * requested. - * 2) When such routes lose all their references, it arranges for them - * to be deleted in some random collection of circumstances, so that - * a large quantity of stale routing data is not kept in kernel memory - * indefinitely. See in6_rtqtimo() below for the exact mechanism. - */ - #include __FBSDID("$FreeBSD$"); @@ -111,8 +98,6 @@ extern int in6_inithead(void **head, int extern int in6_detachhead(void **head, int off); #endif -#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ - /* * Do what we need to do when inserting a route. */ @@ -183,42 +168,8 @@ in6_addroute(void *v_arg, void *n_arg, s return (ret); } -/* - * This code is the inverse of in6_clsroute: on first reference, if we - * were managing the route, stop doing so and set the expiration timer - * back off again. - */ -static struct radix_node * -in6_matroute(void *v_arg, struct radix_node_head *head) -{ - struct radix_node *rn = rn_match(v_arg, head); - struct rtentry *rt = (struct rtentry *)rn; - - if (rt) { - RT_LOCK(rt); - if (rt->rt_flags & RTPRF_OURS) { - rt->rt_flags &= ~RTPRF_OURS; - rt->rt_rmx.rmx_expire = 0; - } - RT_UNLOCK(rt); - } - return rn; -} - SYSCTL_DECL(_net_inet6_ip6); -static VNET_DEFINE(int, rtq_reallyold6) = 60*60; - /* one hour is ``really old'' */ -#define V_rtq_reallyold6 VNET(rtq_reallyold6) -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire, CTLFLAG_RW, - &VNET_NAME(rtq_reallyold6) , 0, ""); - -static VNET_DEFINE(int, rtq_minreallyold6) = 10; - /* never automatically crank down to less */ -#define V_rtq_minreallyold6 VNET(rtq_minreallyold6) -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, - &VNET_NAME(rtq_minreallyold6) , 0, ""); - static VNET_DEFINE(int, rtq_toomany6) = 128; /* 128 cached routes is ``too many'' */ #define V_rtq_toomany6 VNET(rtq_toomany6) @@ -236,122 +187,6 @@ struct rtqk_arg { }; /* - * Get rid of old routes. When draining, this deletes everything, even when - * the timeout is not expired yet. When updating, this makes sure that - * nothing has a timeout longer than the current value of rtq_reallyold6. - */ -static int -in6_rtqkill(struct radix_node *rn, void *rock) -{ - struct rtqk_arg *ap = rock; - struct rtentry *rt = (struct rtentry *)rn; - int err; - - RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh); - - if (rt->rt_flags & RTPRF_OURS) { - ap->found++; - - if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) { - if (rt->rt_refcnt > 0) - panic("rtqkill route really not free"); - - err = in6_rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), - rt->rt_flags|RTF_RNH_LOCKED, 0, - rt->rt_fibnum); - if (err) { - log(LOG_WARNING, "in6_rtqkill: error %d", err); - } else { - ap->killed++; - } - } else { - if (ap->updating - && (rt->rt_rmx.rmx_expire - time_uptime - > V_rtq_reallyold6)) { - rt->rt_rmx.rmx_expire = time_uptime - + V_rtq_reallyold6; - } - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); - } - } - - return 0; -} - -#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout6) = RTQ_TIMEOUT; -static VNET_DEFINE(struct callout, rtq_timer6); - -#define V_rtq_timeout6 VNET(rtq_timeout6) -#define V_rtq_timer6 VNET(rtq_timer6) - -static void -in6_rtqtimo_one(struct radix_node_head *rnh) -{ - struct rtqk_arg arg; - static time_t last_adjusted_timeout = 0; - - arg.found = arg.killed = 0; - arg.rnh = rnh; - arg.nextstop = time_uptime + V_rtq_timeout6; - arg.draining = arg.updating = 0; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - - /* - * Attempt to be somewhat dynamic about this: - * If there are ``too many'' routes sitting around taking up space, - * then crank down the timeout, and see if we can't make some more - * go away. However, we make sure that we will never adjust more - * than once in rtq_timeout6 seconds, to keep from cranking down too - * hard. - */ - if ((arg.found - arg.killed > V_rtq_toomany6) - && (time_uptime - last_adjusted_timeout >= V_rtq_timeout6) - && V_rtq_reallyold6 > V_rtq_minreallyold6) { - V_rtq_reallyold6 = 2*V_rtq_reallyold6 / 3; - if (V_rtq_reallyold6 < V_rtq_minreallyold6) { - V_rtq_reallyold6 = V_rtq_minreallyold6; - } - - last_adjusted_timeout = time_uptime; -#ifdef DIAGNOSTIC - log(LOG_DEBUG, "in6_rtqtimo: adjusted rtq_reallyold6 to %d", - V_rtq_reallyold6); -#endif - arg.found = arg.killed = 0; - arg.updating = 1; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - } -} - -static void -in6_rtqtimo(void *rock) -{ - CURVNET_SET_QUIET((struct vnet *) rock); - struct radix_node_head *rnh; - struct timeval atv; - u_int fibnum; - - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET6); - if (rnh != NULL) - in6_rtqtimo_one(rnh); - } - - atv.tv_usec = 0; - atv.tv_sec = V_rtq_timeout6; - callout_reset(&V_rtq_timer6, tvtohz(&atv), in6_rtqtimo, rock); - CURVNET_RESTORE(); -} - -/* * Age old PMTUs. */ struct mtuex_arg { @@ -440,12 +275,9 @@ in6_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in6_addroute; - rnh->rnh_matchaddr = in6_matroute; if (V__in6_rt_was_here == 0) { - callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE); - in6_rtqtimo(curvnet); /* kick off timeout first time */ in6_mtutimo(curvnet); /* kick off timeout first time */ V__in6_rt_was_here = 1; } @@ -458,7 +290,6 @@ int in6_detachhead(void **head, int off) { - callout_drain(&V_rtq_timer6); callout_drain(&V_rtq_mtutimer); return (1); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 21:19:59 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 AC7FC521; Tue, 27 Nov 2012 21:19:59 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 868318FC14; Tue, 27 Nov 2012 21:19:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARLJxf3061088; Tue, 27 Nov 2012 21:19:59 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARLJxXV061083; Tue, 27 Nov 2012 21:19:59 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211272119.qARLJxXV061083@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 21:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243631 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 21:19:59 -0000 Author: andre Date: Tue Nov 27 21:19:58 2012 New Revision: 243631 URL: http://svnweb.freebsd.org/changeset/base/243631 Log: Base the mbuf related limits on the available physical memory or kernel memory, whichever is lower. The overall mbuf related memory limit must be set so that mbufs (and clusters of various sizes) can't exhaust physical RAM or KVM. The limit is set to half of the physical RAM or KVM (whichever is lower) as the baseline. In any normal scenario we want to leave at least half of the physmem/kvm for other kernel functions and userspace to prevent it from swapping too easily. Via a tunable kern.maxmbufmem the limit can be upped to at most 3/4 of physmem/kvm. At the same time divorce maxfiles from maxusers and set maxfiles to physpages / 8 with a floor based on maxusers. This way busy servers can make use of the significantly increased mbuf limits with a much larger number of open sockets. Tidy up ordering in init_param2() and check up on some users of those values calculated here. Out of the overall mbuf memory limit 2K clusters and 4K (page size) clusters to get 1/4 each because these are the most heavily used mbuf sizes. 2K clusters are used for MTU 1500 ethernet inbound packets. 4K clusters are used whenever possible for sends on sockets and thus outbound packets. The larger cluster sizes of 9K and 16K are limited to 1/6 of the overall mbuf memory limit. When jumbo MTU's are used these large clusters will end up only on the inbound path. They are not used on outbound, there it's still 4K. Yes, that will stay that way because otherwise we run into lots of complications in the stack. And it really isn't a problem, so don't make a scene. Normal mbufs (256B) weren't limited at all previously. This was problematic as there are certain places in the kernel that on allocation failure of clusters try to piece together their packet from smaller mbufs. The mbuf limit is the number of all other mbuf sizes together plus some more to allow for standalone mbufs (ACK for example) and to send off a copy of a cluster. Unfortunately there isn't a way to set an overall limit for all mbuf memory together as UMA doesn't support such a limiting. NB: Every cluster also has an mbuf associated with it. Two examples on the revised mbuf sizing limits: 1GB KVM: 512MB limit for mbufs 419,430 mbufs 65,536 2K mbuf clusters 32,768 4K mbuf clusters 9,709 9K mbuf clusters 5,461 16K mbuf clusters 16GB RAM: 8GB limit for mbufs 33,554,432 mbufs 1,048,576 2K mbuf clusters 524,288 4K mbuf clusters 155,344 9K mbuf clusters 87,381 16K mbuf clusters These defaults should be sufficient for even the most demanding network loads. MFC after: 1 month Modified: head/sys/kern/kern_mbuf.c head/sys/kern/subr_param.c head/sys/kern/uipc_socket.c head/sys/sys/eventhandler.h head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Nov 27 20:22:36 2012 (r243630) +++ head/sys/kern/kern_mbuf.c Tue Nov 27 21:19:58 2012 (r243631) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); * */ +int nmbufs; /* limits number of mbufs */ int nmbclusters; /* limits number of mbuf clusters */ int nmbjumbop; /* limits number of page size jumbo clusters */ int nmbjumbo9; /* limits number of 9k jumbo clusters */ @@ -147,9 +148,11 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) newnmbclusters = nmbclusters; error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); if (error == 0 && req->newptr) { - if (newnmbclusters > nmbclusters) { + if (newnmbclusters > nmbclusters && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbclusters = newnmbclusters; uma_zone_set_max(zone_clust, nmbclusters); + nmbclusters = uma_zone_get_max(zone_clust); EVENTHANDLER_INVOKE(nmbclusters_change); } else error = EINVAL; @@ -168,9 +171,11 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) newnmbjumbop = nmbjumbop; error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbop> nmbjumbop) { + if (newnmbjumbop > nmbjumbop && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbop = newnmbjumbop; uma_zone_set_max(zone_jumbop, nmbjumbop); + nmbjumbop = uma_zone_get_max(zone_jumbop); } else error = EINVAL; } @@ -189,9 +194,11 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) newnmbjumbo9 = nmbjumbo9; error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbo9> nmbjumbo9) { + if (newnmbjumbo9 > nmbjumbo9&& + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo9 = newnmbjumbo9; uma_zone_set_max(zone_jumbo9, nmbjumbo9); + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); } else error = EINVAL; } @@ -209,9 +216,11 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) newnmbjumbo16 = nmbjumbo16; error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbo16> nmbjumbo16) { + if (newnmbjumbo16 > nmbjumbo16 && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo16 = newnmbjumbo16; uma_zone_set_max(zone_jumbo16, nmbjumbo16); + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); } else error = EINVAL; } @@ -221,6 +230,27 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumb &nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); +static int +sysctl_nmbufs(SYSCTL_HANDLER_ARGS) +{ + int error, newnmbufs; + + newnmbufs = nmbufs; + error = sysctl_handle_int(oidp, &newnmbufs, 0, req); + if (error == 0 && req->newptr) { + if (newnmbufs > nmbufs) { + nmbufs = newnmbufs; + uma_zone_set_max(zone_mbuf, nmbufs); + nmbclusters = uma_zone_get_max(zone_mbuf); + EVENTHANDLER_INVOKE(nmbufs_change); + } else + error = EINVAL; + } + return (error); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbuf, CTLTYPE_INT|CTLFLAG_RW, +&nmbufs, 0, sysctl_nmbufs, "IU", + "Maximum number of mbufs allowed"); SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat, @@ -275,6 +305,10 @@ mbuf_init(void *dummy) NULL, NULL, #endif MSIZE - 1, UMA_ZONE_MAXBUCKET); + if (nmbufs > 0) { + uma_zone_set_max(zone_mbuf, nmbufs); + nmbufs = uma_zone_get_max(zone_mbuf); + } zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, mb_ctor_clust, mb_dtor_clust, @@ -284,8 +318,10 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbclusters > 0) + if (nmbclusters > 0) { uma_zone_set_max(zone_clust, nmbclusters); + nmbclusters = uma_zone_get_max(zone_clust); + } zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf); @@ -299,8 +335,10 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbjumbop > 0) + if (nmbjumbop > 0) { uma_zone_set_max(zone_jumbop, nmbjumbop); + nmbjumbop = uma_zone_get_max(zone_jumbop); + } zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, mb_ctor_clust, mb_dtor_clust, @@ -310,9 +348,11 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbjumbo9 > 0) - uma_zone_set_max(zone_jumbo9, nmbjumbo9); uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); + if (nmbjumbo9 > 0) { + uma_zone_set_max(zone_jumbo9, nmbjumbo9); + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); + } zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, mb_ctor_clust, mb_dtor_clust, @@ -322,9 +362,11 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbjumbo16 > 0) - uma_zone_set_max(zone_jumbo16, nmbjumbo16); uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); + if (nmbjumbo16 > 0) { + uma_zone_set_max(zone_jumbo16, nmbjumbo16); + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); + } zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), NULL, NULL, Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue Nov 27 20:22:36 2012 (r243630) +++ head/sys/kern/subr_param.c Tue Nov 27 21:19:58 2012 (r243631) @@ -93,6 +93,7 @@ int ncallout; /* maximum # of timer ev int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; +long maxmbufmem; /* max mbuf memory */ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ @@ -270,6 +271,7 @@ init_param1(void) void init_param2(long physpages) { + long realmem; /* Base parameters */ maxusers = MAXUSERS; @@ -293,19 +295,25 @@ init_param2(long physpages) /* * The following can be overridden after boot via sysctl. Note: * unless overriden, these macros are ultimately based on maxusers. - */ - maxproc = NPROC; - TUNABLE_INT_FETCH("kern.maxproc", &maxproc); - /* * Limit maxproc so that kmap entries cannot be exhausted by * processes. */ + maxproc = NPROC; + TUNABLE_INT_FETCH("kern.maxproc", &maxproc); if (maxproc > (physpages / 12)) maxproc = physpages / 12; - maxfiles = MAXFILES; - TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); maxprocperuid = (maxproc * 9) / 10; - maxfilesperproc = (maxfiles * 9) / 10; + + /* + * The default limit for maxfiles is 1/12 of the number of + * physical page but not less than 16 times maxusers. + * At most it can be 1/6 the number of physical pages. + */ + maxfiles = imax(MAXFILES, physpages / 8); + TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); + if (maxfiles > (physpages / 4)) + maxfiles = physpages / 4; + maxfilesperproc = (maxfiles / 10) * 9; /* * Cannot be changed after boot. @@ -313,20 +321,35 @@ init_param2(long physpages) nbuf = NBUF; TUNABLE_INT_FETCH("kern.nbuf", &nbuf); + /* + * XXX: Does the callout wheel have to be so big? + */ ncallout = 16 + maxproc + maxfiles; TUNABLE_INT_FETCH("kern.ncallout", &ncallout); /* + * The default limit for all mbuf related memory is 1/2 of all + * available kernel memory (physical or kmem). + * At most it can be 3/4 of available kernel memory. + */ + realmem = lmin(physpages * PAGE_SIZE, + VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); + maxmbufmem = realmem / 2; + TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); + if (maxmbufmem > (realmem / 4) * 3) + maxmbufmem = (realmem / 4) * 3; + + /* * The default for maxpipekva is min(1/64 of the kernel address space, * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ maxpipekva = (physpages / 64) * PAGE_SIZE; + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); if (maxpipekva < 512 * 1024) maxpipekva = 512 * 1024; if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64; - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); } /* Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Nov 27 20:22:36 2012 (r243630) +++ head/sys/kern/uipc_socket.c Tue Nov 27 21:19:58 2012 (r243631) @@ -290,7 +290,7 @@ init_maxsockets(void *ignored) { TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); - maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); + maxsockets = imax(maxsockets, maxfiles); } SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL); @@ -306,12 +306,9 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) newmaxsockets = maxsockets; error = sysctl_handle_int(oidp, &newmaxsockets, 0, req); if (error == 0 && req->newptr) { - if (newmaxsockets > maxsockets) { + if (newmaxsockets > maxsockets && + newmaxsockets <= maxfiles) { maxsockets = newmaxsockets; - if (maxsockets > ((maxfiles / 4) * 3)) { - maxfiles = (maxsockets * 5) / 4; - maxfilesperproc = (maxfiles * 9) / 10; - } EVENTHANDLER_INVOKE(maxsockets_change); } else error = EINVAL; Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Tue Nov 27 20:22:36 2012 (r243630) +++ head/sys/sys/eventhandler.h Tue Nov 27 21:19:58 2012 (r243631) @@ -253,6 +253,7 @@ EVENTHANDLER_DECLARE(thread_fini, thread typedef void (*uma_zone_chfn)(void *); EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); +EVENTHANDLER_DECLARE(nmbufs_change, uma_zone_chfn); EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); #endif /* SYS_EVENTHANDLER_H */ Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Nov 27 20:22:36 2012 (r243630) +++ head/sys/sys/mbuf.h Tue Nov 27 21:19:58 2012 (r243631) @@ -395,7 +395,7 @@ struct mbstat { * * The rest of it is defined in kern/kern_mbuf.c */ - +extern long maxmbufmem; extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; extern uma_zone_t zone_pack; From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 21:21:03 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 4432F6AA; Tue, 27 Nov 2012 21:21:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id BE6C58FC0C; Tue, 27 Nov 2012 21:21:02 +0000 (UTC) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qARLDeBn016488; Wed, 28 Nov 2012 08:13:40 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qARLDMdC027414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Nov 2012 08:13:32 +1100 Date: Wed, 28 Nov 2012 08:13:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek Subject: Re: svn commit: r243613 - head/sys/kern In-Reply-To: <201211271038.qARAcBeX044425@svn.freebsd.org> Message-ID: <20121128072724.A1049@besplex.bde.org> References: <201211271038.qARAcBeX044425@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=fbv1UDsF c=1 sm=1 a=baJ7GeqPacgA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=DSn26mRKnKe-ZutKH90A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 21:21:03 -0000 On Tue, 27 Nov 2012, Pawel Jakub Dawidek wrote: > Log: > Add kern.capmode_coredump sysctl/tunable to allow processes in capability mode > to dump core. You missed fixing some style bugs before touching this. > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Tue Nov 27 10:32:35 2012 (r243612) > +++ head/sys/kern/kern_sig.c Tue Nov 27 10:38:11 2012 (r243613) > @@ -175,6 +175,11 @@ TUNABLE_INT("kern.sugid_coredump", &sugi > SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, > &sugid_coredump, 0, "Allow setuid and setgid processes to dump core"); Normal indentation. Abnormal description of a flag. > > +static int capmode_coredump; > +TUNABLE_INT("kern.capmode_coredump", &capmode_coredump); > +SYSCTL_INT(_kern, OID_AUTO, capmode_coredump, CTLFLAG_RW, > + &capmode_coredump, 0, "Allow processes in capability mode to dump core"); > + Normal indentation. Abnormal description of a flag. > static int do_coredump = 1; > SYSCTL_INT(_kern, OID_AUTO, coredump, CTLFLAG_RW, > &do_coredump, 0, "Enable/Disable coredumps"); Abnormal indentation. Normal description of a flag as Enable/Disable (but better if it leaves out "Disable"). I'm not sure if the new flag is sufficiently different to deserve an "Allow" in it. The first one certainly doesn't. It is just another flag that gates the main one; when it is set, set*id processes aren't "Allowed" to dump core, but are forced to. It used to be described more or less correctly as "Enable coredumping set user/group ID processes", but this has been broken. The description was verbose and had bad grammar. Now it is verbose and has correct grammar, but is not obviously just a flag. My version doesn't fix this, but fixes the indentation and the order of the declarations (the basic do_coredump flag should be first, since it is first alphabetically, historically (?) and logically). The 2 newer flag also have a namespace error (they don't have a do_ prefix like the others). Among other bugs, this makes it sort incorrectly with the others. My version adds a do_ prefix to the second-newest one. Suggested rewordings for the old descriptions, and other style fixes (indentation, namespace): &do_coredump, 0, "Enable core dumps"); Statistics: on freefall now, sysctl -nda | grep -i ... shows 115 lines matching "enable", 38 matching "disable", and only 11 matching both; zgrep -ir on /usr/share/man shows 338 lines matching "core dump" and 168 matching "coredump", with most of the compressed spellings being for proper names like the coredumpsize rlimit and the wait flag WCOREDUMP. &do_sugid_coredump, 0, "Enable core dumps for set*id processes"); Now I don't like the "Enable" wording either. This flag is in addition to the other one, and neither "Enable" nor "Allow" fully describes the logic. A full verbose description is "Enable core dumps for set*id processes (if core dumps are not disabled for all processes)". > @@ -3134,12 +3139,17 @@ nomem: > int error, n; > int flags = O_CREAT | O_EXCL | FWRITE | O_NOFOLLOW; > int cmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; Old style bugs: - nested declarations - unsorted declarations - int variables not all in 1 declaration - initialization in declarations. > + int oflags = 0; > + > + if (capmode_coredump) > + oflags = VN_OPEN_NOCAPCHECK; New style bugs: - extend the previous bugs. Half of the initialization of oflags is in its declaration and half in 2 new lines. - extra blank line - other verboseness. The initialization of oflags can be written more concisely and clearly as oflags = capmode_coredump ? VN_OPEN_NOCAPCHECK : 0; This could be squeezed into its declaration line, but shouldn't be. Unless you make it slighly clearer by declaring oflags as const -- then its initialization must be in its declaration. This often applies for variables that hold translations of flags from one set to another. But I wouldn't go that far. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:05: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 7396D2A4; Tue, 27 Nov 2012 22:05:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58CEB8FC15; Tue, 27 Nov 2012 22:05:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARM52q3069036; Tue, 27 Nov 2012 22:05:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARM52O3069035; Tue, 27 Nov 2012 22:05:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211272205.qARM52O3069035@svn.freebsd.org> From: Devin Teske Date: Tue, 27 Nov 2012 22:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243634 - head/usr.sbin/bsdconfig/networking/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:05:02 -0000 Author: dteske Date: Tue Nov 27 22:05:01 2012 New Revision: 243634 URL: http://svnweb.freebsd.org/changeset/base/243634 Log: Comments. Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Tue Nov 27 21:45:42 2012 (r243633) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Tue Nov 27 22:05:01 2012 (r243634) @@ -107,7 +107,7 @@ f_validate_ipaddr() # f_dialog_iperror $error $ipaddr # # Display a msgbox with the appropriate error message for an error returned by -# f_validate_ipaddr above. +# the f_validate_ipaddr function above. # f_dialog_iperror() { @@ -285,7 +285,7 @@ f_validate_ipaddr6() # f_dialog_ip6error $error $ipv6_addr # # Display a msgbox with the appropriate error message for an error returned by -# f_validate_ipaddr6 above. +# the f_validate_ipaddr6 function above. # f_dialog_ip6error() { From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:11: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 E42706A8; Tue, 27 Nov 2012 22:11:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C8B0F8FC19; Tue, 27 Nov 2012 22:11:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARMBrt4070366; Tue, 27 Nov 2012 22:11:53 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARMBrPm070365; Tue, 27 Nov 2012 22:11:53 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211272211.qARMBrPm070365@svn.freebsd.org> From: Devin Teske Date: Tue, 27 Nov 2012 22:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243635 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:11:54 -0000 Author: dteske Date: Tue Nov 27 22:11:53 2012 New Revision: 243635 URL: http://svnweb.freebsd.org/changeset/base/243635 Log: Change self-initialization to occur when loaded versus the previous behavior which was to self-initialize during the first function-call. This didn't work so well because the first call was may or may-not be within a sub-shell (which prevented proper setup of the pass-thru file descriptor, resulting in dialogs that would not display). Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue Nov 27 22:05:01 2012 (r243634) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue Nov 27 22:11:53 2012 (r243635) @@ -72,8 +72,7 @@ unset XDIALOG_FORCE_AUTOSIZE unset XDIALOG_INFOBOX_TIMEOUT # -# Default behavior is to call f_dialog_init() automatically if not already -# called manually by the time the first f_dialog_*() function is used. +# Default behavior is to call f_dialog_init() automatically when loaded. # : ${DIALOG_SELF_INITIALIZE=1} @@ -185,8 +184,6 @@ f_dialog_backtitle_restore() # f_dialog_infobox_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 local min_width max_size @@ -308,8 +305,6 @@ f_dialog_infobox_size() # f_dialog_buttonbox_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" local size="$( f_dialog_infobox_size \ "$title" "$btitle" "$prompt" "$hline" )" @@ -355,8 +350,6 @@ f_dialog_buttonbox_size() # f_dialog_inputbox_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" init="$4" hline="$5" n local size="$( f_dialog_buttonbox_size \ "$title" "$btitle" "$prompt" "$hline" )" @@ -422,8 +415,6 @@ f_dialog_inputbox_size() # f_xdialog_2inputsbox_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" local label1="$4" init1="$5" label2="$6" init2="$7" n local size="$( f_dialog_inputbox_size \ @@ -519,8 +510,6 @@ f_xdialog_2inputsbox_size() # f_dialog_menu_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 local min_width min_rows max_size @@ -603,8 +592,6 @@ f_dialog_menu_size() # f_dialog_menu_with_help_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 local min_width min_rows max_size @@ -704,8 +691,6 @@ f_dialog_menu_with_help_size() # f_dialog_radiolist_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 local min_width min_rows max_size @@ -788,8 +773,6 @@ f_dialog_radiolist_size() # f_dialog_calendar_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" n local size="$( f_dialog_infobox_size \ "$title" "$btitle" "$prompt" "$hline" )" @@ -869,8 +852,6 @@ f_dialog_calendar_size() # f_dialog_timebox_size() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local title="$1" btitle="$2" prompt="$3" hline="$4" n local size="$( f_dialog_infobox_size \ "$title" "$btitle" "$prompt" "$hline" )" @@ -934,8 +915,6 @@ f_dialog_timebox_size() # f_dialog_clear() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - $DIALOG --clear } @@ -948,8 +927,6 @@ f_dialog_clear() # f_dialog_info() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local info_text="$*" local size="$( f_dialog_infobox_size \ "$DIALOG_TITLE" \ @@ -972,8 +949,6 @@ f_dialog_info() # f_xdialog_info() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local info_text="$*" local size="$( f_dialog_infobox_size \ "$DIALOG_TITLE" \ @@ -1000,8 +975,6 @@ f_xdialog_info() # f_dialog_msgbox() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local msg_text="$*" local size="$( f_dialog_buttonbox_size \ "$DIALOG_TITLE" \ @@ -1028,8 +1001,6 @@ f_dialog_msgbox() # f_dialog_textbox() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local file="$1" local contents retval size @@ -1070,8 +1041,6 @@ f_dialog_textbox() # f_dialog_yesno() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local msg_text="$*" local hline="$hline_arrows_tab_enter" local size="$( f_dialog_buttonbox_size \ @@ -1112,8 +1081,6 @@ f_dialog_yesno() # f_dialog_noyes() { - [ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init - local msg_text="$*" local hline="$hline_arrows_tab_enter" local size="$( f_dialog_buttonbox_size \ @@ -1462,4 +1429,8 @@ f_dialog_init() fi } +############################################################ MAIN + +[ "$DIALOG_SELF_INITIALIZE" ] && f_dialog_init + fi # ! $_DIALOG_SUBR From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:12:25 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 D8D5C82C for ; Tue, 27 Nov 2012 22:12:25 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 56D658FC14 for ; Tue, 27 Nov 2012 22:12:24 +0000 (UTC) Received: (qmail 37063 invoked from network); 27 Nov 2012 23:43:59 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 27 Nov 2012 23:43:59 -0000 Message-ID: <50B53ABC.1010304@freebsd.org> Date: Tue, 27 Nov 2012 23:12:12 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r243594 - head/sys/netinet References: <201211270304.qAR34PfD056691@svn.freebsd.org> In-Reply-To: <201211270304.qAR34PfD056691@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:12:25 -0000 On 27.11.2012 04:04, Alfred Perlstein wrote: > Author: alfred > Date: Tue Nov 27 03:04:24 2012 > New Revision: 243594 > URL: http://svnweb.freebsd.org/changeset/base/243594 > > Log: > Auto size the tcbhashsize structure based on max sockets. > > While here, also make the code that enforces power-of-two more > forgiving, instead of just resetting to 512, graciously round-down > to the next lower power of two. The porthash (also a parameter to in_pcbinfo_init()) should not be scaled the same as tcbhashsize. It's unlikely that anyone is going to have more than a thousand listen ports. The default tcbhashsize scaling factor of maxsockets / 4 is IMHO excessive. If someone is running at the limit he's going to up maxsockets to double the target load. Dividing by 8 is a better balance for normal and well used large memory machines. The hashsize calculation logic is done a bit in a roundabout way. What do think of the attached patch to fix the porthash and to simplify the hashsize logic? -- Andre Index: netinet/tcp_subr.c =================================================================== --- netinet/tcp_subr.c (revision 243631) +++ netinet/tcp_subr.c (working copy) @@ -229,14 +229,17 @@ void *ip4hdr, const void *ip6hdr); /* - * Target size of TCP PCB hash tables. Must be a power of two. + * Minimal size of TCP PCB hash tables. Must be a power of two. * * Note that this can be overridden by the kernel environment * variable net.inet.tcp.tcbhashsize */ -#ifndef TCBHASHSIZE -#define TCBHASHSIZE 0 +#ifndef TCBMINHASHSIZE +#define TCBMINHASHSIZE 512 #endif +#ifndef TCBPORTHASHSIZE +#define TCBPORTHASHSIZE 512 +#endif /* * XXX @@ -282,35 +285,10 @@ return (0); } -/* - * Take a value and get the next power of 2 that doesn't overflow. - * Used to size the tcp_inpcb hash buckets. - */ -static int -maketcp_hashsize(int size) -{ - int hashsize; - - /* - * auto tune. - * get the next power of 2 higher than maxsockets. - */ - hashsize = 1 << fls(size); - /* catch overflow, and just go one power of 2 smaller */ - if (hashsize < size) { - hashsize = 1 << (fls(size) - 1); - } - return (hashsize); -} - void tcp_init(void) { - const char *tcbhash_tuneable; - int hashsize; - tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; - if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, &V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); @@ -318,49 +296,17 @@ &V_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); - hashsize = TCBHASHSIZE; - TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); - if (hashsize == 0) { - /* - * Auto tune the hash size based on maxsockets. - * A perfect hash would have a 1:1 mapping - * (hashsize = maxsockets) however it's been - * suggested that O(2) average is better. - */ - hashsize = maketcp_hashsize(maxsockets / 4); - /* - * Our historical default is 512, - * do not autotune lower than this. - */ - if (hashsize < 512) - hashsize = 512; - if (bootverbose) - printf("%s: %s auto tuned to %d\n", __func__, - tcbhash_tuneable, hashsize); + tcp_tcbhashsize = 0x1 << fls((maxsockets / 8) - 1); + TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &tcp_tcbhashsize); + if (!powerof2(tcp_tcbhashsize) || + tcp_tcbhashsize < TCBMINHASHSIZE) { + printf("WARNING: TCB hash size not a power of 2 or too small\n"); + tcp_tcbhashsize = TCBMINHASHSIZE; } - /* - * We require a hashsize to be a power of two. - * Previously if it was not a power of two we would just reset it - * back to 512, which could be a nasty surprise if you did not notice - * the error message. - * Instead what we do is clip it to the closest power of two lower - * than the specified hash value. - */ - if (!powerof2(hashsize)) { - int oldhashsize = hashsize; + in_pcbinfo_init(&V_tcbinfo, "tcp", &V_tcb, tcp_tcbhashsize, + TCBPORTHASHSIZE, "tcp_inpcb", tcp_inpcb_init, NULL, + UMA_ZONE_NOFREE, IPI_HASHFIELDS_4TUPLE); - hashsize = maketcp_hashsize(hashsize); - /* prevent absurdly low value */ - if (hashsize < 16) - hashsize = 16; - printf("%s: WARNING: TCB hash size not a power of 2, " - "clipped from %d to %d.\n", __func__, oldhashsize, - hashsize); - } - in_pcbinfo_init(&V_tcbinfo, "tcp", &V_tcb, hashsize, hashsize, - "tcp_inpcb", tcp_inpcb_init, NULL, UMA_ZONE_NOFREE, - IPI_HASHFIELDS_4TUPLE); - /* * These have to be type stable for the benefit of the timers. */ @@ -393,7 +339,6 @@ tcp_rexmit_min = 1; tcp_rexmit_slop = TCPTV_CPU_VAR; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; - tcp_tcbhashsize = hashsize; TUNABLE_INT_FETCH("net.inet.tcp.soreceive_stream", &tcp_soreceive_stream); if (tcp_soreceive_stream) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:14:23 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 773B1A64; Tue, 27 Nov 2012 22:14:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CD268FC15; Tue, 27 Nov 2012 22:14:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARMEN6q070858; Tue, 27 Nov 2012 22:14:23 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARMENIN070857; Tue, 27 Nov 2012 22:14:23 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211272214.qARMENIN070857@svn.freebsd.org> From: Devin Teske Date: Tue, 27 Nov 2012 22:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243636 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:14:23 -0000 Author: dteske Date: Tue Nov 27 22:14:22 2012 New Revision: 243636 URL: http://svnweb.freebsd.org/changeset/base/243636 Log: Allow setting of NULL titles with f_dialog_[back]title(). Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue Nov 27 22:11:53 2012 (r243635) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue Nov 27 22:14:22 2012 (r243636) @@ -92,7 +92,7 @@ f_dialog_title() { local new_title="$1" - if [ "$new_title" ]; then + if [ "${1+set}" ]; then if [ "$USE_XDIALOG" ]; then _DIALOG_BACKTITLE="$DIALOG_BACKTITLE" DIALOG_BACKTITLE="$new_title" @@ -133,7 +133,7 @@ f_dialog_backtitle() { local new_backtitle="$1" - if [ "$new_backtitle" ]; then + if [ "${1+set}" ]; then if [ "$USE_XDIALOG" ]; then _DIALOG_TITLE="$DIALOG_TITLE" DIALOG_TITLE="$new_backtitle" From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:34:46 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 C6B7B5BD; Tue, 27 Nov 2012 22:34:46 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADBFD8FC15; Tue, 27 Nov 2012 22:34:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARMYkTs074157; Tue, 27 Nov 2012 22:34:46 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARMYk0D074156; Tue, 27 Nov 2012 22:34:46 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211272234.qARMYk0D074156@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 27 Nov 2012 22:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243637 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:34:46 -0000 Author: alfred Date: Tue Nov 27 22:34:46 2012 New Revision: 243637 URL: http://svnweb.freebsd.org/changeset/base/243637 Log: Autoconfigure nfsd threads based on ncpu. Rick Macklem and I discussed the default number of nfsd threads and concluded that it is too low to perform adiquitely on today's hardware. We decided to auto tune the number of nfsds based on the number of cpus in the system. While I'm here I've also added: 1) ability to set the minthreads/maxthreads from userland. 2) ability to run nfsd in debug mode via the cli. Reviewed by: rmacklem MFC after: 2 weeks Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Tue Nov 27 22:14:22 2012 (r243636) +++ head/usr.sbin/nfsd/nfsd.c Tue Nov 27 22:34:46 2012 (r243637) @@ -53,6 +53,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -71,14 +72,11 @@ static const char rcsid[] = #include #include #include +#include + +#include -/* Global defs */ -#ifdef DEBUG -#define syslog(e, s...) fprintf(stderr,s) -static int debug = 1; -#else static int debug = 0; -#endif #define NFSD_STABLERESTART "/var/db/nfs-stablerestart" #define NFSD_STABLEBACKUP "/var/db/nfs-stablerestart.bak" @@ -86,11 +84,26 @@ static int debug = 0; #define DEFNFSDCNT 4 static pid_t children[MAXNFSDCNT]; /* PIDs of children */ static int nfsdcnt; /* number of children */ +static int nfsdcnt_set; +static int minthreads; +static int maxthreads; static int new_syscall; static int run_v4server = 1; /* Force running of nfsv4 server */ static int nfssvc_nfsd; /* Set to correct NFSSVC_xxx flag */ static int stablefd = -1; /* Fd for the stable restart file */ static int backupfd; /* Fd for the backup stable restart file */ +static const char *getopt_shortopts; +static const char *getopt_usage; + +static int minthreads_set; +static int maxthreads_set; + +static struct option longopts[] = { + { "debug", no_argument, &debug, 1 }, + { "minthreads", required_argument, &minthreads_set, 1 }, + { "maxthreads", required_argument, &maxthreads_set, 1 }, + { NULL, 0, NULL, 0} +}; void cleanup(int); void child_cleanup(int); @@ -145,26 +158,28 @@ main(int argc, char **argv) int udpflag, ecode, error, s, srvcnt; int bindhostc, bindanyflag, rpcbreg, rpcbregcnt; int nfssvc_addsock; + int longindex = 0; + const char *lopt; char **bindhost = NULL; pid_t pid; nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = maxsock = 0; bindanyflag = udpflag = connect_type_cnt = bindhostc = 0; -#define GETOPT "ah:n:rdtueo" -#define USAGE "[-ardtueo] [-n num_servers] [-h bindip]" - while ((ch = getopt(argc, argv, GETOPT)) != -1) + getopt_shortopts = "ah:n:rdtueo"; + getopt_usage = + "usage:\n" + " nfsd [-ardtueo] [-h bindip]\n" + " [-n numservers] [--minthreads #] [--maxthreads #]\n"; + while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, + &longindex)) != -1) switch (ch) { case 'a': bindanyflag = 1; break; case 'n': + nfsdcnt_set = 1; nfsdcnt = atoi(optarg); - if (nfsdcnt < 1 || nfsdcnt > MAXNFSDCNT) { - warnx("nfsd count %d; reset to %d", nfsdcnt, - DEFNFSDCNT); - nfsdcnt = DEFNFSDCNT; - } break; case 'h': bindhostc++; @@ -193,6 +208,14 @@ main(int argc, char **argv) case 'o': run_v4server = 0; break; + case 0: + lopt = longopts[longindex].name; + if (!strcmp(lopt, "minthreads")) { + minthreads = atoi(optarg); + } else if (!strcmp(lopt, "maxthreads")) { + maxthreads = atoi(optarg); + } + break; default: case '?': usage(); @@ -209,6 +232,7 @@ main(int argc, char **argv) if (argc > 1) usage(); if (argc == 1) { + nfsdcnt_set = 1; nfsdcnt = atoi(argv[0]); if (nfsdcnt < 1 || nfsdcnt > MAXNFSDCNT) { warnx("nfsd count %d; reset to %d", nfsdcnt, @@ -356,7 +380,7 @@ main(int argc, char **argv) (void)signal(SIGCHLD, reapchild); (void)signal(SIGUSR2, backup_stable); - openlog("nfsd", LOG_PID, LOG_DAEMON); + openlog("nfsd", LOG_PID | (debug ? LOG_PERROR : 0), LOG_DAEMON); /* * For V4, we open the stablerestart file and call nfssvc() @@ -374,13 +398,13 @@ main(int argc, char **argv) if (run_v4server > 0) { open_stable(&stablefd, &backupfd); if (stablefd < 0) { - syslog(LOG_ERR, "Can't open %s\n", NFSD_STABLERESTART); + syslog(LOG_ERR, "Can't open %s: %m\n", NFSD_STABLERESTART); exit(1); } /* This system call will fail for old kernels, but that's ok. */ nfssvc(NFSSVC_BACKUPSTABLE, NULL); if (nfssvc(NFSSVC_STABLERESTART, (caddr_t)&stablefd) < 0) { - syslog(LOG_ERR, "Can't read stable storage file\n"); + syslog(LOG_ERR, "Can't read stable storage file: %m\n"); exit(1); } nfssvc_addsock = NFSSVC_NFSDADDSOCK; @@ -401,6 +425,16 @@ main(int argc, char **argv) } if (!new_syscall) { + if (nfsdcnt < 1) { + warnx("nfsd count too low %d; reset to %d", nfsdcnt, + DEFNFSDCNT); + nfsdcnt = DEFNFSDCNT; + } + if (nfsdcnt > MAXNFSDCNT) { + warnx("nfsd counta too high %d; reset to %d", nfsdcnt, + DEFNFSDCNT); + nfsdcnt = MAXNFSDCNT; + } /* If we use UDP only, we start the last server below. */ srvcnt = tcpflag ? nfsdcnt : nfsdcnt - 1; for (i = 0; i < srvcnt; i++) { @@ -855,7 +889,7 @@ setbindhost(struct addrinfo **ai, const void usage(void) { - (void)fprintf(stderr, "usage: nfsd %s\n", USAGE); + (void)fprintf(stderr, "%s", getopt_usage); exit(1); } @@ -923,6 +957,29 @@ nfsd_exit(int status) exit(status); } +static int +get_tuned_nfsdcount(void) +{ + int ncpu, error, tuned_nfsdcnt; + size_t ncpu_size; + + ncpu_size = sizeof(ncpu); + error = sysctlbyname("hw.ncpu", &ncpu, &ncpu_size, NULL, 0); + if (error) { + warnx("sysctlbyname(hw.ncpu) failed defaulting to %d nfs servers", + DEFNFSDCNT); + tuned_nfsdcnt = DEFNFSDCNT; + } else { + tuned_nfsdcnt = ncpu * 8; + } + if (!new_syscall && tuned_nfsdcnt > MAXNFSDCNT) { + warnx("nfsd count %d; truncated to %d", tuned_nfsdcnt, + MAXNFSDCNT); + tuned_nfsdcnt = MAXNFSDCNT; + } + return tuned_nfsdcnt; +} + void start_server(int master) { @@ -952,8 +1009,28 @@ start_server(int master) } } nfsdargs.principal = principal; - nfsdargs.minthreads = nfsdcnt; - nfsdargs.maxthreads = nfsdcnt; + + if (minthreads_set) { + nfsdargs.minthreads = minthreads; + if (!maxthreads_set) + nfsdargs.maxthreads = minthreads; + } + if (maxthreads_set) { + nfsdargs.maxthreads = maxthreads; + if (!minthreads_set) + nfsdargs.minthreads = maxthreads; + } + if (nfsdcnt_set) { + nfsdargs.minthreads = nfsdcnt; + nfsdargs.maxthreads = nfsdcnt; + } + if (!minthreads_set && !maxthreads_set && !nfsdcnt_set) { + int tuned_nfsdcnt; + + tuned_nfsdcnt = get_tuned_nfsdcount(); + nfsdargs.minthreads = tuned_nfsdcnt; + nfsdargs.maxthreads = tuned_nfsdcnt; + } error = nfssvc(nfssvc_nfsd, &nfsdargs); if (error < 0 && errno == EAUTH) { /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:35:44 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 BFE8F768 for ; Tue, 27 Nov 2012 22:35:44 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 346B88FC16 for ; Tue, 27 Nov 2012 22:35:43 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so9836363lbb.13 for ; Tue, 27 Nov 2012 14:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NBZhnIAnjZp+Yc2JRsOuekKN6FwjlIfdnt6xfO+i02M=; b=Mv/HI3BS3TjsKmsofn/3akds0JcTyfjeXBPI406n3l6oU0mbrWXLAtBnCdu2UGATmZ hGmIkavWralFftN/F31m86GDZujWdp7fh1x7KXUsyyM7XxZin9jyR5HAlzjeMk31RBRF fhHEtRhCS4ni7qfevddnPoxPD4euTfwg6ZDwI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=NBZhnIAnjZp+Yc2JRsOuekKN6FwjlIfdnt6xfO+i02M=; b=PiDp8CZfrvhJdU3fl4VK/I3i4TWGWgCJ0wgzlM+tfXvlVguH6V7Lg0mAd6tAdx5NgJ 1xtykCfGgXOtl7GzutNaclUsz+7We6CgljOb3ohCsOkN8Ho7oNBRPxINCzvjpGaJGLhD HYsQMLNFSNjW9Kn3PGkRPq3DOtjGXlAZDCwRLaV1VrcXozWo/Wau4J2ImSZ2h8VDvISJ 9r4usPFbLAWbyU/aqwYmGClP5hUeNiQfJ/FPHcxMGIPLPlopeXiwe7tOlZkxjPug+dto wE0Uefw1sQxq89Zrc6h7jESg5KRAouTLhr0Sy4W9qY5yv9m9ADB/w5w5jaNYuMzlBP1L +0+A== MIME-Version: 1.0 Received: by 10.112.87.40 with SMTP id u8mr7240718lbz.50.1354055742336; Tue, 27 Nov 2012 14:35:42 -0800 (PST) Received: by 10.112.8.36 with HTTP; Tue, 27 Nov 2012 14:35:42 -0800 (PST) In-Reply-To: <201211272004.qARK4qS8047209@svn.freebsd.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> Date: Tue, 27 Nov 2012 14:35:42 -0800 Message-ID: Subject: Re: svn commit: r243627 - head/sys/kern From: Peter Wemm To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmzUSmgGSMiYfeybiv+WwhB3efXuQ+fZqaHRJ882vRvmpbaVgVboxminFRHgmIkVCQD5hTS Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:35:44 -0000 Andre.. this breaks incoming connections. TCP is immediately reset and never even gets to the listener process. You need to back out of fix this urgently please. On Tue, Nov 27, 2012 at 12:04 PM, Andre Oppermann wrote: > Author: andre > Date: Tue Nov 27 20:04:52 2012 > New Revision: 243627 > URL: http://svnweb.freebsd.org/changeset/base/243627 > > Log: > Fix a race on listen socket teardown where while draining the > accept queues a new socket/connection may be added to the queue > due to a race on the ACCEPT_LOCK. > > The submitted patch is slightly changed in comments, teardown > and locking order and extended with KASSERT's. > > Submitted by: Vijay Singh > Found by: His team. > MFC after: 1 week > > Modified: > head/sys/kern/uipc_socket.c > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Tue Nov 27 19:35:21 2012 (r243626) > +++ head/sys/kern/uipc_socket.c Tue Nov 27 20:04:52 2012 (r243627) > @@ -555,6 +555,16 @@ sonewconn(struct socket *head, int conns > so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; > so->so_state |= connstatus; > ACCEPT_LOCK(); > + /* > + * The accept socket may be tearing down but we just > + * won a race on the ACCEPT_LOCK. > + */ > + if (!(so->so_options & SO_ACCEPTCONN)) { > + SOCK_LOCK(so); > + so->so_head = NULL; > + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ > + return (NULL); > + } > if (connstatus) { > TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); > so->so_qstate |= SQ_COMP; > @@ -780,9 +790,14 @@ soclose(struct socket *so) > drop: > if (so->so_proto->pr_usrreqs->pru_close != NULL) > (*so->so_proto->pr_usrreqs->pru_close)(so); > + ACCEPT_LOCK(); > if (so->so_options & SO_ACCEPTCONN) { > struct socket *sp; > - ACCEPT_LOCK(); > + /* > + * Prevent new additions to the accept queues due > + * to ACCEPT_LOCK races while we are draining them. > + */ > + so->so_options &= ~SO_ACCEPTCONN; > while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { > TAILQ_REMOVE(&so->so_incomp, sp, so_list); > so->so_incqlen--; > @@ -801,13 +816,15 @@ drop: > soabort(sp); > ACCEPT_LOCK(); > } > - ACCEPT_UNLOCK(); > + KASSERT((TAILQ_EMPTY(&so->so_comp)), > + ("%s: so_comp populated", __func__)); > + KASSERT((TAILQ_EMPTY(&so->so_incomp)), > + ("%s: so_incomp populated", __func__)); > } > - ACCEPT_LOCK(); > SOCK_LOCK(so); > KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); > so->so_state |= SS_NOFDREF; > - sorele(so); > + sorele(so); /* NB: Returns with ACCEPT_UNLOCK(). */ > CURVNET_RESTORE(); > return (error); > } -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:35:49 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 17D0B76D; Tue, 27 Nov 2012 22:35:49 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1B558FC16; Tue, 27 Nov 2012 22:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARMZmor074348; Tue, 27 Nov 2012 22:35:48 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARMZmji074347; Tue, 27 Nov 2012 22:35:48 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211272235.qARMZmji074347@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 22:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243638 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:35:49 -0000 Author: andre Date: Tue Nov 27 22:35:48 2012 New Revision: 243638 URL: http://svnweb.freebsd.org/changeset/base/243638 Log: Fix r243627 by testing against the head socket instead of the socket just created. MFC after: 1 week X-MFC-with: r243627 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Nov 27 22:34:46 2012 (r243637) +++ head/sys/kern/uipc_socket.c Tue Nov 27 22:35:48 2012 (r243638) @@ -556,7 +556,7 @@ sonewconn(struct socket *head, int conns * The accept socket may be tearing down but we just * won a race on the ACCEPT_LOCK. */ - if (!(so->so_options & SO_ACCEPTCONN)) { + if (!(head->so_options & SO_ACCEPTCONN)) { SOCK_LOCK(so); so->so_head = NULL; sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:41: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 CFE1ABFE for ; Tue, 27 Nov 2012 22:41:17 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 20EE88FC15 for ; Tue, 27 Nov 2012 22:41:16 +0000 (UTC) Received: (qmail 37223 invoked from network); 28 Nov 2012 00:12:51 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Nov 2012 00:12:51 -0000 Message-ID: <50B54180.5020608@freebsd.org> Date: Tue, 27 Nov 2012 23:41:04 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r243627 - head/sys/kern References: <201211272004.qARK4qS8047209@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:41:18 -0000 On 27.11.2012 23:35, Peter Wemm wrote: > Andre.. this breaks incoming connections. TCP is immediately reset > and never even gets to the listener process. You need to back out of > fix this urgently please. I just found out and fixed it. Sorry for the breakage. -- Andre > On Tue, Nov 27, 2012 at 12:04 PM, Andre Oppermann wrote: >> Author: andre >> Date: Tue Nov 27 20:04:52 2012 >> New Revision: 243627 >> URL: http://svnweb.freebsd.org/changeset/base/243627 >> >> Log: >> Fix a race on listen socket teardown where while draining the >> accept queues a new socket/connection may be added to the queue >> due to a race on the ACCEPT_LOCK. >> >> The submitted patch is slightly changed in comments, teardown >> and locking order and extended with KASSERT's. >> >> Submitted by: Vijay Singh >> Found by: His team. >> MFC after: 1 week >> >> Modified: >> head/sys/kern/uipc_socket.c >> >> Modified: head/sys/kern/uipc_socket.c >> ============================================================================== >> --- head/sys/kern/uipc_socket.c Tue Nov 27 19:35:21 2012 (r243626) >> +++ head/sys/kern/uipc_socket.c Tue Nov 27 20:04:52 2012 (r243627) >> @@ -555,6 +555,16 @@ sonewconn(struct socket *head, int conns >> so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; >> so->so_state |= connstatus; >> ACCEPT_LOCK(); >> + /* >> + * The accept socket may be tearing down but we just >> + * won a race on the ACCEPT_LOCK. >> + */ >> + if (!(so->so_options & SO_ACCEPTCONN)) { >> + SOCK_LOCK(so); >> + so->so_head = NULL; >> + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ >> + return (NULL); >> + } >> if (connstatus) { >> TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); >> so->so_qstate |= SQ_COMP; >> @@ -780,9 +790,14 @@ soclose(struct socket *so) >> drop: >> if (so->so_proto->pr_usrreqs->pru_close != NULL) >> (*so->so_proto->pr_usrreqs->pru_close)(so); >> + ACCEPT_LOCK(); >> if (so->so_options & SO_ACCEPTCONN) { >> struct socket *sp; >> - ACCEPT_LOCK(); >> + /* >> + * Prevent new additions to the accept queues due >> + * to ACCEPT_LOCK races while we are draining them. >> + */ >> + so->so_options &= ~SO_ACCEPTCONN; >> while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { >> TAILQ_REMOVE(&so->so_incomp, sp, so_list); >> so->so_incqlen--; >> @@ -801,13 +816,15 @@ drop: >> soabort(sp); >> ACCEPT_LOCK(); >> } >> - ACCEPT_UNLOCK(); >> + KASSERT((TAILQ_EMPTY(&so->so_comp)), >> + ("%s: so_comp populated", __func__)); >> + KASSERT((TAILQ_EMPTY(&so->so_incomp)), >> + ("%s: so_incomp populated", __func__)); >> } >> - ACCEPT_LOCK(); >> SOCK_LOCK(so); >> KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); >> so->so_state |= SS_NOFDREF; >> - sorele(so); >> + sorele(so); /* NB: Returns with ACCEPT_UNLOCK(). */ >> CURVNET_RESTORE(); >> return (error); >> } > > > From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:48:50 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 83101E7D; Tue, 27 Nov 2012 22:48:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 361298FC14; Tue, 27 Nov 2012 22:48:50 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C37CB46B17; Tue, 27 Nov 2012 17:48:49 -0500 (EST) Date: Tue, 27 Nov 2012 22:48:49 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andre Oppermann Subject: Re: svn commit: r243627 - head/sys/kern In-Reply-To: <50B54180.5020608@freebsd.org> Message-ID: References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:48:50 -0000 On Tue, 27 Nov 2012, Andre Oppermann wrote: > On 27.11.2012 23:35, Peter Wemm wrote: >> Andre.. this breaks incoming connections. TCP is immediately reset and >> never even gets to the listener process. You need to back out of fix this >> urgently please. > > I just found out and fixed it. Sorry for the breakage. I'd like to see a much more thorough use of "Reviewed by:" in socket and TCP-related commits -- this is very sensitive code, and a second pair of eyes is always valuable. Post-commit review is not a substitute. Looking back over similar changes in the socket code over the last two years, I see that almost all have reviewers, so I think it would be reasonable to consider it mandatory for these subsystems at this point. The good news is that we have lots of people with expertise in it. Robert > > -- > Andre > >> On Tue, Nov 27, 2012 at 12:04 PM, Andre Oppermann >> wrote: >>> Author: andre >>> Date: Tue Nov 27 20:04:52 2012 >>> New Revision: 243627 >>> URL: http://svnweb.freebsd.org/changeset/base/243627 >>> >>> Log: >>> Fix a race on listen socket teardown where while draining the >>> accept queues a new socket/connection may be added to the queue >>> due to a race on the ACCEPT_LOCK. >>> >>> The submitted patch is slightly changed in comments, teardown >>> and locking order and extended with KASSERT's. >>> >>> Submitted by: Vijay Singh >>> Found by: His team. >>> MFC after: 1 week >>> >>> Modified: >>> head/sys/kern/uipc_socket.c >>> >>> Modified: head/sys/kern/uipc_socket.c >>> ============================================================================== >>> --- head/sys/kern/uipc_socket.c Tue Nov 27 19:35:21 2012 (r243626) >>> +++ head/sys/kern/uipc_socket.c Tue Nov 27 20:04:52 2012 (r243627) >>> @@ -555,6 +555,16 @@ sonewconn(struct socket *head, int conns >>> so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; >>> so->so_state |= connstatus; >>> ACCEPT_LOCK(); >>> + /* >>> + * The accept socket may be tearing down but we just >>> + * won a race on the ACCEPT_LOCK. >>> + */ >>> + if (!(so->so_options & SO_ACCEPTCONN)) { >>> + SOCK_LOCK(so); >>> + so->so_head = NULL; >>> + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. >>> */ >>> + return (NULL); >>> + } >>> if (connstatus) { >>> TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); >>> so->so_qstate |= SQ_COMP; >>> @@ -780,9 +790,14 @@ soclose(struct socket *so) >>> drop: >>> if (so->so_proto->pr_usrreqs->pru_close != NULL) >>> (*so->so_proto->pr_usrreqs->pru_close)(so); >>> + ACCEPT_LOCK(); >>> if (so->so_options & SO_ACCEPTCONN) { >>> struct socket *sp; >>> - ACCEPT_LOCK(); >>> + /* >>> + * Prevent new additions to the accept queues due >>> + * to ACCEPT_LOCK races while we are draining them. >>> + */ >>> + so->so_options &= ~SO_ACCEPTCONN; >>> while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { >>> TAILQ_REMOVE(&so->so_incomp, sp, so_list); >>> so->so_incqlen--; >>> @@ -801,13 +816,15 @@ drop: >>> soabort(sp); >>> ACCEPT_LOCK(); >>> } >>> - ACCEPT_UNLOCK(); >>> + KASSERT((TAILQ_EMPTY(&so->so_comp)), >>> + ("%s: so_comp populated", __func__)); >>> + KASSERT((TAILQ_EMPTY(&so->so_incomp)), >>> + ("%s: so_incomp populated", __func__)); >>> } >>> - ACCEPT_LOCK(); >>> SOCK_LOCK(so); >>> KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); >>> so->so_state |= SS_NOFDREF; >>> - sorele(so); >>> + sorele(so); /* NB: Returns with >>> ACCEPT_UNLOCK(). */ >>> CURVNET_RESTORE(); >>> return (error); >>> } >> >> >> > > From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 22:54:23 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 5259B212 for ; Tue, 27 Nov 2012 22:54:23 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id AF4FC8FC1A for ; Tue, 27 Nov 2012 22:54:22 +0000 (UTC) Received: (qmail 37300 invoked from network); 28 Nov 2012 00:25:56 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Nov 2012 00:25:56 -0000 Message-ID: <50B54492.5040100@freebsd.org> Date: Tue, 27 Nov 2012 23:54:10 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Robert Watson Subject: Re: svn commit: r243627 - head/sys/kern References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:54:23 -0000 On 27.11.2012 23:48, Robert Watson wrote: > > On Tue, 27 Nov 2012, Andre Oppermann wrote: > >> On 27.11.2012 23:35, Peter Wemm wrote: >>> Andre.. this breaks incoming connections. TCP is immediately reset and never even gets to the >>> listener process. You need to back out of fix this urgently please. >> >> I just found out and fixed it. Sorry for the breakage. > > I'd like to see a much more thorough use of "Reviewed by:" in socket and TCP-related commits -- this > is very sensitive code, and a second pair of eyes is always valuable. Post-commit review is not a > substitute. Looking back over similar changes in the socket code over the last two years, I see > that almost all have reviewers, so I think it would be reasonable to consider it mandatory for these > subsystems at this point. The good news is that we have lots of people with expertise in it. Good to see you becoming more active again. :-) And yes, you have a point there. -- Andre From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 23:05: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 0332E71B; Tue, 27 Nov 2012 23:05:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C1C058FC15; Tue, 27 Nov 2012 23:05:41 +0000 (UTC) Received: from [192.168.2.119] (host86-146-118-26.range86-146.btcentralplus.com [86.146.118.26]) by cyrus.watson.org (Postfix) with ESMTPSA id 8EF1D46B06; Tue, 27 Nov 2012 18:05:40 -0500 (EST) Subject: Re: svn commit: r243627 - head/sys/kern Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: "Robert N. M. Watson" In-Reply-To: <50B54492.5040100@freebsd.org> Date: Tue, 27 Nov 2012 23:05:39 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 23:05:42 -0000 On 27 Nov 2012, at 22:54, Andre Oppermann wrote: >>>> Andre.. this breaks incoming connections. TCP is immediately reset = and never even gets to the >>>> listener process. You need to back out of fix this urgently = please. >>>=20 >>> I just found out and fixed it. Sorry for the breakage. >>=20 >> I'd like to see a much more thorough use of "Reviewed by:" in socket = and TCP-related commits -- this >> is very sensitive code, and a second pair of eyes is always valuable. = Post-commit review is not a >> substitute. Looking back over similar changes in the socket code = over the last two years, I see >> that almost all have reviewers, so I think it would be reasonable to = consider it mandatory for these >> subsystems at this point. The good news is that we have lots of = people with expertise in it. >=20 > Good to see you becoming more active again. :-) And yes, > you have a point there. Yes -- this is only about three weeks old, however; for the prior = six-twelve months, I've been fairly non-existent in FreeBSD-land due to = outside obligations :-). Robert= From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 23:16: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 42E4D123; Tue, 27 Nov 2012 23:16:57 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8368FC08; Tue, 27 Nov 2012 23:16:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qARNGuJL080899; Tue, 27 Nov 2012 23:16:56 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qARNGurs080897; Tue, 27 Nov 2012 23:16:56 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211272316.qARNGurs080897@svn.freebsd.org> From: Andre Oppermann Date: Tue, 27 Nov 2012 23:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243639 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 23:16:57 -0000 Author: andre Date: Tue Nov 27 23:16:56 2012 New Revision: 243639 URL: http://svnweb.freebsd.org/changeset/base/243639 Log: Complete r243631 by applying the remainder of kern_mbuf.c that got lost while merging into the commit tree. MFC after: 1 month X-MFC-with: r243631 Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Nov 27 22:35:48 2012 (r243638) +++ head/sys/kern/kern_mbuf.c Tue Nov 27 23:16:56 2012 (r243639) @@ -107,36 +107,38 @@ struct mbstat mbstat; * tunable_mbinit() has to be run before init_maxsockets() thus * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() * runs at SI_ORDER_ANY. + * + * NB: This has to be done before VM init. */ static void tunable_mbinit(void *dummy) { - /* This has to be done before VM init. */ TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); - if (nmbclusters == 0) { -#ifdef VM_AUTOTUNE_NMBCLUSTERS - nmbclusters = VM_AUTOTUNE_NMBCLUSTERS; -#else - nmbclusters = 1024 + maxusers * 64; -#endif -#ifdef VM_MAX_AUTOTUNE_NMBCLUSTERS - if (nmbclusters > VM_MAX_AUTOTUNE_NMBCLUSTERS) - nmbclusters = VM_MAX_AUTOTUNE_NMBCLUSTERS; -#endif - } + if (nmbclusters == 0) + nmbclusters = maxmbufmem / MCLBYTES / 4; TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); if (nmbjumbop == 0) - nmbjumbop = nmbclusters / 2; + nmbjumbop = maxmbufmem / MJUMPAGESIZE / 4; TUNABLE_INT_FETCH("kern.ipc.nmbjumbo9", &nmbjumbo9); if (nmbjumbo9 == 0) - nmbjumbo9 = nmbclusters / 4; + nmbjumbo9 = maxmbufmem / MJUM9BYTES / 6; TUNABLE_INT_FETCH("kern.ipc.nmbjumbo16", &nmbjumbo16); if (nmbjumbo16 == 0) - nmbjumbo16 = nmbclusters / 8; + nmbjumbo16 = maxmbufmem / MJUM16BYTES / 6; + + /* + * We need at least as many mbufs as we have clusters of + * the various types added together. + */ + TUNABLE_INT_FETCH("kern.ipc.nmbufs", &nmbufs); + if (nmbufs < nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) + nmbufs = lmax(maxmbufmem / MSIZE / 5, + nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16); + } SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); @@ -241,7 +243,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) if (newnmbufs > nmbufs) { nmbufs = newnmbufs; uma_zone_set_max(zone_mbuf, nmbufs); - nmbclusters = uma_zone_get_max(zone_mbuf); + nmbufs = uma_zone_get_max(zone_mbuf); EVENTHANDLER_INVOKE(nmbufs_change); } else error = EINVAL; From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 23:21:24 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 EC622624 for ; Tue, 27 Nov 2012 23:21:24 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 812DC8FC12 for ; Tue, 27 Nov 2012 23:21:24 +0000 (UTC) Received: (qmail 37468 invoked from network); 28 Nov 2012 00:52:58 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Nov 2012 00:52:58 -0000 Message-ID: <50B54AE8.4060509@freebsd.org> Date: Wed, 28 Nov 2012 00:21:12 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243639 - head/sys/kern References: <201211272316.qARNGurs080897@svn.freebsd.org> In-Reply-To: <201211272316.qARNGurs080897@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 23:21:25 -0000 On 28.11.2012 00:16, Andre Oppermann wrote: > Author: andre > Date: Tue Nov 27 23:16:56 2012 > New Revision: 243639 > URL: http://svnweb.freebsd.org/changeset/base/243639 > > Log: > Complete r243631 by applying the remainder of kern_mbuf.c that got > lost while merging into the commit tree. Please note that this didn't have any serious negative effects. -- Andre From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 23:29:49 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 5CDC1B57 for ; Tue, 27 Nov 2012 23:29:49 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id AF27D8FC19 for ; Tue, 27 Nov 2012 23:29:48 +0000 (UTC) Received: (qmail 37523 invoked from network); 28 Nov 2012 01:01:22 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Nov 2012 01:01:22 -0000 Message-ID: <50B54CE0.6080008@freebsd.org> Date: Wed, 28 Nov 2012 00:29:36 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: "Robert N. M. Watson" Subject: Re: svn commit: r243627 - head/sys/kern References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> In-Reply-To: <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 23:29:49 -0000 On 28.11.2012 00:05, Robert N. M. Watson wrote: > > On 27 Nov 2012, at 22:54, Andre Oppermann wrote: > >>>>> Andre.. this breaks incoming connections. TCP is immediately reset and never even gets to the >>>>> listener process. You need to back out of fix this urgently please. >>>> >>>> I just found out and fixed it. Sorry for the breakage. >>> >>> I'd like to see a much more thorough use of "Reviewed by:" in socket and TCP-related commits -- this >>> is very sensitive code, and a second pair of eyes is always valuable. Post-commit review is not a >>> substitute. Looking back over similar changes in the socket code over the last two years, I see >>> that almost all have reviewers, so I think it would be reasonable to consider it mandatory for these >>> subsystems at this point. The good news is that we have lots of people with expertise in it. >> >> Good to see you becoming more active again. :-) And yes, >> you have a point there. > > Yes -- this is only about three weeks old, however; for the prior six-twelve months, I've been fairly non-existent in FreeBSD-land due to outside obligations :-). Just saw that I did indeed send you a review request three weeks ago. ;-) At the end of a rather long email though. -- Andre From owner-svn-src-all@FreeBSD.ORG Tue Nov 27 23:59:15 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 4165965D; Tue, 27 Nov 2012 23:59:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0EDE58FC12; Tue, 27 Nov 2012 23:59:15 +0000 (UTC) Received: from [192.168.2.119] (host86-146-118-26.range86-146.btcentralplus.com [86.146.118.26]) by cyrus.watson.org (Postfix) with ESMTPSA id DC5D146B2C; Tue, 27 Nov 2012 18:59:13 -0500 (EST) Subject: Re: svn commit: r243627 - head/sys/kern Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: "Robert N. M. Watson" In-Reply-To: <50B54CE0.6080008@freebsd.org> Date: Tue, 27 Nov 2012 23:59:12 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 23:59:15 -0000 On 27 Nov 2012, at 23:29, Andre Oppermann wrote: >>>>>> Andre.. this breaks incoming connections. TCP is immediately = reset and never even gets to the >>>>>> listener process. You need to back out of fix this urgently = please. >>>>>=20 >>>>> I just found out and fixed it. Sorry for the breakage. >>>>=20 >>>> I'd like to see a much more thorough use of "Reviewed by:" in = socket and TCP-related commits -- this >>>> is very sensitive code, and a second pair of eyes is always = valuable. Post-commit review is not a >>>> substitute. Looking back over similar changes in the socket code = over the last two years, I see >>>> that almost all have reviewers, so I think it would be reasonable = to consider it mandatory for these >>>> subsystems at this point. The good news is that we have lots of = people with expertise in it. >>>=20 >>> Good to see you becoming more active again. :-) And yes, >>> you have a point there. >>=20 >> Yes -- this is only about three weeks old, however; for the prior = six-twelve months, I've been fairly non-existent in FreeBSD-land due to = outside obligations :-). >=20 > Just saw that I did indeed send you a review request three weeks ago. = ;-) > At the end of a rather long email though. Yes, indeed -- no patch was attached, and it followed quite a long = e-mail on your plans to rewrite the TCP stack. I'm afraid that went onto = the "read this later as time permits" pile as I was at a conference, = rather than the fast-path "oh, quickly review this patch" pile. However, = simply committing the patch rather than trying a bit harder to find a = reviewer isn't the right answer either. To maximise the likelihood of a = review, construct an e-mail with a subject line like "Review request: = (patch description)", attach the patch, and include a proposed commit = message. Robert= From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 00:36:41 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 458D4C17; Wed, 28 Nov 2012 00:36:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 115C18FC0C; Wed, 28 Nov 2012 00:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS0ae6P094521; Wed, 28 Nov 2012 00:36:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS0aeSO094520; Wed, 28 Nov 2012 00:36:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201211280036.qAS0aeSO094520@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 28 Nov 2012 00:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243641 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 00:36:41 -0000 Author: pfg Date: Wed Nov 28 00:36:40 2012 New Revision: 243641 URL: http://svnweb.freebsd.org/changeset/base/243641 Log: Partially bring r242520 to ext2fs. When a file is first being written, the dynamic block reallocation (implemented by ext2_reallocblks) relocates the file's blocks so as to cluster them together into a contiguous set of blocks on the disk. When the cluster crosses the boundary into the first indirect block, the first indirect block is initially allocated in a position immediately following the last direct block. Block reallocation would usually destroy locality by moving the indirect block out of the way to keep the data blocks contiguous. The issue was diagnosed long ago by Bruce Evans on ffs and surfaced on ext2fs when block reallocaton was ported. This is only a partial solution based on the similarities with FFS. We still require more review of the allocation details that vary in ext2fs. Reported by: bde MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Wed Nov 28 00:02:17 2012 (r243640) +++ head/sys/fs/ext2fs/ext2_alloc.c Wed Nov 28 00:36:40 2012 (r243641) @@ -197,6 +197,18 @@ ext2_reallocblks(ap) panic("ext2_reallocblks: non-cluster"); #endif /* + * If the cluster crosses the boundary for the first indirect + * block, leave space for the indirect block. Indirect blocks + * are initially laid out in a position after the last direct + * block. Block reallocation would usually destroy locality by + * moving the indirect block out of the way to make room for + * data blocks if we didn't compensate here. We should also do + * this for other indirect block boundaries, but it is only + * important for the first one. + */ + if (start_lbn < NDADDR && end_lbn >= NDADDR) + return (ENOSPC); + /* * If the latest allocation is in a new cylinder group, assume that * the filesystem has decided to move and do not force it back to * the previous cylinder group. From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 01:55: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 A68EA501; Wed, 28 Nov 2012 01:55:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82D5F8FC08; Wed, 28 Nov 2012 01:55:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS1tM1k007726; Wed, 28 Nov 2012 01:55:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS1tM3c007725; Wed, 28 Nov 2012 01:55:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211280155.qAS1tM3c007725@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Nov 2012 01:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243642 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 01:55:22 -0000 Author: adrian Date: Wed Nov 28 01:55:22 2012 New Revision: 243642 URL: http://svnweb.freebsd.org/changeset/base/243642 Log: Pull out the debugging code from the critical path and make sure it happens _after_ all of the time delta calculations. Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Wed Nov 28 00:36:40 2012 (r243641) +++ head/sys/dev/ath/if_ath_tdma.c Wed Nov 28 01:55:22 2012 (r243642) @@ -402,28 +402,6 @@ ath_tdma_update(struct ieee80211_node *n * not just 0..65535 TU. */ nextslottu = TSF_TO_TU(nextslot>>32, nextslot); - DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "rs->rstamp %llu rstamp %llu tsf %llu txtime %d, nextslot %llu, nextslottu %d, nextslottume %d\n", - (unsigned long long) rs->rs_tstamp, rstamp, tsf, txtime, nextslot, nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); - DPRINTF(sc, ATH_DEBUG_TDMA, - " beacon tstamp: %llu (0x%016llx)\n", - le64toh(ni->ni_tstamp.tsf), - le64toh(ni->ni_tstamp.tsf)); - -#ifdef ATH_DEBUG_ALQ - if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE)) { - struct if_ath_alq_tdma_beacon_state t; - t.rx_tsf = htobe64(rstamp); - t.beacon_tsf = htobe64(le64toh(ni->ni_tstamp.tsf)); - t.tsf64 = htobe64(tsf); - t.nextslot_tsf = htobe64(nextslot); - t.nextslot_tu = htobe32(nextslottu); - t.txtime = htobe32(txtime); - if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE, - sizeof(t), (char *) &t); - } -#endif - /* * Retrieve the hardware NextTBTT in usecs * and calculate the difference between what the @@ -459,27 +437,22 @@ ath_tdma_update(struct ieee80211_node *n tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "rs->rstamp %llu rstamp %llu tsf %llu txtime %d, nextslot %llu, " + "nextslottu %d, nextslottume %d\n", + (unsigned long long) rs->rs_tstamp, rstamp, tsf, txtime, + nextslot, nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); + DPRINTF(sc, ATH_DEBUG_TDMA, + " beacon tstamp: %llu (0x%016llx)\n", + le64toh(ni->ni_tstamp.tsf), + le64toh(ni->ni_tstamp.tsf)); + + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "nexttbtt %llu (0x%08llx) tsfdelta %d avg +%d/-%d\n", nexttbtt, (long long) nexttbtt, tsfdelta, TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); -#ifdef ATH_DEBUG_ALQ - if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC)) { - struct if_ath_alq_tdma_slot_calc t; - - t.nexttbtt = htobe64(nexttbtt_full); - t.next_slot = htobe64(nextslot); - t.tsfdelta = htobe32(tsfdelta); - t.avg_plus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltap)); - t.avg_minus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltam)); - - if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC, - sizeof(t), (char *) &t); - } -#endif - if (tsfdelta < 0) { TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); @@ -496,6 +469,33 @@ ath_tdma_update(struct ieee80211_node *n } tudelta = nextslottu - TSF_TO_TU(nexttbtt_full >> 32, nexttbtt_full); +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE)) { + struct if_ath_alq_tdma_beacon_state t; + t.rx_tsf = htobe64(rstamp); + t.beacon_tsf = htobe64(le64toh(ni->ni_tstamp.tsf)); + t.tsf64 = htobe64(tsf); + t.nextslot_tsf = htobe64(nextslot); + t.nextslot_tu = htobe32(nextslottu); + t.txtime = htobe32(txtime); + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE, + sizeof(t), (char *) &t); + } + + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC)) { + struct if_ath_alq_tdma_slot_calc t; + + t.nexttbtt = htobe64(nexttbtt_full); + t.next_slot = htobe64(nextslot); + t.tsfdelta = htobe32(tsfdelta); + t.avg_plus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltap)); + t.avg_minus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltam)); + + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC, + sizeof(t), (char *) &t); + } +#endif + /* * Copy sender's timetstamp into tdma ie so they can * calculate roundtrip time. We submit a beacon frame From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 02:24:00 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 08A09FA2; Wed, 28 Nov 2012 02:24:00 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E12668FC14; Wed, 28 Nov 2012 02:23:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS2Nx9b013741; Wed, 28 Nov 2012 02:23:59 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS2NxU7013740; Wed, 28 Nov 2012 02:23:59 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211280223.qAS2NxU7013740@svn.freebsd.org> From: Alfred Perlstein Date: Wed, 28 Nov 2012 02:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243644 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 02:24:00 -0000 Author: alfred Date: Wed Nov 28 02:23:59 2012 New Revision: 243644 URL: http://svnweb.freebsd.org/changeset/base/243644 Log: Fix typo. Pointed out by: marck Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:03:53 2012 (r243643) +++ head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:23:59 2012 (r243644) @@ -431,7 +431,7 @@ main(int argc, char **argv) nfsdcnt = DEFNFSDCNT; } if (nfsdcnt > MAXNFSDCNT) { - warnx("nfsd counta too high %d; reset to %d", nfsdcnt, + warnx("nfsd count too high %d; reset to %d", nfsdcnt, DEFNFSDCNT); nfsdcnt = MAXNFSDCNT; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 02:47: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 617A79AB; Wed, 28 Nov 2012 02:47:32 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44B0E8FC15; Wed, 28 Nov 2012 02:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS2lWia018007; Wed, 28 Nov 2012 02:47:32 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS2lWS4018006; Wed, 28 Nov 2012 02:47:32 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211280247.qAS2lWS4018006@svn.freebsd.org> From: Alfred Perlstein Date: Wed, 28 Nov 2012 02:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243645 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 02:47:32 -0000 Author: alfred Date: Wed Nov 28 02:47:31 2012 New Revision: 243645 URL: http://svnweb.freebsd.org/changeset/base/243645 Log: Don't allow minthreads > maxthreads. Suggested by: rmacklem Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:23:59 2012 (r243644) +++ head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:47:31 2012 (r243645) @@ -224,6 +224,10 @@ main(int argc, char **argv) udpflag = 1; argv += optind; argc -= optind; + if (minthreads_set && maxthreads_set && minthreads > maxthreads) + errx(EX_USAGE, + "error: minthreads(%d) can't be greater than " + "maxthreads(%d)", minthreads, maxthreads); /* * XXX From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 03:04:44 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 8E52AEDA; Wed, 28 Nov 2012 03:04:44 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 432AA8FC18; Wed, 28 Nov 2012 03:04:44 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 637E81A3D8A; Tue, 27 Nov 2012 19:04:37 -0800 (PST) Message-ID: <50B57F46.1060207@mu.org> Date: Tue, 27 Nov 2012 19:04:38 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243594 - head/sys/netinet References: <201211270304.qAR34PfD056691@svn.freebsd.org> <50B53ABC.1010304@freebsd.org> In-Reply-To: <50B53ABC.1010304@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 03:04:44 -0000 On 11/27/12 2:12 PM, Andre Oppermann wrote: > On 27.11.2012 04:04, Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Nov 27 03:04:24 2012 >> New Revision: 243594 >> URL: http://svnweb.freebsd.org/changeset/base/243594 >> >> Log: >> Auto size the tcbhashsize structure based on max sockets. >> >> While here, also make the code that enforces power-of-two more >> forgiving, instead of just resetting to 512, graciously round-down >> to the next lower power of two. > > The porthash (also a parameter to in_pcbinfo_init()) should not be > scaled the same as tcbhashsize. It's unlikely that anyone is going > to have more than a thousand listen ports. > > The default tcbhashsize scaling factor of maxsockets / 4 is IMHO > excessive. If someone is running at the limit he's going to up > maxsockets to double the target load. Dividing by 8 is a better > balance for normal and well used large memory machines. > The hashsize calculation logic is done a bit in a roundabout way. > > What do think of the attached patch to fix the porthash and to simplify > the hashsize logic? > I like the porthash fix. However your change: 1) removes explanation of what the code is doing. (comments/clarity) 2) removes the more forgiving code that rounds-down the tcp_tcbhashsize. Can you please maintain the comments (probably keeping the logic of maketcp_hashsize() in a separate function). Can you please maintain the more forgiving code for dealing with non-power of 2 tunable? I like this, it makes it easier for admins and less error prone. - if (!powerof2(hashsize)) { - int oldhashsize = hashsize; - hashsize = maketcp_hashsize(hashsize); - /* prevent absurdly low value */ - if (hashsize < 16) - hashsize = 16; - printf("%s: WARNING: TCB hash size not a power of 2, " - "clipped from %d to %d.\n", __func__, oldhashsize, - hashsize); From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 06:55:35 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 358FD548; Wed, 28 Nov 2012 06:55:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2428FC08; Wed, 28 Nov 2012 06:55:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS6tYEm060982; Wed, 28 Nov 2012 06:55:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS6tYlb060981; Wed, 28 Nov 2012 06:55:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211280655.qAS6tYlb060981@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Nov 2012 06:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243647 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 06:55:35 -0000 Author: adrian Date: Wed Nov 28 06:55:34 2012 New Revision: 243647 URL: http://svnweb.freebsd.org/changeset/base/243647 Log: Until I figure out what to do here, remind myself that this needs some rate control 'adjustment' when NOACK is set. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed Nov 28 03:04:38 2012 (r243646) +++ head/sys/dev/ath/if_ath_tx.c Wed Nov 28 06:55:34 2012 (r243647) @@ -522,6 +522,16 @@ ath_tx_set_ratectrl(struct ath_softc *sc if (! bf->bf_state.bfs_ismrr) rc[1].tries = rc[2].tries = rc[3].tries = 0; +#if 0 + /* + * If NOACK is set, just set ntries=1. + */ + else if (bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) { + rc[1].tries = rc[2].tries = rc[3].tries = 0; + rc[0].tries = 1; + } +#endif + /* * Always call - that way a retried descriptor will * have the MRR fields overwritten. From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 07:12: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 52A21970; Wed, 28 Nov 2012 07:12:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 388ED8FC08; Wed, 28 Nov 2012 07:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS7C9Q6064016; Wed, 28 Nov 2012 07:12:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS7C9Lr064014; Wed, 28 Nov 2012 07:12:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211280712.qAS7C9Lr064014@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Nov 2012 07:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243648 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 07:12:09 -0000 Author: adrian Date: Wed Nov 28 07:12:08 2012 New Revision: 243648 URL: http://svnweb.freebsd.org/changeset/base/243648 Log: Call if_free() with the correct vnet context if and only if ifp_vnet isn't NULL. If the attach fails prematurely and there's no if_vnet context, calling CURVNET_SET(ifp->if_vnet) is going to dereference a NULL pointer. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Nov 28 06:55:34 2012 (r243647) +++ head/sys/dev/ath/if_ath.c Wed Nov 28 07:12:08 2012 (r243648) @@ -918,11 +918,16 @@ bad2: bad: if (ah) ath_hal_detach(ah); - if (ifp != NULL) { + + /* + * To work around scoping issues with CURVNET_SET/CURVNET_RESTORE.. + */ + if (ifp != NULL && ifp->if_vnet) { CURVNET_SET(ifp->if_vnet); if_free(ifp); CURVNET_RESTORE(); - } + } else if (ifp != NULL) + if_free(ifp); sc->sc_invalid = 1; return error; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 08:02:08 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 09D265FA for ; Wed, 28 Nov 2012 08:02:08 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 5A17F8FC19 for ; Wed, 28 Nov 2012 08:02:07 +0000 (UTC) Received: (qmail 39318 invoked from network); 28 Nov 2012 09:33:36 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Nov 2012 09:33:36 -0000 Message-ID: <50B5C4F1.1020002@freebsd.org> Date: Wed, 28 Nov 2012 09:01:53 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: "Robert N. M. Watson" Subject: Re: svn commit: r243627 - head/sys/kern References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> In-Reply-To: <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 08:02:08 -0000 On 28.11.2012 00:59, Robert N. M. Watson wrote: > > On 27 Nov 2012, at 23:29, Andre Oppermann wrote: > >>>>>>> Andre.. this breaks incoming connections. TCP is immediately reset and never even gets to the >>>>>>> listener process. You need to back out of fix this urgently please. >>>>>> >>>>>> I just found out and fixed it. Sorry for the breakage. >>>>> >>>>> I'd like to see a much more thorough use of "Reviewed by:" in socket and TCP-related commits -- this >>>>> is very sensitive code, and a second pair of eyes is always valuable. Post-commit review is not a >>>>> substitute. Looking back over similar changes in the socket code over the last two years, I see >>>>> that almost all have reviewers, so I think it would be reasonable to consider it mandatory for these >>>>> subsystems at this point. The good news is that we have lots of people with expertise in it. >>>> >>>> Good to see you becoming more active again. :-) And yes, >>>> you have a point there. >>> >>> Yes -- this is only about three weeks old, however; for the prior six-twelve months, I've been fairly non-existent in FreeBSD-land due to outside obligations :-). >> >> Just saw that I did indeed send you a review request three weeks ago. ;-) >> At the end of a rather long email though. > > Yes, indeed -- no patch was attached, and it followed quite a long e-mail on your plans to rewrite the TCP stack. I'm afraid that went onto the "read this later as time permits" pile as I was at a conference, rather than the fast-path "oh, quickly review this patch" pile. However, simply committing the patch rather than trying a bit harder to find a reviewer isn't the right answer either. To maximise the likelihood of a review, construct an e-mail with a subject line like "Review request: (patch description)", attach the patch, and include a proposed commit message. Yes, and I didn't really expect you to answer (at least quickly) during your FreeBSD hiatus. So it was seeking review by chance. Alas I found and fixed the bug myself within 2.5hrs. While not optimal, a sign of poor prior testing and too much trust into the submitter of the patch it wasn't an earth shattering event. Doesn't distract from the fact that it was mea culpa in any case though. For prior review of kern_socket* and netinet/tcp_* related changes it has been on and off by various committers over the past year. If we do have a policy of prior review required then it should be made official and codified in MAINTAINERS and universally applied to all. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 08:31: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 7A588D99; Wed, 28 Nov 2012 08:31:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 488D68FC0C; Wed, 28 Nov 2012 08:31:02 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6DC9246B2C; Wed, 28 Nov 2012 03:31:01 -0500 (EST) Date: Wed, 28 Nov 2012 08:31:01 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andre Oppermann Subject: Re: svn commit: r243627 - head/sys/kern In-Reply-To: <50B5C4F1.1020002@freebsd.org> Message-ID: References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 08:31:02 -0000 On Wed, 28 Nov 2012, Andre Oppermann wrote: > Yes, and I didn't really expect you to answer (at least quickly) during your > FreeBSD hiatus. So it was seeking review by chance. > > Alas I found and fixed the bug myself within 2.5hrs. While not optimal, a > sign of poor prior testing and too much trust into the submitter of the > patch it wasn't an earth shattering event. Doesn't distract from the fact > that it was mea culpa in any case though. The rapid fix was, of course, extremely appreciated :-). > For prior review of kern_socket* and netinet/tcp_* related changes it has > been on and off by various committers over the past year. If we do have a > policy of prior review required then it should be made official and codified > in MAINTAINERS and universally applied to all. I tend to be of the view that 'maintainers' is a bad idea, and that we should just make a regular practice of seeking review for this sort of thing, especially as our community grows (and, let us be honest, complexity also grows -- your observations about decades of accumulated complexity in the TCP stack are not amiss). I'll try to take a look at this change in detail over the weekend -- listen/accept locking is a bit of a sore point; in the original design, I didn't have a separate accept lock, but ended up being forced to introduce it to solve races along these lines. In the past we've also relied on the pcbinfo lock in the protocol providing significant synchronisation during new connection events, and as we reduce the influence of that lock, finding more structured solutions is necessary. Robert From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 11:47: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 19F942E2; Wed, 28 Nov 2012 11:47:48 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D83628FC14; Wed, 28 Nov 2012 11:47:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASBll41018282; Wed, 28 Nov 2012 11:47:47 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASBll2T018280; Wed, 28 Nov 2012 11:47:47 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201211281147.qASBll2T018280@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 28 Nov 2012 11:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243649 - head/contrib/sendmail/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 11:47:48 -0000 Author: ume Date: Wed Nov 28 11:47:47 2012 New Revision: 243649 URL: http://svnweb.freebsd.org/changeset/base/243649 Log: cyrus-sasl 2.1.26 was released. In this version, the type of callback functions was changed from "unsigned long" to "size_t". Reviewed by: gshapiro MFC after: 3 days Modified: head/contrib/sendmail/src/sasl.c Modified: head/contrib/sendmail/src/sasl.c ============================================================================== --- head/contrib/sendmail/src/sasl.c Wed Nov 28 07:12:08 2012 (r243648) +++ head/contrib/sendmail/src/sasl.c Wed Nov 28 11:47:47 2012 (r243649) @@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08 ** using unsigned long: for portability, it should be size_t. */ -void *sm_sasl_malloc __P((unsigned long)); -static void *sm_sasl_calloc __P((unsigned long, unsigned long)); -static void *sm_sasl_realloc __P((void *, unsigned long)); +#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a +#define SM_SASL_SIZE_T size_t +#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ +#define SM_SASL_SIZE_T unsigned long +#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ + +void *sm_sasl_malloc __P((SM_SASL_SIZE_T)); +static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T)); +static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T)); void sm_sasl_free __P((void *)); /* @@ -50,7 +56,7 @@ void sm_sasl_free __P((void *)); void * sm_sasl_malloc(size) - unsigned long size; + SM_SASL_SIZE_T size; { return sm_malloc((size_t) size); } @@ -71,8 +77,8 @@ sm_sasl_malloc(size) static void * sm_sasl_calloc(nelem, elemsize) - unsigned long nelem; - unsigned long elemsize; + SM_SASL_SIZE_T nelem; + SM_SASL_SIZE_T elemsize; { size_t size; void *p; @@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize) static void * sm_sasl_realloc(o, size) void *o; - unsigned long size; + SM_SASL_SIZE_T size; { return sm_realloc(o, (size_t) size); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 12:16:59 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 A2826A7D; Wed, 28 Nov 2012 12:16:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0C68FC12; Wed, 28 Nov 2012 12:16:58 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 9BD98358C68; Wed, 28 Nov 2012 13:16:56 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 8097D2848C; Wed, 28 Nov 2012 13:16:56 +0100 (CET) Date: Wed, 28 Nov 2012 13:16:56 +0100 From: Jilles Tjoelker To: Alfred Perlstein Subject: Re: svn commit: r243644 - head/usr.sbin/nfsd Message-ID: <20121128121656.GA14031@stack.nl> References: <201211280223.qAS2NxU7013740@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211280223.qAS2NxU7013740@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 12:16:59 -0000 On Wed, Nov 28, 2012 at 02:23:59AM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Wed Nov 28 02:23:59 2012 > New Revision: 243644 > URL: http://svnweb.freebsd.org/changeset/base/243644 > Log: > Fix typo. > Pointed out by: marck > Modified: > head/usr.sbin/nfsd/nfsd.c > Modified: head/usr.sbin/nfsd/nfsd.c > ============================================================================== > --- head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:03:53 2012 (r243643) > +++ head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:23:59 2012 (r243644) > @@ -431,7 +431,7 @@ main(int argc, char **argv) > nfsdcnt = DEFNFSDCNT; > } > if (nfsdcnt > MAXNFSDCNT) { > - warnx("nfsd counta too high %d; reset to %d", nfsdcnt, > + warnx("nfsd count too high %d; reset to %d", nfsdcnt, > DEFNFSDCNT); > nfsdcnt = MAXNFSDCNT; > } This says it reset the count to 4, while actually resetting it to 256. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 12:20:43 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 A0B41C3D; Wed, 28 Nov 2012 12:20:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 754578FC17; Wed, 28 Nov 2012 12:20:42 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id 12so1478505wgh.31 for ; Wed, 28 Nov 2012 04:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7wjA9uRD7f8lTujGTk7IcJGja1nc048qSzQBamaPcyM=; b=a2IkE7qgCgaIzXJaf3oYd9YnZTTJtu1Sb7dZHdTY28cKwB+1Ikmx8L1qx3nTAaJw1z 2aOjbqxdI38kD/xxBPoN/0+yWY6To0zhC6VcMDTszDzBHKqXldPsJ46voi4YCdUdVvBk 6PZoTTPmXK42UXEbpHbYt/BVd5SdH6vt375ZxUaOQKM18QuF/q9YphUZlETGeU5PJto1 1yr6WNe2WOKK+ZBHn0er93iHYnDEMhCinvcM7dhN4GdNskjxeYLw8Tlyhc4YUbaNXx/5 8rM9QhNDBZME6wL93jfdBvowwrda4bU9LVlVMgadrjiNHAGodAWOI00WIP2DulPtnjFE 5uig== Received: by 10.216.91.17 with SMTP id g17mr2591333wef.76.1354105241403; Wed, 28 Nov 2012 04:20:41 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id hv4sm6794748wib.0.2012.11.28.04.20.39 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 04:20:40 -0800 (PST) Date: Wed, 28 Nov 2012 13:20:34 +0100 From: Mateusz Guzik To: Alfred Perlstein Subject: Re: svn commit: r243645 - head/usr.sbin/nfsd Message-ID: <20121128122034.GB17871@dft-labs.eu> References: <201211280247.qAS2lWS4018006@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201211280247.qAS2lWS4018006@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 12:20:43 -0000 On Wed, Nov 28, 2012 at 02:47:32AM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Wed Nov 28 02:47:31 2012 > New Revision: 243645 > URL: http://svnweb.freebsd.org/changeset/base/243645 > > Log: > Don't allow minthreads > maxthreads. > > Suggested by: rmacklem > > Modified: > head/usr.sbin/nfsd/nfsd.c > > Modified: head/usr.sbin/nfsd/nfsd.c > ============================================================================== > --- head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:23:59 2012 (r243644) > +++ head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:47:31 2012 (r243645) > @@ -224,6 +224,10 @@ main(int argc, char **argv) > udpflag = 1; > argv += optind; > argc -= optind; > + if (minthreads_set && maxthreads_set && minthreads > maxthreads) > + errx(EX_USAGE, > + "error: minthreads(%d) can't be greater than " > + "maxthreads(%d)", minthreads, maxthreads); > > /* > * XXX Should not this be also checked in the kernel? Looks like nfssvc_nfsd is trustful: [..] if (args) { nfsrv_pool->sp_minthreads = args->minthreads; nfsrv_pool->sp_maxthreads = args->maxthreads; } else { nfsrv_pool->sp_minthreads = 4; nfsrv_pool->sp_maxthreads = 4; } [..] -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 15:48:33 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 36B12FD6; Wed, 28 Nov 2012 15:48:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FDE38FC08; Wed, 28 Nov 2012 15:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASFmWTP068832; Wed, 28 Nov 2012 15:48:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASFmW1x068830; Wed, 28 Nov 2012 15:48:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201211281548.qASFmW1x068830@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 28 Nov 2012 15:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243652 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 15:48:33 -0000 Author: pfg Date: Wed Nov 28 15:48:32 2012 New Revision: 243652 URL: http://svnweb.freebsd.org/changeset/base/243652 Log: Update some definitions or make them match NetBSD's headers. Bring several definitions required for newer ext4 features. Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it is not being used yet and the new name is more compatible with NetBSD and Linux. This change is purely cosmetic and has no effect on the real code. Obtained from: NetBSD MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Wed Nov 28 13:34:44 2012 (r243651) +++ head/sys/fs/ext2fs/ext2_dinode.h Wed Nov 28 15:48:32 2012 (r243652) @@ -60,8 +60,15 @@ #define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ - -#define EXT2_HTREE 0x00001000 /* HTree-indexed directory */ +#define EXT2_INDEX 0x00001000 /* hash-indexed directory */ +#define EXT2_IMAGIC 0x00002000 /* AFS directory */ +#define EXT2_JOURNAL_DATA 0x00004000 /* file data should be journaled */ +#define EXT2_NOTAIL 0x00008000 /* file tail should not be merged */ +#define EXT2_DIRSYNC 0x00010000 /* dirsync behaviour */ +#define EXT2_TOPDIR 0x00020000 /* Top of directory hierarchies*/ +#define EXT2_HUGE_FILE 0x00040000 /* Set to each huge file */ +#define EXT2_EXTENTS 0x00080000 /* Inode uses extents */ +#define EXT2_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ /* * Definitions for nanosecond timestamps. @@ -95,9 +102,8 @@ struct ext2fs_dinode { uint32_t e2di_facl; /* 104: file ACL (not implemented) */ uint32_t e2di_dacl; /* 108: dir ACL (not implemented) */ uint32_t e2di_faddr; /* 112: fragment address */ - uint8_t e2di_nfrag; /* 116: fragment number */ - uint8_t e2di_fsize; /* 117: fragment size */ - uint16_t e2di_linux_reserved2; /* 118 */ + uint16_t e2di_nblock_high; /* 116: Blocks count bits 47:32 */ + uint16_t e2di_facl_high; /* 118: file ACL bits 47:32 */ uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Wed Nov 28 13:34:44 2012 (r243651) +++ head/sys/fs/ext2fs/ext2fs.h Wed Nov 28 15:48:32 2012 (r243652) @@ -210,15 +210,23 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 -#define EXT2F_COMPAT_HTREE 0x0020 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT4F_ROCOMPAT_HUGE_FILE 0x0008 +#define EXT4F_ROCOMPAT_GDT_CSUM 0x0010 +#define EXT4F_ROCOMPAT_DIR_NLINK 0x0020 #define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040 #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT4F_INCOMPAT_META_BG 0x0010 +#define EXT4F_INCOMPAT_EXTENTS 0x0040 +#define EXT4F_INCOMPAT_64BIT 0x0080 +#define EXT4F_INCOMPAT_MMP 0x0100 +#define EXT4F_INCOMPAT_FLEX_BG 0x0200 /* * Features supported in this implementation From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 17:37: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 E19DEB0B; Wed, 28 Nov 2012 17:37:53 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id AE1358FC15; Wed, 28 Nov 2012 17:37:53 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 955B44C023F; Wed, 28 Nov 2012 11:37:47 -0600 (CST) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 939104C0235; Wed, 28 Nov 2012 11:37:47 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id l1Im_c4j662U; Wed, 28 Nov 2012 11:37:47 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id C79394C01D0; Wed, 28 Nov 2012 11:37:46 -0600 (CST) Message-ID: <50B64BE8.3040708@rice.edu> Date: Wed, 28 Nov 2012 11:37:44 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:16.0) Gecko/20121111 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> In-Reply-To: <201211272119.qARLJxXV061083@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 17:37:54 -0000 I'm pretty sure that the "realmem" calculation is going to overflow on i386/PAE, where the number of bytes of physical memory is greater than the type long can represent. On 11/27/2012 15:19, Andre Oppermann wrote: > Author: andre > Date: Tue Nov 27 21:19:58 2012 > New Revision: 243631 > URL: http://svnweb.freebsd.org/changeset/base/243631 > > Log: > Base the mbuf related limits on the available physical memory or > kernel memory, whichever is lower. The overall mbuf related memory > limit must be set so that mbufs (and clusters of various sizes) > can't exhaust physical RAM or KVM. > > The limit is set to half of the physical RAM or KVM (whichever is > lower) as the baseline. In any normal scenario we want to leave > at least half of the physmem/kvm for other kernel functions and > userspace to prevent it from swapping too easily. Via a tunable > kern.maxmbufmem the limit can be upped to at most 3/4 of physmem/kvm. > > At the same time divorce maxfiles from maxusers and set maxfiles to > physpages / 8 with a floor based on maxusers. This way busy servers > can make use of the significantly increased mbuf limits with a much > larger number of open sockets. > > Tidy up ordering in init_param2() and check up on some users of > those values calculated here. > > Out of the overall mbuf memory limit 2K clusters and 4K (page size) > clusters to get 1/4 each because these are the most heavily used mbuf > sizes. 2K clusters are used for MTU 1500 ethernet inbound packets. > 4K clusters are used whenever possible for sends on sockets and thus > outbound packets. The larger cluster sizes of 9K and 16K are limited > to 1/6 of the overall mbuf memory limit. When jumbo MTU's are used > these large clusters will end up only on the inbound path. They are > not used on outbound, there it's still 4K. Yes, that will stay that > way because otherwise we run into lots of complications in the > stack. And it really isn't a problem, so don't make a scene. > > Normal mbufs (256B) weren't limited at all previously. This was > problematic as there are certain places in the kernel that on > allocation failure of clusters try to piece together their packet > from smaller mbufs. > > The mbuf limit is the number of all other mbuf sizes together plus > some more to allow for standalone mbufs (ACK for example) and to > send off a copy of a cluster. Unfortunately there isn't a way to > set an overall limit for all mbuf memory together as UMA doesn't > support such a limiting. > > NB: Every cluster also has an mbuf associated with it. > > Two examples on the revised mbuf sizing limits: > > 1GB KVM: > 512MB limit for mbufs > 419,430 mbufs > 65,536 2K mbuf clusters > 32,768 4K mbuf clusters > 9,709 9K mbuf clusters > 5,461 16K mbuf clusters > > 16GB RAM: > 8GB limit for mbufs > 33,554,432 mbufs > 1,048,576 2K mbuf clusters > 524,288 4K mbuf clusters > 155,344 9K mbuf clusters > 87,381 16K mbuf clusters > > These defaults should be sufficient for even the most demanding > network loads. > > MFC after: 1 month > > Modified: > head/sys/kern/kern_mbuf.c > head/sys/kern/subr_param.c > head/sys/kern/uipc_socket.c > head/sys/sys/eventhandler.h > head/sys/sys/mbuf.h > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/kern/kern_mbuf.c Tue Nov 27 21:19:58 2012 (r243631) > @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); > * > */ > > +int nmbufs; /* limits number of mbufs */ > int nmbclusters; /* limits number of mbuf clusters */ > int nmbjumbop; /* limits number of page size jumbo clusters */ > int nmbjumbo9; /* limits number of 9k jumbo clusters */ > @@ -147,9 +148,11 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) > newnmbclusters = nmbclusters; > error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbclusters > nmbclusters) { > + if (newnmbclusters > nmbclusters && > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbclusters = newnmbclusters; > uma_zone_set_max(zone_clust, nmbclusters); > + nmbclusters = uma_zone_get_max(zone_clust); > EVENTHANDLER_INVOKE(nmbclusters_change); > } else > error = EINVAL; > @@ -168,9 +171,11 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) > newnmbjumbop = nmbjumbop; > error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbjumbop> nmbjumbop) { > + if (newnmbjumbop > nmbjumbop && > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbjumbop = newnmbjumbop; > uma_zone_set_max(zone_jumbop, nmbjumbop); > + nmbjumbop = uma_zone_get_max(zone_jumbop); > } else > error = EINVAL; > } > @@ -189,9 +194,11 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) > newnmbjumbo9 = nmbjumbo9; > error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbjumbo9> nmbjumbo9) { > + if (newnmbjumbo9 > nmbjumbo9&& > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbjumbo9 = newnmbjumbo9; > uma_zone_set_max(zone_jumbo9, nmbjumbo9); > + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); > } else > error = EINVAL; > } > @@ -209,9 +216,11 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) > newnmbjumbo16 = nmbjumbo16; > error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbjumbo16> nmbjumbo16) { > + if (newnmbjumbo16 > nmbjumbo16 && > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbjumbo16 = newnmbjumbo16; > uma_zone_set_max(zone_jumbo16, nmbjumbo16); > + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); > } else > error = EINVAL; > } > @@ -221,6 +230,27 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumb > &nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", > "Maximum number of mbuf 16k jumbo clusters allowed"); > > +static int > +sysctl_nmbufs(SYSCTL_HANDLER_ARGS) > +{ > + int error, newnmbufs; > + > + newnmbufs = nmbufs; > + error = sysctl_handle_int(oidp, &newnmbufs, 0, req); > + if (error == 0 && req->newptr) { > + if (newnmbufs > nmbufs) { > + nmbufs = newnmbufs; > + uma_zone_set_max(zone_mbuf, nmbufs); > + nmbclusters = uma_zone_get_max(zone_mbuf); > + EVENTHANDLER_INVOKE(nmbufs_change); > + } else > + error = EINVAL; > + } > + return (error); > +} > +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbuf, CTLTYPE_INT|CTLFLAG_RW, > +&nmbufs, 0, sysctl_nmbufs, "IU", > + "Maximum number of mbufs allowed"); > > > SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat, > @@ -275,6 +305,10 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > MSIZE - 1, UMA_ZONE_MAXBUCKET); > + if (nmbufs > 0) { > + uma_zone_set_max(zone_mbuf, nmbufs); > + nmbufs = uma_zone_get_max(zone_mbuf); > + } > > zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, > mb_ctor_clust, mb_dtor_clust, > @@ -284,8 +318,10 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbclusters > 0) > + if (nmbclusters > 0) { > uma_zone_set_max(zone_clust, nmbclusters); > + nmbclusters = uma_zone_get_max(zone_clust); > + } > > zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, > mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf); > @@ -299,8 +335,10 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbjumbop > 0) > + if (nmbjumbop > 0) { > uma_zone_set_max(zone_jumbop, nmbjumbop); > + nmbjumbop = uma_zone_get_max(zone_jumbop); > + } > > zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, > mb_ctor_clust, mb_dtor_clust, > @@ -310,9 +348,11 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbjumbo9 > 0) > - uma_zone_set_max(zone_jumbo9, nmbjumbo9); > uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); > + if (nmbjumbo9 > 0) { > + uma_zone_set_max(zone_jumbo9, nmbjumbo9); > + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); > + } > > zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, > mb_ctor_clust, mb_dtor_clust, > @@ -322,9 +362,11 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbjumbo16 > 0) > - uma_zone_set_max(zone_jumbo16, nmbjumbo16); > uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); > + if (nmbjumbo16 > 0) { > + uma_zone_set_max(zone_jumbo16, nmbjumbo16); > + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); > + } > > zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), > NULL, NULL, > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/kern/subr_param.c Tue Nov 27 21:19:58 2012 (r243631) > @@ -93,6 +93,7 @@ int ncallout; /* maximum # of timer ev > int nbuf; > int ngroups_max; /* max # groups per process */ > int nswbuf; > +long maxmbufmem; /* max mbuf memory */ > pid_t pid_max = PID_MAX; > long maxswzone; /* max swmeta KVA storage */ > long maxbcache; /* max buffer cache KVA storage */ > @@ -270,6 +271,7 @@ init_param1(void) > void > init_param2(long physpages) > { > + long realmem; > > /* Base parameters */ > maxusers = MAXUSERS; > @@ -293,19 +295,25 @@ init_param2(long physpages) > /* > * The following can be overridden after boot via sysctl. Note: > * unless overriden, these macros are ultimately based on maxusers. > - */ > - maxproc = NPROC; > - TUNABLE_INT_FETCH("kern.maxproc", &maxproc); > - /* > * Limit maxproc so that kmap entries cannot be exhausted by > * processes. > */ > + maxproc = NPROC; > + TUNABLE_INT_FETCH("kern.maxproc", &maxproc); > if (maxproc > (physpages / 12)) > maxproc = physpages / 12; > - maxfiles = MAXFILES; > - TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); > maxprocperuid = (maxproc * 9) / 10; > - maxfilesperproc = (maxfiles * 9) / 10; > + > + /* > + * The default limit for maxfiles is 1/12 of the number of > + * physical page but not less than 16 times maxusers. > + * At most it can be 1/6 the number of physical pages. > + */ > + maxfiles = imax(MAXFILES, physpages / 8); > + TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); > + if (maxfiles > (physpages / 4)) > + maxfiles = physpages / 4; > + maxfilesperproc = (maxfiles / 10) * 9; > > /* > * Cannot be changed after boot. > @@ -313,20 +321,35 @@ init_param2(long physpages) > nbuf = NBUF; > TUNABLE_INT_FETCH("kern.nbuf", &nbuf); > > + /* > + * XXX: Does the callout wheel have to be so big? > + */ > ncallout = 16 + maxproc + maxfiles; > TUNABLE_INT_FETCH("kern.ncallout", &ncallout); > > /* > + * The default limit for all mbuf related memory is 1/2 of all > + * available kernel memory (physical or kmem). > + * At most it can be 3/4 of available kernel memory. > + */ > + realmem = lmin(physpages * PAGE_SIZE, > + VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); > + maxmbufmem = realmem / 2; > + TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); > + if (maxmbufmem > (realmem / 4) * 3) > + maxmbufmem = (realmem / 4) * 3; > + > + /* > * The default for maxpipekva is min(1/64 of the kernel address space, > * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. > */ > maxpipekva = (physpages / 64) * PAGE_SIZE; > + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); > if (maxpipekva < 512 * 1024) > maxpipekva = 512 * 1024; > if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) > maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / > 64; > - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); > } > > /* > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/kern/uipc_socket.c Tue Nov 27 21:19:58 2012 (r243631) > @@ -290,7 +290,7 @@ init_maxsockets(void *ignored) > { > > TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); > - maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); > + maxsockets = imax(maxsockets, maxfiles); > } > SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL); > > @@ -306,12 +306,9 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) > newmaxsockets = maxsockets; > error = sysctl_handle_int(oidp, &newmaxsockets, 0, req); > if (error == 0 && req->newptr) { > - if (newmaxsockets > maxsockets) { > + if (newmaxsockets > maxsockets && > + newmaxsockets <= maxfiles) { > maxsockets = newmaxsockets; > - if (maxsockets > ((maxfiles / 4) * 3)) { > - maxfiles = (maxsockets * 5) / 4; > - maxfilesperproc = (maxfiles * 9) / 10; > - } > EVENTHANDLER_INVOKE(maxsockets_change); > } else > error = EINVAL; > > Modified: head/sys/sys/eventhandler.h > ============================================================================== > --- head/sys/sys/eventhandler.h Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/sys/eventhandler.h Tue Nov 27 21:19:58 2012 (r243631) > @@ -253,6 +253,7 @@ EVENTHANDLER_DECLARE(thread_fini, thread > > typedef void (*uma_zone_chfn)(void *); > EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); > +EVENTHANDLER_DECLARE(nmbufs_change, uma_zone_chfn); > EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); > > #endif /* SYS_EVENTHANDLER_H */ > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/sys/mbuf.h Tue Nov 27 21:19:58 2012 (r243631) > @@ -395,7 +395,7 @@ struct mbstat { > * > * The rest of it is defined in kern/kern_mbuf.c > */ > - > +extern long maxmbufmem; > extern uma_zone_t zone_mbuf; > extern uma_zone_t zone_clust; > extern uma_zone_t zone_pack; > From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 17:39:16 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 6E614D7A; Wed, 28 Nov 2012 17:39:16 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 41E3B8FC12; Wed, 28 Nov 2012 17:39:16 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 3049C1A3DC1; Wed, 28 Nov 2012 09:39:15 -0800 (PST) Message-ID: <50B64C43.50001@mu.org> Date: Wed, 28 Nov 2012 09:39:15 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243627 - head/sys/kern References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> In-Reply-To: <50B5C4F1.1020002@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 17:39:16 -0000 On 11/28/12 12:01 AM, Andre Oppermann wrote: > On 28.11.2012 00:59, Robert N. M. Watson wrote: >> >> On 27 Nov 2012, at 23:29, Andre Oppermann wrote: >> >>>>>>>> Andre.. this breaks incoming connections. TCP is immediately >>>>>>>> reset and never even gets to the >>>>>>>> listener process. You need to back out of fix this urgently >>>>>>>> please. >>>>>>> >>>>>>> I just found out and fixed it. Sorry for the breakage. >>>>>> >>>>>> I'd like to see a much more thorough use of "Reviewed by:" in >>>>>> socket and TCP-related commits -- this >>>>>> is very sensitive code, and a second pair of eyes is always >>>>>> valuable. Post-commit review is not a >>>>>> substitute. Looking back over similar changes in the socket code >>>>>> over the last two years, I see >>>>>> that almost all have reviewers, so I think it would be reasonable >>>>>> to consider it mandatory for these >>>>>> subsystems at this point. The good news is that we have lots of >>>>>> people with expertise in it. >>>>> >>>>> Good to see you becoming more active again. :-) And yes, >>>>> you have a point there. >>>> >>>> Yes -- this is only about three weeks old, however; for the prior >>>> six-twelve months, I've been fairly non-existent in FreeBSD-land >>>> due to outside obligations :-). >>> >>> Just saw that I did indeed send you a review request three weeks >>> ago. ;-) >>> At the end of a rather long email though. >> >> Yes, indeed -- no patch was attached, and it followed quite a long >> e-mail on your plans to rewrite the TCP stack. I'm afraid that went >> onto the "read this later as time permits" pile as I was at a >> conference, rather than the fast-path "oh, quickly review this patch" >> pile. However, simply committing the patch rather than trying a bit >> harder to find a reviewer isn't the right answer either. To maximise >> the likelihood of a review, construct an e-mail with a subject line >> like "Review request: (patch description)", attach the patch, and >> include a proposed commit message. > > Yes, and I didn't really expect you to answer (at least quickly) during > your FreeBSD hiatus. So it was seeking review by chance. > > Alas I found and fixed the bug myself within 2.5hrs. While not optimal, > a sign of poor prior testing and too much trust into the submitter of > the patch it wasn't an earth shattering event. Doesn't distract from > the fact that it was mea culpa in any case though. > > For prior review of kern_socket* and netinet/tcp_* related changes it has > been on and off by various committers over the past year. If we do have > a policy of prior review required then it should be made official and > codified in MAINTAINERS and universally applied to all. > Personally I don't think we need any more anchors attached to people's feet when developing FreeBSD. Mistakes will happen, they will happen in head. Slowing down the process to eliminate mistakes only works to slow down change and give a false sense of "fixing stability" when in fact the only thing "stable" is the slowness of submitting code. -Alfred From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 17:43: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 3A3B911C; Wed, 28 Nov 2012 17:43:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0549B8FC0C; Wed, 28 Nov 2012 17:43:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASHhfoS099529; Wed, 28 Nov 2012 17:43:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASHhfVS099527; Wed, 28 Nov 2012 17:43:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281743.qASHhfVS099527@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 17:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243654 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 17:43:42 -0000 Author: hselasky Date: Wed Nov 28 17:43:41 2012 New Revision: 243654 URL: http://svnweb.freebsd.org/changeset/base/243654 Log: Add new USB IDs. PR: usb/173503 Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Wed Nov 28 17:34:17 2012 (r243653) +++ stable/9/sys/dev/usb/serial/u3g.c Wed Nov 28 17:43:41 2012 (r243654) @@ -319,6 +319,10 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3770, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3770_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K4505, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K4505_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Wed Nov 28 17:34:17 2012 (r243653) +++ stable/9/sys/dev/usb/usbdevs Wed Nov 28 17:43:41 2012 (r243654) @@ -2188,12 +2188,16 @@ product HUAWEI E143D 0x143d 3G modem product HUAWEI E143E 0x143e 3G modem product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem +product HUAWEI K4505 0x1464 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider +product HUAWEI K3770 0x14c9 3G modem +product HUAWEI K3770_INIT 0x14d1 K3770 Initial product HUAWEI E3131_INIT 0x14fe 3G modem initial product HUAWEI E392 0x1505 LTE modem product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial +product HUAWEI K4505_INIT 0x1521 K4505 Initial product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 17:55:18 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 EF6F93DC; Wed, 28 Nov 2012 17:55:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2AA58FC12; Wed, 28 Nov 2012 17:55:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASHtIDj001733; Wed, 28 Nov 2012 17:55:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASHtI3m001731; Wed, 28 Nov 2012 17:55:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281755.qASHtI3m001731@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 17:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243655 - in stable/8/sys/dev/usb: . serial X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 17:55:19 -0000 Author: hselasky Date: Wed Nov 28 17:55:18 2012 New Revision: 243655 URL: http://svnweb.freebsd.org/changeset/base/243655 Log: MFC r238079, r238493, r238717 and r242906: Add new USB ID's. PR: usb/169789, usb/173503 Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Wed Nov 28 17:43:41 2012 (r243654) +++ stable/8/sys/dev/usb/serial/u3g.c Wed Nov 28 17:55:18 2012 (r243655) @@ -305,14 +305,22 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E143F, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E173, 0), U3G_DEV(HUAWEI, E173_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, E3131, 0), + U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E392, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3770, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3770_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K4505, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K4505_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Wed Nov 28 17:43:41 2012 (r243654) +++ stable/8/sys/dev/usb/usbdevs Wed Nov 28 17:55:18 2012 (r243655) @@ -1898,9 +1898,17 @@ product HUAWEI E143D 0x143d 3G modem product HUAWEI E143E 0x143e 3G modem product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem +product HUAWEI K4505 0x1464 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider +product HUAWEI K3770 0x14c9 3G modem +product HUAWEI K3770_INIT 0x14d1 K3770 Initial +product HUAWEI E3131_INIT 0x14fe 3G modem initial +product HUAWEI E392 0x1505 LTE modem +product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial +product HUAWEI K4505_INIT 0x1521 K4505 Initial +product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:10: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 BC4F3BA9; Wed, 28 Nov 2012 18:10:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9823F8FC13; Wed, 28 Nov 2012 18:10:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIA5Hk004372; Wed, 28 Nov 2012 18:10:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIA5E5004369; Wed, 28 Nov 2012 18:10:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281810.qASIA5E5004369@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 18:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243656 - in stable/9/sys: dev/usb/serial sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:10:05 -0000 Author: hselasky Date: Wed Nov 28 18:10:05 2012 New Revision: 243656 URL: http://svnweb.freebsd.org/changeset/base/243656 Log: MFC r242619, r242695, r242702 and r242703: Implement support for RTS (flow control). Improve USB serial console support. Implement a USB serial jitter buffer in receive direction. Modified: stable/9/sys/dev/usb/serial/usb_serial.c stable/9/sys/dev/usb/serial/usb_serial.h stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/9/sys/dev/usb/serial/usb_serial.c Wed Nov 28 17:55:18 2012 (r243655) +++ stable/9/sys/dev/usb/serial/usb_serial.c Wed Nov 28 18:10:05 2012 (r243656) @@ -162,6 +162,7 @@ static tsw_ioctl_t ucom_ioctl; static tsw_modem_t ucom_modem; static tsw_param_t ucom_param; static tsw_outwakeup_t ucom_outwakeup; +static tsw_inwakeup_t ucom_inwakeup; static tsw_free_t ucom_free; static struct ttydevsw ucom_class = { @@ -169,6 +170,7 @@ static struct ttydevsw ucom_class = { .tsw_open = ucom_open, .tsw_close = ucom_close, .tsw_outwakeup = ucom_outwakeup, + .tsw_inwakeup = ucom_inwakeup, .tsw_ioctl = ucom_ioctl, .tsw_param = ucom_param, .tsw_modem = ucom_modem, @@ -423,16 +425,13 @@ ucom_attach_tty(struct ucom_super_softc if ((ucom_cons_softc == NULL) && (ssc->sc_unit == ucom_cons_unit) && (sc->sc_subunit == ucom_cons_subunit)) { - struct termios t; - DPRINTF("unit %d subunit %d is console", ssc->sc_unit, sc->sc_subunit); + DPRINTF("unit %d subunit %d is console", + ssc->sc_unit, sc->sc_subunit); ucom_cons_softc = sc; - memset(&t, 0, sizeof(t)); - t.c_ispeed = ucom_cons_baud; - t.c_ospeed = t.c_ispeed; - t.c_cflag = CS8; + tty_init_console(tp, ucom_cons_baud); UCOM_MTX_LOCK(ucom_cons_softc); ucom_cons_rx_low = 0; @@ -441,7 +440,7 @@ ucom_attach_tty(struct ucom_super_softc ucom_cons_tx_high = 0; sc->sc_flag |= UCOM_FLAG_CONSOLE; ucom_open(ucom_cons_softc->sc_tty); - ucom_param(ucom_cons_softc->sc_tty, &t); + ucom_param(ucom_cons_softc->sc_tty, &tp->t_termios_init_in); UCOM_MTX_UNLOCK(ucom_cons_softc); } @@ -716,6 +715,10 @@ ucom_open(struct tty *tp) sc->sc_pls_set = 0; sc->sc_pls_clr = 0; + /* reset jitter buffer */ + sc->sc_jitterbuf_in = 0; + sc->sc_jitterbuf_out = 0; + ucom_queue_command(sc, ucom_cfg_open, NULL, &sc->sc_open_task[0].hdr, &sc->sc_open_task[1].hdr); @@ -780,6 +783,46 @@ ucom_close(struct tty *tp) } } +static void +ucom_inwakeup(struct tty *tp) +{ + struct ucom_softc *sc = tty_softc(tp); + uint16_t pos; + + if (sc == NULL) + return; + + UCOM_MTX_ASSERT(sc, MA_OWNED); + + DPRINTF("tp=%p\n", tp); + + if (ttydisc_can_bypass(tp) != 0 || + (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { + return; + } + + pos = sc->sc_jitterbuf_out; + + while (sc->sc_jitterbuf_in != pos) { + int c; + + c = (char)sc->sc_jitterbuf[pos]; + + if (ttydisc_rint(tp, c, 0) == -1) + break; + pos++; + if (pos >= UCOM_JITTERBUF_SIZE) + pos -= UCOM_JITTERBUF_SIZE; + } + + sc->sc_jitterbuf_out = pos; + + /* clear RTS in async fashion */ + if ((sc->sc_jitterbuf_in == pos) && + (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) + ucom_rts(sc, 0); +} + static int ucom_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { @@ -1139,17 +1182,22 @@ ucom_param(struct tty *tp, struct termio if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) { /* XXX the TTY layer should call "open()" first! */ - + /* + * Not quite: Its ordering is partly backwards, but + * some parameters must be set early in ttydev_open(), + * possibly before calling ttydevsw_open(). + */ error = ucom_open(tp); - if (error) { + if (error) goto done; - } + opened = 1; } DPRINTF("sc = %p\n", sc); /* Check requested parameters. */ if (t->c_ispeed && (t->c_ispeed != t->c_ospeed)) { + /* XXX c_ospeed == 0 is perfectly valid. */ DPRINTF("mismatch ispeed and ospeed\n"); error = EINVAL; goto done; @@ -1360,6 +1408,11 @@ ucom_put_data(struct ucom_softc *sc, str /* first check if we can pass the buffer directly */ if (ttydisc_can_bypass(tp)) { + + /* clear any jitter buffer */ + sc->sc_jitterbuf_in = 0; + sc->sc_jitterbuf_out = 0; + if (ttydisc_rint_bypass(tp, buf, cnt) != cnt) { DPRINTF("tp=%p, data lost\n", tp); } @@ -1368,8 +1421,31 @@ ucom_put_data(struct ucom_softc *sc, str /* need to loop */ for (cnt = 0; cnt != res.length; cnt++) { - if (ttydisc_rint(tp, buf[cnt], 0) == -1) { - /* XXX what should we do? */ + if (sc->sc_jitterbuf_in != sc->sc_jitterbuf_out || + ttydisc_rint(tp, buf[cnt], 0) == -1) { + uint16_t end; + uint16_t pos; + + pos = sc->sc_jitterbuf_in; + end = sc->sc_jitterbuf_out + + UCOM_JITTERBUF_SIZE - 1; + if (end >= UCOM_JITTERBUF_SIZE) + end -= UCOM_JITTERBUF_SIZE; + + for (; cnt != res.length; cnt++) { + if (pos == end) + break; + sc->sc_jitterbuf[pos] = buf[cnt]; + pos++; + if (pos >= UCOM_JITTERBUF_SIZE) + pos -= UCOM_JITTERBUF_SIZE; + } + + sc->sc_jitterbuf_in = pos; + + /* set RTS in async fashion */ + if (sc->sc_flag & UCOM_FLAG_RTS_IFLOW) + ucom_rts(sc, 1); DPRINTF("tp=%p, lost %d " "chars\n", tp, res.length - cnt); Modified: stable/9/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/9/sys/dev/usb/serial/usb_serial.h Wed Nov 28 17:55:18 2012 (r243655) +++ stable/9/sys/dev/usb/serial/usb_serial.h Wed Nov 28 18:10:05 2012 (r243656) @@ -78,6 +78,7 @@ #define UCOM_MINVER 1 #define UCOM_PREFVER UCOM_MODVER #define UCOM_MAXVER 1 +#define UCOM_JITTERBUF_SIZE 128 /* bytes */ struct usb_device; struct ucom_softc; @@ -169,6 +170,8 @@ struct ucom_softc { struct mtx *sc_mtx; void *sc_parent; int sc_subunit; + uint16_t sc_jitterbuf_in; + uint16_t sc_jitterbuf_out; uint16_t sc_portno; uint16_t sc_flag; #define UCOM_FLAG_RTS_IFLOW 0x01 /* use RTS input flow control */ @@ -191,6 +194,7 @@ struct ucom_softc { #define UCOM_LS_RTS 0x02 #define UCOM_LS_BREAK 0x04 #define UCOM_LS_RING 0x08 + uint8_t sc_jitterbuf[UCOM_JITTERBUF_SIZE]; }; #define UCOM_MTX_ASSERT(sc, what) mtx_assert((sc)->sc_mtx, what) Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Wed Nov 28 17:55:18 2012 (r243655) +++ stable/9/sys/sys/param.h Wed Nov 28 18:10:05 2012 (r243656) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 901501 /* Master, propagated to newvers */ +#define __FreeBSD_version 901502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:13:36 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 4C649E49; Wed, 28 Nov 2012 18:13:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 150928FC13; Wed, 28 Nov 2012 18:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIDZHV005144; Wed, 28 Nov 2012 18:13:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIDZFl005143; Wed, 28 Nov 2012 18:13:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281813.qASIDZFl005143@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 18:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243657 - stable/9/sys/dev/usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:13:36 -0000 Author: hselasky Date: Wed Nov 28 18:13:35 2012 New Revision: 243657 URL: http://svnweb.freebsd.org/changeset/base/243657 Log: MFC r243380: Fix uplcom clear stall logic for PL2303HX. Submitted by: Mark Johnston Modified: stable/9/sys/dev/usb/serial/uplcom.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uplcom.c Wed Nov 28 18:10:05 2012 (r243656) +++ stable/9/sys/dev/usb/serial/uplcom.c Wed Nov 28 18:13:35 2012 (r243657) @@ -432,11 +432,21 @@ uplcom_attach(device_t dev) usbd_errstr(error)); goto detach; } - /* clear stall at first run */ - mtx_lock(&sc->sc_mtx); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); - mtx_unlock(&sc->sc_mtx); + + if (sc->sc_chiptype != TYPE_PL2303HX) { + /* HX variants seem to lock up after a clear stall request. */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); + } else { + if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 8, 0, 0) || + uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 9, 0, 0)) { + goto detach; + } + } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uplcom_callback, &sc->sc_mtx); @@ -555,9 +565,6 @@ uplcom_pl2303_init(struct usb_device *ud if (err) return (EIO); - if (uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) - || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 9, 0, 0)) - return (EIO); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:13:43 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 945B1F34; Wed, 28 Nov 2012 18:13:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1DA8FC0C; Wed, 28 Nov 2012 18:13:42 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D3F7E46B17; Wed, 28 Nov 2012 13:13:41 -0500 (EST) Date: Wed, 28 Nov 2012 18:13:41 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alfred Perlstein Subject: Re: svn commit: r243627 - head/sys/kern In-Reply-To: <50B64C43.50001@mu.org> Message-ID: References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:13:43 -0000 On Wed, 28 Nov 2012, Alfred Perlstein wrote: >> Yes, and I didn't really expect you to answer (at least quickly) during >> your FreeBSD hiatus. So it was seeking review by chance. >> >> Alas I found and fixed the bug myself within 2.5hrs. While not optimal, a >> sign of poor prior testing and too much trust into the submitter of the >> patch it wasn't an earth shattering event. Doesn't distract from the fact >> that it was mea culpa in any case though. >> >> For prior review of kern_socket* and netinet/tcp_* related changes it has >> been on and off by various committers over the past year. If we do have a >> policy of prior review required then it should be made official and >> codified in MAINTAINERS and universally applied to all. >> > Personally I don't think we need any more anchors attached to people's feet > when developing FreeBSD. > > Mistakes will happen, they will happen in head. Slowing down the process to > eliminate mistakes only works to slow down change and give a false sense of > "fixing stability" when in fact the only thing "stable" is the slowness of > submitting code. Yes, the purpose of review in this case would not be to catch (too many) dumb mistakes -- that's what testing is for -- but rather, to introduce architectural review and catch quite subtle mistakes. It was interesting doing the development cycle for the pcbgroup work a year or so ago -- having Bjoern do line-by-line reviews of changes generated not only lots of bug fixes, but also lots of high-level feedback on the design that improved it markedly. "MAINTAINERS" is a concept I'd like to see die, but the idea of seeking pre-commit review for changes, especially in sensitive code, is something to encourage. One reason review is so critical in this area is that there are lots of subtle implications to do with timing, object life cycles, inter-layer locking, etc, in the socket and TCP code -- things that any one author may not see the big picture on. We've been working to improve comments, but the problem there, of course, is that you end up with a book of design comments, and code review actually brings many of those concerns to light in a more structured and practical way. Robert From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:15:39 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 261631AF; Wed, 28 Nov 2012 18:15:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5E048FC15; Wed, 28 Nov 2012 18:15:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIFcm4005569; Wed, 28 Nov 2012 18:15:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIFcMJ005567; Wed, 28 Nov 2012 18:15:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281815.qASIFcMJ005567@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 18:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243658 - stable/8/sys/dev/usb/serial X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:15:39 -0000 Author: hselasky Date: Wed Nov 28 18:15:38 2012 New Revision: 243658 URL: http://svnweb.freebsd.org/changeset/base/243658 Log: MFC r243380: Fix uplcom clear stall logic for PL2303HX. Submitted by: Mark Johnston Modified: stable/8/sys/dev/usb/serial/uplcom.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Wed Nov 28 18:13:35 2012 (r243657) +++ stable/8/sys/dev/usb/serial/uplcom.c Wed Nov 28 18:15:38 2012 (r243658) @@ -428,11 +428,21 @@ uplcom_attach(device_t dev) usbd_errstr(error)); goto detach; } - /* clear stall at first run */ - mtx_lock(&sc->sc_mtx); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); - mtx_unlock(&sc->sc_mtx); + + if (sc->sc_chiptype != TYPE_PL2303HX) { + /* HX variants seem to lock up after a clear stall request. */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); + } else { + if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 8, 0, 0) || + uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 9, 0, 0)) { + goto detach; + } + } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uplcom_callback, &sc->sc_mtx); @@ -531,9 +541,6 @@ uplcom_pl2303_init(struct usb_device *ud if (err) return (EIO); - if (uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) - || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 9, 0, 0)) - return (EIO); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:17: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 661AD32E; Wed, 28 Nov 2012 18:17:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id CFF328FC16; Wed, 28 Nov 2012 18:17:26 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qASHpGkd015496; Wed, 28 Nov 2012 21:51:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qASHpGQR015495; Wed, 28 Nov 2012 21:51:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 28 Nov 2012 21:51:16 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r243627 - head/sys/kern Message-ID: <20121128175116.GI14202@FreeBSD.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50B64C43.50001@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, Andre Oppermann , Peter Wemm , svn-src-all@FreeBSD.org, "Robert N. M. Watson" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:17:27 -0000 Alfred, On Wed, Nov 28, 2012 at 09:39:15AM -0800, Alfred Perlstein wrote: A> Personally I don't think we need any more anchors attached to people's A> feet when developing FreeBSD. A> A> Mistakes will happen, they will happen in head. Slowing down the A> process to eliminate mistakes only works to slow down change and give a A> false sense of "fixing stability" when in fact the only thing "stable" A> is the slowness of submitting code. This will eventually lead back to the situation when no one runs head, because it is unusable. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:25:08 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 E5B845D0; Wed, 28 Nov 2012 18:25:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B10208FC13; Wed, 28 Nov 2012 18:25:08 +0000 (UTC) Received: from c0205.aw.cl.cam.ac.uk (c0205.aw.cl.cam.ac.uk [128.232.100.205]) by cyrus.watson.org (Postfix) with ESMTPSA id A16D746B2C; Wed, 28 Nov 2012 13:25:07 -0500 (EST) Subject: Re: svn commit: r243627 - head/sys/kern Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=koi8-r From: "Robert N. M. Watson" In-Reply-To: <20121128175116.GI14202@FreeBSD.org> Date: Wed, 28 Nov 2012 18:25:06 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <41E6060B-5A74-4524-9011-2BFFF5B47E24@FreeBSD.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> <20121128175116.GI14202@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1283) Cc: src-committers@FreeBSD.org, Andre Oppermann , Peter Wemm , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:25:09 -0000 On 28 Nov 2012, at 17:51, Gleb Smirnoff wrote: > On Wed, Nov 28, 2012 at 09:39:15AM -0800, Alfred Perlstein wrote: > A> Personally I don't think we need any more anchors attached to = people's=20 > A> feet when developing FreeBSD. > A>=20 > A> Mistakes will happen, they will happen in head. Slowing down the=20= > A> process to eliminate mistakes only works to slow down change and = give a=20 > A> false sense of "fixing stability" when in fact the only thing = "stable"=20 > A> is the slowness of submitting code. >=20 > This will eventually lead back to the situation when no one runs = head, > because it is unusable. Also, based on past experience: I'm much happier reviewing shaky code = before it goes into the tree than trying to debug it in situ and having = to back it out. If our advice to many companies is that they should = start developing products against head, we can't let the quality of the = head get back to the way it was in the 5.x timeframe. Several factors = have led to our having a nearly-production quality development head over = the last few years -- one is much heavier use of branched development = for features (first Perforce, and more recently, Subversion, git, etc = branches); the other is much heavier use of code review, especially for = critical parts of the system. Device driver authors have a lot more = leeway, but for core parts of the design, seeking review during = development of a feature, and then before merging it upstream, should be = an expectation for all but the most trivial of changes. It's a two-way = street, of course: if you review other people's code, they will review = yours, so as more people use review, the pool of potential reviewers = goes up as well. Robert= From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:29:34 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 C49E38A8; Wed, 28 Nov 2012 18:29:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A93FA8FC14; Wed, 28 Nov 2012 18:29:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASITYbO007515; Wed, 28 Nov 2012 18:29:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASITYKn007514; Wed, 28 Nov 2012 18:29:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201211281829.qASITYKn007514@svn.freebsd.org> From: Alan Cox Date: Wed, 28 Nov 2012 18:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243659 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:29:34 -0000 Author: alc Date: Wed Nov 28 18:29:34 2012 New Revision: 243659 URL: http://svnweb.freebsd.org/changeset/base/243659 Log: Add support for the (relatively) new object type OBJT_MGTDEVICE to vm_object_set_memattr(). Also, add a "safety belt" so that vm_object_set_memattr() doesn't silently modify undefined object types. Reviewed by: kib MFC after: 10 days Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Nov 28 18:15:38 2012 (r243658) +++ head/sys/vm/vm_object.c Wed Nov 28 18:29:34 2012 (r243659) @@ -301,6 +301,7 @@ vm_object_set_memattr(vm_object_t object switch (object->type) { case OBJT_DEFAULT: case OBJT_DEVICE: + case OBJT_MGTDEVICE: case OBJT_PHYS: case OBJT_SG: case OBJT_SWAP: @@ -310,6 +311,9 @@ vm_object_set_memattr(vm_object_t object break; case OBJT_DEAD: return (KERN_INVALID_ARGUMENT); + default: + panic("vm_object_set_memattr: object %p is of undefined type", + object); } object->memattr = memattr; return (KERN_SUCCESS); From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:35:46 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 D277EB44; Wed, 28 Nov 2012 18:35:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADFC58FC15; Wed, 28 Nov 2012 18:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIZk56008512; Wed, 28 Nov 2012 18:35:46 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIZknp008510; Wed, 28 Nov 2012 18:35:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211281835.qASIZknp008510@svn.freebsd.org> From: Devin Teske Date: Wed, 28 Nov 2012 18:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243660 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:35:46 -0000 Author: dteske Date: Wed Nov 28 18:35:46 2012 New Revision: 243660 URL: http://svnweb.freebsd.org/changeset/base/243660 Log: Discussed at-length on -arch. Make the following interface changes to my beastie boot menu: + Move boot options to a submenu + Add a new "Boot Single" menu item + Make "Boot" item and new "Boot Single" item reverse when boot_single is set + Add new "Load Defaults" item (in new "Boot Options" submenu) for overridding loader.conf(5) provided values with system defaults. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/sys/boot/forth/menu-commands.4th head/sys/boot/forth/menu.rc Modified: head/sys/boot/forth/menu-commands.4th ============================================================================== --- head/sys/boot/forth/menu-commands.4th Wed Nov 28 18:29:34 2012 (r243659) +++ head/sys/boot/forth/menu-commands.4th Wed Nov 28 18:35:46 2012 (r243660) @@ -32,6 +32,51 @@ variable kernel_state variable root_state \ +\ Boot +\ + +: init_boot ( N -- N ) + dup + s" boot_single" getenv -1 <> if + drop ( n n c-addr -- n n ) \ unused + toggle_menuitem ( n n -- n n ) + s" set menu_keycode[N]=115" \ base command to execute + else + s" set menu_keycode[N]=98" \ base command to execute + then + 17 +c! \ replace 'N' with ASCII numeral + evaluate +; + +\ +\ Alternate Boot +\ + +: init_altboot ( N -- N ) + dup + s" boot_single" getenv -1 <> if + drop ( n c-addr -- n ) \ unused + toggle_menuitem ( n -- n ) + s" set menu_keycode[N]=109" \ base command to execute + else + s" set menu_keycode[N]=115" \ base command to execute + then + 17 +c! \ replace 'N' with ASCII numeral + evaluate +; + +: altboot ( -- ) + s" boot_single" 2dup getenv -1 <> if + drop ( c-addr/u c-addr -- c-addr/u ) \ unused + unsetenv ( c-addr/u -- ) + else + 2drop ( c-addr/u -- ) \ unused + s" set boot_single=YES" evaluate + then + 0 boot ( state -- ) +; + +\ \ ACPI \ @@ -287,3 +332,15 @@ variable root_state menu-redraw TRUE \ Loop menu again ; + +\ +\ Defaults +\ + +: set_default_boot_options ( N -- N TRUE ) + acpi_enable + safemode_disable + singleuser_disable + verbose_disable + 2 goto_menu +; Modified: head/sys/boot/forth/menu.rc ============================================================================== --- head/sys/boot/forth/menu.rc Wed Nov 28 18:29:34 2012 (r243659) +++ head/sys/boot/forth/menu.rc Wed Nov 28 18:35:46 2012 (r243660) @@ -18,57 +18,98 @@ menu-init \ initialize the menu area \ Initialize main menu constructs (see `menu.4th') \ NOTE: To use the `ansi' variants, add `loader_color=1' to loader.conf(5) -set menu_caption[1]="Boot [Enter]" -set menu_command[1]="boot" -set ansi_caption[1]="Boot [Enter]" -set menu_keycode[1]="98" - -set menu_caption[2]="[Esc]ape to loader prompt" -set menu_command[2]="goto_prompt" -set menu_keycode[2]="27" -set ansi_caption[2]="Escape to loader prompt" +\ +\ MAIN MENU +\ + +set menuset_name1="main" + +set mainmenu_init[1]="init_boot" +set mainmenu_caption[1]="Boot Multi User [Enter]" +set maintoggled_text[1]="Boot [S]ingle User [Enter]" +set mainmenu_command[1]="boot" +set mainansi_caption[1]="Boot Multi User [Enter]" +set maintoggled_ansi[1]="Boot Single User [Enter]" +\ keycode set by init_boot + +set mainmenu_init[2]="init_altboot" +set mainmenu_caption[2]="Boot [S]ingle User" +set maintoggled_text[2]="Boot [M]ulti User" +set mainmenu_command[2]="altboot" +set mainansi_caption[2]="Boot Single User" +set maintoggled_ansi[2]="Boot Multi User" +\ keycode set by init_altboot + +set mainmenu_caption[3]="[Esc]ape to loader prompt" +set mainmenu_command[3]="goto_prompt" +set mainmenu_keycode[3]=27 +set mainansi_caption[3]="Escape to loader prompt" \ Enable built-in "Reboot" trailing menuitem \ NOTE: appears before menu_options if configured \ -set menu_reboot +set mainmenu_reboot \ Enable "Options:" separator. When set to a numerical value (1-8), a visual \ separator is inserted before that menuitem number. \ -set menu_options=4 +set mainmenu_options=5 + +set mainmenu_caption[5]="Configure Boot [O]ptions..." +set mainmenu_command[5]="2 goto_menu" +set mainmenu_keycode[5]=111 +set mainansi_caption[5]="Configure Boot Options..." + +\ +\ BOOT OPTIONS MENU +\ + +set menuset_name2="options" -set menu_caption[4]="[A]CPI Support off" -set toggled_text[4]="[A]CPI Support On" -set menu_command[4]="toggle_acpi" -set menu_keycode[4]="97" -set menu_acpi=4 -set ansi_caption[4]="ACPI Support Off" -set toggled_ansi[4]="ACPI Support On" - -set menu_caption[5]="Safe [M]ode... off" -set toggled_text[5]="Safe [M]ode... On" -set menu_init[5]="init_safemode" -set menu_command[5]="toggle_safemode" -set menu_keycode[5]="109" -set ansi_caption[5]="Safe Mode... Off" -set toggled_ansi[5]="Safe Mode... On" - -set menu_caption[6]="[S]ingle User. off" -set toggled_text[6]="[S]ingle User. On" -set menu_init[6]="init_singleuser" -set menu_command[6]="toggle_singleuser" -set menu_keycode[6]="115" -set ansi_caption[6]="Single User. Off" -set toggled_ansi[6]="Single User. On" - -set menu_caption[7]="[V]erbose..... off" -set toggled_text[7]="[V]erbose..... On" -set menu_init[7]="init_verbose" -set menu_command[7]="toggle_verbose" -set menu_keycode[7]="118" -set ansi_caption[7]="Verbose..... Off" -set toggled_ansi[7]="Verbose..... On" +set optionsmenu_caption[1]="Back to Main Menu [Backspace]" +set optionsmenu_command[1]="1 goto_menu" +set optionsmenu_keycode[1]=8 +set optionsansi_caption[1]="Back to Main Menu [Backspace]" + +set optionsmenu_caption[2]="Load System [D]efaults" +set optionsmenu_command[2]="set_default_boot_options" +set optionsmenu_keycode[2]=100 +set optionsansi_caption[2]="Load System Defaults" + +set optionsmenu_options=3 +set optionsmenu_optionstext="Boot Options:" + +set optionsmenu_acpi=3 +set optionsmenu_caption[3]="[A]CPI Support off" +set optionstoggled_text[3]="[A]CPI Support On" +set optionsmenu_command[3]="toggle_acpi" +set optionsmenu_keycode[3]=97 +set optionsansi_caption[3]="ACPI Support Off" +set optionstoggled_ansi[3]="ACPI Support On" + +set optionsmenu_init[4]="init_safemode" +set optionsmenu_caption[4]="Safe [M]ode... off" +set optionstoggled_text[4]="Safe [M]ode... On" +set optionsmenu_command[4]="toggle_safemode" +set optionsmenu_keycode[4]=109 +set optionsansi_caption[4]="Safe Mode... Off" +set optionstoggled_ansi[4]="Safe Mode... On" + +set optionsmenu_init[5]="init_singleuser" +set optionsmenu_caption[5]="[S]ingle User. off" +set optionstoggled_text[5]="[S]ingle User. On" +set optionsmenu_command[5]="toggle_singleuser" +set optionsmenu_keycode[5]=115 +set optionsansi_caption[5]="Single User. Off" +set optionstoggled_ansi[5]="Single User. On" + +set optionsmenu_init[6]="init_verbose" +set optionsmenu_caption[6]="[V]erbose..... off" +set optionstoggled_text[6]="[V]erbose..... On" +set optionsmenu_command[6]="toggle_verbose" +set optionsmenu_keycode[6]=118 +set optionsansi_caption[6]="Verbose..... Off" +set optionstoggled_ansi[6]="Verbose..... On" \ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to \ customize the timeout; default is 10-seconds) @@ -76,4 +117,6 @@ set toggled_ansi[7]="Verbose... set menu_timeout_command="boot" \ Display the main menu (see `menu.4th') +set menuset_initial=1 +menuset-loadinitial menu-display From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 18:37: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 30EB2EC9; Wed, 28 Nov 2012 18:37:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F10A48FC08; Wed, 28 Nov 2012 18:37:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASIbKtv008771; Wed, 28 Nov 2012 18:37:20 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASIbKhQ008770; Wed, 28 Nov 2012 18:37:20 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211281837.qASIbKhQ008770@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 Nov 2012 18:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243661 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 18:37:21 -0000 Author: hselasky Date: Wed Nov 28 18:37:20 2012 New Revision: 243661 URL: http://svnweb.freebsd.org/changeset/base/243661 Log: Regenerate usb.conf MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Wed Nov 28 18:35:46 2012 (r243660) +++ head/etc/devd/usb.conf Wed Nov 28 18:37:20 2012 (r243661) @@ -52,6 +52,17 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x12a8"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload -n if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0104"; match "product" "0x00be"; action "kldload -n uipaq"; @@ -3069,7 +3080,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x14fe|0x1505|0x1506|0x1520|0x1803|0x1c05|0x1c0b)"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1803|0x1c05|0x1c0b)"; action "kldload -n u3g"; }; @@ -4600,5 +4611,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2274 USB entries processed +# 2279 USB entries processed From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 19:32:30 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 E2684BD4; Wed, 28 Nov 2012 19:32:30 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B98CC8FC0C; Wed, 28 Nov 2012 19:32:30 +0000 (UTC) Received: from [10.250.141.33] (181.sub-174-254-232.myvzw.com [174.254.232.181]) by elvis.mu.org (Postfix) with ESMTPSA id CB2421A3DD8; Wed, 28 Nov 2012 11:32:29 -0800 (PST) References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> <20121128175116.GI14202@FreeBSD.org> <41E6060B-5A74-4524-9011-2BFFF5B47E24@FreeBSD.org> Mime-Version: 1.0 (1.0) In-Reply-To: <41E6060B-5A74-4524-9011-2BFFF5B47E24@FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <645253DB-A722-477B-8E86-FDBD9E3E58C4@mu.org> X-Mailer: iPhone Mail (10A523) From: Alfred Perlstein Subject: Re: svn commit: r243627 - head/sys/kern Date: Wed, 28 Nov 2012 11:32:27 -0800 To: "Robert N. M. Watson" Cc: "src-committers@FreeBSD.org" , Andre Oppermann , Peter Wemm , "svn-src-all@FreeBSD.org" , Gleb Smirnoff , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 19:32:31 -0000 Do you think we need another TRB? It could be used to oust undesirable committers if needed.=20 Sent from my iPhone On Nov 28, 2012, at 10:25 AM, "Robert N. M. Watson" wr= ote: >=20 > On 28 Nov 2012, at 17:51, Gleb Smirnoff wrote: >=20 >> On Wed, Nov 28, 2012 at 09:39:15AM -0800, Alfred Perlstein wrote: >> A> Personally I don't think we need any more anchors attached to people's= =20 >> A> feet when developing FreeBSD. >> A>=20 >> A> Mistakes will happen, they will happen in head. Slowing down the=20 >> A> process to eliminate mistakes only works to slow down change and give a= =20 >> A> false sense of "fixing stability" when in fact the only thing "stable"= =20 >> A> is the slowness of submitting code. >>=20 >> This will eventually lead back to the situation when no one runs head, >> because it is unusable. >=20 > Also, based on past experience: I'm much happier reviewing shaky code befo= re it goes into the tree than trying to debug it in situ and having to back i= t out. If our advice to many companies is that they should start developing p= roducts against head, we can't let the quality of the head get back to the w= ay it was in the 5.x timeframe. Several factors have led to our having a nea= rly-production quality development head over the last few years -- one is mu= ch heavier use of branched development for features (first Perforce, and mor= e recently, Subversion, git, etc branches); the other is much heavier use of= code review, especially for critical parts of the system. Device driver aut= hors have a lot more leeway, but for core parts of the design, seeking revie= w during development of a feature, and then before merging it upstream, shou= ld be an expectation for all but the most trivial of changes. It's a two-way= street, of course: if you review other people's code, they will review your= s, so as more people use review, the pool of potential reviewers goes up as w= ell. >=20 > Robert From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 21:00:18 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 0E05D129; Wed, 28 Nov 2012 21:00:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B60298FC0C; Wed, 28 Nov 2012 21:00:17 +0000 (UTC) Received: from [10.141.19.129] (unknown [212.183.128.188]) by cyrus.watson.org (Postfix) with ESMTPSA id 27D2D46B09; Wed, 28 Nov 2012 16:00:17 -0500 (EST) References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> <20121128175116.GI14202@FreeBSD.org> <41E6060B-5A74-4524-9011-2BFFF5B47E24@FreeBSD.org> <645253DB-A722-477B-8E86-FDBD9E3E58C4@mu.org> Mime-Version: 1.0 (1.0) In-Reply-To: <645253DB-A722-477B-8E86-FDBD9E3E58C4@mu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPad Mail (10A403) From: "Robert N. M. Watson" Subject: Re: svn commit: r243627 - head/sys/kern Date: Wed, 28 Nov 2012 21:00:13 +0000 To: Alfred Perlstein Cc: "src-committers@FreeBSD.org" , Andre Oppermann , Peter Wemm , "svn-src-all@FreeBSD.org" , Gleb Smirnoff , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 21:00:18 -0000 On 28 Nov 2012, at 19:32, Alfred Perlstein wrote: > Do you think we need another TRB? >=20 > It could be used to oust undesirable committers if needed.=20 Are we seriously having a discussion in which the merits of favouring pre-co= mmit code review for the things like TCP stack are in doubt? I'm not saying w= e need to seek universal consensus on all changes, rather, that I would stro= ngly prefer that people committing to this code seek review (and clearly ind= icate it in commit messages) before rather than after sticking things in the= tree. This stuff is incredibly subtle, and debugging problems in the field i= s vastly harder than catching them early in the cycle. I certainly wouldn't c= ommit any non-trivial change to the code in question without asking someone t= o go through it line-by-line, and I'd prefer if others took the same view, a= s I often end up chasing the bugs later, in the field, where it is hardest t= o do so. Robert >=20 > Sent from my iPhone >=20 > On Nov 28, 2012, at 10:25 AM, "Robert N. M. Watson" w= rote: >=20 >>=20 >> On 28 Nov 2012, at 17:51, Gleb Smirnoff wrote: >>=20 >>> On Wed, Nov 28, 2012 at 09:39:15AM -0800, Alfred Perlstein wrote: >>> A> Personally I don't think we need any more anchors attached to people'= s=20 >>> A> feet when developing FreeBSD. >>> A>=20 >>> A> Mistakes will happen, they will happen in head. Slowing down the=20 >>> A> process to eliminate mistakes only works to slow down change and give= a=20 >>> A> false sense of "fixing stability" when in fact the only thing "stable= "=20 >>> A> is the slowness of submitting code. >>>=20 >>> This will eventually lead back to the situation when no one runs head, >>> because it is unusable. >>=20 >> Also, based on past experience: I'm much happier reviewing shaky code bef= ore it goes into the tree than trying to debug it in situ and having to back= it out. If our advice to many companies is that they should start developin= g products against head, we can't let the quality of the head get back to th= e way it was in the 5.x timeframe. Several factors have led to our having a n= early-production quality development head over the last few years -- one is m= uch heavier use of branched development for features (first Perforce, and mo= re recently, Subversion, git, etc branches); the other is much heavier use o= f code review, especially for critical parts of the system. Device driver au= thors have a lot more leeway, but for core parts of the design, seeking revi= ew during development of a feature, and then before merging it upstream, sho= uld be an expectation for all but the most trivial of changes. It's a two-wa= y street, of course: if you review other people's code, they will review you= rs, so as more people use review, the pool of potential reviewers goes up as= well. >>=20 >> Robert From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 21:45:49 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 77472F62; Wed, 28 Nov 2012 21:45:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id C06278FC13; Wed, 28 Nov 2012 21:45:48 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qASLjYRB008859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Nov 2012 08:45:39 +1100 Date: Thu, 29 Nov 2012 08:45:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Cox Subject: Re: svn commit: r243631 - in head/sys: kern sys In-Reply-To: <50B64BE8.3040708@rice.edu> Message-ID: <20121129072617.T1123@besplex.bde.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50B64BE8.3040708@rice.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=Zoq1sKHG c=1 sm=1 a=PcN1GEuqyV8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y5AXMyR2jB0A:10 a=ZpmuPUM5UnzFerMvZvEA:9 a=CjuIK1q_8ugA:10 a=qNwCHDfXISvSPmd_:21 a=yMgbbjGJPBlhYQA9:21 a=LyIlnvU96IiO9QpA:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 21:45:49 -0000 On Wed, 28 Nov 2012, Alan Cox wrote: > I'm pretty sure that the "realmem" calculation is going to overflow on > i386/PAE, where the number of bytes of physical memory is greater than > the type long can represent. It overflows on i386 even without PAE, where the number of bytes of physical memory is greater than the type long can represent (2GB). This is the usual case for new hardware. I think it changes the defaults for machines with small amounts of memory (say 32MB) in dangerous ways. Reserving half of kva for mbufs is network-centric. I reserve more than half of kva for the buffer cache in some configurations (VM_BCACHE_SIZE_MAX defaults too 200 MB, but I use 512 MB), and in the old scheme where the default for mbufs was under-sized, this may even have fitted without separate tuning for mbufs. The code has lots of style bugs. > On 11/27/2012 15:19, Andre Oppermann wrote: >> ... >> NB: Every cluster also has an mbuf associated with it. >> >> Two examples on the revised mbuf sizing limits: >> >> 1GB KVM: >> 512MB limit for mbufs >> 419,430 mbufs >> 65,536 2K mbuf clusters >> 32,768 4K mbuf clusters >> 9,709 9K mbuf clusters >> 5,461 16K mbuf clusters >> >> 16GB RAM: >> 8GB limit for mbufs >> 33,554,432 mbufs >> 1,048,576 2K mbuf clusters >> 524,288 4K mbuf clusters >> 155,344 9K mbuf clusters >> 87,381 16K mbuf clusters >> >> These defaults should be sufficient for even the most demanding >> network loads. I noticed in earlier mail that there were no examples with small amounts of physical memory. This case mixes unusually with the relatively large amount of kva. PAE gives the opposite extreme. >> Modified: head/sys/kern/kern_mbuf.c >> ============================================================================== >> --- head/sys/kern/kern_mbuf.c Tue Nov 27 20:22:36 2012 (r243630) >> +++ head/sys/kern/kern_mbuf.c Tue Nov 27 21:19:58 2012 (r243631) >> @@ -147,9 +148,11 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) >> newnmbclusters = nmbclusters; >> error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); >> if (error == 0 && req->newptr) { >> - if (newnmbclusters > nmbclusters) { >> + if (newnmbclusters > nmbclusters && >> + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { Style bug: long line. This bogotifies early splitting in the previous line. >> nmbclusters = newnmbclusters; >> uma_zone_set_max(zone_clust, nmbclusters); >> + nmbclusters = uma_zone_get_max(zone_clust); >> EVENTHANDLER_INVOKE(nmbclusters_change); >> } else >> error = EINVAL; >> @@ -168,9 +171,11 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) >> newnmbjumbop = nmbjumbop; >> error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); >> if (error == 0 && req->newptr) { >> - if (newnmbjumbop> nmbjumbop) { >> + if (newnmbjumbop > nmbjumbop && >> + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { Style bug, as above. >> nmbjumbop = newnmbjumbop; >> uma_zone_set_max(zone_jumbop, nmbjumbop); >> + nmbjumbop = uma_zone_get_max(zone_jumbop); >> } else >> error = EINVAL; >> } >> @@ -189,9 +194,11 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) >> newnmbjumbo9 = nmbjumbo9; >> error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); >> if (error == 0 && req->newptr) { >> - if (newnmbjumbo9> nmbjumbo9) { >> + if (newnmbjumbo9 > nmbjumbo9&& Style bug, not as above (no space before '&&'). >> + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { Style bug, as above. >> nmbjumbo9 = newnmbjumbo9; >> uma_zone_set_max(zone_jumbo9, nmbjumbo9); >> + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); >> } else >> error = EINVAL; >> } >> @@ -209,9 +216,11 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) >> newnmbjumbo16 = nmbjumbo16; >> error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); >> if (error == 0 && req->newptr) { >> - if (newnmbjumbo16> nmbjumbo16) { >> + if (newnmbjumbo16 > nmbjumbo16 && >> + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { Style bug, as above. >> nmbjumbo16 = newnmbjumbo16; >> uma_zone_set_max(zone_jumbo16, nmbjumbo16); >> + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); >> } else >> error = EINVAL; >> } The code surrounding these style bugs uses the technique of nested elses to make the indentation march to the right, when it could simply return after an error and after the usual case where the sysctl only does a read. For one of the sysctls, the old code is: @ static int @ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) @ { @ int error, newnmbclusters; @ @ newnmbclusters = nmbclusters; @ error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); Style bug: hard-coding of the variable type (int) hard-coding sysctl_handle_int() here. @ if (error == 0 && req->newptr) { Style bug: boolean check for null pointer. Technique for marching to the right starts here. @ if (newnmbclusters > nmbclusters) { Use another nested else to get 2 indentation levels deeper than necessary altogether. @ nmbclusters = newnmbclusters; @ uma_zone_set_max(zone_clust, nmbclusters); @ EVENTHANDLER_INVOKE(nmbclusters_change); @ } else @ error = EINVAL; Only increasing nmbclusters is supported. Even null changes of it give this error. @ } @ return (error); @ } After fixing some style bugs and reducing the indentation. @@ if (error != 0 || req->newptr == NULL) @@ return (error); @@ if (newnmbclusters <= nmbclusters) @@ return (EINVAL); /* XXX preserve bogusness when equal */ @@ nmbclusters = newnmbclusters; @@ uma_zone_set_max(zone_clust, nmbclusters); @@ EVENTHANDLER_INVOKE(nmbclusters_change); @@ return (0); @@ } @ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW, Missing spaces around binary operation '|'. @ &nmbclusters, 0, sysctl_nmbclusters, "IU", Missing indentation. @ "Maximum number of mbuf clusters allowed"); @ Back to the commit. >> @@ -221,6 +230,27 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumb >> &nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", >> "Maximum number of mbuf 16k jumbo clusters allowed"); >> >> +static int >> +sysctl_nmbufs(SYSCTL_HANDLER_ARGS) >> +{ >> + int error, newnmbufs; >> + >> + newnmbufs = nmbufs; >> + error = sysctl_handle_int(oidp, &newnmbufs, 0, req); >> + if (error == 0 && req->newptr) { >> + if (newnmbufs > nmbufs) { >> + nmbufs = newnmbufs; >> + uma_zone_set_max(zone_mbuf, nmbufs); >> + nmbclusters = uma_zone_get_max(zone_mbuf); >> + EVENTHANDLER_INVOKE(nmbufs_change); >> + } else >> + error = EINVAL; >> + } >> + return (error); >> +} >> +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbuf, CTLTYPE_INT|CTLFLAG_RW, >> +&nmbufs, 0, sysctl_nmbufs, "IU", >> + "Maximum number of mbufs allowed"); All the bugs in the old sysctl are cloned here. >> >> This is not bug for bug compatible. There used to be 3 blank lines here (2 extra). Now there are only 2 (1 extra). >> Modified: head/sys/kern/subr_param.c >> ============================================================================== >> --- head/sys/kern/subr_param.c Tue Nov 27 20:22:36 2012 (r243630) >> +++ head/sys/kern/subr_param.c Tue Nov 27 21:19:58 2012 (r243631) >> @@ -93,6 +93,7 @@ int ncallout; /* maximum # of timer ev >> int nbuf; >> int ngroups_max; /* max # groups per process */ >> int nswbuf; >> +long maxmbufmem; /* max mbuf memory */ This can overflow too, since once the other overflows are fixed, it is only limited to 3/4 of physical memory so the limit on i386 is 3G, which overflows to -1G when stored here. >> pid_t pid_max = PID_MAX; >> long maxswzone; /* max swmeta KVA storage */ >> long maxbcache; /* max buffer cache KVA storage */ >> @@ -270,6 +271,7 @@ init_param1(void) >> void >> init_param2(long physpages) vm mostly uses u_int for page counts (see . v_page_count is only u_int). This avoids most overflow problems. I think alc wants to change to longs. But long is just bogus here. It can't even handle the range of u_int on 32-bit systems. But since 32-bit systems can't have >= 2**31 pages, this type error is only cosmetic. >> { >> + long realmem; u_long would work up to 4GB. >> >> /* Base parameters */ >> maxusers = MAXUSERS; >> @@ -293,19 +295,25 @@ init_param2(long physpages) >> /* >> * The following can be overridden after boot via sysctl. Note: >> * unless overriden, these macros are ultimately based on maxusers. >> - */ >> - maxproc = NPROC; >> - TUNABLE_INT_FETCH("kern.maxproc", &maxproc); >> - /* >> * Limit maxproc so that kmap entries cannot be exhausted by >> * processes. >> */ >> + maxproc = NPROC; >> + TUNABLE_INT_FETCH("kern.maxproc", &maxproc); The comments are misplaced in different ways than before. >> if (maxproc > (physpages / 12)) Old style bug: excessive parentheses. >> maxproc = physpages / 12; I dodn't like limiting the values that can be set by tunables. This prevents the administrator overring bad limits, including ones caused by overflows. >> - maxfiles = MAXFILES; >> - TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); >> maxprocperuid = (maxproc * 9) / 10; >> - maxfilesperproc = (maxfiles * 9) / 10; >> + >> + /* >> + * The default limit for maxfiles is 1/12 of the number of >> + * physical page but not less than 16 times maxusers. >> + * At most it can be 1/6 the number of physical pages. >> + */ Very wrong comment: - 1/12 is unrelated to maxfiles. It is for maxproc, and is used for that without comment above. The code uses 1/8. - 16 is quite wrong too, but the actual limit is hard to describe. The code uses a limit of MAXFILES, where MAXFILES defaults to (maxproc * 2) but can be #defined; maxproc defaults to NPROC but can be clamped. NPROC is (20 + 16 * maxusers), and cannot be #defined. The 16 in it seems to be the relevant magic numbner. But since there is a factor of 2 in (maxproc * 2), 16 is just wrong and 32 is closer to being correct. - 1/6 seems to be wrong too. The code uses 1/4. I don't like limiting tunable at all. This code has too many comments, and most of them are not useful. Most of them just echo the magic numbers in the code (here the code's value of 1/8 is not even echoed). Few or none describe when these values are what the are. Of course, this is hard to describe since the values are either heuristics or the result of very complicated calculations to ensure that everything can be packed into the available physical/virtual memory, or more likely some fuzzy combination of these. >> + maxfiles = imax(MAXFILES, physpages / 8); >> + TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); >> + if (maxfiles > (physpages / 4)) Style bug (excessive parentheses). >> + maxfiles = physpages / 4; >> + maxfilesperproc = (maxfiles / 10) * 9; Style bug (excessive parentheses). >> >> /* >> * Cannot be changed after boot. >> @@ -313,20 +321,35 @@ init_param2(long physpages) >> nbuf = NBUF; >> TUNABLE_INT_FETCH("kern.nbuf", &nbuf); >> >> + /* >> + * XXX: Does the callout wheel have to be so big? >> + */ >> ncallout = 16 + maxproc + maxfiles; >> TUNABLE_INT_FETCH("kern.ncallout", &ncallout); >> >> /* >> + * The default limit for all mbuf related memory is 1/2 of all >> + * available kernel memory (physical or kmem). >> + * At most it can be 3/4 of available kernel memory. >> + */ >> + realmem = lmin(physpages * PAGE_SIZE, >> + VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); As well as overflowing, this has a weird continuation indentation of 2 tabs to not line up with anything, instead of the KNF 4 spaces to line up with that level of indentation. >> + maxmbufmem = realmem / 2; >> + TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); >> + if (maxmbufmem > (realmem / 4) * 3) >> + maxmbufmem = (realmem / 4) * 3; Style bugs (excessive indentation; 2 instances). You added a lot of upper clamps on tunables. I don't like them, as above. There are no lower clamps, so foot shooting is still easy by setting tunables to preposterous values like 0 or negative, or to large values that overflow to negative. And if some other subsystem uses a tunable or option like VM_BCACHE_SIZE_MAX to reserve lots of kva for itself, none of the upper clams here is right. >> + >> + /* >> * The default for maxpipekva is min(1/64 of the kernel address space, >> * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. >> */ >> maxpipekva = (physpages / 64) * PAGE_SIZE; Old style bug (excessive parentheses). This divides by 64 first, so its multiplication doesn't overflow so easily. It works up to 64 * 2GB. I don't know the limit for PAE, but this much physical memory is easy to reach now. >> + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); >> if (maxpipekva < 512 * 1024) >> maxpipekva = 512 * 1024; >> if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) >> maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / >> 64; >> - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); This used to be correctly placed, so that the administrator can set any value. >> } >> >> /* >> >> Modified: head/sys/kern/uipc_socket.c >> ============================================================================== >> --- head/sys/kern/uipc_socket.c Tue Nov 27 20:22:36 2012 (r243630) >> +++ head/sys/kern/uipc_socket.c Tue Nov 27 21:19:58 2012 (r243631) >> @@ -306,12 +306,9 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) >> newmaxsockets = maxsockets; >> error = sysctl_handle_int(oidp, &newmaxsockets, 0, req); >> if (error == 0 && req->newptr) { >> - if (newmaxsockets > maxsockets) { >> + if (newmaxsockets > maxsockets && >> + newmaxsockets <= maxfiles) { No need to split this line. >> maxsockets = newmaxsockets; >> - if (maxsockets > ((maxfiles / 4) * 3)) { >> - maxfiles = (maxsockets * 5) / 4; >> - maxfilesperproc = (maxfiles * 9) / 10; >> - } Bad examples with exessive parnetheses in old code. >> EVENTHANDLER_INVOKE(maxsockets_change); >> } else >> error = EINVAL; >> Bruce From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 22:04:19 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 4320A688; Wed, 28 Nov 2012 22:04:19 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2778F8FC08; Wed, 28 Nov 2012 22:04:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qASM4Jif038847; Wed, 28 Nov 2012 22:04:19 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qASM4Ino038846; Wed, 28 Nov 2012 22:04:18 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201211282204.qASM4Ino038846@svn.freebsd.org> From: Gabor Pali Date: Wed, 28 Nov 2012 22:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243662 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 22:04:19 -0000 Author: pgj (ports committer) Date: Wed Nov 28 22:04:18 2012 New Revision: 243662 URL: http://svnweb.freebsd.org/changeset/base/243662 Log: - Update organization.dot to reflect that attilio resigned from core Approved by: core (implicit) Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Wed Nov 28 18:37:20 2012 (r243661) +++ head/share/misc/organization.dot Wed Nov 28 22:04:18 2012 (r243662) @@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted -core [label="Core Team\ncore@FreeBSD.org\ntabthorpe, gavin, jhb, kib,\ntheraven, attilio, hrs,\npeter, miwi"] +core [label="Core Team\ncore@FreeBSD.org\ntabthorpe, gavin, jhb, kib,\ntheraven, hrs, peter, miwi"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\npgj"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 22:13:33 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 C4122A74; Wed, 28 Nov 2012 22:13:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id BD3C38FC08; Wed, 28 Nov 2012 22:13:32 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hm9so5125436wib.13 for ; Wed, 28 Nov 2012 14:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=i1BP0dya9udJILpewnzaGBWOMWHe5COyMg5FXUHRHAY=; b=UTcnO7tYbYtgB5eW3zGLJD34eqJy/dul9hV5fmcXRfZIXE4bfZxFOFG6LNSbhPInnO jghBQZa8y4DwRnrzgdhUk5qIPEYr2eHEZf2Lq/95xiGjaD2ZBFgvm6D+H9zG/9u9JONM vUWHvAs4YDgTnfrgrppsYi6nQKop6ljhj2Jmshq2gcqbYo/qF9Z+oHUdXVXIF7bILrUG x36fPzd2h4by7shlxfDnovPylVz/0Ksq3gTstiXk6EYqr3E423qDJG0yht1v1O1RbfVO tydUmnxPqoUmohKfYsuJlGA8jGl8nNtsSvnQi9zvRciaX2p7RUTxyniyxMB7iMZJms1N OoLw== MIME-Version: 1.0 Received: by 10.216.85.211 with SMTP id u61mr2470608wee.212.1354140811660; Wed, 28 Nov 2012 14:13:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 28 Nov 2012 14:13:31 -0800 (PST) In-Reply-To: <201211272119.qARLJxXV061083@svn.freebsd.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> Date: Wed, 28 Nov 2012 14:13:31 -0800 X-Google-Sender-Auth: jXSNodJZ-aPm9bsAd7QiZjSnmv8 Message-ID: Subject: Re: svn commit: r243631 - in head/sys: kern sys From: Adrian Chadd To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 22:13:33 -0000 Can you please post some example figures for machines with 16, 32, 64 and 128MB? As Bruce has just replied, there's concern about this tuning being very "lots of RAM" centric, which certainly isn't the case. I'd hate to see this swing from one extreme (not enough mbufs) to the other extreme .. Adrian On 27 November 2012 13:19, Andre Oppermann wrote: > Author: andre > Date: Tue Nov 27 21:19:58 2012 > New Revision: 243631 > URL: http://svnweb.freebsd.org/changeset/base/243631 > > Log: > Base the mbuf related limits on the available physical memory or > kernel memory, whichever is lower. The overall mbuf related memory > limit must be set so that mbufs (and clusters of various sizes) > can't exhaust physical RAM or KVM. > > The limit is set to half of the physical RAM or KVM (whichever is > lower) as the baseline. In any normal scenario we want to leave > at least half of the physmem/kvm for other kernel functions and > userspace to prevent it from swapping too easily. Via a tunable > kern.maxmbufmem the limit can be upped to at most 3/4 of physmem/kvm. > > At the same time divorce maxfiles from maxusers and set maxfiles to > physpages / 8 with a floor based on maxusers. This way busy servers > can make use of the significantly increased mbuf limits with a much > larger number of open sockets. > > Tidy up ordering in init_param2() and check up on some users of > those values calculated here. > > Out of the overall mbuf memory limit 2K clusters and 4K (page size) > clusters to get 1/4 each because these are the most heavily used mbuf > sizes. 2K clusters are used for MTU 1500 ethernet inbound packets. > 4K clusters are used whenever possible for sends on sockets and thus > outbound packets. The larger cluster sizes of 9K and 16K are limited > to 1/6 of the overall mbuf memory limit. When jumbo MTU's are used > these large clusters will end up only on the inbound path. They are > not used on outbound, there it's still 4K. Yes, that will stay that > way because otherwise we run into lots of complications in the > stack. And it really isn't a problem, so don't make a scene. > > Normal mbufs (256B) weren't limited at all previously. This was > problematic as there are certain places in the kernel that on > allocation failure of clusters try to piece together their packet > from smaller mbufs. > > The mbuf limit is the number of all other mbuf sizes together plus > some more to allow for standalone mbufs (ACK for example) and to > send off a copy of a cluster. Unfortunately there isn't a way to > set an overall limit for all mbuf memory together as UMA doesn't > support such a limiting. > > NB: Every cluster also has an mbuf associated with it. > > Two examples on the revised mbuf sizing limits: > > 1GB KVM: > 512MB limit for mbufs > 419,430 mbufs > 65,536 2K mbuf clusters > 32,768 4K mbuf clusters > 9,709 9K mbuf clusters > 5,461 16K mbuf clusters > > 16GB RAM: > 8GB limit for mbufs > 33,554,432 mbufs > 1,048,576 2K mbuf clusters > 524,288 4K mbuf clusters > 155,344 9K mbuf clusters > 87,381 16K mbuf clusters > > These defaults should be sufficient for even the most demanding > network loads. > > MFC after: 1 month > > Modified: > head/sys/kern/kern_mbuf.c > head/sys/kern/subr_param.c > head/sys/kern/uipc_socket.c > head/sys/sys/eventhandler.h > head/sys/sys/mbuf.h > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/kern/kern_mbuf.c Tue Nov 27 21:19:58 2012 (r243631) > @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); > * > */ > > +int nmbufs; /* limits number of mbufs */ > int nmbclusters; /* limits number of mbuf clusters */ > int nmbjumbop; /* limits number of page size jumbo clusters */ > int nmbjumbo9; /* limits number of 9k jumbo clusters */ > @@ -147,9 +148,11 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) > newnmbclusters = nmbclusters; > error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbclusters > nmbclusters) { > + if (newnmbclusters > nmbclusters && > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbclusters = newnmbclusters; > uma_zone_set_max(zone_clust, nmbclusters); > + nmbclusters = uma_zone_get_max(zone_clust); > EVENTHANDLER_INVOKE(nmbclusters_change); > } else > error = EINVAL; > @@ -168,9 +171,11 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) > newnmbjumbop = nmbjumbop; > error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbjumbop> nmbjumbop) { > + if (newnmbjumbop > nmbjumbop && > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbjumbop = newnmbjumbop; > uma_zone_set_max(zone_jumbop, nmbjumbop); > + nmbjumbop = uma_zone_get_max(zone_jumbop); > } else > error = EINVAL; > } > @@ -189,9 +194,11 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) > newnmbjumbo9 = nmbjumbo9; > error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbjumbo9> nmbjumbo9) { > + if (newnmbjumbo9 > nmbjumbo9&& > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbjumbo9 = newnmbjumbo9; > uma_zone_set_max(zone_jumbo9, nmbjumbo9); > + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); > } else > error = EINVAL; > } > @@ -209,9 +216,11 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) > newnmbjumbo16 = nmbjumbo16; > error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); > if (error == 0 && req->newptr) { > - if (newnmbjumbo16> nmbjumbo16) { > + if (newnmbjumbo16 > nmbjumbo16 && > + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { > nmbjumbo16 = newnmbjumbo16; > uma_zone_set_max(zone_jumbo16, nmbjumbo16); > + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); > } else > error = EINVAL; > } > @@ -221,6 +230,27 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumb > &nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", > "Maximum number of mbuf 16k jumbo clusters allowed"); > > +static int > +sysctl_nmbufs(SYSCTL_HANDLER_ARGS) > +{ > + int error, newnmbufs; > + > + newnmbufs = nmbufs; > + error = sysctl_handle_int(oidp, &newnmbufs, 0, req); > + if (error == 0 && req->newptr) { > + if (newnmbufs > nmbufs) { > + nmbufs = newnmbufs; > + uma_zone_set_max(zone_mbuf, nmbufs); > + nmbclusters = uma_zone_get_max(zone_mbuf); > + EVENTHANDLER_INVOKE(nmbufs_change); > + } else > + error = EINVAL; > + } > + return (error); > +} > +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbuf, CTLTYPE_INT|CTLFLAG_RW, > +&nmbufs, 0, sysctl_nmbufs, "IU", > + "Maximum number of mbufs allowed"); > > > SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat, > @@ -275,6 +305,10 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > MSIZE - 1, UMA_ZONE_MAXBUCKET); > + if (nmbufs > 0) { > + uma_zone_set_max(zone_mbuf, nmbufs); > + nmbufs = uma_zone_get_max(zone_mbuf); > + } > > zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, > mb_ctor_clust, mb_dtor_clust, > @@ -284,8 +318,10 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbclusters > 0) > + if (nmbclusters > 0) { > uma_zone_set_max(zone_clust, nmbclusters); > + nmbclusters = uma_zone_get_max(zone_clust); > + } > > zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, > mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf); > @@ -299,8 +335,10 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbjumbop > 0) > + if (nmbjumbop > 0) { > uma_zone_set_max(zone_jumbop, nmbjumbop); > + nmbjumbop = uma_zone_get_max(zone_jumbop); > + } > > zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, > mb_ctor_clust, mb_dtor_clust, > @@ -310,9 +348,11 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbjumbo9 > 0) > - uma_zone_set_max(zone_jumbo9, nmbjumbo9); > uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); > + if (nmbjumbo9 > 0) { > + uma_zone_set_max(zone_jumbo9, nmbjumbo9); > + nmbjumbo9 = uma_zone_get_max(zone_jumbo9); > + } > > zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, > mb_ctor_clust, mb_dtor_clust, > @@ -322,9 +362,11 @@ mbuf_init(void *dummy) > NULL, NULL, > #endif > UMA_ALIGN_PTR, UMA_ZONE_REFCNT); > - if (nmbjumbo16 > 0) > - uma_zone_set_max(zone_jumbo16, nmbjumbo16); > uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); > + if (nmbjumbo16 > 0) { > + uma_zone_set_max(zone_jumbo16, nmbjumbo16); > + nmbjumbo16 = uma_zone_get_max(zone_jumbo16); > + } > > zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), > NULL, NULL, > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/kern/subr_param.c Tue Nov 27 21:19:58 2012 (r243631) > @@ -93,6 +93,7 @@ int ncallout; /* maximum # of timer ev > int nbuf; > int ngroups_max; /* max # groups per process */ > int nswbuf; > +long maxmbufmem; /* max mbuf memory */ > pid_t pid_max = PID_MAX; > long maxswzone; /* max swmeta KVA storage */ > long maxbcache; /* max buffer cache KVA storage */ > @@ -270,6 +271,7 @@ init_param1(void) > void > init_param2(long physpages) > { > + long realmem; > > /* Base parameters */ > maxusers = MAXUSERS; > @@ -293,19 +295,25 @@ init_param2(long physpages) > /* > * The following can be overridden after boot via sysctl. Note: > * unless overriden, these macros are ultimately based on maxusers. > - */ > - maxproc = NPROC; > - TUNABLE_INT_FETCH("kern.maxproc", &maxproc); > - /* > * Limit maxproc so that kmap entries cannot be exhausted by > * processes. > */ > + maxproc = NPROC; > + TUNABLE_INT_FETCH("kern.maxproc", &maxproc); > if (maxproc > (physpages / 12)) > maxproc = physpages / 12; > - maxfiles = MAXFILES; > - TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); > maxprocperuid = (maxproc * 9) / 10; > - maxfilesperproc = (maxfiles * 9) / 10; > + > + /* > + * The default limit for maxfiles is 1/12 of the number of > + * physical page but not less than 16 times maxusers. > + * At most it can be 1/6 the number of physical pages. > + */ > + maxfiles = imax(MAXFILES, physpages / 8); > + TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); > + if (maxfiles > (physpages / 4)) > + maxfiles = physpages / 4; > + maxfilesperproc = (maxfiles / 10) * 9; > > /* > * Cannot be changed after boot. > @@ -313,20 +321,35 @@ init_param2(long physpages) > nbuf = NBUF; > TUNABLE_INT_FETCH("kern.nbuf", &nbuf); > > + /* > + * XXX: Does the callout wheel have to be so big? > + */ > ncallout = 16 + maxproc + maxfiles; > TUNABLE_INT_FETCH("kern.ncallout", &ncallout); > > /* > + * The default limit for all mbuf related memory is 1/2 of all > + * available kernel memory (physical or kmem). > + * At most it can be 3/4 of available kernel memory. > + */ > + realmem = lmin(physpages * PAGE_SIZE, > + VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); > + maxmbufmem = realmem / 2; > + TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); > + if (maxmbufmem > (realmem / 4) * 3) > + maxmbufmem = (realmem / 4) * 3; > + > + /* > * The default for maxpipekva is min(1/64 of the kernel address space, > * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. > */ > maxpipekva = (physpages / 64) * PAGE_SIZE; > + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); > if (maxpipekva < 512 * 1024) > maxpipekva = 512 * 1024; > if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) > maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / > 64; > - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); > } > > /* > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/kern/uipc_socket.c Tue Nov 27 21:19:58 2012 (r243631) > @@ -290,7 +290,7 @@ init_maxsockets(void *ignored) > { > > TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); > - maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); > + maxsockets = imax(maxsockets, maxfiles); > } > SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL); > > @@ -306,12 +306,9 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) > newmaxsockets = maxsockets; > error = sysctl_handle_int(oidp, &newmaxsockets, 0, req); > if (error == 0 && req->newptr) { > - if (newmaxsockets > maxsockets) { > + if (newmaxsockets > maxsockets && > + newmaxsockets <= maxfiles) { > maxsockets = newmaxsockets; > - if (maxsockets > ((maxfiles / 4) * 3)) { > - maxfiles = (maxsockets * 5) / 4; > - maxfilesperproc = (maxfiles * 9) / 10; > - } > EVENTHANDLER_INVOKE(maxsockets_change); > } else > error = EINVAL; > > Modified: head/sys/sys/eventhandler.h > ============================================================================== > --- head/sys/sys/eventhandler.h Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/sys/eventhandler.h Tue Nov 27 21:19:58 2012 (r243631) > @@ -253,6 +253,7 @@ EVENTHANDLER_DECLARE(thread_fini, thread > > typedef void (*uma_zone_chfn)(void *); > EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); > +EVENTHANDLER_DECLARE(nmbufs_change, uma_zone_chfn); > EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); > > #endif /* SYS_EVENTHANDLER_H */ > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Tue Nov 27 20:22:36 2012 (r243630) > +++ head/sys/sys/mbuf.h Tue Nov 27 21:19:58 2012 (r243631) > @@ -395,7 +395,7 @@ struct mbstat { > * > * The rest of it is defined in kern/kern_mbuf.c > */ > - > +extern long maxmbufmem; > extern uma_zone_t zone_mbuf; > extern uma_zone_t zone_clust; > extern uma_zone_t zone_pack; From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 22:26:51 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 913C4D7E for ; Wed, 28 Nov 2012 22:26:51 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC858FC14 for ; Wed, 28 Nov 2012 22:26:50 +0000 (UTC) Received: (qmail 45398 invoked from network); 28 Nov 2012 23:58:08 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Nov 2012 23:58:08 -0000 Message-ID: <50B68F97.3010206@freebsd.org> Date: Wed, 28 Nov 2012 23:26:31 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50B64BE8.3040708@rice.edu> In-Reply-To: <50B64BE8.3040708@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 22:26:51 -0000 On 28.11.2012 18:37, Alan Cox wrote: > I'm pretty sure that the "realmem" calculation is going to overflow on > i386/PAE, where the number of bytes of physical memory is greater than > the type long can represent. Right. long == int on i386/PAE, not LP64. Is uint64_t the correct type to use to catch that? -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 23:14:52 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 4CE225CD; Wed, 28 Nov 2012 23:14:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id CB7658FC14; Wed, 28 Nov 2012 23:14:51 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qASNEZgb021539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Nov 2012 10:14:42 +1100 Date: Thu, 29 Nov 2012 10:14:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys In-Reply-To: <50B68F97.3010206@freebsd.org> Message-ID: <20121129100035.P1734@besplex.bde.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50B64BE8.3040708@rice.edu> <50B68F97.3010206@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=LfNkcUji c=1 sm=1 a=PcN1GEuqyV8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y5AXMyR2jB0A:10 a=2YkA8vpbpZSPZ7cIIj4A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 23:14:52 -0000 On Wed, 28 Nov 2012, Andre Oppermann wrote: > On 28.11.2012 18:37, Alan Cox wrote: >> I'm pretty sure that the "realmem" calculation is going to overflow on >> i386/PAE, where the number of bytes of physical memory is greater than >> the type long can represent. > > Right. long == int on i386/PAE, not LP64. Is uint64_t the correct type > to use to catch that? No. 2**63-1 bytes of physical memory might be enough for anyone, but more than that is is useful for virtual memory, and there is no need to ensure that P128 will be broken when it exists. I would just use sizes in pages for everything so that 32-bit u_ints are enough. Although this may break before P128 exists. Otherwise, uintmax_t should be used. Sloppy code can also depend on uintmax_t being "infinitely" large, so that multiplications by small scale factors don't overflow (use the more natural 'foo = bar * 3 / 4;' instead of 'foo = bar / 4 * 3;', but this can still overflow if bar is user input (say a tunable) that is not already limited enough. vm_paddr_t could be used for physical memory sizes, but might be too small or too large for virtual memory sizes, so using it would often give the same bloat as using uintmax_t, and more complications than using either u_int or uintmax_t for everything. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 23:16:01 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 9DF0974E for ; Wed, 28 Nov 2012 23:16:01 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id E26098FC12 for ; Wed, 28 Nov 2012 23:16:00 +0000 (UTC) Received: (qmail 46685 invoked from network); 29 Nov 2012 00:47:23 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 29 Nov 2012 00:47:23 -0000 Message-ID: <50B69B22.80706@freebsd.org> Date: Thu, 29 Nov 2012 00:15:46 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50B64BE8.3040708@rice.edu> <20121129072617.T1123@besplex.bde.org> In-Reply-To: <20121129072617.T1123@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 23:16:01 -0000 On 28.11.2012 22:45, Bruce Evans wrote: > On Wed, 28 Nov 2012, Alan Cox wrote: > >> I'm pretty sure that the "realmem" calculation is going to overflow on >> i386/PAE, where the number of bytes of physical memory is greater than >> the type long can represent. > > It overflows on i386 even without PAE, where the number of bytes of > physical memory is greater than the type long can represent (2GB). This is the usual case for new > hardware. Please have a look at the attached patch. Is quad_t the appropriate type to use? If not, which is the right one? > I think it changes the defaults for machines with small amounts of > memory (say 32MB) in dangerous ways. > > Reserving half of kva for mbufs is network-centric. I reserve more > than half of kva for the buffer cache in some configurations > (VM_BCACHE_SIZE_MAX defaults too 200 MB, but I use 512 MB), and in the > old scheme where the default for mbufs was under-sized, this may even > have fitted without separate tuning for mbufs. Please note that NO *reservations* are made for mbufs. It's only *limits* that are enforced. For example stand-alone mbufs were not limited at all previously and could completely exhaust all available kernel memory. > The code has lots of style bugs. Thank you for your detailed input. I'll handle that after the "long" overflow issue is solved. -- Andre Index: kern/subr_param.c =================================================================== --- kern/subr_param.c (revision 243631) +++ kern/subr_param.c (working copy) @@ -271,7 +271,7 @@ void init_param2(long physpages) { - long realmem; + quad_t realmem; /* Base parameters */ maxusers = MAXUSERS; @@ -332,10 +332,10 @@ * available kernel memory (physical or kmem). * At most it can be 3/4 of available kernel memory. */ - realmem = lmin(physpages * PAGE_SIZE, + realmem = qmin(physpages * PAGE_SIZE, VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); maxmbufmem = realmem / 2; - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); if (maxmbufmem > (realmem / 4) * 3) maxmbufmem = (realmem / 4) * 3; Index: sys/mbuf.h =================================================================== --- sys/mbuf.h (revision 243631) +++ sys/mbuf.h (working copy) @@ -395,7 +395,7 @@ * * The rest of it is defined in kern/kern_mbuf.c */ -extern long maxmbufmem; +extern quad_t maxmbufmem; extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; extern uma_zone_t zone_pack; From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 23:21:45 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 86FF89C3 for ; Wed, 28 Nov 2012 23:21:45 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id DDBE48FC13 for ; Wed, 28 Nov 2012 23:21:44 +0000 (UTC) Received: (qmail 46719 invoked from network); 29 Nov 2012 00:53:07 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 29 Nov 2012 00:53:07 -0000 Message-ID: <50B69C7A.4010904@freebsd.org> Date: Thu, 29 Nov 2012 00:21:30 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50B64BE8.3040708@rice.edu> <50B68F97.3010206@freebsd.org> <20121129100035.P1734@besplex.bde.org> In-Reply-To: <20121129100035.P1734@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 23:21:45 -0000 On 29.11.2012 00:14, Bruce Evans wrote: > On Wed, 28 Nov 2012, Andre Oppermann wrote: > >> On 28.11.2012 18:37, Alan Cox wrote: >>> I'm pretty sure that the "realmem" calculation is going to overflow on >>> i386/PAE, where the number of bytes of physical memory is greater than >>> the type long can represent. >> >> Right. long == int on i386/PAE, not LP64. Is uint64_t the correct type >> to use to catch that? > > No. 2**63-1 bytes of physical memory might be enough for anyone, but > more than that is is useful for virtual memory, and there is no need > to ensure that P128 will be broken when it exists. > > I would just use sizes in pages for everything so that 32-bit u_ints > are enough. Although this may break before P128 exists. Pages is not optimal as it would complicate the translations to the different mbuf sizes which are not necessarily integer multiple of pages. > Otherwise, uintmax_t should be used. Sloppy code can also depend on > uintmax_t being "infinitely" large, so that multiplications by small > scale factors don't overflow (use the more natural 'foo = bar * 3 / 4;' > instead of 'foo = bar / 4 * 3;', but this can still overflow if bar > is user input (say a tunable) that is not already limited enough. In the other patch I already sent to you I've used quad_t because we already have an existing TUNABLE_QUAD_FETCH macro for it. It also more natural for people to specify a memory related number in raw bytes rather than pages (which are 8k on IA64 IIRC). > vm_paddr_t could be used for physical memory sizes, but might be too > small or too large for virtual memory sizes, so using it would often > give the same bloat as using uintmax_t, and more complications than > using either u_int or uintmax_t for everything. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 23:53: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 A3E242FD; Wed, 28 Nov 2012 23:53:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 3449E8FC12; Wed, 28 Nov 2012 23:53:56 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qASNrk4Q016806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Nov 2012 10:53:48 +1100 Date: Thu, 29 Nov 2012 10:53:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys In-Reply-To: <50B69B22.80706@freebsd.org> Message-ID: <20121129103059.W1853@besplex.bde.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50B64BE8.3040708@rice.edu> <20121129072617.T1123@besplex.bde.org> <50B69B22.80706@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=FoRdZBXq c=1 sm=1 a=PcN1GEuqyV8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y5AXMyR2jB0A:10 a=9rSyG_wS7LSbufcbvGEA:9 a=CjuIK1q_8ugA:10 a=9p-u1cbOahvkULHJ:21 a=rgtl55nj80HkSBee:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 23:53:57 -0000 On Thu, 29 Nov 2012, Andre Oppermann wrote: > On 28.11.2012 22:45, Bruce Evans wrote: >> On Wed, 28 Nov 2012, Alan Cox wrote: >> >>> I'm pretty sure that the "realmem" calculation is going to overflow on >>> i386/PAE, where the number of bytes of physical memory is greater than >>> the type long can represent. >> >> It overflows on i386 even without PAE, where the number of bytes of >> physical memory is greater than the type long can represent (2GB). This is >> the usual case for new >> hardware. > > Please have a look at the attached patch. Is quad_t the appropriate > type to use? If not, which is the right one? quad_t is an old BSD type and shouldn't be used in any code newer than C99. Using a signed type risks sign extension bugs (but using an unsigned type may risk more). >> Reserving half of kva for mbufs is network-centric. I reserve more >> than half of kva for the buffer cache in some configurations >> (VM_BCACHE_SIZE_MAX defaults too 200 MB, but I use 512 MB), and in the >> old scheme where the default for mbufs was under-sized, this may even >> have fitted without separate tuning for mbufs. > > Please note that NO *reservations* are made for mbufs. It's only *limits* > that are enforced. For example stand-alone mbufs were not limited at all > previously and could completely exhaust all available kernel memory. I think there is no real difference. If the limits are reached then virtual memory may still be overcommitted. > Index: kern/subr_param.c > =================================================================== > --- kern/subr_param.c (revision 243631) > +++ kern/subr_param.c (working copy) > @@ -271,7 +271,7 @@ > void > init_param2(long physpages) > { > - long realmem; > + quad_t realmem; > > /* Base parameters */ > maxusers = MAXUSERS; > @@ -332,10 +332,10 @@ > * available kernel memory (physical or kmem). > * At most it can be 3/4 of available kernel memory. > */ > - realmem = lmin(physpages * PAGE_SIZE, > + realmem = qmin(physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); Oops, libkern hasn't caught up with C99 yet, so it doesn't have uimmin() or uimmax() for uintmax_t. Its only new min/max functions since 1993 are for off_t. These are mistakes, since off_t is not a basic type like all the others and it is much less important than intmax_t. Using these functions is too hard, but 4.4BSD intentionally left out the unsafe macros MIN() and MAX() in the kernel. Someone broke this, so we now have MIN() and MAX() and random choices of which is used. Older subr_param code mostly doesn't use min/max functions, and you could copy this and just use compare-and-assign for uintmax_t here. > maxmbufmem = realmem / 2; > - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); > + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); It is a more intractable problem that tunables also haven't caught up with C99 despite them being born in 1999 too. Nothing larger than quad_t is supported. Values larger than QUAD_MAX are blindly clamped to QUAD_MAX. This is better than for 32-bit ints and longs -- values larger than the respective MAX are blindly truncated mod 2**32. sysctls also haven't caught up with C99. So there is nothing better than TUNABLE_QUAD_FETCH() here. Then you can use any of quad_t, uquad_t, intmax_t or uintmax_t on the value. But quad_t shouldn't be used after C99... > if (maxmbufmem > (realmem / 4) * 3) > maxmbufmem = (realmem / 4) * 3; > > Index: sys/mbuf.h > =================================================================== > --- sys/mbuf.h (revision 243631) > +++ sys/mbuf.h (working copy) > @@ -395,7 +395,7 @@ > * > * The rest of it is defined in kern/kern_mbuf.c > */ > -extern long maxmbufmem; > +extern quad_t maxmbufmem; > extern uma_zone_t zone_mbuf; > extern uma_zone_t zone_clust; > extern uma_zone_t zone_pack; > Bruce From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 00:14:25 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 464FCC23; Thu, 29 Nov 2012 00:14:25 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2AEAF8FC0C; Thu, 29 Nov 2012 00:14:24 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8EALyntlCDaFvO/2dsb2JhbABFhiq6DnOCHgEBBSMEUhsOBgQCAg0ZAlkGiBEDDwysJ4kWDYlUgSKLHYMugRMDiF6NI4EcjyiDEIID X-IronPort-AV: E=Sophos;i="4.84,180,1355115600"; d="scan'208";a="2472250" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu.net.uoguelph.ca with ESMTP; 28 Nov 2012 19:14:23 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 72483B4023; Wed, 28 Nov 2012 19:14:23 -0500 (EST) Date: Wed, 28 Nov 2012 19:14:23 -0500 (EST) From: Rick Macklem To: Mateusz Guzik Message-ID: <460700956.954956.1354148063432.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20121128122034.GB17871@dft-labs.eu> Subject: Re: svn commit: r243645 - head/usr.sbin/nfsd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 00:14:25 -0000 Mateusz Guzik wrote: > On Wed, Nov 28, 2012 at 02:47:32AM +0000, Alfred Perlstein wrote: > > Author: alfred > > Date: Wed Nov 28 02:47:31 2012 > > New Revision: 243645 > > URL: http://svnweb.freebsd.org/changeset/base/243645 > > > > Log: > > Don't allow minthreads > maxthreads. > > > > Suggested by: rmacklem > > > > Modified: > > head/usr.sbin/nfsd/nfsd.c > > > > Modified: head/usr.sbin/nfsd/nfsd.c > > ============================================================================== > > --- head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:23:59 2012 (r243644) > > +++ head/usr.sbin/nfsd/nfsd.c Wed Nov 28 02:47:31 2012 (r243645) > > @@ -224,6 +224,10 @@ main(int argc, char **argv) > > udpflag = 1; > > argv += optind; > > argc -= optind; > > + if (minthreads_set && maxthreads_set && minthreads > maxthreads) > > + errx(EX_USAGE, > > + "error: minthreads(%d) can't be greater than " > > + "maxthreads(%d)", minthreads, maxthreads); > > > > /* > > * XXX > > Should not this be also checked in the kernel? Looks like nfssvc_nfsd > is > trustful: > [..] > if (args) { > nfsrv_pool->sp_minthreads = args->minthreads; > nfsrv_pool->sp_maxthreads = args->maxthreads; > } else { > nfsrv_pool->sp_minthreads = 4; > nfsrv_pool->sp_maxthreads = 4; > } > [..] > Well, since only root can do this and I can't think of why a sysadmin would use anything other than nfsd, I'm not sure it matters much? (But I don't see a problem with adding a sanity check in the kernel code.) rick > -- > Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 00:32:04 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 F23233CC; Thu, 29 Nov 2012 00:32:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5BDC8FC14; Thu, 29 Nov 2012 00:32:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAT0W3qF059974; Thu, 29 Nov 2012 00:32:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAT0W3qc059972; Thu, 29 Nov 2012 00:32:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211290032.qAT0W3qc059972@svn.freebsd.org> From: Eitan Adler Date: Thu, 29 Nov 2012 00:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243663 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 00:32:04 -0000 Author: eadler Date: Thu Nov 29 00:32:03 2012 New Revision: 243663 URL: http://svnweb.freebsd.org/changeset/base/243663 Log: Add support for AT&T Sierra Wireless USB 3G adapter PR: kern/173982 Submitted by: Eric Camachat Approved by: cperciva (implicit) MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Wed Nov 28 22:04:18 2012 (r243662) +++ head/sys/dev/usb/serial/u3g.c Thu Nov 29 00:32:03 2012 (r243663) @@ -213,6 +213,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), U3G_DEV(AIRPRIME, PC5220, 0), + U3G_DEV(AIRPRIME, AC313U, 0), U3G_DEV(ALINK, 3G, 0), U3G_DEV(ALINK, 3GU, 0), U3G_DEV(ALINK, DWM652U5, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 28 22:04:18 2012 (r243662) +++ head/sys/dev/usb/usbdevs Thu Nov 29 00:32:03 2012 (r243663) @@ -943,6 +943,7 @@ product AIRPLUS MCD650 0x3198 MCD650 mo /* AirPrime products */ product AIRPRIME PC5220 0x0112 CDMA Wireless PC Card product AIRPRIME USB308 0x68A3 USB308 HSPA+ USB Modem +product AIRPRIME AC313U 0x68aa Sierra Wireless AirCard 313U /* AirTies products */ product AIRTIES RT3070 0x2310 RT3070 From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 00:35:16 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 7A27966C; Thu, 29 Nov 2012 00:35:16 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF448FC0C; Thu, 29 Nov 2012 00:35:15 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id c13so9794071eek.13 for ; Wed, 28 Nov 2012 16:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/rKuLrzQHIkAlKfwvAEmBrXTwQX11/KR3z2D8NX7s5s=; b=r9qwxb0zyiF0PXntJMTWenV/F6Y6iYOM78HKfJf3Z/vmnujQwZP0SxY+tyFsFR4ENt mr5K3lhK9ZpY0S7r50YXVbhb6lV4rfU/1TuzV3yZiEle7RmdR0SwI9FUM8r0T10cnRrS 0yJwnAyI5mi9C/0DA+gnJWPbUmAGhFKIYlI1tZBMSpSr7Z2PS91A8Ru4RSAp+vc/wAdf ZbpCeTe8MSUuNXDfGHA243YFFY9RfUwJ7DQKzSHK7WfTA1ayBtaSp3BCnEUBjDBdSTJE Cp1yegL+RIpLlt3PEEYVs/JMDupyMV2frRyKQThzzzYWQdRjNKDF91CmBwhWnDohYIhO eUmg== MIME-Version: 1.0 Received: by 10.14.205.198 with SMTP id j46mr75778483eeo.27.1354149314061; Wed, 28 Nov 2012 16:35:14 -0800 (PST) Received: by 10.14.3.133 with HTTP; Wed, 28 Nov 2012 16:35:13 -0800 (PST) In-Reply-To: <50B5C4F1.1020002@freebsd.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> Date: Wed, 28 Nov 2012 16:35:13 -0800 Message-ID: Subject: Re: svn commit: r243627 - head/sys/kern From: Vijay Singh To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 00:35:16 -0000 > a sign of poor prior testing and too much trust into the submitter of > the patch it wasn't an earth shattering event. Doesn't distract from Andre, I am really quite disappointed to read this from you. The patch I sent you was fine, and has been well tested here. You modified it and made the error. If you wish, I can attach the mail I sent with the patch. -vijay From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 00:39:06 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 C59747FE; Thu, 29 Nov 2012 00:39:06 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id B4F188FC08; Thu, 29 Nov 2012 00:39:05 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id 12so1910350wgh.31 for ; Wed, 28 Nov 2012 16:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=moew9CWavpDAZ+8fRZU/C3//+P+aKt5SW9CXYJhJ0WI=; b=UwAtodlCZf8cOJoOtv9FwxsssfHVN+OP3yMbRjtDu0SHUDXy7V8j8QXRi0Ini/cRGa qJdM55pNNcM5S/ZXbfb4ATw5vcXdZJSyNxxXJULeM5POHTs9np970SU2WlqLChsuigaK pUr/aTHlQc/DOWyprkZwMFvnaxqaPHAgHJI8D71iCvMqkXT6nc+UvN5rU0Ac9jxbrHNi 1MkHuUiNIE41YnjxrgOXC7it+i+09Fa3Hx0P3tYNeWX0U+LMJ0uP50N3pp7BVeEFGDGH Wqw1i4zD7Xn1Sdm4W4ztun28JaBpF9ZRkesIaepomFHbd6EhcqQsRF2ps/S8KWynSF9R SP7g== Received: by 10.216.209.130 with SMTP id s2mr8658303weo.86.1354149544517; Wed, 28 Nov 2012 16:39:04 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id d9sm9475242wiw.0.2012.11.28.16.39.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 16:39:03 -0800 (PST) Date: Thu, 29 Nov 2012 01:38:53 +0100 From: Mateusz Guzik To: Rick Macklem Subject: Re: svn commit: r243645 - head/usr.sbin/nfsd Message-ID: <20121129003853.GB22327@dft-labs.eu> References: <20121128122034.GB17871@dft-labs.eu> <460700956.954956.1354148063432.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <460700956.954956.1354148063432.JavaMail.root@erie.cs.uoguelph.ca> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 00:39:06 -0000 On Wed, Nov 28, 2012 at 07:14:23PM -0500, Rick Macklem wrote: > Mateusz Guzik wrote: > > On Wed, Nov 28, 2012 at 02:47:32AM +0000, Alfred Perlstein wrote: > > > Author: alfred > > > Date: Wed Nov 28 02:47:31 2012 > > > New Revision: 243645 > > > URL: http://svnweb.freebsd.org/changeset/base/243645 > > > > > > Log: > > > Don't allow minthreads > maxthreads. > > > > > Should not this be also checked in the kernel? Looks like nfssvc_nfsd > > is > > trustful: > > > Well, since only root can do this and I can't think of why a sysadmin > would use anything other than nfsd, I'm not sure it matters much? > (But I don't see a problem with adding a sanity check in the kernel code.) > It's nothing serious and I'm not going to insist, especially since this is your code. I just prefer the kernel to be resistant if it does not cost much. I had something like this in mind (untested): http://people.freebsd.org/~mjg/patches/nfs-threads-check.diff -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 01:00:36 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 B2E7AB9C; Thu, 29 Nov 2012 01:00:36 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB038FC08; Thu, 29 Nov 2012 01:00:36 +0000 (UTC) Received: from freebsd (unknown [72.5.114.2]) by mx0.deglitch.com (Postfix) with ESMTPA id 291818FC36; Thu, 29 Nov 2012 05:00:32 +0400 (MSK) Date: Wed, 28 Nov 2012 17:00:32 -0800 From: Stanislav Sedov To: Eitan Adler Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version Message-Id: <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> In-Reply-To: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 01:00:36 -0000 On Mon, 26 Nov 2012 05:11:07 +0000 (UTC) Eitan Adler mentioned: > Author: eadler > Date: Mon Nov 26 05:11:07 2012 > New Revision: 243554 > URL: http://svnweb.freebsd.org/changeset/base/243554 > > Log: > Provide an option to users to shoot themselves in the foot. > This should probably be a default behavior. It's not good when all these warnings pop up everywhere just because local.sqlite file is present. -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 02:04:30 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 6724364A for ; Thu, 29 Nov 2012 02:04:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C26188FC12 for ; Thu, 29 Nov 2012 02:04:29 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so11144680lbb.13 for ; Wed, 28 Nov 2012 18:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Cb/TeAk5VGpkAyl+lHQLLbrFyJNI6mG7nksCNbUj9O8=; b=ukENIs17LuEjZCP4iyHTysdAJFjLc39ieNep5h6xcjGGuaebArkhtbi4RJ36FzYAKp r5i0PvlPYkTOiFRBv1dZ3SIhF5MPvcAuNl5+yAyw1ynS89B+XwAsCngQtzYqpAFlXIGP UbQrI1m8BlWKRbPFytQpIWXZIkrXNog4pPJBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Cb/TeAk5VGpkAyl+lHQLLbrFyJNI6mG7nksCNbUj9O8=; b=lyJMAqcTSbG/mo6YiULjBxxX/OO8uTvrmKx0EKAAJXDoUzBIT7brHM1YtUt2uKXi4g PrJl3vD66wbnOhkBrl2PTRb8ckCFgUS7rGSwXtG1ogWuAwwioT4uzPnkZRGajJpT7kD6 wM/hSCMuQWEuFXlMdwNVsVXCTulQF2s7iz9oxAdjnwPToc+35WGgLzI//8z9OUoQ+z1h WfQZscmX3+Q/kuEtuM8+6Xo3Xt2+/jj50dOS8rMRoQJUMkv9pmit5jG3rFjceL1WPLo0 dIscSLc+3vY0fOUX4xiqOdmpejhtIWTm2+eDnishwUUagfA7+wbUrKDpqi12exeVJ6Pi 6KJg== Received: by 10.112.38.103 with SMTP id f7mr5655849lbk.120.1354154668610; Wed, 28 Nov 2012 18:04:28 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Wed, 28 Nov 2012 18:03:58 -0800 (PST) In-Reply-To: <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> From: Eitan Adler Date: Wed, 28 Nov 2012 21:03:58 -0500 X-Google-Sender-Auth: nIQTHxx9n7emBtSmrKMWogG8MSg Message-ID: Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version To: Stanislav Sedov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQl7ThYImyNx2/19xa1e4qo8WAhZBMlKrBK11pz+EuM02Fenmo8J0AzZOdzg4ByKuadz4UU9 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 02:04:30 -0000 On 28 November 2012 20:00, Stanislav Sedov wrote: > On Mon, 26 Nov 2012 05:11:07 +0000 (UTC) > Eitan Adler mentioned: > >> Author: eadler >> Date: Mon Nov 26 05:11:07 2012 >> New Revision: 243554 >> URL: http://svnweb.freebsd.org/changeset/base/243554 >> >> Log: >> Provide an option to users to shoot themselves in the foot. >> > > This should probably be a default behavior. It's not good when all these > warnings pop up everywhere just because local.sqlite file is present. Making the foot shooting behavior default defeats the point. If local.sqlite exists it almost certainly means that you don't want to run the old pkg_ tools. For the few correct uses an opt-out option is provided. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 02:34: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 CF8F5C0D; Thu, 29 Nov 2012 02:34:27 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [78.110.53.255]) by mx1.freebsd.org (Postfix) with ESMTP id 1070C8FC15; Thu, 29 Nov 2012 02:34:27 +0000 (UTC) Received: from freebsd (unknown [72.5.114.2]) by mx0.deglitch.com (Postfix) with ESMTPA id 9E3BF8FC2B; Thu, 29 Nov 2012 06:34:23 +0400 (MSK) Date: Wed, 28 Nov 2012 18:34:22 -0800 From: Stanislav Sedov To: Eitan Adler Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version Message-Id: <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> In-Reply-To: References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 02:34:28 -0000 On Wed, 28 Nov 2012 21:03:58 -0500 Eitan Adler mentioned: > On 28 November 2012 20:00, Stanislav Sedov wrote: > > On Mon, 26 Nov 2012 05:11:07 +0000 (UTC) > > Eitan Adler mentioned: > > > >> Author: eadler > >> Date: Mon Nov 26 05:11:07 2012 > >> New Revision: 243554 > >> URL: http://svnweb.freebsd.org/changeset/base/243554 > >> > >> Log: > >> Provide an option to users to shoot themselves in the foot. > >> > > > > This should probably be a default behavior. It's not good when all these > > warnings pop up everywhere just because local.sqlite file is present. > > Making the foot shooting behavior default defeats the point. > If local.sqlite exists it almost certainly means that you don't want > to run the old pkg_ tools. > For the few correct uses an opt-out option is provided. > Well, it's not entirely true. I did end up with local.sqlite because I stepped on the landmine of portmgr-pkg becoming the default for some reason. So I did end up with half of my packages being in the pkgng sqlite database, and half in standard /var/db/pkg. I had to convert them back to standard format by hand, but I still have the sqlite database just in case. I guess if you really want to prevent a foot-shooting, you should add a message to pkgng sayng in all caps e.g. "You are running experimental package manager and there's no migration plan from pkgng to old pkg exists." and maybe ask for confirmation. I don't really see how this message being in pkg_ tools helps to prevent a possible foot-shooting at all. At very least, it makes sense to make it conditional on WITH_PKGNG, so this code does not end up compiled in if PKGNG is disabled in src.conf. -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 02:49: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 5CF51E5 for ; Thu, 29 Nov 2012 02:49:48 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C04FD8FC17 for ; Thu, 29 Nov 2012 02:49:47 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so13748455lah.13 for ; Wed, 28 Nov 2012 18:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=OM6+Nw0d9vdPEeLg+mezkTEkFOtkjTi/hcgTAEjFomM=; b=T+HsQciv9BU/CbCZWzQpT0dKlxVWH1FvJBUzbfNaZzOK1Jjm5DEOCQlbKVOZGAIJ2D 1OoP1ZZMdvxLAeu1dFFo5Cnv2Bae95hMXK4OL0Fpeq1OBKRXDeRN/oQc3HZYwmi/hjbh RlZsMd/4QeYmSCU6I7wDdm2yzq08sVAToB2N8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=OM6+Nw0d9vdPEeLg+mezkTEkFOtkjTi/hcgTAEjFomM=; b=fLA1wjY6v7dGBink0kZE5x+zp6Es58fIiSweiAEDgROw5i/XZAYgJW8meKKB8UdAfg Dg+WSkGbnfsbLQfzY/LYuxDmWAw9cK8rikqck2o8MJhKRy0woGeqMQEaDH79Rbf8+JtB uOqWS+kR8HtbiY0awfUNweAUrx2Dgl24ZhjN/64PQ6rA5Q5yS+FmChLrwU+raBCgpcoB R5pqrgE4kDdJ99+hjGipwEumcGDFH9OpHtJb5Uhcdc82hEpGWoK/ROoQH2l2+KDUq2VZ AvXQjSL53n42w9B9bM0MNwUdal4UPnpisCqkXEhOV8Smp4h7bRD7dzw2I/eIYZCJ6QtV VsHQ== Received: by 10.112.103.135 with SMTP id fw7mr4182156lbb.17.1354157386591; Wed, 28 Nov 2012 18:49:46 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Wed, 28 Nov 2012 18:49:15 -0800 (PST) In-Reply-To: <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> From: Eitan Adler Date: Wed, 28 Nov 2012 21:49:15 -0500 X-Google-Sender-Auth: vG7KSl0E-pOx1DO1jUGGp4pMLrw Message-ID: Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version To: Stanislav Sedov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQn/+wR1Qk+EBVUZpb0pYHZ1KAPE8cVQuKgq75SHuSQC4VCRkaC6Yxz5xKnnvWZCtAXTHXWJ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 02:49:48 -0000 On 28 November 2012 21:34, Stanislav Sedov wrote: > Well, it's not entirely true. I did end up with local.sqlite because I > stepped on the landmine of portmgr-pkg becoming the default for some > reason. So I did end up with half of my packages being in the pkgng > sqlite database, and half in standard /var/db/pkg. How did this happen without running pkg2ng ? > I had to convert > them back to standard format by hand, but I still have the sqlite database > just in case. This is a rare case and exactly the use case for the environment variable. Perhaps you could also just rename the file. > I guess if you really want to prevent a foot-shooting, you should add > a message to pkgng sayng in all caps e.g. "You are running experimental > package manager and there's no migration plan from pkgng to old pkg > exists." and maybe ask for confirmation. pkg is not maintained by FreeBSD so I couldn't add this if I wanted to ;) > I don't really see how this > message being in pkg_ tools helps to prevent a possible foot-shooting > at all. It reminds people that using the pkg_* tools once a conversion is done is wrong. > At very least, it makes sense to make it conditional on WITH_PKGNG, so this > code does not end up compiled in if PKGNG is disabled in src.conf. Interesting idea. Maybe I shall do this. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 03:48:40 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 21F8E903; Thu, 29 Nov 2012 03:48:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E06CA8FC08; Thu, 29 Nov 2012 03:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAT3md2u086795; Thu, 29 Nov 2012 03:48:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAT3mdRB086793; Thu, 29 Nov 2012 03:48:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211290348.qAT3mdRB086793@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 29 Nov 2012 03:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243664 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 03:48:40 -0000 Author: marcel Date: Thu Nov 29 03:48:39 2012 New Revision: 243664 URL: http://svnweb.freebsd.org/changeset/base/243664 Log: Fix LINT build for arm: NOTES defines LDFLAGS by way of a make option but LDFLAGS is not (yet) passed on to the linker (via SYSTEM_LD et al). Do so now. As such, any kernel configuration can now define linker flags by setting LDFLAGS as normal and not have to revert to hacks like setting DEBUG for flags that do not relate to debugging (see sys/powerpc/conf/MPC85XX). Modified: head/sys/conf/Makefile.arm head/sys/conf/kern.pre.mk Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Thu Nov 29 00:32:03 2012 (r243663) +++ head/sys/conf/Makefile.arm Thu Nov 29 03:48:39 2012 (r243664) @@ -43,7 +43,7 @@ STRIP_FLAGS = -S CFLAGS += -mno-apcs-frame .endif -SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader \ +SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \ -warn-common -export-dynamic -dynamic-linker /red/herring -o \ ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\ Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Nov 29 00:32:03 2012 (r243663) +++ head/sys/conf/kern.pre.mk Thu Nov 29 03:48:39 2012 (r243664) @@ -167,7 +167,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS} SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \ +SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${LDFLAGS} --no-warn-mismatch \ -warn-common -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 03:49:50 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 4EF89B1C; Thu, 29 Nov 2012 03:49:50 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id EC6568FC0C; Thu, 29 Nov 2012 03:49:49 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id wz12so10496069pbc.13 for ; Wed, 28 Nov 2012 19:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=qiLaJtSoc//JPSWh0uDp9bg5LtBA/TXf8isr1HBdeWo=; b=fRXjbca57Os6t29uxrH0bDtpsOfzcKct5VXPyn+Dq2KIE2wa+GZARm26uhfoMHtkCj /QtrHnV5tUm2OVokxgEbJQvydhgalSV5pIimLkOiYRwORWC5kuh2sOulLLpjropSsymQ Bw4zGHPC4jEgji4o4iM6tI+radbfqNUbju9ZLZDrmvpBH2f/ZK4mQHJQivh3K3CwWEiA 93WnW8iw2kcq7OmT3qxNnolHvVcSTjlxVKK5OVQ4bMjWqX4gstE1PRSP873Ed19yDHDL iCEAT5AS7nVmMbDGQqK2nhfOJgjDNvPQAFU91yXoCMwZwa0trBEnPgvpCH7wCKGIBK4M Cm0A== Received: by 10.68.247.39 with SMTP id yb7mr65431088pbc.15.1354160988265; Wed, 28 Nov 2012 19:49:48 -0800 (PST) Received: from [10.11.216.81] (mobile-166-147-095-130.mycingular.net. [166.147.95.130]) by mx.google.com with ESMTPS id o7sm296629pax.31.2012.11.28.19.49.45 (version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 19:49:47 -0800 (PST) References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> Mime-Version: 1.0 (1.0) In-Reply-To: <50B64C43.50001@mu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (10A523) From: Garrett Cooper Subject: Reviewing before commit and stability minibikeshed (Re: svn commit: r243627 - head/sys/kern) Date: Wed, 28 Nov 2012 19:49:40 -0800 To: Alfred Perlstein Cc: "src-committers@freebsd.org" , Andre Oppermann , Peter Wemm , "svn-src-all@freebsd.org" , "Robert N. M. Watson" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 03:49:50 -0000 On Nov 28, 2012, at 9:39 AM, Alfred Perlstein wrote: > On 11/28/12 12:01 AM, Andre Oppermann wrote: >> On 28.11.2012 00:59, Robert N. M. Watson wrote: >>>=20 >>> On 27 Nov 2012, at 23:29, Andre Oppermann wrote: >>>=20 >>>>>>>>> Andre.. this breaks incoming connections. TCP is immediately rese= t and never even gets to the >>>>>>>>> listener process. You need to back out of fix this urgently pleas= e. >>>>>>>>=20 >>>>>>>> I just found out and fixed it. Sorry for the breakage. >>>>>>>=20 >>>>>>> I'd like to see a much more thorough use of "Reviewed by:" in socket= and TCP-related commits -- this >>>>>>> is very sensitive code, and a second pair of eyes is always valuable= . Post-commit review is not a >>>>>>> substitute. Looking back over similar changes in the socket code ov= er the last two years, I see >>>>>>> that almost all have reviewers, so I think it would be reasonable to= consider it mandatory for these >>>>>>> subsystems at this point. The good news is that we have lots of peo= ple with expertise in it. >>>>>>=20 >>>>>> Good to see you becoming more active again. :-) And yes, >>>>>> you have a point there. >>>>>=20 >>>>> Yes -- this is only about three weeks old, however; for the prior six-= twelve months, I've been fairly non-existent in FreeBSD-land due to outside o= bligations :-). >>>>=20 >>>> Just saw that I did indeed send you a review request three weeks ago. ;= -) >>>> At the end of a rather long email though. >>>=20 >>> Yes, indeed -- no patch was attached, and it followed quite a long e-mai= l on your plans to rewrite the TCP stack. I'm afraid that went onto the "rea= d this later as time permits" pile as I was at a conference, rather than the= fast-path "oh, quickly review this patch" pile. However, simply committing t= he patch rather than trying a bit harder to find a reviewer isn't the right a= nswer either. To maximise the likelihood of a review, construct an e-mail wi= th a subject line like "Review request: (patch description)", attach the pat= ch, and include a proposed commit message. >>=20 >> Yes, and I didn't really expect you to answer (at least quickly) during >> your FreeBSD hiatus. So it was seeking review by chance. >>=20 >> Alas I found and fixed the bug myself within 2.5hrs. While not optimal, >> a sign of poor prior testing and too much trust into the submitter of >> the patch it wasn't an earth shattering event. Doesn't distract from >> the fact that it was mea culpa in any case though. >>=20 >> For prior review of kern_socket* and netinet/tcp_* related changes it has= >> been on and off by various committers over the past year. If we do have >> a policy of prior review required then it should be made official and >> codified in MAINTAINERS and universally applied to all. > Personally I don't think we need any more anchors attached to people's fee= t when developing FreeBSD. >=20 > Mistakes will happen, they will happen in head. Slowing down the process t= o eliminate mistakes only works to slow down change and give a false sense o= f "fixing stability" when in fact the only thing "stable" is the slowness of= submitting code. Organizing cabals of people to review code is the best way to go. It's an ex= tension of the maintainers concept applied in a better fashion because it en= courages several developers to provide input on a series of commits instead o= f one. I know it's sort of done in some groups [based on commit messages], but it w= ould be nice to have it better formalized and socialized as well. Things lik= e this are helpful for other potential freebsd contributors/developers (like= some folks I work with for instance!). An extension of this code review idea would probably be reviewboard. Email b= ased review is doable and a lot of OSS groups use it, but there are some nic= e points to using a more advanced tool, in particular: 1. Colorized diffs. 2. Various diff niceties (hide white space changes, etc). 3. It does a reasonable job at establishing code context (code block A has m= oved to B). There are 2 FreeBSD corporate consumers that use it, with at least one other= group considering it, and there are probably more groups that using it as w= ell. Plus it integrates well with p4, and does pretty well with git and svn.= Thanks! -Garrett= From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 04:17:40 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 6B436A7; Thu, 29 Nov 2012 04:17:40 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 405718FC08; Thu, 29 Nov 2012 04:17:40 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 8E5CB1A3D17; Wed, 28 Nov 2012 20:17:34 -0800 (PST) Message-ID: <50B6E1DD.2030908@mu.org> Date: Wed, 28 Nov 2012 20:17:33 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: Reviewing before commit and stability minibikeshed (Re: svn commit: r243627 - head/sys/kern) References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , Andre Oppermann , Peter Wemm , "svn-src-all@freebsd.org" , "Robert N. M. Watson" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 04:17:40 -0000 On 11/28/12 7:49 PM, Garrett Cooper wrote: > On Nov 28, 2012, at 9:39 AM, Alfred Perlstein wrote: > >> On 11/28/12 12:01 AM, Andre Oppermann wrote: >>> On 28.11.2012 00:59, Robert N. M. Watson wrote: >>>> On 27 Nov 2012, at 23:29, Andre Oppermann wrote: >>>> >>>>>>>>>> Andre.. this breaks incoming connections. TCP is immediately reset and never even gets to the >>>>>>>>>> listener process. You need to back out of fix this urgently please. >>>>>>>>> I just found out and fixed it. Sorry for the breakage. >>>>>>>> I'd like to see a much more thorough use of "Reviewed by:" in socket and TCP-related commits -- this >>>>>>>> is very sensitive code, and a second pair of eyes is always valuable. Post-commit review is not a >>>>>>>> substitute. Looking back over similar changes in the socket code over the last two years, I see >>>>>>>> that almost all have reviewers, so I think it would be reasonable to consider it mandatory for these >>>>>>>> subsystems at this point. The good news is that we have lots of people with expertise in it. >>>>>>> Good to see you becoming more active again. :-) And yes, >>>>>>> you have a point there. >>>>>> Yes -- this is only about three weeks old, however; for the prior six-twelve months, I've been fairly non-existent in FreeBSD-land due to outside obligations :-). >>>>> Just saw that I did indeed send you a review request three weeks ago. ;-) >>>>> At the end of a rather long email though. >>>> Yes, indeed -- no patch was attached, and it followed quite a long e-mail on your plans to rewrite the TCP stack. I'm afraid that went onto the "read this later as time permits" pile as I was at a conference, rather than the fast-path "oh, quickly review this patch" pile. However, simply committing the patch rather than trying a bit harder to find a reviewer isn't the right answer either. To maximise the likelihood of a review, construct an e-mail with a subject line like "Review request: (patch description)", attach the patch, and include a proposed commit message. >>> Yes, and I didn't really expect you to answer (at least quickly) during >>> your FreeBSD hiatus. So it was seeking review by chance. >>> >>> Alas I found and fixed the bug myself within 2.5hrs. While not optimal, >>> a sign of poor prior testing and too much trust into the submitter of >>> the patch it wasn't an earth shattering event. Doesn't distract from >>> the fact that it was mea culpa in any case though. >>> >>> For prior review of kern_socket* and netinet/tcp_* related changes it has >>> been on and off by various committers over the past year. If we do have >>> a policy of prior review required then it should be made official and >>> codified in MAINTAINERS and universally applied to all. >> Personally I don't think we need any more anchors attached to people's feet when developing FreeBSD. >> >> Mistakes will happen, they will happen in head. Slowing down the process to eliminate mistakes only works to slow down change and give a false sense of "fixing stability" when in fact the only thing "stable" is the slowness of submitting code. > Organizing cabals of people to review code is the best way to go. It's an extension of the maintainers concept applied in a better fashion because it encourages several developers to provide input on a series of commits instead of one. > > I know it's sort of done in some groups [based on commit messages], but it would be nice to have it better formalized and socialized as well. Things like this are helpful for other potential freebsd contributors/developers (like some folks I work with for instance!). > > An extension of this code review idea would probably be reviewboard. Email based review is doable and a lot of OSS groups use it, but there are some nice points to using a more advanced tool, in particular: > 1. Colorized diffs. > 2. Various diff niceties (hide white space changes, etc). > 3. It does a reasonable job at establishing code context (code block A has moved to B). > > There are 2 FreeBSD corporate consumers that use it, with at least one other group considering it, and there are probably more groups that using it as well. Plus it integrates well with p4, and does pretty well with git and svn. > > I've seen what happens with large groups, it doesn't scale and basically you wind up with the following type of reviewers: 1) whitespace nazis 2) rubber stampers 3) forever absentee reviewers 4) name nazis The whitespace nazis will never give review approval until you've gone through 600 iterations of the code. Imagine Bruce... but if he wasn't pragmatic and awesome and didn't have other amazing skills. The rubber stampers are friends or people that feel bad about what's happening to you by the whitespace nazis and name nazis so they just glance and approve based on the fact that you're a good guy who has committed to the same place before and usually doesn't break stuff. The forever absentee reviewers are the ones that sign up to review, but never are around to review, or just don't have the time. Eventually an entire subsystem becomes "owned" by absentee reviewers and then it's a huge, delicate and annoying process to get that part of the code under some other list or remove the absentee people. Finally the name nazis, these will debate you on if your code should be of the name kern_foo.c, subr_foo.c or maybe in the new-name-ng should actually be called kernel_subr_foo.c, but whatever you name something, they will make you change it, because you are wrong. Anyhow, that is my opinion on heavy handed reviews in a large project. I've been fortunate enough to work on one project where luckily it was dominated by rubber stampers, that was silly but awesome because at least we could get stuff done... Unfortunately I then worked on quite a few dominated by a mix of all the four I mentioned. The result sucked. -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 05:16:50 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 9CB3881D; Thu, 29 Nov 2012 05:16:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 81BE88FC0C; Thu, 29 Nov 2012 05:16:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAT5GoR8098710; Thu, 29 Nov 2012 05:16:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAT5GoT5098709; Thu, 29 Nov 2012 05:16:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211290516.qAT5GoT5098709@svn.freebsd.org> From: Eitan Adler Date: Thu, 29 Nov 2012 05:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243665 - head/sbin/dump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 05:16:50 -0000 Author: eadler Date: Thu Nov 29 05:16:50 2012 New Revision: 243665 URL: http://svnweb.freebsd.org/changeset/base/243665 Log: Mark non-returning function as such PR: bin/172978 Approved by: cperciva MFC after: 3 days Modified: head/sbin/dump/dump.h Modified: head/sbin/dump/dump.h ============================================================================== --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) @@ -121,7 +121,7 @@ void trewind(void); void writerec(char *dp, int isspcl); void Exit(int status) __dead2; -void dumpabort(int signo); +void dumpabort(int signo) __dead2; void dump_getfstab(void); char *rawname(char *cp); From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 05:46:47 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 1CF17C60; Thu, 29 Nov 2012 05:46:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3AE48FC0C; Thu, 29 Nov 2012 05:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAT5kkNn002560; Thu, 29 Nov 2012 05:46:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAT5kkZx002559; Thu, 29 Nov 2012 05:46:46 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211290546.qAT5kkZx002559@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 29 Nov 2012 05:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243666 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 05:46:47 -0000 Author: gonzo Date: Thu Nov 29 05:46:46 2012 New Revision: 243666 URL: http://svnweb.freebsd.org/changeset/base/243666 Log: Fix hardcoded bpp value Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Thu Nov 29 05:16:50 2012 (r243665) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Thu Nov 29 05:46:46 2012 (r243666) @@ -751,7 +751,7 @@ bcmfb_putc(video_adapter_t *adp, vm_offs p = sc->font + c*BCMFB_FONT_HEIGHT; addr = (uint8_t *)sc->fb_addr + (row + sc->ymargin)*(sc->stride) - + 3 * (col + sc->xmargin); + + (sc->depth/8) * (col + sc->xmargin); fg = a & 0xf ; bg = (a >> 8) & 0xf; From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 07:05:13 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 9C12C7D4; Thu, 29 Nov 2012 07:05:13 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og108.obsmtp.com (exprod7og108.obsmtp.com [64.18.2.169]) by mx1.freebsd.org (Postfix) with ESMTP id 0554B8FC0C; Thu, 29 Nov 2012 07:05:09 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob108.postini.com ([64.18.6.12]) with SMTP ID DSNKULcJJDMRa77b0Wqe+tbHYfoyBH3i4MFD@postini.com; Wed, 28 Nov 2012 23:05:13 PST Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 28 Nov 2012 23:02:35 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id qAT72Y324267; Wed, 28 Nov 2012 23:02:34 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 9C68458094; Wed, 28 Nov 2012 23:02:34 -0800 (PST) To: Alfred Perlstein Subject: Re: Reviewing before commit and stability minibikeshed (Re: svn commit: r243627 - head/sys/kern) In-Reply-To: <50B6E1DD.2030908@mu.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> <50B6E1DD.2030908@mu.org> Comments: In-reply-to: Alfred Perlstein message dated "Wed, 28 Nov 2012 20:17:33 -0800." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 28 Nov 2012 23:02:34 -0800 Message-ID: <20121129070234.9C68458094@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: "src-committers@freebsd.org" , Andre Oppermann , Peter Wemm , Garrett Cooper , "svn-src-all@freebsd.org" , "Robert N. M. Watson" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:05:13 -0000 >On 11/28/12 7:49 PM, Garrett Cooper wrote: >> I know it's sort of done in some groups [based on commit messages], but it w >ould be nice to have it better formalized and socialized as well. Things like Trying to get too formalized could be counter productive. >> An extension of this code review idea would probably be reviewboard. Email b >ased review is doable and a lot of OSS groups use it, but there are some nice >points to using a more advanced tool, in particular: >> 1. Colorized diffs. FWIW all the Colorized tools I've seen just hurt my eyes. On Wed, 28 Nov 2012 20:17:33 -0800, Alfred Perlstein writes: >I've seen what happens with large groups, it doesn't scale and basically >you wind up with the following type of reviewers: The issues you cite, are the result of taking a good idea too far. Mandating reviews for all changes - does not make sense, and all the ills you describe are natural consequences. But AFAIK that wasn't what Robert was talking about. Some bits of code do warrant extra care when touching. Unless you are the sole author and maintainer (and sometimes even then) getting a 2nd opinion (from someone familiar with the code) makes sense. That does not have to map to a requirement for formal reviewers, review tracking etc - none of which would scale in a volunteer organization anyway. From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 07:24:00 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 C8AFADC8 for ; Thu, 29 Nov 2012 07:24:00 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2204A8FC14 for ; Thu, 29 Nov 2012 07:23:59 +0000 (UTC) Received: (qmail 48575 invoked from network); 29 Nov 2012 08:55:19 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 29 Nov 2012 08:55:19 -0000 Message-ID: <50B70D81.5090000@freebsd.org> Date: Thu, 29 Nov 2012 08:23:45 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Vijay Singh Subject: Re: svn commit: r243627 - head/sys/kern References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:24:00 -0000 On 29.11.2012 01:35, Vijay Singh wrote: >> a sign of poor prior testing and too much trust into the submitter of >> the patch it wasn't an earth shattering event. Doesn't distract from > > Andre, I am really quite disappointed to read this from you. The patch > I sent you was fine, and has been well tested here. You modified it > and made the error. If you wish, I can attach the mail I sent with the > patch. Vijay, Your original patch indeed was correct wrt. testing against the head pointer. On Nov. 2 I sent you my (wrongly) modified patch for review and testing. On Nov. 5 you replied that is looks good to you. There is no doubt that I screwed up about everything else on this patch but I did send it for review and you didn't catch the mistake I made. -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 07:30:43 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 5FBA2F8B; Thu, 29 Nov 2012 07:30:43 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C2578FC0C; Thu, 29 Nov 2012 07:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAT7UhLX016747; Thu, 29 Nov 2012 07:30:43 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAT7Uhkv016745; Thu, 29 Nov 2012 07:30:43 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211290730.qAT7Uhkv016745@svn.freebsd.org> From: Andre Oppermann Date: Thu, 29 Nov 2012 07:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243668 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:30:43 -0000 Author: andre Date: Thu Nov 29 07:30:42 2012 New Revision: 243668 URL: http://svnweb.freebsd.org/changeset/base/243668 Log: Using a long is the wrong type to represent the realmem and maxmbufmem variable as they may overflow on i386/PAE and i386 with > 2GB RAM. Use 64bit quad_t instead. It has broader kernel infrastructure support with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. Pointed out by: alc, bde Modified: head/sys/kern/subr_param.c head/sys/sys/mbuf.h Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; -long maxmbufmem; /* max mbuf memory */ +quad_t maxmbufmem; /* max mbuf memory */ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ @@ -271,7 +271,7 @@ init_param1(void) void init_param2(long physpages) { - long realmem; + quad_t realmem; /* Base parameters */ maxusers = MAXUSERS; @@ -332,10 +332,10 @@ init_param2(long physpages) * available kernel memory (physical or kmem). * At most it can be 3/4 of available kernel memory. */ - realmem = lmin(physpages * PAGE_SIZE, + realmem = qmin(physpages * PAGE_SIZE, VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); maxmbufmem = realmem / 2; - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); if (maxmbufmem > (realmem / 4) * 3) maxmbufmem = (realmem / 4) * 3; Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Nov 29 06:26:42 2012 (r243667) +++ head/sys/sys/mbuf.h Thu Nov 29 07:30:42 2012 (r243668) @@ -395,7 +395,7 @@ struct mbstat { * * The rest of it is defined in kern/kern_mbuf.c */ -extern long maxmbufmem; +extern quad_t maxmbufmem; extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; extern uma_zone_t zone_pack; From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 07:38:52 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 1E15327E; Thu, 29 Nov 2012 07:38:52 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id D59818FC0C; Thu, 29 Nov 2012 07:38:50 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id a14so5039769eaa.13 for ; Wed, 28 Nov 2012 23:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=rZxwGivGaPVIN+gB4LguqbzpwDcl/nzN0nnrKE+9iyA=; b=F4fsxERsz2OkgoKOWTgafKzeMAGMYIfaUhAEcu4JVBbmHnZ97uMWEzTyrm/mw+XmZm qTxmtIF/C44Zn+V+bVnNbI2qgorzWqKMMOkDFpaG525hlr9u1S0FFuXqSwpF9R0V1/0U y5anaqK9ghZmVbM5ByAys+J9zncMBMISDiw+6t8A9NkMdaTxqF3D9UEo3gXJRASdy3yh 4AdESN2n0ArJM6rr187bosiWi8AUmfw6lZCReNmwuckuv2FmuZMEbAc2nsIppzoB0DWL k9Qhzi/3qBfn0GELeD6w2gc19KWYfCJzSeg+U2y6f6htKPDvizoYACUT1zlAScRZz383 sVXQ== Received: by 10.14.178.7 with SMTP id e7mr63276677eem.44.1354174730057; Wed, 28 Nov 2012 23:38:50 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPS id e1sm1886601eem.3.2012.11.28.23.38.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 23:38:49 -0800 (PST) Sender: Baptiste Daroussin Date: Thu, 29 Nov 2012 08:38:47 +0100 From: Baptiste Daroussin To: Stanislav Sedov Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version Message-ID: <20121129073846.GG97474@ithaqua.etoilebsd.net> References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S5HS5MvDw4DmbRmb" Content-Disposition: inline In-Reply-To: <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:38:52 -0000 --S5HS5MvDw4DmbRmb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 28, 2012 at 06:34:22PM -0800, Stanislav Sedov wrote: > On Wed, 28 Nov 2012 21:03:58 -0500 > Eitan Adler mentioned: >=20 > > On 28 November 2012 20:00, Stanislav Sedov wrote: > > > On Mon, 26 Nov 2012 05:11:07 +0000 (UTC) > > > Eitan Adler mentioned: > > > > > >> Author: eadler > > >> Date: Mon Nov 26 05:11:07 2012 > > >> New Revision: 243554 > > >> URL: http://svnweb.freebsd.org/changeset/base/243554 > > >> > > >> Log: > > >> Provide an option to users to shoot themselves in the foot. > > >> > > > > > > This should probably be a default behavior. It's not good when all t= hese > > > warnings pop up everywhere just because local.sqlite file is present. > >=20 > > Making the foot shooting behavior default defeats the point. > > If local.sqlite exists it almost certainly means that you don't want > > to run the old pkg_ tools. > > For the few correct uses an opt-out option is provided. > >=20 >=20 > Well, it's not entirely true. I did end up with local.sqlite because I > stepped on the landmine of portmgr-pkg becoming the default for some > reason. So I did end up with half of my packages being in the pkgng > sqlite database, and half in standard /var/db/pkg. I had to convert > them back to standard format by hand, but I still have the sqlite database > just in case. >=20 > I guess if you really want to prevent a foot-shooting, you should add > a message to pkgng sayng in all caps e.g. "You are running experimental > package manager and there's no migration plan from pkgng to old pkg > exists." and maybe ask for confirmation. I don't really see how this > message being in pkg_ tools helps to prevent a possible foot-shooting > at all. pkg is no more experimental at all, it is not perfect there are large rooms= for improvements, but it is perfectly ready to be used, if you have any concern about some missing "feature" just report it; Concerning a landmine, when you have big flashy lights all over the place: http://lists.freebsd.org/pipermail/freebsd-ports-announce/2012-October/0000= 32.html http://lists.freebsd.org/pipermail/freebsd-current/2012-October/037001.html a fanfare playing in front of it saying beware landsmine: http://svnweb.freebsd.org/ports?view=3Drevision&revision=3D305637 and maps available all over the places to explains where the mine are how to workaround them, or be mine proof: http://svnweb.freebsd.org/ports/head/CHANGES (entry 20121010) http://svnweb.freebsd.org/ports/head/UPDATING (entry 20121010) I'd say in that case it is no more considered as a landmine but just a new = safe way. Bapt --S5HS5MvDw4DmbRmb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC3EQYACgkQ8kTtMUmk6EwhjgCfbWItx7QrIoYQL4o5WkiDLK0H l/YAn2+w1YL7Zl5guHYtBdqVFxnKD936 =ucWY -----END PGP SIGNATURE----- --S5HS5MvDw4DmbRmb-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 07:44:00 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 E3E69438; Thu, 29 Nov 2012 07:44:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5358FC12; Thu, 29 Nov 2012 07:44:00 +0000 (UTC) Received: from [192.168.2.119] (host86-146-118-26.range86-146.btcentralplus.com [86.146.118.26]) by cyrus.watson.org (Postfix) with ESMTPSA id 2A0AB46B17; Thu, 29 Nov 2012 02:43:58 -0500 (EST) Subject: Re: Reviewing before commit and stability minibikeshed (Re: svn commit: r243627 - head/sys/kern) Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: "Robert N. M. Watson" In-Reply-To: <50B6E1DD.2030908@mu.org> Date: Thu, 29 Nov 2012 07:43:57 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <450D9522-1878-41C7-B1E1-3C5388B5A2A4@FreeBSD.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> <50B6E1DD.2030908@mu.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1283) Cc: "src-committers@freebsd.org" , Andre Oppermann , Peter Wemm , Garrett Cooper , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:44:01 -0000 On 29 Nov 2012, at 04:17, Alfred Perlstein wrote: > I've seen what happens with large groups, it doesn't scale and = basically you wind up with the following type of reviewers: I think we have to assume best intent here -- the goal of code review in = complex critical components is not to eliminate creativity, but to = reduce the occurrence of errors and improve the extent to which larger = architectural goals are applied and understood in substantive changes. I = would much rather we agree by consensus that this sort of code requires = mutual code review than chase the "stick" aspect -- as I've said, I feel = strongly that code review applied in the last few years has improved = code quality markedly in this area, and prevented a lot of problems from = being shipped in production kernels. Obviously, you've had some bad = experiences with code review, and I have sympathies -- however, if we = grant commit bits on the basis of not just technical competence and = independence, but also their ability to work well with others, then we = need to trust them to perform code reviews in a mature way. And by "code = review", I'm incorporating the idea of "design review" as well -- some = collaboration throughout development of non-trivial changes (e.g., in a = branch) really does improve not just quality of local areas of code, but = the overall design. Robert >=20 > 1) whitespace nazis > 2) rubber stampers > 3) forever absentee reviewers > 4) name nazis >=20 > The whitespace nazis will never give review approval until you've gone = through 600 iterations of the code. Imagine Bruce... but if he wasn't = pragmatic and awesome and didn't have other amazing skills. >=20 > The rubber stampers are friends or people that feel bad about what's = happening to you by the whitespace nazis and name nazis so they just = glance and approve based on the fact that you're a good guy who has = committed to the same place before and usually doesn't break stuff. >=20 > The forever absentee reviewers are the ones that sign up to review, = but never are around to review, or just don't have the time. Eventually = an entire subsystem becomes "owned" by absentee reviewers and then it's = a huge, delicate and annoying process to get that part of the code under = some other list or remove the absentee people. >=20 > Finally the name nazis, these will debate you on if your code should = be of the name kern_foo.c, subr_foo.c or maybe in the new-name-ng should = actually be called kernel_subr_foo.c, but whatever you name something, = they will make you change it, because you are wrong. >=20 > Anyhow, that is my opinion on heavy handed reviews in a large project. >=20 > I've been fortunate enough to work on one project where luckily it was = dominated by rubber stampers, that was silly but awesome because at = least we could get stuff done... >=20 > Unfortunately I then worked on quite a few dominated by a mix of all = the four I mentioned. The result sucked. >=20 > -Alfred >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 07:53:19 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 5E109827; Thu, 29 Nov 2012 07:53:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1379B8FC08; Thu, 29 Nov 2012 07:53:19 +0000 (UTC) Received: from [192.168.2.119] (host86-146-118-26.range86-146.btcentralplus.com [86.146.118.26]) by cyrus.watson.org (Postfix) with ESMTPSA id 7E40F46B09; Thu, 29 Nov 2012 02:53:17 -0500 (EST) Subject: Re: Reviewing before commit and stability minibikeshed (Re: svn commit: r243627 - head/sys/kern) Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20121129070234.9C68458094@chaos.jnpr.net> Date: Thu, 29 Nov 2012 07:53:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <49B76E37-D3AB-4FCE-85F4-34A7864117D8@FreeBSD.org> References: <201211272004.qARK4qS8047209@svn.freebsd.org> <50B54180.5020608@freebsd.org> <50B54492.5040100@freebsd.org> <956CE44A-BA0F-4FE4-AA38-F4B90C85ECBA@FreeBSD.org> <50B54CE0.6080008@freebsd.org> <2A12C740-1D72-4D30-B663-47A37AAC2FF3@FreeBSD.org> <50B5C4F1.1020002@freebsd.org> <50B64C43.50001@mu.org> <50B6E1DD.2030908@mu.org> <20121129070234.9C68458094@chaos.jnpr.net> To: Simon J. Gerraty X-Mailer: Apple Mail (2.1283) Cc: "src-committers@freebsd.org" , Andre Oppermann , Peter Wemm , Garrett Cooper , "svn-src-all@freebsd.org" , Alfred Perlstein , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:53:19 -0000 On 29 Nov 2012, at 07:02, Simon J. Gerraty wrote: > On Wed, 28 Nov 2012 20:17:33 -0800, Alfred Perlstein writes: >> I've seen what happens with large groups, it doesn't scale and = basically=20 >> you wind up with the following type of reviewers: >=20 > The issues you cite, are the result of taking a good idea too far. > Mandating reviews for all changes - does not make sense, and all the > ills you describe are natural consequences. >=20 > But AFAIK that wasn't what Robert was talking about. >=20 > Some bits of code do warrant extra care when touching. > Unless you are the sole author and maintainer (and sometimes even = then) > getting a 2nd opinion (from someone familiar with the code) makes = sense. >=20 > That does not have to map to a requirement for formal reviewers, = review > tracking etc - none of which would scale in a volunteer organization > anyway. Yes, exactly so. Perhaps I took too much for granted in my original = e-mail, and too much focus was placed on the original commit that = triggered the larger thread, so I should be more explicit: - I have in mind developers increasing their practice of seeking code = review when touching critical and extremely sensitive subsystems in the = network stack -- e.g., socket buffers, inter-layer locking, TCP = structure, etc, rather than an edge-case device drivers. - When I say "mandatory", what I mean is a mutual consensus that = everyone involved in that area thinks that review is an important part = of working on it, and seeks review as part of their development process. - That this obviously applies to non-trivial changes rather than every = tweak to a comment. - That it be done sensibly and with good intentions by people who = understand the code. - That it occur in a culture of mutual review: if we have four active = developers in the socket code, then they all agree to participate in = both sides of the process. E.g., I suggest code review to Andre and = agree to do some, but in return, he reviews some of my changes. An = imbalance in code production and review leads to dissatisfaction for = everyone, and is not sustainable. Looking back through svn log on netinet over the last thousand changes, = excluding the last month and a half, SCTP, and mechanical/cosmetic = changes, we can see that roughly half of changes are "reviewed by" or = "discussed with", and there are patterns of mutual review, especially = for major changes. I suspect more were reviewed but that it wasn't = specifically tagged in commit messages. That doesn't mean errors don't = creep in, changes don't have to be backed out, etc, but it has = significant benefits. Robert= From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 08:06:24 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 0D254B01; Thu, 29 Nov 2012 08:06:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E27C48FC08; Thu, 29 Nov 2012 08:06:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAT86Nwb022285; Thu, 29 Nov 2012 08:06:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAT86NxD022284; Thu, 29 Nov 2012 08:06:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211290806.qAT86NxD022284@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 29 Nov 2012 08:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243669 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 08:06:24 -0000 Author: pjd Date: Thu Nov 29 08:06:23 2012 New Revision: 243669 URL: http://svnweb.freebsd.org/changeset/base/243669 Log: - Use more appropriate loop (do { } while()) when generating ethernet address for bridge interface. - If we found a collision we can break the loop - only one collision is possible and one is exactly enough to need to renegerate. Obtained from: WHEEL Systems MFC after: 1 week Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Nov 29 07:30:42 2012 (r243668) +++ head/sys/net/if_bridge.c Thu Nov 29 08:06:23 2012 (r243669) @@ -615,7 +615,7 @@ bridge_clone_create(struct if_clone *ifc */ fb = 0; getcredhostid(curthread->td_ucred, &hostid); - for (retry = 1; retry != 0;) { + do { if (fb || hostid == 0) { arc4rand(sc->sc_defaddr, ETHER_ADDR_LEN, 1); sc->sc_defaddr[0] &= ~1;/* clear multicast bit */ @@ -635,11 +635,13 @@ bridge_clone_create(struct if_clone *ifc LIST_FOREACH(sc2, &bridge_list, sc_list) { bifp = sc2->sc_ifp; if (memcmp(sc->sc_defaddr, - IF_LLADDR(bifp), ETHER_ADDR_LEN) == 0) + IF_LLADDR(bifp), ETHER_ADDR_LEN) == 0) { retry = 1; + break; + } } mtx_unlock(&bridge_list_mtx); - } + } while (retry == 1); bstp_attach(&sc->sc_stp, &bridge_ops); ether_ifattach(ifp, sc->sc_defaddr); From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 08:50:55 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 19D814DB; Thu, 29 Nov 2012 08:50:55 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 9F5D88FC14; Thu, 29 Nov 2012 08:50:54 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 02CE989E; Thu, 29 Nov 2012 09:48:55 +0100 (CET) Date: Thu, 29 Nov 2012 09:52:08 +0100 From: Pawel Jakub Dawidek To: Andre Oppermann Subject: Re: svn commit: r241726 - head/sys/kern Message-ID: <20121129085208.GA1370@garage.freebsd.pl> References: <201210191015.q9JAFWm5060261@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <201210191015.q9JAFWm5060261@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 08:50:55 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 19, 2012 at 10:15:32AM +0000, Andre Oppermann wrote: > Author: andre > Date: Fri Oct 19 10:15:32 2012 > New Revision: 241726 > URL: http://svn.freebsd.org/changeset/base/241726 >=20 > Log: > Move UMA socket zone initialization from uipc_domain.c to uipc_socket.c > into one place next to its other related functions to avoid confusion. I think you can remove include of vm/uma.h from uipc_domain.c now. > Modified: > head/sys/kern/uipc_domain.c > head/sys/kern/uipc_socket.c >=20 > Modified: head/sys/kern/uipc_domain.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/uipc_domain.c Fri Oct 19 10:07:55 2012 (r241725) > +++ head/sys/kern/uipc_domain.c Fri Oct 19 10:15:32 2012 (r241726) > @@ -239,28 +239,11 @@ domain_add(void *data) > mtx_unlock(&dom_mtx); > } > =20 > -static void > -socket_zone_change(void *tag) > -{ > - > - uma_zone_set_max(socket_zone, maxsockets); > -} > - > /* ARGSUSED*/ > static void > domaininit(void *dummy) > { > =20 > - /* > - * Before we do any setup, make sure to initialize the > - * zone allocator we get struct sockets from. > - */ > - socket_zone =3D uma_zcreate("socket", sizeof(struct socket), NULL, NULL, > - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); > - uma_zone_set_max(socket_zone, maxsockets); > - EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL, > - EVENTHANDLER_PRI_FIRST); > - > if (max_linkhdr < 16) /* XXX */ > max_linkhdr =3D 16; > =20 >=20 > Modified: head/sys/kern/uipc_socket.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/uipc_socket.c Fri Oct 19 10:07:55 2012 (r241725) > +++ head/sys/kern/uipc_socket.c Fri Oct 19 10:15:32 2012 (r241726) > @@ -227,6 +227,29 @@ MTX_SYSINIT(so_global_mtx, &so_global_mt > SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC"); > =20 > /* > + * Initialize the socket subsystem and set up the socket > + * memory allocator. > + */ > +static void > +socket_zone_change(void *tag) > +{ > + > + uma_zone_set_max(socket_zone, maxsockets); > +} > + > +static void > +socket_init(void *tag) > +{ > + > + socket_zone =3D uma_zcreate("socket", sizeof(struct socket), NUL= L, NULL, > + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); > + uma_zone_set_max(socket_zone, maxsockets); > + EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NUL= L, > + EVENTHANDLER_PRI_FIRST); > +} > +SYSINIT(socket, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, socket_init, NULL= ); > + > +/* > * Sysctl to get and set the maximum global sockets limit. Notify proto= cols > * of the change so that they can update their dependent limits as requi= red. > */ --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC3IjcACgkQForvXbEpPzTMXQCg0ZuntUfMPwvrM5HOHUtQwC0Z /5cAoNO6sxzK+qE7fy3mjTuvfxSaivrN =DdPA -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 09:11:10 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 25DCB9BF; Thu, 29 Nov 2012 09:11:10 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id D784A8FC0C; Thu, 29 Nov 2012 09:11:09 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 12E218AA; Thu, 29 Nov 2012 10:09:18 +0100 (CET) Date: Thu, 29 Nov 2012 10:12:30 +0100 From: Pawel Jakub Dawidek To: Andre Oppermann Subject: Re: svn commit: r241726 - head/sys/kern Message-ID: <20121129091230.GC1370@garage.freebsd.pl> References: <201210191015.q9JAFWm5060261@svn.freebsd.org> <20121129085208.GA1370@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xesSdrSSBC0PokLI" Content-Disposition: inline In-Reply-To: <20121129085208.GA1370@garage.freebsd.pl> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 09:11:10 -0000 --xesSdrSSBC0PokLI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 09:52:08AM +0100, Pawel Jakub Dawidek wrote: > On Fri, Oct 19, 2012 at 10:15:32AM +0000, Andre Oppermann wrote: > > Author: andre > > Date: Fri Oct 19 10:15:32 2012 > > New Revision: 241726 > > URL: http://svn.freebsd.org/changeset/base/241726 > >=20 > > Log: > > Move UMA socket zone initialization from uipc_domain.c to uipc_socket= =2Ec > > into one place next to its other related functions to avoid confusion. >=20 > I think you can remove include of vm/uma.h from uipc_domain.c now. Also, you changed tabs to spaces while moving it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --xesSdrSSBC0PokLI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC3Jv4ACgkQForvXbEpPzSepQCgvs430GhE7b0FXs9K0ha+nr0G R50Ani0sU6BzaEFUunx5hAiJOul9xtwt =SAdo -----END PGP SIGNATURE----- --xesSdrSSBC0PokLI-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 12:01:59 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 2C2D55A7; Thu, 29 Nov 2012 12:01:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8877D8FC0C; Thu, 29 Nov 2012 12:01:58 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qATC1l5G057758; Thu, 29 Nov 2012 14:01:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qATC1l5G057758 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qATC1lDN057757; Thu, 29 Nov 2012 14:01:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2012 14:01:47 +0200 From: Konstantin Belousov To: Eitan Adler Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129120147.GE3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qCuyVVLLFvr0p6ls" Content-Disposition: inline In-Reply-To: <201211290516.qAT5GoT5098709@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 12:01:59 -0000 --qCuyVVLLFvr0p6ls Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: > Author: eadler > Date: Thu Nov 29 05:16:50 2012 > New Revision: 243665 > URL: http://svnweb.freebsd.org/changeset/base/243665 >=20 > Log: > Mark non-returning function as such > =20 > PR: bin/172978 > Approved by: cperciva > MFC after: 3 days >=20 > Modified: > head/sbin/dump/dump.h >=20 > Modified: head/sbin/dump/dump.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) > +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) > @@ -121,7 +121,7 @@ void trewind(void); > void writerec(char *dp, int isspcl); > =20 > void Exit(int status) __dead2; > -void dumpabort(int signo); > +void dumpabort(int signo) __dead2; > void dump_getfstab(void); > =20 > char *rawname(char *cp); What is the goal of this change ? It is arguably backward. There is absolutely no use to mark signal handler as __dead2, and all other uses do not benefit from the redundand declaratio= n. Also, being quite removed from the function definition, there is a chance that some future modification would make the attribute a lie. --qCuyVVLLFvr0p6ls Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC3TqsACgkQC3+MBN1Mb4gUFACgpYhL1B/3guz8Tlgck1sj4wGn 2ugAoMqd9AWWaF+qby3HusN/pzOGnr3d =kUCf -----END PGP SIGNATURE----- --qCuyVVLLFvr0p6ls-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 12:45:45 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 5B0773B1 for ; Thu, 29 Nov 2012 12:45:45 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C2FE18FC13 for ; Thu, 29 Nov 2012 12:45:44 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so11606904lbb.13 for ; Thu, 29 Nov 2012 04:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=V7u83gyxNED4BE1u60bhHeogAN6F8OWS/EO/cjYTAzA=; b=jKdrnAZpb97+bpIypsn+Kff6SAO7zSO+4GJ5y0F5+Fe5stpC3PXMKN2kppnEdx3pJY aKpr3Xhqqsy3iaJgNOb+ilHaBbL0tF5qBjogWsoHY+LG9ZjHcx7USYmp5XSLEAP1EpWG 0QkAhcLEt3mezqi9idDAQ1YSUIsf9FBFJNK60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=V7u83gyxNED4BE1u60bhHeogAN6F8OWS/EO/cjYTAzA=; b=ar+nCHSFX//46/XxUnI6AzMt9NQgIFFQEOnwP9RGGm6qE3c0zEfx+H8b1N2YJObR03 RTrywik47ffFEPJSiIPj+l3cFdk2WnthA5q4MdiairFFrceboY7LQ2SZpFoZBDo4wmFH mNQxZHFbpNuJdWvZ11HzUurMhBe5GQo9g98Ld6xl4NSKpsl7p11VDSoo0MWXwQbcKKxE MFu1hk956ERVdu7Wm0Ah81wl/D7G/RFuIvcoqmW2DbZFK92mqnfy1hZyfBmS2HoAll5j Vm1IniPAcNfnTSmJ80qrimQcCWnBvM0LvVEma4gEAUIpzwtF8hsVVsk6JS7vp6RJmmyU pkVw== Received: by 10.152.105.33 with SMTP id gj1mr21566731lab.49.1354193143111; Thu, 29 Nov 2012 04:45:43 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Thu, 29 Nov 2012 04:45:12 -0800 (PST) In-Reply-To: <20121129120147.GE3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> From: Eitan Adler Date: Thu, 29 Nov 2012 07:45:12 -0500 X-Google-Sender-Auth: iGMQ3Ff5eAbQZkdUkdlyLrkfo0w Message-ID: Subject: Re: svn commit: r243665 - head/sbin/dump To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmrJRwo1wTpR7RlgzYpihX1LQ4+Ye/u+h/t/zSbfG1EcEFl0J+1pIxibFLUrpChatDJ2rNJ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 12:45:45 -0000 On 29 November 2012 07:01, Konstantin Belousov wrote: > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Thu Nov 29 05:16:50 2012 >> New Revision: 243665 >> URL: http://svnweb.freebsd.org/changeset/base/243665 >> >> Log: >> Mark non-returning function as such >> >> PR: bin/172978 >> Approved by: cperciva >> MFC after: 3 days >> >> Modified: >> head/sbin/dump/dump.h >> >> Modified: head/sbin/dump/dump.h >> ============================================================================== >> --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) >> +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) >> @@ -121,7 +121,7 @@ void trewind(void); >> void writerec(char *dp, int isspcl); >> >> void Exit(int status) __dead2; >> -void dumpabort(int signo); >> +void dumpabort(int signo) __dead2; >> void dump_getfstab(void); >> >> char *rawname(char *cp); > What is the goal of this change ? It fixes some static analyzer warnings. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 12:51:11 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 3A96D87D; Thu, 29 Nov 2012 12:51:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2094A8FC16; Thu, 29 Nov 2012 12:51:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATCpBL1078278; Thu, 29 Nov 2012 12:51:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATCpA7w078277; Thu, 29 Nov 2012 12:51:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211291251.qATCpA7w078277@svn.freebsd.org> From: Eitan Adler Date: Thu, 29 Nov 2012 12:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243670 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 12:51:11 -0000 Author: eadler Date: Thu Nov 29 12:51:10 2012 New Revision: 243670 URL: http://svnweb.freebsd.org/changeset/base/243670 Log: Generalize make.conf man page: use "cc" instead of "gcc" PR: misc/173604 Submitted by: Dan McGregor Approved by: bcr (mentor) MFC after: 3 days Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Thu Nov 29 08:06:23 2012 (r243669) +++ head/share/man/man5/make.conf.5 Thu Nov 29 12:51:10 2012 (r243670) @@ -143,7 +143,7 @@ and are not supported. .Va BDECFLAGS is provided as a set of -.Xr gcc 1 +.Xr cc 1 settings suggested by .An "Bruce Evans" Aq bde@FreeBSD.org for developing and testing changes. @@ -162,7 +162,7 @@ the value of and .Va COPTFLAGS to contain the appropriate optimization directive to -.Xr gcc 1 . +.Xr cc 1 . The automatic setting of .Va CFLAGS and @@ -693,7 +693,7 @@ The default number is 20011. .Pq Vt int Causes the system compiler to be built such that it forces high optimization levels to a lower one. -.Xr gcc 1 +.Xr cc 1 .Fl O2 and above is known to trigger known optimizer bugs at various times. @@ -735,7 +735,7 @@ filter, or both. .It Pa /usr/src/Makefile.inc1 .El .Sh SEE ALSO -.Xr gcc 1 , +.Xr cc 1 , .Xr install 1 , .Xr make 1 , .Xr src.conf 5 , From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 13:04: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 420CEC66; Thu, 29 Nov 2012 13:04:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id C36F38FC08; Thu, 29 Nov 2012 13:04:56 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qATD4n66063652; Thu, 29 Nov 2012 15:04:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qATD4n66063652 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qATD4n4G063651; Thu, 29 Nov 2012 15:04:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2012 15:04:49 +0200 From: Konstantin Belousov To: Eitan Adler Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129130449.GH3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7e8BFhNxqpjiNKz7" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 13:04:57 -0000 --7e8BFhNxqpjiNKz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 07:45:12AM -0500, Eitan Adler wrote: > On 29 November 2012 07:01, Konstantin Belousov wrot= e: > > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: > >> Author: eadler > >> Date: Thu Nov 29 05:16:50 2012 > >> New Revision: 243665 > >> URL: http://svnweb.freebsd.org/changeset/base/243665 > >> > >> Log: > >> Mark non-returning function as such > >> > >> PR: bin/172978 > >> Approved by: cperciva > >> MFC after: 3 days > >> > >> Modified: > >> head/sbin/dump/dump.h > >> > >> Modified: head/sbin/dump/dump.h > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) > >> +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) > >> @@ -121,7 +121,7 @@ void trewind(void); > >> void writerec(char *dp, int isspcl); > >> > >> void Exit(int status) __dead2; > >> -void dumpabort(int signo); > >> +void dumpabort(int signo) __dead2; > >> void dump_getfstab(void); > >> > >> char *rawname(char *cp); > > What is the goal of this change ? >=20 > It fixes some static analyzer warnings. This cannot be a reason to cripple the code. --7e8BFhNxqpjiNKz7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQt11vAAoJEJDCuSvBvK1BOtoP+wUojm+INQ2WCWJIJicFBe6h lRw+a1cJw38Ww/4dAjytL1cQe7vdG9YgJf3MK3+n7ZVDjBRa+TtyZpsR97A6nI8B XHB+Ozl/qGagebrguoOoCy+IYcR04R6E/wC+Q2mxhko7HPzoXZQSUFh+hpkj0BFl xysz4IBHjfXL1kh8r2TPeuSBcd6MQN/xWjmPZZFPIsHcwRAgsTQb+h0a9LrrUfp5 C/3CZPopsuICbwMuLgWiPcliudU0/fdivzoL6snUEzg0EV0g+32w0rPfUU2Jsfin VjEinuYT7M6NZsNv2Scl+xLxaOSQpNKcnz0hWBMFARuLgTVBHt3fBpa6CqKiL2Yy TWUAGdTu9YwbjdjsCJ3eLEe+6n5TijbepK5OvQGYqNRZz3/se0C5cRpYF6318TFD 3o1kXK/eu+aJ93SaJkIbkZmbX6TNXMJRyDpQ+Ik2g0pt4NKOmKcWt9uOySlRTbVx UN8BHU9DxhJz4lR6z/YwlBN4Uu4mmmMF2QsRLcJ7wV4b4qbo6zhd8XFEkNcHESVj JTZlq9ktXAKUd4DnWBiQuZmSn4UbKAWW3f1pjHyDBAcWnoM/y3FnaxgpqoIBStE4 VCF0PfuUoMeOcCZEJohsfsM5BgApq62OOmseisOSzgBWVTeGzvLNvdgMEYe9xdZF elq7gjruUC2jMGPzcOTA =aaDE -----END PGP SIGNATURE----- --7e8BFhNxqpjiNKz7-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 13:28: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 69AE9402; Thu, 29 Nov 2012 13:28:57 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48D6C8FC13; Thu, 29 Nov 2012 13:28:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATDSvK3085025; Thu, 29 Nov 2012 13:28:57 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATDSvRN085018; Thu, 29 Nov 2012 13:28:57 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201211291328.qATDSvRN085018@svn.freebsd.org> From: David Chisnall Date: Thu, 29 Nov 2012 13:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243671 - vendor/libc++/dist/include X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 13:28:57 -0000 Author: theraven Date: Thu Nov 29 13:28:56 2012 New Revision: 243671 URL: http://svnweb.freebsd.org/changeset/base/243671 Log: Import new libc++. This contains some fixes for code compiled in c++98 / c++03 mode. Modified: vendor/libc++/dist/include/__config vendor/libc++/dist/include/cstdlib vendor/libc++/dist/include/cwchar vendor/libc++/dist/include/exception vendor/libc++/dist/include/iterator vendor/libc++/dist/include/locale Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Thu Nov 29 12:51:10 2012 (r243670) +++ vendor/libc++/dist/include/__config Thu Nov 29 13:28:56 2012 (r243671) @@ -51,6 +51,9 @@ # define _LIBCPP_LITTLE_ENDIAN 0 # define _LIBCPP_BIG_ENDIAN 1 # endif // _BYTE_ORDER == _LITTLE_ENDIAN +# ifndef __LONG_LONG_SUPPORTED +# define _LIBCPP_HAS_NO_LONG_LONG +# endif // __LONG_LONG_SUPPORTED #endif // __FreeBSD__ #ifdef _WIN32 Modified: vendor/libc++/dist/include/cstdlib ============================================================================== --- vendor/libc++/dist/include/cstdlib Thu Nov 29 12:51:10 2012 (r243670) +++ vendor/libc++/dist/include/cstdlib Thu Nov 29 13:28:56 2012 (r243671) @@ -97,18 +97,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD using ::size_t; using ::div_t; using ::ldiv_t; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::lldiv_t; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::atof; using ::atoi; using ::atol; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::atoll; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::strtod; using ::strtof; using ::strtold; using ::strtol; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::strtoll; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::strtoul; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::strtoull; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::rand; using ::srand; using ::calloc; @@ -125,10 +133,14 @@ using ::bsearch; using ::qsort; using ::abs; using ::labs; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::llabs; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::div; using ::ldiv; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::lldiv; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::mblen; using ::mbtowc; using ::wctomb; @@ -145,10 +157,14 @@ using ::aligned_alloc; // MSVC already has the correct prototype in #ifdef __cplusplus #if !defined(_MSC_VER) && !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} +#ifndef _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} +#endif // _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} +#ifndef _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} +#endif // _LIBCPP_HAS_NO_LONG_LONG #endif // _MSC_VER _LIBCPP_END_NAMESPACE_STD Modified: vendor/libc++/dist/include/cwchar ============================================================================== --- vendor/libc++/dist/include/cwchar Thu Nov 29 12:51:10 2012 (r243670) +++ vendor/libc++/dist/include/cwchar Thu Nov 29 13:28:56 2012 (r243671) @@ -151,9 +151,13 @@ using ::wcstof; using ::wcstold; #endif // _MSC_VER using ::wcstol; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::wcstoll; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::wcstoul; +#ifndef _LIBCPP_HAS_NO_LONG_LONG using ::wcstoull; +#endif // _LIBCPP_HAS_NO_LONG_LONG using ::wcscpy; using ::wcsncpy; using ::wcscat; Modified: vendor/libc++/dist/include/exception ============================================================================== --- vendor/libc++/dist/include/exception Thu Nov 29 12:51:10 2012 (r243670) +++ vendor/libc++/dist/include/exception Thu Nov 29 13:28:56 2012 (r243671) @@ -143,7 +143,7 @@ public: {return !(__x == __y);} friend exception_ptr current_exception() _NOEXCEPT; - _LIBCPP_NORETURN friend void rethrow_exception(exception_ptr); + friend void rethrow_exception(exception_ptr); }; template Modified: vendor/libc++/dist/include/iterator ============================================================================== --- vendor/libc++/dist/include/iterator Thu Nov 29 12:51:10 2012 (r243670) +++ vendor/libc++/dist/include/iterator Thu Nov 29 13:28:56 2012 (r243671) @@ -317,6 +317,10 @@ template T* end(T (& #include #include #include +#if __APPLE__ +#include +#endif + #ifdef _LIBCPP_DEBUG #include #endif @@ -795,7 +799,7 @@ public: typedef basic_streambuf<_CharT,_Traits> streambuf_type; typedef basic_istream<_CharT,_Traits> istream_type; private: - streambuf_type* __sbuf_; + mutable streambuf_type* __sbuf_; class __proxy { @@ -809,13 +813,14 @@ private: }; _LIBCPP_INLINE_VISIBILITY - void __test_for_eof() + bool __test_for_eof() const { if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof())) __sbuf_ = 0; + return __sbuf_ == 0; } public: - _LIBCPP_INLINE_VISIBILITY istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT : __sbuf_(__s.rdbuf()) {__test_for_eof();} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT @@ -828,19 +833,16 @@ public: _LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++() { - if (traits_type::eq_int_type(__sbuf_->snextc(), traits_type::eof())) - __sbuf_ = 0; + __sbuf_->sbumpc(); return *this; } _LIBCPP_INLINE_VISIBILITY __proxy operator++(int) { - char_type __c = __sbuf_->sgetc(); - ++(*this); - return __proxy(__c, __sbuf_); + return __proxy(__sbuf_->sbumpc(), __sbuf_); } _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const - {return (__sbuf_ == 0) == (__b.__sbuf_ == 0);} + {return __test_for_eof() == __b.__test_for_eof();} }; template @@ -882,6 +884,10 @@ public: _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;} _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;} +#if !defined(__APPLE__) || \ + (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \ + (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0) + template friend _LIBCPP_HIDDEN @@ -889,6 +895,7 @@ public: __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s, const _Ch* __ob, const _Ch* __op, const _Ch* __oe, ios_base& __iob, _Ch __fl); +#endif }; template Modified: vendor/libc++/dist/include/locale ============================================================================== --- vendor/libc++/dist/include/locale Thu Nov 29 12:51:10 2012 (r243670) +++ vendor/libc++/dist/include/locale Thu Nov 29 13:28:56 2012 (r243671) @@ -192,6 +192,10 @@ template class messages_by #include #endif // !_WIN32 +#if __APPLE__ +#include +#endif + #include <__undef_min_max> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -1587,6 +1591,10 @@ __pad_and_output(_OutputIterator __s, return __s; } +#if !defined(__APPLE__) || \ + (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \ + (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0) + template _LIBCPP_HIDDEN ostreambuf_iterator<_CharT, _Traits> @@ -1633,6 +1641,8 @@ __pad_and_output(ostreambuf_iterator<_Ch return __s; } +#endif + template _OutputIterator num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 13:29:59 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 4789456A; Thu, 29 Nov 2012 13:29:59 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 287028FC08; Thu, 29 Nov 2012 13:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATDTxN0085225; Thu, 29 Nov 2012 13:29:59 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATDTxON085221; Thu, 29 Nov 2012 13:29:59 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201211291329.qATDTxON085221@svn.freebsd.org> From: David Chisnall Date: Thu, 29 Nov 2012 13:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243672 - in vendor/libc++/r168853: . include include/ext src X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 13:29:59 -0000 Author: theraven Date: Thu Nov 29 13:29:58 2012 New Revision: 243672 URL: http://svnweb.freebsd.org/changeset/base/243672 Log: Tagged libc++ import. Added: vendor/libc++/r168853/ - copied from r242938, vendor/libc++/dist/ Replaced: vendor/libc++/r168853/include/__config - copied unchanged from r243671, vendor/libc++/dist/include/__config vendor/libc++/r168853/include/__functional_base - copied unchanged from r242939, vendor/libc++/dist/include/__functional_base vendor/libc++/r168853/include/__functional_base_03 - copied unchanged from r242939, vendor/libc++/dist/include/__functional_base_03 vendor/libc++/r168853/include/__locale - copied unchanged from r242939, vendor/libc++/dist/include/__locale vendor/libc++/r168853/include/__mutex_base - copied unchanged from r242939, vendor/libc++/dist/include/__mutex_base vendor/libc++/r168853/include/algorithm - copied unchanged from r242939, vendor/libc++/dist/include/algorithm vendor/libc++/r168853/include/cmath - copied unchanged from r242939, vendor/libc++/dist/include/cmath vendor/libc++/r168853/include/complex - copied unchanged from r242939, vendor/libc++/dist/include/complex vendor/libc++/r168853/include/condition_variable - copied unchanged from r242939, vendor/libc++/dist/include/condition_variable vendor/libc++/r168853/include/cstddef - copied unchanged from r242939, vendor/libc++/dist/include/cstddef vendor/libc++/r168853/include/cstdlib - copied unchanged from r243671, vendor/libc++/dist/include/cstdlib vendor/libc++/r168853/include/cwchar - copied unchanged from r243671, vendor/libc++/dist/include/cwchar vendor/libc++/r168853/include/exception - copied unchanged from r243671, vendor/libc++/dist/include/exception vendor/libc++/r168853/include/ext/__hash - copied unchanged from r242939, vendor/libc++/dist/include/ext/__hash vendor/libc++/r168853/include/future - copied unchanged from r242939, vendor/libc++/dist/include/future vendor/libc++/r168853/include/ios - copied unchanged from r242939, vendor/libc++/dist/include/ios vendor/libc++/r168853/include/istream - copied unchanged from r242939, vendor/libc++/dist/include/istream vendor/libc++/r168853/include/iterator - copied unchanged from r243671, vendor/libc++/dist/include/iterator vendor/libc++/r168853/include/locale - copied unchanged from r243671, vendor/libc++/dist/include/locale vendor/libc++/r168853/include/memory - copied unchanged from r242939, vendor/libc++/dist/include/memory vendor/libc++/r168853/include/ostream - copied unchanged from r242939, vendor/libc++/dist/include/ostream vendor/libc++/r168853/include/random - copied unchanged from r242939, vendor/libc++/dist/include/random vendor/libc++/r168853/include/streambuf - copied unchanged from r242939, vendor/libc++/dist/include/streambuf vendor/libc++/r168853/include/string - copied unchanged from r242939, vendor/libc++/dist/include/string vendor/libc++/r168853/include/system_error - copied unchanged from r242939, vendor/libc++/dist/include/system_error vendor/libc++/r168853/include/tuple - copied unchanged from r242939, vendor/libc++/dist/include/tuple vendor/libc++/r168853/include/type_traits - copied unchanged from r242939, vendor/libc++/dist/include/type_traits vendor/libc++/r168853/include/utility - copied unchanged from r242939, vendor/libc++/dist/include/utility vendor/libc++/r168853/include/valarray - copied unchanged from r242939, vendor/libc++/dist/include/valarray vendor/libc++/r168853/include/vector - copied unchanged from r242939, vendor/libc++/dist/include/vector vendor/libc++/r168853/src/memory.cpp - copied unchanged from r242939, vendor/libc++/dist/src/memory.cpp Copied: vendor/libc++/r168853/include/__config (from r243671, vendor/libc++/dist/include/__config) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/r168853/include/__config Thu Nov 29 13:29:58 2012 (r243672, copy of r243671, vendor/libc++/dist/include/__config) @@ -0,0 +1,468 @@ +// -*- C++ -*- +//===--------------------------- __config ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_CONFIG +#define _LIBCPP_CONFIG + +#if !_MSC_VER // explicit macro necessary because it is only defined below in this file +#pragma GCC system_header +#endif + +#ifdef __GNUC__ +#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) +#endif + +#define _LIBCPP_VERSION 1101 + +#define _LIBCPP_ABI_VERSION 1 + +#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y +#define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) + +#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION) + +#ifdef __LITTLE_ENDIAN__ +#if __LITTLE_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 1 +#define _LIBCPP_BIG_ENDIAN 0 +#endif // __LITTLE_ENDIAN__ +#endif // __LITTLE_ENDIAN__ + +#ifdef __BIG_ENDIAN__ +#if __BIG_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 0 +#define _LIBCPP_BIG_ENDIAN 1 +#endif // __BIG_ENDIAN__ +#endif // __BIG_ENDIAN__ + +#ifdef __FreeBSD__ +# include +# if _BYTE_ORDER == _LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN 0 +# else // _BYTE_ORDER == _LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN 0 +# define _LIBCPP_BIG_ENDIAN 1 +# endif // _BYTE_ORDER == _LITTLE_ENDIAN +# ifndef __LONG_LONG_SUPPORTED +# define _LIBCPP_HAS_NO_LONG_LONG +# endif // __LONG_LONG_SUPPORTED +#endif // __FreeBSD__ + +#ifdef _WIN32 +# define _LIBCPP_LITTLE_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN 0 +// Compiler intrinsics (GCC or MSVC) +# if (defined(_MSC_VER) && _MSC_VER >= 1400) \ + || (defined(__GNUC__) && _GNUC_VER > 403) +# define _LIBCP_HAS_IS_BASE_OF +# endif +#endif // _WIN32 + +#ifdef __sun__ +# include +# ifdef _LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN 0 +# else +# define _LIBCPP_LITTLE_ENDIAN 0 +# define _LIBCPP_BIG_ENDIAN 1 +# endif +#endif // __sun__ + +#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) +# include +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN 0 +# elif __BYTE_ORDER == __BIG_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN 0 +# define _LIBCPP_BIG_ENDIAN 1 +# else // __BYTE_ORDER == __BIG_ENDIAN +# error unable to determine endian +# endif +#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) + +#if _WIN32 + +// only really useful for a DLL +#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally... +# ifdef cxx_EXPORTS +# define _LIBCPP_HIDDEN +# define _LIBCPP_VISIBLE __declspec(dllexport) +# else +# define _LIBCPP_HIDDEN +# define _LIBCPP_VISIBLE __declspec(dllimport) +# endif +#else +# define _LIBCPP_HIDDEN +# define _LIBCPP_VISIBLE +#endif + +#ifndef _LIBCPP_INLINE_VISIBILITY +# if _MSC_VER +# define _LIBCPP_INLINE_VISIBILITY __forceinline +# else // MinGW GCC and Clang +# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) +# endif +#endif + +#ifndef _LIBCPP_EXCEPTION_ABI +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE +#endif + +#ifndef _LIBCPP_ALWAYS_INLINE +# if _MSC_VER +# define _LIBCPP_ALWAYS_INLINE __forceinline +# endif +#endif + +#endif // _WIN32 + +#ifndef _LIBCPP_HIDDEN +#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) +#endif + +#ifndef _LIBCPP_VISIBLE +#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default"))) +#endif + +#ifndef _LIBCPP_INLINE_VISIBILITY +#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) +#endif + +#ifndef _LIBCPP_EXCEPTION_ABI +#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) +#endif + +#ifndef _LIBCPP_CANTTHROW +#define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__)) +#endif + +#ifndef _LIBCPP_ALWAYS_INLINE +#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) +#endif + +#if defined(__clang__) + +#if __has_feature(cxx_alignas) +# define _ALIGNAS_TYPE(x) alignas(x) +# define _ALIGNAS(x) alignas(x) +#else +# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) +# define _ALIGNAS(x) __attribute__((__aligned__(x))) +#endif + +#if !__has_feature(cxx_alias_templates) +#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES +#endif + +#ifndef __GXX_EXPERIMENTAL_CXX0X__ +#ifdef __linux__ +#define _LIBCPP_HAS_NO_UNICODE_CHARS +#else +typedef __char16_t char16_t; +typedef __char32_t char32_t; +#endif +#endif + +#if !(__has_feature(cxx_exceptions)) +#define _LIBCPP_NO_EXCEPTIONS +#endif + +#if !(__has_feature(cxx_rtti)) +#define _LIBCPP_NO_RTTI +#endif + +#if !(__has_feature(cxx_strong_enums)) +#define _LIBCPP_HAS_NO_STRONG_ENUMS +#endif + +#if !(__has_feature(cxx_decltype)) +#define _LIBCPP_HAS_NO_DECLTYPE +#endif + +#if __has_feature(cxx_attributes) +# define _LIBCPP_NORETURN [[noreturn]] +#else +# define _LIBCPP_NORETURN __attribute__ ((noreturn)) +#endif + +#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS + +#if !(__has_feature(cxx_deleted_functions)) +#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#endif // !(__has_feature(cxx_deleted_functions)) + +#if !(__has_feature(cxx_lambdas)) +#define _LIBCPP_HAS_NO_LAMBDAS +#endif + +#if !(__has_feature(cxx_nullptr)) +#define _LIBCPP_HAS_NO_NULLPTR +#endif + +#if !(__has_feature(cxx_rvalue_references)) +#define _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif + +#if !(__has_feature(cxx_static_assert)) +#define _LIBCPP_HAS_NO_STATIC_ASSERT +#endif + +#if !(__has_feature(cxx_auto_type)) +#define _LIBCPP_HAS_NO_AUTO_TYPE +#endif + +#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return) +#define _LIBCPP_HAS_NO_ADVANCED_SFINAE +#endif + +#if !(__has_feature(cxx_variadic_templates)) +#define _LIBCPP_HAS_NO_VARIADICS +#endif + +#if !(__has_feature(cxx_trailing_return)) +#define _LIBCPP_HAS_NO_TRAILING_RETURN +#endif + +#if !(__has_feature(cxx_generalized_initializers)) +#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif + +#if __has_feature(is_base_of) +# define _LIBCP_HAS_IS_BASE_OF +#endif + +// Objective-C++ features (opt-in) +#if __has_feature(objc_arc) +#define _LIBCPP_HAS_OBJC_ARC +#endif + +#if __has_feature(objc_arc_weak) +#define _LIBCPP_HAS_OBJC_ARC_WEAK +#define _LIBCPP_HAS_NO_STRONG_ENUMS +#endif + +#if !(__has_feature(cxx_constexpr)) +#define _LIBCPP_HAS_NO_CONSTEXPR +#endif + +#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) +#define _LIBCPP_HAS_QUICK_EXIT +#define _LIBCPP_HAS_C11_FEATURES +#endif + +#if (__has_feature(cxx_noexcept)) +# define _NOEXCEPT noexcept +# define _NOEXCEPT_(x) noexcept(x) +#else +# define _NOEXCEPT throw() +# define _NOEXCEPT_(x) +#endif + +#if __has_feature(underlying_type) +# define _LIBCXX_UNDERLYING_TYPE(T) __underlying_type(T) +#endif + +// Inline namespaces are available in Clang regardless of C++ dialect. +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { +#define _LIBCPP_END_NAMESPACE_STD } } +#define _VSTD std::_LIBCPP_NAMESPACE + +namespace std { + inline namespace _LIBCPP_NAMESPACE { + } +} + +#elif defined(__GNUC__) + +#define _ALIGNAS(x) __attribute__((__aligned__(x))) +#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) + +#define _LIBCPP_NORETURN __attribute__((noreturn)) + +#if !__EXCEPTIONS +#define _LIBCPP_NO_EXCEPTIONS +#endif + +#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES +#define _LIBCPP_HAS_NO_CONSTEXPR + +#define _NOEXCEPT throw() +#define _NOEXCEPT_(x) + +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + +#define _LIBCPP_HAS_NO_ADVANCED_SFINAE +#define _LIBCPP_HAS_NO_DECLTYPE +#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS +#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#define _LIBCPP_HAS_NO_NULLPTR +#define _LIBCPP_HAS_NO_STATIC_ASSERT +#define _LIBCPP_HAS_NO_UNICODE_CHARS +#define _LIBCPP_HAS_NO_VARIADICS +#define _LIBCPP_HAS_NO_RVALUE_REFERENCES +#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS + +#else // __GXX_EXPERIMENTAL_CXX0X__ + +#define _LIBCPP_HAS_NO_TRAILING_RETURN +#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS + +#if _GNUC_VER < 403 +#define _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif + +#if _GNUC_VER < 403 +#define _LIBCPP_HAS_NO_STATIC_ASSERT +#endif + +#if _GNUC_VER < 404 +#define _LIBCPP_HAS_NO_ADVANCED_SFINAE +#define _LIBCPP_HAS_NO_DECLTYPE +#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS +#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#define _LIBCPP_HAS_NO_UNICODE_CHARS +#define _LIBCPP_HAS_NO_VARIADICS +#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _GNUC_VER < 404 + +#if _GNUC_VER < 406 +#define _LIBCPP_HAS_NO_NULLPTR +#endif + +#endif // __GXX_EXPERIMENTAL_CXX0X__ + +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE { +#define _LIBCPP_END_NAMESPACE_STD } } +#define _VSTD std::_LIBCPP_NAMESPACE + +namespace std { +namespace _LIBCPP_NAMESPACE { +} +using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); +} + +#elif defined(_MSC_VER) + +#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES +#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#define _LIBCPP_HAS_NO_CONSTEXPR +#define _LIBCPP_HAS_NO_UNICODE_CHARS +#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#define __alignof__ __alignof +#define _LIBCPP_NORETURN __declspec(noreturn) +#define _ALIGNAS(x) __declspec(align(x)) +#define _LIBCPP_HAS_NO_VARIADICS + +#define _NOEXCEPT throw() +#define _NOEXCEPT_(x) + +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { +#define _LIBCPP_END_NAMESPACE_STD } +#define _VSTD std + +namespace std { +} + +#endif // __clang__ || __GNUC___ || _MSC_VER + +#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS +typedef unsigned short char16_t; +typedef unsigned int char32_t; +#endif // _LIBCPP_HAS_NO_UNICODE_CHARS + +#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT + +template struct __static_assert_test; +template <> struct __static_assert_test {}; +template struct __static_assert_check {}; +#define static_assert(__b, __m) \ + typedef __static_assert_check)> \ + _LIBCPP_CONCAT(__t, __LINE__) + +#endif // _LIBCPP_HAS_NO_STATIC_ASSERT + +#ifdef _LIBCPP_HAS_NO_DECLTYPE +#define decltype(x) __typeof__(x) +#endif + +#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#define _LIBCPP_CONSTEXPR +#else +#define _LIBCPP_CONSTEXPR constexpr +#endif + +#ifdef __GNUC__ +#define _NOALIAS __attribute__((malloc)) +#else +#define _NOALIAS +#endif + +#ifndef __has_feature +#define __has_feature(__x) 0 +#endif + +#if __has_feature(cxx_explicit_conversions) +# define _LIBCPP_EXPLICIT explicit +#else +# define _LIBCPP_EXPLICIT +#endif + +#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS +#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx +#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ + __lx __v_; \ + _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ + _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ + _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ + }; +#else // _LIBCPP_HAS_NO_STRONG_ENUMS +#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x +#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) +#endif // _LIBCPP_HAS_NO_STRONG_ENUMS + +#ifndef _LIBCPP_EXTERN_TEMPLATE +#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; +#endif + +#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__ +#define _LIBCPP_LOCALE__L_EXTENSIONS 1 +#endif +#if __FreeBSD__ +#define _DECLARE_C99_LDBL_MATH 1 +#endif + +#if __APPLE__ || __FreeBSD__ +#define _LIBCPP_HAS_DEFAULTRUNELOCALE +#endif + +#if __APPLE__ || __FreeBSD__ || __sun__ +#define _LIBCPP_WCTYPE_IS_MASK +#endif + +#ifdef _LIBCPP_DEBUG2 +# if _LIBCPP_DEBUG2 == 0 +# define _LIBCPP_DEBUG_LEVEL 1 +# elif _LIBCPP_DEBUG2 == 1 +# define _LIBCPP_DEBUG_LEVEL 2 +# else +# error Supported values for _LIBCPP_DEBUG2 are 0 and 1 +# endif +#endif + +#ifdef _LIBCPP_DEBUG2 +# include <__debug> +#else +# define _LIBCPP_ASSERT(x, m) ((void)0) +#endif + +#endif // _LIBCPP_CONFIG Copied: vendor/libc++/r168853/include/__functional_base (from r242939, vendor/libc++/dist/include/__functional_base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/r168853/include/__functional_base Thu Nov 29 13:29:58 2012 (r243672, copy of r242939, vendor/libc++/dist/include/__functional_base) @@ -0,0 +1,437 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_FUNCTIONAL_BASE +#define _LIBCPP_FUNCTIONAL_BASE + +#include <__config> +#include +#include +#include + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _LIBCPP_VISIBLE unary_function +{ + typedef _Arg argument_type; + typedef _Result result_type; +}; + +template +struct _LIBCPP_VISIBLE binary_function +{ + typedef _Arg1 first_argument_type; + typedef _Arg2 second_argument_type; + typedef _Result result_type; +}; + +template struct _LIBCPP_VISIBLE hash; + +template +struct __has_result_type +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::result_type* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + +template +struct _LIBCPP_VISIBLE less : binary_function<_Tp, _Tp, bool> +{ + _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x < __y;} +}; + +#ifdef _LIBCPP_HAS_NO_VARIADICS + +#include <__functional_base_03> + +#else // _LIBCPP_HAS_NO_VARIADICS + +// __weak_result_type + +template +struct __derives_from_unary_function +{ +private: + struct __two {char __lx; char __lxx;}; + static __two __test(...); + template + static unary_function<_Ap, _Rp> + __test(const volatile unary_function<_Ap, _Rp>*); +public: + static const bool value = !is_same::value; + typedef decltype(__test((_Tp*)0)) type; +}; + +template +struct __derives_from_binary_function +{ +private: + struct __two {char __lx; char __lxx;}; + static __two __test(...); + template + static binary_function<_A1, _A2, _Rp> + __test(const volatile binary_function<_A1, _A2, _Rp>*); +public: + static const bool value = !is_same::value; + typedef decltype(__test((_Tp*)0)) type; +}; + +template ::value> +struct __maybe_derive_from_unary_function // bool is true + : public __derives_from_unary_function<_Tp>::type +{ +}; + +template +struct __maybe_derive_from_unary_function<_Tp, false> +{ +}; + +template ::value> +struct __maybe_derive_from_binary_function // bool is true + : public __derives_from_binary_function<_Tp>::type +{ +}; + +template +struct __maybe_derive_from_binary_function<_Tp, false> +{ +}; + +template ::value> +struct __weak_result_type_imp // bool is true + : public __maybe_derive_from_unary_function<_Tp>, + public __maybe_derive_from_binary_function<_Tp> +{ + typedef typename _Tp::result_type result_type; +}; + +template +struct __weak_result_type_imp<_Tp, false> + : public __maybe_derive_from_unary_function<_Tp>, + public __maybe_derive_from_binary_function<_Tp> +{ +}; + +template +struct __weak_result_type + : public __weak_result_type_imp<_Tp> +{ +}; + +// 0 argument case + +template +struct __weak_result_type<_Rp ()> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (&)()> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (*)()> +{ + typedef _Rp result_type; +}; + +// 1 argument case + +template +struct __weak_result_type<_Rp (_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (&)(_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (*)(_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)()> + : public unary_function<_Cp*, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)() const> + : public unary_function +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)() volatile> + : public unary_function +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)() const volatile> + : public unary_function +{ +}; + +// 2 argument case + +template +struct __weak_result_type<_Rp (_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (*)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (&)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1)> + : public binary_function<_Cp*, _A1, _Rp> +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1) const> + : public binary_function +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> + : public binary_function +{ +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> + : public binary_function +{ +}; + +// 3 or more arguments + +template +struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> +{ + typedef _Rp result_type; +}; + +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> +{ + typedef _Rp result_type; +}; + +// __invoke + +// bullets 1 and 2 + +template +inline _LIBCPP_INLINE_VISIBILITY +auto +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) + -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)) +{ + return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +auto +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) + -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)) +{ + return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...); +} + +// bullets 3 and 4 + +template +inline _LIBCPP_INLINE_VISIBILITY +auto +__invoke(_Fp&& __f, _A0&& __a0) + -> decltype(_VSTD::forward<_A0>(__a0).*__f) +{ + return _VSTD::forward<_A0>(__a0).*__f; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +auto +__invoke(_Fp&& __f, _A0&& __a0) + -> decltype((*_VSTD::forward<_A0>(__a0)).*__f) +{ + return (*_VSTD::forward<_A0>(__a0)).*__f; +} + +// bullet 5 + +template +inline _LIBCPP_INLINE_VISIBILITY +auto +__invoke(_Fp&& __f, _Args&& ...__args) + -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)) +{ + return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...); +} + +template +struct __invoke_return +{ + typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type; +}; + +template +class _LIBCPP_VISIBLE reference_wrapper + : public __weak_result_type<_Tp> +{ +public: + // types + typedef _Tp type; +private: + type* __f_; + +public: + // construct/copy/destroy + _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT : __f_(&__f) {} +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + private: reference_wrapper(type&&); public: // = delete; // do not bind to temps +#endif + + // access + _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;} + _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;} + + // invoke + template + _LIBCPP_INLINE_VISIBILITY + typename __invoke_of::type + operator() (_ArgTypes&&... __args) const + { + return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...); + } +}; + +template struct ____is_reference_wrapper : public false_type {}; +template struct ____is_reference_wrapper > : public true_type {}; +template struct __is_reference_wrapper + : public ____is_reference_wrapper::type> {}; + +template +inline _LIBCPP_INLINE_VISIBILITY +reference_wrapper<_Tp> +ref(_Tp& __t) _NOEXCEPT +{ + return reference_wrapper<_Tp>(__t); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +reference_wrapper<_Tp> +ref(reference_wrapper<_Tp> __t) _NOEXCEPT +{ + return ref(__t.get()); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +reference_wrapper +cref(const _Tp& __t) _NOEXCEPT +{ + return reference_wrapper(__t); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +reference_wrapper +cref(reference_wrapper<_Tp> __t) _NOEXCEPT +{ + return cref(__t.get()); +} + +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS + +template void ref(const _Tp&&) = delete; +template void cref(const _Tp&&) = delete; + +#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS + +template void ref(const _Tp&&);// = delete; +template void cref(const _Tp&&);// = delete; + +#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS + +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#endif // _LIBCPP_HAS_NO_VARIADICS + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_FUNCTIONAL_BASE Copied: vendor/libc++/r168853/include/__functional_base_03 (from r242939, vendor/libc++/dist/include/__functional_base_03) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/r168853/include/__functional_base_03 Thu Nov 29 13:29:58 2012 (r243672, copy of r242939, vendor/libc++/dist/include/__functional_base_03) @@ -0,0 +1,1087 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_FUNCTIONAL_BASE_03 +#define _LIBCPP_FUNCTIONAL_BASE_03 + +// manual variadic expansion for + +// __weak_result_type + +template +struct __derives_from_unary_function +{ +private: + struct __two {char __lx; char __lxx;}; + static __two __test(...); + template + static unary_function<_Ap, _Rp> + __test(const volatile unary_function<_Ap, _Rp>*); +public: + static const bool value = !is_same::value; + typedef decltype(__test((_Tp*)0)) type; +}; + +template +struct __derives_from_binary_function +{ +private: + struct __two {char __lx; char __lxx;}; + static __two __test(...); + template + static binary_function<_A1, _A2, _Rp> + __test(const volatile binary_function<_A1, _A2, _Rp>*); +public: + static const bool value = !is_same::value; + typedef decltype(__test((_Tp*)0)) type; +}; + +template ::value> +struct __maybe_derive_from_unary_function // bool is true + : public __derives_from_unary_function<_Tp>::type +{ +}; + +template +struct __maybe_derive_from_unary_function<_Tp, false> +{ +}; + +template ::value> +struct __maybe_derive_from_binary_function // bool is true + : public __derives_from_binary_function<_Tp>::type +{ +}; + +template +struct __maybe_derive_from_binary_function<_Tp, false> +{ +}; + +template ::value> +struct __weak_result_type_imp // bool is true + : public __maybe_derive_from_unary_function<_Tp>, + public __maybe_derive_from_binary_function<_Tp> +{ + typedef typename _Tp::result_type result_type; +}; + +template +struct __weak_result_type_imp<_Tp, false> + : public __maybe_derive_from_unary_function<_Tp>, + public __maybe_derive_from_binary_function<_Tp> +{ +}; + +template +struct __weak_result_type + : public __weak_result_type_imp::type> +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 13:35:45 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 243338DB; Thu, 29 Nov 2012 13:35:45 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F18438FC15; Thu, 29 Nov 2012 13:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATDZiHH086284; Thu, 29 Nov 2012 13:35:44 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATDZiLX086281; Thu, 29 Nov 2012 13:35:44 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201211291335.qATDZiLX086281@svn.freebsd.org> From: David Chisnall Date: Thu, 29 Nov 2012 13:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243673 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 13:35:45 -0000 Author: theraven Date: Thu Nov 29 13:35:44 2012 New Revision: 243673 URL: http://svnweb.freebsd.org/changeset/base/243673 Log: Merge new libc++ into head. Modified: head/contrib/libc++/include/exception head/contrib/libc++/include/iterator head/contrib/libc++/include/locale Directory Properties: head/contrib/libc++/ (props changed) Modified: head/contrib/libc++/include/exception ============================================================================== --- head/contrib/libc++/include/exception Thu Nov 29 13:29:58 2012 (r243672) +++ head/contrib/libc++/include/exception Thu Nov 29 13:35:44 2012 (r243673) @@ -143,7 +143,7 @@ public: {return !(__x == __y);} friend exception_ptr current_exception() _NOEXCEPT; - _LIBCPP_NORETURN friend void rethrow_exception(exception_ptr); + friend void rethrow_exception(exception_ptr); }; template Modified: head/contrib/libc++/include/iterator ============================================================================== --- head/contrib/libc++/include/iterator Thu Nov 29 13:29:58 2012 (r243672) +++ head/contrib/libc++/include/iterator Thu Nov 29 13:35:44 2012 (r243673) @@ -317,6 +317,10 @@ template T* end(T (& #include #include #include +#if __APPLE__ +#include +#endif + #ifdef _LIBCPP_DEBUG #include #endif @@ -795,7 +799,7 @@ public: typedef basic_streambuf<_CharT,_Traits> streambuf_type; typedef basic_istream<_CharT,_Traits> istream_type; private: - streambuf_type* __sbuf_; + mutable streambuf_type* __sbuf_; class __proxy { @@ -809,13 +813,14 @@ private: }; _LIBCPP_INLINE_VISIBILITY - void __test_for_eof() + bool __test_for_eof() const { if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof())) __sbuf_ = 0; + return __sbuf_ == 0; } public: - _LIBCPP_INLINE_VISIBILITY istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT : __sbuf_(__s.rdbuf()) {__test_for_eof();} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT @@ -828,19 +833,16 @@ public: _LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++() { - if (traits_type::eq_int_type(__sbuf_->snextc(), traits_type::eof())) - __sbuf_ = 0; + __sbuf_->sbumpc(); return *this; } _LIBCPP_INLINE_VISIBILITY __proxy operator++(int) { - char_type __c = __sbuf_->sgetc(); - ++(*this); - return __proxy(__c, __sbuf_); + return __proxy(__sbuf_->sbumpc(), __sbuf_); } _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const - {return (__sbuf_ == 0) == (__b.__sbuf_ == 0);} + {return __test_for_eof() == __b.__test_for_eof();} }; template @@ -882,6 +884,10 @@ public: _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;} _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;} +#if !defined(__APPLE__) || \ + (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \ + (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0) + template friend _LIBCPP_HIDDEN @@ -889,6 +895,7 @@ public: __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s, const _Ch* __ob, const _Ch* __op, const _Ch* __oe, ios_base& __iob, _Ch __fl); +#endif }; template Modified: head/contrib/libc++/include/locale ============================================================================== --- head/contrib/libc++/include/locale Thu Nov 29 13:29:58 2012 (r243672) +++ head/contrib/libc++/include/locale Thu Nov 29 13:35:44 2012 (r243673) @@ -192,6 +192,10 @@ template class messages_by #include #endif // !_WIN32 +#if __APPLE__ +#include +#endif + #include <__undef_min_max> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -1587,6 +1591,10 @@ __pad_and_output(_OutputIterator __s, return __s; } +#if !defined(__APPLE__) || \ + (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \ + (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0) + template _LIBCPP_HIDDEN ostreambuf_iterator<_CharT, _Traits> @@ -1633,6 +1641,8 @@ __pad_and_output(ostreambuf_iterator<_Ch return __s; } +#endif + template _OutputIterator num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 14:05:04 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 CDAA1F6A; Thu, 29 Nov 2012 14:05:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A20318FC08; Thu, 29 Nov 2012 14:05:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATE547A091479; Thu, 29 Nov 2012 14:05:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATE54uo091470; Thu, 29 Nov 2012 14:05:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211291405.qATE54uo091470@svn.freebsd.org> From: Martin Matuska Date: Thu, 29 Nov 2012 14:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243674 - in stable/9: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolar... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 14:05:04 -0000 Author: mm Date: Thu Nov 29 14:05:04 2012 New Revision: 243674 URL: http://svnweb.freebsd.org/changeset/base/243674 Log: Merge ZFS feature flags support and related bugfixes: 236884, 237001, 237119, 237458, 237972, 238113, 238391, 238422, 238926, 238950, 238951, 239389, 239394, 239620, 239774, 239953, 239958, 239967, 239968, 240063, 240133, 240153, 240303, 240345, 240415, 240955, 241655, 243014, 243505, 243506 MFC r236884: Introduce "feature flags" for ZFS pools (bump SPA version to 5000). Add first feature "com.delphix:async_destroy" (asynchronous destroy of ZFS datasets). Implement features support in ZFS boot code. Illumos revisions merged: 13700:2889e2596bd6 13701:1949b688d5fb 2619 asynchronous destruction of ZFS file systems 2747 SPA versioning with zfs feature flags References: https://www.illumos.org/issues/2619 https://www.illumos.org/issues/2747 MFC r237001: Fix ZFS boot with pre-features pools (version <= 28) broken in r236884 MFC r237119 [1]: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. MFC r237458: Import Illumos revision 13736:9f1d48e1681f 2901 ZFS receive fails for exabyte sparse files References: https://www.illumos.org/issues/2901 MFC r237972: Expose scrub and resilver tunables. This allows the user to tune the priority trade-off between scrub/resilver and other ZFS I/O. MFC r238113 (pjd): vdev_io_done stage is not used for ioctls. MFC r238391: Change behavior introduced in r237119 to vendor solution References: https://www.illumos.org/issues/2883 MFC r238422: Merge illumos commit 13749:df4cd82e2b60 1796 "ZFS HOLD" should not be used when doing "ZFS SEND" froma read-only pool 2871 support for __ZFS_POOL_RESTRICT used by ZFS test suite 2903 zfs destroy -d does not work 2957 zfs destroy -R/r sometimes fails when removing defer-destroyed snapshot References: https://www.illumos.org/issues/1796 https://www.illumos.org/issues/2871 https://www.illumos.org/issues/2903 https://www.illumos.org/issues/2957 MFC r238926: Partial MFV (illumos-gate 13753:2aba784c276b) 2762 zpool command should have better support for feature flags References: https://www.illumos.org/issues/2762 MFC r238950: Fix reporting of root pool upgrade notice. MFC r238951: Fix wrong indent according to style(9) MFC r239389: Backport fix for vendor issue #3085 3085 zfs diff panics, then panics in a loop on booting References: https://www.illumos.org/issues/3085 MFC r239394: Update zfs(8) manpage with illumos version of "zfs diff" Illumos issue: 2399 zfs manual page does not document use of "zfs diff" References: https://www.illumos.org/issues/2399 MFC r239620 [2]: Merge recent vendor changes: 3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets 3090 vdev_reopen() during reguid causes vdev to be treated as corrupt 3102 vdev_uberblock_load() and vdev_validate() may read the wrong label Referenes: https://www.illumos.org/issues/3086 https://www.illumos.org/issues/3090 https://www.illumos.org/issues/3102 MFC r239774: Merge recent vendor changes: 3100 zvol rename fails with EBUSY when dirty 3104 eliminate empty bpobjs 3120 zinject hangs in zfsdev_ioctl() due to uninitialized zc References: https://www.illumos.org/issues/3100 https://www.illumos.org/issues/3104 https://www.illumos.org/issues/3120 MFC r239953 (joel): Mdoc fixes. MFC r239958 (joel): Minor mdoc fixes. MFC r239967 (joel): Mdoc fixes. MFC r239968 (joel): Remove trailing whitespace. MFC r240063 (gjb): Add myself to copyright sections, per CDDL license. MFC r240133: Merge recent vendor changes and sync code: 1862 incremental zfs receive fails for sparse file > 8PB 3112 ztest does not honor ZFS_DEBUG 3122 zfs destroy filesystem should prefetch blocks 3129 'zpool reopen' restarts resilvers 3130 ztest failure: Assertion failed: 0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10) References: https://www.illumos.org/issues/1862 https://www.illumos.org/issues/3112 https://www.illumos.org/issues/3122 https://www.illumos.org/issues/3129 https://www.illumos.org/issues/3130 MFC r240153 (gjb) [3]: Typo fix and minor word swap. MFC r240303: Add assfail() and assfail3() to the opensolaris module. Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h. MFC r240345 (avg): zfs: fix sa_modify_attrs handling of variable-sized attributes - skip length_idx index for a replaced variable-sized attribute - skip length_idx index for a removed variable-sized attribute - also re-arranged code to make sure that length_idx is always incremented for variable-sized attributes - additionally add an assertion that the number of actually produced attributes is the same as the expected number of resulting attributes MFC r240415: Merge recent zfs vendor changes, sync code and adjust userland DEBUG. Illumos issued covered: 1884 Empty "used" field for zfs *space commands 3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero 3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID 3048 zfs {user,group}space [-s|-S] is broken 3049 zfs {user,group}space -t doesn't really filter the results 3060 zfs {user,group}space -H output isn't tab-delimited 3061 zfs {user,group}space -o doesn't use specified fields order 3064 usr/src/cmd/zpool/zpool_main.c misspells "successful" 3093 zfs {user,group}space's -i is noop 3098 zfs userspace/groupspace fail without saying why when run as non-root References: https://www.illumos.org/issues/ + [issue_id] MFC r240955 (partial): Merge recent vendor changes in ZFS. Illumos issued covered: 3139 zdb dies when it tries to determine path of unlinked file 3189 kernel panic in ZFS test suite during hotspare_onoffline_004_neg 3208 moving zpool cross-endian results in incorrect user/group accounting References: https://www.illumos.org/issues/ + [issue_id] MFC r241655: Add missing initialization for do_prefix. Corrects porting error in r238391 Vendor issue and changeset reference: 2883 changing "canmount" property to "on" should not always remount dataset https://www.illumos.org/issues/2883 Changeset 13743:95aba6e49b9f MFC r243014: Move zpool-features manual page from section 5 to section 7 and fix references Reported by: pluknet MFC r243505: Illumos 13886:e3261d03efbf 3349 zpool upgrade -V bumps the on disk version number, but leaves the in core version References: https://www.illumos.org/issues/3349 MFC r243506: zfs sha256 checksum is missing in zfs.8 manpage PR: kern/167905 [1], kern/170912 [2], kern/170914 [2], doc/171356 [3] Added: stable/9/cddl/contrib/opensolaris/cmd/zhack/ - copied from r236884, head/cddl/contrib/opensolaris/cmd/zhack/ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 - copied unchanged from r243014, head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/9/cddl/usr.sbin/zhack/ - copied from r236884, head/cddl/usr.sbin/zhack/ stable/9/sys/cddl/compat/opensolaris/sys/assfail.h - copied, changed from r240303, head/sys/cddl/compat/opensolaris/sys/assfail.h stable/9/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h - copied unchanged from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Replaced: stable/9/sys/cddl/compat/opensolaris/sys/debug.h - copied unchanged from r240415, head/sys/cddl/compat/opensolaris/sys/debug.h Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/UPDATING stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c stable/9/cddl/contrib/opensolaris/lib/libuutil/common/uu_misc.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/9/cddl/lib/libnvpair/Makefile stable/9/cddl/lib/libzfs/Makefile stable/9/cddl/lib/libzpool/Makefile stable/9/cddl/sbin/zpool/Makefile stable/9/cddl/usr.bin/ztest/Makefile stable/9/cddl/usr.sbin/Makefile stable/9/cddl/usr.sbin/zdb/Makefile stable/9/cddl/usr.sbin/zhack/Makefile stable/9/rescue/rescue/Makefile stable/9/sys/boot/zfs/zfsimpl.c stable/9/sys/cddl/boot/zfs/zfsimpl.h stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/9/sys/modules/zfs/Makefile Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/cddl/lib/ (props changed) stable/9/rescue/rescue/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/Makefile.inc1 Thu Nov 29 14:05:04 2012 (r243674) @@ -1273,7 +1273,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ - ${_cddl_lib_libumem} \ + ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1292,6 +1292,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem +_cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib= cddl/lib .endif Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/UPDATING Thu Nov 29 14:05:04 2012 (r243674) @@ -9,6 +9,16 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121129: + A new version of ZFS (pool version 5000) has been merged to 9-STABLE. + Starting with this version the old system of ZFS pool versioning + is superseded by "feature flags". This concept enables forward + compatibility against certain future changes in functionality of ZFS + pools. The first two read-only compatible "feature flags" for ZFS + pools are "com.delphix:async_destroy" and "com.delphix:empty_bpobj". + For more information read the new zpool-features(7) manual page. + Please refer to the "ZFS notes" section of this file for information + on upgrading boot ZFS pools. 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Thu Nov 29 14:05:04 2012 (r243674) @@ -93,14 +93,14 @@ If specified multiple times, verify the .It Fl C Display information about the configuration. If specified with no other options, instead display information about the cache file -.Ns ( Pa /etc/zfs/zpool.cache Ns ). +.Po Pa /etc/zfs/zpool.cache Pc . To specify the cache file to display, see .Fl U .Pp If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with -.FL e +.Fl e also display the configuration that would be used were the pool to be imported. .It Fl d @@ -135,7 +135,7 @@ option is also specified, also display t .It Fl L Disable leak tracing and the loading of space maps. By default, -.Nm +.Nm verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. @@ -253,7 +253,7 @@ MOS Configuration: .Li # Ic zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects -... + ... .Ed .It Xo Sy Example 3 Display basic information about object 0 in .Sy 'rpool/export/home' @@ -272,7 +272,7 @@ Dataset rpool/export/home [ZPL], ID 137, .Li # Ic zdb -S rpool Simulated DDT histogram: -bucket allocated referenced +bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Nov 29 14:05:04 2012 (r243674) @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -54,6 +56,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -63,7 +66,8 @@ #define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ zio_checksum_table[(idx)].ci_name : "UNKNOWN") #define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : "UNKNOWN") + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) #ifndef lint @@ -1088,7 +1092,7 @@ dump_dsl_dataset(objset_t *os, uint64_t ASSERT(size == sizeof (*ds)); crtime = ds->ds_creation_time; - zdb_nicenum(ds->ds_used_bytes, used); + zdb_nicenum(ds->ds_referenced_bytes, used); zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); @@ -1132,6 +1136,44 @@ dump_dsl_dataset(objset_t *os, uint64_t /* ARGSUSED */ static int +dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) +{ + char blkbuf[BP_SPRINTF_LEN]; + + if (bp->blk_birth != 0) { + sprintf_blkptr(blkbuf, bp); + (void) printf("\t%s\n", blkbuf); + } + return (0); +} + +static void +dump_bptree(objset_t *os, uint64_t obj, char *name) +{ + char bytes[32]; + bptree_phys_t *bt; + dmu_buf_t *db; + + if (dump_opt['d'] < 3) + return; + + VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db)); + bt = db->db_data; + zdb_nicenum(bt->bt_bytes, bytes); + (void) printf("\n %s: %llu datasets, %s\n", + name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes); + dmu_buf_rele(db, FTAG); + + if (dump_opt['d'] < 5) + return; + + (void) printf("\n"); + + (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL); +} + +/* ARGSUSED */ +static int dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { char blkbuf[BP_SPRINTF_LEN]; @@ -1883,11 +1925,13 @@ typedef struct zdb_blkstats { */ #define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0) #define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1) -#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3) static char *zdb_ot_extname[] = { "deferred free", "dedup ditto", + "other", "Total", }; @@ -1968,9 +2012,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog type = BP_GET_TYPE(bp); - zdb_count_block(zcb, zilog, bp, type); + zdb_count_block(zcb, zilog, bp, + (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type); - is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata); + is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { int ioerr; @@ -2197,6 +2242,12 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, + &zcb, NULL)); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; @@ -2373,7 +2424,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo } if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF || - BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata) + BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp))) return (0); ddt_key_fill(&zdde_search.zdde_key, bp); @@ -2478,7 +2529,14 @@ dump_zpool(spa_t *spa) dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool frees"); + "Pool snapshot frees"); + } + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + dump_bptree(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, + "Pool dataset frees"); } dump_dtl(spa->spa_root_vdev, 0); } Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Nov 29 14:05:04 2012 (r243674) @@ -23,6 +23,7 @@ .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Bryan Drewery +.\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" @@ -57,8 +58,8 @@ .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Nm .Cm snapshot @@ -136,17 +137,21 @@ .Fl a | Ar filesystem .Nm .Cm userspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot .Nm .Cm groupspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -619,7 +624,7 @@ privilege with .Qq Nm Cm allow , can access everyone's usage. .Pp -The +The .Sy userused@ Ns ... properties are not displayed by .Qq Nm Cm get all . @@ -819,7 +824,7 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, @@ -1129,7 +1134,7 @@ will not use configured pool log devices will instead optimize synchronous operations for global pool throughput and efficient use of resources. .It Sy snapdir Ns = Ns Cm hidden | visible -Controls whether the +Controls whether the .Pa \&.zfs directory is hidden or visible in the root of the file system as discussed in the @@ -1196,7 +1201,7 @@ are not reflected in the reservation. The .Sy vscan property is currently not supported on -.Fx . +.Fx . .It Sy xattr Ns = Ns Cm off | on The .Sy xattr @@ -1283,7 +1288,7 @@ properties. The correlation between prop In addition, these options can be set on a per-mount basis using the .Fl o option, without affecting the property that is stored on disk. The values -specified on the command line override the values stored in the dataset. These +specified on the command line override the values stored in the dataset. These properties are reported as "temporary" by the .Qq Nm Cm get command. If the properties are changed while the dataset is mounted, the new @@ -1322,7 +1327,7 @@ domain name for the .Ar module component of property names to reduce the chance that two independently-developed packages use the same property name for different -purposes. Property names beginning with +purposes. Property names beginning with .Em com.sun are reserved for use by Sun Microsystems. .Pp @@ -1489,8 +1494,8 @@ behavior for mounted file systems in use .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Xc .Pp @@ -1978,9 +1983,11 @@ Upgrade the specified file system. .It Xo .Nm .Cm userspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -1998,9 +2005,9 @@ Print numeric ID instead of user/group n .It Fl H Do not print headers, use tab-delimited output. .It Fl p -Use exact (parseable) numeric output. +Use exact (parsable) numeric output. .It Fl o Ar field Ns Op , Ns Ar ... -Display only the specified fields from the following set, +Display only the specified fields from the following set: .Sy type,name,used,quota . The default is to display all fields. .It Fl s Ar field @@ -2015,7 +2022,7 @@ another. The default is Sort by this field in reverse order. See .Fl s . .It Fl t Ar type Ns Op , Ns Ar ... -Print only the specified types from the following set, +Print only the specified types from the following set: .Sy all,posixuser,smbuser,posixgroup,smbgroup . .Pp The default is @@ -2029,9 +2036,11 @@ Translate SID to POSIX ID. This flag cur .It Xo .Nm .Cm groupspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -2209,7 +2218,7 @@ and it is assumed to be from the same fi .Ar snapshot . .Pp If the destination is a clone, the source may be the origin snapshot, which -must be fully specified (for example, +must be fully specified (for example, .Cm pool/fs@origin , not just .Cm @origin ) . @@ -2458,24 +2467,26 @@ subcommand or change a property. The following permissions are available: .Bl -column -offset 4n "secondarycache" "subcommand" .It NAME Ta TYPE Ta NOTES -.It Xo allow Ta subcommand Ta Must +.It allow Ta subcommand Ta Must Xo also have the permission that is being allowed .Xc -.It Xo clone Ta subcommand Ta Must +.It clone Ta subcommand Ta Must Xo also have the 'create' ability and 'mount' ability in the origin file system .Xc .It create Ta subcommand Ta Must also have the 'mount' ability .It destroy Ta subcommand Ta Must also have the 'mount' ability +.It diff Ta subcommand Ta Allows lookup of paths within a dataset given an +object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets -.It Xo promote Ta subcommand Ta Must +.It promote Ta subcommand Ta Must Xo also have the 'mount' and 'promote' ability in the origin file system .Xc .It receive Ta subcommand Ta Must also have the 'mount' and 'create' ability -.It Xo release Ta subcommand Ta Allows +.It release Ta subcommand Ta Allows Xo releasing a user hold which might destroy the snapshot .Xc -.It Xo rename Ta subcommand Ta Must +.It rename Ta subcommand Ta Must Xo also have the 'mount' and 'create' ability in the new parent .Xc .It rollback Ta subcommand Ta Must also have the 'mount' ability @@ -2491,7 +2502,6 @@ protocol .It userprop Ta other Ta Allows changing any user property .It userquota Ta other Ta Allows accessing any userquota@... property .It userused Ta other Ta Allows reading any userused@... property -.It Ta .It aclinherit Ta property .It aclmode Ta property .It atime Ta property @@ -2669,43 +2679,42 @@ descendent file systems. .Op Ar snapshot Ns | Ns Ar filesystem .Xc .Pp -Describes differences between a snapshot and a successor dataset. The -successor dataset can be a later snapshot or the current filesystem. -.Pp -The changed files are displayed including the change type. The change type -is displayed useing a single character. If a file or directory was renamed, -the old and the new names are displayed. -.Pp -The following change types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "CHANGE TYPE" -.It CHARACTER Ta CHANGE TYPE -.It \&+ Ta file was added -.It \&- Ta file was removed -.It \&M Ta file was modified -.It \&R Ta file was renamed +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname +.Pq in case of rename , +change in link count, and optionally file type and/or change time. +.Pp +The types of change are: +.Bl -column -offset 2n indent +.It \&- Ta path was removed +.It \&+ Ta path was added +.It \&M Ta path was modified +.It \&R Ta path was renamed .El .Bl -tag -width indent .It Fl F -Display a single letter for the file type in second to last column. -.Pp -The following file types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "FILE TYPE" -.It CHARACTER Ta FILE TYPE -.It \&F Ta file -.It \&/ Ta directory +Display an indication of the type of file, in a manner similar to the +.Fl F +option of +.Xr ls 1 . +.Bl -column -offset 2n indent .It \&B Ta block device +.It \&C Ta character device +.It \&F Ta regular file +.It \&/ Ta directory .It \&@ Ta symbolic link .It \&= Ta socket .It \&> Ta door (not supported on Fx ) -.It \&| Ta FIFO (not supported on Fx ) -.It \&P Ta event portal (not supported on Fx ) +.It \&| Ta named pipe (not supported on Fx ) +.It \&P Ta event port (not supported on Fx ) .El .It Fl H -Machine-parseable output, fields separated a tab character. +Give more parseable tab-separated output, without header lines and without +arrows. .It Fl t -Display a change timestamp in the first column. +Display the path's inode change time as the first column of output. .El .It Xo .Nm @@ -2742,6 +2751,16 @@ Detaches the specified from the jail identified by JID .Ar jailid . .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a Tn ZFS No File System Hierarchy @@ -2807,7 +2826,7 @@ Snapshots are displayed if the .Sy listsnaps property is .Cm on . -The default is +The default is .Cm off . See .Xr zpool 8 @@ -3158,16 +3177,21 @@ Local+Descendent permissions on (tank/us group staff @pset,create,mount ------------------------------------------------------------- .Ed -.El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. +.It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset +.Pp +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The +.Fl F +option is used to indicate type information for the files affected. +.Bd -literal -offset 2n +.Li # Ic zfs diff tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.Ed .El .Sh SEE ALSO .Xr chmod 2 , Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Nov 29 13:35:44 2012 (r243673) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Nov 29 14:05:04 2012 (r243674) @@ -304,13 +304,13 @@ get_usage(zfs_help_t idx) "\tunallow [-r] -s @setname [[,...]] " "\n")); case HELP_USERSPACE: - return (gettext("\tuserspace [-niHp] [-o field[,...]] " - "[-sS field] ... [-t type[,...]]\n" - "\t \n")); + return (gettext("\tuserspace [-Hinp] [-o field[,...]] " + "[-s field] ...\n\t[-S field] ... " + "[-t type[,...]] \n")); case HELP_GROUPSPACE: - return (gettext("\tgroupspace [-niHp] [-o field[,...]] " - "[-sS field] ... [-t type[,...]]\n" - "\t \n")); + return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " + "[-s field] ...\n\t[-S field] ... " + "[-t type[,...]] \n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: @@ -1081,7 +1081,7 @@ snapshot_to_nvl_cb(zfs_handle_t *zhp, vo int err = 0; /* Check for clones. */ - if (!cb->cb_doclones) { + if (!cb->cb_doclones && !cb->cb_defer_destroy) { cb->cb_target = zhp; cb->cb_first = B_TRUE; err = zfs_iter_dependents(zhp, B_TRUE, @@ -2057,30 +2057,52 @@ zfs_do_upgrade(int argc, char **argv) return (ret); } -#define USTYPE_USR_BIT (0) -#define USTYPE_GRP_BIT (1) -#define USTYPE_PSX_BIT (2) -#define USTYPE_SMB_BIT (3) - -#define USTYPE_USR (1 << USTYPE_USR_BIT) -#define USTYPE_GRP (1 << USTYPE_GRP_BIT) - -#define USTYPE_PSX (1 << USTYPE_PSX_BIT) -#define USTYPE_SMB (1 << USTYPE_SMB_BIT) - -#define USTYPE_PSX_USR (USTYPE_PSX | USTYPE_USR) -#define USTYPE_SMB_USR (USTYPE_SMB | USTYPE_USR) -#define USTYPE_PSX_GRP (USTYPE_PSX | USTYPE_GRP) -#define USTYPE_SMB_GRP (USTYPE_SMB | USTYPE_GRP) -#define USTYPE_ALL (USTYPE_PSX_USR | USTYPE_SMB_USR \ - | USTYPE_PSX_GRP | USTYPE_SMB_GRP) +/* + * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...] + * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...] + * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * + * -H Scripted mode; elide headers and separate columns by tabs. + * -i Translate SID to POSIX ID. + * -n Print numeric ID instead of user/group name. + * -o Control which fields to display. + * -p Use exact (parseable) numeric output. + * -s Specify sort columns, descending order. + * -S Specify sort columns, ascending order. + * -t Control which object types to display. + * + * Displays space consumed by, and quotas on, each user in the specified + * filesystem or snapshot. + */ +/* us_field_types, us_field_hdr and us_field_names should be kept in sync */ +enum us_field_types { + USFIELD_TYPE, + USFIELD_NAME, + USFIELD_USED, + USFIELD_QUOTA +}; +static char *us_field_hdr[] = { "TYPE", "NAME", "USED", "QUOTA" }; +static char *us_field_names[] = { "type", "name", "used", "quota" }; +#define USFIELD_LAST (sizeof (us_field_names) / sizeof (char *)) -#define USPROP_USED_BIT (0) -#define USPROP_QUOTA_BIT (1) +#define USTYPE_PSX_GRP (1 << 0) +#define USTYPE_PSX_USR (1 << 1) +#define USTYPE_SMB_GRP (1 << 2) +#define USTYPE_SMB_USR (1 << 3) +#define USTYPE_ALL \ + (USTYPE_PSX_GRP | USTYPE_PSX_USR | USTYPE_SMB_GRP | USTYPE_SMB_USR) -#define USPROP_USED (1 << USPROP_USED_BIT) -#define USPROP_QUOTA (1 << USPROP_QUOTA_BIT) +static int us_type_bits[] = { + USTYPE_PSX_GRP, + USTYPE_PSX_USR, + USTYPE_SMB_GRP, + USTYPE_SMB_USR, + USTYPE_ALL +}; +static char *us_type_names[] = { "posixgroup", "posxiuser", "smbgroup", + "smbuser", "all" }; typedef struct us_node { nvlist_t *usn_nvl; @@ -2089,37 +2111,49 @@ typedef struct us_node { } us_node_t; typedef struct us_cbdata { - nvlist_t **cb_nvlp; - uu_avl_pool_t *cb_avl_pool; - uu_avl_t *cb_avl; - boolean_t cb_numname; - boolean_t cb_nicenum; - boolean_t cb_sid2posix; - zfs_userquota_prop_t cb_prop; - zfs_sort_column_t *cb_sortcol; - size_t cb_max_typelen; - size_t cb_max_namelen; - size_t cb_max_usedlen; - size_t cb_max_quotalen; + nvlist_t **cb_nvlp; + uu_avl_pool_t *cb_avl_pool; + uu_avl_t *cb_avl; + boolean_t cb_numname; + boolean_t cb_nicenum; + boolean_t cb_sid2posix; + zfs_userquota_prop_t cb_prop; + zfs_sort_column_t *cb_sortcol; + size_t cb_width[USFIELD_LAST]; } us_cbdata_t; +static boolean_t us_populated = B_FALSE; + typedef struct { zfs_sort_column_t *si_sortcol; - boolean_t si_num_name; - boolean_t si_parsable; + boolean_t si_numname; } us_sort_info_t; static int +us_field_index(char *field) +{ + int i; + + for (i = 0; i < USFIELD_LAST; i++) { + if (strcmp(field, us_field_names[i]) == 0) + return (i); + } + + return (-1); +} + +static int us_compare(const void *larg, const void *rarg, void *unused) { const us_node_t *l = larg; const us_node_t *r = rarg; - int rc = 0; us_sort_info_t *si = (us_sort_info_t *)unused; zfs_sort_column_t *sortcol = si->si_sortcol; - boolean_t num_name = si->si_num_name; + boolean_t numname = si->si_numname; nvlist_t *lnvl = l->usn_nvl; nvlist_t *rnvl = r->usn_nvl; + int rc = 0; + boolean_t lvb, rvb; for (; sortcol != NULL; sortcol = sortcol->sc_next) { char *lvstr = ""; @@ -2138,17 +2172,17 @@ us_compare(const void *larg, const void (void) nvlist_lookup_uint32(lnvl, propname, &lv32); (void) nvlist_lookup_uint32(rnvl, propname, &rv32); if (rv32 != lv32) - rc = (rv32 > lv32) ? 1 : -1; + rc = (rv32 < lv32) ? 1 : -1; break; case ZFS_PROP_NAME: propname = "name"; - if (num_name) { - (void) nvlist_lookup_uint32(lnvl, propname, - &lv32); - (void) nvlist_lookup_uint32(rnvl, propname, - &rv32); - if (rv32 != lv32) - rc = (rv32 > lv32) ? 1 : -1; + if (numname) { + (void) nvlist_lookup_uint64(lnvl, propname, + &lv64); + (void) nvlist_lookup_uint64(rnvl, propname, + &rv64); + if (rv64 != lv64) + rc = (rv64 < lv64) ? 1 : -1; } else { (void) nvlist_lookup_string(lnvl, propname, &lvstr); @@ -2157,27 +2191,40 @@ us_compare(const void *larg, const void rc = strcmp(lvstr, rvstr); } break; - case ZFS_PROP_USED: case ZFS_PROP_QUOTA: - if (ZFS_PROP_USED == prop) + if (!us_populated) + break; + if (prop == ZFS_PROP_USED) propname = "used"; else propname = "quota"; (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, &rv64); if (rv64 != lv64) - rc = (rv64 > lv64) ? 1 : -1; + rc = (rv64 < lv64) ? 1 : -1; + break; } - if (rc) + if (rc != 0) { if (rc < 0) return (reverse ? 1 : -1); else return (reverse ? -1 : 1); + } } - return (rc); + /* + * If entries still seem to be the same, check if they are of the same + * type (smbentity is added only if we are doing SID to POSIX ID + * translation where we can have duplicate type/name combinations). + */ + if (nvlist_lookup_boolean_value(lnvl, "smbentity", &lvb) == 0 && + nvlist_lookup_boolean_value(rnvl, "smbentity", &rvb) == 0 && + lvb != rvb) + return (lvb < rvb ? -1 : 1); + + return (0); } static inline const char * @@ -2197,9 +2244,6 @@ us_type2str(unsigned field_type) } } -/* - * zfs userspace - */ static int userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space) { @@ -2207,7 +2251,6 @@ userspace_cb(void *arg, const char *doma zfs_userquota_prop_t prop = cb->cb_prop; char *name = NULL; char *propname; - char namebuf[32]; char sizebuf[32]; us_node_t *node; uu_avl_pool_t *avl_pool = cb->cb_avl_pool; @@ -2221,32 +2264,30 @@ userspace_cb(void *arg, const char *doma size_t namelen; size_t typelen; size_t sizelen; + int typeidx, nameidx, sizeidx; us_sort_info_t sortinfo = { sortcol, cb->cb_numname }; + boolean_t smbentity = B_FALSE; - if (domain == NULL || domain[0] == '\0') { - /* POSIX */ - if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { - type = USTYPE_PSX_GRP; - struct group *g = getgrgid(rid); - if (g) - name = g->gr_name; - } else { - type = USTYPE_PSX_USR; - struct passwd *p = getpwuid(rid); - if (p) - name = p->pw_name; - } - } else { - char sid[ZFS_MAXNAMELEN+32]; + if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) + nomem(); + node = safe_malloc(sizeof (us_node_t)); + uu_avl_node_init(node, &node->usn_avlnode, avl_pool); + node->usn_nvl = props; + + if (domain != NULL && domain[0] != '\0') { + /* SMB */ + char sid[ZFS_MAXNAMELEN + 32]; uid_t id; uint64_t classes; #ifdef sun - int err = 0; + int err; directory_error_t e; #endif + smbentity = B_TRUE; + (void) snprintf(sid, sizeof (sid), "%s-%u", domain, rid); - /* SMB */ + if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { type = USTYPE_SMB_GRP; #ifdef sun @@ -2262,217 +2303,139 @@ userspace_cb(void *arg, const char *doma #ifdef sun if (err == 0) { rid = id; - - e = directory_name_from_sid(NULL, sid, &name, &classes); - if (e != NULL) { - directory_error_free(e); - return (NULL); + if (!cb->cb_sid2posix) { + e = directory_name_from_sid(NULL, sid, &name, + &classes); + if (e != NULL) + directory_error_free(e); + if (name == NULL) + name = sid; } - - if (name == NULL) - name = sid; } #endif } -/* - * if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) - * ug = "group"; - * else - * ug = "user"; - */ - - if (prop == ZFS_PROP_USERUSED || prop == ZFS_PROP_GROUPUSED) - propname = "used"; - else - propname = "quota"; - - (void) snprintf(namebuf, sizeof (namebuf), "%u", rid); - if (name == NULL) - name = namebuf; - - if (cb->cb_nicenum) - zfs_nicenum(space, sizebuf, sizeof (sizebuf)); - else - (void) sprintf(sizebuf, "%llu", space); + if (cb->cb_sid2posix || domain == NULL || domain[0] == '\0') { + /* POSIX or -i */ + if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { + type = USTYPE_PSX_GRP; + if (!cb->cb_numname) { + struct group *g; - node = safe_malloc(sizeof (us_node_t)); - uu_avl_node_init(node, &node->usn_avlnode, avl_pool); + if ((g = getgrgid(rid)) != NULL) + name = g->gr_name; + } + } else { + type = USTYPE_PSX_USR; + if (!cb->cb_numname) { + struct passwd *p; - if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) { - free(node); - return (-1); + if ((p = getpwuid(rid)) != NULL) + name = p->pw_name; + } + } } + /* + * Make sure that the type/name combination is unique when doing + * SID to POSIX ID translation (hence changing the type from SMB to + * POSIX). + */ + if (cb->cb_sid2posix && + nvlist_add_boolean_value(props, "smbentity", smbentity) != 0) + nomem(); + + /* Calculate/update width of TYPE field */ + typestr = us_type2str(type); + typelen = strlen(gettext(typestr)); + typeidx = us_field_index("type"); + if (typelen > cb->cb_width[typeidx]) + cb->cb_width[typeidx] = typelen; if (nvlist_add_uint32(props, "type", type) != 0) nomem(); - if (cb->cb_numname) { - if (nvlist_add_uint32(props, "name", rid) != 0) + /* Calculate/update width of NAME field */ + if ((cb->cb_numname && cb->cb_sid2posix) || name == NULL) { + if (nvlist_add_uint64(props, "name", rid) != 0) nomem(); - namelen = strlen(namebuf); + namelen = snprintf(NULL, 0, "%u", rid); } else { if (nvlist_add_string(props, "name", name) != 0) nomem(); namelen = strlen(name); } + nameidx = us_field_index("name"); + if (namelen > cb->cb_width[nameidx]) + cb->cb_width[nameidx] = namelen; - typestr = us_type2str(type); - typelen = strlen(gettext(typestr)); - if (typelen > cb->cb_max_typelen) - cb->cb_max_typelen = typelen; - - if (namelen > cb->cb_max_namelen) - cb->cb_max_namelen = namelen; - - sizelen = strlen(sizebuf); - if (0 == strcmp(propname, "used")) { - if (sizelen > cb->cb_max_usedlen) - cb->cb_max_usedlen = sizelen; - } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 14:41:45 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 26EFABBB for ; Thu, 29 Nov 2012 14:41:45 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id AB1358FC21 for ; Thu, 29 Nov 2012 14:41:44 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/afgnrylsiW6obkY= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-109-45-0-1.web.vodafone.de [109.45.0.1]) by smtp.strato.de (jored mo27) (RZmta 31.6 DYNA|AUTH) with (AES128-SHA encrypted) ESMTPA id k05fe0oATE0WO6 for ; Thu, 29 Nov 2012 15:41:42 +0100 (CET) Received: by britannica.bec.de (sSMTP sendmail emulation); Thu, 29 Nov 2012 15:41:41 +0100 Date: Thu, 29 Nov 2012 15:41:41 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129144141.GA10843@britannica.bec.de> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121129120147.GE3013@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 14:41:45 -0000 On Thu, Nov 29, 2012 at 02:01:47PM +0200, Konstantin Belousov wrote: > Also, being quite removed from the function definition, there is a chance > that some future modification would make the attribute a lie. At least clang enforces the correctness of the attribute. Joerg From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 15:16: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 ED752880 for ; Thu, 29 Nov 2012 15:16:27 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4E6728FC13 for ; Thu, 29 Nov 2012 15:16:27 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so14357953lah.13 for ; Thu, 29 Nov 2012 07:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=ZCS1ElbtcQhuQwSz5D0kz9P3hh/jf/EDzkd0xwxEhlE=; b=OeZXOqT0Zp2pcX5b/PZZl5ww8XxC5XwJaByp4oT0uImXcou+DZjdgMEEPwd/L4Xcrf 3bgBDCZ/3pekjY5KSHiMffj+6nEDBSxafCHCk4laCnIUj7q0hyY58cLTVCgVUTwJgDOQ zHpXQ9+eO+gNKEs93X88DNG4kE83JLPKiLRIg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=ZCS1ElbtcQhuQwSz5D0kz9P3hh/jf/EDzkd0xwxEhlE=; b=GcDUarPhzLK1ppJss7To7ijjZOb1f1y+fWm+foFwv1TTIYYlqww8hwMgm7Eavl4T5Z DDuAeJYQJOXetZpgMBdwvAmPBZhgcWnFDR7/rsXOUabmplPHdok1w7eYEMp+Vi6lEPiS nWEMKfHA1iofrEq3QILW1ukFF3Y7yDapShZfo17XK6pU3If7BHD1bD40M7pbNLU7ZsmI BoEKZk+c3cAMG9FW5qFp7P3Q0H47JFgZ8NOobfoJMqQttN3txrvlboqDacZfIpufQG/W MyQkc1rnVmtj4MmJIsJxLkojleHiBuCG1cE36Qvx+2ytkZW+Tk7qEBPrZWyE/27RBy3L WE1Q== Received: by 10.152.105.33 with SMTP id gj1mr22020411lab.49.1354202185945; Thu, 29 Nov 2012 07:16:25 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Thu, 29 Nov 2012 07:15:54 -0800 (PST) In-Reply-To: <20121129130449.GH3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> <20121129130449.GH3013@kib.kiev.ua> From: Eitan Adler Date: Thu, 29 Nov 2012 10:15:54 -0500 X-Google-Sender-Auth: Kh35L_3S08YPNfNYrDu_i6xvmZ4 Message-ID: Subject: Re: svn commit: r243665 - head/sbin/dump To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkPMjiNjlTpiwXkeynG86Gg6rw/abMH/IP5lSVvo1aOaGBLU3sGZKn0OQpqoKLTqJsxpo6v Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 15:16:28 -0000 On 29 November 2012 08:04, Konstantin Belousov wrote: >> It fixes some static analyzer warnings. > This cannot be a reason to cripple the code. How is the code crippled? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 16:24: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 3F7673C7; Thu, 29 Nov 2012 16:24:17 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id CC48A8FC14; Thu, 29 Nov 2012 16:24:16 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 8EF0A1203C0; Thu, 29 Nov 2012 17:24:12 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 68D522848C; Thu, 29 Nov 2012 17:24:12 +0100 (CET) Date: Thu, 29 Nov 2012 17:24:12 +0100 From: Jilles Tjoelker To: Konstantin Belousov Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129162412.GD29338@stack.nl> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121129120147.GE3013@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 16:24:17 -0000 On Thu, Nov 29, 2012 at 02:01:47PM +0200, Konstantin Belousov wrote: > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: > > Author: eadler > > Date: Thu Nov 29 05:16:50 2012 > > New Revision: 243665 > > URL: http://svnweb.freebsd.org/changeset/base/243665 > > Log: > > Mark non-returning function as such > > PR: bin/172978 > > Approved by: cperciva > > MFC after: 3 days > > Modified: > > head/sbin/dump/dump.h > > Modified: head/sbin/dump/dump.h > > ============================================================================== > > --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) > > +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) > > @@ -121,7 +121,7 @@ void trewind(void); > > void writerec(char *dp, int isspcl); > > > > void Exit(int status) __dead2; > > -void dumpabort(int signo); > > +void dumpabort(int signo) __dead2; > > void dump_getfstab(void); > > > > char *rawname(char *cp); > What is the goal of this change ? This has been discussed before in http://lists.freebsd.org/pipermail/freebsd-current/2011-January/022179.html and the rest of the thread. The result there seems that it is the least bad thing to add __dead2 even on static functions that do not return to reduce compiler/analyzer warnings and improve the generated code with GCC 4.2.1 and GCC 4.5. > It is arguably backward. There is absolutely no use to mark signal > handler as __dead2, and all other uses do not benefit from the > redundand declaration. Although most of the uses of dumpabort() are in the same file as its definition, GCC 4.2.1 is too dumb to detect its noreturn property automatically. Furthermore, some of the uses are in separate files. In particular, __dead2 on dumpabort() is required to mark or detect quit() as noreturn. > Also, being quite removed from the function definition, there is a > chance that some future modification would make the attribute a lie. Both GCC and Clang generate a warning by default if it appears possible for a noreturn function to return, so as long as -Werror remains enabled it should be safe enough. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 17:35: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 4A5AA4B6; Thu, 29 Nov 2012 17:35:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3F28FC0C; Thu, 29 Nov 2012 17:35:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATHZwTp026354; Thu, 29 Nov 2012 17:35:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATHZwvL026352; Thu, 29 Nov 2012 17:35:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211291735.qATHZwvL026352@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 29 Nov 2012 17:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243676 - in stable/9/sys: modules netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 17:35:58 -0000 Author: ae Date: Thu Nov 29 17:35:57 2012 New Revision: 243676 URL: http://svnweb.freebsd.org/changeset/base/243676 Log: MFC r243336: Remove opt_inet.h, it isn't required here. MFC r243337: Connect ip6_mroute kernel module to the build. Modified: stable/9/sys/modules/Makefile stable/9/sys/netinet6/ip6_mroute.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Thu Nov 29 15:08:13 2012 (r243675) +++ stable/9/sys/modules/Makefile Thu Nov 29 17:35:57 2012 (r243676) @@ -147,6 +147,7 @@ SUBDIR= \ ${_ipfw} \ ipfw_nat \ ${_ipmi} \ + ip6_mroute_mod \ ip_mroute_mod \ ${_ips} \ ${_ipw} \ Modified: stable/9/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/9/sys/netinet6/ip6_mroute.c Thu Nov 29 15:08:13 2012 (r243675) +++ stable/9/sys/netinet6/ip6_mroute.c Thu Nov 29 17:35:57 2012 (r243676) @@ -81,7 +81,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet.h" #include "opt_inet6.h" #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 17:41:19 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 B237B661; Thu, 29 Nov 2012 17:41:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96CFF8FC0C; Thu, 29 Nov 2012 17:41:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATHfJas027087; Thu, 29 Nov 2012 17:41:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATHfJtH027085; Thu, 29 Nov 2012 17:41:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211291741.qATHfJtH027085@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 29 Nov 2012 17:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243677 - in stable/8/sys: modules netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 17:41:19 -0000 Author: ae Date: Thu Nov 29 17:41:19 2012 New Revision: 243677 URL: http://svnweb.freebsd.org/changeset/base/243677 Log: MFC r243336: Remove opt_inet.h, it isn't required here. MFC r243337: Connect ip6_mroute kernel module to the build. Modified: stable/8/sys/modules/Makefile stable/8/sys/netinet6/ip6_mroute.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/modules/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Thu Nov 29 17:35:57 2012 (r243676) +++ stable/8/sys/modules/Makefile Thu Nov 29 17:41:19 2012 (r243677) @@ -140,6 +140,7 @@ SUBDIR= \ ${_ipfw} \ ipfw_nat \ ${_ipmi} \ + ip6_mroute_mod \ ip_mroute_mod \ ${_ips} \ ${_ipw} \ Modified: stable/8/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/8/sys/netinet6/ip6_mroute.c Thu Nov 29 17:35:57 2012 (r243676) +++ stable/8/sys/netinet6/ip6_mroute.c Thu Nov 29 17:41:19 2012 (r243677) @@ -81,7 +81,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet.h" #include "opt_inet6.h" #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 18:08:37 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 169BED56; Thu, 29 Nov 2012 18:08:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC0308FC16; Thu, 29 Nov 2012 18:08:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATI8aCn031224; Thu, 29 Nov 2012 18:08:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATI8a9M031211; Thu, 29 Nov 2012 18:08:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211291808.qATI8a9M031211@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Nov 2012 18:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243678 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 18:08:37 -0000 Author: mav Date: Thu Nov 29 18:08:36 2012 New Revision: 243678 URL: http://svnweb.freebsd.org/changeset/base/243678 Log: MFC r242323, r242328: Add basic BIO_DELETE support to GEOM RAID class for all RAID levels. If at least one subdisk in the volume supports it, BIO_DELETE requests will be propagated down. Unfortunatelly, for RAID levels with redundancy unmapped blocks will be mapped back during first rebuild/resync process. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/g_raid.h stable/9/sys/geom/raid/md_ddf.c 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 stable/9/sys/geom/raid/tr_concat.c stable/9/sys/geom/raid/tr_raid0.c stable/9/sys/geom/raid/tr_raid1.c stable/9/sys/geom/raid/tr_raid1e.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/g_raid.c Thu Nov 29 18:08:36 2012 (r243678) @@ -499,6 +499,34 @@ g_raid_get_diskname(struct g_raid_disk * } void +g_raid_get_disk_info(struct g_raid_disk *disk) +{ + struct g_consumer *cp = disk->d_consumer; + int error, len; + + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + error = g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); + if (error) + disk->d_kd.di.dumper = NULL; + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG1(2, disk->d_softc, + "Dumping not supported by %s: %d.", + cp->provider->name, error); + + /* Read BIO_DELETE support. */ + error = g_getattr("GEOM::candelete", cp, &disk->d_candelete); + if (error) + disk->d_candelete = 0; + if (!disk->d_candelete) + G_RAID_DEBUG1(2, disk->d_softc, + "BIO_DELETE not supported by %s: %d.", + cp->provider->name, error); +} + +void g_raid_report_disk_state(struct g_raid_disk *disk) { struct g_raid_subdisk *sd; @@ -1052,6 +1080,31 @@ g_raid_kerneldump(struct g_raid_softc *s } static void +g_raid_candelete(struct g_raid_softc *sc, struct bio *bp) +{ + struct g_provider *pp; + struct g_raid_volume *vol; + struct g_raid_subdisk *sd; + int *val; + int i; + + val = (int *)bp->bio_data; + pp = bp->bio_to; + vol = pp->private; + *val = 0; + for (i = 0; i < vol->v_disks_count; i++) { + sd = &vol->v_subdisks[i]; + if (sd->sd_state == G_RAID_SUBDISK_S_NONE) + continue; + if (sd->sd_disk->d_candelete) { + *val = 1; + break; + } + } + g_io_deliver(bp, 0); +} + +static void g_raid_start(struct bio *bp) { struct g_raid_softc *sc; @@ -1073,7 +1126,9 @@ g_raid_start(struct bio *bp) case BIO_FLUSH: break; case BIO_GETATTR: - if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) + g_raid_candelete(sc, bp); + else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_raid_kerneldump(sc, bp); else g_io_deliver(bp, EOPNOTSUPP); Modified: stable/9/sys/geom/raid/g_raid.h ============================================================================== --- stable/9/sys/geom/raid/g_raid.h Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/g_raid.h Thu Nov 29 18:08:36 2012 (r243678) @@ -153,6 +153,7 @@ struct g_raid_disk { struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ struct g_kerneldump d_kd; /* Kernel dumping method/args. */ + int d_candelete; /* BIO_DELETE supported. */ uint64_t d_flags; /* Additional flags. */ u_int d_state; /* Disk state. */ u_int d_load; /* Disk average load. */ @@ -418,6 +419,7 @@ struct g_raid_volume * g_raid_create_vol const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); const char * g_raid_get_diskname(struct g_raid_disk *disk); +void g_raid_get_disk_info(struct g_raid_disk *disk); int g_raid_start_volume(struct g_raid_volume *vol); Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_ddf.c Thu Nov 29 18:08:36 2012 (r243678) @@ -2087,7 +2087,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_object *mdi; struct g_geom *geom; - int error, result, len, be; + int error, result, be; char name[16]; G_RAID_DEBUG(1, "Tasting DDF on %s", cp->provider->name); @@ -2154,14 +2154,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_ddf_new_disk(disk); @@ -2348,15 +2341,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec ddf_meta_update(&mdi->mdio_meta, &pd->pd_meta); g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, GET64(&pd->pd_meta, @@ -2675,15 +2660,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_intel.c Thu Nov 29 18:08:36 2012 (r243678) @@ -1369,14 +1369,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_intel_new_disk(disk); @@ -1556,15 +1549,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); intel_set_disk_sectors(&pd->pd_disk_meta, pp->mediasize / pp->sectorsize); @@ -2080,15 +2065,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); Modified: stable/9/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/9/sys/geom/raid/md_jmicron.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_jmicron.c Thu Nov 29 18:08:36 2012 (r243678) @@ -826,7 +826,7 @@ g_raid_md_taste_jmicron(struct g_raid_md struct jmicron_raid_conf *meta; struct g_raid_md_jmicron_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[16]; uint16_t vendor; @@ -945,14 +945,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_jmicron_new_disk(disk); @@ -1115,15 +1108,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1374,15 +1359,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_jmicron_start_disk(disk); Modified: stable/9/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/9/sys/geom/raid/md_nvidia.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_nvidia.c Thu Nov 29 18:08:36 2012 (r243678) @@ -830,7 +830,7 @@ g_raid_md_taste_nvidia(struct g_raid_md_ struct nvidia_raid_conf *meta; struct g_raid_md_nvidia_perdisk *pd; struct g_geom *geom; - int error, result, spare, len; + int result, spare, len; char name[32]; uint16_t vendor; @@ -939,14 +939,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_nvidia_new_disk(disk); @@ -1117,15 +1110,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1377,15 +1362,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_nvidia_start_disk(disk); Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_promise.c Thu Nov 29 18:08:36 2012 (r243678) @@ -1046,7 +1046,7 @@ g_raid_md_taste_promise(struct g_raid_md struct promise_raid_conf *meta, *metaarr[4]; struct g_raid_md_promise_perdisk *pd; struct g_geom *geom; - int error, i, j, result, len, subdisks; + int i, j, result, len, subdisks; char name[16]; uint16_t vendor; @@ -1142,14 +1142,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_promise_new_disk(disk); @@ -1337,15 +1330,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, pp->mediasize - 131072llu * pp->sectorsize); @@ -1659,15 +1644,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/md_sii.c Thu Nov 29 18:08:36 2012 (r243678) @@ -912,7 +912,7 @@ g_raid_md_taste_sii(struct g_raid_md_obj struct sii_raid_conf *meta; struct g_raid_md_sii_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[32]; uint16_t vendor; @@ -1032,14 +1032,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_sii_new_disk(disk); @@ -1201,15 +1194,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1459,15 +1444,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_sii_start_disk(disk); Modified: stable/9/sys/geom/raid/tr_concat.c ============================================================================== --- stable/9/sys/geom/raid/tr_concat.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_concat.c Thu Nov 29 18:08:36 2012 (r243678) @@ -248,7 +248,8 @@ g_raid_tr_iostart_concat(struct g_raid_t cbp->bio_caller1 = sd; bioq_insert_tail(&queue, cbp); remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; offset = 0; no++; KASSERT(no < vol->v_disks_count || remain == 0, Modified: stable/9/sys/geom/raid/tr_raid0.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid0.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_raid0.c Thu Nov 29 18:08:36 2012 (r243678) @@ -234,7 +234,8 @@ g_raid_tr_iostart_raid0(struct g_raid_tr offset += strip_size; } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } while (remain > 0); for (cbp = bioq_first(&queue); cbp != NULL; Modified: stable/9/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_raid1.c Thu Nov 29 18:08:36 2012 (r243678) @@ -647,10 +647,8 @@ g_raid_tr_iostart_raid1(struct g_raid_tr g_raid_tr_iostart_raid1_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -896,7 +894,7 @@ rebuild_round_done: if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); } Modified: stable/9/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1e.c Thu Nov 29 17:41:19 2012 (r243677) +++ stable/9/sys/geom/raid/tr_raid1e.c Thu Nov 29 18:08:36 2012 (r243678) @@ -802,7 +802,8 @@ nextdisk: } } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } for (cbp = bioq_first(&queue); cbp != NULL; @@ -858,10 +859,8 @@ g_raid_tr_iostart_raid1e(struct g_raid_t g_raid_tr_iostart_raid1e_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1e_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1e_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -1122,7 +1121,7 @@ rebuild_round_done: if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 18:23: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 BA7A4F9; Thu, 29 Nov 2012 18:23:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CDB88FC08; Thu, 29 Nov 2012 18:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATINLW7033525; Thu, 29 Nov 2012 18:23:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATINLoJ033511; Thu, 29 Nov 2012 18:23:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211291823.qATINLoJ033511@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Nov 2012 18:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243679 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 18:23:22 -0000 Author: mav Date: Thu Nov 29 18:23:21 2012 New Revision: 243679 URL: http://svnweb.freebsd.org/changeset/base/243679 Log: MFC r242323, r242328: Add basic BIO_DELETE support to GEOM RAID class for all RAID levels. If at least one subdisk in the volume supports it, BIO_DELETE requests will be propagated down. Unfortunatelly, for RAID levels with redundancy unmapped blocks will be mapped back during first rebuild/resync process. Modified: stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/g_raid.h stable/8/sys/geom/raid/md_ddf.c stable/8/sys/geom/raid/md_intel.c stable/8/sys/geom/raid/md_jmicron.c stable/8/sys/geom/raid/md_nvidia.c stable/8/sys/geom/raid/md_promise.c stable/8/sys/geom/raid/md_sii.c stable/8/sys/geom/raid/tr_concat.c stable/8/sys/geom/raid/tr_raid0.c stable/8/sys/geom/raid/tr_raid1.c stable/8/sys/geom/raid/tr_raid1e.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/g_raid.c Thu Nov 29 18:23:21 2012 (r243679) @@ -496,6 +496,34 @@ g_raid_get_diskname(struct g_raid_disk * } void +g_raid_get_disk_info(struct g_raid_disk *disk) +{ + struct g_consumer *cp = disk->d_consumer; + int error, len; + + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + error = g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); + if (error) + disk->d_kd.di.dumper = NULL; + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG1(2, disk->d_softc, + "Dumping not supported by %s: %d.", + cp->provider->name, error); + + /* Read BIO_DELETE support. */ + error = g_getattr("GEOM::candelete", cp, &disk->d_candelete); + if (error) + disk->d_candelete = 0; + if (!disk->d_candelete) + G_RAID_DEBUG1(2, disk->d_softc, + "BIO_DELETE not supported by %s: %d.", + cp->provider->name, error); +} + +void g_raid_report_disk_state(struct g_raid_disk *disk) { struct g_raid_subdisk *sd; @@ -1049,6 +1077,31 @@ g_raid_kerneldump(struct g_raid_softc *s } static void +g_raid_candelete(struct g_raid_softc *sc, struct bio *bp) +{ + struct g_provider *pp; + struct g_raid_volume *vol; + struct g_raid_subdisk *sd; + int *val; + int i; + + val = (int *)bp->bio_data; + pp = bp->bio_to; + vol = pp->private; + *val = 0; + for (i = 0; i < vol->v_disks_count; i++) { + sd = &vol->v_subdisks[i]; + if (sd->sd_state == G_RAID_SUBDISK_S_NONE) + continue; + if (sd->sd_disk->d_candelete) { + *val = 1; + break; + } + } + g_io_deliver(bp, 0); +} + +static void g_raid_start(struct bio *bp) { struct g_raid_softc *sc; @@ -1070,7 +1123,9 @@ g_raid_start(struct bio *bp) case BIO_FLUSH: break; case BIO_GETATTR: - if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) + g_raid_candelete(sc, bp); + else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_raid_kerneldump(sc, bp); else g_io_deliver(bp, EOPNOTSUPP); Modified: stable/8/sys/geom/raid/g_raid.h ============================================================================== --- stable/8/sys/geom/raid/g_raid.h Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/g_raid.h Thu Nov 29 18:23:21 2012 (r243679) @@ -153,6 +153,7 @@ struct g_raid_disk { struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ struct g_kerneldump d_kd; /* Kernel dumping method/args. */ + int d_candelete; /* BIO_DELETE supported. */ uint64_t d_flags; /* Additional flags. */ u_int d_state; /* Disk state. */ u_int d_load; /* Disk average load. */ @@ -418,6 +419,7 @@ struct g_raid_volume * g_raid_create_vol const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); const char * g_raid_get_diskname(struct g_raid_disk *disk); +void g_raid_get_disk_info(struct g_raid_disk *disk); int g_raid_start_volume(struct g_raid_volume *vol); Modified: stable/8/sys/geom/raid/md_ddf.c ============================================================================== --- stable/8/sys/geom/raid/md_ddf.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/md_ddf.c Thu Nov 29 18:23:21 2012 (r243679) @@ -2087,7 +2087,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_object *mdi; struct g_geom *geom; - int error, result, len, be; + int error, result, be; char name[16]; G_RAID_DEBUG(1, "Tasting DDF on %s", cp->provider->name); @@ -2154,14 +2154,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_ddf_new_disk(disk); @@ -2348,15 +2341,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec ddf_meta_update(&mdi->mdio_meta, &pd->pd_meta); g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, GET64(&pd->pd_meta, @@ -2675,15 +2660,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/md_intel.c Thu Nov 29 18:23:21 2012 (r243679) @@ -1369,14 +1369,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_intel_new_disk(disk); @@ -1556,15 +1549,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); intel_set_disk_sectors(&pd->pd_disk_meta, pp->mediasize / pp->sectorsize); @@ -2080,15 +2065,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); Modified: stable/8/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/8/sys/geom/raid/md_jmicron.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/md_jmicron.c Thu Nov 29 18:23:21 2012 (r243679) @@ -826,7 +826,7 @@ g_raid_md_taste_jmicron(struct g_raid_md struct jmicron_raid_conf *meta; struct g_raid_md_jmicron_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[16]; uint16_t vendor; @@ -945,14 +945,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_jmicron_new_disk(disk); @@ -1115,15 +1108,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1374,15 +1359,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_jmicron_start_disk(disk); Modified: stable/8/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/8/sys/geom/raid/md_nvidia.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/md_nvidia.c Thu Nov 29 18:23:21 2012 (r243679) @@ -830,7 +830,7 @@ g_raid_md_taste_nvidia(struct g_raid_md_ struct nvidia_raid_conf *meta; struct g_raid_md_nvidia_perdisk *pd; struct g_geom *geom; - int error, result, spare, len; + int result, spare, len; char name[32]; uint16_t vendor; @@ -939,14 +939,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_nvidia_new_disk(disk); @@ -1117,15 +1110,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1377,15 +1362,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_nvidia_start_disk(disk); Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/md_promise.c Thu Nov 29 18:23:21 2012 (r243679) @@ -1046,7 +1046,7 @@ g_raid_md_taste_promise(struct g_raid_md struct promise_raid_conf *meta, *metaarr[4]; struct g_raid_md_promise_perdisk *pd; struct g_geom *geom; - int error, i, j, result, len, subdisks; + int i, j, result, len, subdisks; char name[16]; uint16_t vendor; @@ -1142,14 +1142,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_promise_new_disk(disk); @@ -1337,15 +1330,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, pp->mediasize - 131072llu * pp->sectorsize); @@ -1659,15 +1644,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: stable/8/sys/geom/raid/md_sii.c ============================================================================== --- stable/8/sys/geom/raid/md_sii.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/md_sii.c Thu Nov 29 18:23:21 2012 (r243679) @@ -912,7 +912,7 @@ g_raid_md_taste_sii(struct g_raid_md_obj struct sii_raid_conf *meta; struct g_raid_md_sii_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[32]; uint16_t vendor; @@ -1032,14 +1032,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_sii_new_disk(disk); @@ -1201,15 +1194,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1459,15 +1444,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_sii_start_disk(disk); Modified: stable/8/sys/geom/raid/tr_concat.c ============================================================================== --- stable/8/sys/geom/raid/tr_concat.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/tr_concat.c Thu Nov 29 18:23:21 2012 (r243679) @@ -248,7 +248,8 @@ g_raid_tr_iostart_concat(struct g_raid_t cbp->bio_caller1 = sd; bioq_insert_tail(&queue, cbp); remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; offset = 0; no++; KASSERT(no < vol->v_disks_count || remain == 0, Modified: stable/8/sys/geom/raid/tr_raid0.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid0.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/tr_raid0.c Thu Nov 29 18:23:21 2012 (r243679) @@ -234,7 +234,8 @@ g_raid_tr_iostart_raid0(struct g_raid_tr offset += strip_size; } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } while (remain > 0); for (cbp = bioq_first(&queue); cbp != NULL; Modified: stable/8/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/tr_raid1.c Thu Nov 29 18:23:21 2012 (r243679) @@ -647,10 +647,8 @@ g_raid_tr_iostart_raid1(struct g_raid_tr g_raid_tr_iostart_raid1_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -896,7 +894,7 @@ rebuild_round_done: if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); } Modified: stable/8/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1e.c Thu Nov 29 18:08:36 2012 (r243678) +++ stable/8/sys/geom/raid/tr_raid1e.c Thu Nov 29 18:23:21 2012 (r243679) @@ -802,7 +802,8 @@ nextdisk: } } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } for (cbp = bioq_first(&queue); cbp != NULL; @@ -858,10 +859,8 @@ g_raid_tr_iostart_raid1e(struct g_raid_t g_raid_tr_iostart_raid1e_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1e_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1e_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -1122,7 +1121,7 @@ rebuild_round_done: if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 19:10: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 6BA21AC1; Thu, 29 Nov 2012 19:10:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50FF98FC17; Thu, 29 Nov 2012 19:10:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATJA5nI039954; Thu, 29 Nov 2012 19:10:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATJA58C039951; Thu, 29 Nov 2012 19:10:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211291910.qATJA58C039951@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 29 Nov 2012 19:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243680 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 19:10:05 -0000 Author: np Date: Thu Nov 29 19:10:04 2012 New Revision: 243680 URL: http://svnweb.freebsd.org/changeset/base/243680 Log: cxgbe/tom: Add a flag to indicate that the L2 table entry for an embryonic connection has been setup and never attempt to abort a tid before this is done. This fixes a bad race where a listening socket is closed when the driver is in the middle of step (b) here. The symptom of this were "ARP miss" errors from the driver followed by tid leaks. A hardware-offloaded passive open works this way: a) A SYN "hits" the TCAM entry for a server tid and the chip delivers it to the queue associated with the server tid (say, queue A). It waits for a response from the driver telling it what to do. b) The driver decides it is ok to proceed. It adds the new tid to the list of embryonic connections associated with the server tid and then hands off the SYN to the kernel's syncache to make sure that the kernel okays it too. If it does then the driver provides an L2 table entry, queue id (say, queue B), etc. and instructs the chip to send the SYN/ACK response. c) The chip delivers a status to queue B depending on how the third step of the 3-way handshake goes. The driver removes the tid from its list of embryonic connections and either expands the syncache entry or destroys the tid. In any case all subsequent messages for the new tid will be delivered to queue B, not queue A. Anything running in queue B knows that the L2 entry has long been setup and the new flag is of no interest from here on. If the listener is closed it will deal with so_comp as normal. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 29 18:23:21 2012 (r243679) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 29 19:10:04 2012 (r243680) @@ -786,6 +786,29 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(opcode == CPL_PEER_CLOSE, ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); + + if (__predict_false(toep->flags & TPF_SYNQE)) { +#ifdef INVARIANTS + struct synq_entry *synqe = (void *)toep; + + INP_WLOCK(synqe->lctx->inp); + if (synqe->flags & TPF_SYNQE_HAS_L2TE) { + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, + ("%s: listen socket closed but tid %u not aborted.", + __func__, tid)); + } else { + /* + * do_pass_accept_req is still running and will + * eventually take care of this tid. + */ + } + INP_WUNLOCK(synqe->lctx->inp); +#endif + CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, + toep, toep->flags); + return (0); + } + KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); INP_INFO_WLOCK(&V_tcbinfo); @@ -1092,13 +1115,24 @@ do_rx_data(struct sge_iq *iq, const stru int len; if (__predict_false(toep->flags & TPF_SYNQE)) { - /* - * do_pass_establish failed and must be attempting to abort the - * synqe's tid. Meanwhile, the T4 has sent us data for such a - * connection. - */ - KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, - ("%s: synqe and tid isn't being aborted.", __func__)); +#ifdef INVARIANTS + struct synq_entry *synqe = (void *)toep; + + INP_WLOCK(synqe->lctx->inp); + if (synqe->flags & TPF_SYNQE_HAS_L2TE) { + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, + ("%s: listen socket closed but tid %u not aborted.", + __func__, tid)); + } else { + /* + * do_pass_accept_req is still running and will + * eventually take care of this tid. + */ + } + INP_WUNLOCK(synqe->lctx->inp); +#endif + CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, + toep, toep->flags); m_freem(m); return (0); } Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 29 18:23:21 2012 (r243679) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 29 19:10:04 2012 (r243680) @@ -282,8 +282,8 @@ send_reset_synqe(struct toedev *tod, str INP_WLOCK_ASSERT(synqe->lctx->inp); - CTR4(KTR_CXGBE, "%s: synqe %p, tid %d%s", - __func__, synqe, synqe->tid, + CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s", + __func__, synqe, synqe->flags, synqe->tid, synqe->flags & TPF_ABORT_SHUTDOWN ? " (abort already in progress)" : ""); if (synqe->flags & TPF_ABORT_SHUTDOWN) @@ -501,8 +501,10 @@ t4_listen_stop(struct toedev *tod, struc * socket's so_comp. It doesn't know about the connections on the synq * so we need to take care of those. */ - TAILQ_FOREACH(synqe, &lctx->synq, link) - send_reset_synqe(tod, synqe); + TAILQ_FOREACH(synqe, &lctx->synq, link) { + if (synqe->flags & TPF_SYNQE_HAS_L2TE) + send_reset_synqe(tod, synqe); + } destroy_server(sc, lctx); return (0); @@ -1131,8 +1133,7 @@ do_pass_accept_req(struct sge_iq *iq, co synqe->lctx = lctx; synqe->syn = m; m = NULL; - refcount_init(&synqe->refcnt, 1); /* 1 so that it is held for the - duration of this function */ + refcount_init(&synqe->refcnt, 0); synqe->l2e_idx = e->idx; synqe->rcv_bufsize = rx_credits; atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); @@ -1155,46 +1156,9 @@ do_pass_accept_req(struct sge_iq *iq, co * If we replied during syncache_add (synqe->wr has been consumed), * good. Otherwise, set it to 0 so that further syncache_respond * attempts by the kernel will be ignored. - * - * The extra hold on the synqe makes sure that it is still around, even - * if the listener has been dropped and the synqe was aborted and the - * reply to the abort has removed and released the synqe from the synq - * list. */ if (atomic_cmpset_ptr(&synqe->wr, (uintptr_t)wr, 0)) { - INP_WLOCK(inp); - if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* listener closed. synqe must have been aborted. */ - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listener %p closed but synqe %p not aborted", - __func__, inp, synqe)); - - CTR5(KTR_CXGBE, - "%s: stid %u, tid %u, lctx %p, synqe %p, ABORTED", - __func__, stid, tid, lctx, synqe); - INP_WUNLOCK(inp); - free(wr, M_CXGBE); - release_synqe(synqe); /* about to exit function */ - return (__LINE__); - } - - /* - * synqe aborted before TOM replied to PASS_ACCEPT_REQ. But - * that can only happen if the listener was closed and we just - * checked for that. - */ - KASSERT(!(synqe->flags & TPF_ABORT_SHUTDOWN), - ("%s: synqe %p aborted, but listener %p not dropped.", - __func__, synqe, inp)); - - /* Yank the synqe out of the lctx synq. */ - TAILQ_REMOVE(&lctx->synq, synqe, link); - release_synqe(synqe); /* removed from synq list */ - inp = release_lctx(sc, lctx); - if (inp) - INP_WUNLOCK(inp); - /* * syncache may or may not have a hold on the synqe, which may * or may not be stashed in the original SYN mbuf passed to us. @@ -1205,13 +1169,39 @@ do_pass_accept_req(struct sge_iq *iq, co m->m_pkthdr.rcvif = ifp; remove_tid(sc, synqe->tid); - release_synqe(synqe); /* about to exit function */ free(wr, M_CXGBE); + + /* Yank the synqe out of the lctx synq. */ + INP_WLOCK(inp); + TAILQ_REMOVE(&lctx->synq, synqe, link); + release_synqe(synqe); /* removed from synq list */ + inp = release_lctx(sc, lctx); + if (inp) + INP_WUNLOCK(inp); + REJECT_PASS_ACCEPT(); } - release_synqe(synqe); /* about to exit function */ + CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK", __func__, stid, tid, lctx, synqe); + + INP_WLOCK(inp); + synqe->flags |= TPF_SYNQE_HAS_L2TE; + if (__predict_false(inp->inp_flags & INP_DROPPED)) { + /* + * Listening socket closed but tod_listen_stop did not abort + * this tid because there was no L2T entry for the tid at that + * time. Abort it now. The reply to the abort will clean up. + */ + CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, ABORT", + __func__, stid, tid, lctx, synqe); + send_reset_synqe(tod, synqe); + INP_WUNLOCK(inp); + + return (__LINE__); + } + INP_WUNLOCK(inp); + return (0); reject: CTR4(KTR_CXGBE, "%s: stid %u, tid %u, REJECT (%d)", __func__, stid, tid, @@ -1293,15 +1283,12 @@ do_pass_establish(struct sge_iq *iq, con __func__, stid, tid, synqe, synqe->flags, inp->inp_flags); if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* - * The listening socket has closed. The TOM must have aborted - * all the embryonic connections (including this one) that were - * on the lctx's synq. do_abort_rpl for the tid is responsible - * for cleaning up. - */ - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket dropped but tid %u not aborted.", - __func__, tid)); + + if (synqe->flags & TPF_SYNQE_HAS_L2TE) { + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, + ("%s: listen socket closed but tid %u not aborted.", + __func__, tid)); + } INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -1321,7 +1308,12 @@ do_pass_establish(struct sge_iq *iq, con toep = alloc_toepcb(pi, txqid, rxqid, M_NOWAIT); if (toep == NULL) { reset: - /* The reply to this abort will perform final cleanup */ + /* + * The reply to this abort will perform final cleanup. There is + * no need to check for HAS_L2TE here. We can be here only if + * we responded to the PASS_ACCEPT_REQ, and our response had the + * L2T idx. + */ send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 29 18:23:21 2012 (r243679) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 29 19:10:04 2012 (r243680) @@ -67,6 +67,7 @@ enum { TPF_SYNQE_NEEDFREE = (1 << 9), /* synq_entry was malloc'd separately */ TPF_SYNQE_TCPDDP = (1 << 10), /* ulp_mode TCPDDP in toepcb */ TPF_SYNQE_EXPANDED = (1 << 11), /* toepcb ready, tid context updated */ + TPF_SYNQE_HAS_L2TE = (1 << 12), /* we've replied to PASS_ACCEPT_REQ */ }; enum { From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 19:39:28 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 0E30056A; Thu, 29 Nov 2012 19:39:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E83938FC17; Thu, 29 Nov 2012 19:39:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATJdRtk043962; Thu, 29 Nov 2012 19:39:27 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATJdR2v043959; Thu, 29 Nov 2012 19:39:27 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211291939.qATJdR2v043959@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 29 Nov 2012 19:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243681 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 19:39:28 -0000 Author: np Date: Thu Nov 29 19:39:27 2012 New Revision: 243681 URL: http://svnweb.freebsd.org/changeset/base/243681 Log: cxgbe/tom: Handle the case where the chip falls out of DDP mode by itself. The hole in the receive sequence space corresponds to the number of bytes placed directly up to that point. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 29 19:10:04 2012 (r243680) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 29 19:39:27 2012 (r243681) @@ -1113,6 +1113,7 @@ do_rx_data(struct sge_iq *iq, const stru struct socket *so; struct sockbuf *sb; int len; + uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { #ifdef INVARIANTS @@ -1154,13 +1155,8 @@ do_rx_data(struct sge_iq *iq, const stru tp = intotcpcb(inp); -#ifdef INVARIANTS - if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq))) { - log(LOG_ERR, - "%s: unexpected seq# %x for TID %u, rcv_nxt %x\n", - __func__, be32toh(cpl->seq), toep->tid, tp->rcv_nxt); - } -#endif + if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq))) + ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt; tp->rcv_nxt += len; KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); @@ -1207,12 +1203,20 @@ do_rx_data(struct sge_iq *iq, const stru int changed = !(toep->ddp_flags & DDP_ON) ^ cpl->ddp_off; if (changed) { - if (__predict_false(!(toep->ddp_flags & DDP_SC_REQ))) { - /* XXX: handle this if legitimate */ - panic("%s: unexpected DDP state change %d", - __func__, cpl->ddp_off); + if (toep->ddp_flags & DDP_SC_REQ) + toep->ddp_flags ^= DDP_ON | DDP_SC_REQ; + else { + KASSERT(cpl->ddp_off == 1, + ("%s: DDP switched on by itself.", + __func__)); + + /* Fell out of DDP mode */ + toep->ddp_flags &= ~(DDP_ON | DDP_BUF0_ACTIVE | + DDP_BUF1_ACTIVE); + + if (ddp_placed) + insert_ddp_data(toep, ddp_placed); } - toep->ddp_flags ^= DDP_ON | DDP_SC_REQ; } if ((toep->ddp_flags & DDP_OK) == 0 && Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Thu Nov 29 19:10:04 2012 (r243680) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Thu Nov 29 19:39:27 2012 (r243681) @@ -205,6 +205,42 @@ release_ddp_resources(struct toepcb *toe } } +/* XXX: handle_ddp_data code duplication */ +void +insert_ddp_data(struct toepcb *toep, uint32_t n) +{ + struct inpcb *inp = toep->inp; + struct tcpcb *tp = intotcpcb(inp); + struct sockbuf *sb = &inp->inp_socket->so_rcv; + struct mbuf *m; + + INP_WLOCK_ASSERT(inp); + SOCKBUF_LOCK_ASSERT(sb); + + m = m_get(M_NOWAIT, MT_DATA); + if (m == NULL) + CXGBE_UNIMPLEMENTED("mbuf alloc failure"); + m->m_len = n; + m->m_flags |= M_DDP; /* Data is already where it should be */ + m->m_data = "nothing to see here"; + + tp->rcv_nxt += n; +#ifndef USE_DDP_RX_FLOW_CONTROL + KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); + tp->rcv_wnd -= n; +#endif + + KASSERT(toep->sb_cc >= sb->sb_cc, + ("%s: sb %p has more data (%d) than last time (%d).", + __func__, sb, sb->sb_cc, toep->sb_cc)); + toep->rx_credits += toep->sb_cc - sb->sb_cc; +#ifdef USE_DDP_RX_FLOW_CONTROL + toep->rx_credits -= n; /* adjust for F_RX_FC_DDP */ +#endif + sbappendstream_locked(sb, m); + toep->sb_cc = sb->sb_cc; +} + /* SET_TCB_FIELD sent as a ULP command looks like this */ #define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 29 19:10:04 2012 (r243680) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 29 19:39:27 2012 (r243681) @@ -273,4 +273,5 @@ int t4_soreceive_ddp(struct socket *, st struct mbuf **, struct mbuf **, int *); void enable_ddp(struct adapter *, struct toepcb *toep); void release_ddp_resources(struct toepcb *toep); +void insert_ddp_data(struct toepcb *, uint32_t); #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 20:57:38 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 CB4AE8F9; Thu, 29 Nov 2012 20:57:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2096D8FC0C; Thu, 29 Nov 2012 20:57:37 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qATKvTGk009937; Thu, 29 Nov 2012 22:57:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qATKvTGk009937 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qATKvTrt009936; Thu, 29 Nov 2012 22:57:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2012 22:57:29 +0200 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129205729.GN3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> <20121129162412.GD29338@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s33OSBZCP+C8M/FY" Content-Disposition: inline In-Reply-To: <20121129162412.GD29338@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 20:57:38 -0000 --s33OSBZCP+C8M/FY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 05:24:12PM +0100, Jilles Tjoelker wrote: > On Thu, Nov 29, 2012 at 02:01:47PM +0200, Konstantin Belousov wrote: > > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: > > > Author: eadler > > > Date: Thu Nov 29 05:16:50 2012 > > > New Revision: 243665 > > > URL: http://svnweb.freebsd.org/changeset/base/243665 >=20 > > > Log: > > > Mark non-returning function as such >=20 > > > PR: bin/172978 > > > Approved by: cperciva > > > MFC after: 3 days >=20 > > > Modified: > > > head/sbin/dump/dump.h >=20 > > > Modified: head/sbin/dump/dump.h > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) > > > +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) > > > @@ -121,7 +121,7 @@ void trewind(void); > > > void writerec(char *dp, int isspcl); > > > =20 > > > void Exit(int status) __dead2; > > > -void dumpabort(int signo); > > > +void dumpabort(int signo) __dead2; > > > void dump_getfstab(void); > > > =20 > > > char *rawname(char *cp); >=20 > > What is the goal of this change ? >=20 > This has been discussed before in > http://lists.freebsd.org/pipermail/freebsd-current/2011-January/022179.ht= ml > and the rest of the thread. The result there seems that it is the least > bad thing to add __dead2 even on static functions that do not return to > reduce compiler/analyzer warnings and improve the generated code with > GCC 4.2.1 and GCC 4.5. But we are already in the shiny new world ? We should not care about so antique and unsupported compilers any more ? Or, at least, the commit message should have said that we do. I suppose that the worry about slightly unefficient code in the dump(8) wou= ld be good April 1 subject. >=20 > > It is arguably backward. There is absolutely no use to mark signal > > handler as __dead2, and all other uses do not benefit from the > > redundand declaration. >=20 > Although most of the uses of dumpabort() are in the same file as its > definition, GCC 4.2.1 is too dumb to detect its noreturn property > automatically. >=20 > Furthermore, some of the uses are in separate files. In particular, > __dead2 on dumpabort() is required to mark or detect quit() as noreturn. >=20 > > Also, being quite removed from the function definition, there is a > > chance that some future modification would make the attribute a lie. >=20 > Both GCC and Clang generate a warning by default if it appears possible > for a noreturn function to return, so as long as -Werror remains enabled > it should be safe enough. The annotation is very much like comment which rephrase the code and thus is useless. But in this case, the attribute annotation does has a chance of changing the compiler behaviour. IMO, such changes shall not be done, and the already accumulated nonsense needs to be reverted. --s33OSBZCP+C8M/FY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQt8w4AAoJEJDCuSvBvK1B1gwQAJ0ILgnDl6p7NFlMZJX9Dsg0 Je71RR6hibh8InvO6QSfKkj+QFNIAmjFDAaFrw9YsK1cGCHmN87F8DUncdDyxm/p ZClOsiBErb6eAh6lBXLFpde0FHyEpVZgC0lw1e2+3WPoj3dd2mCIQuYvnC0Afg3d vbENP2A4n+5Ttra6SgwmCueayWxw24IQE1uE1u+JETxkdqpeyW6iP6cpYFN4ueuJ MNglJ9lDhRa6Q3aekAS6ktx6Na5Ac0QC0yRNnz1WWhF/1kecL8y3kOqe29Gqsepo Rmr6tLkv+FhASybLC3AB1HIY8nunihnZ/x7QFHuTzqc+7B93bCWWBeOBNDulniVL ERx/k+x2SjzJyeZHR1Y6jZd63+aH5KfKGVZNSfRdWzueTdLsP9OW02emy06PoG7O 32pPmsy945/bTdLHqAh3caTW/QJ5IIdj1RVJ7TGqXYyhsOxik3LbDMzEDCQLPT6g vOqSXtyxGAGZpJXk1VLbMr0WYGtN/gPX7FIIviX6i7RgH8qcLH943ILZ5j4fR43+ bO2JWVTYJvUndkxwDmnXaqiltB8SfLH77K+yxejcCIQzmer4A8U6PwLe/SUOJj5q bcgbAa1UcnRFLs8h7eYh6gIo8WtIDLy0LcTu4OfJ/E/8c/R4GfifNKkBRiu0uyRN cHmu3THybrHfyZd8OUS4 =05Qe -----END PGP SIGNATURE----- --s33OSBZCP+C8M/FY-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 20:58:20 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 3E247A83; Thu, 29 Nov 2012 20:58:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 96ED68FC16; Thu, 29 Nov 2012 20:58:19 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qATKwG9C009949; Thu, 29 Nov 2012 22:58:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qATKwG9C009949 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qATKwGLj009948; Thu, 29 Nov 2012 22:58:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2012 22:58:16 +0200 From: Konstantin Belousov To: Eitan Adler Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129205816.GO3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> <20121129130449.GH3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9ZRxqsK4bBEmgNeO" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 20:58:20 -0000 --9ZRxqsK4bBEmgNeO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 10:15:54AM -0500, Eitan Adler wrote: > On 29 November 2012 08:04, Konstantin Belousov wrot= e: > >> It fixes some static analyzer warnings. > > This cannot be a reason to cripple the code. >=20 > How is the code crippled? I described it in the part of the first message, which you stripped. --9ZRxqsK4bBEmgNeO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQt8xmAAoJEJDCuSvBvK1ByKoP/iydkwHdl7nOlWcoQOpQnnEF qVY2OE5XzVVr935ojF/3b7KL9W91n1T7mMb4dnK+ZtEc8g4aFlQxCPe+FgxT3Rfd 7wQ8SQ/PILwwk1ttpWv1nHDwo40T3sNAgBdgwQi/LFte4PABERbkXOGiSFTIHSZ4 PuyMitfB4c4l/DDwfVOKFupRikTlvU5V8ArZ/muXJ4yb6MOYFtn8U35WrKISHyVC AcZIQGQmyKnWTx9bXf8T3VwAivQ50lRG5apZwp2X7uQcPzZ3nTunrfqNzBHUHjKu oTtIecbLT96XAduEbrvdH63BKxYc+CZwT9D8+QBnPCfD+HH92D13veokjDfeia0b 7dy3xb7SBHDeyjmknUY4E8WJshNzwnrW1r8DBu1wwU7ql0KzFqTPR29CkVIiIC/l ef0oboOXmov41gtqF1mZzRreJ+Wivx9YiLQLCxr77uCYX8wmL48jmZi+ooATzuSo 1JbdEnZPMbLPsGiVhfOaXOI/UQEQBefNWBYbs6Qs9GulHiP0z/pHjg/YLM2qTupL 944X8kcoNSODR8StMw0THP29vH4BRgv1t4mKBG35siZxjc3ubNv6fnRrxNFeTUuB mq1ijMeCieTlGOtCkI5LPoX5Tz+eBPt9lZ0byjtGIar+J7YgC1qusNhDeJEoMbPY U2XVV2aeXSRcl7wbt/o/ =97vL -----END PGP SIGNATURE----- --9ZRxqsK4bBEmgNeO-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 21:26: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 A4110F1; Thu, 29 Nov 2012 21:26:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 867978FC0C; Thu, 29 Nov 2012 21:26:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qATLQw90058791; Thu, 29 Nov 2012 21:26:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qATLQvdm058769; Thu, 29 Nov 2012 21:26:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211292126.qATLQvdm058769@svn.freebsd.org> From: Dimitry Andric Date: Thu, 29 Nov 2012 21:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243683 - in stable/9/contrib/libc++: include include/ext src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 21:26:58 -0000 Author: dim Date: Thu Nov 29 21:26:57 2012 New Revision: 243683 URL: http://svnweb.freebsd.org/changeset/base/243683 Log: MFC r242945 (by theraven): Import new version of libc++ into base. Modified: stable/9/contrib/libc++/include/__config stable/9/contrib/libc++/include/__functional_base stable/9/contrib/libc++/include/__functional_base_03 stable/9/contrib/libc++/include/__locale stable/9/contrib/libc++/include/__mutex_base stable/9/contrib/libc++/include/algorithm stable/9/contrib/libc++/include/cmath stable/9/contrib/libc++/include/complex stable/9/contrib/libc++/include/condition_variable stable/9/contrib/libc++/include/cstddef stable/9/contrib/libc++/include/ext/__hash stable/9/contrib/libc++/include/future stable/9/contrib/libc++/include/ios stable/9/contrib/libc++/include/istream stable/9/contrib/libc++/include/iterator stable/9/contrib/libc++/include/locale stable/9/contrib/libc++/include/memory stable/9/contrib/libc++/include/ostream stable/9/contrib/libc++/include/random stable/9/contrib/libc++/include/streambuf stable/9/contrib/libc++/include/string stable/9/contrib/libc++/include/system_error stable/9/contrib/libc++/include/tuple stable/9/contrib/libc++/include/type_traits stable/9/contrib/libc++/include/utility stable/9/contrib/libc++/include/valarray stable/9/contrib/libc++/include/vector stable/9/contrib/libc++/src/memory.cpp Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/9/contrib/libc++/include/__config ============================================================================== --- stable/9/contrib/libc++/include/__config Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__config Thu Nov 29 21:26:57 2012 (r243683) @@ -415,11 +415,11 @@ template struct __static_asse #endif #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum _ +#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ - _ __v_; \ - _LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \ - _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \ + __lx __v_; \ + _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ + _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS @@ -427,6 +427,10 @@ template struct __static_asse #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_HAS_NO_STRONG_ENUMS +#ifndef _LIBCPP_EXTERN_TEMPLATE +#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; +#endif + #if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__ #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif Modified: stable/9/contrib/libc++/include/__functional_base ============================================================================== --- stable/9/contrib/libc++/include/__functional_base Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__functional_base Thu Nov 29 21:26:57 2012 (r243683) @@ -43,7 +43,7 @@ template struct __has_result_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::result_type* = 0); public: @@ -69,7 +69,7 @@ template struct __derives_from_unary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static unary_function<_Ap, _Rp> @@ -83,7 +83,7 @@ template struct __derives_from_binary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static binary_function<_A1, _A2, _Rp> Modified: stable/9/contrib/libc++/include/__functional_base_03 ============================================================================== --- stable/9/contrib/libc++/include/__functional_base_03 Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__functional_base_03 Thu Nov 29 21:26:57 2012 (r243683) @@ -19,7 +19,7 @@ template struct __derives_from_unary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static unary_function<_Ap, _Rp> @@ -33,7 +33,7 @@ template struct __derives_from_binary_function { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; static __two __test(...); template static binary_function<_A1, _A2, _Rp> @@ -943,7 +943,7 @@ template struct __has_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::type* = 0); public: Modified: stable/9/contrib/libc++/include/__locale ============================================================================== --- stable/9/contrib/libc++/include/__locale Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__locale Thu Nov 29 21:26:57 2012 (r243683) @@ -254,8 +254,8 @@ collate<_CharT>::do_hash(const char_type return static_cast(__h); } -extern template class _LIBCPP_VISIBLE collate; -extern template class _LIBCPP_VISIBLE collate; +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate) +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate) // template class collate_byname; @@ -1135,10 +1135,10 @@ codecvt_byname<_InternT, _ExternT, _Stat { } -extern template class codecvt_byname; -extern template class codecvt_byname; -extern template class codecvt_byname; -extern template class codecvt_byname; +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) _LIBCPP_VISIBLE void __throw_runtime_error(const char*); Modified: stable/9/contrib/libc++/include/__mutex_base ============================================================================== --- stable/9/contrib/libc++/include/__mutex_base Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/__mutex_base Thu Nov 29 21:26:57 2012 (r243683) @@ -287,14 +287,14 @@ swap(unique_lock<_Mutex>& __x, unique_lo struct _LIBCPP_VISIBLE cv_status { - enum _ { + enum __lx { no_timeout, timeout }; - _ __v_; + __lx __v_; - _LIBCPP_INLINE_VISIBILITY cv_status(_ __v) : __v_(__v) {} + _LIBCPP_INLINE_VISIBILITY cv_status(__lx __v) : __v_(__v) {} _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} }; Modified: stable/9/contrib/libc++/include/algorithm ============================================================================== --- stable/9/contrib/libc++/include/algorithm Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/algorithm Thu Nov 29 21:26:57 2012 (r243683) @@ -3782,39 +3782,39 @@ sort(__wrap_iter<_Tp*> __first, __wrap_i #pragma warning( push ) #pragma warning( disable: 4231) #endif // _MSC_VER -extern template void __sort<__less&, char*>(char*, char*, __less&); -extern template void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&); -extern template void __sort<__less&, signed char*>(signed char*, signed char*, __less&); -extern template void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&); -extern template void __sort<__less&, short*>(short*, short*, __less&); -extern template void __sort<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&); -extern template void __sort<__less&, int*>(int*, int*, __less&); -extern template void __sort<__less&, unsigned*>(unsigned*, unsigned*, __less&); -extern template void __sort<__less&, long*>(long*, long*, __less&); -extern template void __sort<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&); -extern template void __sort<__less&, long long*>(long long*, long long*, __less&); -extern template void __sort<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&); -extern template void __sort<__less&, float*>(float*, float*, __less&); -extern template void __sort<__less&, double*>(double*, double*, __less&); -extern template void __sort<__less&, long double*>(long double*, long double*, __less&); - -extern template bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&); -extern template bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&); -extern template bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&); -extern template bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&); -extern template bool __insertion_sort_incomplete<__less&, int*>(int*, int*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned*>(unsigned*, unsigned*, __less&); -extern template bool __insertion_sort_incomplete<__less&, long*>(long*, long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, long long*>(long long*, long long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&); -extern template bool __insertion_sort_incomplete<__less&, float*>(float*, float*, __less&); -extern template bool __insertion_sort_incomplete<__less&, double*>(double*, double*, __less&); -extern template bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&); +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, char*>(char*, char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, signed char*>(signed char*, signed char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, short*>(short*, short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, int*>(int*, int*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned*>(unsigned*, unsigned*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, long*>(long*, long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, long long*>(long long*, long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, float*>(float*, float*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, double*>(double*, double*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, long double*>(long double*, long double*, __less&)) + +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, int*>(int*, int*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned*>(unsigned*, unsigned*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long*>(long*, long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long long*>(long long*, long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, float*>(float*, float*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, double*>(double*, double*, __less&)) +_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&)) -extern template unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&); +_LIBCPP_EXTERN_TEMPLATE(unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&)) #ifdef _MSC_VER #pragma warning( pop ) #endif // _MSC_VER Modified: stable/9/contrib/libc++/include/cmath ============================================================================== --- stable/9/contrib/libc++/include/cmath Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/cmath Thu Nov 29 21:26:57 2012 (r243683) @@ -1202,7 +1202,9 @@ fdim(_A1 __x, _A2 __y) _NOEXCEPT // fma inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);} +#ifndef FP_FAST_FMAF #define FP_FAST_FMAF +#endif using ::fma; Modified: stable/9/contrib/libc++/include/complex ============================================================================== --- stable/9/contrib/libc++/include/complex Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/complex Thu Nov 29 21:26:57 2012 (r243683) @@ -1249,10 +1249,12 @@ acosh(const complex<_Tp>& __x) if (isnan(__x.imag())) return complex<_Tp>(abs(__x.real()), __x.imag()); if (isinf(__x.imag())) + { if (__x.real() > 0) return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag())); else return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag())); + } if (__x.real() < 0) return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag())); return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag())); Modified: stable/9/contrib/libc++/include/condition_variable ============================================================================== --- stable/9/contrib/libc++/include/condition_variable Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/condition_variable Thu Nov 29 21:26:57 2012 (r243683) @@ -163,7 +163,7 @@ inline _LIBCPP_INLINE_VISIBILITY void condition_variable_any::notify_one() _NOEXCEPT { - {lock_guard _(*__mut_);} + {lock_guard __lx(*__mut_);} __cv_.notify_one(); } @@ -171,7 +171,7 @@ inline _LIBCPP_INLINE_VISIBILITY void condition_variable_any::notify_all() _NOEXCEPT { - {lock_guard _(*__mut_);} + {lock_guard __lx(*__mut_);} __cv_.notify_all(); } @@ -188,8 +188,8 @@ condition_variable_any::wait(_Lock& __lo shared_ptr __mut = __mut_; unique_lock __lk(*__mut); __lock.unlock(); - unique_ptr<_Lock, __lock_external> __(&__lock); - lock_guard > _(__lk, adopt_lock); + unique_ptr<_Lock, __lock_external> __lxx(&__lock); + lock_guard > __lx(__lk, adopt_lock); __cv_.wait(__lk); } // __mut_.unlock(), __lock.lock() @@ -210,8 +210,8 @@ condition_variable_any::wait_until(_Lock shared_ptr __mut = __mut_; unique_lock __lk(*__mut); __lock.unlock(); - unique_ptr<_Lock, __lock_external> __(&__lock); - lock_guard > _(__lk, adopt_lock); + unique_ptr<_Lock, __lock_external> __lxx(&__lock); + lock_guard > __lx(__lk, adopt_lock); return __cv_.wait_until(__lk, __t); } // __mut_.unlock(), __lock.lock() Modified: stable/9/contrib/libc++/include/cstddef ============================================================================== --- stable/9/contrib/libc++/include/cstddef Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/cstddef Thu Nov 29 21:26:57 2012 (r243683) @@ -58,12 +58,12 @@ typedef long double max_align_t; struct _LIBCPP_VISIBLE nullptr_t { - void* _; + void* __lx; struct __nat {int __for_bool_;}; - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : _(0) {} - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : _(0) {} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {} _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} Modified: stable/9/contrib/libc++/include/ext/__hash ============================================================================== --- stable/9/contrib/libc++/include/ext/__hash Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/ext/__hash Thu Nov 29 21:26:57 2012 (r243683) @@ -43,4 +43,4 @@ template <> struct _LIBCPP_VISIBLE hash< }; } -#endif _LIBCPP_EXT_HASH +#endif // _LIBCPP_EXT_HASH Modified: stable/9/contrib/libc++/include/future ============================================================================== --- stable/9/contrib/libc++/include/future Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/future Thu Nov 29 21:26:57 2012 (r243683) @@ -391,7 +391,7 @@ struct _LIBCPP_VISIBLE is_error_code_enu #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS template <> -struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; +struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; #endif //enum class launch Modified: stable/9/contrib/libc++/include/ios ============================================================================== --- stable/9/contrib/libc++/include/ios Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/ios Thu Nov 29 21:26:57 2012 (r243683) @@ -384,7 +384,7 @@ struct _LIBCPP_VISIBLE is_error_code_enu #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS template <> -struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; +struct _LIBCPP_VISIBLE is_error_code_enum : public true_type { }; #endif _LIBCPP_VISIBLE Modified: stable/9/contrib/libc++/include/istream ============================================================================== --- stable/9/contrib/libc++/include/istream Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/istream Thu Nov 29 21:26:57 2012 (r243683) @@ -1189,7 +1189,11 @@ basic_istream<_CharT, _Traits>::peek() #endif // _LIBCPP_NO_EXCEPTIONS sentry __sen(*this, true); if (__sen) + { __r = this->rdbuf()->sgetc(); + if (traits_type::eq_int_type(__r, traits_type::eof())) + this->setstate(ios_base::eofbit); + } #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) @@ -1706,9 +1710,9 @@ operator>>(basic_istream<_CharT, _Traits return __is; } -extern template class basic_istream; -extern template class basic_istream; -extern template class basic_iostream; +_LIBCPP_EXTERN_TEMPLATE(class basic_istream) +_LIBCPP_EXTERN_TEMPLATE(class basic_istream) +_LIBCPP_EXTERN_TEMPLATE(class basic_iostream) _LIBCPP_END_NAMESPACE_STD Modified: stable/9/contrib/libc++/include/iterator ============================================================================== --- stable/9/contrib/libc++/include/iterator Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/iterator Thu Nov 29 21:26:57 2012 (r243683) @@ -337,7 +337,7 @@ template struct __has_iterator_category { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::iterator_category* = 0); public: Modified: stable/9/contrib/libc++/include/locale ============================================================================== --- stable/9/contrib/libc++/include/locale Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/locale Thu Nov 29 21:26:57 2012 (r243683) @@ -692,8 +692,8 @@ __num_get<_CharT>::__stage2_float_loop(_ return 0; } -extern template struct __num_get; -extern template struct __num_get; +_LIBCPP_EXTERN_TEMPLATE(struct __num_get) +_LIBCPP_EXTERN_TEMPLATE(struct __num_get) template > class _LIBCPP_VISIBLE num_get @@ -1314,8 +1314,8 @@ num_get<_CharT, _InputIterator>::do_get( return __b; } -extern template class num_get; -extern template class num_get; +_LIBCPP_EXTERN_TEMPLATE(class num_get) +_LIBCPP_EXTERN_TEMPLATE(class num_get) struct __num_put_base { @@ -1464,8 +1464,8 @@ __num_put<_CharT>::__widen_and_group_flo __op = __ob + (__np - __nb); } -extern template struct __num_put; -extern template struct __num_put; +_LIBCPP_EXTERN_TEMPLATE(struct __num_put) +_LIBCPP_EXTERN_TEMPLATE(struct __num_put) template > class _LIBCPP_VISIBLE num_put @@ -1938,8 +1938,8 @@ num_put<_CharT, _OutputIterator>::do_put return __pad_and_output(__s, __o, __op, __oe, __iob, __fl); } -extern template class num_put; -extern template class num_put; +_LIBCPP_EXTERN_TEMPLATE(class num_put) +_LIBCPP_EXTERN_TEMPLATE(class num_put) template _LIBCPP_HIDDEN @@ -2605,8 +2605,8 @@ time_get<_CharT, _InputIterator>::do_get return __b; } -extern template class time_get; -extern template class time_get; +_LIBCPP_EXTERN_TEMPLATE(class time_get) +_LIBCPP_EXTERN_TEMPLATE(class time_get) class __time_get { @@ -2688,8 +2688,8 @@ private: virtual const string_type& __X() const {return this->__X_;} }; -extern template class time_get_byname; -extern template class time_get_byname; +_LIBCPP_EXTERN_TEMPLATE(class time_get_byname) +_LIBCPP_EXTERN_TEMPLATE(class time_get_byname) class __time_put { @@ -2801,8 +2801,8 @@ time_put<_CharT, _OutputIterator>::do_pu return _VSTD::copy(__nb, __ne, __s); } -extern template class time_put; -extern template class time_put; +_LIBCPP_EXTERN_TEMPLATE(class time_put) +_LIBCPP_EXTERN_TEMPLATE(class time_put) template > class _LIBCPP_VISIBLE time_put_byname @@ -2822,8 +2822,8 @@ protected: ~time_put_byname() {} }; -extern template class time_put_byname; -extern template class time_put_byname; +_LIBCPP_EXTERN_TEMPLATE(class time_put_byname) +_LIBCPP_EXTERN_TEMPLATE(class time_put_byname) // money_base @@ -2885,10 +2885,10 @@ template ::id; -extern template class moneypunct; -extern template class moneypunct; -extern template class moneypunct; -extern template class moneypunct; +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct) // moneypunct_byname @@ -2942,10 +2942,10 @@ template<> void moneypunct_byname void moneypunct_byname::init(const char*); template<> void moneypunct_byname::init(const char*); -extern template class moneypunct_byname; -extern template class moneypunct_byname; -extern template class moneypunct_byname; -extern template class moneypunct_byname; +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) +_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname) // money_get @@ -3001,8 +3001,8 @@ __money_get<_CharT>::__gather_info(bool } } -extern template class __money_get; -extern template class __money_get; +_LIBCPP_EXTERN_TEMPLATE(class __money_get) +_LIBCPP_EXTERN_TEMPLATE(class __money_get) template > class _LIBCPP_VISIBLE money_get @@ -3382,8 +3382,8 @@ money_get<_CharT, _InputIterator>::do_ge return __b; } -extern template class money_get; -extern template class money_get; +_LIBCPP_EXTERN_TEMPLATE(class money_get) +_LIBCPP_EXTERN_TEMPLATE(class money_get) // money_put @@ -3557,8 +3557,8 @@ __money_put<_CharT>::__format(char_type* __mi = __mb; } -extern template class __money_put; -extern template class __money_put; +_LIBCPP_EXTERN_TEMPLATE(class __money_put) +_LIBCPP_EXTERN_TEMPLATE(class __money_put) template > class _LIBCPP_VISIBLE money_put @@ -3714,8 +3714,8 @@ money_put<_CharT, _OutputIterator>::do_p return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl); } -extern template class money_put; -extern template class money_put; +_LIBCPP_EXTERN_TEMPLATE(class money_put) +_LIBCPP_EXTERN_TEMPLATE(class money_put) // messages @@ -3824,8 +3824,8 @@ messages<_CharT>::do_close(catalog __c) #endif // !_WIN32 } -extern template class messages; -extern template class messages; +_LIBCPP_EXTERN_TEMPLATE(class messages) +_LIBCPP_EXTERN_TEMPLATE(class messages) template class _LIBCPP_VISIBLE messages_byname @@ -3848,8 +3848,8 @@ protected: ~messages_byname() {} }; -extern template class messages_byname; -extern template class messages_byname; +_LIBCPP_EXTERN_TEMPLATE(class messages_byname) +_LIBCPP_EXTERN_TEMPLATE(class messages_byname) template, Modified: stable/9/contrib/libc++/include/memory ============================================================================== --- stable/9/contrib/libc++/include/memory Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/memory Thu Nov 29 21:26:57 2012 (r243683) @@ -694,7 +694,7 @@ template struct __has_element_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::element_type* = 0); public: @@ -782,7 +782,7 @@ template struct __has_difference_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::difference_type* = 0); public: @@ -805,7 +805,7 @@ template struct __has_rebind { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Xp::template rebind<_Up>* = 0); public: @@ -998,7 +998,7 @@ template struct __has_const_pointer { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::const_pointer* = 0); public: @@ -1025,7 +1025,7 @@ template struct __has_void_pointer { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::void_pointer* = 0); public: @@ -1052,7 +1052,7 @@ template struct __has_const_void_pointer { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::const_void_pointer* = 0); public: @@ -1095,7 +1095,7 @@ template struct __has_size_type { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::size_type* = 0); public: @@ -1118,7 +1118,7 @@ template struct __has_propagate_on_container_copy_assignment { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::propagate_on_container_copy_assignment* = 0); public: @@ -1141,7 +1141,7 @@ template struct __has_propagate_on_container_move_assignment { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::propagate_on_container_move_assignment* = 0); public: @@ -1164,7 +1164,7 @@ template struct __has_propagate_on_container_swap { private: - struct __two {char _; char __;}; + struct __two {char __lx; char __lxx;}; template static __two __test(...); template static char __test(typename _Up::propagate_on_container_swap* = 0); public: @@ -1187,7 +1187,7 @@ template static __two __test(...); template static char __test(typename _Xp::template rebind<_Up>::other* = 0); public: @@ -5268,7 +5268,7 @@ operator<<(basic_ostream<_CharT, _Traits class __sp_mut { - void* _; + void* __lx; public: void lock() _NOEXCEPT; void unlock() _NOEXCEPT; @@ -5395,17 +5395,17 @@ atomic_compare_exchange_weak_explicit(sh //enum class struct _LIBCPP_VISIBLE pointer_safety { - enum _ + enum __lx { relaxed, preferred, strict }; - _ __v_; + __lx __v_; _LIBCPP_INLINE_VISIBILITY - pointer_safety(_ __v) : __v_(__v) {} + pointer_safety(__lx __v) : __v_(__v) {} _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} }; Modified: stable/9/contrib/libc++/include/ostream ============================================================================== --- stable/9/contrib/libc++/include/ostream Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/ostream Thu Nov 29 21:26:57 2012 (r243683) @@ -1287,8 +1287,8 @@ operator<<(basic_ostream<_CharT, _Traits use_facet >(__os.getloc()).widen('1')); } -extern template class basic_ostream; -extern template class basic_ostream; +_LIBCPP_EXTERN_TEMPLATE(class basic_ostream) +_LIBCPP_EXTERN_TEMPLATE(class basic_ostream) _LIBCPP_END_NAMESPACE_STD Modified: stable/9/contrib/libc++/include/random ============================================================================== --- stable/9/contrib/libc++/include/random Thu Nov 29 21:05:50 2012 (r243682) +++ stable/9/contrib/libc++/include/random Thu Nov 29 21:26:57 2012 (r243683) @@ -1991,7 +1991,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_UIntType, __a, __c, __m>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); __os.fill(__os.widen(' ')); return __os << __x.__x_; @@ -2003,7 +2003,7 @@ basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_UIntType, __a, __c, __m>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _UIntType __t; __is >> __t; @@ -2377,7 +2377,7 @@ operator<<(basic_ostream<_CharT, _Traits const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -2398,7 +2398,7 @@ operator>>(basic_istream<_CharT, _Traits mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _UI __t[_Np]; for (size_t __i = 0; __i < _Np; ++__i) @@ -2684,7 +2684,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -2703,7 +2703,7 @@ basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _UI __t[_Rp+1]; for (size_t __i = 0; __i < _Rp+1; ++__i) @@ -2859,7 +2859,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const discard_block_engine<_Eng, _Pp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -2872,7 +2872,7 @@ basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, discard_block_engine<_Eng, _Pp, _Rp>& __x) { - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _Eng __e; int __n; @@ -3340,7 +3340,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const shuffle_order_engine<_Eng, _Kp>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -3357,7 +3357,7 @@ operator>>(basic_istream<_CharT, _Traits shuffle_order_engine<_Eng, _Kp>& __x) { typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); _Eng __e; result_type _Vp[_Kp+1]; @@ -3561,7 +3561,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const uniform_int_distribution<_IT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); @@ -3576,7 +3576,7 @@ operator>>(basic_istream<_CharT, _Traits typedef uniform_int_distribution<_IT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -3682,7 +3682,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const uniform_real_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -3698,7 +3698,7 @@ operator>>(basic_istream<_CharT, _Traits typedef uniform_real_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -3793,7 +3793,7 @@ template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -3807,7 +3807,7 @@ operator>>(basic_istream<_CharT, _Traits { typedef bernoulli_distribution _Eng; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); double __p; __is >> __p; @@ -3955,7 +3955,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const binomial_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -3971,7 +3971,7 @@ operator>>(basic_istream<_CharT, _Traits typedef binomial_distribution<_IntType> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __t; double __p; @@ -4073,7 +4073,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const exponential_distribution<_RealType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); return __os << __x.lambda(); @@ -4087,7 +4087,7 @@ operator>>(basic_istream<_CharT, _Traits typedef exponential_distribution<_RealType> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __lambda; __is >> __lambda; @@ -4227,7 +4227,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const normal_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -4246,7 +4246,7 @@ operator>>(basic_istream<_CharT, _Traits typedef normal_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __mean; result_type __stddev; @@ -4598,7 +4598,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const poisson_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); return __os << __x.mean(); @@ -4611,7 +4611,7 @@ operator>>(basic_istream<_CharT, _Traits { typedef poisson_distribution<_IntType> _Eng; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); double __mean; __is >> __mean; @@ -4709,7 +4709,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const weibull_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -4726,7 +4726,7 @@ operator>>(basic_istream<_CharT, _Traits typedef weibull_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -4828,7 +4828,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const extreme_value_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -4845,7 +4845,7 @@ operator>>(basic_istream<_CharT, _Traits typedef extreme_value_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __a; result_type __b; @@ -5000,7 +5000,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const gamma_distribution<_RT>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -5017,7 +5017,7 @@ operator>>(basic_istream<_CharT, _Traits typedef gamma_distribution<_RT> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __alpha; result_type __beta; @@ -5136,7 +5136,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const negative_binomial_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); _CharT __sp = __os.widen(' '); @@ -5152,7 +5152,7 @@ operator>>(basic_istream<_CharT, _Traits typedef negative_binomial_distribution<_IntType> _Eng; typedef typename _Eng::result_type result_type; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); result_type __k; double __p; @@ -5242,7 +5242,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const geometric_distribution<_IntType>& __x) { - __save_flags<_CharT, _Traits> _(__os); + __save_flags<_CharT, _Traits> __lx(__os); __os.flags(ios_base::dec | ios_base::left | ios_base::fixed | ios_base::scientific); return __os << __x.p(); @@ -5255,7 +5255,7 @@ operator>>(basic_istream<_CharT, _Traits { typedef geometric_distribution<_IntType> _Eng; typedef typename _Eng::param_type param_type; - __save_flags<_CharT, _Traits> _(__is); + __save_flags<_CharT, _Traits> __lx(__is); __is.flags(ios_base::dec | ios_base::skipws); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 29 23:39: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 06108A04; Thu, 29 Nov 2012 23:39:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 8BC958FC12; Thu, 29 Nov 2012 23:39:28 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qATNdNdZ017356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Nov 2012 10:39:24 +1100 Date: Fri, 30 Nov 2012 10:39:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r243665 - head/sbin/dump In-Reply-To: <20121129205729.GN3013@kib.kiev.ua> Message-ID: <20121130100508.R1242@besplex.bde.org> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> <20121129162412.GD29338@stack.nl> <20121129205729.GN3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zr21sKHG c=1 sm=1 a=L02UnmsDQJIA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=rj3hlHQjMzkA:10 a=6I5d2MoRAAAA:8 a=mr-JSwSOzfl-SWpwChUA:9 a=CjuIK1q_8ugA:10 a=OJY-0xXhBfMA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 23:39:29 -0000 On Thu, 29 Nov 2012, Konstantin Belousov wrote: > On Thu, Nov 29, 2012 at 05:24:12PM +0100, Jilles Tjoelker wrote: >> On Thu, Nov 29, 2012 at 02:01:47PM +0200, Konstantin Belousov wrote: >>> On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: >>>> Log: >>>> Mark non-returning function as such >> >>>> PR: bin/172978 >>>> Approved by: cperciva >>>> MFC after: 3 days >> >>>> Modified: >>>> head/sbin/dump/dump.h >> >>>> Modified: head/sbin/dump/dump.h >>>> ============================================================================== >>>> --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) >>>> +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) >>>> @@ -121,7 +121,7 @@ void trewind(void); >>>> void writerec(char *dp, int isspcl); >>>> >>>> void Exit(int status) __dead2; >>>> -void dumpabort(int signo); >>>> +void dumpabort(int signo) __dead2; >>>> void dump_getfstab(void); >>>> >>>> char *rawname(char *cp); >> >>> What is the goal of this change ? It seems reasonable. The function is not static, so compilers can't always see that it is no-return. But I think most older uses of __dead2 for static functions are like uses of the register keyword. >> This has been discussed before in >> http://lists.freebsd.org/pipermail/freebsd-current/2011-January/022179.html >> and the rest of the thread. The result there seems that it is the least >> bad thing to add __dead2 even on static functions that do not return to >> reduce compiler/analyzer warnings and improve the generated code with >> GCC 4.2.1 and GCC 4.5. > But we are already in the shiny new world ? We should not care about so > antique and unsupported compilers any more ? > Or, at least, the commit message should have said that we do. > > I suppose that the worry about slightly unefficient code in the dump(8) would > be good April 1 subject. >> >>> It is arguably backward. There is absolutely no use to mark signal >>> handler as __dead2, and all other uses do not benefit from the >>> redundand declaration. >> >> Although most of the uses of dumpabort() are in the same file as its >> definition, GCC 4.2.1 is too dumb to detect its noreturn property >> automatically. >> >> Furthermore, some of the uses are in separate files. In particular, >> __dead2 on dumpabort() is required to mark or detect quit() as noreturn. >> >>> Also, being quite removed from the function definition, there is a >>> chance that some future modification would make the attribute a lie. >> >> Both GCC and Clang generate a warning by default if it appears possible >> for a noreturn function to return, so as long as -Werror remains enabled >> it should be safe enough. > > The annotation is very much like comment which rephrase the code and thus is > useless. But in this case, the attribute annotation does has a chance of > changing the compiler behaviour. > > IMO, such changes shall not be done, and the already accumulated nonsense > needs to be reverted. The only problem that I see is that the change obfuscates the actual bugs: - dumpabort() is a normal function that is used as a signal handler - the use of dumpabort() as a signal handler is not just a style bug, since it is very async-signal unsafe and thus cannot be used as a (non-broken) signal handler. Similar bugs were fixed in the less-critical application dd(1). Even in 4.4BSD, the signal handler summaryx() was safe (it used and still uses a combination of snprintf() and write()), and the only fix needed was to chane exit() to _exit() in the signal handler terminate(). dumpabort() does much more than exit() in some cases, so it is harder to fix. dd was presumably more correct since signals occur in normal operation so races in the signal handling would have been more obvious. I'm not happy with some other fixes for unsafe signal handlers. The ones in ping and top are still broken AFAIK. Just setting a flag in the signal and checking the in the main loop doesn't work if any syscall is restarted. In top, the read() syscall is restarted, so top is broken for signal that occur in its read() loop (e.g., for responding to the prompt for the 's' command). So SA_RESTART should be kept clear for most signals. But then every syscall has to check for EINTR. This is a burden and is not done by top, although it is probably manageable for top (there aren't any (?) syscalls other than the one in the read() loop to check). ping is more careful and keeps SA_RESTART clear, but it is still broken when the resolver library restarts. Libraries in general might not handle the EINTR's from !SA_RESTART properly, but in the resolver library the problem is sort of the opposite: at least in very old versions that use select(), EINTR is normal but the resolvier library doesn't want to return for EINTR, so it restarts at the library level and thus the main loop in ping is never reached in another way. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 00:07:11 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 CE552F03; Fri, 30 Nov 2012 00:07:11 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id AC10A8FC0C; Fri, 30 Nov 2012 00:07:10 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAMf3t1CDaFvO/2dsb2JhbABEFoYWuXBzgh4BAQQBI1YFFg4GBAICDRkCWQaIEQMJBgysLYkFDYlUgSKLHoMugRMDiF6NI4EcjyiDEIID X-IronPort-AV: E=Sophos;i="4.84,188,1355115600"; d="scan'208";a="2656235" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu.net.uoguelph.ca with ESMTP; 29 Nov 2012 19:07:02 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id B5138B4060; Thu, 29 Nov 2012 19:07:02 -0500 (EST) Date: Thu, 29 Nov 2012 19:07:02 -0500 (EST) From: Rick Macklem To: Mateusz Guzik Message-ID: <1665336113.1002130.1354234022710.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20121129003853.GB22327@dft-labs.eu> Subject: Re: svn commit: r243645 - head/usr.sbin/nfsd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 00:07:12 -0000 Mateusz Guzik wrote: > On Wed, Nov 28, 2012 at 07:14:23PM -0500, Rick Macklem wrote: > > Mateusz Guzik wrote: > > > On Wed, Nov 28, 2012 at 02:47:32AM +0000, Alfred Perlstein wrote: > > > > Author: alfred > > > > Date: Wed Nov 28 02:47:31 2012 > > > > New Revision: 243645 > > > > URL: http://svnweb.freebsd.org/changeset/base/243645 > > > > > > > > Log: > > > > Don't allow minthreads > maxthreads. > > > > > > > Should not this be also checked in the kernel? Looks like > > > nfssvc_nfsd > > > is > > > trustful: > > > > > Well, since only root can do this and I can't think of why a > > sysadmin > > would use anything other than nfsd, I'm not sure it matters much? > > (But I don't see a problem with adding a sanity check in the kernel > > code.) > > > > It's nothing serious and I'm not going to insist, especially since > this > is your code. It's not my code, it's the collective's code. (For want of a better term for the FreeBSD project.;-) Also, I wasn't the author of the krpc related stuff (which these thread limits are a part of). I just cloned it from the old NFS server for the new one. > I just prefer the kernel to be resistant if it does not > cost much. > > I had something like this in mind (untested): > http://people.freebsd.org/~mjg/patches/nfs-threads-check.diff > Since it was alfred@'s patch, I'll let him decide. As I said before, I have no problem with adding the check to the kernel. Have fun with it, rick > -- > Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 00:09: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 9E793103; Fri, 30 Nov 2012 00:09:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 19B648FC0C; Fri, 30 Nov 2012 00:09:21 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAU09BXf008546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Nov 2012 11:09:13 +1100 Date: Fri, 30 Nov 2012 11:09:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r243670 - head/share/man/man5 In-Reply-To: <201211291251.qATCpA7w078277@svn.freebsd.org> Message-ID: <20121130110154.E1441@besplex.bde.org> References: <201211291251.qATCpA7w078277@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zr21sKHG c=1 sm=1 a=bvcLnixDC-gA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=TdF0Wd7UlPIA:10 a=6I5d2MoRAAAA:8 a=WaMP1lU5r4K276wGbWcA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 00:09:22 -0000 On Thu, 29 Nov 2012, Eitan Adler wrote: > Log: > Generalize make.conf man page: use "cc" instead of "gcc" > > PR: misc/173604 > Submitted by: Dan McGregor > Approved by: bcr (mentor) > MFC after: 3 days "gcc" was mostly correct here, since the flags are unportable gcc ones. They don't work with any "cc", but may work with clang, although this is unclear since none of them is documented in clang(1). > Modified: head/share/man/man5/make.conf.5 > ============================================================================== > --- head/share/man/man5/make.conf.5 Thu Nov 29 08:06:23 2012 (r243669) > +++ head/share/man/man5/make.conf.5 Thu Nov 29 12:51:10 2012 (r243670) > @@ -143,7 +143,7 @@ and > are not supported. > .Va BDECFLAGS > is provided as a set of > -.Xr gcc 1 > +.Xr cc 1 > settings suggested by > .An "Bruce Evans" Aq bde@FreeBSD.org > for developing and testing changes. However, I never would have agreed to putting any of them here. Lots here is now superseded by flags set by WARNS anyway. clang's even more unportable new flags are not documented in clang(1) and the settings here are too old to have dreamed of these. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 00:13: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 B7AE629A; Fri, 30 Nov 2012 00:13:32 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99F908FC08; Fri, 30 Nov 2012 00:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU0DWlQ081452; Fri, 30 Nov 2012 00:13:32 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU0DWa1081430; Fri, 30 Nov 2012 00:13:32 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211300013.qAU0DWa1081430@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 30 Nov 2012 00:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243684 - stable/8/usr.bin/systat X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 00:13:32 -0000 Author: melifaro Date: Fri Nov 30 00:13:31 2012 New Revision: 243684 URL: http://svnweb.freebsd.org/changeset/base/243684 Log: Merge r226396, r240605 Make systat(1) accept fractional number of seconds. Make old alarm(3)-based code use select(2). Ability to specify small intervals can be very handy while debugging traffic microbursts. Note that locale-aware strtod(3) is used to parse delay which is slightly different from ping. Fix whitespace inconsistencies in systat(1). Approved by: ed (r226396) Modified: stable/8/usr.bin/systat/cmds.c stable/8/usr.bin/systat/cmdtab.c stable/8/usr.bin/systat/devs.c stable/8/usr.bin/systat/extern.h stable/8/usr.bin/systat/fetch.c stable/8/usr.bin/systat/icmp.c stable/8/usr.bin/systat/icmp6.c stable/8/usr.bin/systat/ifcmds.c stable/8/usr.bin/systat/ifstat.c stable/8/usr.bin/systat/ip.c stable/8/usr.bin/systat/ip6.c stable/8/usr.bin/systat/keyboard.c stable/8/usr.bin/systat/main.c stable/8/usr.bin/systat/mode.c stable/8/usr.bin/systat/mode.h stable/8/usr.bin/systat/netstat.c stable/8/usr.bin/systat/systat.1 stable/8/usr.bin/systat/systat.h stable/8/usr.bin/systat/tcp.c stable/8/usr.bin/systat/vmstat.c Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/systat/ (props changed) Modified: stable/8/usr.bin/systat/cmds.c ============================================================================== --- stable/8/usr.bin/systat/cmds.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/cmds.c Fri Nov 30 00:13:31 2012 (r243684) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; #endif +#include + #include #include #include @@ -51,32 +53,31 @@ static const char sccsid[] = "@(#)cmds.c void command(const char *cmd) { - struct cmdtab *p; - char *cp, *tmpstr, *tmpstr1; - int interval, omask; + struct cmdtab *p; + char *cp, *tmpstr, *tmpstr1; + double t; tmpstr = tmpstr1 = strdup(cmd); - omask = sigblock(sigmask(SIGALRM)); - for (cp = tmpstr1; *cp && !isspace(*cp); cp++) - ; - if (*cp) - *cp++ = '\0'; + for (cp = tmpstr1; *cp && !isspace(*cp); cp++) + ; + if (*cp) + *cp++ = '\0'; if (*tmpstr1 == '\0') return; for (; *cp && isspace(*cp); cp++) ; - if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) - die(0); + if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) + die(0); if (strcmp(tmpstr1, "load") == 0) { load(); goto done; } - if (strcmp(tmpstr1, "stop") == 0) { - alarm(0); - mvaddstr(CMDLINE, 0, "Refresh disabled."); - clrtoeol(); + if (strcmp(tmpstr1, "stop") == 0) { + delay = 0; + mvaddstr(CMDLINE, 0, "Refresh disabled."); + clrtoeol(); goto done; - } + } if (strcmp(tmpstr1, "help") == 0) { int _col, _len; @@ -92,31 +93,34 @@ command(const char *cmd) clrtoeol(); goto done; } - interval = atoi(tmpstr1); - if (interval <= 0 && - (strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) { - interval = *cp ? atoi(cp) : naptime; - if (interval <= 0) { - error("%d: bad interval.", interval); - goto done; - } + t = strtod(tmpstr1, NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; + if ((t <= 0 || t > (double)UINT_MAX) && + (strcmp(tmpstr1, "start") == 0 || + strcmp(tmpstr1, "interval") == 0)) { + if (*cp != '\0') { + t = strtod(cp, NULL) * 1000000.0; + if (t <= 0 || t >= (double)UINT_MAX) { + error("%d: bad interval.", (int)t); + goto done; + } + } } - if (interval > 0) { - alarm(0); - naptime = interval; - display(0); - status(); + if (t > 0) { + delay = (unsigned int)t; + display(); + status(); goto done; - } + } p = lookup(tmpstr1); if (p == (struct cmdtab *)-1) { error("%s: Ambiguous command.", tmpstr1); goto done; } - if (p) { - if (curcmd == p) + if (p) { + if (curcmd == p) goto done; - alarm(0); (*curcmd->c_close)(wnd); curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); @@ -135,16 +139,15 @@ command(const char *cmd) else goto done; } - curcmd = p; + curcmd = p; labels(); - display(0); - status(); + display(); + status(); goto done; - } + } if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp)) error("%s: Unknown command.", tmpstr1); done: - sigsetmask(omask); free(tmpstr); } @@ -180,18 +183,18 @@ void status(void) { - error("Showing %s, refresh every %d seconds.", - curcmd->c_name, naptime); + error("Showing %s, refresh every %d seconds.", + curcmd->c_name, delay / 1000000); } int prefix(const char *s1, const char *s2) { - while (*s1 == *s2) { - if (*s1 == '\0') - return (1); - s1++, s2++; - } - return (*s1 == '\0'); + while (*s1 == *s2) { + if (*s1 == '\0') + return (1); + s1++, s2++; + } + return (*s1 == '\0'); } Modified: stable/8/usr.bin/systat/cmdtab.c ============================================================================== --- stable/8/usr.bin/systat/cmdtab.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/cmdtab.c Fri Nov 30 00:13:31 2012 (r243684) @@ -44,22 +44,22 @@ static const char sccsid[] = "@(#)cmdtab #include "mode.h" struct cmdtab cmdtab[] = { - { "pigs", showpigs, fetchpigs, labelpigs, + { "pigs", showpigs, fetchpigs, labelpigs, initpigs, openpigs, closepigs, 0, 0, CF_LOADAV }, - { "swap", showswap, fetchswap, labelswap, + { "swap", showswap, fetchswap, labelswap, initswap, openswap, closeswap, 0, 0, CF_LOADAV }, - { "mbufs", showmbufs, fetchmbufs, labelmbufs, + { "mbufs", showmbufs, fetchmbufs, labelmbufs, initmbufs, openmbufs, closembufs, 0, 0, CF_LOADAV }, - { "iostat", showiostat, fetchiostat, labeliostat, + { "iostat", showiostat, fetchiostat, labeliostat, initiostat, openiostat, closeiostat, cmdiostat, 0, CF_LOADAV }, - { "vmstat", showkre, fetchkre, labelkre, + { "vmstat", showkre, fetchkre, labelkre, initkre, openkre, closekre, cmdkre, 0, 0 }, - { "netstat", shownetstat, fetchnetstat, labelnetstat, + { "netstat", shownetstat, fetchnetstat, labelnetstat, initnetstat, opennetstat, closenetstat, cmdnetstat, 0, CF_LOADAV }, { "icmp", showicmp, fetchicmp, labelicmp, @@ -82,6 +82,6 @@ struct cmdtab cmdtab[] = { { "ifstat", showifstat, fetchifstat, labelifstat, initifstat, openifstat, closeifstat, cmdifstat, 0, CF_LOADAV }, - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; struct cmdtab *curcmd = &cmdtab[0]; Modified: stable/8/usr.bin/systat/devs.c ============================================================================== --- stable/8/usr.bin/systat/devs.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/devs.c Fri Nov 30 00:13:31 2012 (r243684) @@ -109,7 +109,7 @@ dsinit(int maxshowdevs, struct statinfo /* * Make sure that the userland devstat version matches the kernel - * devstat version. If not, exit and print a message informing + * devstat version. If not, exit and print a message informing * the user of his mistake. */ if (devstat_checkversion(NULL) < 0) @@ -159,10 +159,10 @@ dscmd(const char *cmd, const char *args, if (prefix(cmd, "refresh")) { retval = devstat_selectdevs(&dev_select, &num_selected, &num_selections, &select_generation, generation, - s1->dinfo->devices, num_devices, + s1->dinfo->devices, num_devices, (last_type ==DS_MATCHTYPE_PATTERN) ? matches : NULL, (last_type ==DS_MATCHTYPE_PATTERN) ? num_matches : 0, - (last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL, + (last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL, (last_type == DS_MATCHTYPE_SPEC) ?num_devices_specified : 0, (last_type == DS_MATCHTYPE_NONE) ? DS_SELECT_ADD : DS_SELECT_ADDONLY, maxshowdevs, 0); @@ -224,7 +224,7 @@ dsmatchselect(const char *args, devstat_ } for (i = 0; i < num_args; i++) { - if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) { + if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) { warnx("%s", devstat_errbuf); return(0); } @@ -286,7 +286,7 @@ dsselect(const char *args, devstat_selec asprintf(&buffer, "%s%d", dev_select[i].device_name, dev_select[i].unit_number); if (strcmp(buffer, tmpstr1) == 0) { - + num_devices_specified++; specified_devices =(char **)realloc( Modified: stable/8/usr.bin/systat/extern.h ============================================================================== --- stable/8/usr.bin/systat/extern.h Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/extern.h Fri Nov 30 00:13:31 2012 (r243684) @@ -53,11 +53,12 @@ extern int CMDLINE; extern int dk_ndrive; extern int hz, stathz; extern double hertz; /* sampling frequency for cp_time and dk_time */ -extern int naptime, col; +extern int col; extern int nhosts; extern int nports; extern int protos; extern int verbose; +extern unsigned int delay; struct inpcb; @@ -91,7 +92,7 @@ int cmdnetstat(const char *, const char struct cmdtab *lookup(const char *); void command(const char *); void die(int); -void display(int); +void display(void); int dkinit(void); int dkcmd(char *, char *); void error(const char *fmt, ...) __printflike(1, 2); Modified: stable/8/usr.bin/systat/fetch.c ============================================================================== --- stable/8/usr.bin/systat/fetch.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/fetch.c Fri Nov 30 00:13:31 2012 (r243684) @@ -66,17 +66,17 @@ void getsysctl(const char *name, void *p { size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) { - error("sysctl(%s...) failed: %s", name, + error("sysctl(%s...) failed: %s", name, strerror(errno)); } if (nlen != len) { - error("sysctl(%s...) expected %lu, got %lu", name, + error("sysctl(%s...) expected %lu, got %lu", name, (unsigned long)len, (unsigned long)nlen); } } /* - * Read sysctl data with variable size. Try some times (with increasing + * Read sysctl data with variable size. Try some times (with increasing * buffers), fail if still too small. * This is needed sysctls with possibly raplidly increasing data sizes, * but imposes little overhead in the case of constant sizes. @@ -88,8 +88,8 @@ void getsysctl(const char *name, void *p /* Some defines: Number of tries. */ #define SD_NTRIES 10 /* Percent of over-allocation (initial) */ -#define SD_MARGIN 10 -/* +#define SD_MARGIN 10 +/* * Factor for over-allocation in percent (the margin is increased by this on * any failed try). */ Modified: stable/8/usr.bin/systat/icmp.c ============================================================================== --- stable/8/usr.bin/systat/icmp.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/icmp.c Fri Nov 30 00:13:31 2012 (r243684) @@ -142,7 +142,7 @@ domode(struct icmpstat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: stable/8/usr.bin/systat/icmp6.c ============================================================================== --- stable/8/usr.bin/systat/icmp6.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/icmp6.c Fri Nov 30 00:13:31 2012 (r243684) @@ -141,7 +141,7 @@ domode(struct icmp6stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: stable/8/usr.bin/systat/ifcmds.c ============================================================================== --- stable/8/usr.bin/systat/ifcmds.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/ifcmds.c Fri Nov 30 00:13:31 2012 (r243684) @@ -47,7 +47,7 @@ ifcmd(const char *cmd, const char *args) clrtoeol(); addstr("what scale? "); addstr(get_helplist()); - } + } } return (1); } Modified: stable/8/usr.bin/systat/ifstat.c ============================================================================== --- stable/8/usr.bin/systat/ifstat.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/ifstat.c Fri Nov 30 00:13:31 2012 (r243684) @@ -43,7 +43,7 @@ #include "extern.h" #include "convtbl.h" - /* Column numbers */ + /* Column numbers */ #define C1 0 /* 0-19 */ #define C2 20 /* 20-39 */ @@ -121,9 +121,9 @@ static u_int getifnum(void); } while (0) #define DOPUTTOTAL(c, r, d) do { \ - CLEAR_COLUMN((r), (c)); \ - mvprintw((r), (c), "%12.3f %s ", \ - convert(d##_##c, SC_AUTO), \ + CLEAR_COLUMN((r), (c)); \ + mvprintw((r), (c), "%12.3f %s ", \ + convert(d##_##c, SC_AUTO), \ get_string(d##_##c, SC_AUTO)); \ } while (0) @@ -255,8 +255,8 @@ fetchifstat(void) (void)getifmibdata(ifp->if_row, &ifp->if_mib); - new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; - new_outb = ifp->if_mib.ifmd_data.ifi_obytes; + new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; + new_outb = ifp->if_mib.ifmd_data.ifi_obytes; /* Display interface if it's received some traffic. */ if (new_inb > 0 && old_inb == 0) { @@ -269,9 +269,9 @@ fetchifstat(void) * for our current traffic rates, and while we're there, * see if we have new peak rates. */ - old_tv = ifp->tv; - timersub(&new_tv, &old_tv, &tv); - elapsed = tv.tv_sec + (tv.tv_usec * 1e-6); + old_tv = ifp->tv; + timersub(&new_tv, &old_tv, &tv); + elapsed = tv.tv_sec + (tv.tv_usec * 1e-6); ifp->if_in_curtraffic = new_inb - old_inb; ifp->if_out_curtraffic = new_outb - old_outb; @@ -281,8 +281,8 @@ fetchifstat(void) * and line, we divide by ``elapsed'' as this is likely * to be more accurate. */ - ifp->if_in_curtraffic /= elapsed; - ifp->if_out_curtraffic /= elapsed; + ifp->if_in_curtraffic /= elapsed; + ifp->if_out_curtraffic /= elapsed; if (ifp->if_in_curtraffic > ifp->if_in_traffic_peak) ifp->if_in_traffic_peak = ifp->if_in_curtraffic; Modified: stable/8/usr.bin/systat/ip.c ============================================================================== --- stable/8/usr.bin/systat/ip.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/ip.c Fri Nov 30 00:13:31 2012 (r243684) @@ -150,7 +150,7 @@ domode(struct stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: stable/8/usr.bin/systat/ip6.c ============================================================================== --- stable/8/usr.bin/systat/ip6.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/ip6.c Fri Nov 30 00:13:31 2012 (r243684) @@ -146,7 +146,7 @@ domode(struct ip6stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: stable/8/usr.bin/systat/keyboard.c ============================================================================== --- stable/8/usr.bin/systat/keyboard.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/keyboard.c Fri Nov 30 00:13:31 2012 (r243684) @@ -39,88 +39,147 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93"; #endif +#include +#include + #include #include -#include #include #include +#include #include "systat.h" #include "extern.h" +static char line[80]; +static int keyboard_dispatch(int ch); + int keyboard(void) { - char ch, line[80]; - int oldmask; + char line[80]; + int ch, n; + struct timeval last, intvl, now, tm; + fd_set rfds; + + /* Set initial timings */ + gettimeofday(&last, NULL); + intvl.tv_sec = delay / 1000000; + intvl.tv_usec = delay % 1000000; + for (;;) { + col = 0; + move(CMDLINE, 0); + for (;;) { + /* Determine interval to sleep */ + (void)gettimeofday(&now, NULL); + tm.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; + tm.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; + while (tm.tv_usec < 0) { + tm.tv_usec += 1000000; + tm.tv_sec--; + } + while (tm.tv_usec >= 1000000) { + tm.tv_usec -= 1000000; + tm.tv_sec++; + } + if (tm.tv_sec < 0) { + /* We have to update screen immediately */ + display(); + gettimeofday(&last, NULL); + continue; + } + + /* Prepare select */ + FD_ZERO(&rfds); + FD_SET(STDIN_FILENO, &rfds); + n = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tm); - for (;;) { - col = 0; - move(CMDLINE, 0); - do { - refresh(); - ch = getch(); - if (ch == ERR) { - if (errno == EINTR) - continue; - exit(1); - } - if (ch >= 'A' && ch <= 'Z') - ch += 'a' - 'A'; - if (col == 0) { -#define mask(s) (1 << ((s) - 1)) - if (ch == CTRL('l')) { - oldmask = sigblock(mask(SIGALRM)); - wrefresh(curscr); - sigsetmask(oldmask); - continue; - } - if (ch == CTRL('g')) { - oldmask = sigblock(mask(SIGALRM)); - status(); - sigsetmask(oldmask); + if (n > 0) { + /* Read event on stdin */ + ch = getch(); + + if (keyboard_dispatch(ch) == 0) { + refresh(); continue; } - if (ch != ':') - continue; - move(CMDLINE, 0); - clrtoeol(); - } - if (ch == erasechar() && col > 0) { - if (col == 1 && line[0] == ':') - continue; - col--; - goto doerase; - } - if (ch == CTRL('w') && col > 0) { - while (--col >= 0 && isspace(line[col])) - ; - col++; - while (--col >= 0 && !isspace(line[col])) - if (col == 0 && line[0] == ':') - break; - col++; - goto doerase; - } - if (ch == killchar() && col > 0) { - col = 0; - if (line[0] == ':') - col++; - doerase: - move(CMDLINE, col); - clrtoeol(); - continue; - } - if (isprint(ch) || ch == ' ') { - line[col] = ch; - mvaddch(CMDLINE, col, ch); - col++; - } - } while (col == 0 || (ch != '\r' && ch != '\n')); - line[col] = '\0'; - oldmask = sigblock(mask(SIGALRM)); - command(line + 1); - sigsetmask(oldmask); - } - /*NOTREACHED*/ + + line[col] = '\0'; + command(line + 1); + /* Refresh delay */ + intvl.tv_sec = delay / 1000000; + intvl.tv_usec = delay % 1000000; + refresh(); + break; + } + + if (n < 0 && errno != EINTR) + exit(1); + + /* Timeout or signal. Call display another time */ + display(); + gettimeofday(&last, NULL); + } + } +} + +static int +keyboard_dispatch(int ch) +{ + + if (ch == ERR) { + if (errno == EINTR) + return 0; + exit(1); + } + if (ch >= 'A' && ch <= 'Z') + ch += 'a' - 'A'; + if (col == 0) { + if (ch == CTRL('l')) { + wrefresh(curscr); + return 0; + } + if (ch == CTRL('g')) { + status(); + return 0; + } + if (ch != ':') + return 0; + move(CMDLINE, 0); + clrtoeol(); + } + if (ch == erasechar() && col > 0) { + if (col == 1 && line[0] == ':') + return 0; + col--; + goto doerase; + } + if (ch == CTRL('w') && col > 0) { + while (--col >= 0 && isspace(line[col])) + ; + col++; + while (--col >= 0 && !isspace(line[col])) + if (col == 0 && line[0] == ':') + return 1; + col++; + goto doerase; + } + if (ch == killchar() && col > 0) { + col = 0; + if (line[0] == ':') + col++; +doerase: + move(CMDLINE, col); + clrtoeol(); + return 0; + } + if (isprint(ch) || ch == ' ') { + line[col] = ch; + mvaddch(CMDLINE, col, ch); + col++; + } + + if (col == 0 || (ch != '\r' && ch != '\n')) + return 0; + + return 1; } Modified: stable/8/usr.bin/systat/main.c ============================================================================== --- stable/8/usr.bin/systat/main.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/main.c Fri Nov 30 00:13:31 2012 (r243684) @@ -68,7 +68,7 @@ kvm_t *kd; sig_t sigtstpdfl; double avenrun[3]; int col; -int naptime = 5; +unsigned int delay = 5000000; /* in microseconds */ int verbose = 1; /* to report kvm read errs */ struct clockinfo clkinfo; double hertz; @@ -86,6 +86,7 @@ main(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX], dummy; size_t size; + double t; (void) setlocale(LC_ALL, ""); @@ -101,9 +102,9 @@ main(int argc, char **argv) errx(1, "%s: unknown request", &argv[0][1]); curcmd = p; } else { - naptime = atoi(argv[0]); - if (naptime <= 0) - naptime = 5; + t = strtod(argv[0], NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; } argc--, argv++; } @@ -170,8 +171,7 @@ main(int argc, char **argv) dellave = 0.0; - signal(SIGALRM, display); - display(0); + display(); noecho(); crmode(); keyboard(); @@ -196,7 +196,7 @@ labels(void) } void -display(int signo __unused) +display() { int i, j; @@ -227,7 +227,6 @@ display(int signo __unused) wrefresh(wnd); move(CMDLINE, col); refresh(); - alarm(naptime); } void Modified: stable/8/usr.bin/systat/mode.c ============================================================================== --- stable/8/usr.bin/systat/mode.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/mode.c Fri Nov 30 00:13:31 2012 (r243684) @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: stable/8/usr.bin/systat/mode.h ============================================================================== --- stable/8/usr.bin/systat/mode.h Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/mode.h Fri Nov 30 00:13:31 2012 (r243684) @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: stable/8/usr.bin/systat/netstat.c ============================================================================== --- stable/8/usr.bin/systat/netstat.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/netstat.c Fri Nov 30 00:13:31 2012 (r243684) @@ -133,7 +133,7 @@ closenetstat(WINDOW *w) lastrow--; p->ni_line = -1; } - if (w != NULL) { + if (w != NULL) { wclear(w); wrefresh(w); delwin(w); Modified: stable/8/usr.bin/systat/systat.1 ============================================================================== --- stable/8/usr.bin/systat/systat.1 Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/systat.1 Fri Nov 30 00:13:31 2012 (r243684) @@ -32,7 +32,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd October 14, 2007 +.Dd September 17, 2012 .Dt SYSTAT 1 .Os .Sh NAME @@ -113,6 +113,7 @@ full detail below. The .Ar refresh-value specifies the screen refresh time interval in seconds. +Time interval can be fractional. .El .Pp Certain characters cause immediate action by Modified: stable/8/usr.bin/systat/systat.h ============================================================================== --- stable/8/usr.bin/systat/systat.h Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/systat.h Fri Nov 30 00:13:31 2012 (r243684) @@ -37,10 +37,10 @@ #include struct cmdtab { - const char *c_name; /* command name */ - void (*c_refresh)(void); /* display refresh */ - void (*c_fetch)(void); /* sets up data structures */ - void (*c_label)(void); /* label display */ + const char *c_name; /* command name */ + void (*c_refresh)(void); /* display refresh */ + void (*c_fetch)(void); /* sets up data structures */ + void (*c_label)(void); /* label display */ int (*c_init)(void); /* initialize namelist, etc. */ WINDOW *(*c_open)(void); /* open display */ void (*c_close)(WINDOW *); /* close display */ Modified: stable/8/usr.bin/systat/tcp.c ============================================================================== --- stable/8/usr.bin/systat/tcp.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/tcp.c Fri Nov 30 00:13:31 2012 (r243684) @@ -151,7 +151,7 @@ domode(struct tcpstat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: stable/8/usr.bin/systat/vmstat.c ============================================================================== --- stable/8/usr.bin/systat/vmstat.c Thu Nov 29 21:26:57 2012 (r243683) +++ stable/8/usr.bin/systat/vmstat.c Fri Nov 30 00:13:31 2012 (r243684) @@ -236,7 +236,7 @@ initkre(void) intrloc = calloc(nintr, sizeof (long)); intrname = calloc(nintr, sizeof (char *)); intrnamebuf = sysctl_dynread("hw.intrnames", NULL); - if (intrnamebuf == NULL || intrname == NULL || + if (intrnamebuf == NULL || intrname == NULL || intrloc == NULL) { error("Out of memory"); if (intrnamebuf) @@ -863,7 +863,7 @@ dinfo(int dn, int lc, struct statinfo *n elapsed_time = now->snap_time - then->snap_time; } else { /* Calculate relative to device creation */ - elapsed_time = now->snap_time - devstat_compute_etime( + elapsed_time = now->snap_time - devstat_compute_etime( &now->dinfo->devices[di].creation_time, NULL); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 00:15:56 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 2BF04430 for ; Fri, 30 Nov 2012 00:15:56 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 87E898FC15 for ; Fri, 30 Nov 2012 00:15:55 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so52114lbb.13 for ; Thu, 29 Nov 2012 16:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=umjPM7gCTmT/0LwQgwimVOa/hsSzHu4769NHpwhl0LY=; b=eK57JD+DEbqc15saLSoCBpmnn0GievA6ciaRMD5Y2bFJZMHKJ2yn1wuJDRsc6iuoVm IOwwSbaAUL8ksl+CdLhuvjsmjVMYwJhk/B3urMmd973Y+1wSSqnhBILHsKvfbF1V145o O1yuBjOiSP38CyQ6t8ppHzhlNzDtjB+QTlJ1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=umjPM7gCTmT/0LwQgwimVOa/hsSzHu4769NHpwhl0LY=; b=MF6GzWCZ0nc7Y7IW+/wzZLgVzIEUaptIieChiM/fCs88G0ruo17KARbn7TVoj/OWGi rGvudzbKIye+o+sw4RPs2XRGRrElRYsqFRN5bSCfcbMT2BkOV5Zk5YqUmY4QzheT4q0F w68E7hDNA8tMHC8y+XIiZkZuF5YkxrCfh+P5WtaHKS8yBcFa9eu3N8aR+DBzU5itg5J2 qeW8UDawdpXQpKjQOj8Z4aYiq5jQSaTtJppDF/ndR2tQJ02A+hQh/RLrYKjggMx+SimZ CjWSR74+IXdM41qlNQTKqfE8wlzzuvuB/uEmiF3A+cbSt6mh9sBg6pY4Mh0GMlbX08zI FyKg== Received: by 10.112.17.170 with SMTP id p10mr90922lbd.53.1354234554038; Thu, 29 Nov 2012 16:15:54 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Thu, 29 Nov 2012 16:15:23 -0800 (PST) In-Reply-To: <20121130110154.E1441@besplex.bde.org> References: <201211291251.qATCpA7w078277@svn.freebsd.org> <20121130110154.E1441@besplex.bde.org> From: Eitan Adler Date: Thu, 29 Nov 2012 19:15:23 -0500 X-Google-Sender-Auth: Hg9N7v240W7HZpxO6ncdE1Za5PM Message-ID: Subject: Re: svn commit: r243670 - head/share/man/man5 To: Bruce Evans Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk7KMU3mGOXTi15jdXc4v5U81geXxtD3FS2/QyQXFmmYrVHNPf/Mw/oyfOHfXF6nkVuo2rp Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 00:15:56 -0000 On 29 November 2012 19:09, Bruce Evans wrote: > On Thu, 29 Nov 2012, Eitan Adler wrote: > "gcc" was mostly correct here, since the flags are unportable gcc ones. > They don't work with any "cc", but may work with clang, although this > is unclear since none of them is documented in clang(1). Every time I talk to the clang folk about flags they point me to gcc documentation. > However, I never would have agreed to putting any of them here. > > Lots here is now superseded by flags set by WARNS anyway. > > clang's even more unportable new flags are not documented in clang(1) > and the settings here are too old to have dreamed of these. The reference to BDECFLAGS actually isn't true - there is no such variable. There is a *commented out* version which I had planned to email you about at some point. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 00:19:07 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 CF655674 for ; Fri, 30 Nov 2012 00:19:07 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 338538FC14 for ; Fri, 30 Nov 2012 00:19:06 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so54172lbb.13 for ; Thu, 29 Nov 2012 16:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=qb0vbC3JRACClkpqBuOk9GAmS4B5mL/+yw8QurzdulE=; b=kU6MhQq+F7etiImixSpGTbCEo3jWr/ou+er0xtFbN1GSd4P4TpwIrJRYA3ifEBIMh0 4117RGERCbEotKbDYfh+NQ6e2KOT0JT42ZJhT0BbfHzUvHPK5p2OM9sSHU3KG81yDZCX cDkYN62d0k3J+qMI/Jauc2/ZJ/eWvo9VTF6Oo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=qb0vbC3JRACClkpqBuOk9GAmS4B5mL/+yw8QurzdulE=; b=eCEe1uNqq7WRq/ZKZfWAs6U5GIaD7l/oeSchdMdt6MsQy2ZEiHBuZjEjMlI5fJFmTg BAfdcy7DfOn0htgBaHa3jWyDfqJm0ljlYbOGiFdnn2qiZksUxkikIBaVuhfC9/1ANm7B Jwa3dZPDrpjF2f2uW73f/s2Mr0HOh+Dmfn+ygiD2QrYw7DBFzYhQr+nCVIIVLVml7WSY 81TCUGutB7lO4wIqsDHjwA6vgufltPHCleZBWyxY2Nh15MuztUCQjqyJKxFmqyibdy02 4JMDUmocAl7JOglbbmUH4NFH0PyDJpxeXuvNwlTQf/15fruig34mbAOwO2pEgzOUtuNu 2wsQ== Received: by 10.152.105.103 with SMTP id gl7mr23141783lab.10.1354234746094; Thu, 29 Nov 2012 16:19:06 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Thu, 29 Nov 2012 16:18:35 -0800 (PST) In-Reply-To: <20121129205729.GN3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> <20121129162412.GD29338@stack.nl> <20121129205729.GN3013@kib.kiev.ua> From: Eitan Adler Date: Thu, 29 Nov 2012 19:18:35 -0500 X-Google-Sender-Auth: jmtyCgqPpYJmF9eXxwb0AQM0YB8 Message-ID: Subject: Re: svn commit: r243665 - head/sbin/dump To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk6T7cuPfCufB/v6weHg60s0YNXMCDZzXR74L0hq+PgvAei4y4VSj/oU6OP9pCEmeBzGDik Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 00:19:07 -0000 On 29 November 2012 15:57, Konstantin Belousov wrote: > IMO, such changes shall not be done, and the already accumulated nonsense > needs to be reverted. It causes no harm, and helps reduce the number of false positives in the clang static analyzer code so I fail to see why this should be reverted. This isn't akin to a comment as it changes the behavior of at least one helpful tool. Any future change which changed the return behavior of the function would cause an error (due to -Werror) and then the attribute could be changed. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 00:59:38 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 2CF97BE6; Fri, 30 Nov 2012 00:59:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1075E8FC14; Fri, 30 Nov 2012 00:59:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU0xbRk086991; Fri, 30 Nov 2012 00:59:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU0xbc1086989; Fri, 30 Nov 2012 00:59:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201211300059.qAU0xbc1086989@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 30 Nov 2012 00:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243685 - in head/sys: amd64/pci i386/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 00:59:38 -0000 Author: jkim Date: Fri Nov 30 00:59:37 2012 New Revision: 243685 URL: http://svnweb.freebsd.org/changeset/base/243685 Log: Tidy up inline assembly. No functional change. Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- head/sys/amd64/pci/pci_cfgreg.c Fri Nov 30 00:13:31 2012 (r243684) +++ head/sys/amd64/pci/pci_cfgreg.c Fri Nov 30 00:59:37 2012 (r243685) @@ -324,15 +324,15 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("mov %1, %%eax" : "=a" (data) + __asm __volatile("movl %1, %0" : "=a" (data) : "m" (*(uint32_t *)va)); break; case 2: - __asm __volatile("movzwl %1, %%eax" : "=a" (data) + __asm __volatile("movzwl %1, %0" : "=a" (data) : "m" (*(uint16_t *)va)); break; case 1: - __asm __volatile("movzbl %1, %%eax" : "=a" (data) + __asm __volatile("movzbl %1, %0" : "=a" (data) : "m" (*(uint8_t *)va)); break; } @@ -354,16 +354,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + __asm __volatile("movl %1, %0" : "=m" (*(uint32_t *)va) : "a" (data)); break; case 2: - __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) - : "a" (data)); + __asm __volatile("movw %1, %0" : "=m" (*(uint16_t *)va) + : "a" ((uint16_t)data)); break; case 1: - __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) - : "a" (data)); + __asm __volatile("movb %1, %0" : "=m" (*(uint8_t *)va) + : "a" ((uint8_t)data)); break; } } Modified: head/sys/i386/pci/pci_cfgreg.c ============================================================================== --- head/sys/i386/pci/pci_cfgreg.c Fri Nov 30 00:13:31 2012 (r243684) +++ head/sys/i386/pci/pci_cfgreg.c Fri Nov 30 00:59:37 2012 (r243685) @@ -681,15 +681,15 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("mov %1, %%eax" : "=a" (data) + __asm __volatile("movl %1, %0" : "=a" (data) : "m" (*(uint32_t *)va)); break; case 2: - __asm __volatile("movzwl %1, %%eax" : "=a" (data) + __asm __volatile("movzwl %1, %0" : "=a" (data) : "m" (*(uint16_t *)va)); break; case 1: - __asm __volatile("movzbl %1, %%eax" : "=a" (data) + __asm __volatile("movzbl %1, %0" : "=a" (data) : "m" (*(uint8_t *)va)); break; } @@ -718,16 +718,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + __asm __volatile("movl %1, %0" : "=m" (*(uint32_t *)va) : "a" (data)); break; case 2: - __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) - : "a" (data)); + __asm __volatile("movw %1, %0" : "=m" (*(uint16_t *)va) + : "a" ((uint16_t)data)); break; case 1: - __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) - : "a" (data)); + __asm __volatile("movb %1, %0" : "=m" (*(uint8_t *)va) + : "a" ((uint8_t)data)); break; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 01:13:37 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 6B09AE56; Fri, 30 Nov 2012 01:13:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id D46348FC0C; Fri, 30 Nov 2012 01:13:36 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAU1DVPB012214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Nov 2012 12:13:33 +1100 Date: Fri, 30 Nov 2012 12:13:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r243670 - head/share/man/man5 In-Reply-To: Message-ID: <20121130121105.W1707@besplex.bde.org> References: <201211291251.qATCpA7w078277@svn.freebsd.org> <20121130110154.E1441@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=FoRdZBXq c=1 sm=1 a=bvcLnixDC-gA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=TdF0Wd7UlPIA:10 a=wAwkY7PBfuqKK9cADVEA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 01:13:37 -0000 On Thu, 29 Nov 2012, Eitan Adler wrote: > On 29 November 2012 19:09, Bruce Evans wrote: >> On Thu, 29 Nov 2012, Eitan Adler wrote: > >> "gcc" was mostly correct here, since the flags are unportable gcc ones. >> They don't work with any "cc", but may work with clang, although this >> is unclear since none of them is documented in clang(1). > > Every time I talk to the clang folk about flags they point me to gcc > documentation. That's where I look too. It doesn't cover clang extensions. >> However, I never would have agreed to putting any of them here. >> >> Lots here is now superseded by flags set by WARNS anyway. >> >> clang's even more unportable new flags are not documented in clang(1) >> and the settings here are too old to have dreamed of these. > > The reference to BDECFLAGS actually isn't true - there is no such > variable. There is a *commented out* version which I had planned to > email you about at some point. The whole file src/share/examples/etc consists of commented-out examples and comments about the examples, with most of its value in the latter. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 01:37:07 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 95BB3312; Fri, 30 Nov 2012 01:37:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id 27A4C8FC14; Fri, 30 Nov 2012 01:37:06 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAU1atk9018159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Nov 2012 12:36:57 +1100 Date: Fri, 30 Nov 2012 12:36:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r243670 - head/share/man/man5 In-Reply-To: <20121130121105.W1707@besplex.bde.org> Message-ID: <20121130121426.X1735@besplex.bde.org> References: <201211291251.qATCpA7w078277@svn.freebsd.org> <20121130110154.E1441@besplex.bde.org> <20121130121105.W1707@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e5de0tV/ c=1 sm=1 a=bvcLnixDC-gA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=TdF0Wd7UlPIA:10 a=hT-wbfSIKCv8klB7IyYA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 01:37:07 -0000 On Fri, 30 Nov 2012, Bruce Evans wrote: > On Thu, 29 Nov 2012, Eitan Adler wrote: >> ... >> The reference to BDECFLAGS actually isn't true - there is no such >> variable. There is a *commented out* version which I had planned to >> email you about at some point. > > The whole file src/share/examples/etc consists of commented-out examples > and comments about the examples, with most of its value in the latter. PS: ... with many bad examples and no comments about the difficulty of changing or extending the defaultes in sys.mk using /etc/make.conf or the bugs if the bad examples are uncommented. Redefining CFLAGS is especially problematic. sys.mk uses "?=" on CFLAGS so that the command line has precedence. That doesn't work in /etc/make.conf, since CFLAGS is always defined when it is included. The correct fix is to include /etc/make.conf near the start of sys.mk and use "?=" in it. I'm not sure why that wasn't always done, but seem to remember some technical problems with this order too. I just use ifdefs like the following in /etc/make.conf: % .if ${CFLAGS} == "-O -pipe" % CFLAGS+= -mcpu=athlon-xp % .endif This adds to CFLAGS if and only if CFLAGS is identical to the default in sys.mk (with older sys.mk that hasn't been broken to default to -O2). % # CPUTYPE= athlon-xp I don't believe in using CPUTYPE or bsd.cpu.mk. If you use them, then the it becomes even more difficult to change or extend the defaults in all the nested include files. You have to look up the undocumented implementation details for the defaults and figure out where to put the changes. bsd.cpu.mk happens to be included after /etc/make.conf, so extending it in /etc/make.conf is impossible. It probably cannot be controlled by earlier settings, short of turning it all off. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 01:38:01 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 2E713484; Fri, 30 Nov 2012 01:38:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1476C8FC0C; Fri, 30 Nov 2012 01:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU1c0lp092237; Fri, 30 Nov 2012 01:38:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU1c092092235; Fri, 30 Nov 2012 01:38:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211300138.qAU1c092092235@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Nov 2012 01:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243686 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 01:38:01 -0000 Author: yongari Date: Fri Nov 30 01:38:00 2012 New Revision: 243686 URL: http://svnweb.freebsd.org/changeset/base/243686 Log: Add preliminary support for BCM57766 ASIC. While I'm here add BCM57762 device id which is found on Apple Thunderbolt ethernet. Tested by: Richard Kuhns < rjk <> wintek dot com > Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Nov 30 00:59:37 2012 (r243685) +++ head/sys/dev/bge/if_bge.c Fri Nov 30 01:38:00 2012 (r243686) @@ -216,7 +216,9 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57762 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57765 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57766 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57781 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57785 }, @@ -347,6 +349,7 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, { BGE_ASICREV_BCM57765, "unknown BCM57765" }, + { BGE_ASICREV_BCM57766, "unknown BCM57766" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { BGE_ASICREV_BCM5719, "unknown BCM5719" }, @@ -362,6 +365,7 @@ static const struct bge_revision bge_maj #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) #define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) #define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) +#define BGE_IS_57765_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_57765_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -2243,7 +2247,7 @@ bge_blockinit(struct bge_softc *sc) } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM57765) + BGE_IS_57765_PLUS(sc)) limit = 4; else limit = 1; @@ -2657,7 +2661,9 @@ bge_probe(device_t dev) BGE_PCI_GEN2_PRODID_ASICREV, 4); break; case BCOM_DEVICEID_BCM57761: + case BCOM_DEVICEID_BCM57762: case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57766: case BCOM_DEVICEID_BCM57781: case BCOM_DEVICEID_BCM57785: case BCOM_DEVICEID_BCM57791: @@ -3258,7 +3264,9 @@ bge_attach(device_t dev) BGE_PCI_GEN2_PRODID_ASICREV, 4); break; case BCOM_DEVICEID_BCM57761: + case BCOM_DEVICEID_BCM57762: case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57766: case BCOM_DEVICEID_BCM57781: case BCOM_DEVICEID_BCM57785: case BCOM_DEVICEID_BCM57791: @@ -3321,10 +3329,13 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM57765: + case BGE_ASICREV_BCM57766: + sc->bge_flags |= BGE_FLAG_57765_PLUS; + /* FALLTHROUGH */ case BGE_ASICREV_BCM5717: case BGE_ASICREV_BCM5719: case BGE_ASICREV_BCM5720: - case BGE_ASICREV_BCM57765: sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | BGE_FLAG_JUMBO_FRAME; @@ -3738,12 +3749,9 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_NO_3LED; if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && - sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM5719 && - sc->bge_asicrev != BGE_ASICREV_BCM5720 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && - sc->bge_asicrev != BGE_ASICREV_BCM57765 && - sc->bge_asicrev != BGE_ASICREV_BCM57780) { + sc->bge_asicrev != BGE_ASICREV_BCM57780 && + !BGE_IS_5717_PLUS(sc)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Fri Nov 30 00:59:37 2012 (r243685) +++ head/sys/dev/bge/if_bgereg.h Fri Nov 30 01:38:00 2012 (r243686) @@ -360,6 +360,7 @@ #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 #define BGE_ASICREV_BCM57765 0x57785 +#define BGE_ASICREV_BCM57766 0x57766 #define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ @@ -2483,7 +2484,9 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5906M 0x1713 #define BCOM_DEVICEID_BCM57760 0x1690 #define BCOM_DEVICEID_BCM57761 0x16B0 +#define BCOM_DEVICEID_BCM57762 0x1682 #define BCOM_DEVICEID_BCM57765 0x16B4 +#define BCOM_DEVICEID_BCM57766 0x1686 #define BCOM_DEVICEID_BCM57780 0x1692 #define BCOM_DEVICEID_BCM57781 0x16B1 #define BCOM_DEVICEID_BCM57785 0x16B5 @@ -2961,6 +2964,7 @@ struct bge_softc { #define BGE_FLAG_5755_PLUS 0x00100000 #define BGE_FLAG_5788 0x00200000 #define BGE_FLAG_5717_PLUS 0x00400000 +#define BGE_FLAG_57765_PLUS 0x00800000 #define BGE_FLAG_40BIT_BUG 0x01000000 #define BGE_FLAG_4G_BNDRY_BUG 0x02000000 #define BGE_FLAG_RX_ALIGNBUG 0x04000000 From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 02:31:08 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 D4317B90; Fri, 30 Nov 2012 02:31:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B77748FC08; Fri, 30 Nov 2012 02:31:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU2V8pZ099371; Fri, 30 Nov 2012 02:31:08 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU2V8Tq099370; Fri, 30 Nov 2012 02:31:08 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300231.qAU2V8Tq099370@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 02:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243687 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 02:31:09 -0000 Author: gonzo Date: Fri Nov 30 02:31:08 2012 New Revision: 243687 URL: http://svnweb.freebsd.org/changeset/base/243687 Log: Fix RGB565 case Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Nov 30 01:38:00 2012 (r243686) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Nov 30 02:31:08 2012 (r243687) @@ -776,11 +776,11 @@ bcmfb_putc(video_adapter_t *adp, vm_offs addr[3*j+2] = bcmfb_palette[color].b; break; case 16: - rgb = (bcmfb_palette[color].r >> 3) << 10; - rgb |= (bcmfb_palette[color].g >> 3) << 5; + rgb = (bcmfb_palette[color].r >> 3) << 11; + rgb |= (bcmfb_palette[color].g >> 2) << 5; rgb |= (bcmfb_palette[color].b >> 3); - addr[2*j] = (rgb >> 8) & 0xff; - addr[2*j + 1] = rgb & 0xff; + addr[2*j] = rgb & 0xff; + addr[2*j + 1] = (rgb >> 8) & 0xff; default: /* Not supported yet */ break; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 02:32:38 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 AA5DED0D; Fri, 30 Nov 2012 02:32:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 717AE8FC08; Fri, 30 Nov 2012 02:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU2WcAb099570; Fri, 30 Nov 2012 02:32:38 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU2WcTA099569; Fri, 30 Nov 2012 02:32:38 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300232.qAU2WcTA099569@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 02:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243688 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 02:32:38 -0000 Author: gonzo Date: Fri Nov 30 02:32:37 2012 New Revision: 243688 URL: http://svnweb.freebsd.org/changeset/base/243688 Log: Get frequency from "clock-frequency" property of "/axi/sdhci" FDT node Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 30 02:31:08 2012 (r243687) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 30 02:32:37 2012 (r243688) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -66,6 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include "sdhci_if.h" +#define BCM2835_DEFAULT_SDHCI_FREQ 50 + #define DEBUG #ifdef DEBUG @@ -129,10 +132,20 @@ bcm_sdhci_attach(device_t dev) { struct bcm_sdhci_softc *sc = device_get_softc(dev); int rid, err; + phandle_t node; + pcell_t cell; + int default_freq; sc->sc_dev = dev; sc->sc_req = NULL; + default_freq = BCM2835_DEFAULT_SDHCI_FREQ; + node = ofw_bus_get_node(sc->sc_dev); + if ((OF_getprop(node, "clock-frequency", &cell, sizeof(cell))) > 0) + default_freq = (int)fdt32_to_cpu(cell)/1000000; + + dprintf("SDHCI frequency: %dMHz\n", default_freq); + mtx_init(&sc->sc_mtx, "bcm sdhci", "sdhci", MTX_DEF); rid = 0; @@ -168,7 +181,7 @@ bcm_sdhci_attach(device_t dev) } sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180 | SDHCI_CAN_DO_HISPD; - sc->sc_slot.caps |= (50 << SDHCI_CLOCK_BASE_SHIFT); + sc->sc_slot.caps |= (default_freq << SDHCI_CLOCK_BASE_SHIFT); sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_MISSING_CAPS; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 02:35:13 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 CB6A7E97; Fri, 30 Nov 2012 02:35:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 950948FC08; Fri, 30 Nov 2012 02:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU2ZDHg099935; Fri, 30 Nov 2012 02:35:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU2ZDYR099933; Fri, 30 Nov 2012 02:35:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300235.qAU2ZDYR099933@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 02:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243689 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 02:35:13 -0000 Author: gonzo Date: Fri Nov 30 02:35:13 2012 New Revision: 243689 URL: http://svnweb.freebsd.org/changeset/base/243689 Log: - Get proper maximum clock frequency for SDHCI v3.0 and higher Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Fri Nov 30 02:32:37 2012 (r243688) +++ head/sys/dev/sdhci/sdhci.c Fri Nov 30 02:35:13 2012 (r243689) @@ -96,6 +96,8 @@ static void sdhci_card_task(void *, int) #define SDHCI_ASSERT_LOCKED(_slot) mtx_assert(&_slot->mtx, MA_OWNED); #define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert(&_slot->mtx, MA_NOTOWNED); +#define SDHCI_DEFAULT_MAX_FREQ 50 + static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -516,12 +518,16 @@ sdhci_init_slot(device_t dev, struct sdh else caps = RD4(slot, SDHCI_CAPABILITIES); /* Calculate base clock frequency. */ - slot->max_clk = - (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; + if (slot->version >= SDHCI_SPEC_300) + slot->max_clk = (caps & SDHCI_CLOCK_V3_BASE_MASK) + >> SDHCI_CLOCK_BASE_SHIFT; + else + slot->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) + >> SDHCI_CLOCK_BASE_SHIFT; if (slot->max_clk == 0) { - slot->max_clk = 50; + slot->max_clk = SDHCI_DEFAULT_MAX_FREQ; device_printf(dev, "Hardware doesn't specify base clock " - "frequency.\n"); + "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } slot->max_clk *= 1000000; /* Calculate timeout clock frequency. */ Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Fri Nov 30 02:32:37 2012 (r243688) +++ head/sys/dev/sdhci/sdhci.h Fri Nov 30 02:35:13 2012 (r243689) @@ -191,6 +191,7 @@ #define SDHCI_TIMEOUT_CLK_SHIFT 0 #define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 #define SDHCI_CLOCK_BASE_MASK 0x00003F00 +#define SDHCI_CLOCK_V3_BASE_MASK 0x0000FF00 #define SDHCI_CLOCK_BASE_SHIFT 8 #define SDHCI_MAX_BLOCK_MASK 0x00030000 #define SDHCI_MAX_BLOCK_SHIFT 16 From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:08:50 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 100C3C40; Fri, 30 Nov 2012 03:08:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E83498FC0C; Fri, 30 Nov 2012 03:08:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU38nS6005120; Fri, 30 Nov 2012 03:08:49 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU38nQe005118; Fri, 30 Nov 2012 03:08:49 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300308.qAU38nQe005118@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 03:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243690 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:08:50 -0000 Author: gonzo Date: Fri Nov 30 03:08:49 2012 New Revision: 243690 URL: http://svnweb.freebsd.org/changeset/base/243690 Log: Add fdt_get_reserved_regions function. API is simmilar to fdt_get_mem_regions It returns memory regions restricted from being used by kernel. These regions are dfined in "memreserve" property of root node in the same format as "reg" property of /memory node Modified: head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Fri Nov 30 02:35:13 2012 (r243689) +++ head/sys/dev/fdt/fdt_common.c Fri Nov 30 03:08:49 2012 (r243690) @@ -634,6 +634,66 @@ fdt_get_phyaddr(phandle_t node, device_t } int +fdt_get_reserved_regions(struct mem_region *mr, int *mrcnt) +{ + pcell_t reserve[FDT_REG_CELLS * FDT_MEM_REGIONS]; + pcell_t *reservep; + phandle_t memory, root; + uint32_t memory_size; + int addr_cells, size_cells; + int i, max_size, res_len, rv, tuple_size, tuples; + + max_size = sizeof(reserve); + root = OF_finddevice("/"); + memory = OF_finddevice("/memory"); + if (memory == -1) { + rv = ENXIO; + goto out; + } + + if ((rv = fdt_addrsize_cells(OF_parent(memory), &addr_cells, + &size_cells)) != 0) + goto out; + + if (addr_cells > 2) { + rv = ERANGE; + goto out; + } + + tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); + + res_len = OF_getproplen(root, "memreserve"); + if (res_len <= 0 || res_len > sizeof(reserve)) { + rv = ERANGE; + goto out; + } + + if (OF_getprop(root, "memreserve", reserve, res_len) <= 0) { + rv = ENXIO; + goto out; + } + + memory_size = 0; + tuples = res_len / tuple_size; + reservep = (pcell_t *)&reserve; + for (i = 0; i < tuples; i++) { + + rv = fdt_data_to_res(reservep, addr_cells, size_cells, + (u_long *)&mr[i].mr_start, (u_long *)&mr[i].mr_size); + + if (rv != 0) + goto out; + + reservep += addr_cells + size_cells; + } + + *mrcnt = i; + rv = 0; +out: + return (rv); +} + +int fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, uint32_t *memsize) { pcell_t reg[FDT_REG_CELLS * FDT_MEM_REGIONS]; Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Fri Nov 30 02:35:13 2012 (r243689) +++ head/sys/dev/fdt/fdt_common.h Fri Nov 30 03:08:49 2012 (r243690) @@ -90,6 +90,7 @@ int fdt_data_to_res(pcell_t *, int, int, int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); +int fdt_get_reserved_regions(struct mem_region *, int *); int fdt_get_phyaddr(phandle_t, device_t, int *, void **); int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:11:03 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 9910ADF7; Fri, 30 Nov 2012 03:11:03 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7ED308FC08; Fri, 30 Nov 2012 03:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3B3qr005547; Fri, 30 Nov 2012 03:11:03 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3B3T1005546; Fri, 30 Nov 2012 03:11:03 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300311.qAU3B3T1005546@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 03:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243691 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:11:03 -0000 Author: gonzo Date: Fri Nov 30 03:11:03 2012 New Revision: 243691 URL: http://svnweb.freebsd.org/changeset/base/243691 Log: Get reserved memory regions and exclude them from available memory map Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Nov 30 03:08:49 2012 (r243690) +++ head/sys/arm/arm/machdep.c Fri Nov 30 03:11:03 2012 (r243691) @@ -1144,7 +1144,9 @@ physmap_init(struct mem_region *availmem void * initarm(struct arm_boot_params *abp) { + struct mem_region memory_regions[FDT_MEM_REGIONS]; struct mem_region availmem_regions[FDT_MEM_REGIONS]; + struct mem_region reserved_regions[FDT_MEM_REGIONS]; struct pv_addr kernel_l1pt; struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; @@ -1154,7 +1156,12 @@ initarm(struct arm_boot_params *abp) void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; + int memory_regions_sz; int availmem_regions_sz; + int reserved_regions_sz; + vm_offset_t start, end; + vm_offset_t rstart, rend; + int curr; lastaddr = parse_boot_param(abp); memsize = 0; @@ -1185,10 +1192,73 @@ initarm(struct arm_boot_params *abp) while (1); /* Grab physical memory regions information from device tree. */ - if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz, + if (fdt_get_mem_regions(memory_regions, &memory_regions_sz, &memsize) != 0) while(1); + /* Grab physical memory regions information from device tree. */ + if (fdt_get_reserved_regions(reserved_regions, &reserved_regions_sz) != 0) + reserved_regions_sz = 0; + + /* + * Now exclude all the reserved regions + */ + curr = 0; + for (i = 0; i < memory_regions_sz; i++) { + start = memory_regions[i].mr_start; + end = start + memory_regions[i].mr_size; + for (j = 0; j < reserved_regions_sz; j++) { + rstart = reserved_regions[j].mr_start; + rend = rstart + reserved_regions[j].mr_size; + /* + * Restricted region is before available + * Skip restricted region + */ + if (rend <= start) + continue; + /* + * Restricted region is behind available + * No further processing required + */ + if (rstart >= end) + break; + /* + * Restricted region includes memory region + * skip availble region + */ + if ((start >= rstart) && (rend >= end)) { + start = rend; + end = rend; + break; + } + /* + * Memory region includes restricted region + */ + if ((rstart > start) && (end > rend)) { + availmem_regions[curr].mr_start = start; + availmem_regions[curr++].mr_size = rstart - start; + start = rend; + break; + } + /* + * Memory region partially overlaps with restricted + */ + if ((rstart >= start) && (rstart <= end)) { + end = rstart; + } + else if ((rend >= start) && (rend <= end)) { + start = rend; + } + } + + if (end > start) { + availmem_regions[curr].mr_start = start; + availmem_regions[curr++].mr_size = end - start; + } + } + + availmem_regions_sz = curr; + /* Platform-specific initialisation */ pmap_bootstrap_lastaddr = initarm_lastaddr(); From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:14:12 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 63BD2F88; Fri, 30 Nov 2012 03:14:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 482488FC12; Fri, 30 Nov 2012 03:14:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3ECrT006025; Fri, 30 Nov 2012 03:14:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3ECkD006024; Fri, 30 Nov 2012 03:14:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211300314.qAU3ECkD006024@svn.freebsd.org> From: Adrian Chadd Date: Fri, 30 Nov 2012 03:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243692 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:14:12 -0000 Author: adrian Date: Fri Nov 30 03:14:11 2012 New Revision: 243692 URL: http://svnweb.freebsd.org/changeset/base/243692 Log: Include opt_wlan.h so the net80211 RX debug API compiles correctly. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Nov 30 03:11:03 2012 (r243691) +++ head/sys/dev/iwn/if_iwn.c Fri Nov 30 03:14:11 2012 (r243692) @@ -26,6 +26,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:15:50 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 8A7B017C; Fri, 30 Nov 2012 03:15:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EB588FC13; Fri, 30 Nov 2012 03:15:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3Fo9q006255; Fri, 30 Nov 2012 03:15:50 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3FoRU006253; Fri, 30 Nov 2012 03:15:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300315.qAU3FoRU006253@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 03:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243693 - in head/sys/boot: fdt uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:15:50 -0000 Author: gonzo Date: Fri Nov 30 03:15:50 2012 New Revision: 243693 URL: http://svnweb.freebsd.org/changeset/base/243693 Log: - Implement "fdt mres" sub-command that prints reserved memory regions - Add "fdt addr" subcommand that lets you specify preloaded blob address - Do not pre-initialize blob for "fdt addr" - Do not try to load dtb every time fdt subcommand is issued, do it only once - Change the way DTB is passed to kernel. With introduction of "fdt addr" actual blob address can be not virtual but physical or reside in area higher then 64Mb. ubldr should create copy of it in kernel area and pass pointer to this newly allocated buffer which is guaranteed to work in kernel after switching on MMU. - Convert memreserv FDT info to "memreserv" property of root node FDT uses /memreserve/ data to notify OS about reserved memory areas. Technically it's not real property, it's just data blob, sequence of pairs where both start and size are 64-bit integers. It doesn't fit nicely with OF API we use in kernel, so in order to unify thing ubldr converts this data to "memreserve" property using the same format for addresses and sizes as /memory node. Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Fri Nov 30 03:14:11 2012 (r243692) +++ head/sys/boot/fdt/fdt_loader_cmd.c Fri Nov 30 03:15:50 2012 (r243693) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "glue.h" -#define DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -62,6 +60,8 @@ __FBSDID("$FreeBSD$"); #define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" +#define CMD_REQUIRES_BLOB 0x01 + /* Local copy of FDT */ static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ @@ -69,8 +69,11 @@ static size_t fdtp_size = 0; /* Location of FDT in kernel or module */ static vm_offset_t fdtp_va = 0; +static int fdt_load_dtb(vm_offset_t va); + static int fdt_cmd_nyi(int argc, char *argv[]); +static int fdt_cmd_addr(int argc, char *argv[]); static int fdt_cmd_mkprop(int argc, char *argv[]); static int fdt_cmd_cd(int argc, char *argv[]); static int fdt_cmd_hdr(int argc, char *argv[]); @@ -79,25 +82,28 @@ static int fdt_cmd_prop(int argc, char * static int fdt_cmd_pwd(int argc, char *argv[]); static int fdt_cmd_rm(int argc, char *argv[]); static int fdt_cmd_mknode(int argc, char *argv[]); +static int fdt_cmd_mres(int argc, char *argv[]); typedef int cmdf_t(int, char *[]); struct cmdtab { char *name; cmdf_t *handler; + int flags; }; static const struct cmdtab commands[] = { - { "alias", &fdt_cmd_nyi }, - { "cd", &fdt_cmd_cd }, - { "header", &fdt_cmd_hdr }, - { "ls", &fdt_cmd_ls }, - { "mknode", &fdt_cmd_mknode }, - { "mkprop", &fdt_cmd_mkprop }, - { "mres", &fdt_cmd_nyi }, - { "prop", &fdt_cmd_prop }, - { "pwd", &fdt_cmd_pwd }, - { "rm", &fdt_cmd_rm }, + { "addr", &fdt_cmd_addr, 0 }, + { "alias", &fdt_cmd_nyi, 0 }, + { "cd", &fdt_cmd_cd, CMD_REQUIRES_BLOB }, + { "header", &fdt_cmd_hdr, CMD_REQUIRES_BLOB }, + { "ls", &fdt_cmd_ls, CMD_REQUIRES_BLOB }, + { "mknode", &fdt_cmd_mknode, CMD_REQUIRES_BLOB }, + { "mkprop", &fdt_cmd_mkprop, CMD_REQUIRES_BLOB }, + { "mres", &fdt_cmd_mres, CMD_REQUIRES_BLOB }, + { "prop", &fdt_cmd_prop, CMD_REQUIRES_BLOB }, + { "pwd", &fdt_cmd_pwd, CMD_REQUIRES_BLOB }, + { "rm", &fdt_cmd_rm, CMD_REQUIRES_BLOB }, { NULL, NULL } }; @@ -128,7 +134,7 @@ fdt_find_static_dtb() if (md == NULL) return (0); bcopy(md->md_data, &esym, sizeof(esym)); - // esym is already offset + /* esym is already offset */ md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); if (md == NULL) @@ -188,53 +194,67 @@ fdt_find_static_dtb() } static int -fdt_setup_fdtp() +fdt_load_dtb(vm_offset_t va) { struct fdt_header header; - struct preloaded_file *bfp; int err; + COPYOUT(va, &header, sizeof(header)); + err = fdt_check_header(&header); + if (err < 0) { + if (err == -FDT_ERR_BADVERSION) + sprintf(command_errbuf, + "incompatible blob version: %d, should be: %d", + fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); + + else + sprintf(command_errbuf, "error validating blob: %s", + fdt_strerror(err)); + return (1); + } + /* - * Find the device tree blob. + * Release previous blob */ - bfp = file_findfile(NULL, "dtb"); - if (bfp == NULL) { - if ((fdtp_va = fdt_find_static_dtb()) == 0) { - command_errmsg = "no device tree blob found!"; - printf("%s\n", command_errmsg); - return (CMD_ERROR); - } - } else { - /* Dynamic blob has precedence over static. */ - fdtp_va = bfp->f_addr; - } + if (fdtp) + free(fdtp); - COPYOUT(fdtp_va, &header, sizeof(header)); fdtp_size = fdt_totalsize(&header); fdtp = malloc(fdtp_size); + if (fdtp == NULL) { command_errmsg = "can't allocate memory for device tree copy"; - printf("%s\n", command_errmsg); - return (CMD_ERROR); + return (1); } - COPYOUT(fdtp_va, fdtp, fdtp_size); - /* - * Validate the blob. - */ - err = fdt_check_header(fdtp); - if (err < 0) { - if (err == -FDT_ERR_BADVERSION) - sprintf(command_errbuf, - "incompatible blob version: %d, should be: %d", - fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); + fdtp_va = va; + COPYOUT(va, fdtp, fdtp_size); + debugf("DTB blob found at 0x%jx, size: 0x%jx\n", (uintmax_t)va, (uintmax_t)fdtp_size); - else - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); - return (CMD_ERROR); + return (0); +} + +static int +fdt_setup_fdtp() +{ + struct preloaded_file *bfp; + vm_offset_t va; + + bfp = file_findfile(NULL, "dtb"); + if (bfp == NULL) { + if ((va = fdt_find_static_dtb()) == 0) { + command_errmsg = "no device tree blob found!"; + return (1); + } + } else { + /* Dynamic blob has precedence over static. */ + va = bfp->f_addr; } - return (CMD_OK); + + if (fdt_load_dtb(va) != 0) + return (1); + + return (0); } #define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ @@ -414,6 +434,8 @@ fixup_memory(struct sys_info *si) uint32_t *addr_cellsp, *reg, *size_cellsp; int err, i, len, memory, realmrno, root; uint8_t *buf, *sb; + uint64_t rstart, rsize; + int reserved; root = fdt_path_offset(fdtp, "/"); if (root < 0) { @@ -453,6 +475,52 @@ fixup_memory(struct sys_info *si) addr_cells = fdt32_to_cpu(*addr_cellsp); size_cells = fdt32_to_cpu(*size_cellsp); + /* + * Convert memreserve data to memreserve property + * Check if property already exists + */ + reserved = fdt_num_mem_rsv(fdtp); + if (reserved && + (fdt_getprop(fdtp, root, "memreserve", NULL) == NULL)) { + len = (addr_cells + size_cells) * reserved * sizeof(uint32_t); + sb = buf = (uint8_t *)malloc(len); + if (!buf) + return; + + bzero(buf, len); + + for (i = 0; i < reserved; i++) { + curmr = &si->mr[i]; + if (fdt_get_mem_rsv(fdtp, i, &rstart, &rsize)) + break; + if (rsize) { + /* Ensure endianess, and put cells into a buffer */ + if (addr_cells == 2) + *(uint64_t *)buf = + cpu_to_fdt64(rstart); + else + *(uint32_t *)buf = + cpu_to_fdt32(rstart); + + buf += sizeof(uint32_t) * addr_cells; + if (size_cells == 2) + *(uint64_t *)buf = + cpu_to_fdt64(rsize); + else + *(uint32_t *)buf = + cpu_to_fdt32(rsize); + + buf += sizeof(uint32_t) * size_cells; + } + } + + /* Set property */ + if ((err = fdt_setprop(fdtp, root, "memreserve", sb, len)) < 0) + printf("Could not fixup 'memreserve' property.\n"); + + free(sb); + } + /* Count valid memory regions entries in sysinfo. */ realmrno = si->mr_no; for (i = 0; i < si->mr_no; i++) @@ -509,6 +577,8 @@ fixup_memory(struct sys_info *si) /* Set property */ if ((err = fdt_setprop(fdtp, memory, "reg", sb, len)) < 0) sprintf(command_errbuf, "Could not fixup '/memory' node.\n"); + + free(sb); } void @@ -564,7 +634,7 @@ fixup_stdout(const char *env) /* * Locate the blob, fix it up and return its location. */ -vm_offset_t +static vm_offset_t fdt_fixup(void) { const char *env; @@ -577,10 +647,12 @@ fdt_fixup(void) ethstr = NULL; len = 0; - err = fdt_setup_fdtp(); - if (err) { - sprintf(command_errbuf, "No valid device tree blob found!"); - return (0); + if (fdtp == NULL) { + err = fdt_setup_fdtp(); + if (err) { + sprintf(command_errbuf, "No valid device tree blob found!"); + return (0); + } } /* Create /chosen node (if not exists) */ @@ -640,10 +712,36 @@ success: return (fdtp_va); } +/* + * Copy DTB blob to specified location and its return size + */ +int +fdt_copy(vm_offset_t va) +{ + int err; + + if (fdtp == NULL) { + err = fdt_setup_fdtp(); + if (err) { + printf("No valid device tree blob found!"); + return (0); + } + } + + if (fdt_fixup() == 0) + return (0); + + COPYIN(fdtp, va, fdtp_size); + return (fdtp_size); +} + + + int command_fdt_internal(int argc, char *argv[]) { cmdf_t *cmdh; + int flags; char *cmd; int i, err; @@ -653,12 +751,6 @@ command_fdt_internal(int argc, char *arg } /* - * Check if uboot env vars were parsed already. If not, do it now. - */ - if (fdt_fixup() == 0) - return (CMD_ERROR); - - /* * Validate fdt . */ cmd = strdup(argv[1]); @@ -668,6 +760,7 @@ command_fdt_internal(int argc, char *arg if (strcmp(cmd, commands[i].name) == 0) { /* found it */ cmdh = commands[i].handler; + flags = commands[i].flags; break; } i++; @@ -677,6 +770,14 @@ command_fdt_internal(int argc, char *arg return (CMD_ERROR); } + if (flags & CMD_REQUIRES_BLOB) { + /* + * Check if uboot env vars were parsed already. If not, do it now. + */ + if (fdt_fixup() == 0) + return (CMD_ERROR); + } + /* * Call command handler. */ @@ -686,6 +787,31 @@ command_fdt_internal(int argc, char *arg } static int +fdt_cmd_addr(int argc, char *argv[]) +{ + vm_offset_t va; + char *addr, *cp; + + if (argc > 2) + addr = argv[2]; + else { + sprintf(command_errbuf, "no address specified"); + return (CMD_ERROR); + } + + va = strtol(addr, &cp, 0); + if (cp == addr) { + sprintf(command_errbuf, "Invalid address: %s", addr); + return (CMD_ERROR); + } + + if (fdt_load_dtb(va) != 0) + return (CMD_ERROR); + + return (CMD_OK); +} + +static int fdt_cmd_cd(int argc, char *argv[]) { char *path; @@ -1445,6 +1571,30 @@ fdt_cmd_pwd(int argc, char *argv[]) } static int +fdt_cmd_mres(int argc, char *argv[]) +{ + uint64_t start, size; + int i, total; + char line[80]; + + pager_open(); + total = fdt_num_mem_rsv(fdtp); + if (total > 0) { + pager_output("Reserved memory regions:\n"); + for (i = 0; i < total; i++) { + fdt_get_mem_rsv(fdtp, i, &start, &size); + sprintf(line, "reg#%d: (start: 0x%jx, size: 0x%jx)\n", + i, start, size); + pager_output(line); + } + } else + pager_output("No reserved memory regions\n"); + pager_close(); + + return (CMD_OK); +} + +static int fdt_cmd_nyi(int argc, char *argv[]) { Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Fri Nov 30 03:14:11 2012 (r243692) +++ head/sys/boot/uboot/common/metadata.c Fri Nov 30 03:15:50 2012 (r243693) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -extern vm_offset_t fdt_fixup(void); +extern int fdt_copy(vm_offset_t); #endif /* @@ -279,7 +279,10 @@ md_load(char *args, vm_offset_t *modulep vm_offset_t envp; vm_offset_t size; vm_offset_t vaddr; +#if defined(LOADER_FDT_SUPPORT) vm_offset_t dtbp; + int dtb_size; +#endif char *rootdevname; int howto; int i; @@ -325,6 +328,16 @@ md_load(char *args, vm_offset_t *modulep /* Pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); +#if defined(LOADER_FDT_SUPPORT) + /* Handle device tree blob */ + dtbp = addr; + dtb_size = fdt_copy(addr); + + /* Pad to a page boundary */ + if (dtb_size) + addr += roundup(dtb_size, PAGE_SIZE); +#endif + kernend = 0; kfp = file_findfile(NULL, "elf32 kernel"); if (kfp == NULL) @@ -335,9 +348,7 @@ md_load(char *args, vm_offset_t *modulep file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); #if defined(LOADER_FDT_SUPPORT) - /* Handle device tree blob */ - dtbp = fdt_fixup(); - if (dtbp != 0) + if (dtb_size) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); else pager_output("WARNING! Trying to fire up the kernel, but no " From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:16:45 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 BEABD2F2; Fri, 30 Nov 2012 03:16:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A36BA8FC15; Fri, 30 Nov 2012 03:16:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3GjfP006395; Fri, 30 Nov 2012 03:16:45 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3Gjx4006393; Fri, 30 Nov 2012 03:16:45 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300316.qAU3Gjx4006393@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 03:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243694 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:16:45 -0000 Author: gonzo Date: Fri Nov 30 03:16:45 2012 New Revision: 243694 URL: http://svnweb.freebsd.org/changeset/base/243694 Log: Add vchiq node Modified: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Modified: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts ============================================================================== --- head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Fri Nov 30 03:15:50 2012 (r243693) +++ head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Fri Nov 30 03:16:45 2012 (r243694) @@ -471,6 +471,13 @@ reg-shift = <2>; }; + vchiq { + compatible = "broadcom,bcm2835-vchiq"; + reg = <0xB800 0x50>; + interrupts = <2>; + interrupt-parent = <&intc>; + }; + usb { compatible = "broadcom,bcm2835-usb", "broadcom,bcm2708-usb", "synopsys,designware-hs-otg2"; reg = <0x980000 0x20000>; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:38: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 3B2CB656; Fri, 30 Nov 2012 03:38:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F51F8FC08; Fri, 30 Nov 2012 03:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3c1Iq008989; Fri, 30 Nov 2012 03:38:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3c1gx008988; Fri, 30 Nov 2012 03:38:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300338.qAU3c1gx008988@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243695 - stable/7/sys/dev/mfi X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:38:02 -0000 Author: eadler Date: Fri Nov 30 03:38:01 2012 New Revision: 243695 URL: http://svnweb.freebsd.org/changeset/base/243695 Log: MFC r243078: Add deviceid to the disk output on boot to help debugging. PR: kern/173290 Approved by: cperciva (implicit) Modified: stable/7/sys/dev/mfi/mfi_syspd.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/7/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:16:45 2012 (r243694) +++ stable/7/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:01 2012 (r243695) @@ -116,8 +116,8 @@ mfi_syspd_attach(device_t dev) mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); mtx_unlock(&sc->pd_controller->mfi_io_lock); - device_printf(dev, "%juMB (%ju sectors) SYSPD volume\n", - sectors / (1024 * 1024 / secsize), sectors); + device_printf(dev, "%juMB (%ju sectors) SYSPD volume (deviceid: %d)\n", + sectors / (1024 * 1024 / secsize), sectors, sc->pd_id); sc->pd_disk = disk_alloc(); sc->pd_disk->d_drv1 = sc; sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:38: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 82FE1658; Fri, 30 Nov 2012 03:38:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 67F908FC12; Fri, 30 Nov 2012 03:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3c2o0009006; Fri, 30 Nov 2012 03:38:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3c2nP009005; Fri, 30 Nov 2012 03:38:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300338.qAU3c2nP009005@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243696 - stable/8/sys/dev/mfi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:38:02 -0000 Author: eadler Date: Fri Nov 30 03:38:01 2012 New Revision: 243696 URL: http://svnweb.freebsd.org/changeset/base/243696 Log: MFC r243078: Add deviceid to the disk output on boot to help debugging. PR: kern/173290 Approved by: cperciva (implicit) Modified: stable/8/sys/dev/mfi/mfi_syspd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:01 2012 (r243695) +++ stable/8/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:01 2012 (r243696) @@ -116,8 +116,8 @@ mfi_syspd_attach(device_t dev) mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); mtx_unlock(&sc->pd_controller->mfi_io_lock); - device_printf(dev, "%juMB (%ju sectors) SYSPD volume\n", - sectors / (1024 * 1024 / secsize), sectors); + device_printf(dev, "%juMB (%ju sectors) SYSPD volume (deviceid: %d)\n", + sectors / (1024 * 1024 / secsize), sectors, sc->pd_id); sc->pd_disk = disk_alloc(); sc->pd_disk->d_drv1 = sc; sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:38:03 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 800C1659; Fri, 30 Nov 2012 03:38:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64EA08FC14; Fri, 30 Nov 2012 03:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3c30H009044; Fri, 30 Nov 2012 03:38:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3c33n009043; Fri, 30 Nov 2012 03:38:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300338.qAU3c33n009043@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243697 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:38:03 -0000 Author: eadler Date: Fri Nov 30 03:38:02 2012 New Revision: 243697 URL: http://svnweb.freebsd.org/changeset/base/243697 Log: MFC r243078: Add deviceid to the disk output on boot to help debugging. PR: kern/173290 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/mfi/mfi_syspd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:01 2012 (r243696) +++ stable/9/sys/dev/mfi/mfi_syspd.c Fri Nov 30 03:38:02 2012 (r243697) @@ -116,8 +116,8 @@ mfi_syspd_attach(device_t dev) mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); mtx_unlock(&sc->pd_controller->mfi_io_lock); - device_printf(dev, "%juMB (%ju sectors) SYSPD volume\n", - sectors / (1024 * 1024 / secsize), sectors); + device_printf(dev, "%juMB (%ju sectors) SYSPD volume (deviceid: %d)\n", + sectors / (1024 * 1024 / secsize), sectors, sc->pd_id); sc->pd_disk = disk_alloc(); sc->pd_disk->d_drv1 = sc; sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:48:46 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 10106B54; Fri, 30 Nov 2012 03:48:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC21B8FC0C; Fri, 30 Nov 2012 03:48:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3mjV1010619; Fri, 30 Nov 2012 03:48:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3mjjR010617; Fri, 30 Nov 2012 03:48:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300348.qAU3mjjR010617@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243699 - stable/8/sbin/umount X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:48:46 -0000 Author: eadler Date: Fri Nov 30 03:48:45 2012 New Revision: 243699 URL: http://svnweb.freebsd.org/changeset/base/243699 Log: MFC r243082: Fix memory leak in umount.c PR: bin/172553 Approved by: cperciva (implicit) Modified: stable/8/sbin/umount/umount.c Directory Properties: stable/8/sbin/umount/ (props changed) Modified: stable/8/sbin/umount/umount.c ============================================================================== --- stable/8/sbin/umount/umount.c Fri Nov 30 03:48:45 2012 (r243698) +++ stable/8/sbin/umount/umount.c Fri Nov 30 03:48:45 2012 (r243699) @@ -357,8 +357,10 @@ umountfs(struct statfs *sfs) do_rpc = 1; } - if (!namematch(ai)) + if (!namematch(ai)) { + free(orignfsdirname); return (1); + } /* First try to unmount using the file system ID. */ snprintf(fsidbuf, sizeof(fsidbuf), "FSID:%d:%d", sfs->f_fsid.val[0], sfs->f_fsid.val[1]); @@ -367,13 +369,16 @@ umountfs(struct statfs *sfs) if (errno != ENOENT || sfs->f_fsid.val[0] != 0 || sfs->f_fsid.val[1] != 0) warn("unmount of %s failed", sfs->f_mntonname); - if (errno != ENOENT) + if (errno != ENOENT) { + free(orignfsdirname); return (1); + } /* Compatibility for old kernels. */ if (sfs->f_fsid.val[0] != 0 || sfs->f_fsid.val[1] != 0) warnx("retrying using path instead of file system ID"); if (unmount(sfs->f_mntonname, fflag) != 0) { warn("unmount of %s failed", sfs->f_mntonname); + free(orignfsdirname); return (1); } } @@ -391,6 +396,7 @@ umountfs(struct statfs *sfs) if (clp == NULL) { warnx("%s: %s", hostp, clnt_spcreateerror("MOUNTPROG")); + free(orignfsdirname); return (1); } clp->cl_auth = authsys_create_default(); @@ -401,6 +407,7 @@ umountfs(struct statfs *sfs) if (clnt_stat != RPC_SUCCESS) { warnx("%s: %s", hostp, clnt_sperror(clp, "RPCMNT_UMOUNT")); + free(orignfsdirname); return (1); } /* @@ -413,10 +420,10 @@ umountfs(struct statfs *sfs) hostp, nfsdirname); free_mtab(); } - free(orignfsdirname); auth_destroy(clp->cl_auth); clnt_destroy(clp); } + free(orignfsdirname); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 03:48:46 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 1079AB55; Fri, 30 Nov 2012 03:48:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEFE68FC16; Fri, 30 Nov 2012 03:48:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU3mj5j010620; Fri, 30 Nov 2012 03:48:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU3mjRQ010618; Fri, 30 Nov 2012 03:48:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211300348.qAU3mjRQ010618@svn.freebsd.org> From: Eitan Adler Date: Fri, 30 Nov 2012 03:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243698 - stable/9/sbin/umount X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 03:48:46 -0000 Author: eadler Date: Fri Nov 30 03:48:45 2012 New Revision: 243698 URL: http://svnweb.freebsd.org/changeset/base/243698 Log: MFC r243082: Fix memory leak in umount.c PR: bin/172553 Approved by: cperciva (implicit) Modified: stable/9/sbin/umount/umount.c Directory Properties: stable/9/sbin/umount/ (props changed) Modified: stable/9/sbin/umount/umount.c ============================================================================== --- stable/9/sbin/umount/umount.c Fri Nov 30 03:38:02 2012 (r243697) +++ stable/9/sbin/umount/umount.c Fri Nov 30 03:48:45 2012 (r243698) @@ -359,8 +359,10 @@ umountfs(struct statfs *sfs) do_rpc = 1; } - if (!namematch(ai)) + if (!namematch(ai)) { + free(orignfsdirname); return (1); + } /* First try to unmount using the file system ID. */ snprintf(fsidbuf, sizeof(fsidbuf), "FSID:%d:%d", sfs->f_fsid.val[0], sfs->f_fsid.val[1]); @@ -369,13 +371,16 @@ umountfs(struct statfs *sfs) if (errno != ENOENT || sfs->f_fsid.val[0] != 0 || sfs->f_fsid.val[1] != 0) warn("unmount of %s failed", sfs->f_mntonname); - if (errno != ENOENT) + if (errno != ENOENT) { + free(orignfsdirname); return (1); + } /* Compatibility for old kernels. */ if (sfs->f_fsid.val[0] != 0 || sfs->f_fsid.val[1] != 0) warnx("retrying using path instead of file system ID"); if (unmount(sfs->f_mntonname, fflag) != 0) { warn("unmount of %s failed", sfs->f_mntonname); + free(orignfsdirname); return (1); } } @@ -393,6 +398,7 @@ umountfs(struct statfs *sfs) if (clp == NULL) { warnx("%s: %s", hostp, clnt_spcreateerror("MOUNTPROG")); + free(orignfsdirname); return (1); } clp->cl_auth = authsys_create_default(); @@ -403,6 +409,7 @@ umountfs(struct statfs *sfs) if (clnt_stat != RPC_SUCCESS) { warnx("%s: %s", hostp, clnt_sperror(clp, "RPCMNT_UMOUNT")); + free(orignfsdirname); return (1); } /* @@ -415,10 +422,10 @@ umountfs(struct statfs *sfs) hostp, nfsdirname); free_mtab(); } - free(orignfsdirname); auth_destroy(clp->cl_auth); clnt_destroy(clp); } + free(orignfsdirname); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 04:44: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 8F4DF7D6; Fri, 30 Nov 2012 04:44:32 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7392E8FC14; Fri, 30 Nov 2012 04:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU4iWd3017659; Fri, 30 Nov 2012 04:44:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU4iWQi017657; Fri, 30 Nov 2012 04:44:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201211300444.qAU4iWQi017657@svn.freebsd.org> From: Neel Natu Date: Fri, 30 Nov 2012 04:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243700 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 04:44:32 -0000 Author: neel Date: Fri Nov 30 04:44:32 2012 New Revision: 243700 URL: http://svnweb.freebsd.org/changeset/base/243700 Log: Teach userboot to boot from ISO image files. Reviewed by: ae@, dfr@ Obtained from: NetApp Modified: head/sys/boot/userboot/userboot/conf.c head/sys/boot/userboot/userboot/main.c Modified: head/sys/boot/userboot/userboot/conf.c ============================================================================== --- head/sys/boot/userboot/userboot/conf.c Fri Nov 30 03:48:45 2012 (r243699) +++ head/sys/boot/userboot/userboot/conf.c Fri Nov 30 04:44:32 2012 (r243700) @@ -57,6 +57,7 @@ struct devsw *devsw[] = { struct fs_ops *file_system[] = { &host_fsops, &ufs_fsops, + &cd9660_fsops, &gzipfs_fsops, NULL }; Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Fri Nov 30 03:48:45 2012 (r243699) +++ head/sys/boot/userboot/userboot/main.c Fri Nov 30 04:44:32 2012 (r243700) @@ -153,11 +153,13 @@ extract_currdev(void) dev.d_slice = 0; dev.d_partition = 0; /* - * Figure out if we are using MBR or GPT - for GPT we - * set the partition to 0 since everything is a GPT slice. + * If we cannot auto-detect the partition type then + * access the disk as a raw device. */ - if (dev.d_dev->dv_open(NULL, &dev)) - dev.d_partition = 255; + if (dev.d_dev->dv_open(NULL, &dev)) { + dev.d_slice = -1; + dev.d_partition = -1; + } } else { dev.d_dev = &host_dev; dev.d_type = dev.d_dev->dv_type; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 04:56:39 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 D09AEB76; Fri, 30 Nov 2012 04:56:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B57F88FC15; Fri, 30 Nov 2012 04:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU4udKi019156; Fri, 30 Nov 2012 04:56:39 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU4ud7j019155; Fri, 30 Nov 2012 04:56:39 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211300456.qAU4ud7j019155@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 30 Nov 2012 04:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243701 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 04:56:39 -0000 Author: gonzo Date: Fri Nov 30 04:56:39 2012 New Revision: 243701 URL: http://svnweb.freebsd.org/changeset/base/243701 Log: - Enable syscons/framebuffer by default - Enable NFS client by default. Might be useful for building ports Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Fri Nov 30 04:44:32 2012 (r243700) +++ head/sys/arm/conf/RPI-B Fri Nov 30 04:56:39 2012 (r243701) @@ -44,7 +44,8 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories device snp -#options NFSCL #Network Filesystem Client +options NFSCL #Network Filesystem Client + #options NFS_ROOT #NFS usable as /, requires NFSCLIENT #options BOOTP_NFSROOT #options BOOTP_COMPAT @@ -73,13 +74,12 @@ device pl011 device pty -# NOTE: serial console will be disabled if syscons enabled -# Uncomment following lines for framebuffer/syscons support -# device sc -# device kbdmux -# options SC_DFLT_FONT # compile font in -# makeoptions SC_DFLT_FONT=cp437 -# device ukbd +# Comment following lines for boot console on serial port +device sc +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 +device ukbd device sdhci device mmc From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 05:30: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 82DC417D; Fri, 30 Nov 2012 05:30:32 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0928FC14; Fri, 30 Nov 2012 05:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU5UWaF023780; Fri, 30 Nov 2012 05:30:32 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU5UWvR023779; Fri, 30 Nov 2012 05:30:32 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201211300530.qAU5UWvR023779@svn.freebsd.org> From: David Xu Date: Fri, 30 Nov 2012 05:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243702 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 05:30:32 -0000 Author: davidxu Date: Fri Nov 30 05:30:31 2012 New Revision: 243702 URL: http://svnweb.freebsd.org/changeset/base/243702 Log: MFC r243599: Take first active vnode correctly. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Fri Nov 30 04:56:39 2012 (r243701) +++ stable/9/sys/kern/vfs_subr.c Fri Nov 30 05:30:31 2012 (r243702) @@ -4776,7 +4776,7 @@ __mnt_vnode_first_active(struct vnode ** MNT_REF(mp); (*mvp)->v_type = VMARKER; - vp = TAILQ_NEXT(*mvp, v_actfreelist); + vp = TAILQ_FIRST(&mp->mnt_activevnodelist); while (vp != NULL) { VI_LOCK(vp); if (vp->v_mount == mp && vp->v_type != VMARKER && From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 09:12:25 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 3C3BE15C; Fri, 30 Nov 2012 09:12:25 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id E28B48FC0C; Fri, 30 Nov 2012 09:12:23 +0000 (UTC) Received: from [192.168.0.2] (cpc39-cmbg15-2-0-cust69.5-4.cable.virginmedia.com [81.101.138.70]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id qAU9CFgl019701 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 30 Nov 2012 09:12:16 GMT (envelope-from theraven@FreeBSD.org) Subject: Re: svn commit: r243670 - head/share/man/man5 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: Date: Fri, 30 Nov 2012 09:12:11 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4DDE660C-B809-47A5-AEBD-026FAAE8DB8B@FreeBSD.org> References: <201211291251.qATCpA7w078277@svn.freebsd.org> <20121130110154.E1441@besplex.bde.org> To: Eitan Adler X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 09:12:25 -0000 On 30 Nov 2012, at 00:15, Eitan Adler wrote: > Every time I talk to the clang folk about flags they point me to gcc > documentation. No we don't. We point you at the gcc documentation and at the clang = manual. Clang aims to support all of the gcc flags, and provides some = extra ones as documented here: http://clang.llvm.org/docs/UsersManual.html If you are interested in writing a full manual for clang including the = gcc options, then that would almost certainly be appreciated. Most of = this can be automatically generated. The best thing to do would be to = write a tablegen back end that could emit mandoc from the existing = options descriptions. David= From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 09:30: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 D5396892; Fri, 30 Nov 2012 09:30:31 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp2.one.com (csmtp2.one.com [91.198.169.22]) by mx1.freebsd.org (Postfix) with ESMTP id 093528FC19; Fri, 30 Nov 2012 09:30:31 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp2.one.com (Postfix) with ESMTPA id 81A72304042C; Fri, 30 Nov 2012 09:30:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r243665 - head/sbin/dump From: Erik Cederstrand In-Reply-To: <20121129120147.GE3013@kib.kiev.ua> Date: Fri, 30 Nov 2012 10:30:25 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9E5035D8-506F-4A18-9511-BFA0511ACE10@cederstrand.dk> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 09:30:31 -0000 Den 29/11/2012 kl. 13.01 skrev Konstantin Belousov = : > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Thu Nov 29 05:16:50 2012 >> New Revision: 243665 >> URL: http://svnweb.freebsd.org/changeset/base/243665 >>=20 >> Log: >> Mark non-returning function as such >>=20 >> PR: bin/172978 >> Approved by: cperciva >> MFC after: 3 days >>=20 >> Modified: >> head/sbin/dump/dump.h >>=20 >> Modified: head/sbin/dump/dump.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 = (r243664) >> +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 = (r243665) >> @@ -121,7 +121,7 @@ void trewind(void); >> void writerec(char *dp, int isspcl); >>=20 >> void Exit(int status) __dead2; >> -void dumpabort(int signo); >> +void dumpabort(int signo) __dead2; >> void dump_getfstab(void); >>=20 >> char *rawname(char *cp); > What is the goal of this change ? >=20 > It is arguably backward. There is absolutely no use to mark signal = handler > as __dead2, and all other uses do not benefit from the redundand = declaration. I submitted this patch because it fixes static analysis warnings. = Compilation units that contain the header but not the implementation = need this to reason about the code. As I see it, the __dead2 is part of the function definition, just like = 'void' and 'int signo'. Actually, before the patch, return type 'void' = was a lie, because the function never returns. > Also, being quite removed from the function definition, there is a = chance > that some future modification would make the attribute a lie. That is not any different than some future modification changing the = return type to 'int', which the compiler would also warn about. Thanks, Erik= From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 12:41:38 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 78B4B12D for ; Fri, 30 Nov 2012 12:41:38 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id CEA368FC14 for ; Fri, 30 Nov 2012 12:41:37 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so535239lbb.13 for ; Fri, 30 Nov 2012 04:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=fKkzRRsh7S7O/ILiDqME2bgh/bbHs/0afj4TVJBcz0Q=; b=CmFhFoH5ORyU7PqgEEFqWsVjji7jo7CNfk1aoQu4zLhEnFSEChjx+8sdwoGM1Hau9B jhdi5w0UtS1HYzSnPUXI35X/RWyNUvXfnAhsEFAPshTBxYCZsUyv9W6ThIGnyjfe5FEW EuLNpIKRSZBRlEEn2GOEm/wF2OAzrDGtd/gpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=fKkzRRsh7S7O/ILiDqME2bgh/bbHs/0afj4TVJBcz0Q=; b=FPd4ILGwXIBtf7UfQc3tTEWn6BqH4mKg7eycKa8s/5PPl7qiFQc/Sik80fG7YxwBiA BJkmY1nwidWpwh57hMkHkXvClfEbyAXlPOqX/ngAeQq9uzs3yEVjfi0OREV8I/+X3v9r eHwYM4lfirR/ADQ4Bl/cyBZzG6nE+Ga6tz8JYTAjqcL+rWdMPYATBaYXU5IaIdXtVWG8 eyl6vVGUZ7hoJhaqNiD7LuzQ7RcsQZZzTE82cEKNFe1D8ystv4oqfaFn5mycNg+0VgAq ocCBL+i2Rc+CkFsExZcKjpPl5Cq2wxrad9CVQzQRr7Xvvi5zt1qtRpku+anKWZZxC+mx Yc6A== Received: by 10.152.108.48 with SMTP id hh16mr1143286lab.25.1354279296198; Fri, 30 Nov 2012 04:41:36 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.154.168 with HTTP; Fri, 30 Nov 2012 04:41:05 -0800 (PST) In-Reply-To: <4DDE660C-B809-47A5-AEBD-026FAAE8DB8B@FreeBSD.org> References: <201211291251.qATCpA7w078277@svn.freebsd.org> <20121130110154.E1441@besplex.bde.org> <4DDE660C-B809-47A5-AEBD-026FAAE8DB8B@FreeBSD.org> From: Eitan Adler Date: Fri, 30 Nov 2012 07:41:05 -0500 X-Google-Sender-Auth: DN0bVROW2SuW2az_4enhUwPPBvY Message-ID: Subject: Re: svn commit: r243670 - head/share/man/man5 To: David Chisnall Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnwV+tF+82kh3C4rX3Ki/jZyZ0/lGTSQoq0oo2HeHqgrxdj3ySgUaWuqqKCyB63rH8ufYgr Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 12:41:38 -0000 On 30 November 2012 04:12, David Chisnall wrote: > On 30 Nov 2012, at 00:15, Eitan Adler wrote: > >> Every time I talk to the clang folk about flags they point me to gcc >> documentation. > > No we don't. We point you at the gcc documentation and at the clang manu= al. Clang aims to support all of the gcc flags, and provides some extra on= es as documented here: Actually, every time I've asked the response I got has been exactly "man gc= c" > If you are interested in writing a full manual for clang including the gc= c options, then that would almost certainly be appreciated. Most of this c= an be automatically generated. The best thing to do would be to write a ta= blegen back end that could emit mandoc from the existing options descriptio= ns. and then they mention this. I've thought about working on it, but ENOTIME usually ;) --=20 Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 16:15:36 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 97845A12; Fri, 30 Nov 2012 16:15:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 775358FC08; Fri, 30 Nov 2012 16:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUGFadN014927; Fri, 30 Nov 2012 16:15:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUGFac8014918; Fri, 30 Nov 2012 16:15:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211301615.qAUGFac8014918@svn.freebsd.org> From: Hiroki Sato Date: Fri, 30 Nov 2012 16:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r243705 - in releng/9.1/release: . doc doc/de_DE.ISO8859-1/early-adopter doc/de_DE.ISO8859-1/errata doc/de_DE.ISO8859-1/hardware/alpha doc/de_DE.ISO8859-1/hardware/common doc/de_DE.ISO8... X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 16:15:36 -0000 Author: hrs Date: Fri Nov 30 16:15:35 2012 New Revision: 243705 URL: http://svnweb.freebsd.org/changeset/base/243705 Log: - Bump versions and revert XML migration of the release documents in releng/9.1 branch. The doc tree release/9.1.0 for this release still uses SGML toolchain[1]. - Add SVNROOT{BASE,SRC,DOC,PORTS} for subversion repository URLs and BRANCH{SRC,DOC,PORTS} for the branches to generate-release.sh, and remove -p, -r, -d options. The revision to be built should be specified in the URL. - Add {WORLD,KERNEL}_FLAGS to generate-release.sh. These were supported in the old release build framework. - Disable to use binary package for docproj port during a release build. This package should be built successfully. Pointy hat to: hrs [1] Approved by: re (implicitly) Added: releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/artheader.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/dev.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/dev.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/intro.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/intro.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/proc-i386.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/proc-i386.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/proc-ia64.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/proc-ia64.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/proc-pc98.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/proc-pc98.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/dev-sparc64.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/dev-sparc64.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/proc-sparc64.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/proc-sparc64.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/abstract.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/abstract.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/artheader.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/trouble.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/trouble.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/upgrade.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/upgrade.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/install.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/install.sgml releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/common/new.sgml - copied unchanged from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/common/new.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/share/sgml/ - copied from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/share/sgml/ releng/9.1/release/doc/en_US.ISO8859-1/errata/article.sgml - copied, changed from r241444, releng/9.1/release/doc/en_US.ISO8859-1/errata/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.sgml - copied, changed from r241444, releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/installation/article.sgml - copied, changed from r241444, releng/9.1/release/doc/en_US.ISO8859-1/installation/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/readme/article.sgml - copied, changed from r241444, releng/9.1/release/doc/en_US.ISO8859-1/readme/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml - copied, changed from r241444, releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/share/sgml/ - copied from r241444, releng/9.1/release/doc/en_US.ISO8859-1/share/sgml/ releng/9.1/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/errata/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/errata/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/proc-alpha.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/proc-alpha.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/artheader.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/dev.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/dev.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/intro.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/intro.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/proc-i386.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/proc-i386.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/proc-ia64.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/proc-ia64.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/proc-pc98.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/proc-pc98.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/dev-sparc64.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/dev-sparc64.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/proc-sparc64.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/proc-sparc64.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/alpha/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/alpha/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/abstract.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/abstract.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/artheader.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/install.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/install.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/layout.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/layout.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/trouble.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/trouble.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/i386/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/i386/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/pc98/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/pc98/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/alpha/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/alpha/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/common/new.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/common/new.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/i386/article.sgml - copied, changed from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/i386/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/share/sgml/ - copied from r241444, releng/9.1/release/doc/fr_FR.ISO8859-1/share/sgml/ releng/9.1/release/doc/ja_JP.eucJP/errata/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/errata/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/alpha/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/alpha/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/proc-amd64.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/proc-amd64.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/common/artheader.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/common/dev.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/common/dev.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/common/intro.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/common/intro.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/proc-i386.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/proc-i386.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/proc-ia64.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/proc-ia64.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/proc-pc98.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/proc-pc98.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/article.sgml releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/proc-sparc64.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/proc-sparc64.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/alpha/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/alpha/article.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/amd64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/amd64/article.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/common/new.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/common/new.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/i386/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/i386/article.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/ia64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/ia64/article.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/pc98/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/pc98/article.sgml releng/9.1/release/doc/ja_JP.eucJP/relnotes/sparc64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ja_JP.eucJP/relnotes/sparc64/article.sgml releng/9.1/release/doc/ja_JP.eucJP/share/sgml/ - copied from r241444, releng/9.1/release/doc/ja_JP.eucJP/share/sgml/ releng/9.1/release/doc/ru_RU.KOI8-R/errata/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/errata/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/alpha/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/alpha/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/proc-amd64.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/proc-amd64.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/artheader.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/intro.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/intro.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/proc-i386.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/proc-i386.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/proc-ia64.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/proc-ia64.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/proc-pc98.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/proc-pc98.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/proc-sparc64.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/proc-sparc64.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/alpha/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/alpha/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/amd64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/amd64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/abstract.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/abstract.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/artheader.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/artheader.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/install.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/install.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/layout.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/layout.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/trouble.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/trouble.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/upgrade.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/upgrade.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/i386/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/i386/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/ia64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/ia64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/pc98/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/pc98/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/installation/sparc64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/installation/sparc64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/readme/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/readme/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/alpha/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/alpha/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/amd64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/amd64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/i386/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/i386/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/ia64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/ia64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/pc98/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/pc98/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/sparc64/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/sparc64/article.sgml releng/9.1/release/doc/ru_RU.KOI8-R/share/sgml/ - copied from r241444, releng/9.1/release/doc/ru_RU.KOI8-R/share/sgml/ releng/9.1/release/doc/share/sgml/ - copied from r241444, releng/9.1/release/doc/share/sgml/ releng/9.1/release/doc/zh_CN.GB2312/errata/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/zh_CN.GB2312/errata/article.sgml releng/9.1/release/doc/zh_CN.GB2312/hardware/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/zh_CN.GB2312/hardware/article.sgml releng/9.1/release/doc/zh_CN.GB2312/readme/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/zh_CN.GB2312/readme/article.sgml releng/9.1/release/doc/zh_CN.GB2312/relnotes/article.sgml - copied unchanged from r241444, releng/9.1/release/doc/zh_CN.GB2312/relnotes/article.sgml releng/9.1/release/doc/zh_CN.GB2312/share/sgml/ - copied from r241444, releng/9.1/release/doc/zh_CN.GB2312/share/sgml/ Deleted: releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/artheader.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/dev.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/intro.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/proc-i386.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/proc-ia64.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/proc-pc98.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/dev-sparc64.xml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/proc-sparc64.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/abstract.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/artheader.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/trouble.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/upgrade.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/install.xml releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/common/new.xml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.xml releng/9.1/release/doc/de_DE.ISO8859-1/share/xml/ releng/9.1/release/doc/en_US.ISO8859-1/errata/article.xml releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.xml releng/9.1/release/doc/en_US.ISO8859-1/installation/article.xml releng/9.1/release/doc/en_US.ISO8859-1/readme/article.xml releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.xml releng/9.1/release/doc/en_US.ISO8859-1/share/xml/ releng/9.1/release/doc/fr_FR.ISO8859-1/early-adopter/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/errata/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/proc-alpha.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/artheader.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/dev.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/intro.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/proc-i386.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/proc-ia64.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/proc-pc98.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/dev-sparc64.xml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/proc-sparc64.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/alpha/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/abstract.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/artheader.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/install.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/layout.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/trouble.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/i386/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/pc98/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.xml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/alpha/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/common/new.xml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/i386/article.xml releng/9.1/release/doc/fr_FR.ISO8859-1/share/xml/ releng/9.1/release/doc/ja_JP.eucJP/errata/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/alpha/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/proc-amd64.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/common/artheader.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/common/dev.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/common/intro.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/proc-i386.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/proc-ia64.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/proc-pc98.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/article.xml releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/proc-sparc64.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/alpha/article.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/amd64/article.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/common/new.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/i386/article.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/ia64/article.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/pc98/article.xml releng/9.1/release/doc/ja_JP.eucJP/relnotes/sparc64/article.xml releng/9.1/release/doc/ja_JP.eucJP/share/xml/ releng/9.1/release/doc/ru_RU.KOI8-R/errata/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/alpha/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/proc-amd64.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/artheader.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/dev.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/intro.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/proc-i386.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/proc-ia64.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/proc-pc98.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/proc-sparc64.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/alpha/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/amd64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/abstract.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/artheader.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/install.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/layout.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/trouble.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/upgrade.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/i386/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/ia64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/pc98/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/installation/sparc64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/readme/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/alpha/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/amd64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/common/new.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/i386/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/ia64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/pc98/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/sparc64/article.xml releng/9.1/release/doc/ru_RU.KOI8-R/share/xml/ releng/9.1/release/doc/share/xml/ releng/9.1/release/doc/zh_CN.GB2312/errata/article.xml releng/9.1/release/doc/zh_CN.GB2312/hardware/article.xml releng/9.1/release/doc/zh_CN.GB2312/readme/article.xml releng/9.1/release/doc/zh_CN.GB2312/relnotes/article.xml releng/9.1/release/doc/zh_CN.GB2312/share/xml/ Modified: releng/9.1/release/doc/Makefile releng/9.1/release/doc/README releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/errata/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/hardware/common/hw.ent releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.ent releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/readme/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/common/relnotes.ent releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/Makefile releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/Makefile releng/9.1/release/doc/en_US.ISO8859-1/errata/Makefile releng/9.1/release/doc/en_US.ISO8859-1/hardware/Makefile releng/9.1/release/doc/en_US.ISO8859-1/installation/Makefile releng/9.1/release/doc/en_US.ISO8859-1/readme/Makefile releng/9.1/release/doc/en_US.ISO8859-1/relnotes/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/early-adopter/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/errata/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/hw.ent releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/installation/alpha/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/install.ent releng/9.1/release/doc/fr_FR.ISO8859-1/installation/i386/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/installation/pc98/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/alpha/Makefile releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/common/relnotes.ent releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/i386/Makefile releng/9.1/release/doc/ja_JP.eucJP/errata/Makefile releng/9.1/release/doc/ja_JP.eucJP/hardware/alpha/Makefile releng/9.1/release/doc/ja_JP.eucJP/hardware/amd64/Makefile releng/9.1/release/doc/ja_JP.eucJP/hardware/common/hw.ent releng/9.1/release/doc/ja_JP.eucJP/hardware/i386/Makefile releng/9.1/release/doc/ja_JP.eucJP/hardware/ia64/Makefile releng/9.1/release/doc/ja_JP.eucJP/hardware/pc98/Makefile releng/9.1/release/doc/ja_JP.eucJP/hardware/sparc64/Makefile releng/9.1/release/doc/ja_JP.eucJP/relnotes/alpha/Makefile releng/9.1/release/doc/ja_JP.eucJP/relnotes/amd64/Makefile releng/9.1/release/doc/ja_JP.eucJP/relnotes/common/relnotes.ent releng/9.1/release/doc/ja_JP.eucJP/relnotes/i386/Makefile releng/9.1/release/doc/ja_JP.eucJP/relnotes/ia64/Makefile releng/9.1/release/doc/ja_JP.eucJP/relnotes/pc98/Makefile releng/9.1/release/doc/ja_JP.eucJP/relnotes/sparc64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/errata/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/hardware/alpha/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/hardware/amd64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/hardware/common/hw.ent releng/9.1/release/doc/ru_RU.KOI8-R/hardware/i386/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/hardware/ia64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/hardware/pc98/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/hardware/sparc64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/installation/alpha/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/installation/amd64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/installation/common/install.ent releng/9.1/release/doc/ru_RU.KOI8-R/installation/i386/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/installation/ia64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/installation/pc98/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/installation/sparc64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/readme/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/alpha/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/amd64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/common/relnotes.ent releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/i386/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/ia64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/pc98/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/relnotes/sparc64/Makefile releng/9.1/release/doc/ru_RU.KOI8-R/share/examples/dev-auto-translate.pl releng/9.1/release/doc/share/examples/Makefile.relnotesng releng/9.1/release/doc/share/mk/doc.relnotes.mk releng/9.1/release/doc/share/sgml/release.ent releng/9.1/release/doc/zh_CN.GB2312/errata/Makefile releng/9.1/release/doc/zh_CN.GB2312/hardware/Makefile releng/9.1/release/doc/zh_CN.GB2312/readme/Makefile releng/9.1/release/doc/zh_CN.GB2312/relnotes/Makefile releng/9.1/release/generate-release.sh Directory Properties: releng/9.1/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: releng/9.1/release/doc/Makefile ============================================================================== --- releng/9.1/release/doc/Makefile Fri Nov 30 07:00:14 2012 (r243704) +++ releng/9.1/release/doc/Makefile Fri Nov 30 16:15:35 2012 (r243705) @@ -8,31 +8,9 @@ SUBDIR+= ${RELNOTES_LANG} .else SUBDIR+= en_US.ISO8859-1 .endif -SUBDIR+= share/xml +SUBDIR+= share/sgml RELN_ROOT?= ${.CURDIR} -.if defined(SUPHOST) -SUPFLAGS+= -h ${SUPHOST} -.endif -update: -.if defined(SUP_UPDATE) -.if !defined(DOCSUPFILE) - @echo "Error: Please define DOCSUPFILE before doing make update." - @exit 1 -.endif - @echo "--------------------------------------------------------------" - @echo ">>> Running ${SUP}" - @echo "--------------------------------------------------------------" - @${SUP} ${SUPFLAGS} ${DOCSUPFILE} -.elif defined(CVS_UPDATE) - @echo "--------------------------------------------------------------" - @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT} - @echo "--------------------------------------------------------------" - cd ${.CURDIR}; cvs -q update -P -d -.else - @echo "Error: Please define either SUP_UPDATE or CVS_UPDATE first." -.endif - .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.subdir.mk" Modified: releng/9.1/release/doc/README ============================================================================== --- releng/9.1/release/doc/README Fri Nov 30 07:00:14 2012 (r243704) +++ releng/9.1/release/doc/README Fri Nov 30 16:15:35 2012 (r243705) @@ -24,34 +24,34 @@ share/mk/doc.relnotes.mk Common Makefile definitions for RELNOTESng. These definitions mostly accommodate the fact that we're building DocProj-like documents outside the doc/ tree. -share/xml/catalog +share/sgml/catalog Main SGML catalog for all language-neutral (and default EN) stylesheet and entity files. Can be overridden if needed for translations. -share/xml/default.dsl +share/sgml/default.dsl All documents build with this file as a stylesheet. All it does is to make it possible to use the document catalogs to locate the "real" stylesheet by reference, rather than having to specify it by pathname. -share/xml/release.dsl +share/sgml/release.dsl Language-neutral stylesheet. This stylesheet supports the arch= attribute on (all?) DocBook elements; elements with an arch= attribute are only included in the output if their value is equal to the value of the &arch; entity. In the future, arch= could be a list of possible &arch; entity values that match, such as "i386,sparc64". -share/xml/release.ent +share/sgml/release.ent Release information. Need to update the entry definitions in this file when rolling new revisions; these should take effect in all documents. -en_US.ISO8859-1/share/xml/release.dsl +en_US.ISO8859-1/share/sgml/release.dsl Language-dependent stylesheet for en, but also the default for translations if they don't override the settings here. This stylesheet sets the email footer at the bottom of HTML pages, as well as a few other parameters. If necessary for translations, this file can be overridden with - */share/xml/release.dsl and */share/xml/catalog. + */share/sgml/release.dsl and */share/sgml/catalog. */relnotes/common/ Directory for multi-architecture release notes files. @@ -88,7 +88,7 @@ tree. For example: % make DOC_PREFIX=/usr/doc all All definition of the "current" version of FreeBSD is contained in the -share/xml/release.ent file; release engineers should peruse the +share/sgml/release.ent file; release engineers should peruse the contents of this file carefully when doing version number bumps. When creating content for the architecture-dependent files, authors @@ -108,9 +108,9 @@ When creating a translation, make a new directory with a language code (paralleling the DocProj directory structure). If necessary, new language-dependent HTML footers can be generated by making a new language-dependent -${LANG}/share/xml/release.dsl, a ${LANG}/share/xml/catalog that +${LANG}/share/sgml/release.dsl, a ${LANG}/share/sgml/catalog that points to it, and a new definition in the Makefiles that adds -${LANG}/share/xml/catalog to EXTRA_CATALOGS. Except for the Makefile +${LANG}/share/sgml/catalog to EXTRA_CATALOGS. Except for the Makefile changes, this is the same procedure that is used for creating a new translation for DocProj files. Modified: releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/Makefile ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/Makefile Fri Nov 30 07:00:14 2012 (r243704) +++ releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/Makefile Fri Nov 30 16:15:35 2012 (r243705) @@ -17,7 +17,7 @@ FORMATS?= html INSTALL_COMPRESSED?=gz INSTALL_ONLY_COMPRESSED?= -SRCS+= article.xml +SRCS+= article.sgml .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Copied and modified: releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml (from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml) ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml Thu Oct 11 15:21:07 2012 (r241444, copy source) +++ releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml Fri Nov 30 16:15:35 2012 (r243705) @@ -1,14 +1,3 @@ - - -%entities; - -%release; - -X"> -X"> -]> - + +%man; + + +%freebsd; + + +%authors; + + +%teams; + + +%mailing-lists; + + +%release; + +X"> +X"> + +]> +
Hinweise für die ersten Anwender von &os; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/errata/Makefile ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/errata/Makefile Fri Nov 30 07:00:14 2012 (r243704) +++ releng/9.1/release/doc/de_DE.ISO8859-1/errata/Makefile Fri Nov 30 16:15:35 2012 (r243705) @@ -16,7 +16,7 @@ INSTALL_COMPRESSED?= gz INSTALL_ONLY_COMPRESSED?= # SGML content -SRCS+= article.xml +SRCS+= article.sgml .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Copied and modified: releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml (from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml) ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml Thu Oct 11 15:21:07 2012 (r241444, copy source) +++ releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml Fri Nov 30 16:15:35 2012 (r243705) @@ -1,11 +1,3 @@ -<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ -<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> -%entities; -<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> -%release; -]> - <!-- FreeBSD errata document. Unlike some of the other RELNOTESng files, this file should remain as a single SGML file, so that @@ -20,6 +12,19 @@ basiert auf: 1.38 --> +<!DOCTYPE ARTICLE PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ +<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> +%man; +<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> +%authors; +<!ENTITY % translators PUBLIC "-//FreeBSD//ENTITIES DocBook Translator Entities//DE"> +%translators; +<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> +%mlists; +<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> +%release; +]> + <article lang="de"> <articleinfo> Modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/Makefile ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/Makefile Fri Nov 30 07:00:14 2012 (r243704) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/Makefile Fri Nov 30 16:15:35 2012 (r243705) @@ -13,11 +13,11 @@ INSTALL_ONLY_COMPRESSED?= JADEFLAGS+= -V %generate-article-toc% # SGML content -SRCS+= article.xml -SRCS+= proc-alpha.xml +SRCS+= article.sgml +SRCS+= proc-alpha.sgml SRCS+= ../common/hw.ent -SRCS+= ../common/artheader.xml -SRCS+= ../common/dev.xml +SRCS+= ../common/artheader.sgml +SRCS+= ../common/dev.sgml .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Copied and modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml (from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml) ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml Thu Oct 11 15:21:07 2012 (r241444, copy source) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml Fri Nov 30 16:15:35 2012 (r243705) @@ -1,22 +1,28 @@ -<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ -<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> -%entities; +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/article.sgml,v 1.5 2002/10/12 18:02:21 ue Exp $ + basiert auf: 1.4 +--> + +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ +<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> +%man; +<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> +%authors; +<!ENTITY % translators PUBLIC "-//FreeBSD//ENTITIES DocBook Translator Entities//DE"> +%translators; +<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> +%mlists; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; <!-- Architecture-specific customization --> <!ENTITY arch "alpha"> <!ENTITY arch.print "Alpha/AXP"> -]> -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/article.sgml,v 1.5 2002/10/12 18:02:21 ue Exp $ - basiert auf: 1.4 ---> +]> <article lang="de"> &artheader; Copied: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml (from r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml Fri Nov 30 16:15:35 2012 (r243705, copy of r241444, releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml) @@ -0,0 +1,3841 @@ +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/proc-alpha.sgml,v 1.35 2003/05/24 19:11:43 ue Exp $ + basiert auf: 1.60 +--> + +<sect1 id="support-proc"> + <sect1info> + <authorgroup> + <author> + <firstname>Wilko</firstname> + + <surname>Bulte</surname> + + <contrib>Gepflegt von </contrib> + </author> + </authorgroup> + </sect1info> + + <title>Unterstützte Prozessoren und Mainboards + + Wir freuen uns über Ergänzungen, Korrekturen und + konstruktive Kritik. Informationen über Fehlverhalten von + Systemen sind willkommen. + + + Übersicht + + Dieses Dokument soll die erste Anlaufstelle für alle + Anwender sein, die &os; auf einer Maschine mit Alpha-Prozessor + benutzen wollen. Ziel ist, Hintergrundinformationen über + die diversen Varianten der Hardware zu geben. Es ist nicht als + Ersatz für die Handbücher der jeweiligen Systeme + gedacht. Die Informationen gliedern sich wie folgt: + + + + Mindestanforderungen an die Hardware für den + Betrieb von &os; auf einem Alpha System; + + + + nähere Informationen zu den von &os; + unterstützten Modellen/Mainboards; + + + + Hinweise zur Verwendung von Erweiterungskarten mit &os; + inklusive Informationen zu plattformabhängiger + Hardware. + + + + + Im Text wird je nach Lust und Laune auf DEC, Digital + Equipment Corporation und Compaq verwiesen. Nachdem Compaq + die Firma Digital Equipment aufgekauft hatte, wäre es + richtiger gewesen, nur noch auf Compaq zu verweisen. Nachdem + Compaq jetzt von HP aufgekauft wurde, müßte Compaq + überall durch HP ersetzt werden. Allerdings findet man + diesen Namens-Mix überall, darum haben wir uns die Arbeit + erspart. + + + + SRM Befehle werden in + GROSSBUCHSTABEN dargestellt. SRM + akzeptiert auch Kleinbuchstaben, die Verwendung von + Großbuchstaben dient dazu, Befehle für den Leser + hervorzuheben. + + + + Compaq stellt auf seinen Webseiten Informationen für + Linux-Entwickler bereit. Auch für &os; Anwender sind + diese durchaus nützlich. Werfen Sie einmal einen Blick + auf Linux Alpha + Power tools. + + + + + Was braucht man im Allgemeinen um &os; auf einer Alpha zu + nutzen? + + Logischerweise eine Alpha, die von &os; unterstützt + wird. Alpha Maschinen sind KEINE PCs. Es gibt erhebliche + Unterschiede zwischen den einzelnen Chipsätzen und + Mainboards. Der Kernel muß also die genauen Details einer + Maschine kennen, damit er auf ihr laufen kann. Wenn Sie einfach + irgendeinen GENERIC Kernel auf Ihre + Hardware loslassen, wird das in der Regel böse in die Hose + gehen. + + Wenn Sie planen, eine Maschine mit &os; zu nutzen, sollten + Sie darauf achten, daß die SRM Firmware Konsole + installiert ist, bzw. das diese Firmware für Ihre Maschine + verfügbar ist. Wenn Ihr System noch nicht von &os; + unterstützt wird, kann sich das durchaus irgendwann einmal + ändern; allerdings nur, wenn SRM für dieses System + verfügbar ist. + + Wenn auf Ihrer Maschine die Firmware für die ARC oder + AlphaBIOS Konsole installiert ist, handelt es sich um ein + System, welches auf den Betrieb mit WindowsNT ausgelegt ist. + Bei einigen Systemen ist die Firmware für die SRM Konsole + im System-ROM verfügbar und Sie müssen diese nur + aktivieren (über das ARC oder AlphaBIOS Menü). Bei + anderen System werden Sie die ROMs mit der SRM Firmware neu + flashen müssen. Bei + http://ftp.digital.com/pub/DEC/Alpha/firmware können Sie + erfahren, welche Optionen für Ihr System verfügbar + sind. Grundregel: Kein SRM bedeutet kein + &os; (und auch kein NetBSD, OpenBSD, Tru64 Unix oder OpenVMS). + Nach dem Ende von WindowsNT/Alpha werden viele alte NT-Systeme + auf dem Gebrauchtmarkt verkauft. Diese sind mehr oder weniger + wertlos, wenn die Firmware lediglich NT unterstützt. Seien + Sie also vorsichtig, wenn der Preis zu verlockend + scheint. + + Für diese Maschinen ist kein SRM + verfügbar: + + + + Digital XL series + + + + Digital XLT series + + + + Samsung PC164UX (Ruffian) + + + + Samsung 164B + + + + Für diese Systeme ist zwar eine SRM Firmware + verfügbar, sie werden aber nicht von &os; + unterstützt: + + + + DECpc 150 (Jensen) + + + + DEC 2000/300 (Jensen) + + + + DEC 2000/500 (Culzean) + + + + AXPvme Familie (Medulla) + + + + Um die Dinge noch weiter zu verkomplizieren, hat Digital + zwei verschiedene Typen von Alpha-Maschinen verkauft: Die + weißen Alphas waren reine NT-Maschinen, + während auf den blauen Alphas OpenVMS und + Digital Unix laufen. Die Namen stammen von den Farben der + Gehäuse: FrostWhite bzw. + TopGunBlue. Sie können zwar die Firmware + für die SRM Konsole auf einer weißen Alpha + installieren, allerdings werden sich OpenVMS und Digital Unix + weigern, auf einer solchen Maschine zu booten. &os; kann seit + 4.0-RELEASE sowohl auf weißen als auch auf blauen Alphas + genutzt werden. Um Fragen vorzubeugen: Digital verkaufte die + weißen Alphas zu einem anderen (lies: geringeren) + Preis. + + Zusammen mit der SRM Firmware erhalten Sie den sogenannten + OSF/1 PAL Code (OSF/1 war der ursprüngliche Name für + die von Digital angebotene Variante für die Alpha). Der + PAL Code ist eine Art Vermittler zwischen der Hardware und dem + Betriebssystem. Er benutzt die normalen CPU Befehle und einige + besondere Anweisungen, die nur für die Nutzung durch den + PAL gedacht sind. PAL ist kein Microcode. Die Firmware + für die ARC Konsole enthält einen anderen PAL Code der + auf die Nutzung durch WinNT optimiert ist. Er kann nicht von + &os; (oder generell Unix bzw. OpenVMS) genutzt werden. Um die + üblichen Frage vorwegzunehmen: Linux verfügt + über einen eigenen PAL Code und kann daher auch von ARC und + AlphaBIOS. Dieser Ansatz wird aus diversen Gründen von den + *BSD-Machern abgelehnt. Details würden an dieser Stelle zu + weit führen, sind aber auf den Webseiten von &os; und + NetBSD verfügbar. + + Es gibt noch einen weiteren Fallstrick: Sie brauchen einen + Festplatten-Controller, der von der SRM Firmware erkannt wird, + damit Sie davon booten können. Welche Controller + akzeptabel sind, hängt leider stark vom jeweiligen System + und der SRM Version ab. Für ältere PCI-basierte + Systeme brauchen Sie entweder einen Kontroller mit einem + NCR/Symbios 53C810 oder einem Qlogic 1020/1040. Einige + Maschinen verfügen über einen integrierten On-Board + Controller. Neuere Maschinen und SRM Versionen + unterstützen auch aktuellere SCSI-Chips bzw. Kontroller. + Details finden Sie in den System-spezifischen Informationen. + Hinweis: Wenn in diesem Dokument Symbios Chips erwähnt + werden, sind damit auch ältere Chips gemeint, die noch die + Aufschrift NCR tragen. NCR wurde vor einiger Zeit von Symbios + aufgekauft. + + Diese Einschränkung könnte Ihnen Probleme machen, + wenn Sie ein ehemaliges WindowsNT-System haben. ARC und + AlphaBIOS kennen (und booten von) anderen + Controllern als SRM. Zum Beispiel können Sie mit + ARC/AlphaBIOS von einem Adaptec 2940UW booten, während das + mit SRM (normalerweise) nicht geht. Nur bei einigen neueren + Maschinen ist es möglich, von einem Adaptec zu booten. + Details finden Sie in den System-spezifischen + Informationen. + + Wenn Sie von einem Controller nicht booten können, + können Sie ihn aber in der Regel für Festplatten + nutzen, von denen nicht gebootet werden soll. Die Unterschiede + zwischen SRM und ARC können auch dazu führen, + daß in Ihrem System IDE CDROMs oder Festplatten stecken + (speziell bei ehemaligen WindowsNT-Systemen). Es gibt einige + SRM Versionen, die von IDE-Festplatten und -CDROMs booten + können, Details dazu finden Sie wiederum in den + System-spezifischen Informationen. + + Seit &os; 4.0 können Sie von der Original-CD booten, + bei älteren Versionen brauchen Sie hingegen die zwei + Bootdisketten. + + Wenn Sie von einer Festplatte booten wollen, muß die + Root-Partition (Partition a) am Anfang (Offset 0) der Festplatte + liegen. Daher müssen Sie das Partitions-Menü des + Installationsprogramms benutzen und als erstes Partition a mit + Offset 0 als Root-Partition anlegen. Danach können Sie den + Rest der Festplatten frei aufteilen. Wenn Sie sich nicht an + diese Regel halten, werden Sie das System zwar problemlos + installieren können, aber nicht von der gerade installieren + Festplatte booten können. + + Wenn Sie keine Festplatte haben (oder wollen), können + Sie das System auch über Ethernet booten. Dazu brauchen + Sie eine Netzwerkkarte bzw. Chips, der von der SRM Konsole + unterstützt wird. Das bedeutet in der Regel, daß + Sie eine Netzwerkkarte mit einem 21040, 21142 oder 21143 Chip + benötigen. Wenn Sie eine ältere Maschine oder SRM + Versionen haben, werden die 21142 / 21143 Fast Ethernet Chips + möglicherweise nicht erkannt. In diesem Fall können + Sie nur 10MBit Ethernet nutzen, wenn Sie über Ethernet + booten wollen. Wenn Ihre Karte nicht von DEC stammt, wird sie + meistens auch funktionieren (aber nicht immer). Intel hat vor + einiger Zeit Digital Semiconductor aufgekauft und damit auch die + Rechte an den 21x4x Chips erworben. Wundern Sie sich also + nicht, wenn Sie einen 21x4x mit Intel-Logo sehen. Der SRM auf + einigen neuen Modellen unterstützt übrigens auch die + Intel 8255x Chips. + + Alphas mit SRM können sowohl eine graphische als auch + eine serielle Konsole nutzen. ARC kann zur Not auch eine + serielle Konsole bedienen. Wenn Sie ein Terminalprogramm mit + einer 8Bit-fähigen VT100-Emulation besitzen, sollten Sie in + der Lage sein, von ARC/AlphaBIOS auf SRM umzuschalten, ohne erst + eine Graphikkarte installieren zu müssen. + + Wenn Sie Ihre Alpha ohne Monitor und Grafikkarte betreiben + wollen, müssen Sie lediglich Tastatur und Maus abziehen. + Als Ersatz schließen Sie ein Terminal (bzw. einen PC mit + Terminalprogramm) an den Anschluß "serial port #1" an. + Der SRM spricht 9600N81. Diese Variante ist auch sehr praktisch + für die Fehlerdiagnose. Vorsicht: Einige/alle SRM geben + auch am zweiten seriellen Anschluß eine + Eingabeaufforderung aus. Der Kernel wird allerdings nur den + ersten Anschluß für seine Ausgaben und seine Konsole + nutzen. Dieses Verhalten kann zu massiver Verwirrung + führen. + + Die meisten PCI-basierten Alphas können normale + VGA-Karten für PCs nutzen. Der SRM ist intelligent genug, + um diese Karten anzusprechen. Allerdings bedeutet dies nicht, + daß jede beliebige PCI VGA-Karte in einer Alpha + funktioniert. Die S3 Trio64, Mach64, und Matrox Millennium + funktionieren in der Regel, auch alte ET4000 funktionieren. + Fragen Sie lieber nach, bevor Sie Geld ausgeben. + + Die meisten anderen PCI-Karten aus der PC-Welt werden auch + von &os; auf PCI-basierten Alpha-Maschinen unterstützt. + Die aktuellsten Informationen zu diesem Thema finden Sie in der + Datei /sys/alpha/conf/GENERIC. Wenn auf + der von Ihnen genutzten PCI-Karte eine PCI-Bridge ist, sollten + Sie die spezifischen Informationen zum jeweiligen System + beachten. In einigen Fällen können PCI-Karten + Probleme verursachen, wenn sie die PCI-Parity nicht richtig + implementieren. Dies kann zu Abstürzen des Systems + führen. Sie können die Überprüfung der + PCI-Parity mit dem folgenden SRM Kommando abschalten: + + >>> SET PCI_PARITY OFF + + Dies ist kein Fehler in &os;, alle auf der Alpha genutzten + Betriebssysteme benötigen diesen + Trick. + + Wenn Ihr System (auch) EISA-Steckplätze enthält, + müssen Sie, nachdem Sie eine EISA-Karte eingebaut oder die + Firmware der Konsole aktualisiert haben, das EISA Configuration + Utility (ECU) starten. + + Es gibt verschiedene Version der Alpha CPU. Die erste + Version war der 21064. Er wurde in einem MOS4 genannten + Verfahren hergestellt, die Chips haben den Spitznamen EV4. + Neuere CPUs heißen 21164, 21264, usw. Sie werden auch als + EV4S, EV45, EV5, EV56, EV6, EV67, EV68 bezeichnet. Die EVs mit + zwei Ziffern kennzeichnen verbesserte Versionen. Zum Beispiel + verfügt der EV45 im Vergleich zu seinem Vorgänger, der + EV4 über eine verbesserte FPU sowie über einen 16 + KByte I&D Cache on-chip. Faustregel: Je größer + die erste Ziffer nach dem EV ist, desto besser + ist der Chip (lies: schneller / moderner). + + In Punkto Speicher sollten Sie auf jeden Fall mindestens 32 + MByte einsetzen. Es ist zwar möglich, &os; auch auf einem + System mit nur 16 MByte zu nutzen, aber dabei kommt keine Freude + auf. Die zur Compilierung des Kernels benötigte Zeit + halbierte sich nach dem Ausbau auf 32 MByte. Bitte beachten + Sie, daß die SRM Konsole 2 MByte des Systemspeichers nutzt + (und auch behält). Wenn Sie ernsthaft mit Ihrem System + arbeiten wollen, sollte es mindestens 64 MByte Speicher + besitzen. + + Wo wir gerade beim Thema sind: Achten Sie sehr genau + darauf, welche Art von Speicher Ihr System benutzt. Es gibt + viele verschiedene Konfigurationen und Einschränkungen + für die unterschiedlichen Systeme. + + Zum Abschluß: Der oben stehende Text dürfte auf + einen Einsteiger etwas abschreckend wirken. Lassen Sie sich + aber nicht abhalten. Wenn Sie noch Fragen haben, stellen Sie + diese ruhig. + + + + Spezifische Informationen für einzelne + Systeme + + Im Rest dieses Kapitels finden Sie eine Übersicht + über alle Systeme, auf denen &os; genutzt werden kann. + Diese Liste wird länger werden, ein Blick in + /sys/alpha/conf/GENERIC lohnt sich. + + Bei Alpha-Systemen wird oft nur der Codename aus dem + Entwicklungsprojekt benutzt, um eine Maschine zu identifizieren. + Soweit bekannt, stehen die Namen in Klammern hinter dem + offiziellen Namen. + + + AXPpci33 (<quote>NoName</quote>) + + Bei der NoName handelt es sich um ein Mainboard im Baby-AT + Format mit einem 21066 LCA (Low Cost Alpha) Prozessor. Die + NoName war ursprünglich für die Verwendung durch + OEMs gedacht. Der LCA Chip enthält fast die gesamte + Ansteuerung für den PCI-Bus und den Speicher, was ein + sehr preiswertes System möglich macht. + + Das eingeschränkte Interface zum Hauptspeicher bremst + das System bei einem Cache-Miss stark aus. Solange Sie + innerhalb des On-Chip Caches bleiben, ist die Performance der + CPU vergleichbar mit der einer 21064 (erste Generation der + Alpha). Diese Mainboards sollten heute sehr günstig zu + haben sein. Sie erhalten eine vollwertige 64-Bit CPU, + allerdings sollten Sie keine Geschwindigkeitswunder + erwarten. + + Features: + + + + 21066 Alpha CPU mit 166 MHz oder 21066A CPU mit 233 + MHz. 21068 CPUs existieren auch, sind aber noch + langsamer. + + + + on-board Bcache / L2 cache: 0, 256k oder 1 MByte + (nutzt DIL Chips) + + + + PS/2 Maus & Tastatur ODER 5pin DIN Tastatur (2 + verschiedene Mainboards) + + + + Speicher: + + + + Busbreite: 64 Bits + + + + PS/2 72 Pin 36 Bit Fast Page Mode SIMMs + + + + 70ns oder schneller + + + + müssen paarweise installiert werden + + + + 4 SIMM Steckplätze + + + + benutzt ECC + + + + + + 512 KByte Flash ROM für die Konsole + + + + 2 serielle Anschlüsse, 16550A + + + + 1 paralleler Anschluß + + + + Floppy-Anschluß + + + + 1 IDE Anschluß on-board + + + + Steckplätze: + + + + 3 32 Bit PCI Steckplätze (einer mit ISA + geteilt) + + + + 5 ISA Steckplätze (einer mit PCI + geteilt) + + + + + + on-board Fast SCSI mit Symbios 53C810 Chip + + + + Die NoName kann in ihrem Flash ROM die Firmware für + den SRM oder ARC Konsole enthalten. Das + Flash ROM ist nicht groß genug, um beide Varianten + gleichzeitig zur Verfügung zu stellen und die Auswahl per + Software möglich zu machen. Sie benötigen jedoch + nur SRM. + + Der Cache der NoNames nutzt 15 oder 20 ns DIL Chips. Wenn + Sie nur 256 KByte Cache brauchen, sollten Sie ihr altes 486er + Mainboard ausschlachten. Die für 1 MByte Cache + benötigten Chips sind leider deutlich seltener zu finden. + Sie sollten zur Steigerung der Performance mindestens 256 + KByte Cache nutzen. Ohne Cache sind diese Maschinen sehr + langsam. + + Das NoName Mainboard hat den normalen + PC/AT-Stromanschluß. Außerdem verfügt es + über einen zusätzlichen Anschluß für 3.3 + Volt. Es ist allerdings nicht notwendig, ein neues Netzteil + zu kaufen. Die 3.3 Volt werden nur benötigt, wenn Sie + auf 3.3 Volt ausgelegt PCI-Karten nutzen wollen. Diese sind + extrem selten. + + Der IDE-Anschluß wird von &os; unterstützt, + wenn die folgende Zeile in der Konfigurationsdatei des Kernels + steht: + + device ata + + Der IDE-Anschluß nutzt IRQ 14 + + Leider kann die SRM Konsole von der IDE-Festplatte + nicht booten. Sie brauchen daher eine + SCSI-Platte als Bootdevice. + + Die NoName verhält sich im Bereich der seriellen + Konsole etwas störrisch. Sie müssen + + >>> SET CONSOLE SERIAL + + eingeben, damit sie eine serielle Konsole benutzt. Im + Gegensatz zu den meisten anderen Modellen reicht es nicht aus, + die Tastatur abzuziehen. Um wieder zur graphischen Konsole zu + wechseln, müssen Sie + + >>> SET CONSOLE GRAPHICS + + auf der seriellen Konsole eingeben. + + Einige Anwender mußten manchmal + Control-Alt-Del + drücken, um den SRM aufzuwecken. Ich habe diese + Situation noch nie erlebt; aber wenn Sie nach dem Einschalten + von einem schwarzen Bildschirm begrüßt werden, ist + es einen Versuch wert. + + Verwenden Sie nur echte 36 Bit SIMMs, und nur FPM (Fast + Page Mode) DRAM. EDO DRAM oder SIMMs mit simulierter Parity + funktionieren nicht. Das System nutzt + die zusätzlichen 4 Bit für ECC. Das ist auch der + Grund weshalb 33 Bit FPM SIMMs nicht funktionieren. + + Wenn Sie die Wahl haben, sollten Sie zur PS/2-Variante des + Mainboards greifen. Zum einen erhalten Sie einen + Bonus-Anschluß für die Maus, zum anderen wird diese + Variante von Tru64 Unix unterstützt (falls Sie das + irgendwann einmal benutzen wollen oder müssen). Die + DIN-Variante sollte aber für &os; + ausreichend sein. + + Lesen Sie nach Möglichkeit das + OEM manual. + + Die Konfigurationsdatei für den Kernel einer NoName + muß die folgenden Zeilen enthalten: + + options DEC_AXPPCI_33 +cpu EV4 + + + + Universal Desktop Box (UDB oder + <quote>Multia</quote>) + + + Die Multia enthält entweder eine Intel- oder + Alpha-CPU. Hier wird aus offensichtlichen Gründen nur + die Alpha-Variante betrachtet. + + + Die Multia ist ein kleiner Desktop-Rechner, der als eine + Art Personal Workstation gedacht war. Es gibt viele + verschiedene Varianten, Sie sollten also genau auf die Details + achten. + + Features: + + + + 21066 Alpha CPU mit 166 MHz oder 21066A CPU mit 233 + MHz + + + + on-board Bcache / L2 cache: COAST-ähnliches 256 + KByte Cache Modul; die Variante mit 233 MHz hat 512 KByte + Cache; die Variante mit 166 MHz besitzt 256 KByte Cache, + der fest eingebaut ist. + + + + Anschlüsse für PS/2 Maus & Tastatur + + + + Speicher: + + + + Busbreite: 64 Bit + + + + PS/2 72 Pin 36 Bit Fast Page Mode SIMMs + + + + 70ns oder schneller + + + + müssen paarweise installiert werden + + + + 4 SIMM Steckplätze + + + + benutzt ECC + + + + + + 2 serielle Anschlüsse, 16550A + + + + 1 paralleler Anschluß + + + + Floppy-Anschluß + + + + Intel 82378ZB PCI-ISA-Bridge + + + + 1 on-Board 21040 für 10MBit Ethernet mit AUI und + 10Base2 Anschlüssen + + + + Steckplätze: + + + + 1 32 Bit PCI Steckplatz + + + + 2 PCMCIA Steckplätze + + + + + + on-board Crystal CS4231 oder AD1848 Soundchip + + + + on-board Fast SCSI, nutzt einen Symbios 53C810[A] Chip + auf der PCI Riser Card + + + + Das Flash ROM der Multia ist groß genug, um SRM und + ARC aufzunehmen und die Umschaltung der Software zu + ermöglichen. + + Die in die Multia eingebaute TGA-Grafikkarte kann von &os; + nicht als Konsole genutzt werden. Sie + müssen eine serielle Konsole verwenden. + + Die Multia hat nur einen 32 Bit PCI Steckplatz, der nur + für eine kleine PCI-Karte genutzt werden kann. Wenn Sie + darauf verzichten, können Sie eine 3.5" Festplatte + einbauen. Das Montagematerial könnte Ihrer Multia + beiliegen. Allerdings sollten Sie auf den Einbau der + Festplatte verzichten, da das Netzteil + und die Kühlung unterdimensioniert sind. + + Die beiden PCMCIA Steckplätze der Multia werden + momentan nicht von &os; unterstützt. + + Wenn Sie planen, eine schnellere CPU einzubauen, sollen + Sie prüfen, ob die CPU gesockelt ist. Bei den kleineren + Multias ist sie normalerweise eingelötet. + + Die Multia besitzt zwei serielle Schnittstellen, + allerdings sind diese auf einem 25-poligen sub-D + Anschluß zusammengefaßt. In der Multia-FAQ + finden Sie eine Anleitung zum Bau eines Y-Kabels, mit dem Sie + beide Anschlüsse nutzen können. + + Sie können die Multia von Diskette booten, allerdings + können Sie dabei auf Probleme stoßen. Der typische + Fehler ist: + + *** Soft Error - Error #10 - FDC: Data overrun or underrun + + Dies ist kein Problem von &os;, es ist ein Fehler im SRM. + Die einfachste Möglichkeit bei der Installation von &os; + ist, von einem SCSI CDROM zu booten. + + Einige Anwender mußten manchmal + Control-Alt-Del + drücken, um den SRM aufzuwecken. Ich habe diese + Situation noch nie erlebt; aber es kommt auf einen Versuch an, + wenn Sie nach dem Einschalten von einem schwarzen Bildschirm + begrüßt werden. + + Audio funktioniert beim Crystal CS4231 Chip einwandfrei, + wenn Sie den &man.pcm.4;-Treiber benutzen und die folgende + Zeile in der Konfigurationsdatei für Ihren Kernel + haben: + + device pcm + + Die Audio-Hardware nutzt Port 0x530, IRQ 9 und DRQ 3. Sie + müssen in device.hints + zusätzlich noch flags 0x15 + angeben. + + Bis jetzt hat es noch niemand geschafft, einer Multia mit + einem AD1848 einen Ton zu entlocken.. + + Beim Test der Audio-Wiedergabe wird man daran erinnert, + daß die 166 MHz CPU nicht schnell ist. MP3s können + nur mit 22 kHz fehlerfrei wiedergegeben werden. + + Multis sind dafür bekannt, daß sie gerne den + Hitzetod sterben. Das extrem kompakte Gehäuse erlaubt + kaum Luftzufuhr. Sie sollten Sie Multia senkrecht in ihrem + Ständer stellen, nicht waagerecht + (Pizzaschachtel). Es ist eine sehr gute Idee, + den Lüfter durch ein leistungsstärkeres Modell zu + ersetzen. Weiterhin können Sie eines der Kabel zum + Temperatursensor durchschneiden. Danach wird der Lüfter + mit voller Drehzahl (und Lautstärke) betrieben. + Hüten Sie sich vor PCI-Karten, die sehr viel Strom *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 16:18: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 08C9CC61; Fri, 30 Nov 2012 16:18:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFB8D8FC0C; Fri, 30 Nov 2012 16:18:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUGIQjh015888; Fri, 30 Nov 2012 16:18:26 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUGIQWb015887; Fri, 30 Nov 2012 16:18:26 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211301618.qAUGIQWb015887@svn.freebsd.org> From: Hiroki Sato Date: Fri, 30 Nov 2012 16:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r243706 - in releng/9.1/release/doc: de_DE.ISO8859-1 fr_FR.ISO8859-1 ja_JP.eucJP ru_RU.KOI8-R zh_CN.GB2312 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 16:18:27 -0000 Author: hrs Date: Fri Nov 30 16:18:26 2012 New Revision: 243706 URL: http://svnweb.freebsd.org/changeset/base/243706 Log: Remove stale documents. Approved by: re (implicitly) Deleted: releng/9.1/release/doc/de_DE.ISO8859-1/ releng/9.1/release/doc/fr_FR.ISO8859-1/ releng/9.1/release/doc/ja_JP.eucJP/ releng/9.1/release/doc/ru_RU.KOI8-R/ releng/9.1/release/doc/zh_CN.GB2312/ From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 16:33: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 D4FFDFE5; Fri, 30 Nov 2012 16:33:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B85658FC13; Fri, 30 Nov 2012 16:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUGXMG5017823; Fri, 30 Nov 2012 16:33:22 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUGXMPd017820; Fri, 30 Nov 2012 16:33:22 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211301633.qAUGXMPd017820@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 30 Nov 2012 16:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243707 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 16:33:22 -0000 Author: melifaro Date: Fri Nov 30 16:33:22 2012 New Revision: 243707 URL: http://svnweb.freebsd.org/changeset/base/243707 Log: Make ipfw dynamic states operations SMP-ready. * Global IPFW_DYN_LOCK() is changed to per-bucket mutex. * State expiration is done in ipfw_tick every second. * No expiration is done on forwarding path. * hash table resize is done automatically and does not flush all states. * Dynamic UMA zone is now allocated per each VNET * State limiting is now done via UMA(9) api. Discussed with: ipfw MFC after: 3 weeks Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 16:18:26 2012 (r243706) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 16:33:22 2012 (r243707) @@ -2046,7 +2046,7 @@ do { \ f->rulenum, f->id); cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; - ipfw_dyn_unlock(); + ipfw_dyn_unlock(q); cmdlen = 0; match = 1; break; @@ -2525,7 +2525,6 @@ ipfw_init(void) { int error = 0; - ipfw_dyn_attach(); /* * Only print out this stuff the first time around, * when called from the sysinit code. @@ -2579,7 +2578,6 @@ ipfw_destroy(void) { ipfw_log_bpf(0); /* uninit */ - ipfw_dyn_detach(); printf("IP firewall unloaded\n"); } @@ -2637,7 +2635,7 @@ vnet_ipfw_init(const void *unused) chain->id = rule->id = 1; IPFW_LOCK_INIT(chain); - ipfw_dyn_init(); + ipfw_dyn_init(chain); /* First set up some values that are compile time options */ V_ipfw_vnet_ready = 1; /* Open for business */ Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 16:18:26 2012 (r243706) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 16:33:22 2012 (r243707) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); * The lifetime of dynamic rules is regulated by dyn_*_lifetime, * measured in seconds and depending on the flags. * - * The total number of dynamic rules is stored in dyn_count. + * The total number of dynamic rules is equal to UMA zone items count. * The max number of dynamic rules is dyn_max. When we reach * the maximum number of rules we do not create anymore. This is * done to avoid consuming too much memory, but also too much @@ -111,37 +111,33 @@ __FBSDID("$FreeBSD$"); * passes through the firewall. XXX check the latter!!! */ +struct ipfw_dyn_bucket { + struct mtx mtx; /* Bucket protecting lock */ + ipfw_dyn_rule *head; /* Pointer to first rule */ +}; + /* * Static variables followed by global ones */ -static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets); +static VNET_DEFINE(struct ipfw_dyn_bucket *, ipfw_dyn_v); +static VNET_DEFINE(u_int32_t, dyn_buckets_max); static VNET_DEFINE(u_int32_t, curr_dyn_buckets); static VNET_DEFINE(struct callout, ipfw_timeout); #define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets VNET(dyn_buckets) +#define V_dyn_buckets_max VNET(dyn_buckets_max) #define V_curr_dyn_buckets VNET(curr_dyn_buckets) #define V_ipfw_timeout VNET(ipfw_timeout) -static uma_zone_t ipfw_dyn_rule_zone; -#ifndef __FreeBSD__ -DEFINE_SPINLOCK(ipfw_dyn_mtx); -#else -static struct mtx ipfw_dyn_mtx; /* mutex guarding dynamic rules */ -#endif - -#define IPFW_DYN_LOCK_INIT() \ - mtx_init(&ipfw_dyn_mtx, "IPFW dynamic rules", NULL, MTX_DEF) -#define IPFW_DYN_LOCK_DESTROY() mtx_destroy(&ipfw_dyn_mtx) -#define IPFW_DYN_LOCK() mtx_lock(&ipfw_dyn_mtx) -#define IPFW_DYN_UNLOCK() mtx_unlock(&ipfw_dyn_mtx) -#define IPFW_DYN_LOCK_ASSERT() mtx_assert(&ipfw_dyn_mtx, MA_OWNED) +static VNET_DEFINE(uma_zone_t, ipfw_dyn_rule_zone); +#define V_ipfw_dyn_rule_zone VNET(ipfw_dyn_rule_zone) -void -ipfw_dyn_unlock(void) -{ - IPFW_DYN_UNLOCK(); -} +#define IPFW_BUCK_LOCK_INIT(b) \ + mtx_init(&(b)->mtx, "IPFW dynamic bucket", NULL, MTX_DEF) +#define IPFW_BUCK_LOCK_DESTROY(b) \ + mtx_destroy(&(b)->mtx) +#define IPFW_BUCK_LOCK(i) mtx_lock(&V_ipfw_dyn_v[(i)].mtx) +#define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) +#define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) /* * Timeouts for various events in handing dynamic rules. @@ -171,33 +167,42 @@ static VNET_DEFINE(u_int32_t, dyn_short_ static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); static VNET_DEFINE(u_int32_t, dyn_keepalive_period); static VNET_DEFINE(u_int32_t, dyn_keepalive); +static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) #define V_dyn_keepalive_period VNET(dyn_keepalive_period) #define V_dyn_keepalive VNET(dyn_keepalive) +#define V_dyn_keepalive_last VNET(dyn_keepalive_last) -static VNET_DEFINE(u_int32_t, dyn_count); /* # of dynamic rules */ static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ -#define V_dyn_count VNET(dyn_count) +#define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) #define V_dyn_max VNET(dyn_max) +static int last_log; /* Log ratelimiting */ + +static void ipfw_dyn_tick(void *vnetx); +static void check_dyn_rules(struct ip_fw_chain *, struct ip_fw *, + int, int, int); #ifdef SYSCTL_NODE +static int sysctl_ipfw_dyn_count(SYSCTL_HANDLER_ARGS); +static int sysctl_ipfw_dyn_max(SYSCTL_HANDLER_ARGS); + SYSBEGIN(f2) SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_RW, &VNET_NAME(dyn_buckets), 0, - "Number of dyn. buckets"); + CTLFLAG_RW, &VNET_NAME(dyn_buckets_max), 0, + "Max number of dyn. buckets"); SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, "Current Number of dyn. buckets"); -SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_RD, &VNET_NAME(dyn_count), 0, +SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, dyn_count, + CTLTYPE_UINT|CTLFLAG_RD, 0, 0, sysctl_ipfw_dyn_count, "IU", "Number of dyn. rules"); -SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_RW, &VNET_NAME(dyn_max), 0, +SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, dyn_max, + CTLTYPE_UINT|CTLFLAG_RW, 0, 0, sysctl_ipfw_dyn_max, "IU", "Max number of dyn. rules"); SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, @@ -244,7 +249,7 @@ hash_packet6(struct ipfw_flow_id *id) * and we want to find both in the same bucket. */ static __inline int -hash_packet(struct ipfw_flow_id *id) +hash_packet(struct ipfw_flow_id *id, int buckets) { u_int32_t i; @@ -254,7 +259,7 @@ hash_packet(struct ipfw_flow_id *id) else #endif /* INET6 */ i = (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port); - i &= (V_curr_dyn_buckets - 1); + i &= (buckets - 1); return i; } @@ -286,124 +291,19 @@ print_dyn_rule_flags(struct ipfw_flow_id } log(log_flags, "ipfw: %s type %d %s %d -> %s %d, %d %s\n", prefix, dyn_type, src, id->src_port, dst, - id->dst_port, V_dyn_count, postfix); + id->dst_port, DYN_COUNT, postfix); } #define print_dyn_rule(id, dtype, prefix, postfix) \ print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) -/** - * unlink a dynamic rule from a chain. prev is a pointer to - * the previous one, q is a pointer to the rule to delete, - * head is a pointer to the head of the queue. - * Modifies q and potentially also head. - */ -#define UNLINK_DYN_RULE(prev, head, q) { \ - ipfw_dyn_rule *old_q = q; \ - \ - /* remove a refcount to the parent */ \ - if (q->dyn_type == O_LIMIT) \ - q->parent->count--; \ - V_dyn_count--; \ - DEB(print_dyn_rule(&q->id, q->dyn_type, "unlink entry", "left");) \ - if (prev != NULL) \ - prev->next = q = q->next; \ - else \ - head = q = q->next; \ - uma_zfree(ipfw_dyn_rule_zone, old_q); } - #define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) -/** - * Remove dynamic rules pointing to "rule", or all of them if rule == NULL. - * - * If keep_me == NULL, rules are deleted even if not expired, - * otherwise only expired rules are removed. - * - * The value of the second parameter is also used to point to identify - * a rule we absolutely do not want to remove (e.g. because we are - * holding a reference to it -- this is the case with O_LIMIT_PARENT - * rules). The pointer is only used for comparison, so any non-null - * value will do. - */ -static void -remove_dyn_rule(struct ip_fw *rule, ipfw_dyn_rule *keep_me) -{ - static u_int32_t last_remove = 0; - -#define FORCE (keep_me == NULL) - - ipfw_dyn_rule *prev, *q; - int i, pass = 0, max_pass = 0; - - IPFW_DYN_LOCK_ASSERT(); - - if (V_ipfw_dyn_v == NULL || V_dyn_count == 0) - return; - /* do not expire more than once per second, it is useless */ - if (!FORCE && last_remove == time_uptime) - return; - last_remove = time_uptime; - - /* - * because O_LIMIT refer to parent rules, during the first pass only - * remove child and mark any pending LIMIT_PARENT, and remove - * them in a second pass. - */ -next_pass: - for (i = 0 ; i < V_curr_dyn_buckets ; i++) { - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q ; ) { - /* - * Logic can become complex here, so we split tests. - */ - if (q == keep_me) - goto next; - if (rule != NULL && rule != q->rule) - goto next; /* not the one we are looking for */ - if (q->dyn_type == O_LIMIT_PARENT) { - /* - * handle parent in the second pass, - * record we need one. - */ - max_pass = 1; - if (pass == 0) - goto next; - if (FORCE && q->count != 0 ) { - /* XXX should not happen! */ - printf("ipfw: OUCH! cannot remove rule," - " count %d\n", q->count); - } - } else { - if (!FORCE && - !TIME_LEQ( q->expire, time_uptime )) - goto next; - } - if (q->dyn_type != O_LIMIT_PARENT || !q->count) { - UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); - continue; - } -next: - prev=q; - q=q->next; - } - } - if (pass++ < max_pass) - goto next_pass; -} - -void -ipfw_remove_dyn_children(struct ip_fw *rule) -{ - IPFW_DYN_LOCK(); - remove_dyn_rule(rule, NULL /* force removal */); - IPFW_DYN_UNLOCK(); -} - /* * Lookup a dynamic rule, locked version. */ static ipfw_dyn_rule * -lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, +lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i, int *match_direction, struct tcphdr *tcp) { /* @@ -414,23 +314,17 @@ lookup_dyn_rule_locked(struct ipfw_flow_ #define MATCH_FORWARD 1 #define MATCH_NONE 2 #define MATCH_UNKNOWN 3 - int i, dir = MATCH_NONE; + int dir = MATCH_NONE; ipfw_dyn_rule *prev, *q = NULL; - IPFW_DYN_LOCK_ASSERT(); + IPFW_BUCK_ASSERT(i); - if (V_ipfw_dyn_v == NULL) - goto done; /* not found */ - i = hash_packet(pkt); - for (prev = NULL, q = V_ipfw_dyn_v[i]; q != NULL;) { + for (prev = NULL, q = V_ipfw_dyn_v[i].head; q; prev = q, q = q->next) { if (q->dyn_type == O_LIMIT_PARENT && q->count) - goto next; - if (TIME_LEQ(q->expire, time_uptime)) { /* expire entry */ - UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); continue; - } + if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) - goto next; + continue; if (IS_IP6_FLOW_ID(pkt)) { if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && @@ -463,17 +357,14 @@ lookup_dyn_rule_locked(struct ipfw_flow_ break; } } -next: - prev = q; - q = q->next; } if (q == NULL) goto done; /* q = NULL, not found */ if (prev != NULL) { /* found and not in front */ prev->next = q->next; - q->next = V_ipfw_dyn_v[i]; - V_ipfw_dyn_v[i] = q; + q->next = V_ipfw_dyn_v[i].head; + V_ipfw_dyn_v[i].head = q; } if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ uint32_t ack; @@ -556,42 +447,108 @@ ipfw_lookup_dyn_rule(struct ipfw_flow_id struct tcphdr *tcp) { ipfw_dyn_rule *q; + int i; - IPFW_DYN_LOCK(); - q = lookup_dyn_rule_locked(pkt, match_direction, tcp); + i = hash_packet(pkt, V_curr_dyn_buckets); + + IPFW_BUCK_LOCK(i); + q = lookup_dyn_rule_locked(pkt, i, match_direction, tcp); if (q == NULL) - IPFW_DYN_UNLOCK(); + IPFW_BUCK_UNLOCK(i); /* NB: return table locked when q is not NULL */ return q; } -static void -realloc_dynamic_table(void) +/* + * Unlock bucket mtx + * @p - pointer to dynamic rule + */ +void +ipfw_dyn_unlock(ipfw_dyn_rule *q) +{ + + IPFW_BUCK_UNLOCK(q->bucket); +} + +static int +resize_dynamic_table(struct ip_fw_chain *chain, int nbuckets) { - IPFW_DYN_LOCK_ASSERT(); + int i, k, nbuckets_old; + ipfw_dyn_rule *q; + struct ipfw_dyn_bucket *dyn_v, *dyn_v_old; + + /* Check if given number is power of 2 and less than 64k */ + if ((nbuckets > 65536) || (!powerof2(nbuckets))) + return 1; + + CTR3(KTR_NET, "%s: resize dynamic hash: %d -> %d", __func__, + V_curr_dyn_buckets, nbuckets); + + /* Allocate and initialize new hash */ + dyn_v = malloc(nbuckets * sizeof(ipfw_dyn_rule), M_IPFW, + M_WAITOK | M_ZERO); + + for (i = 0 ; i < nbuckets; i++) + IPFW_BUCK_LOCK_INIT(&dyn_v[i]); /* - * Try reallocation, make sure we have a power of 2 and do - * not allow more than 64k entries. In case of overflow, - * default to 1024. + * Call upper half lock, as get_map() do to ease + * read-only access to dynamic rules hash from sysctl */ + IPFW_UH_WLOCK(chain); - if (V_dyn_buckets > 65536) - V_dyn_buckets = 1024; - if ((V_dyn_buckets & (V_dyn_buckets-1)) != 0) { /* not a power of 2 */ - V_dyn_buckets = V_curr_dyn_buckets; /* reset */ - return; + /* + * Acquire chain write lock to permit hash access + * for main traffic path without additional locks + */ + IPFW_WLOCK(chain); + + /* Save old values */ + nbuckets_old = V_curr_dyn_buckets; + dyn_v_old = V_ipfw_dyn_v; + + /* Skip relinking if array is not set up */ + if (V_ipfw_dyn_v == NULL) + V_curr_dyn_buckets = 0; + + /* Re-link all dynamic states */ + for (i = 0 ; i < V_curr_dyn_buckets ; i++) { + while (V_ipfw_dyn_v[i].head != NULL) { + /* Remove from current chain */ + q = V_ipfw_dyn_v[i].head; + V_ipfw_dyn_v[i].head = q->next; + + /* Get new hash value */ + k = hash_packet(&q->id, nbuckets); + q->bucket = k; + /* Add to the new head */ + q->next = dyn_v[k].head; + dyn_v[k].head = q; + } } - V_curr_dyn_buckets = V_dyn_buckets; - if (V_ipfw_dyn_v != NULL) - free(V_ipfw_dyn_v, M_IPFW); - for (;;) { - V_ipfw_dyn_v = malloc(V_curr_dyn_buckets * sizeof(ipfw_dyn_rule *), - M_IPFW, M_NOWAIT | M_ZERO); - if (V_ipfw_dyn_v != NULL || V_curr_dyn_buckets <= 2) - break; - V_curr_dyn_buckets /= 2; + + /* Update current pointers/buckets values */ + V_curr_dyn_buckets = nbuckets; + V_ipfw_dyn_v = dyn_v; + + IPFW_WUNLOCK(chain); + + IPFW_UH_WUNLOCK(chain); + + /* Start periodic callout on initial creation */ + if (dyn_v_old == NULL) { + callout_reset_on(&V_ipfw_timeout, hz, ipfw_dyn_tick, curvnet, 0); + return (0); } + + /* Destroy all mutexes */ + for (i = 0 ; i < nbuckets_old ; i++) + IPFW_BUCK_LOCK_DESTROY(&dyn_v_old[i]); + + /* Free old hash */ + free(dyn_v_old, M_IPFW); + + return 0; } /** @@ -605,33 +562,30 @@ realloc_dynamic_table(void) * - "parent" rules for the above (O_LIMIT_PARENT). */ static ipfw_dyn_rule * -add_dyn_rule(struct ipfw_flow_id *id, u_int8_t dyn_type, struct ip_fw *rule) +add_dyn_rule(struct ipfw_flow_id *id, int i, u_int8_t dyn_type, struct ip_fw *rule) { ipfw_dyn_rule *r; - int i; - IPFW_DYN_LOCK_ASSERT(); + IPFW_BUCK_ASSERT(i); - if (V_ipfw_dyn_v == NULL || - (V_dyn_count == 0 && V_dyn_buckets != V_curr_dyn_buckets)) { - realloc_dynamic_table(); - if (V_ipfw_dyn_v == NULL) - return NULL; /* failed ! */ - } - i = hash_packet(id); - - r = uma_zalloc(ipfw_dyn_rule_zone, M_NOWAIT | M_ZERO); + r = uma_zalloc(V_ipfw_dyn_rule_zone, M_NOWAIT | M_ZERO); if (r == NULL) { - printf ("ipfw: sorry cannot allocate state\n"); + if (last_log != time_uptime) { + last_log = time_uptime; + log(LOG_DEBUG, "ipfw: %s: Cannot allocate rule\n", + __func__); + } return NULL; } - /* increase refcount on parent, and set pointer */ + /* + * refcount on parent is already incremented, so + * it is safe to use parent unlocked. + */ if (dyn_type == O_LIMIT) { ipfw_dyn_rule *parent = (ipfw_dyn_rule *)rule; if ( parent->dyn_type != O_LIMIT_PARENT) panic("invalid parent"); - parent->count++; r->parent = parent; rule = parent->rule; } @@ -644,9 +598,8 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ r->count = 0; r->bucket = i; - r->next = V_ipfw_dyn_v[i]; - V_ipfw_dyn_v[i] = r; - V_dyn_count++; + r->next = V_ipfw_dyn_v[i].head; + V_ipfw_dyn_v[i].head = r; DEB(print_dyn_rule(id, dyn_type, "add dyn entry", "total");) return r; } @@ -656,40 +609,40 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ * If the lookup fails, then install one. */ static ipfw_dyn_rule * -lookup_dyn_parent(struct ipfw_flow_id *pkt, struct ip_fw *rule) +lookup_dyn_parent(struct ipfw_flow_id *pkt, int *pindex, struct ip_fw *rule) { ipfw_dyn_rule *q; - int i; + int i, is_v6; - IPFW_DYN_LOCK_ASSERT(); + is_v6 = IS_IP6_FLOW_ID(pkt); + i = hash_packet( pkt, V_curr_dyn_buckets ); + *pindex = i; + IPFW_BUCK_LOCK(i); + for (q = V_ipfw_dyn_v[i].head ; q != NULL ; q=q->next) + if (q->dyn_type == O_LIMIT_PARENT && + rule== q->rule && + pkt->proto == q->id.proto && + pkt->src_port == q->id.src_port && + pkt->dst_port == q->id.dst_port && + ( + (is_v6 && + IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), + &(q->id.src_ip6)) && + IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), + &(q->id.dst_ip6))) || + (!is_v6 && + pkt->src_ip == q->id.src_ip && + pkt->dst_ip == q->id.dst_ip) + ) + ) { + q->expire = time_uptime + V_dyn_short_lifetime; + DEB(print_dyn_rule(pkt, q->dyn_type, + "lookup_dyn_parent found", "");) + return q; + } - if (V_ipfw_dyn_v) { - int is_v6 = IS_IP6_FLOW_ID(pkt); - i = hash_packet( pkt ); - for (q = V_ipfw_dyn_v[i] ; q != NULL ; q=q->next) - if (q->dyn_type == O_LIMIT_PARENT && - rule== q->rule && - pkt->proto == q->id.proto && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port && - ( - (is_v6 && - IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.src_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.dst_ip6))) || - (!is_v6 && - pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip) - ) - ) { - q->expire = time_uptime + V_dyn_short_lifetime; - DEB(print_dyn_rule(pkt, q->dyn_type, - "lookup_dyn_parent found", "");) - return q; - } - } - return add_dyn_rule(pkt, O_LIMIT_PARENT, rule); + /* Add virtual limiting rule */ + return add_dyn_rule(pkt, i, O_LIMIT_PARENT, rule); } /** @@ -702,14 +655,16 @@ int ipfw_install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg) { - static int last_log; ipfw_dyn_rule *q; + int i; DEB(print_dyn_rule(&args->f_id, cmd->o.opcode, "install_state", "");) + + i = hash_packet(&args->f_id, V_curr_dyn_buckets); - IPFW_DYN_LOCK(); + IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(&args->f_id, NULL, NULL); + q = lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL); if (q != NULL) { /* should never occur */ DEB( @@ -718,26 +673,20 @@ ipfw_install_state(struct ip_fw *rule, i printf("ipfw: %s: entry already present, done\n", __func__); }) - IPFW_DYN_UNLOCK(); + IPFW_BUCK_UNLOCK(i); return (0); } - if (V_dyn_count >= V_dyn_max) - /* Run out of slots, try to remove any expired rule. */ - remove_dyn_rule(NULL, (ipfw_dyn_rule *)1); - - if (V_dyn_count >= V_dyn_max) { - if (last_log != time_uptime) { - last_log = time_uptime; - printf("ipfw: %s: Too many dynamic rules\n", __func__); - } - IPFW_DYN_UNLOCK(); - return (1); /* cannot install, notify caller */ - } + /* + * State limiting is done via uma(9) zone limiting. + * Save pointer to newly-installed rule and reject + * packet if add_dyn_rule() returned NULL. + * Note q is currently set to NULL. + */ switch (cmd->o.opcode) { case O_KEEP_STATE: /* bidir rule */ - add_dyn_rule(&args->f_id, O_KEEP_STATE, rule); + q = add_dyn_rule(&args->f_id, i, O_KEEP_STATE, rule); break; case O_LIMIT: { /* limit number of sessions */ @@ -745,6 +694,7 @@ ipfw_install_state(struct ip_fw *rule, i ipfw_dyn_rule *parent; uint32_t conn_limit; uint16_t limit_mask = cmd->limit_mask; + int pindex; conn_limit = (cmd->conn_limit == IP_FW_TABLEARG) ? tablearg : cmd->conn_limit; @@ -778,46 +728,65 @@ ipfw_install_state(struct ip_fw *rule, i id.src_port = args->f_id.src_port; if (limit_mask & DYN_DST_PORT) id.dst_port = args->f_id.dst_port; - if ((parent = lookup_dyn_parent(&id, rule)) == NULL) { + + /* + * We have to release lock for previous bucket to + * avoid possible deadlock + */ + IPFW_BUCK_UNLOCK(i); + + if ((parent = lookup_dyn_parent(&id, &pindex, rule)) == NULL) { printf("ipfw: %s: add parent failed\n", __func__); - IPFW_DYN_UNLOCK(); + IPFW_BUCK_UNLOCK(pindex); return (1); } if (parent->count >= conn_limit) { - /* See if we can remove some expired rule. */ - remove_dyn_rule(rule, parent); - if (parent->count >= conn_limit) { - if (V_fw_verbose && last_log != time_uptime) { - last_log = time_uptime; - char sbuf[24]; - last_log = time_uptime; - snprintf(sbuf, sizeof(sbuf), - "%d drop session", - parent->rule->rulenum); - print_dyn_rule_flags(&args->f_id, - cmd->o.opcode, - LOG_SECURITY | LOG_DEBUG, - sbuf, "too many entries"); - } - IPFW_DYN_UNLOCK(); - return (1); + if (V_fw_verbose && last_log != time_uptime) { + last_log = time_uptime; + char sbuf[24]; + last_log = time_uptime; + snprintf(sbuf, sizeof(sbuf), + "%d drop session", + parent->rule->rulenum); + print_dyn_rule_flags(&args->f_id, + cmd->o.opcode, + LOG_SECURITY | LOG_DEBUG, + sbuf, "too many entries"); } + IPFW_BUCK_UNLOCK(pindex); + return (1); + } + /* Increment counter on parent */ + parent->count++; + IPFW_BUCK_UNLOCK(pindex); + + IPFW_BUCK_LOCK(i); + q = add_dyn_rule(&args->f_id, i, O_LIMIT, (struct ip_fw *)parent); + if (q == NULL) { + /* Decrement index and notify caller */ + IPFW_BUCK_UNLOCK(i); + IPFW_BUCK_LOCK(pindex); + parent->count--; + IPFW_BUCK_UNLOCK(pindex); + return (1); } - add_dyn_rule(&args->f_id, O_LIMIT, (struct ip_fw *)parent); break; } default: printf("ipfw: %s: unknown dynamic rule type %u\n", __func__, cmd->o.opcode); - IPFW_DYN_UNLOCK(); - return (1); + } + + if (q == NULL) { + IPFW_BUCK_UNLOCK(i); + return (1); /* Notify caller about failure */ } /* XXX just set lifetime */ - lookup_dyn_rule_locked(&args->f_id, NULL, NULL); + lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL); - IPFW_DYN_UNLOCK(); + IPFW_BUCK_UNLOCK(i); return (0); } @@ -996,23 +965,92 @@ ipfw_dyn_send_ka(struct mbuf **mtailp, i } /* - * This procedure is only used to handle keepalives. It is invoked - * every dyn_keepalive_period + * This procedure is used to perform various maintance + * on dynamic hash list. Currently it is called every second. */ static void -ipfw_tick(void * vnetx) +ipfw_dyn_tick(void * vnetx) { - struct mbuf *m0, *m, *mnext, **mtailp; - struct ip *h; - int i; - ipfw_dyn_rule *q; + struct ip_fw_chain *chain; + int check_ka = 0; #ifdef VIMAGE struct vnet *vp = vnetx; #endif CURVNET_SET(vp); - if (V_dyn_keepalive == 0 || V_ipfw_dyn_v == NULL || V_dyn_count == 0) - goto done; + + chain = &V_layer3_chain; + + /* Run keepalive checks every keepalive_interval iff ka is enabled */ + if ((V_dyn_keepalive_last + V_dyn_keepalive_interval >= time_uptime) && + (V_dyn_keepalive != 0)) { + V_dyn_keepalive_last = time_uptime; + check_ka = 1; + } + + check_dyn_rules(chain, NULL, RESVD_SET, check_ka, 1); + + callout_reset_on(&V_ipfw_timeout, hz, ipfw_dyn_tick, vnetx, 0); + + CURVNET_RESTORE(); +} + + +/* + * Walk thru all dynamic states doing generic maintance: + * 1) free expired states + * 2) free all states based on deleted rule / set + * 3) send keepalives for states if needed + * + * @chain - pointer to current ipfw rules chain + * @rule - delete all states originated by given rule if != NULL + * @set - delete all states originated by any rule in set @set if != RESVD_SET + * @check_ka - perform checking/sending keepalives + * @timer - indicate call from timer routine. + * + * Timer routine must call this function unlocked to permit + * sending keepalives/resizing table. + * + * Others has to call function with IPFW_UH_WLOCK held. + * Additionally, function assume that dynamic rule/set is + * ALREADY deleted so no new states can be generated by + * 'deleted' rules. + * + * Write lock is needed to ensure that unused parent rules + * are not freed by other instance (see stage 2, 3) + */ +static void +check_dyn_rules(struct ip_fw_chain *chain, struct ip_fw *rule, + int set, int check_ka, int timer) +{ + struct mbuf *m0, *m, *mnext, **mtailp; + struct ip *h; + int i, dyn_count, new_buckets = 0, max_buckets; + int expired = 0, expired_limits = 0, parents = 0, total = 0; + ipfw_dyn_rule *q, *q_prev, *q_next; + ipfw_dyn_rule *exp_head, **exptailp; + ipfw_dyn_rule *exp_lhead, **expltailp; + + KASSERT(V_ipfw_dyn_v != NULL, ("%s: dynamic table not allocated", + __func__)); + + /* Avoid possible LOR */ + KASSERT(!check_ka || timer, ("%s: keepalive check with lock held", + __func__)); + + /* + * Do not perform any checks if we currently have no dynamic states + */ + if (DYN_COUNT == 0) + return; + + /* Expired states */ + exp_head = NULL; + exptailp = &exp_head; + + /* Expired limit states */ + exp_lhead = NULL; + expltailp = &exp_lhead; /* * We make a chain of packets to go out here -- not deferring @@ -1022,26 +1060,211 @@ ipfw_tick(void * vnetx) */ m0 = NULL; mtailp = &m0; - IPFW_DYN_LOCK(); + + /* Protect from hash resizing */ + if (timer != 0) + IPFW_UH_WLOCK(chain); + else + IPFW_UH_WLOCK_ASSERT(chain); + +#define NEXT_RULE() { q_prev = q; q = q->next ; continue; } + + /* Stage 1: perform requested deletion */ for (i = 0 ; i < V_curr_dyn_buckets ; i++) { - for (q = V_ipfw_dyn_v[i] ; q ; q = q->next ) { - if (q->dyn_type == O_LIMIT_PARENT) - continue; - if (TIME_LEQ(q->expire, time_uptime)) - continue; /* too late, rule expired */ + IPFW_BUCK_LOCK(i); + for (q = V_ipfw_dyn_v[i].head, q_prev = q; q ; ) { + /* account every rule */ + total++; - if (q->id.proto != IPPROTO_TCP) - continue; - if ( (q->state & BOTH_SYN) != BOTH_SYN) + /* Skip parent rules at all */ + if (q->dyn_type == O_LIMIT_PARENT) { + parents++; + NEXT_RULE(); + } + + /* + * Remove rules which are: + * 1) expired + * 2) created by given rule + * 3) created by any rule in given set + */ + if ((TIME_LEQ(q->expire, time_uptime)) || + ((rule != NULL) && (q->rule == rule)) || + ((set != RESVD_SET) && (q->rule->set == set))) { + /* Unlink q from current list */ + q_next = q->next; + if (q == V_ipfw_dyn_v[i].head) + V_ipfw_dyn_v[i].head = q_next; + else + q_prev->next = q_next; + + q->next = NULL; + + /* queue q to expire list */ + if (q->dyn_type != O_LIMIT) { + *exptailp = q; + exptailp = &(*exptailp)->next; + DEB(print_dyn_rule(&q->id, q->dyn_type, + "unlink entry", "left"); + ) + } else { + /* Separate list for limit rules */ + *expltailp = q; + expltailp = &(*expltailp)->next; + expired_limits++; + DEB(print_dyn_rule(&q->id, q->dyn_type, + "unlink limit entry", "left"); + ) + } + + q = q_next; + expired++; continue; - if (TIME_LEQ(time_uptime + V_dyn_keepalive_interval, - q->expire)) - continue; /* too early */ + } + + /* + * Check if we need to send keepalive: + * we need to ensure if is time to do KA, + * this is established TCP session, and + * expire time is within keepalive interval + */ + if ((check_ka != 0) && (q->id.proto == IPPROTO_TCP) && + ((q->state & BOTH_SYN) == BOTH_SYN) && + (TIME_LEQ(q->expire, time_uptime + + V_dyn_keepalive_interval))) + mtailp = ipfw_dyn_send_ka(mtailp, q); + + NEXT_RULE(); + } + IPFW_BUCK_UNLOCK(i); + } + + /* Stage 2: decrement counters from O_LIMIT parents */ + if (expired_limits != 0) { + /* + * XXX: Note that deleting set with more than one + * heavily-used LIMIT rules can result in overwhelming + * locking due to lack of per-hash value sorting + * + * We should probably think about: + * 1) pre-allocating hash of size, say, + * MAX(16, V_curr_dyn_buckets / 1024) + * 2) checking if expired_limits is large enough + * 3) If yes, init hash (or its part), re-link + * current list and start decrementing procedure in + * each bucket separately + */ + + /* + * Small optimization: do not unlock bucket until + * we see the next item resides in different bucket + */ + if (exp_lhead != NULL) { + i = exp_lhead->parent->bucket; + IPFW_BUCK_LOCK(i); + } + for (q = exp_lhead; q != NULL; q = q->next) { + if (i != q->parent->bucket) { + IPFW_BUCK_UNLOCK(i); + i = q->parent->bucket; + IPFW_BUCK_LOCK(i); + } - mtailp = ipfw_dyn_send_ka(mtailp, q); + /* Decrease parent refcount */ + q->parent->count--; + } + if (exp_lhead != NULL) + IPFW_BUCK_UNLOCK(i); + } + + /* + * We protectet ourselves from unused parent deletion + * (from the timer function) by holding UH write lock. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 19:27: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 C4308DB1; Fri, 30 Nov 2012 19:27:31 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A94F38FC17; Fri, 30 Nov 2012 19:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUJRVkY043073; Fri, 30 Nov 2012 19:27:31 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUJRVcI043072; Fri, 30 Nov 2012 19:27:31 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201211301927.qAUJRVcI043072@svn.freebsd.org> From: Ken Smith Date: Fri, 30 Nov 2012 19:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243708 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 19:27:31 -0000 Author: kensmith Date: Fri Nov 30 19:27:31 2012 New Revision: 243708 URL: http://svnweb.freebsd.org/changeset/base/243708 Log: Guess when we'll be ready to announce 9.1-RELEASE. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Fri Nov 30 16:33:22 2012 (r243707) +++ stable/9/UPDATING Fri Nov 30 19:27:31 2012 (r243708) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121205: + 9.1-RELEASE. + 20121129: A new version of ZFS (pool version 5000) has been merged to 9-STABLE. Starting with this version the old system of ZFS pool versioning From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 19:35:01 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 89D4FFCA; Fri, 30 Nov 2012 19:35:01 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F64D8FC08; Fri, 30 Nov 2012 19:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUJZ1NE044050; Fri, 30 Nov 2012 19:35:01 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUJZ1FU044049; Fri, 30 Nov 2012 19:35:01 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201211301935.qAUJZ1FU044049@svn.freebsd.org> From: Ken Smith Date: Fri, 30 Nov 2012 19:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r243709 - releng/9.1 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 19:35:01 -0000 Author: kensmith Date: Fri Nov 30 19:35:01 2012 New Revision: 243709 URL: http://svnweb.freebsd.org/changeset/base/243709 Log: Merge r243708: Guess when we'll be ready to announce 9.1-RELEASE. Approved by: re (implicit) Modified: releng/9.1/UPDATING (contents, props changed) Directory Properties: releng/9.1/ (props changed) Modified: releng/9.1/UPDATING ============================================================================== --- releng/9.1/UPDATING Fri Nov 30 19:27:31 2012 (r243708) +++ releng/9.1/UPDATING Fri Nov 30 19:35:01 2012 (r243709) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121205: + 9.1-RELEASE. + 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 19:36: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 44E801B0; Fri, 30 Nov 2012 19:36:21 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 279C38FC15; Fri, 30 Nov 2012 19:36:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUJaLPq044243; Fri, 30 Nov 2012 19:36:21 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUJaLUh044242; Fri, 30 Nov 2012 19:36:21 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201211301936.qAUJaLUh044242@svn.freebsd.org> From: Ken Smith Date: Fri, 30 Nov 2012 19:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r243710 - releng/9.1/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 19:36:21 -0000 Author: kensmith Date: Fri Nov 30 19:36:20 2012 New Revision: 243710 URL: http://svnweb.freebsd.org/changeset/base/243710 Log: We think we're ready for the 9.1-RELEASE builds. Approved by: re (implicit) Modified: releng/9.1/sys/conf/newvers.sh Modified: releng/9.1/sys/conf/newvers.sh ============================================================================== --- releng/9.1/sys/conf/newvers.sh Fri Nov 30 19:35:01 2012 (r243709) +++ releng/9.1/sys/conf/newvers.sh Fri Nov 30 19:36:20 2012 (r243710) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="RC3" +BRANCH="RELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 19:36:55 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 EE1B5310; Fri, 30 Nov 2012 19:36:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA3528FC17; Fri, 30 Nov 2012 19:36:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUJatfU044339; Fri, 30 Nov 2012 19:36:55 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUJatp4044335; Fri, 30 Nov 2012 19:36:55 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211301936.qAUJatp4044335@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 30 Nov 2012 19:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243711 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 19:36:56 -0000 Author: melifaro Date: Fri Nov 30 19:36:55 2012 New Revision: 243711 URL: http://svnweb.freebsd.org/changeset/base/243711 Log: Use common macros for working with rule/dynamic counters. This is done as preparation to introduce per-cpu ipfw counters. MFC after: 3 weeks Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 19:36:20 2012 (r243710) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 19:36:55 2012 (r243711) @@ -2034,8 +2034,7 @@ do { \ * the parent rule by setting * f, cmd, l and clearing cmdlen. */ - q->pcnt++; - q->bcnt += pktlen; + IPFW_INC_DYN_COUNTER(q, pktlen); /* XXX we would like to have f_pos * readily accessible in the dynamic * rule, instead of having to @@ -2096,16 +2095,12 @@ do { \ break; case O_COUNT: - f->pcnt++; /* update stats */ - f->bcnt += pktlen; - f->timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); l = 0; /* exit inner loop */ break; case O_SKIPTO: - f->pcnt++; /* update stats */ - f->bcnt += pktlen; - f->timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); /* If possible use cached f_pos (in f->next_rule), * whose version is written in f->next_rule * (horrible hacks to avoid changing the ABI). @@ -2202,9 +2197,7 @@ do { \ break; } - f->pcnt++; /* update stats */ - f->bcnt += pktlen; - f->timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); stack = (uint16_t *)(mtag + 1); /* @@ -2357,9 +2350,7 @@ do { \ case O_SETFIB: { uint32_t fib; - f->pcnt++; /* update stats */ - f->bcnt += pktlen; - f->timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); fib = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg: cmd->arg1; if (fib >= rt_numfibs) @@ -2409,8 +2400,7 @@ do { \ case O_REASS: { int ip_off; - f->pcnt++; - f->bcnt += pktlen; + IPFW_INC_RULE_COUNTER(f, pktlen); l = 0; /* in any case exit inner loop */ ip_off = ntohs(ip->ip_off); @@ -2473,9 +2463,7 @@ do { \ if (done) { struct ip_fw *rule = chain->map[f_pos]; /* Update statistics */ - rule->pcnt++; - rule->bcnt += pktlen; - rule->timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(rule, pktlen); } else { retval = IP_FW_DENY; printf("ipfw: ouch!, skip past end of rules, denying packet\n"); Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 19:36:20 2012 (r243710) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 19:36:55 2012 (r243711) @@ -594,7 +594,7 @@ add_dyn_rule(struct ipfw_flow_id *id, in r->expire = time_uptime + V_dyn_syn_lifetime; r->rule = rule; r->dyn_type = dyn_type; - r->pcnt = r->bcnt = 0; + IPFW_ZERO_DYN_COUNTER(r); r->count = 0; r->bucket = i; Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Fri Nov 30 19:36:20 2012 (r243710) +++ head/sys/netpfil/ipfw/ip_fw_private.h Fri Nov 30 19:36:55 2012 (r243711) @@ -236,6 +236,28 @@ struct ip_fw_chain { struct sockopt; /* used by tcp_var.h */ +/* Macro for working with various counters */ +#define IPFW_INC_RULE_COUNTER(_cntr, _bytes) do { \ + (_cntr)->pcnt++; \ + (_cntr)->bcnt += _bytes; \ + (_cntr)->timestamp = time_uptime; \ + } while (0) + +#define IPFW_INC_DYN_COUNTER(_cntr, _bytes) do { \ + (_cntr)->pcnt++; \ + (_cntr)->bcnt += _bytes; \ + } while (0) + +#define IPFW_ZERO_RULE_COUNTER(_cntr) do { \ + (_cntr)->pcnt = 0; \ + (_cntr)->bcnt = 0; \ + (_cntr)->timestamp = 0; \ + } while (0) + +#define IPFW_ZERO_DYN_COUNTER(_cntr) do { \ + (_cntr)->pcnt = 0; \ + (_cntr)->bcnt = 0; \ + } while (0) /* * The lock is heavily used by ip_fw2.c (the main file) and ip_fw_nat.c * so the variable and the macros must be here. Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri Nov 30 19:36:20 2012 (r243710) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri Nov 30 19:36:55 2012 (r243711) @@ -175,9 +175,7 @@ ipfw_add_rule(struct ip_fw_chain *chain, /* clear fields not settable from userland */ rule->x_next = NULL; rule->next_rule = NULL; - rule->pcnt = 0; - rule->bcnt = 0; - rule->timestamp = 0; + IPFW_ZERO_RULE_COUNTER(rule); if (V_autoinc_step < 1) V_autoinc_step = 1; @@ -439,10 +437,8 @@ clear_counters(struct ip_fw *rule, int l { ipfw_insn_log *l = (ipfw_insn_log *)ACTION_PTR(rule); - if (log_only == 0) { - rule->bcnt = rule->pcnt = 0; - rule->timestamp = 0; - } + if (log_only == 0) + IPFW_ZERO_RULE_COUNTER(rule); if (l->o.opcode == O_LOG) l->log_left = l->max_log; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 20:15: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 80CF6A08; Fri, 30 Nov 2012 20:15:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66ECC8FC13; Fri, 30 Nov 2012 20:15:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUKF2NP049360; Fri, 30 Nov 2012 20:15:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUKF2BA049358; Fri, 30 Nov 2012 20:15:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201211302015.qAUKF2BA049358@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 30 Nov 2012 20:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243712 - in head/sys: amd64/pci i386/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 20:15:02 -0000 Author: jkim Date: Fri Nov 30 20:15:01 2012 New Revision: 243712 URL: http://svnweb.freebsd.org/changeset/base/243712 Log: Use volatile keywords properly. Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- head/sys/amd64/pci/pci_cfgreg.c Fri Nov 30 19:36:55 2012 (r243711) +++ head/sys/amd64/pci/pci_cfgreg.c Fri Nov 30 20:15:01 2012 (r243712) @@ -313,7 +313,7 @@ static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) { - volatile vm_offset_t va; + vm_offset_t va; int data = -1; if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || @@ -324,16 +324,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("movl %1, %0" : "=a" (data) - : "m" (*(uint32_t *)va)); + __asm("movl %1, %0" : "=a" (data) + : "m" (*(volatile uint32_t *)va)); break; case 2: - __asm __volatile("movzwl %1, %0" : "=a" (data) - : "m" (*(uint16_t *)va)); + __asm("movzwl %1, %0" : "=a" (data) + : "m" (*(volatile uint16_t *)va)); break; case 1: - __asm __volatile("movzbl %1, %0" : "=a" (data) - : "m" (*(uint8_t *)va)); + __asm("movzbl %1, %0" : "=a" (data) + : "m" (*(volatile uint8_t *)va)); break; } @@ -344,7 +344,7 @@ static void pciereg_cfgwrite(int bus, unsigned slot, unsigned func, unsigned reg, int data, unsigned bytes) { - volatile vm_offset_t va; + vm_offset_t va; if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCIE_REGMAX) @@ -354,15 +354,15 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("movl %1, %0" : "=m" (*(uint32_t *)va) + __asm("movl %1, %0" : "=m" (*(volatile uint32_t *)va) : "a" (data)); break; case 2: - __asm __volatile("movw %1, %0" : "=m" (*(uint16_t *)va) + __asm("movw %1, %0" : "=m" (*(volatile uint16_t *)va) : "a" ((uint16_t)data)); break; case 1: - __asm __volatile("movb %1, %0" : "=m" (*(uint8_t *)va) + __asm("movb %1, %0" : "=m" (*(volatile uint8_t *)va) : "a" ((uint8_t)data)); break; } Modified: head/sys/i386/pci/pci_cfgreg.c ============================================================================== --- head/sys/i386/pci/pci_cfgreg.c Fri Nov 30 19:36:55 2012 (r243711) +++ head/sys/i386/pci/pci_cfgreg.c Fri Nov 30 20:15:01 2012 (r243712) @@ -665,7 +665,7 @@ pciereg_cfgread(int bus, unsigned slot, unsigned bytes) { struct pcie_cfg_elem *elem; - volatile vm_offset_t va; + vm_offset_t va; vm_paddr_t pa, papage; int data = -1; @@ -681,16 +681,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("movl %1, %0" : "=a" (data) - : "m" (*(uint32_t *)va)); + __asm("movl %1, %0" : "=a" (data) + : "m" (*(volatile uint32_t *)va)); break; case 2: - __asm __volatile("movzwl %1, %0" : "=a" (data) - : "m" (*(uint16_t *)va)); + __asm("movzwl %1, %0" : "=a" (data) + : "m" (*(volatile uint16_t *)va)); break; case 1: - __asm __volatile("movzbl %1, %0" : "=a" (data) - : "m" (*(uint8_t *)va)); + __asm("movzbl %1, %0" : "=a" (data) + : "m" (*(volatile uint8_t *)va)); break; } @@ -703,7 +703,7 @@ pciereg_cfgwrite(int bus, unsigned slot, unsigned bytes) { struct pcie_cfg_elem *elem; - volatile vm_offset_t va; + vm_offset_t va; vm_paddr_t pa, papage; if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || @@ -718,15 +718,15 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile("movl %1, %0" : "=m" (*(uint32_t *)va) + __asm("movl %1, %0" : "=m" (*(volatile uint32_t *)va) : "a" (data)); break; case 2: - __asm __volatile("movw %1, %0" : "=m" (*(uint16_t *)va) + __asm("movw %1, %0" : "=m" (*(volatile uint16_t *)va) : "a" ((uint16_t)data)); break; case 1: - __asm __volatile("movb %1, %0" : "=m" (*(uint8_t *)va) + __asm("movb %1, %0" : "=m" (*(volatile uint8_t *)va) : "a" ((uint8_t)data)); break; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 20:50:35 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 5A0AC1CD; Fri, 30 Nov 2012 20:50:35 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7BE8FC15; Fri, 30 Nov 2012 20:50:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUKoZ19053579; Fri, 30 Nov 2012 20:50:35 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUKoZFT053578; Fri, 30 Nov 2012 20:50:35 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211302050.qAUKoZFT053578@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 30 Nov 2012 20:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243713 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 20:50:35 -0000 Author: sjg Date: Fri Nov 30 20:50:34 2012 New Revision: 243713 URL: http://svnweb.freebsd.org/changeset/base/243713 Log: The build-tools step during build32 also needs the -legacy magic. Approved by: marcel (mentor) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 30 20:15:01 2012 (r243712) +++ head/Makefile.inc1 Fri Nov 30 20:50:34 2012 (r243713) @@ -511,6 +511,8 @@ build32: .endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic cd ${.CURDIR}/${_dir}; \ + WORLDTMP=${WORLDTMP} \ + MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ -DEARLY_BUILD build-tools From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 20:52: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 ABB5D359; Fri, 30 Nov 2012 20:52:53 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF228FC0C; Fri, 30 Nov 2012 20:52:52 +0000 (UTC) Received: from server.rulingia.com (c220-239-239-142.belrs5.nsw.optusnet.com.au [220.239.239.142]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id qAUKqhJd070945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 1 Dec 2012 07:52:44 +1100 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id qAUKqbVM069282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Dec 2012 07:52:37 +1100 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id qAUKqaBF069280; Sat, 1 Dec 2012 07:52:36 +1100 (EST) (envelope-from peter) Date: Sat, 1 Dec 2012 07:52:35 +1100 From: Peter Jeremy To: "Matthew D. Fuller" Subject: Re: svn commit: r242102 - in head: contrib/bmake usr.bin/bmake Message-ID: <20121130205235.GA84363@server.rulingia.com> References: <201210252318.q9PNI6IQ069461@svn.freebsd.org> <20121114172823.GA20127@dragon.NUXI.org> <20121114184837.GA73505@kib.kiev.ua> <20121115151622.J1179@besplex.bde.org> <20121115084121.GI66994@over-yonder.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <20121115084121.GI66994@over-yonder.net> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 20:52:53 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [A bit delayed] On 2012-Nov-15 02:41:22 -0600, "Matthew D. Fuller" wrote: >On Thu, Nov 15, 2012 at 06:07:27PM +1100 I heard the voice of >Bruce Evans, and lo! it spake thus: >>=20 >> Maybe malloc() would be faster with MALLOC_PRODUCTION. I use >> /etc/malloc.conf -> aj locally. freefall doesn't have >> /etc/malloc.conf. MALLOC_OPTIONS no longer works, and MALLOC_CONF >> is too large for me to understand, so I don't know how to turn off >> non-production features dynamically. > >FWIW, I suspected MALLOC_PRODUCTION in some massive slowdowns I see >from time to time on my -CURRENT box. Most vividly around running >portupgrade-related bits (portupgrade, pkgdb, etc). I got annoyed by >it enough a few weeks ago to write up a quickie to bang malloc() >around and see what happened. Attached, just for grins. Not defining MALLOC_PRODUCTION causes quite significant startup costs for any process that uses malloc() at all. In this case, jemalloc verifies that memory obtained from the kernel is zero-filled, causing (thousands of unnecessary) page faults. For a short-running process that doesn't allocate all the space in the jemalloc arenas, this dominates the runtime - in the case of /bin/echo, I measured 87 page faults with MALLOC_PRODUCTION and 2133 without. --=20 Peter Jeremy --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC5HJMACgkQ/opHv/APuIeCqACgtQM6+UkZ7zbht12xgkTZoilv Mf0AoJ0aeI5dZENkCDFSkE2RX3PNZJ9D =nraQ -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:19:19 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 EC40EB72; Fri, 30 Nov 2012 22:19:18 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D14428FC08; Fri, 30 Nov 2012 22:19:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMJIbw065474; Fri, 30 Nov 2012 22:19:18 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMJIkI065470; Fri, 30 Nov 2012 22:19:18 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302219.qAUMJIkI065470@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 22:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243714 - in head/sys/dev: ixgbe netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:19:19 -0000 Author: jfv Date: Fri Nov 30 22:19:18 2012 New Revision: 243714 URL: http://svnweb.freebsd.org/changeset/base/243714 Log: First of a series of 11 patches leading to new ixgbe version 2.5.0 This removes the header split and supporting code from the driver. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 20:50:34 2012 (r243713) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:19:18 2012 (r243714) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.4.11"; +char ixgbe_driver_version[] = "2.5.0 - 1"; /********************************************************************* * PCI Device ID Table @@ -266,15 +266,6 @@ static int ixgbe_enable_msix = 1; TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); /* - * Header split: this causes the hardware to DMA - * the header into a separate mbuf from the payload, - * it can be a performance win in some workloads, but - * in others it actually hurts, its off by default. - */ -static int ixgbe_header_split = FALSE; -TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe_header_split); - -/* * Number of Queues, can be set to 0, * it then autoconfigures based on the * number of cpus with a max of 8. This @@ -1117,7 +1108,7 @@ ixgbe_init_locked(struct adapter *adapte /* ** Determine the correct mbuf pool - ** for doing jumbo/headersplit + ** for doing jumbo frames */ if (adapter->max_frame_size <= 2048) adapter->rx_mbuf_sz = MCLBYTES; @@ -3728,10 +3719,9 @@ static void ixgbe_refresh_mbufs(struct rx_ring *rxr, int limit) { struct adapter *adapter = rxr->adapter; - bus_dma_segment_t hseg[1]; - bus_dma_segment_t pseg[1]; + bus_dma_segment_t seg[1]; struct ixgbe_rx_buf *rxbuf; - struct mbuf *mh, *mp; + struct mbuf *mp; int i, j, nsegs, error; bool refreshed = FALSE; @@ -3742,43 +3732,13 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, while (j != limit) { rxbuf = &rxr->rx_buffers[i]; - if (rxr->hdr_split == FALSE) - goto no_split; - - if (rxbuf->m_head == NULL) { - mh = m_gethdr(M_DONTWAIT, MT_DATA); - if (mh == NULL) - goto update; - } else - mh = rxbuf->m_head; - - mh->m_pkthdr.len = mh->m_len = MHLEN; - mh->m_len = MHLEN; - mh->m_flags |= M_PKTHDR; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->htag, - rxbuf->hmap, mh, hseg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf("Refresh mbufs: hdr dmamap load" - " failure - %d\n", error); - m_free(mh); - rxbuf->m_head = NULL; - goto update; - } - rxbuf->m_head = mh; - bus_dmamap_sync(rxr->htag, rxbuf->hmap, - BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.hdr_addr = - htole64(hseg[0].ds_addr); - -no_split: - if (rxbuf->m_pack == NULL) { + if (rxbuf->buf == NULL) { mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (mp == NULL) goto update; } else - mp = rxbuf->m_pack; + mp = rxbuf->buf; mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; @@ -3787,22 +3747,22 @@ no_split: */ if ((rxbuf->flags & IXGBE_RX_COPY) == 0) { /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->ptag, - rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(rxr->tag, + rxbuf->map, mp, seg, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { printf("Refresh mbufs: payload dmamap load" " failure - %d\n", error); m_free(mp); - rxbuf->m_pack = NULL; + rxbuf->buf = NULL; goto update; } - rxbuf->m_pack = mp; - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + rxbuf->buf = mp; + bus_dmamap_sync(rxr->tag, rxbuf->map, BUS_DMASYNC_PREREAD); - rxbuf->paddr = rxr->rx_base[i].read.pkt_addr = - htole64(pseg[0].ds_addr); + rxbuf->addr = rxr->rx_base[i].read.pkt_addr = + htole64(seg[0].ds_addr); } else { - rxr->rx_base[i].read.pkt_addr = rxbuf->paddr; + rxr->rx_base[i].read.pkt_addr = rxbuf->addr; rxbuf->flags &= ~IXGBE_RX_COPY; } @@ -3850,45 +3810,23 @@ ixgbe_allocate_receive_buffers(struct rx BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MSIZE, /* maxsize */ - 1, /* nsegments */ - MSIZE, /* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &rxr->htag))) { - device_printf(dev, "Unable to create RX DMA tag\n"); - goto fail; - } - - if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, bounds */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ MJUM16BYTES, /* maxsize */ 1, /* nsegments */ MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ - &rxr->ptag))) { + &rxr->tag))) { device_printf(dev, "Unable to create RX DMA tag\n"); goto fail; } for (i = 0; i < adapter->num_rx_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->htag, - BUS_DMA_NOWAIT, &rxbuf->hmap); - if (error) { - device_printf(dev, "Unable to create RX head map\n"); - goto fail; - } - error = bus_dmamap_create(rxr->ptag, - BUS_DMA_NOWAIT, &rxbuf->pmap); + error = bus_dmamap_create(rxr->tag, + BUS_DMA_NOWAIT, &rxbuf->map); if (error) { - device_printf(dev, "Unable to create RX pkt map\n"); + device_printf(dev, "Unable to create RX dma map\n"); goto fail; } } @@ -3986,22 +3924,14 @@ ixgbe_free_receive_ring(struct rx_ring * adapter = rxr->adapter; for (i = 0; i < adapter->num_rx_desc; i++) { rxbuf = &rxr->rx_buffers[i]; - if (rxbuf->m_head != NULL) { - bus_dmamap_sync(rxr->htag, rxbuf->hmap, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->htag, rxbuf->hmap); - rxbuf->m_head->m_flags |= M_PKTHDR; - m_freem(rxbuf->m_head); - } - if (rxbuf->m_pack != NULL) { - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + if (rxbuf->buf != NULL) { + bus_dmamap_sync(rxr->tag, rxbuf->map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->ptag, rxbuf->pmap); - rxbuf->m_pack->m_flags |= M_PKTHDR; - m_freem(rxbuf->m_pack); + bus_dmamap_unload(rxr->tag, rxbuf->map); + rxbuf->buf->m_flags |= M_PKTHDR; + m_freem(rxbuf->buf); + rxbuf->buf = NULL; } - rxbuf->m_head = NULL; - rxbuf->m_pack = NULL; } } @@ -4018,7 +3948,7 @@ ixgbe_setup_receive_ring(struct rx_ring struct ifnet *ifp; device_t dev; struct ixgbe_rx_buf *rxbuf; - bus_dma_segment_t pseg[1], hseg[1]; + bus_dma_segment_t seg[1]; struct lro_ctrl *lro = &rxr->lro; int rsize, nsegs, error = 0; #ifdef DEV_NETMAP @@ -4043,13 +3973,9 @@ ixgbe_setup_receive_ring(struct rx_ring /* Free current RX buffer structs and their mbufs */ ixgbe_free_receive_ring(rxr); - /* Configure header split? */ - if (ixgbe_header_split) - rxr->hdr_split = TRUE; - /* Now replenish the mbufs */ for (int j = 0; j != adapter->num_rx_desc; ++j) { - struct mbuf *mh, *mp; + struct mbuf *mp; rxbuf = &rxr->rx_buffers[j]; #ifdef DEV_NETMAP @@ -4066,60 +3992,30 @@ ixgbe_setup_receive_ring(struct rx_ring void *addr; addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->ptag, rxbuf->pmap, addr); + netmap_load_map(rxr->tag, rxbuf->map, addr); /* Update descriptor */ rxr->rx_base[j].read.pkt_addr = htole64(paddr); continue; } #endif /* DEV_NETMAP */ - /* - ** Don't allocate mbufs if not - ** doing header split, its wasteful - */ - if (rxr->hdr_split == FALSE) - goto skip_head; - - /* First the header */ - rxbuf->m_head = m_gethdr(M_NOWAIT, MT_DATA); - if (rxbuf->m_head == NULL) { - error = ENOBUFS; - goto fail; - } - m_adj(rxbuf->m_head, ETHER_ALIGN); - mh = rxbuf->m_head; - mh->m_len = mh->m_pkthdr.len = MHLEN; - mh->m_flags |= M_PKTHDR; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->htag, - rxbuf->hmap, rxbuf->m_head, hseg, - &nsegs, BUS_DMA_NOWAIT); - if (error != 0) /* Nothing elegant to do here */ - goto fail; - bus_dmamap_sync(rxr->htag, - rxbuf->hmap, BUS_DMASYNC_PREREAD); - /* Update descriptor */ - rxr->rx_base[j].read.hdr_addr = htole64(hseg[0].ds_addr); - -skip_head: - /* Now the payload cluster */ - rxbuf->m_pack = m_getjcl(M_NOWAIT, MT_DATA, + rxbuf->buf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); - if (rxbuf->m_pack == NULL) { + if (rxbuf->buf == NULL) { error = ENOBUFS; goto fail; } - mp = rxbuf->m_pack; + mp = rxbuf->buf; mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->ptag, - rxbuf->pmap, mp, pseg, + error = bus_dmamap_load_mbuf_sg(rxr->tag, + rxbuf->map, mp, seg, &nsegs, BUS_DMA_NOWAIT); if (error != 0) goto fail; - bus_dmamap_sync(rxr->ptag, - rxbuf->pmap, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(rxr->tag, + rxbuf->map, BUS_DMASYNC_PREREAD); /* Update descriptor */ - rxr->rx_base[j].read.pkt_addr = htole64(pseg[0].ds_addr); + rxr->rx_base[j].read.pkt_addr = htole64(seg[0].ds_addr); } @@ -4127,7 +4023,6 @@ skip_head: rxr->next_to_check = 0; rxr->next_to_refresh = 0; rxr->lro_enabled = FALSE; - rxr->rx_split_packets = 0; rxr->rx_copies = 0; rxr->rx_bytes = 0; rxr->discard = FALSE; @@ -4258,14 +4153,7 @@ ixgbe_initialize_receive_units(struct ad srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; - if (rxr->hdr_split) { - /* Use a standard mbuf for the header */ - srrctl |= ((IXGBE_RX_HDR << - IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) - & IXGBE_SRRCTL_BSIZEHDR_MASK); - srrctl |= IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; - } else - srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; + srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ @@ -4371,29 +4259,17 @@ ixgbe_free_receive_buffers(struct rx_rin if (rxr->rx_buffers != NULL) { for (int i = 0; i < adapter->num_rx_desc; i++) { rxbuf = &rxr->rx_buffers[i]; - if (rxbuf->m_head != NULL) { - bus_dmamap_sync(rxr->htag, rxbuf->hmap, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->htag, rxbuf->hmap); - rxbuf->m_head->m_flags |= M_PKTHDR; - m_freem(rxbuf->m_head); - } - if (rxbuf->m_pack != NULL) { - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + if (rxbuf->buf != NULL) { + bus_dmamap_sync(rxr->tag, rxbuf->map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->ptag, rxbuf->pmap); - rxbuf->m_pack->m_flags |= M_PKTHDR; - m_freem(rxbuf->m_pack); - } - rxbuf->m_head = NULL; - rxbuf->m_pack = NULL; - if (rxbuf->hmap != NULL) { - bus_dmamap_destroy(rxr->htag, rxbuf->hmap); - rxbuf->hmap = NULL; + bus_dmamap_unload(rxr->tag, rxbuf->map); + rxbuf->buf->m_flags |= M_PKTHDR; + m_freem(rxbuf->buf); } - if (rxbuf->pmap != NULL) { - bus_dmamap_destroy(rxr->ptag, rxbuf->pmap); - rxbuf->pmap = NULL; + rxbuf->buf = NULL; + if (rxbuf->map != NULL) { + bus_dmamap_destroy(rxr->tag, rxbuf->map); + rxbuf->map = NULL; } } if (rxr->rx_buffers != NULL) { @@ -4402,13 +4278,9 @@ ixgbe_free_receive_buffers(struct rx_rin } } - if (rxr->htag != NULL) { - bus_dma_tag_destroy(rxr->htag); - rxr->htag = NULL; - } - if (rxr->ptag != NULL) { - bus_dma_tag_destroy(rxr->ptag); - rxr->ptag = NULL; + if (rxr->tag != NULL) { + bus_dma_tag_destroy(rxr->tag); + rxr->tag = NULL; } return; @@ -4467,16 +4339,11 @@ ixgbe_rx_discard(struct rx_ring *rxr, in ** the normal refresh path to get new buffers ** and mapping. */ - if (rbuf->m_head) { - m_free(rbuf->m_head); - rbuf->m_head = NULL; + if (rbuf->buf) { + m_free(rbuf->buf); + rbuf->buf = NULL; } - if (rbuf->m_pack) { - m_free(rbuf->m_pack); - rbuf->m_pack = NULL; - } - return; } @@ -4527,9 +4394,9 @@ ixgbe_rxeof(struct ix_queue *que, int co } #endif /* DEV_NETMAP */ for (i = rxr->next_to_check; count != 0;) { - struct mbuf *sendmp, *mh, *mp; + struct mbuf *sendmp, *mp; u32 rsc, ptype; - u16 hlen, plen, hdr; + u16 len; u16 vtag = 0; bool eop; @@ -4551,19 +4418,13 @@ ixgbe_rxeof(struct ix_queue *que, int co rsc = 0; cur->wb.upper.status_error = 0; rbuf = &rxr->rx_buffers[i]; - mh = rbuf->m_head; - mp = rbuf->m_pack; + mp = rbuf->buf; - plen = le16toh(cur->wb.upper.length); + len = le16toh(cur->wb.upper.length); ptype = le32toh(cur->wb.lower.lo_dword.data) & IXGBE_RXDADV_PKTTYPE_MASK; - hdr = le16toh(cur->wb.lower.lo_dword.hs_rss.hdr_info); eop = ((staterr & IXGBE_RXD_STAT_EOP) != 0); - /* Process vlan info */ - if ((rxr->vtag_strip) && (staterr & IXGBE_RXD_STAT_VP)) - vtag = le16toh(cur->wb.upper.vlan); - /* Make sure bad packets are discarded */ if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) || (rxr->discard)) { @@ -4611,130 +4472,71 @@ ixgbe_rxeof(struct ix_queue *que, int co prefetch(nbuf); } /* - ** The header mbuf is ONLY used when header - ** split is enabled, otherwise we get normal - ** behavior, ie, both header and payload - ** are DMA'd into the payload buffer. - ** ** Rather than using the fmp/lmp global pointers ** we now keep the head of a packet chain in the ** buffer struct and pass this along from one ** descriptor to the next, until we get EOP. */ - if (rxr->hdr_split && (rbuf->fmp == NULL)) { - /* This must be an initial descriptor */ - hlen = (hdr & IXGBE_RXDADV_HDRBUFLEN_MASK) >> - IXGBE_RXDADV_HDRBUFLEN_SHIFT; - if (hlen > IXGBE_RX_HDR) - hlen = IXGBE_RX_HDR; - mh->m_len = hlen; - mh->m_flags |= M_PKTHDR; - mh->m_next = NULL; - mh->m_pkthdr.len = mh->m_len; - /* Null buf pointer so it is refreshed */ - rbuf->m_head = NULL; - /* - ** Check the payload length, this - ** could be zero if its a small - ** packet. - */ - if (plen > 0) { - mp->m_len = plen; - mp->m_next = NULL; - mp->m_flags &= ~M_PKTHDR; - mh->m_next = mp; - mh->m_pkthdr.len += mp->m_len; - /* Null buf pointer so it is refreshed */ - rbuf->m_pack = NULL; - rxr->rx_split_packets++; - } - /* - ** Now create the forward - ** chain so when complete - ** we wont have to. - */ - if (eop == 0) { - /* stash the chain head */ - nbuf->fmp = mh; - /* Make forward chain */ - if (plen) - mp->m_next = nbuf->m_pack; - else - mh->m_next = nbuf->m_pack; - } else { - /* Singlet, prepare to send */ - sendmp = mh; - /* If hardware handled vtag */ - if (vtag) { - sendmp->m_pkthdr.ether_vtag = vtag; - sendmp->m_flags |= M_VLANTAG; - } - } + mp->m_len = len; + /* + ** See if there is a stored head + ** that determines what we are + */ + sendmp = rbuf->fmp; + if (sendmp != NULL) { /* secondary frag */ + rbuf->buf = rbuf->fmp = NULL; + mp->m_flags &= ~M_PKTHDR; + sendmp->m_pkthdr.len += mp->m_len; } else { /* - ** Either no header split, or a - ** secondary piece of a fragmented - ** split packet. - */ - mp->m_len = plen; - /* - ** See if there is a stored head - ** that determines what we are - */ - sendmp = rbuf->fmp; - - if (sendmp != NULL) { /* secondary frag */ - rbuf->m_pack = rbuf->fmp = NULL; - mp->m_flags &= ~M_PKTHDR; - sendmp->m_pkthdr.len += mp->m_len; - } else { - /* - * Optimize. This might be a small packet, - * maybe just a TCP ACK. Do a fast copy that - * is cache aligned into a new mbuf, and - * leave the old mbuf+cluster for re-use. - */ - if (eop && plen <= IXGBE_RX_COPY_LEN) { - sendmp = m_gethdr(M_DONTWAIT, MT_DATA); - if (sendmp != NULL) { - sendmp->m_data += - IXGBE_RX_COPY_ALIGN; - ixgbe_bcopy(mp->m_data, - sendmp->m_data, plen); - sendmp->m_len = plen; - rxr->rx_copies++; - rbuf->flags |= IXGBE_RX_COPY; - } - } - if (sendmp == NULL) { - rbuf->m_pack = rbuf->fmp = NULL; - sendmp = mp; - } - - /* first desc of a non-ps chain */ - sendmp->m_flags |= M_PKTHDR; - sendmp->m_pkthdr.len = mp->m_len; - if (vtag) { - sendmp->m_pkthdr.ether_vtag = vtag; - sendmp->m_flags |= M_VLANTAG; + * Optimize. This might be a small packet, + * maybe just a TCP ACK. Do a fast copy that + * is cache aligned into a new mbuf, and + * leave the old mbuf+cluster for re-use. + */ + if (eop && len <= IXGBE_RX_COPY_LEN) { + sendmp = m_gethdr(M_NOWAIT, MT_DATA); + if (sendmp != NULL) { + sendmp->m_data += + IXGBE_RX_COPY_ALIGN; + ixgbe_bcopy(mp->m_data, + sendmp->m_data, len); + sendmp->m_len = len; + rxr->rx_copies++; + rbuf->flags |= IXGBE_RX_COPY; } - } - /* Pass the head pointer on */ - if (eop == 0) { - nbuf->fmp = sendmp; - sendmp = NULL; - mp->m_next = nbuf->m_pack; } + if (sendmp == NULL) { + rbuf->buf = rbuf->fmp = NULL; + sendmp = mp; + } + + /* first desc of a non-ps chain */ + sendmp->m_flags |= M_PKTHDR; + sendmp->m_pkthdr.len = mp->m_len; } ++processed; - /* Sending this frame? */ - if (eop) { + + /* Pass the head pointer on */ + if (eop == 0) { + nbuf->fmp = sendmp; + sendmp = NULL; + mp->m_next = nbuf->buf; + } else { /* Sending this frame */ sendmp->m_pkthdr.rcvif = ifp; ifp->if_ipackets++; rxr->rx_packets++; /* capture data for AIM */ rxr->bytes += sendmp->m_pkthdr.len; rxr->rx_bytes += sendmp->m_pkthdr.len; + /* Process vlan info */ + if ((rxr->vtag_strip) && + (staterr & IXGBE_RXD_STAT_VP)) + vtag = le16toh(cur->wb.upper.vlan); + if (vtag) { + sendmp->m_pkthdr.ether_vtag = vtag; + sendmp->m_flags |= M_VLANTAG; + } if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) ixgbe_rx_checksum(staterr, sendmp, ptype); #if __FreeBSD_version >= 800000 Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 20:50:34 2012 (r243713) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:19:18 2012 (r243714) @@ -253,14 +253,12 @@ struct ixgbe_tx_buf { }; struct ixgbe_rx_buf { - struct mbuf *m_head; - struct mbuf *m_pack; + struct mbuf *buf; struct mbuf *fmp; - bus_dmamap_t hmap; - bus_dmamap_t pmap; + bus_dmamap_t map; u_int flags; #define IXGBE_RX_COPY 0x01 - uint64_t paddr; + uint64_t addr; }; /* @@ -339,7 +337,6 @@ struct rx_ring { struct ixgbe_dma_alloc rxdma; struct lro_ctrl lro; bool lro_enabled; - bool hdr_split; bool hw_rsc; bool discard; bool vtag_strip; @@ -347,15 +344,13 @@ struct rx_ring { u32 next_to_check; char mtx_name[16]; struct ixgbe_rx_buf *rx_buffers; - bus_dma_tag_t htag; - bus_dma_tag_t ptag; + bus_dma_tag_t tag; u32 bytes; /* Used for AIM calc */ u32 packets; /* Soft stats */ u64 rx_irq; - u64 rx_split_packets; u64 rx_copies; u64 rx_packets; u64 rx_bytes; Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Fri Nov 30 20:50:34 2012 (r243713) +++ head/sys/dev/netmap/ixgbe_netmap.h Fri Nov 30 22:19:18 2012 (r243714) @@ -503,8 +503,8 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; if (ix_write_len) D("rx[%d] len %d", j, ring->slot[j].len); - bus_dmamap_sync(rxr->ptag, - rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(rxr->tag, + rxr->rx_buffers[l].map, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } @@ -556,12 +556,12 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { - netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); + netmap_reload_map(rxr->tag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } curr->wb.upper.status_error = 0; curr->read.pkt_addr = htole64(paddr); - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + bus_dmamap_sync(rxr->tag, rxbuf->map, BUS_DMASYNC_PREREAD); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:23:24 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 735C4D61; Fri, 30 Nov 2012 22:23:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5960F8FC15; Fri, 30 Nov 2012 22:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMNOY8066010; Fri, 30 Nov 2012 22:23:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMNOxS066009; Fri, 30 Nov 2012 22:23:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302223.qAUMNOxS066009@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 22:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243715 - head/crypto/openssl/crypto/rand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:23:24 -0000 Author: pjd Date: Fri Nov 30 22:23:23 2012 New Revision: 243715 URL: http://svnweb.freebsd.org/changeset/base/243715 Log: Allow OpenSSL to use arc4random(3) on FreeBSD. arc4random(3) was modified some time ago to use sysctl instead of /dev/random to get random data, so is now much better choice, especially for sandboxed processes that have no direct access to /dev/random. Approved by: benl MFC after: 2 weeks Modified: head/crypto/openssl/crypto/rand/rand_unix.c Modified: head/crypto/openssl/crypto/rand/rand_unix.c ============================================================================== --- head/crypto/openssl/crypto/rand/rand_unix.c Fri Nov 30 22:19:18 2012 (r243714) +++ head/crypto/openssl/crypto/rand/rand_unix.c Fri Nov 30 22:23:23 2012 (r243715) @@ -216,7 +216,7 @@ int RAND_poll(void) } return 1; } -#elif defined __OpenBSD__ +#elif defined(__FreeBSD__) || defined(__OpenBSD__) int RAND_poll(void) { u_int32_t rnd = 0, i; @@ -233,7 +233,7 @@ int RAND_poll(void) return 1; } -#else /* !defined(__OpenBSD__) */ +#else /* !defined(__FreeBSD__) && !defined(__OpenBSD__) */ int RAND_poll(void) { unsigned long l; @@ -419,7 +419,7 @@ int RAND_poll(void) #endif } -#endif /* defined(__OpenBSD__) */ +#endif /* defined(__FreeBSD__) || defined(__OpenBSD__) */ #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:33: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 8A07116A; Fri, 30 Nov 2012 22:33:21 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0388FC08; Fri, 30 Nov 2012 22:33:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMXLi2067281; Fri, 30 Nov 2012 22:33:21 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMXLX2067279; Fri, 30 Nov 2012 22:33:21 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302233.qAUMXLX2067279@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 22:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243716 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:33:21 -0000 Author: jfv Date: Fri Nov 30 22:33:21 2012 New Revision: 243716 URL: http://svnweb.freebsd.org/changeset/base/243716 Log: Patch #2 - remove OACTIVE and DEPLETED notions from the multiqueue code, this functionality has proven to be more trouble than it was worth. Thanks to Gleb for a second critical look over my code and help in the patches! Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:23:23 2012 (r243715) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:33:21 2012 (r243716) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 1"; +char ixgbe_driver_version[] = "2.5.0 - 2"; /********************************************************************* * PCI Device ID Table @@ -736,17 +736,14 @@ ixgbe_start_locked(struct tx_ring *txr, IXGBE_TX_LOCK_ASSERT(txr); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; if (!adapter->link_active) return; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) { - txr->queue_status |= IXGBE_QUEUE_DEPLETED; + if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) break; - } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) @@ -755,8 +752,6 @@ ixgbe_start_locked(struct tx_ring *txr, if (ixgbe_xmit(txr, &m_head)) { if (m_head != NULL) IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) - txr->queue_status |= IXGBE_QUEUE_DEPLETED; break; } /* Send a copy of the frame to the BPF listener */ @@ -811,8 +806,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct txr = &adapter->tx_rings[i]; que = &adapter->queues[i]; - if (((txr->queue_status & IXGBE_QUEUE_DEPLETED) == 0) && - IXGBE_TX_TRYLOCK(txr)) { + if (IXGBE_TX_TRYLOCK(txr)) { err = ixgbe_mq_start_locked(ifp, txr, m); IXGBE_TX_UNLOCK(txr); } else { @@ -831,7 +825,6 @@ ixgbe_mq_start_locked(struct ifnet *ifp, int enqueued, err = 0; if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || - (txr->queue_status == IXGBE_QUEUE_DEPLETED) || adapter->link_active == 0) { if (m != NULL) err = drbr_enqueue(ifp, txr->br, m); @@ -862,16 +855,12 @@ ixgbe_mq_start_locked(struct ifnet *ifp, break; if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) ixgbe_txeof(txr); - if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) { - txr->queue_status |= IXGBE_QUEUE_DEPLETED; - break; - } next = drbr_dequeue(ifp, txr->br); } if (enqueued > 0) { /* Set watchdog on */ - txr->queue_status |= IXGBE_QUEUE_WORKING; + txr->queue_status = IXGBE_QUEUE_WORKING; txr->watchdog_time = ticks; } @@ -1316,7 +1305,6 @@ ixgbe_init_locked(struct adapter *adapte /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -2018,13 +2006,11 @@ ixgbe_local_timer(void *arg) { struct adapter *adapter = arg; device_t dev = adapter->dev; - struct ifnet *ifp = adapter->ifp; struct ix_queue *que = adapter->queues; struct tx_ring *txr = adapter->tx_rings; - int hung, busy, paused; + int hung = 0, paused = 0; mtx_assert(&adapter->core_mtx, MA_OWNED); - hung = busy = paused = 0; /* Check for pluggable optics */ if (adapter->sfp_probe) @@ -2046,23 +2032,15 @@ ixgbe_local_timer(void *arg) ** - watchdog only if all queues show hung */ for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { - if ((txr->queue_status & IXGBE_QUEUE_HUNG) && + if ((txr->queue_status == IXGBE_QUEUE_HUNG) && (paused == 0)) ++hung; - if (txr->queue_status & IXGBE_QUEUE_DEPLETED) - ++busy; - if ((txr->queue_status & IXGBE_QUEUE_IDLE) == 0) + else if (txr->queue_status == IXGBE_QUEUE_WORKING) taskqueue_enqueue(que->tq, &que->que_task); } /* Only truely watchdog if all queues show hung */ if (hung == adapter->num_queues) goto watchdog; - /* Only turn off the stack flow when ALL are depleted */ - if (busy == adapter->num_queues) - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - else if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) && - (busy < adapter->num_queues)) - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; out: ixgbe_rearm_queues(adapter, adapter->que_mask); @@ -2091,7 +2069,6 @@ static void ixgbe_update_link_status(struct adapter *adapter) { struct ifnet *ifp = adapter->ifp; - struct tx_ring *txr = adapter->tx_rings; device_t dev = adapter->dev; @@ -2112,9 +2089,6 @@ ixgbe_update_link_status(struct adapter device_printf(dev,"Link is Down\n"); if_link_state_change(ifp, LINK_STATE_DOWN); adapter->link_active = FALSE; - for (int i = 0; i < adapter->num_queues; - i++, txr++) - txr->queue_status = IXGBE_QUEUE_IDLE; } } @@ -2145,7 +2119,6 @@ ixgbe_stop(void *arg) /* Let the stack know...*/ ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; ixgbe_reset_hw(hw); hw->adapter_stopped = FALSE; @@ -3694,10 +3667,6 @@ ixgbe_txeof(struct tx_ring *txr) if ((!processed) && ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)) txr->queue_status = IXGBE_QUEUE_HUNG; - /* With a minimum free clear the depleted state bit. */ - if (txr->tx_avail > IXGBE_TX_CLEANUP_THRESHOLD) - txr->queue_status &= ~IXGBE_QUEUE_DEPLETED; - if (txr->tx_avail == adapter->num_tx_desc) { txr->queue_status = IXGBE_QUEUE_IDLE; return (FALSE); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:23:23 2012 (r243715) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:33:21 2012 (r243716) @@ -198,10 +198,6 @@ #define IXGBE_VFTA_SIZE 128 #define IXGBE_BR_SIZE 4096 #define IXGBE_QUEUE_MIN_FREE 32 -#define IXGBE_QUEUE_IDLE 1 -#define IXGBE_QUEUE_WORKING 2 -#define IXGBE_QUEUE_HUNG 4 -#define IXGBE_QUEUE_DEPLETED 8 /* Offload bits in mbuf flag */ #if __FreeBSD_version >= 800000 @@ -299,7 +295,11 @@ struct tx_ring { struct adapter *adapter; struct mtx tx_mtx; u32 me; - int queue_status; + enum { + IXGBE_QUEUE_IDLE, + IXGBE_QUEUE_WORKING, + IXGBE_QUEUE_HUNG, + } queue_status; int watchdog_time; union ixgbe_adv_tx_desc *tx_base; struct ixgbe_dma_alloc txdma; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:38:43 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 4E935302; Fri, 30 Nov 2012 22:38:43 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2BEC08FC14; Fri, 30 Nov 2012 22:38:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMcheK067920; Fri, 30 Nov 2012 22:38:43 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMcgrS067912; Fri, 30 Nov 2012 22:38:42 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211302238.qAUMcgrS067912@svn.freebsd.org> From: Martin Matuska Date: Fri, 30 Nov 2012 22:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243717 - in stable/8: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolar... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:38:43 -0000 Author: mm Date: Fri Nov 30 22:38:42 2012 New Revision: 243717 URL: http://svnweb.freebsd.org/changeset/base/243717 Log: Merge ZFS feature flags support and related bugfixes: 236884, 237001, 237119, 237458, 237972, 238113, 238391, 238422, 238926, 238950, 238951, 239389, 239394, 239620, 239774, 239953, 239958, 239967, 239968, 240063, 240133, 240153, 240303, 240345, 240415, 240955, 241655, 243014, 243505, 243506 MFC r236884: Introduce "feature flags" for ZFS pools (bump SPA version to 5000). Add first feature "com.delphix:async_destroy" (asynchronous destroy of ZFS datasets). Implement features support in ZFS boot code. Illumos revisions merged: 13700:2889e2596bd6 13701:1949b688d5fb 2619 asynchronous destruction of ZFS file systems 2747 SPA versioning with zfs feature flags References: https://www.illumos.org/issues/2619 https://www.illumos.org/issues/2747 MFC r237001: Fix ZFS boot with pre-features pools (version <= 28) broken in r236884 MFC r237119 [1]: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. MFC r237458: Import Illumos revision 13736:9f1d48e1681f 2901 ZFS receive fails for exabyte sparse files References: https://www.illumos.org/issues/2901 MFC r237972: Expose scrub and resilver tunables. This allows the user to tune the priority trade-off between scrub/resilver and other ZFS I/O. MFC r238113 (pjd): vdev_io_done stage is not used for ioctls. MFC r238391: Change behavior introduced in r237119 to vendor solution References: https://www.illumos.org/issues/2883 MFC r238422: Merge illumos commit 13749:df4cd82e2b60 1796 "ZFS HOLD" should not be used when doing "ZFS SEND" froma read-only pool 2871 support for __ZFS_POOL_RESTRICT used by ZFS test suite 2903 zfs destroy -d does not work 2957 zfs destroy -R/r sometimes fails when removing defer-destroyed snapshot References: https://www.illumos.org/issues/1796 https://www.illumos.org/issues/2871 https://www.illumos.org/issues/2903 https://www.illumos.org/issues/2957 MFC r238926: Partial MFV (illumos-gate 13753:2aba784c276b) 2762 zpool command should have better support for feature flags References: https://www.illumos.org/issues/2762 MFC r238950: Fix reporting of root pool upgrade notice. MFC r238951: Fix wrong indent according to style(9) MFC r239389: Backport fix for vendor issue #3085 3085 zfs diff panics, then panics in a loop on booting References: https://www.illumos.org/issues/3085 MFC r239394: Update zfs(8) manpage with illumos version of "zfs diff" Illumos issue: 2399 zfs manual page does not document use of "zfs diff" References: https://www.illumos.org/issues/2399 MFC r239620 [2]: Merge recent vendor changes: 3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets 3090 vdev_reopen() during reguid causes vdev to be treated as corrupt 3102 vdev_uberblock_load() and vdev_validate() may read the wrong label Referenes: https://www.illumos.org/issues/3086 https://www.illumos.org/issues/3090 https://www.illumos.org/issues/3102 MFC r239774: Merge recent vendor changes: 3100 zvol rename fails with EBUSY when dirty 3104 eliminate empty bpobjs 3120 zinject hangs in zfsdev_ioctl() due to uninitialized zc References: https://www.illumos.org/issues/3100 https://www.illumos.org/issues/3104 https://www.illumos.org/issues/3120 MFC r239953 (joel): Mdoc fixes. MFC r239958 (joel): Minor mdoc fixes. MFC r239967 (joel): Mdoc fixes. MFC r239968 (joel): Remove trailing whitespace. MFC r240063 (gjb): Add myself to copyright sections, per CDDL license. MFC r240133: Merge recent vendor changes and sync code: 1862 incremental zfs receive fails for sparse file > 8PB 3112 ztest does not honor ZFS_DEBUG 3122 zfs destroy filesystem should prefetch blocks 3129 'zpool reopen' restarts resilvers 3130 ztest failure: Assertion failed: 0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10) References: https://www.illumos.org/issues/1862 https://www.illumos.org/issues/3112 https://www.illumos.org/issues/3122 https://www.illumos.org/issues/3129 https://www.illumos.org/issues/3130 MFC r240153 (gjb) [3]: Typo fix and minor word swap. MFC r240303: Add assfail() and assfail3() to the opensolaris module. Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h. MFC r240345 (avg): zfs: fix sa_modify_attrs handling of variable-sized attributes - skip length_idx index for a replaced variable-sized attribute - skip length_idx index for a removed variable-sized attribute - also re-arranged code to make sure that length_idx is always incremented for variable-sized attributes - additionally add an assertion that the number of actually produced attributes is the same as the expected number of resulting attributes MFC r240415: Merge recent zfs vendor changes, sync code and adjust userland DEBUG. Illumos issued covered: 1884 Empty "used" field for zfs *space commands 3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero 3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID 3048 zfs {user,group}space [-s|-S] is broken 3049 zfs {user,group}space -t doesn't really filter the results 3060 zfs {user,group}space -H output isn't tab-delimited 3061 zfs {user,group}space -o doesn't use specified fields order 3064 usr/src/cmd/zpool/zpool_main.c misspells "successful" 3093 zfs {user,group}space's -i is noop 3098 zfs userspace/groupspace fail without saying why when run as non-root References: https://www.illumos.org/issues/ + [issue_id] MFC r240955 (partial): Merge recent vendor changes in ZFS. Illumos issued covered: 3139 zdb dies when it tries to determine path of unlinked file 3189 kernel panic in ZFS test suite during hotspare_onoffline_004_neg 3208 moving zpool cross-endian results in incorrect user/group accounting References: https://www.illumos.org/issues/ + [issue_id] MFC r241655: Add missing initialization for do_prefix. Corrects porting error in r238391 Vendor issue and changeset reference: 2883 changing "canmount" property to "on" should not always remount dataset https://www.illumos.org/issues/2883 Changeset 13743:95aba6e49b9f MFC r243014: Move zpool-features manual page from section 5 to section 7 and fix references Reported by: pluknet MFC r243505: Illumos 13886:e3261d03efbf 3349 zpool upgrade -V bumps the on disk version number, but leaves the in core version References: https://www.illumos.org/issues/3349 MFC r243506: zfs sha256 checksum is missing in zfs.8 manpage PR: kern/167905 [1], kern/170912 [2], kern/170914 [2], doc/171356 [3] Added: stable/8/cddl/contrib/opensolaris/cmd/zhack/ - copied from r236884, head/cddl/contrib/opensolaris/cmd/zhack/ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 - copied unchanged from r243014, head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/8/cddl/usr.sbin/zhack/ - copied from r236884, head/cddl/usr.sbin/zhack/ stable/8/sys/cddl/compat/opensolaris/sys/assfail.h - copied, changed from r240303, head/sys/cddl/compat/opensolaris/sys/assfail.h stable/8/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h - copied unchanged from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c - copied, changed from r236884, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Replaced: stable/8/sys/cddl/compat/opensolaris/sys/debug.h - copied unchanged from r240415, head/sys/cddl/compat/opensolaris/sys/debug.h Modified: stable/8/Makefile.inc1 (contents, props changed) stable/8/UPDATING stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c stable/8/cddl/contrib/opensolaris/lib/libuutil/common/uu_misc.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/8/cddl/lib/libnvpair/Makefile stable/8/cddl/lib/libzfs/Makefile stable/8/cddl/lib/libzpool/Makefile stable/8/cddl/sbin/zpool/Makefile stable/8/cddl/usr.bin/ztest/Makefile stable/8/cddl/usr.sbin/Makefile stable/8/cddl/usr.sbin/zdb/Makefile stable/8/cddl/usr.sbin/zhack/Makefile stable/8/rescue/rescue/Makefile stable/8/sys/boot/zfs/zfsimpl.c stable/8/sys/cddl/boot/zfs/zfsimpl.h stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/8/sys/modules/zfs/Makefile Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Fri Nov 30 22:33:21 2012 (r243716) +++ stable/8/Makefile.inc1 Fri Nov 30 22:38:42 2012 (r243717) @@ -1120,7 +1120,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ - ${_cddl_lib_libumem} \ + ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1135,6 +1135,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem +_cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib= cddl/lib .endif Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Fri Nov 30 22:33:21 2012 (r243716) +++ stable/8/UPDATING Fri Nov 30 22:38:42 2012 (r243717) @@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20121130: + A new version of ZFS (pool version 5000) has been merged to 8-STABLE. + Starting with this version the old system of ZFS pool versioning + is superseded by "feature flags". This concept enables forward + compatibility against certain future changes in functionality of ZFS + pools. The first two read-only compatible "feature flags" for ZFS + pools are "com.delphix:async_destroy" and "com.delphix:empty_bpobj". + For more information read the new zpool-features(7) manual page. + Please refer to the "ZFS notes" section of this file for information + on upgrading boot ZFS pools. + 20121018: WITH_CTF can now be specified in src.conf (not recommended, there are some problems with static executables), make.conf (would also Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Nov 30 22:33:21 2012 (r243716) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Nov 30 22:38:42 2012 (r243717) @@ -93,14 +93,14 @@ If specified multiple times, verify the .It Fl C Display information about the configuration. If specified with no other options, instead display information about the cache file -.Ns ( Pa /etc/zfs/zpool.cache Ns ). +.Po Pa /etc/zfs/zpool.cache Pc . To specify the cache file to display, see .Fl U .Pp If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with -.FL e +.Fl e also display the configuration that would be used were the pool to be imported. .It Fl d @@ -135,7 +135,7 @@ option is also specified, also display t .It Fl L Disable leak tracing and the loading of space maps. By default, -.Nm +.Nm verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. @@ -253,7 +253,7 @@ MOS Configuration: .Li # Ic zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects -... + ... .Ed .It Xo Sy Example 3 Display basic information about object 0 in .Sy 'rpool/export/home' @@ -272,7 +272,7 @@ Dataset rpool/export/home [ZPL], ID 137, .Li # Ic zdb -S rpool Simulated DDT histogram: -bucket allocated referenced +bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Nov 30 22:33:21 2012 (r243716) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Nov 30 22:38:42 2012 (r243717) @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -54,6 +56,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -63,7 +66,8 @@ #define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ zio_checksum_table[(idx)].ci_name : "UNKNOWN") #define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : "UNKNOWN") + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) #ifndef lint @@ -1088,7 +1092,7 @@ dump_dsl_dataset(objset_t *os, uint64_t ASSERT(size == sizeof (*ds)); crtime = ds->ds_creation_time; - zdb_nicenum(ds->ds_used_bytes, used); + zdb_nicenum(ds->ds_referenced_bytes, used); zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); @@ -1132,6 +1136,44 @@ dump_dsl_dataset(objset_t *os, uint64_t /* ARGSUSED */ static int +dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) +{ + char blkbuf[BP_SPRINTF_LEN]; + + if (bp->blk_birth != 0) { + sprintf_blkptr(blkbuf, bp); + (void) printf("\t%s\n", blkbuf); + } + return (0); +} + +static void +dump_bptree(objset_t *os, uint64_t obj, char *name) +{ + char bytes[32]; + bptree_phys_t *bt; + dmu_buf_t *db; + + if (dump_opt['d'] < 3) + return; + + VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db)); + bt = db->db_data; + zdb_nicenum(bt->bt_bytes, bytes); + (void) printf("\n %s: %llu datasets, %s\n", + name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes); + dmu_buf_rele(db, FTAG); + + if (dump_opt['d'] < 5) + return; + + (void) printf("\n"); + + (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL); +} + +/* ARGSUSED */ +static int dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { char blkbuf[BP_SPRINTF_LEN]; @@ -1883,11 +1925,13 @@ typedef struct zdb_blkstats { */ #define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0) #define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1) -#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3) static char *zdb_ot_extname[] = { "deferred free", "dedup ditto", + "other", "Total", }; @@ -1968,9 +2012,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog type = BP_GET_TYPE(bp); - zdb_count_block(zcb, zilog, bp, type); + zdb_count_block(zcb, zilog, bp, + (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type); - is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata); + is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { int ioerr; @@ -2197,6 +2242,12 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, + &zcb, NULL)); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; @@ -2373,7 +2424,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo } if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF || - BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata) + BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp))) return (0); ddt_key_fill(&zdde_search.zdde_key, bp); @@ -2478,7 +2529,14 @@ dump_zpool(spa_t *spa) dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool frees"); + "Pool snapshot frees"); + } + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + dump_bptree(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, + "Pool dataset frees"); } dump_dtl(spa->spa_root_vdev, 0); } Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 30 22:33:21 2012 (r243716) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 30 22:38:42 2012 (r243717) @@ -22,7 +22,7 @@ .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek -.\" Copyright (c) 2012, Bryan Drewery +.\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" @@ -57,8 +57,8 @@ .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Nm .Cm snapshot @@ -136,17 +136,21 @@ .Fl a | Ar filesystem .Nm .Cm userspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot .Nm .Cm groupspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -619,7 +623,7 @@ privilege with .Qq Nm Cm allow , can access everyone's usage. .Pp -The +The .Sy userused@ Ns ... properties are not displayed by .Qq Nm Cm get all . @@ -819,7 +823,7 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, @@ -1129,7 +1133,7 @@ will not use configured pool log devices will instead optimize synchronous operations for global pool throughput and efficient use of resources. .It Sy snapdir Ns = Ns Cm hidden | visible -Controls whether the +Controls whether the .Pa \&.zfs directory is hidden or visible in the root of the file system as discussed in the @@ -1196,7 +1200,7 @@ are not reflected in the reservation. The .Sy vscan property is currently not supported on -.Fx . +.Fx . .It Sy xattr Ns = Ns Cm off | on The .Sy xattr @@ -1283,7 +1287,7 @@ properties. The correlation between prop In addition, these options can be set on a per-mount basis using the .Fl o option, without affecting the property that is stored on disk. The values -specified on the command line override the values stored in the dataset. These +specified on the command line override the values stored in the dataset. These properties are reported as "temporary" by the .Qq Nm Cm get command. If the properties are changed while the dataset is mounted, the new @@ -1322,7 +1326,7 @@ domain name for the .Ar module component of property names to reduce the chance that two independently-developed packages use the same property name for different -purposes. Property names beginning with +purposes. Property names beginning with .Em com.sun are reserved for use by Sun Microsystems. .Pp @@ -1489,8 +1493,8 @@ behavior for mounted file systems in use .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Xc .Pp @@ -1978,9 +1982,11 @@ Upgrade the specified file system. .It Xo .Nm .Cm userspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -1998,9 +2004,9 @@ Print numeric ID instead of user/group n .It Fl H Do not print headers, use tab-delimited output. .It Fl p -Use exact (parseable) numeric output. +Use exact (parsable) numeric output. .It Fl o Ar field Ns Op , Ns Ar ... -Display only the specified fields from the following set, +Display only the specified fields from the following set: .Sy type,name,used,quota . The default is to display all fields. .It Fl s Ar field @@ -2015,7 +2021,7 @@ another. The default is Sort by this field in reverse order. See .Fl s . .It Fl t Ar type Ns Op , Ns Ar ... -Print only the specified types from the following set, +Print only the specified types from the following set: .Sy all,posixuser,smbuser,posixgroup,smbgroup . .Pp The default is @@ -2029,9 +2035,11 @@ Translate SID to POSIX ID. This flag cur .It Xo .Nm .Cm groupspace -.Op Fl niHp +.Op Fl Hinp .Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl sS Ar field +.Op Fl s Ar field +.Ar ... +.Op Fl S Ar field .Ar ... .Op Fl t Ar type Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar snapshot @@ -2209,7 +2217,7 @@ and it is assumed to be from the same fi .Ar snapshot . .Pp If the destination is a clone, the source may be the origin snapshot, which -must be fully specified (for example, +must be fully specified (for example, .Cm pool/fs@origin , not just .Cm @origin ) . @@ -2458,24 +2466,26 @@ subcommand or change a property. The following permissions are available: .Bl -column -offset 4n "secondarycache" "subcommand" .It NAME Ta TYPE Ta NOTES -.It Xo allow Ta subcommand Ta Must +.It allow Ta subcommand Ta Must Xo also have the permission that is being allowed .Xc -.It Xo clone Ta subcommand Ta Must +.It clone Ta subcommand Ta Must Xo also have the 'create' ability and 'mount' ability in the origin file system .Xc .It create Ta subcommand Ta Must also have the 'mount' ability .It destroy Ta subcommand Ta Must also have the 'mount' ability +.It diff Ta subcommand Ta Allows lookup of paths within a dataset given an +object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets -.It Xo promote Ta subcommand Ta Must +.It promote Ta subcommand Ta Must Xo also have the 'mount' and 'promote' ability in the origin file system .Xc .It receive Ta subcommand Ta Must also have the 'mount' and 'create' ability -.It Xo release Ta subcommand Ta Allows +.It release Ta subcommand Ta Allows Xo releasing a user hold which might destroy the snapshot .Xc -.It Xo rename Ta subcommand Ta Must +.It rename Ta subcommand Ta Must Xo also have the 'mount' and 'create' ability in the new parent .Xc .It rollback Ta subcommand Ta Must also have the 'mount' ability @@ -2491,7 +2501,6 @@ protocol .It userprop Ta other Ta Allows changing any user property .It userquota Ta other Ta Allows accessing any userquota@... property .It userused Ta other Ta Allows reading any userused@... property -.It Ta .It aclinherit Ta property .It aclmode Ta property .It atime Ta property @@ -2669,43 +2678,42 @@ descendent file systems. .Op Ar snapshot Ns | Ns Ar filesystem .Xc .Pp -Describes differences between a snapshot and a successor dataset. The -successor dataset can be a later snapshot or the current filesystem. -.Pp -The changed files are displayed including the change type. The change type -is displayed useing a single character. If a file or directory was renamed, -the old and the new names are displayed. -.Pp -The following change types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "CHANGE TYPE" -.It CHARACTER Ta CHANGE TYPE -.It \&+ Ta file was added -.It \&- Ta file was removed -.It \&M Ta file was modified -.It \&R Ta file was renamed +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname +.Pq in case of rename , +change in link count, and optionally file type and/or change time. +.Pp +The types of change are: +.Bl -column -offset 2n indent +.It \&- Ta path was removed +.It \&+ Ta path was added +.It \&M Ta path was modified +.It \&R Ta path was renamed .El .Bl -tag -width indent .It Fl F -Display a single letter for the file type in second to last column. -.Pp -The following file types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "FILE TYPE" -.It CHARACTER Ta FILE TYPE -.It \&F Ta file -.It \&/ Ta directory +Display an indication of the type of file, in a manner similar to the +.Fl F +option of +.Xr ls 1 . +.Bl -column -offset 2n indent .It \&B Ta block device +.It \&C Ta character device +.It \&F Ta regular file +.It \&/ Ta directory .It \&@ Ta symbolic link .It \&= Ta socket .It \&> Ta door (not supported on Fx ) -.It \&| Ta FIFO (not supported on Fx ) -.It \&P Ta event portal (not supported on Fx ) +.It \&| Ta named pipe (not supported on Fx ) +.It \&P Ta event port (not supported on Fx ) .El .It Fl H -Machine-parseable output, fields separated a tab character. +Give more parseable tab-separated output, without header lines and without +arrows. .It Fl t -Display a change timestamp in the first column. +Display the path's inode change time as the first column of output. .El .It Xo .Nm @@ -2742,6 +2750,16 @@ Detaches the specified from the jail identified by JID .Ar jailid . .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a Tn ZFS No File System Hierarchy @@ -2807,7 +2825,7 @@ Snapshots are displayed if the .Sy listsnaps property is .Cm on . -The default is +The default is .Cm off . See .Xr zpool 8 @@ -3158,16 +3176,21 @@ Local+Descendent permissions on (tank/us group staff @pset,create,mount ------------------------------------------------------------- .Ed -.El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. +.It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset +.Pp +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The +.Fl F +option is used to indicate type information for the files affected. +.Bd -literal -offset 2n +.Li # Ic zfs diff tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.Ed .El .Sh SEE ALSO .Xr chmod 2 , Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 30 22:33:21 2012 (r243716) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 30 22:38:42 2012 (r243717) @@ -304,13 +304,13 @@ get_usage(zfs_help_t idx) "\tunallow [-r] -s @setname [[,...]] " "\n")); case HELP_USERSPACE: - return (gettext("\tuserspace [-niHp] [-o field[,...]] " - "[-sS field] ... [-t type[,...]]\n" - "\t \n")); + return (gettext("\tuserspace [-Hinp] [-o field[,...]] " + "[-s field] ...\n\t[-S field] ... " + "[-t type[,...]] \n")); case HELP_GROUPSPACE: - return (gettext("\tgroupspace [-niHp] [-o field[,...]] " - "[-sS field] ... [-t type[,...]]\n" - "\t \n")); + return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " + "[-s field] ...\n\t[-S field] ... " + "[-t type[,...]] \n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: @@ -1081,7 +1081,7 @@ snapshot_to_nvl_cb(zfs_handle_t *zhp, vo int err = 0; /* Check for clones. */ - if (!cb->cb_doclones) { + if (!cb->cb_doclones && !cb->cb_defer_destroy) { cb->cb_target = zhp; cb->cb_first = B_TRUE; err = zfs_iter_dependents(zhp, B_TRUE, @@ -2057,30 +2057,52 @@ zfs_do_upgrade(int argc, char **argv) return (ret); } -#define USTYPE_USR_BIT (0) -#define USTYPE_GRP_BIT (1) -#define USTYPE_PSX_BIT (2) -#define USTYPE_SMB_BIT (3) - -#define USTYPE_USR (1 << USTYPE_USR_BIT) -#define USTYPE_GRP (1 << USTYPE_GRP_BIT) - -#define USTYPE_PSX (1 << USTYPE_PSX_BIT) -#define USTYPE_SMB (1 << USTYPE_SMB_BIT) - -#define USTYPE_PSX_USR (USTYPE_PSX | USTYPE_USR) -#define USTYPE_SMB_USR (USTYPE_SMB | USTYPE_USR) -#define USTYPE_PSX_GRP (USTYPE_PSX | USTYPE_GRP) -#define USTYPE_SMB_GRP (USTYPE_SMB | USTYPE_GRP) -#define USTYPE_ALL (USTYPE_PSX_USR | USTYPE_SMB_USR \ - | USTYPE_PSX_GRP | USTYPE_SMB_GRP) +/* + * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...] + * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...] + * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * + * -H Scripted mode; elide headers and separate columns by tabs. + * -i Translate SID to POSIX ID. + * -n Print numeric ID instead of user/group name. + * -o Control which fields to display. + * -p Use exact (parseable) numeric output. + * -s Specify sort columns, descending order. + * -S Specify sort columns, ascending order. + * -t Control which object types to display. + * + * Displays space consumed by, and quotas on, each user in the specified + * filesystem or snapshot. + */ +/* us_field_types, us_field_hdr and us_field_names should be kept in sync */ +enum us_field_types { + USFIELD_TYPE, + USFIELD_NAME, + USFIELD_USED, + USFIELD_QUOTA +}; +static char *us_field_hdr[] = { "TYPE", "NAME", "USED", "QUOTA" }; +static char *us_field_names[] = { "type", "name", "used", "quota" }; +#define USFIELD_LAST (sizeof (us_field_names) / sizeof (char *)) -#define USPROP_USED_BIT (0) -#define USPROP_QUOTA_BIT (1) +#define USTYPE_PSX_GRP (1 << 0) +#define USTYPE_PSX_USR (1 << 1) +#define USTYPE_SMB_GRP (1 << 2) +#define USTYPE_SMB_USR (1 << 3) +#define USTYPE_ALL \ + (USTYPE_PSX_GRP | USTYPE_PSX_USR | USTYPE_SMB_GRP | USTYPE_SMB_USR) -#define USPROP_USED (1 << USPROP_USED_BIT) -#define USPROP_QUOTA (1 << USPROP_QUOTA_BIT) +static int us_type_bits[] = { + USTYPE_PSX_GRP, + USTYPE_PSX_USR, + USTYPE_SMB_GRP, + USTYPE_SMB_USR, + USTYPE_ALL +}; +static char *us_type_names[] = { "posixgroup", "posxiuser", "smbgroup", + "smbuser", "all" }; typedef struct us_node { nvlist_t *usn_nvl; @@ -2089,37 +2111,49 @@ typedef struct us_node { } us_node_t; typedef struct us_cbdata { - nvlist_t **cb_nvlp; - uu_avl_pool_t *cb_avl_pool; - uu_avl_t *cb_avl; - boolean_t cb_numname; - boolean_t cb_nicenum; - boolean_t cb_sid2posix; - zfs_userquota_prop_t cb_prop; - zfs_sort_column_t *cb_sortcol; - size_t cb_max_typelen; - size_t cb_max_namelen; - size_t cb_max_usedlen; - size_t cb_max_quotalen; + nvlist_t **cb_nvlp; + uu_avl_pool_t *cb_avl_pool; + uu_avl_t *cb_avl; + boolean_t cb_numname; + boolean_t cb_nicenum; + boolean_t cb_sid2posix; + zfs_userquota_prop_t cb_prop; + zfs_sort_column_t *cb_sortcol; + size_t cb_width[USFIELD_LAST]; } us_cbdata_t; +static boolean_t us_populated = B_FALSE; + typedef struct { zfs_sort_column_t *si_sortcol; - boolean_t si_num_name; - boolean_t si_parsable; + boolean_t si_numname; } us_sort_info_t; static int +us_field_index(char *field) +{ + int i; + + for (i = 0; i < USFIELD_LAST; i++) { + if (strcmp(field, us_field_names[i]) == 0) + return (i); + } + + return (-1); +} + +static int us_compare(const void *larg, const void *rarg, void *unused) { const us_node_t *l = larg; const us_node_t *r = rarg; - int rc = 0; us_sort_info_t *si = (us_sort_info_t *)unused; zfs_sort_column_t *sortcol = si->si_sortcol; - boolean_t num_name = si->si_num_name; + boolean_t numname = si->si_numname; nvlist_t *lnvl = l->usn_nvl; nvlist_t *rnvl = r->usn_nvl; + int rc = 0; + boolean_t lvb, rvb; for (; sortcol != NULL; sortcol = sortcol->sc_next) { char *lvstr = ""; @@ -2138,17 +2172,17 @@ us_compare(const void *larg, const void (void) nvlist_lookup_uint32(lnvl, propname, &lv32); (void) nvlist_lookup_uint32(rnvl, propname, &rv32); if (rv32 != lv32) - rc = (rv32 > lv32) ? 1 : -1; + rc = (rv32 < lv32) ? 1 : -1; break; case ZFS_PROP_NAME: propname = "name"; - if (num_name) { - (void) nvlist_lookup_uint32(lnvl, propname, - &lv32); - (void) nvlist_lookup_uint32(rnvl, propname, - &rv32); - if (rv32 != lv32) - rc = (rv32 > lv32) ? 1 : -1; + if (numname) { + (void) nvlist_lookup_uint64(lnvl, propname, + &lv64); + (void) nvlist_lookup_uint64(rnvl, propname, + &rv64); + if (rv64 != lv64) + rc = (rv64 < lv64) ? 1 : -1; } else { (void) nvlist_lookup_string(lnvl, propname, &lvstr); @@ -2157,27 +2191,40 @@ us_compare(const void *larg, const void rc = strcmp(lvstr, rvstr); } break; - case ZFS_PROP_USED: case ZFS_PROP_QUOTA: - if (ZFS_PROP_USED == prop) + if (!us_populated) + break; + if (prop == ZFS_PROP_USED) propname = "used"; else propname = "quota"; (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, &rv64); if (rv64 != lv64) - rc = (rv64 > lv64) ? 1 : -1; + rc = (rv64 < lv64) ? 1 : -1; + break; } - if (rc) + if (rc != 0) { if (rc < 0) return (reverse ? 1 : -1); else return (reverse ? -1 : 1); + } } - return (rc); + /* + * If entries still seem to be the same, check if they are of the same + * type (smbentity is added only if we are doing SID to POSIX ID + * translation where we can have duplicate type/name combinations). + */ + if (nvlist_lookup_boolean_value(lnvl, "smbentity", &lvb) == 0 && + nvlist_lookup_boolean_value(rnvl, "smbentity", &rvb) == 0 && + lvb != rvb) + return (lvb < rvb ? -1 : 1); + + return (0); } static inline const char * @@ -2197,9 +2244,6 @@ us_type2str(unsigned field_type) } } -/* - * zfs userspace - */ static int userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space) { @@ -2207,7 +2251,6 @@ userspace_cb(void *arg, const char *doma zfs_userquota_prop_t prop = cb->cb_prop; char *name = NULL; char *propname; - char namebuf[32]; char sizebuf[32]; us_node_t *node; uu_avl_pool_t *avl_pool = cb->cb_avl_pool; @@ -2221,32 +2264,30 @@ userspace_cb(void *arg, const char *doma size_t namelen; size_t typelen; size_t sizelen; + int typeidx, nameidx, sizeidx; us_sort_info_t sortinfo = { sortcol, cb->cb_numname }; + boolean_t smbentity = B_FALSE; - if (domain == NULL || domain[0] == '\0') { - /* POSIX */ - if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { - type = USTYPE_PSX_GRP; - struct group *g = getgrgid(rid); - if (g) - name = g->gr_name; - } else { - type = USTYPE_PSX_USR; - struct passwd *p = getpwuid(rid); - if (p) - name = p->pw_name; - } - } else { - char sid[ZFS_MAXNAMELEN+32]; + if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) + nomem(); + node = safe_malloc(sizeof (us_node_t)); + uu_avl_node_init(node, &node->usn_avlnode, avl_pool); + node->usn_nvl = props; + + if (domain != NULL && domain[0] != '\0') { + /* SMB */ + char sid[ZFS_MAXNAMELEN + 32]; uid_t id; uint64_t classes; #ifdef sun - int err = 0; + int err; directory_error_t e; #endif + smbentity = B_TRUE; + (void) snprintf(sid, sizeof (sid), "%s-%u", domain, rid); - /* SMB */ + if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { type = USTYPE_SMB_GRP; #ifdef sun @@ -2262,217 +2303,139 @@ userspace_cb(void *arg, const char *doma #ifdef sun if (err == 0) { rid = id; - - e = directory_name_from_sid(NULL, sid, &name, &classes); - if (e != NULL) { - directory_error_free(e); - return (NULL); + if (!cb->cb_sid2posix) { + e = directory_name_from_sid(NULL, sid, &name, + &classes); + if (e != NULL) + directory_error_free(e); + if (name == NULL) + name = sid; } - - if (name == NULL) - name = sid; } #endif } -/* - * if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) - * ug = "group"; - * else - * ug = "user"; - */ - - if (prop == ZFS_PROP_USERUSED || prop == ZFS_PROP_GROUPUSED) - propname = "used"; - else - propname = "quota"; - - (void) snprintf(namebuf, sizeof (namebuf), "%u", rid); - if (name == NULL) - name = namebuf; - - if (cb->cb_nicenum) - zfs_nicenum(space, sizebuf, sizeof (sizebuf)); - else - (void) sprintf(sizebuf, "%llu", space); + if (cb->cb_sid2posix || domain == NULL || domain[0] == '\0') { + /* POSIX or -i */ + if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { + type = USTYPE_PSX_GRP; + if (!cb->cb_numname) { + struct group *g; - node = safe_malloc(sizeof (us_node_t)); - uu_avl_node_init(node, &node->usn_avlnode, avl_pool); + if ((g = getgrgid(rid)) != NULL) + name = g->gr_name; + } + } else { + type = USTYPE_PSX_USR; + if (!cb->cb_numname) { + struct passwd *p; - if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) { - free(node); - return (-1); + if ((p = getpwuid(rid)) != NULL) + name = p->pw_name; + } + } } + /* + * Make sure that the type/name combination is unique when doing + * SID to POSIX ID translation (hence changing the type from SMB to + * POSIX). + */ + if (cb->cb_sid2posix && + nvlist_add_boolean_value(props, "smbentity", smbentity) != 0) + nomem(); + + /* Calculate/update width of TYPE field */ + typestr = us_type2str(type); + typelen = strlen(gettext(typestr)); + typeidx = us_field_index("type"); + if (typelen > cb->cb_width[typeidx]) + cb->cb_width[typeidx] = typelen; if (nvlist_add_uint32(props, "type", type) != 0) nomem(); - if (cb->cb_numname) { - if (nvlist_add_uint32(props, "name", rid) != 0) + /* Calculate/update width of NAME field */ + if ((cb->cb_numname && cb->cb_sid2posix) || name == NULL) { + if (nvlist_add_uint64(props, "name", rid) != 0) nomem(); - namelen = strlen(namebuf); + namelen = snprintf(NULL, 0, "%u", rid); } else { if (nvlist_add_string(props, "name", name) != 0) nomem(); namelen = strlen(name); } + nameidx = us_field_index("name"); + if (namelen > cb->cb_width[nameidx]) + cb->cb_width[nameidx] = namelen; - typestr = us_type2str(type); - typelen = strlen(gettext(typestr)); - if (typelen > cb->cb_max_typelen) - cb->cb_max_typelen = typelen; - - if (namelen > cb->cb_max_namelen) - cb->cb_max_namelen = namelen; - - sizelen = strlen(sizebuf); - if (0 == strcmp(propname, "used")) { - if (sizelen > cb->cb_max_usedlen) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:40:52 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 4CCE348F; Fri, 30 Nov 2012 22:40:52 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [78.110.53.255]) by mx1.freebsd.org (Postfix) with ESMTP id 565C08FC12; Fri, 30 Nov 2012 22:40:51 +0000 (UTC) Received: from freebsd (unknown [72.5.114.2]) by mx0.deglitch.com (Postfix) with ESMTPA id 9C47B8FC2B; Sat, 1 Dec 2012 02:40:42 +0400 (MSK) Date: Fri, 30 Nov 2012 14:40:40 -0800 From: Stanislav Sedov To: Baptiste Daroussin Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version Message-Id: <20121130144040.99559ed924a48b909cbd3c4b@FreeBSD.org> In-Reply-To: <20121129073846.GG97474@ithaqua.etoilebsd.net> References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> <20121129073846.GG97474@ithaqua.etoilebsd.net> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:40:52 -0000 On Thu, 29 Nov 2012 08:38:47 +0100 Baptiste Daroussin mentioned: > > pkg is no more experimental at all, it is not perfect there are large rooms for > improvements, but it is perfectly ready to be used, if you have any concern > about some missing "feature" just report it; > > Concerning a landmine, when you have big flashy lights all over the place: > http://lists.freebsd.org/pipermail/freebsd-ports-announce/2012-October/000032.html > http://lists.freebsd.org/pipermail/freebsd-current/2012-October/037001.html > a fanfare playing in front of it saying beware landsmine: > http://svnweb.freebsd.org/ports?view=revision&revision=305637 > and maps available all over the places to explains where the mine are how to > workaround them, or be mine proof: > http://svnweb.freebsd.org/ports/head/CHANGES (entry 20121010) > http://svnweb.freebsd.org/ports/head/UPDATING (entry 20121010) > > I'd say in that case it is no more considered as a landmine but just a new safe > way. It is a new way forced on users. I didn't ask to use pkgng on my system, neither I got any warning when it silently stopped creating entries in /var/db/pkg. Do you expect all users to read UPDATING and/or svn commit logs each time they update? Switching to pkgng was not a community descision, it was a decision made by a small group of people (alledgedly, considering input from the community). Personally, I don't see why it should be that way, and why the default had to be forceably changed. It is an open question (at least for me) whether pkgng is any better than the old tools, and there is at least on drawback in using pkgng, namely sqlite database, which will make you lose all packages in the case of a small fs corruption. That problem was raised before numerous times starting when developing a new pkg tool was proposed. But it is a design decision, and I respect it. What I don't like is that the switch to the new pkg system lacks any legitemacy, as it was largely a portmgr descision. If instead you ran it alongside for some time and it ended up being used by majority of users compared to the legacy pkg, and then pulled the switch, then it'd a different story. The bottom line is that I ended up with a corrupted pkg database for no particular reason. And it didn't have to be that way. -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:41:33 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 7F2F1602; Fri, 30 Nov 2012 22:41:33 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACF48FC08; Fri, 30 Nov 2012 22:41:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMfXOt068316; Fri, 30 Nov 2012 22:41:33 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMfXfu068314; Fri, 30 Nov 2012 22:41:33 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302241.qAUMfXfu068314@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 22:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243718 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:41:33 -0000 Author: jfv Date: Fri Nov 30 22:41:32 2012 New Revision: 243718 URL: http://svnweb.freebsd.org/changeset/base/243718 Log: Patch #3 - Add a new ioctl to access SFP+ module diagnostic data via the I2C routines in shared code. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:38:42 2012 (r243717) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:41:32 2012 (r243718) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 2"; +char ixgbe_driver_version[] = "2.5.0 - 3"; /********************************************************************* * PCI Device ID Table @@ -919,6 +919,7 @@ static int ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { struct adapter *adapter = ifp->if_softc; + struct ixgbe_hw *hw = &adapter->hw; struct ifreq *ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; @@ -1024,7 +1025,22 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c VLAN_CAPABILITIES(ifp); break; } - + case SIOCGI2C: + { + struct ixgbe_i2c_req i2c; + IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)"); + error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + if (error) + break; + if ((i2c.dev_addr != 0xA0) || (i2c.dev_addr != 0xA2)){ + error = EINVAL; + break; + } + hw->phy.ops.read_i2c_byte(hw, i2c.offset, + i2c.dev_addr, i2c.data); + error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + break; + } default: IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); error = ether_ioctl(ifp, command, data); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:38:42 2012 (r243717) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:41:32 2012 (r243718) @@ -199,6 +199,9 @@ #define IXGBE_BR_SIZE 4096 #define IXGBE_QUEUE_MIN_FREE 32 +/* IOCTL define to gather SFP+ Diagnostic data */ +#define SIOCGI2C SIOCGIFGENERIC + /* Offload bits in mbuf flag */ #if __FreeBSD_version >= 800000 #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) @@ -241,6 +244,13 @@ typedef struct _ixgbe_vendor_info_t { unsigned int index; } ixgbe_vendor_info_t; +/* This is used to get SFP+ module data */ +struct ixgbe_i2c_req { + u8 dev_addr; + u8 offset; + u8 len; + u8 data[8]; +}; struct ixgbe_tx_buf { u32 eop_index; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:49: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 7A7EF87A; Fri, 30 Nov 2012 22:49:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF538FC0C; Fri, 30 Nov 2012 22:49:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMnTGJ069336; Fri, 30 Nov 2012 22:49:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMnTY8069335; Fri, 30 Nov 2012 22:49:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302249.qAUMnTY8069335@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 22:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243719 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:49:29 -0000 Author: pjd Date: Fri Nov 30 22:49:28 2012 New Revision: 243719 URL: http://svnweb.freebsd.org/changeset/base/243719 Log: IFp4 @208450: Remove redundant call to AUDIT_ARG_UPATH1(). Path will be remembered by the following NDINIT(AUDITVNODE1) call. Sponsored by: FreeBSD Foundation (auditdistd) MFC after: 2 weeks Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Nov 30 22:41:32 2012 (r243718) +++ head/sys/kern/vfs_mount.c Fri Nov 30 22:49:28 2012 (r243719) @@ -1170,7 +1170,6 @@ sys_unmount(td, uap) } mtx_unlock(&mountlist_mtx); } else { - AUDIT_ARG_UPATH1(td, pathbuf); /* * Try to find global path for path argument. */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:52:36 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 29F9BA33; Fri, 30 Nov 2012 22:52:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FD4B8FC19; Fri, 30 Nov 2012 22:52:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMqZSv069763; Fri, 30 Nov 2012 22:52:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMqZ2w069762; Fri, 30 Nov 2012 22:52:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302252.qAUMqZ2w069762@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 22:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243720 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:52:36 -0000 Author: pjd Date: Fri Nov 30 22:52:35 2012 New Revision: 243720 URL: http://svnweb.freebsd.org/changeset/base/243720 Log: IFp4 @208381: For VOP_GETATTR() we just need vnode to be shared-locked. Sponsored by: FreeBSD Foundation (auditdistd) MFC after: 2 weeks Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c ============================================================================== --- head/sys/security/audit/audit_worker.c Fri Nov 30 22:49:28 2012 (r243719) +++ head/sys/security/audit/audit_worker.c Fri Nov 30 22:52:35 2012 (r243720) @@ -133,7 +133,7 @@ audit_record_write(struct vnode *vp, str error = VFS_STATFS(vp->v_mount, mnt_stat); if (error) goto fail; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); if (error) From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:54:14 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 C7A31BC5; Fri, 30 Nov 2012 22:54:14 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF46D8FC12; Fri, 30 Nov 2012 22:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMsEP6070003; Fri, 30 Nov 2012 22:54:14 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMsE1v070002; Fri, 30 Nov 2012 22:54:14 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302254.qAUMsE1v070002@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 22:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243721 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:54:14 -0000 Author: jfv Date: Fri Nov 30 22:54:14 2012 New Revision: 243721 URL: http://svnweb.freebsd.org/changeset/base/243721 Log: Patch #4 - this does two things, it removes a number of statistics, these are FCOE stats (fiber channel over ethernet), something that FreeBSD does not yet have, they were mistaken for flow control by the implementor I believe. Secondly, the real flow control stats are oddly named with a 'link' tag on the front, it was requested by my validation engineer to make these stats have the same name as the igb driver for clarity and that seemed reasonable to me. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:52:35 2012 (r243720) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:54:14 2012 (r243721) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 3"; +char ixgbe_driver_version[] = "2.5.0 - 4"; /********************************************************************* * PCI Device ID Table @@ -5388,16 +5388,18 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rec_len_errs", CTLFLAG_RD, &stats->rlec, "Receive Length Errors"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "link_xon_txd", + + /* Flow Control stats */ + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xon_txd", CTLFLAG_RD, &stats->lxontxc, "Link XON Transmitted"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "link_xon_rcvd", + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xon_recvd", CTLFLAG_RD, &stats->lxonrxc, "Link XON Received"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "link_xoff_txd", + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &stats->lxofftxc, "Link XOFF Transmitted"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "link_xoff_rcvd", + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xoff_recvd", CTLFLAG_RD, &stats->lxoffrxc, "Link XOFF Received"); @@ -5497,29 +5499,6 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "tx_frames_1024_1522", CTLFLAG_RD, &stats->ptc1522, "1024-1522 byte frames transmitted"); - - /* FC Stats */ - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_crc", - CTLFLAG_RD, &stats->fccrc, - "FC CRC Errors"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_last", - CTLFLAG_RD, &stats->fclast, - "FC Last Error"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_drpd", - CTLFLAG_RD, &stats->fcoerpdc, - "FCoE Packets Dropped"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_pkts_rcvd", - CTLFLAG_RD, &stats->fcoeprc, - "FCoE Packets Received"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_pkts_txd", - CTLFLAG_RD, &stats->fcoeptc, - "FCoE Packets Transmitted"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_dword_rcvd", - CTLFLAG_RD, &stats->fcoedwrc, - "FCoE DWords Received"); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "fc_dword_txd", - CTLFLAG_RD, &stats->fcoedwtc, - "FCoE DWords Transmitted"); } /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 22:59:20 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 D8C89E44; Fri, 30 Nov 2012 22:59:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B12DD8FC12; Fri, 30 Nov 2012 22:59:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMxKuS070944; Fri, 30 Nov 2012 22:59:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMxKMt070943; Fri, 30 Nov 2012 22:59:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302259.qAUMxKMt070943@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 22:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243722 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:59:21 -0000 Author: pjd Date: Fri Nov 30 22:59:20 2012 New Revision: 243722 URL: http://svnweb.freebsd.org/changeset/base/243722 Log: IFp4 @208382: Currently on each record write we call VFS_STATFS() to get available space on the file system as well as VOP_GETATTR() to get trail file size. We can assume that trail file is only updated by the audit worker, so instead of asking for file size on every write, get file size on trail switch only (it should be zero, but it's not expensive) and use global variable audit_size protected by the audit worker lock to keep track of trail file's size. This eliminates VOP_GETATTR() call for every write. VFS_STATFS() is satisfied from in-memory data (mount->mnt_stat), so shouldn't be expensive. Sponsored by: FreeBSD Foundation (auditdistd) MFC after: 2 weeks Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c ============================================================================== --- head/sys/security/audit/audit_worker.c Fri Nov 30 22:54:14 2012 (r243721) +++ head/sys/security/audit/audit_worker.c Fri Nov 30 22:59:20 2012 (r243722) @@ -88,6 +88,7 @@ static struct proc *audit_thread; static int audit_file_rotate_wait; static struct ucred *audit_cred; static struct vnode *audit_vp; +static off_t audit_size; static struct sx audit_worker_lock; #define AUDIT_WORKER_LOCK_INIT() sx_init(&audit_worker_lock, \ @@ -115,7 +116,6 @@ audit_record_write(struct vnode *vp, str struct statfs *mnt_stat; int error; static int cur_fail; - struct vattr vattr; long temp; AUDIT_WORKER_LOCK_ASSERT(); @@ -133,12 +133,6 @@ audit_record_write(struct vnode *vp, str error = VFS_STATFS(vp->v_mount, mnt_stat); if (error) goto fail; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - goto fail; - audit_fstat.af_currsz = vattr.va_size; /* * We handle four different space-related limits: @@ -196,7 +190,7 @@ audit_record_write(struct vnode *vp, str * records may be generated before the daemon rotates the file. */ if ((audit_fstat.af_filesz != 0) && (audit_file_rotate_wait == 0) && - (vattr.va_size >= audit_fstat.af_filesz)) { + (audit_size >= audit_fstat.af_filesz)) { AUDIT_WORKER_LOCK_ASSERT(); audit_file_rotate_wait = 1; @@ -238,6 +232,8 @@ audit_record_write(struct vnode *vp, str goto fail_enospc; else if (error) goto fail; + AUDIT_WORKER_LOCK_ASSERT(); + audit_size += len; /* * Catch completion of a queue drain here; if we're draining and the @@ -448,10 +444,20 @@ audit_rotate_vnode(struct ucred *cred, s { struct ucred *old_audit_cred; struct vnode *old_audit_vp; + struct vattr vattr; KASSERT((cred != NULL && vp != NULL) || (cred == NULL && vp == NULL), ("audit_rotate_vnode: cred %p vp %p", cred, vp)); + if (vp != NULL) { + vn_lock(vp, LK_SHARED | LK_RETRY); + if (VOP_GETATTR(vp, &vattr, cred) != 0) + vattr.va_size = 0; + VOP_UNLOCK(vp, 0); + } else { + vattr.va_size = 0; + } + /* * Rotate the vnode/cred, and clear the rotate flag so that we will * send a rotate trigger if the new file fills. @@ -461,6 +467,7 @@ audit_rotate_vnode(struct ucred *cred, s old_audit_vp = audit_vp; audit_cred = cred; audit_vp = vp; + audit_size = vattr.va_size; audit_file_rotate_wait = 0; audit_enabled = (audit_vp != NULL); AUDIT_WORKER_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:03:52 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 BED46FEE; Fri, 30 Nov 2012 23:03:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2758FC15; Fri, 30 Nov 2012 23:03:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUN3p7X071839; Fri, 30 Nov 2012 23:03:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUN3peT071838; Fri, 30 Nov 2012 23:03:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302303.qAUN3peT071838@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 23:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243723 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:03:52 -0000 Author: pjd Date: Fri Nov 30 23:03:51 2012 New Revision: 243723 URL: http://svnweb.freebsd.org/changeset/base/243723 Log: IFp4 @208383: Currently when we discover that trail file is greater than configured limit we send AUDIT_TRIGGER_ROTATE_KERNEL trigger to the auditd daemon once. If for some reason auditd didn't rotate trail file it will never be rotated. Change it by sending the trigger when trail file size grows by the configured limit. For example if the limit is 1MB, we will send trigger on 1MB, 2MB, 3MB, etc. This is also needed for the auditd change that will be committed soon where auditd may ignore the trigger - it might be ignored if kernel requests the trail file to be rotated too quickly (often than once a second) which would result in overwriting previous trail file. Sponsored by: FreeBSD Foundation (auditdistd) MFC after: 2 weeks Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c ============================================================================== --- head/sys/security/audit/audit_worker.c Fri Nov 30 22:59:20 2012 (r243722) +++ head/sys/security/audit/audit_worker.c Fri Nov 30 23:03:51 2012 (r243723) @@ -189,11 +189,11 @@ audit_record_write(struct vnode *vp, str * to the daemon. This is only approximate, which is fine as more * records may be generated before the daemon rotates the file. */ - if ((audit_fstat.af_filesz != 0) && (audit_file_rotate_wait == 0) && - (audit_size >= audit_fstat.af_filesz)) { + if (audit_fstat.af_filesz != 0 && + audit_size >= audit_fstat.af_filesz * (audit_file_rotate_wait + 1)) { AUDIT_WORKER_LOCK_ASSERT(); - audit_file_rotate_wait = 1; + audit_file_rotate_wait++; (void)audit_send_trigger(AUDIT_TRIGGER_ROTATE_KERNEL); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:06: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 ED9602B9; Fri, 30 Nov 2012 23:06:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA1C68FC08; Fri, 30 Nov 2012 23:06:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUN6RSt072391; Fri, 30 Nov 2012 23:06:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUN6Ris072388; Fri, 30 Nov 2012 23:06:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302306.qAUN6Ris072388@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 23:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243724 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:06:28 -0000 Author: jfv Date: Fri Nov 30 23:06:27 2012 New Revision: 243724 URL: http://svnweb.freebsd.org/changeset/base/243724 Log: Patch #5 Cleanup unused IEEE1588 code fragments, the day may come when this feature gets implemented, but its not here yet and I see no reason to leave this laying around. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:03:51 2012 (r243723) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:06:27 2012 (r243724) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 4"; +char ixgbe_driver_version[] = "2.5.0 - 5"; /********************************************************************* * PCI Device ID Table @@ -1830,12 +1830,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m } else if (ixgbe_tx_ctx_setup(txr, m_head)) olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; -#ifdef IXGBE_IEEE1588 - /* This is changing soon to an mtag detection */ - if (we detect this mbuf has a TSTAMP mtag) - cmd_type_len |= IXGBE_ADVTXD_MAC_TSTAMP; -#endif - #ifdef IXGBE_FDIR /* Do the flow director magic */ if ((txr->atr_sample) && (!adapter->fdir_reinit)) { Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:03:51 2012 (r243723) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:06:27 2012 (r243724) @@ -89,10 +89,6 @@ #include #include -#ifdef IXGBE_IEEE1588 -#include -#endif - #include "ixgbe_api.h" /* Tunables */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:13:56 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 D871A5B9; Fri, 30 Nov 2012 23:13:56 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB3948FC08; Fri, 30 Nov 2012 23:13:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNDuUl073578; Fri, 30 Nov 2012 23:13:56 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNDuhN073576; Fri, 30 Nov 2012 23:13:56 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302313.qAUNDuhN073576@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 23:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243725 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:13:57 -0000 Author: jfv Date: Fri Nov 30 23:13:56 2012 New Revision: 243725 URL: http://svnweb.freebsd.org/changeset/base/243725 Log: Patch #6 Whitespace cleanup, and removal of some very old defines (at Gleb's request). Also, change the defines around the old transmit code to IXGBE_LEGACY_TX, I do this to make it possible to define this regardless of the OS level (it is not defined by default). There are also a couple changed comments for clarity. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:06:27 2012 (r243724) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:13:56 2012 (r243725) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 5"; +char ixgbe_driver_version[] = "2.5.0 - 6"; /********************************************************************* * PCI Device ID Table @@ -104,16 +104,16 @@ static int ixgbe_probe(device_t); static int ixgbe_attach(device_t); static int ixgbe_detach(device_t); static int ixgbe_shutdown(device_t); -#if __FreeBSD_version >= 800000 +#ifdef IXGBE_LEGACY_TX +static void ixgbe_start(struct ifnet *); +static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); +#else /* ! IXGBE_LEGACY_TX */ static int ixgbe_mq_start(struct ifnet *, struct mbuf *); static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static void ixgbe_qflush(struct ifnet *); static void ixgbe_deferred_mq_start(void *, int); -#else -static void ixgbe_start(struct ifnet *); -static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); -#endif +#endif /* IXGBE_LEGACY_TX */ static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); static void ixgbe_init(void *); static void ixgbe_init_locked(struct adapter *); @@ -541,7 +541,6 @@ ixgbe_attach(device_t dev) case IXGBE_ERR_SFP_NOT_SUPPORTED: device_printf(dev,"Unsupported SFP+ Module\n"); error = EIO; - device_printf(dev,"Hardware Initialization Failure\n"); goto err_late; case IXGBE_ERR_SFP_NOT_PRESENT: device_printf(dev,"No SFP+ Module found\n"); @@ -653,7 +652,7 @@ ixgbe_detach(device_t dev) for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { if (que->tq) { -#if __FreeBSD_version >= 800000 +#ifdef IXGBE_LEGACY_TX taskqueue_drain(que->tq, &txr->txq_task); #endif taskqueue_drain(que->tq, &que->que_task); @@ -717,7 +716,7 @@ ixgbe_shutdown(device_t dev) } -#if __FreeBSD_version < 800000 +#ifdef IXGBE_LEGACY_TX /********************************************************************* * Transmit entry point * @@ -784,7 +783,8 @@ ixgbe_start(struct ifnet *ifp) return; } -#else +#else /* ! IXGBE_LEGACY_TX */ + /* ** Multiqueue Transmit driver ** @@ -904,7 +904,7 @@ ixgbe_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* __FreeBSD_version >= 800000 */ +#endif /* IXGBE_LEGACY_TX */ /********************************************************************* * Ioctl entry point @@ -1413,7 +1413,7 @@ ixgbe_handle_que(void *context, int pend more = ixgbe_rxeof(que, adapter->rx_process_limit); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX if (!drbr_empty(ifp, txr->br)) ixgbe_mq_start_locked(ifp, txr, NULL); #else @@ -1513,7 +1513,7 @@ ixgbe_msix_que(void *arg) ** has anything queued the task gets ** scheduled to handle it. */ -#if __FreeBSD_version < 800000 +#ifdef IXGBE_LEGACY_TX if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd)) #else if (!drbr_empty(adapter->ifp, txr->br)) @@ -1809,15 +1809,14 @@ ixgbe_xmit(struct tx_ring *txr, struct m /* Make certain there are enough descriptors */ if (nsegs > txr->tx_avail - 2) { txr->no_desc_avail++; - error = ENOBUFS; - goto xmit_fail; + bus_dmamap_unload(txr->txtag, map); + return (ENOBUFS); } m_head = *m_headp; /* ** Set up the appropriate offload context - ** this becomes the first descriptor of - ** a packet. + ** this will consume the first descriptor */ if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { if (ixgbe_tso_setup(txr, m_head, &paylen, &olinfo_status)) { @@ -1874,7 +1873,12 @@ ixgbe_xmit(struct tx_ring *txr, struct m txr->next_avail_desc = i; txbuf->m_head = m_head; - /* Swap the dma map between the first and last descriptor */ + /* + ** Here we swap the map so the last descriptor, + ** which gets the completion interrupt has the + ** real map, and the first descriptor gets the + ** unused map from this descriptor. + */ txr->tx_buffers[first].map = txbuf->map; txbuf->map = map; bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE); @@ -1894,10 +1898,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m return (0); -xmit_fail: - bus_dmamap_unload(txr->txtag, txbuf->map); - return (error); - } static void @@ -2240,12 +2240,12 @@ ixgbe_setup_optics(struct adapter *adapt static int ixgbe_allocate_legacy(struct adapter *adapter) { - device_t dev = adapter->dev; + device_t dev = adapter->dev; struct ix_queue *que = adapter->queues; -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX struct tx_ring *txr = adapter->tx_rings; #endif - int error, rid = 0; + int error, rid = 0; /* MSI RID at 1 */ if (adapter->msix == 1) @@ -2264,7 +2264,7 @@ ixgbe_allocate_legacy(struct adapter *ad * Try allocating a fast interrupt and the associated deferred * processing contexts. */ -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); @@ -2346,7 +2346,7 @@ ixgbe_allocate_msix(struct adapter *adap if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, i); -#if __FreeBSD_version >= 800000 +#ifdef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); @@ -2592,7 +2592,7 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; #else @@ -2840,7 +2840,7 @@ ixgbe_allocate_queues(struct adapter *ad error = ENOMEM; goto err_tx_desc; } -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX /* Allocate a buf ring */ txr->br = buf_ring_alloc(IXGBE_BR_SIZE, M_DEVBUF, M_WAITOK, &txr->tx_mtx); @@ -3198,7 +3198,7 @@ ixgbe_free_transmit_buffers(struct tx_ri tx_buffer->map = NULL; } } -#if __FreeBSD_version >= 800000 +#ifdef IXGBE_LEGACY_TX if (txr->br != NULL) buf_ring_free(txr->br, M_DEVBUF); #endif @@ -3245,7 +3245,8 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, /* ** In advanced descriptors the vlan tag must - ** be placed into the descriptor itself. + ** be placed into the context descriptor. Hence + ** we need to make one even if not doing offloads. */ if (mp->m_flags & M_VLANTAG) { vtag = htole16(mp->m_pkthdr.ether_vtag); @@ -3576,7 +3577,8 @@ ixgbe_txeof(struct tx_ring *txr) */ if (!netmap_mitigate || (kring->nr_kflags < kring->nkr_num_slots && - tx_desc[kring->nr_kflags].upper.fields.status & IXGBE_TXD_STAT_DD)) { + tx_desc[kring->nr_kflags].upper.fields.status & + IXGBE_TXD_STAT_DD)) { kring->nr_kflags = kring->nkr_num_slots; selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); IXGBE_TX_UNLOCK(txr); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:06:27 2012 (r243724) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:13:56 2012 (r243725) @@ -39,7 +39,7 @@ #include #include -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX #include #endif #include @@ -205,16 +205,6 @@ #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP) #endif -/* For 6.X code compatibility */ -#if !defined(ETHER_BPF_MTAP) -#define ETHER_BPF_MTAP BPF_MTAP -#endif - -#if __FreeBSD_version < 700000 -#define CSUM_TSO 0 -#define IFCAP_TSO4 0 -#endif - /* * Interrupt Moderation parameters */ @@ -316,7 +306,7 @@ struct tx_ring { u32 txd_cmd; bus_dma_tag_t txtag; char mtx_name[16]; -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX struct buf_ring *br; struct task txq_task; #endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:18:50 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 035F6799; Fri, 30 Nov 2012 23:18:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D89148FC14; Fri, 30 Nov 2012 23:18:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNInFJ074244; Fri, 30 Nov 2012 23:18:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNInIh074238; Fri, 30 Nov 2012 23:18:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302318.qAUNInIh074238@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 23:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243726 - in head/sys: kern security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:18:50 -0000 Author: pjd Date: Fri Nov 30 23:18:49 2012 New Revision: 243726 URL: http://svnweb.freebsd.org/changeset/base/243726 Log: IFp4 @208451: Fix path handling for *at() syscalls. Before the change directory descriptor was totally ignored, so the relative path argument was appended to current working directory path and not to the path provided by descriptor, thus wrong paths were stored in audit logs. Now that we use directory descriptor in vfs_lookup, move AUDIT_ARG_UPATH1() and AUDIT_ARG_UPATH2() calls to the place where we hold file descriptors table lock, so we are sure paths will be resolved according to the same directory in audit record and in actual operation. Sponsored by: FreeBSD Foundation (auditdistd) Reviewed by: rwatson MFC after: 2 weeks Modified: head/sys/kern/vfs_lookup.c head/sys/security/audit/audit.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/kern/vfs_lookup.c Fri Nov 30 23:18:49 2012 (r243726) @@ -160,17 +160,6 @@ namei(struct nameidata *ndp) error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, (size_t *)&ndp->ni_pathlen); - if (error == 0) { - /* - * If we are auditing the kernel pathname, save the user - * pathname. - */ - if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_UPATH1(td, cnp->cn_pnbuf); - if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_UPATH2(td, cnp->cn_pnbuf); - } - /* * Don't allow empty pathnames. */ @@ -218,6 +207,14 @@ namei(struct nameidata *ndp) ndp->ni_rootdir = fdp->fd_rdir; ndp->ni_topdir = fdp->fd_jdir; + /* + * If we are auditing the kernel pathname, save the user pathname. + */ + if (cnp->cn_flags & AUDITVNODE1) + AUDIT_ARG_UPATH1(td, ndp->ni_dirfd, , cnp->cn_pnbuf); + if (cnp->cn_flags & AUDITVNODE2) + AUDIT_ARG_UPATH2(td, ndp->ni_dirfd, , cnp->cn_pnbuf); + dp = NULL; if (cnp->cn_pnbuf[0] != '/') { if (ndp->ni_startdir != NULL) { Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit.c Fri Nov 30 23:18:49 2012 (r243726) @@ -691,7 +691,7 @@ audit_proc_coredump(struct thread *td, c if (path != NULL) { pathp = &ar->k_ar.ar_arg_upath1; *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK); - audit_canon_path(td, path, *pathp); + audit_canon_path(td, AT_FDCWD, path, *pathp); ARG_SET_VALID(ar, ARG_UPATH1); } ar->k_ar.ar_arg_signum = td->td_proc->p_sig; Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit.h Fri Nov 30 23:18:49 2012 (r243726) @@ -99,8 +99,8 @@ void audit_arg_sockaddr(struct thread * void audit_arg_auid(uid_t auid); void audit_arg_auditinfo(struct auditinfo *au_info); void audit_arg_auditinfo_addr(struct auditinfo_addr *au_info); -void audit_arg_upath1(struct thread *td, char *upath); -void audit_arg_upath2(struct thread *td, char *upath); +void audit_arg_upath1(struct thread *td, int dirfd, char *upath); +void audit_arg_upath2(struct thread *td, int dirfd, char *upath); void audit_arg_vnode1(struct vnode *vp); void audit_arg_vnode2(struct vnode *vp); void audit_arg_text(char *text); @@ -276,14 +276,14 @@ void audit_thread_free(struct thread *t audit_arg_uid((uid)); \ } while (0) -#define AUDIT_ARG_UPATH1(td, upath) do { \ +#define AUDIT_ARG_UPATH1(td, dirfd, upath) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_upath1((td), (upath)); \ + audit_arg_upath1((td), (dirfd), (upath)); \ } while (0) -#define AUDIT_ARG_UPATH2(td, upath) do { \ +#define AUDIT_ARG_UPATH2(td, dirfd, upath) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_upath2((td), (upath)); \ + audit_arg_upath2((td), (dirfd), (upath)); \ } while (0) #define AUDIT_ARG_VALUE(value) do { \ @@ -356,8 +356,8 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_SUID(suid) #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) -#define AUDIT_ARG_UPATH1(td, upath) -#define AUDIT_ARG_UPATH2(td, upath) +#define AUDIT_ARG_UPATH1(td, dirfd, upath) +#define AUDIT_ARG_UPATH2(td, dirfd, upath) #define AUDIT_ARG_VALUE(value) #define AUDIT_ARG_VNODE1(vp) #define AUDIT_ARG_VNODE2(vp) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit_arg.c Fri Nov 30 23:18:49 2012 (r243726) @@ -463,7 +463,8 @@ audit_arg_sockaddr(struct thread *td, st break; case AF_UNIX: - audit_arg_upath1(td, ((struct sockaddr_un *)sa)->sun_path); + audit_arg_upath1(td, AT_FDCWD, + ((struct sockaddr_un *)sa)->sun_path); ARG_SET_VALID(ar, ARG_SADDRUNIX); break; /* XXXAUDIT: default:? */ @@ -707,16 +708,16 @@ audit_arg_file(struct proc *p, struct fi * freed when the audit record is freed. */ static void -audit_arg_upath(struct thread *td, char *upath, char **pathp) +audit_arg_upath(struct thread *td, int dirfd, char *upath, char **pathp) { if (*pathp == NULL) *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK); - audit_canon_path(td, upath, *pathp); + audit_canon_path(td, dirfd, upath, *pathp); } void -audit_arg_upath1(struct thread *td, char *upath) +audit_arg_upath1(struct thread *td, int dirfd, char *upath) { struct kaudit_record *ar; @@ -724,12 +725,12 @@ audit_arg_upath1(struct thread *td, char if (ar == NULL) return; - audit_arg_upath(td, upath, &ar->k_ar.ar_arg_upath1); + audit_arg_upath(td, dirfd, upath, &ar->k_ar.ar_arg_upath1); ARG_SET_VALID(ar, ARG_UPATH1); } void -audit_arg_upath2(struct thread *td, char *upath) +audit_arg_upath2(struct thread *td, int dirfd, char *upath) { struct kaudit_record *ar; @@ -737,7 +738,7 @@ audit_arg_upath2(struct thread *td, char if (ar == NULL) return; - audit_arg_upath(td, upath, &ar->k_ar.ar_arg_upath2); + audit_arg_upath(td, dirfd, upath, &ar->k_ar.ar_arg_upath2); ARG_SET_VALID(ar, ARG_UPATH2); } Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:18:49 2012 (r243726) @@ -462,13 +462,13 @@ auditon_command_event(int cmd) * leave the filename starting with '/' in the audit log in this case. */ void -audit_canon_path(struct thread *td, char *path, char *cpath) +audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath) { struct vnode *cvnp, *rvnp; char *rbuf, *fbuf, *copy; struct filedesc *fdp; struct sbuf sbf; - int error, cwir; + int error, needslash, vfslocked; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d", __func__, __FILE__, __LINE__); @@ -491,10 +491,27 @@ audit_canon_path(struct thread *td, char * path. */ if (*path != '/') { - cvnp = fdp->fd_cdir; - vhold(cvnp); + if (dirfd == AT_FDCWD) { + cvnp = fdp->fd_cdir; + vhold(cvnp); + } else { + /* XXX: fgetvp() that vhold()s vnode instead of vref()ing it would be better */ + error = fgetvp(td, dirfd, 0, &cvnp); + if (error) { + cpath[0] = '\0'; + if (rvnp != NULL) + vdrop(rvnp); + return; + } + vhold(cvnp); + vfslocked = VFS_LOCK_GIANT(cvnp->v_mount); + vrele(cvnp); + VFS_UNLOCK_GIANT(vfslocked); + } + needslash = (fdp->fd_rdir != cvnp); + } else { + needslash = 1; } - cwir = (fdp->fd_rdir == fdp->fd_cdir); FILEDESC_SUNLOCK(fdp); /* * NB: We require that the supplied array be at least MAXPATHLEN bytes @@ -536,7 +553,7 @@ audit_canon_path(struct thread *td, char (void) sbuf_cat(&sbf, rbuf); free(fbuf, M_TEMP); } - if (cwir == 0 || (cwir != 0 && cvnp == NULL)) + if (needslash) (void) sbuf_putc(&sbf, '/'); /* * Now that we have processed any alternate root and relative path Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit_private.h Fri Nov 30 23:18:49 2012 (r243726) @@ -388,7 +388,8 @@ au_event_t audit_flags_and_error_to_ope au_event_t audit_flags_and_error_to_openatevent(int oflags, int error); au_event_t audit_msgctl_to_event(int cmd); au_event_t audit_semctl_to_event(int cmr); -void audit_canon_path(struct thread *td, char *path, char *cpath); +void audit_canon_path(struct thread *td, int dirfd, char *path, + char *cpath); au_event_t auditon_command_event(int cmd); /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:21:56 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 75643915; Fri, 30 Nov 2012 23:21:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4196A8FC13; Fri, 30 Nov 2012 23:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNLuuH074663; Fri, 30 Nov 2012 23:21:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNLuer074662; Fri, 30 Nov 2012 23:21:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302321.qAUNLuer074662@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 23:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243727 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:21:56 -0000 Author: pjd Date: Fri Nov 30 23:21:55 2012 New Revision: 243727 URL: http://svnweb.freebsd.org/changeset/base/243727 Log: IFp4 @208452: Audit handling for missing events: - AUE_READLINKAT - AUE_FACCESSAT - AUE_MKDIRAT - AUE_MKFIFOAT - AUE_MKNODAT - AUE_SYMLINKAT Sponsored by: FreeBSD Foundation (auditdistd) MFC after: 2 weeks Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Fri Nov 30 23:18:49 2012 (r243726) +++ head/sys/security/audit/audit_bsm.c Fri Nov 30 23:21:55 2012 (r243727) @@ -724,13 +724,6 @@ kaudit_to_bsm(struct kaudit_record *kar, */ break; - case AUE_MKFIFO: - if (ARG_IS_VALID(kar, ARG_MODE)) { - tok = au_to_arg32(2, "mode", ar->ar_arg_mode); - kau_write(rec, tok); - } - /* FALLTHROUGH */ - case AUE_CHDIR: case AUE_CHROOT: case AUE_FSTATAT: @@ -743,6 +736,7 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_LPATHCONF: case AUE_PATHCONF: case AUE_READLINK: + case AUE_READLINKAT: case AUE_REVOKE: case AUE_RMDIR: case AUE_SEARCHFS: @@ -762,6 +756,8 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_ACCESS: case AUE_EACCESS: + case AUE_FACCESSAT: + ATFD1_TOKENS(1); UPATH1_VNODE1_TOKENS; if (ARG_IS_VALID(kar, ARG_VALUE)) { tok = au_to_arg32(2, "mode", ar->ar_arg_value); @@ -1059,6 +1055,10 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_MKDIR: + case AUE_MKDIRAT: + case AUE_MKFIFO: + case AUE_MKFIFOAT: + ATFD1_TOKENS(1); if (ARG_IS_VALID(kar, ARG_MODE)) { tok = au_to_arg32(2, "mode", ar->ar_arg_mode); kau_write(rec, tok); @@ -1067,6 +1067,8 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_MKNOD: + case AUE_MKNODAT: + ATFD1_TOKENS(1); if (ARG_IS_VALID(kar, ARG_MODE)) { tok = au_to_arg32(2, "mode", ar->ar_arg_mode); kau_write(rec, tok); @@ -1546,10 +1548,12 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_SYMLINK: + case AUE_SYMLINKAT: if (ARG_IS_VALID(kar, ARG_TEXT)) { tok = au_to_text(ar->ar_arg_text); kau_write(rec, tok); } + ATFD1_TOKENS(1); UPATH1_VNODE1_TOKENS; break; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:28:01 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 C71A5B30; Fri, 30 Nov 2012 23:28:01 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2AA8FC13; Fri, 30 Nov 2012 23:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNS1Kv075448; Fri, 30 Nov 2012 23:28:01 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNS1Un075446; Fri, 30 Nov 2012 23:28:01 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302328.qAUNS1Un075446@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 23:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243728 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:28:02 -0000 Author: jfv Date: Fri Nov 30 23:28:01 2012 New Revision: 243728 URL: http://svnweb.freebsd.org/changeset/base/243728 Log: Patch #7 This is primarily about processing limit control. - add a limit for both RX and TX, change the default to 256 - change the sysctl usage to be common, and now to be called during init for each ring. - the TX limit is not yet used, but the changes in the last patch in this series uses the value. - the motivation behind these changes is to improve data locality in the final code. - rxeof interface changes since it now gets limit from the ring struct Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:21:55 2012 (r243727) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:28:01 2012 (r243728) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 6"; +char ixgbe_driver_version[] = "2.5.0 - 7"; /********************************************************************* * PCI Device ID Table @@ -150,7 +150,7 @@ static void ixgbe_enable_intr(struct static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); static bool ixgbe_txeof(struct tx_ring *); -static bool ixgbe_rxeof(struct ix_queue *, int); +static bool ixgbe_rxeof(struct ix_queue *); static void ixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); @@ -163,7 +163,7 @@ static int ixgbe_set_thermal_test(SYSCTL static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); -static void ixgbe_add_rx_process_limit(struct adapter *, const char *, +static void ixgbe_add_process_limit(struct adapter *, const char *, const char *, int *, int); static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); @@ -246,9 +246,13 @@ static int ixgbe_max_interrupt_rate = (4 TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); /* How many packets rxeof tries to clean at a time */ -static int ixgbe_rx_process_limit = 128; +static int ixgbe_rx_process_limit = 256; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); +/* How many packets txeof tries to clean at a time */ +static int ixgbe_tx_process_limit = 256; +TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); + /* ** Smart speed setting, default to on ** this only works as a compile option @@ -563,11 +567,6 @@ ixgbe_attach(device_t dev) if (ixgbe_setup_interface(dev, adapter) != 0) goto err_late; - /* Sysctl for limiting the amount of work done in the taskqueue */ - ixgbe_add_rx_process_limit(adapter, "rx_processing_limit", - "max number of rx packets to process", &adapter->rx_process_limit, - ixgbe_rx_process_limit); - /* Initialize statistics */ ixgbe_update_stats_counters(adapter); @@ -1410,7 +1409,7 @@ ixgbe_handle_que(void *context, int pend bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que, adapter->rx_process_limit); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX @@ -1458,7 +1457,7 @@ ixgbe_legacy_irq(void *arg) return; } - more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); + more_rx = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); do { @@ -1504,7 +1503,7 @@ ixgbe_msix_que(void *arg) ixgbe_disable_queue(adapter, que->msix); ++que->irqs; - more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); + more_rx = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); more_tx = ixgbe_txeof(txr); @@ -3083,6 +3082,11 @@ ixgbe_initialize_transmit_units(struct a u64 tdba = txr->txdma.dma_paddr; u32 txctrl; + /* Sysctl for limiting work done in tx clean */ + ixgbe_add_process_limit(adapter, "tx_processing_limit", + "max number of packets to process", &txr->process_limit, + ixgbe_tx_process_limit); + IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba & 0x00000000ffffffffULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); @@ -4122,6 +4126,11 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; + /* Sysctl for limiting work done in rx clean */ + ixgbe_add_process_limit(adapter, "rx_processing_limit", + "max number of packets to process", &rxr->process_limit, + ixgbe_rx_process_limit); + /* Setup the Base and Length of the Rx Descriptor Ring */ IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), (rdba & 0x00000000ffffffffULL)); @@ -4341,7 +4350,7 @@ ixgbe_rx_discard(struct rx_ring *rxr, in * Return TRUE for more work, FALSE for all clean. *********************************************************************/ static bool -ixgbe_rxeof(struct ix_queue *que, int count) +ixgbe_rxeof(struct ix_queue *que) { struct adapter *adapter = que->adapter; struct rx_ring *rxr = que->rxr; @@ -4350,6 +4359,7 @@ ixgbe_rxeof(struct ix_queue *que, int co struct lro_entry *queued; int i, nextp, processed = 0; u32 staterr = 0; + u32 count = rxr->process_limit; union ixgbe_adv_rx_desc *cur; struct ixgbe_rx_buf *rbuf, *nbuf; @@ -5541,13 +5551,13 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) } static void -ixgbe_add_rx_process_limit(struct adapter *adapter, const char *name, +ixgbe_add_process_limit(struct adapter *adapter, const char *name, const char *description, int *limit, int value) { *limit = value; - SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), + SYSCTL_ADD_UINT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLTYPE_UINT|CTLFLAG_RW, limit, value, description); } /* Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:21:55 2012 (r243727) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:28:01 2012 (r243728) @@ -296,6 +296,7 @@ struct tx_ring { IXGBE_QUEUE_WORKING, IXGBE_QUEUE_HUNG, } queue_status; + u32 process_limit; int watchdog_time; union ixgbe_adv_tx_desc *tx_base; struct ixgbe_dma_alloc txdma; @@ -338,6 +339,7 @@ struct rx_ring { bool vtag_strip; u32 next_to_refresh; u32 next_to_check; + u32 process_limit; char mtx_name[16]; struct ixgbe_rx_buf *rx_buffers; bus_dma_tag_t tag; @@ -444,7 +446,6 @@ struct adapter { struct rx_ring *rx_rings; int num_rx_desc; u64 que_mask; - u32 rx_process_limit; /* Multicast array memory */ u8 *mta; From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:45:56 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 4BB7CD41; Fri, 30 Nov 2012 23:45:56 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32B738FC13; Fri, 30 Nov 2012 23:45:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNjuuP077697; Fri, 30 Nov 2012 23:45:56 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNjubV077695; Fri, 30 Nov 2012 23:45:56 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302345.qAUNjubV077695@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 23:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243729 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:45:56 -0000 Author: jfv Date: Fri Nov 30 23:45:55 2012 New Revision: 243729 URL: http://svnweb.freebsd.org/changeset/base/243729 Log: Patch #8 Performance changes - this one improves locality, moving some counters and data to the ring struct from the adapter struct, also compressing some data in the move. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:28:01 2012 (r243728) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:45:55 2012 (r243729) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 7"; +char ixgbe_driver_version[] = "2.5.0 - 8"; /********************************************************************* * PCI Device ID Table @@ -164,7 +164,7 @@ static int ixgbe_dma_malloc(struct adapt struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); static void ixgbe_add_process_limit(struct adapter *, const char *, - const char *, int *, int); + const char *, u16 *, u16); static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); @@ -1787,19 +1787,19 @@ ixgbe_xmit(struct tx_ring *txr, struct m *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); if (error == ENOMEM) { - adapter->no_tx_dma_setup++; + txr->no_tx_dma_setup++; return (error); } else if (error != 0) { - adapter->no_tx_dma_setup++; + txr->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } } else if (error == ENOMEM) { - adapter->no_tx_dma_setup++; + txr->no_tx_dma_setup++; return (error); } else if (error != 0) { - adapter->no_tx_dma_setup++; + txr->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); @@ -1822,7 +1822,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; - ++adapter->tso_tx; + ++txr->tso_tx; } else return (ENXIO); } else if (ixgbe_tx_ctx_setup(txr, m_head)) @@ -1859,7 +1859,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m txd->read.olinfo_status = htole32(olinfo_status); last = i; /* descriptor that will get completion IRQ */ - if (++i == adapter->num_tx_desc) + if (++i == txr->num_desc) i = 0; txbuf->m_head = NULL; @@ -2816,6 +2816,7 @@ ixgbe_allocate_queues(struct adapter *ad txr = &adapter->tx_rings[i]; txr->adapter = adapter; txr->me = i; + txr->num_desc = adapter->num_tx_desc; /* Initialize the TX side lock */ snprintf(txr->mtx_name, sizeof(txr->mtx_name), "%s:tx(%d)", @@ -2862,6 +2863,7 @@ ixgbe_allocate_queues(struct adapter *ad /* Set up some basics */ rxr->adapter = adapter; rxr->me = i; + rxr->num_desc = adapter->num_rx_desc; /* Initialize the RX side lock */ snprintf(rxr->mtx_name, sizeof(rxr->mtx_name), "%s:rx(%d)", @@ -3007,7 +3009,7 @@ ixgbe_setup_transmit_ring(struct tx_ring /* Free any existing tx buffers. */ txbuf = txr->tx_buffers; - for (i = 0; i < adapter->num_tx_desc; i++, txbuf++) { + for (i = 0; i < txr->num_desc; i++, txbuf++) { if (txbuf->m_head != NULL) { bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_POSTWRITE); @@ -3226,7 +3228,6 @@ ixgbe_free_transmit_buffers(struct tx_ri static bool ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp) { - struct adapter *adapter = txr->adapter; struct ixgbe_adv_tx_context_desc *TXD; struct ixgbe_tx_buf *tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; @@ -3329,7 +3330,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, tx_buffer->eop_index = -1; /* We've consumed the first desc, adjust counters */ - if (++ctxd == adapter->num_tx_desc) + if (++ctxd == txr->num_desc) ctxd = 0; txr->next_avail_desc = ctxd; --txr->tx_avail; @@ -3347,7 +3348,6 @@ static bool ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen, u32 *olinfo_status) { - struct adapter *adapter = txr->adapter; struct ixgbe_adv_tx_context_desc *TXD; struct ixgbe_tx_buf *tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; @@ -3450,7 +3450,7 @@ ixgbe_tso_setup(struct tx_ring *txr, str tx_buffer->m_head = NULL; tx_buffer->eop_index = -1; - if (++ctxd == adapter->num_tx_desc) + if (++ctxd == txr->num_desc) ctxd = 0; txr->tx_avail--; @@ -3595,7 +3595,7 @@ ixgbe_txeof(struct tx_ring *txr) } #endif /* DEV_NETMAP */ - if (txr->tx_avail == adapter->num_tx_desc) { + if (txr->tx_avail == txr->num_desc) { txr->queue_status = IXGBE_QUEUE_IDLE; return FALSE; } @@ -3683,7 +3683,7 @@ ixgbe_txeof(struct tx_ring *txr) if ((!processed) && ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)) txr->queue_status = IXGBE_QUEUE_HUNG; - if (txr->tx_avail == adapter->num_tx_desc) { + if (txr->tx_avail == txr->num_desc) { txr->queue_status = IXGBE_QUEUE_IDLE; return (FALSE); } @@ -3712,20 +3712,20 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, i = j = rxr->next_to_refresh; /* Control the loop with one beyond */ - if (++j == adapter->num_rx_desc) + if (++j == rxr->num_desc) j = 0; while (j != limit) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->buf == NULL) { mp = m_getjcl(M_DONTWAIT, MT_DATA, - M_PKTHDR, adapter->rx_mbuf_sz); + M_PKTHDR, rxr->mbuf_sz); if (mp == NULL) goto update; } else mp = rxbuf->buf; - mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; + mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; /* If we're dealing with an mbuf that was copied rather * than replaced, there's no need to go through busdma. @@ -3755,7 +3755,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, /* Next is precalculated */ i = j; rxr->next_to_refresh = i; - if (++j == adapter->num_rx_desc) + if (++j == rxr->num_desc) j = 0; } update: @@ -3781,7 +3781,7 @@ ixgbe_allocate_receive_buffers(struct rx struct ixgbe_rx_buf *rxbuf; int i, bsize, error; - bsize = sizeof(struct ixgbe_rx_buf) * adapter->num_rx_desc; + bsize = sizeof(struct ixgbe_rx_buf) * rxr->num_desc; if (!(rxr->rx_buffers = (struct ixgbe_rx_buf *) malloc(bsize, M_DEVBUF, M_NOWAIT | M_ZERO))) { @@ -3806,7 +3806,7 @@ ixgbe_allocate_receive_buffers(struct rx goto fail; } - for (i = 0; i < adapter->num_rx_desc; i++, rxbuf++) { + for (i = 0; i < rxr->num_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; error = bus_dmamap_create(rxr->tag, BUS_DMA_NOWAIT, &rxbuf->map); @@ -3875,11 +3875,11 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) ** Limit the total number of descriptors that ** can be combined, so it does not exceed 64K */ - if (adapter->rx_mbuf_sz == MCLBYTES) + if (rxr->mbuf_sz == MCLBYTES) rscctrl |= IXGBE_RSCCTL_MAXDESC_16; - else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) + else if (rxr->mbuf_sz == MJUMPAGESIZE) rscctrl |= IXGBE_RSCCTL_MAXDESC_8; - else if (adapter->rx_mbuf_sz == MJUM9BYTES) + else if (rxr->mbuf_sz == MJUM9BYTES) rscctrl |= IXGBE_RSCCTL_MAXDESC_4; else /* Using 16K cluster */ rscctrl |= IXGBE_RSCCTL_MAXDESC_1; @@ -3902,12 +3902,10 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) static void ixgbe_free_receive_ring(struct rx_ring *rxr) { - struct adapter *adapter; struct ixgbe_rx_buf *rxbuf; int i; - adapter = rxr->adapter; - for (i = 0; i < adapter->num_rx_desc; i++) { + for (i = 0; i < rxr->num_desc; i++) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->buf != NULL) { bus_dmamap_sync(rxr->tag, rxbuf->map, @@ -3954,12 +3952,14 @@ ixgbe_setup_receive_ring(struct rx_ring rsize = roundup2(adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc), DBA_ALIGN); bzero((void *)rxr->rx_base, rsize); + /* Cache the size */ + rxr->mbuf_sz = adapter->rx_mbuf_sz; /* Free current RX buffer structs and their mbufs */ ixgbe_free_receive_ring(rxr); /* Now replenish the mbufs */ - for (int j = 0; j != adapter->num_rx_desc; ++j) { + for (int j = 0; j != rxr->num_desc; ++j) { struct mbuf *mp; rxbuf = &rxr->rx_buffers[j]; @@ -3990,7 +3990,7 @@ ixgbe_setup_receive_ring(struct rx_ring goto fail; } mp = rxbuf->buf; - mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; + mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; /* Get the memory mapping */ error = bus_dmamap_load_mbuf_sg(rxr->tag, rxbuf->map, mp, seg, @@ -4359,7 +4359,7 @@ ixgbe_rxeof(struct ix_queue *que) struct lro_entry *queued; int i, nextp, processed = 0; u32 staterr = 0; - u32 count = rxr->process_limit; + u16 count = rxr->process_limit; union ixgbe_adv_rx_desc *cur; struct ixgbe_rx_buf *rbuf, *nbuf; @@ -4540,7 +4540,7 @@ next_desc: BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Advance our pointers to the next descriptor. */ - if (++i == adapter->num_rx_desc) + if (++i == rxr->num_desc) i = 0; /* Now send to the stack or do LRO */ @@ -5286,15 +5286,9 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &adapter->mbuf_defrag_failed, "m_defrag() failed"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_dma_setup", - CTLFLAG_RD, &adapter->no_tx_dma_setup, - "Driver tx dma failure in xmit"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_events", CTLFLAG_RD, &adapter->watchdog_events, "Watchdog timeouts"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tso_tx", - CTLFLAG_RD, &adapter->tso_tx, - "TSO"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", CTLFLAG_RD, &adapter->link_irq, "Link MSIX IRQ Handled"); @@ -5321,6 +5315,12 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); + SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tso_tx", + CTLFLAG_RD, &txr->tso_tx, + "TSO"); + SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "no_tx_dma_setup", + CTLFLAG_RD, &txr->no_tx_dma_setup, + "Driver tx dma failure in xmit"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", CTLFLAG_RD, &txr->no_desc_avail, "Queue No Descriptor Available"); @@ -5552,7 +5552,7 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) static void ixgbe_add_process_limit(struct adapter *adapter, const char *name, - const char *description, int *limit, int value) + const char *description, u16 *limit, u16 value) { *limit = value; SYSCTL_ADD_UINT(device_get_sysctl_ctx(adapter->dev), Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:28:01 2012 (r243728) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:45:55 2012 (r243729) @@ -291,19 +291,20 @@ struct tx_ring { struct adapter *adapter; struct mtx tx_mtx; u32 me; + int watchdog_time; + union ixgbe_adv_tx_desc *tx_base; + struct ixgbe_tx_buf *tx_buffers; + struct ixgbe_dma_alloc txdma; + volatile u16 tx_avail; + u16 next_avail_desc; + u16 next_to_clean; + u16 process_limit; + u16 num_desc; enum { IXGBE_QUEUE_IDLE, IXGBE_QUEUE_WORKING, IXGBE_QUEUE_HUNG, } queue_status; - u32 process_limit; - int watchdog_time; - union ixgbe_adv_tx_desc *tx_base; - struct ixgbe_dma_alloc txdma; - u32 next_avail_desc; - u32 next_to_clean; - struct ixgbe_tx_buf *tx_buffers; - volatile u16 tx_avail; u32 txd_cmd; bus_dma_tag_t txtag; char mtx_name[16]; @@ -318,6 +319,9 @@ struct tx_ring { u32 bytes; /* used for AIM */ u32 packets; /* Soft Stats */ + unsigned long tso_tx; + unsigned long no_tx_map_avail; + unsigned long no_tx_dma_setup; u64 no_desc_avail; u64 total_packets; }; @@ -337,9 +341,11 @@ struct rx_ring { bool hw_rsc; bool discard; bool vtag_strip; - u32 next_to_refresh; - u32 next_to_check; - u32 process_limit; + u16 next_to_refresh; + u16 next_to_check; + u16 num_desc; + u16 mbuf_sz; + u16 process_limit; char mtx_name[16]; struct ixgbe_rx_buf *rx_buffers; bus_dma_tag_t tag; @@ -437,15 +443,15 @@ struct adapter { * Allocated at run time, an array of rings. */ struct tx_ring *tx_rings; - int num_tx_desc; + u32 num_tx_desc; /* * Receive rings: * Allocated at run time, an array of rings. */ struct rx_ring *rx_rings; - int num_rx_desc; u64 que_mask; + u32 num_rx_desc; /* Multicast array memory */ u8 *mta; @@ -455,10 +461,7 @@ struct adapter { unsigned long mbuf_defrag_failed; unsigned long mbuf_header_failed; unsigned long mbuf_packet_failed; - unsigned long no_tx_map_avail; - unsigned long no_tx_dma_setup; unsigned long watchdog_events; - unsigned long tso_tx; unsigned long link_irq; struct ixgbe_hw_stats stats; @@ -522,12 +525,10 @@ drbr_needs_enqueue(struct ifnet *ifp, st static inline u16 ixgbe_rx_unrefreshed(struct rx_ring *rxr) { - struct adapter *adapter = rxr->adapter; - if (rxr->next_to_check > rxr->next_to_refresh) return (rxr->next_to_check - rxr->next_to_refresh - 1); else - return ((adapter->num_rx_desc + rxr->next_to_check) - + return ((rxr->num_desc + rxr->next_to_check) - rxr->next_to_refresh - 1); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:50:08 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 21D45EC3; Fri, 30 Nov 2012 23:50:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 030868FC19; Fri, 30 Nov 2012 23:50:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNo7UE078370; Fri, 30 Nov 2012 23:50:07 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNo7l5078359; Fri, 30 Nov 2012 23:50:07 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201211302350.qAUNo7l5078359@svn.freebsd.org> From: Robert Watson Date: Fri, 30 Nov 2012 23:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243730 - in vendor/openbsm/dist: . bin bin/audit bin/auditd bin/auditdistd bin/auditfilterd bin/auditreduce bin/praudit bsm compat config etc libauditd libbsm m4 man modules modules/au... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:50:08 -0000 Author: rwatson Date: Fri Nov 30 23:50:07 2012 New Revision: 243730 URL: http://svnweb.freebsd.org/changeset/base/243730 Log: Import OpenBSM 1.2-alpha2: OpenBSM 1.2 alpha 2 - auditdistd, a distributed audit trail management daemon, has now been merged. This allows trail files to be securely and reliably synced from audited hosts to an audit server, and employs TLS encryption. Where available, it uses Capsicum to sandbox the service. This work was contributed by Pawel Jakub Dawidek under sponsorship from the FreeBSD Foundation. OpenBSM 1.2 alpha 1 - Add Capsicum-related error numbers for FreeBSD: ENOTCAPABLE, ECAPMODE. - Add Capsicum, process descriptor audit events for FreeBSD. - Allow 0% minspace. - Fixes from the clang static analyser. - Fix expiration of trail files when the host parameter is used. - Various typo fixes. - Support for Solaris privilege and privilege set tokens. - Documentation for getachost(), improvements for getacfilesz(). - Fix a directory descriptor leak that happened when audit trail partitions filled. - Support for more Linux distributions with a partial contemporary endian.h. - Improved escaping of XML-encapsulated BSM. - A variety of minor documentation, style, and functional. Obtained from: TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Added: vendor/openbsm/dist/bin/auditdistd/ vendor/openbsm/dist/bin/auditdistd/Makefile.am (contents, props changed) vendor/openbsm/dist/bin/auditdistd/Makefile.in (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.8 (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/faccessat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/fstatat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/openat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/parse.y vendor/openbsm/dist/bin/auditdistd/pjdlog.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/pjdlog.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_common.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_impl.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_socketpair.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_tcp.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_tls.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_uds.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/receiver.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/renameat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sandbox.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sandbox.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sender.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/strndup.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/subr.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/subr.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/synch.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/token.l vendor/openbsm/dist/bin/auditdistd/trail.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/trail.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/unlinkat.h (contents, props changed) vendor/openbsm/dist/compat/closefrom.h (contents, props changed) vendor/openbsm/dist/compat/compat.h (contents, props changed) vendor/openbsm/dist/compat/endian_enc.h (contents, props changed) vendor/openbsm/dist/compat/flopen.h (contents, props changed) vendor/openbsm/dist/compat/pidfile.h (contents, props changed) vendor/openbsm/dist/compat/vis.h (contents, props changed) vendor/openbsm/dist/config/ylwrap vendor/openbsm/dist/m4/ vendor/openbsm/dist/m4/libtool.m4 vendor/openbsm/dist/m4/ltoptions.m4 vendor/openbsm/dist/m4/ltsugar.m4 vendor/openbsm/dist/m4/ltversion.m4 vendor/openbsm/dist/m4/lt~obsolete.m4 Modified: vendor/openbsm/dist/CREDITS vendor/openbsm/dist/INSTALL vendor/openbsm/dist/LICENSE vendor/openbsm/dist/Makefile.am vendor/openbsm/dist/Makefile.in vendor/openbsm/dist/NEWS vendor/openbsm/dist/README vendor/openbsm/dist/TODO vendor/openbsm/dist/VERSION vendor/openbsm/dist/aclocal.m4 vendor/openbsm/dist/autogen.sh vendor/openbsm/dist/bin/Makefile.am vendor/openbsm/dist/bin/Makefile.in vendor/openbsm/dist/bin/audit/Makefile.am vendor/openbsm/dist/bin/audit/Makefile.in vendor/openbsm/dist/bin/audit/audit.8 vendor/openbsm/dist/bin/auditd/Makefile.am vendor/openbsm/dist/bin/auditd/Makefile.in vendor/openbsm/dist/bin/auditd/auditd.8 vendor/openbsm/dist/bin/auditd/auditd.c vendor/openbsm/dist/bin/auditfilterd/Makefile.am vendor/openbsm/dist/bin/auditfilterd/Makefile.in vendor/openbsm/dist/bin/auditreduce/Makefile.am vendor/openbsm/dist/bin/auditreduce/Makefile.in vendor/openbsm/dist/bin/auditreduce/auditreduce.1 vendor/openbsm/dist/bin/praudit/Makefile.am vendor/openbsm/dist/bin/praudit/Makefile.in vendor/openbsm/dist/bin/praudit/praudit.1 vendor/openbsm/dist/bin/praudit/praudit.c vendor/openbsm/dist/bsm/Makefile.am vendor/openbsm/dist/bsm/Makefile.in vendor/openbsm/dist/bsm/auditd_lib.h vendor/openbsm/dist/bsm/libbsm.h vendor/openbsm/dist/compat/endian.h vendor/openbsm/dist/config/config.h.in vendor/openbsm/dist/config/ltmain.sh vendor/openbsm/dist/configure vendor/openbsm/dist/configure.ac vendor/openbsm/dist/etc/audit_control vendor/openbsm/dist/etc/audit_event vendor/openbsm/dist/libauditd/Makefile.am vendor/openbsm/dist/libauditd/Makefile.in vendor/openbsm/dist/libauditd/auditd_lib.c vendor/openbsm/dist/libbsm/Makefile.am vendor/openbsm/dist/libbsm/Makefile.in vendor/openbsm/dist/libbsm/au_control.3 vendor/openbsm/dist/libbsm/au_fcntl_cmd.3 vendor/openbsm/dist/libbsm/au_io.3 vendor/openbsm/dist/libbsm/audit_submit.3 vendor/openbsm/dist/libbsm/bsm_control.c vendor/openbsm/dist/libbsm/bsm_errno.c vendor/openbsm/dist/libbsm/bsm_io.c vendor/openbsm/dist/libbsm/bsm_token.c vendor/openbsm/dist/libbsm/bsm_user.c vendor/openbsm/dist/libbsm/bsm_wrappers.c vendor/openbsm/dist/man/Makefile.am vendor/openbsm/dist/man/Makefile.in vendor/openbsm/dist/man/audit.log.5 vendor/openbsm/dist/man/audit_control.5 vendor/openbsm/dist/man/auditon.2 vendor/openbsm/dist/man/getaudit.2 vendor/openbsm/dist/man/setaudit.2 vendor/openbsm/dist/modules/Makefile.am vendor/openbsm/dist/modules/Makefile.in vendor/openbsm/dist/modules/auditfilter_noop/Makefile.am vendor/openbsm/dist/modules/auditfilter_noop/Makefile.in vendor/openbsm/dist/sys/Makefile.am vendor/openbsm/dist/sys/Makefile.in vendor/openbsm/dist/sys/bsm/Makefile.am vendor/openbsm/dist/sys/bsm/Makefile.in vendor/openbsm/dist/sys/bsm/audit_errno.h vendor/openbsm/dist/sys/bsm/audit_kevents.h vendor/openbsm/dist/test/Makefile.am vendor/openbsm/dist/test/Makefile.in vendor/openbsm/dist/test/bsm/Makefile.am vendor/openbsm/dist/test/bsm/Makefile.in vendor/openbsm/dist/tools/Makefile.am vendor/openbsm/dist/tools/Makefile.in Modified: vendor/openbsm/dist/CREDITS ============================================================================== --- vendor/openbsm/dist/CREDITS Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/CREDITS Fri Nov 30 23:50:07 2012 (r243730) @@ -29,6 +29,12 @@ the development of OpenBSM: Stacey Son Todd Heberlein Gary Hoo + Dave Bertouille + Jonathan Anderson + Pawel Jakub Dawidek + Joel Dahl + Ryan Steinmetz + The FreeBSD Foundation In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel Software's FlexeLint tool were used to identify a number of bugs in the Modified: vendor/openbsm/dist/INSTALL ============================================================================== --- vendor/openbsm/dist/INSTALL Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/INSTALL Fri Nov 30 23:50:07 2012 (r243730) @@ -14,6 +14,12 @@ force the compile to fail if a warning i CFLAGS="-Wall -Werror" ./configure +On Linux systems, OpenSSL headers may have to be installed to support +encryption of on-the-wire audit streams using auditdistd; the following +appears to work on Ubuntu: + + sudo apt-get install libssl-dev + To install the library, binaries, and man pages, use: make install Modified: vendor/openbsm/dist/LICENSE ============================================================================== --- vendor/openbsm/dist/LICENSE Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/LICENSE Fri Nov 30 23:50:07 2012 (r243730) @@ -2,34 +2,37 @@ OpenBSM Copyrights and Licensing OpenBSM is covered by a number of copyrights, with licenses being either two or three clause BSD licenses. Individual file headers should be consulted -for specific copyrights on specific components. The TrustedBSD Project would -appreciate the contribution of fixes and enhancements under identical or -substantially similar licenses: - - * Copyright (c) - * 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. +for copyrights on specific elements of the distribution. -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#5 $ +The following copyright and license are asserted over the OpenBSM distribution +as a whole: + + Copyright (c) 2005-2012 Robert N.M. Watson + 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. + +The TrustedBSD Project would appreciate the contribution of fixes and +enhancements under an identical license in order to avoid potentially +confusing license proliferation. + +$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: vendor/openbsm/dist/Makefile.am ============================================================================== --- vendor/openbsm/dist/Makefile.am Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/Makefile.am Fri Nov 30 23:50:07 2012 (r243730) @@ -1,6 +1,6 @@ -# -# $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#4 $ -# +## +## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ +## SUBDIRS = \ bsm @@ -17,6 +17,7 @@ SUBDIRS += \ modules \ sys +ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ CHANGELOG \ Modified: vendor/openbsm/dist/Makefile.in ============================================================================== --- vendor/openbsm/dist/Makefile.in Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/Makefile.in Fri Nov 30 23:50:07 2012 (r243730) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,14 +13,28 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - -# -# $P4: //depot/projects/trustedbsd/openbsm/Makefile.in#10 $ -# VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -40,10 +54,14 @@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/config/config.h.in \ - $(top_srcdir)/configure INSTALL NEWS TODO config/config.guess \ - config/config.sub config/depcomp config/install-sh \ - config/ltmain.sh config/missing + $(srcdir)/Makefile.in $(top_srcdir)/config/config.guess \ + $(top_srcdir)/config/config.h.in \ + $(top_srcdir)/config/config.sub \ + $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ + $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ + NEWS TODO config/config.guess config/config.sub config/depcomp \ + config/install-sh config/ltmain.sh config/missing \ + config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -53,6 +71,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -62,21 +81,61 @@ RECURSIVE_TARGETS = all-recursive check- install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + cscope distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = bsm libauditd libbsm bin man modules sys DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -90,45 +149,52 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MIG = @MIG@ MKDIR_P = @MKDIR_P@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ @@ -137,13 +203,15 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -190,6 +258,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = bsm $(am__append_1) libbsm bin man modules sys +ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ CHANGELOG \ LICENSE \ @@ -200,21 +269,21 @@ EXTRA_DIST = \ all: all-recursive .SUFFIXES: -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -230,21 +299,20 @@ $(top_builddir)/config.status: $(top_src $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): config/config.h: config/stamp-h1 - @if test ! -f $@; then \ - rm -f config/stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f config/stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; else :; fi config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status @rm -f config/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config/config.h $(top_srcdir)/config/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f config/stamp-h1 touch $@ @@ -258,16 +326,16 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool + -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -276,7 +344,11 @@ $(RECURSIVE_TARGETS): done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -284,50 +356,23 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -335,14 +380,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -354,7 +399,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -363,36 +408,65 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) + +clean-cscope: + -rm -f cscope.files + +cscope.files: clean-cscope cscopelist-recursive cscopelist + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -408,66 +482,84 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -475,26 +567,31 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -515,14 +612,24 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -553,16 +660,22 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -583,6 +696,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -591,18 +706,28 @@ install-data-am: install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -625,24 +750,27 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am + all all-am am--refresh check check-am clean clean-cscope \ + clean-generic clean-libtool cscope cscopelist \ + cscopelist-recursive ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: vendor/openbsm/dist/NEWS ============================================================================== --- vendor/openbsm/dist/NEWS Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/NEWS Fri Nov 30 23:50:07 2012 (r243730) @@ -1,5 +1,30 @@ OpenBSM Version History +OpenBSM 1.2 alpha 2 + +- auditdistd, a distributed audit trail management daemon, has now been + merged. This allows trail files to be securely and reliably synced from + audited hosts to an audit server, and employs TLS encryption. Where + available, it uses Capsicum to sandbox the service. This work was + contributed by Pawel Jakub Dawidek under sponsorship from the FreeBSD + Foundation. + +OpenBSM 1.2 alpha 1 + +- Add Capsicum-related error numbers for FreeBSD: ENOTCAPABLE, ECAPMODE. +- Add Capsicum, process descriptor audit events for FreeBSD. +- Allow 0% minspace. +- Fixes from the clang static analyser. +- Fix expiration of trail files when the host parameter is used. +- Various typo fixes. +- Support for Solaris privilege and privilege set tokens. +- Documentation for getachost(), improvements for getacfilesz(). +- Fix a directory descriptor leak that happened when audit trail partitions + filled. +- Support for more Linux distributions with a partial contemporary endian.h. +- Improved escaping of XML-encapsulated BSM. +- A variety of minor documentation, style, and functional. + OpenBSM 1.1p2 - Fix audit_event definitions of AUE_OPENAT_RWT and AUE_OPENAT_RWTC. @@ -464,4 +489,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#43 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#53 $ Modified: vendor/openbsm/dist/README ============================================================================== --- vendor/openbsm/dist/README Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/README Fri Nov 30 23:50:07 2012 (r243730) @@ -1,4 +1,4 @@ -OpenBSM 1.1p2 +OpenBSM 1.2a2 Introduction @@ -38,6 +38,7 @@ The following programs are included with audit Command line audit control tool auditd Audit management daemon + auditdistd Audit trail distribution daemon auditfilterd Experimental event monitoring framework auditreduce Audit trail reduction tool audump Debugging tool to parse and print audit databases @@ -64,4 +65,4 @@ Information on TrustedBSD may be found o http://www.TrustedBSD.org/ -$P4: //depot/projects/trustedbsd/openbsm/README#37 $ +$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: vendor/openbsm/dist/TODO ============================================================================== --- vendor/openbsm/dist/TODO Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/TODO Fri Nov 30 23:50:07 2012 (r243730) @@ -21,5 +21,7 @@ OpenBSM TODO alternative locations can be used. - NLS support for au_strerror(3), which provides error strings for BSM errors not available on the local OS platform. +- Support for client certificates in auditdistd, to include certificate chain + validation. -$P4: //depot/projects/trustedbsd/openbsm/TODO#13 $ +$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: vendor/openbsm/dist/VERSION ============================================================================== --- vendor/openbsm/dist/VERSION Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/VERSION Fri Nov 30 23:50:07 2012 (r243730) @@ -1 +1 @@ -OPENBSM_1_1p2 +OPENBSM_1_2alpha2 Modified: vendor/openbsm/dist/aclocal.m4 ============================================================================== --- vendor/openbsm/dist/aclocal.m4 Fri Nov 30 23:45:55 2012 (r243729) +++ vendor/openbsm/dist/aclocal.m4 Fri Nov 30 23:50:07 2012 (r243730) @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.12.2 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,108 +13,206 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.62],, -[m4_warning([this file was generated for autoconf 2.62. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:51:35 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 5D33C806; Fri, 30 Nov 2012 23:51:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 066F18FC15; Fri, 30 Nov 2012 23:51:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNpXPI079391; Fri, 30 Nov 2012 23:51:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNpXtC079387; Fri, 30 Nov 2012 23:51:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211302351.qAUNpXtC079387@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 30 Nov 2012 23:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243731 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:51:35 -0000 Author: jilles Date: Fri Nov 30 23:51:33 2012 New Revision: 243731 URL: http://svnweb.freebsd.org/changeset/base/243731 Log: libc: Allow setting close-on-exec in fopen/freopen/fdopen. This commit adds a new mode option 'e' that must follow any 'b', '+' and/or 'x' options. C11 is clear about the 'x' needing to follow 'b' and/or '+' and that is what we implement; therefore, require a strict position for 'e' as well. For freopen() with a non-NULL path argument and fopen(), the close-on-exec flag is set iff the 'e' mode option is specified. For freopen() with a NULL path argument and fdopen(), the close-on-exec flag is turned on if the 'e' mode option is specified and remains unchanged otherwise. Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC) and fdopen(), this needlessly complicates the calling code. Apart from the ordering requirement, the new option matches glibc. PR: kern/169320 Modified: head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/flags.c head/lib/libc/stdio/fopen.3 head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/fdopen.c ============================================================================== --- head/lib/libc/stdio/fdopen.c Fri Nov 30 23:50:07 2012 (r243730) +++ head/lib/libc/stdio/fdopen.c Fri Nov 30 23:51:33 2012 (r243731) @@ -80,6 +80,12 @@ fdopen(fd, mode) if ((fp = __sfp()) == NULL) return (NULL); + + if ((oflags & O_CLOEXEC) && _fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { + fp->_flags = 0; + return (NULL); + } + fp->_flags = flags; /* * If opened for appending, but underlying descriptor does not have Modified: head/lib/libc/stdio/flags.c ============================================================================== --- head/lib/libc/stdio/flags.c Fri Nov 30 23:50:07 2012 (r243730) +++ head/lib/libc/stdio/flags.c Fri Nov 30 23:51:33 2012 (r243731) @@ -97,6 +97,7 @@ __sflags(mode, optr) /* 'x' means exclusive (fail if the file exists) */ if (*mode == 'x') { + mode++; if (m == O_RDONLY) { errno = EINVAL; return (0); @@ -104,6 +105,10 @@ __sflags(mode, optr) o |= O_EXCL; } + /* set close-on-exec */ + if (*mode == 'e') + o |= O_CLOEXEC; + *optr = m | o; return (ret); } Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Fri Nov 30 23:50:07 2012 (r243730) +++ head/lib/libc/stdio/fopen.3 Fri Nov 30 23:51:33 2012 (r243731) @@ -32,7 +32,7 @@ .\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 17, 2011 +.Dd November 30, 2012 .Dt FOPEN 3 .Os .Sh NAME @@ -97,6 +97,14 @@ or causes the .Fn fopen call to fail if the file already exists. +An optional +.Dq Li e +following the above +causes the +.Fn fopen +call to set the +.Dv FD_CLOEXEC +flag on the underlying file descriptor. .Pp The .Fa mode @@ -144,6 +152,11 @@ of the stream must be compatible with th The .Dq Li x mode option is ignored. +If the +.Dq Li e +mode option is present, the +.Dv FD_CLOEXEC +flag is set, otherwise it remains unchanged. When the stream is closed via .Xr fclose 3 , .Fa fildes @@ -277,3 +290,7 @@ The function conforms to .St -p1003.1-88 . +The +.Dq Li e +mode option does not conform to any standard +but is also supported by glibc. Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Fri Nov 30 23:50:07 2012 (r243730) +++ head/lib/libc/stdio/freopen.c Fri Nov 30 23:51:33 2012 (r243731) @@ -118,6 +118,8 @@ freopen(file, mode, fp) (void) ftruncate(fp->_file, (off_t)0); if (!(oflags & O_APPEND)) (void) _sseek(fp, (fpos_t)0, SEEK_SET); + if (oflags & O_CLOEXEC) + (void) _fcntl(fp->_file, F_SETFD, FD_CLOEXEC); f = fp->_file; isopen = 0; wantfd = -1; @@ -194,7 +196,8 @@ finish: * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ if (wantfd >= 0) { - if (_dup2(f, wantfd) >= 0) { + if ((oflags & O_CLOEXEC ? _fcntl(f, F_DUP2FD_CLOEXEC, wantfd) : + _dup2(f, wantfd)) >= 0) { (void)_close(f); f = wantfd; } else From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:52:45 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 D575C75; Fri, 30 Nov 2012 23:52:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A24E48FC08; Fri, 30 Nov 2012 23:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNqjAd080319; Fri, 30 Nov 2012 23:52:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNqjf5080318; Fri, 30 Nov 2012 23:52:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201211302352.qAUNqjf5080318@svn.freebsd.org> From: Robert Watson Date: Fri, 30 Nov 2012 23:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243732 - vendor/openbsm/1.2-ALPHA-2 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:52:45 -0000 Author: rwatson Date: Fri Nov 30 23:52:45 2012 New Revision: 243732 URL: http://svnweb.freebsd.org/changeset/base/243732 Log: Tag OpenBSM 1.2-alpha2. Obtained from: TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Added: vendor/openbsm/1.2-ALPHA-2/ - copied from r243731, vendor/openbsm/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 23:54: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 EE6434FC; Fri, 30 Nov 2012 23:54:57 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAA438FC12; Fri, 30 Nov 2012 23:54:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUNsvqx080809; Fri, 30 Nov 2012 23:54:57 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUNsvgg080808; Fri, 30 Nov 2012 23:54:57 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201211302354.qAUNsvgg080808@svn.freebsd.org> From: Jack F Vogel Date: Fri, 30 Nov 2012 23:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243733 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 23:54:58 -0000 Author: jfv Date: Fri Nov 30 23:54:57 2012 New Revision: 243733 URL: http://svnweb.freebsd.org/changeset/base/243733 Log: Patch #9 Performance - improve the tx dma failure path, similar to a change done in igb long ago. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:52:45 2012 (r243732) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:54:57 2012 (r243733) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 8"; +char ixgbe_driver_version[] = "2.5.0 - 9"; /********************************************************************* * PCI Device ID Table @@ -1740,6 +1740,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m u32 paylen = 0; int i, j, error, nsegs; int first, last = 0; + bool remap = TRUE; struct mbuf *m_head; bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; @@ -1767,42 +1768,38 @@ ixgbe_xmit(struct tx_ring *txr, struct m /* * Map the packet for DMA. */ +retry: error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error == EFBIG) { + if (__predict_false(error)) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); - if (m == NULL) { - adapter->mbuf_defrag_failed++; - m_freem(*m_headp); - *m_headp = NULL; - return (ENOBUFS); - } - *m_headp = m; - - /* Try it again */ - error = bus_dmamap_load_mbuf_sg(txr->txtag, map, - *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - - if (error == ENOMEM) { + switch (error) { + case EFBIG: + /* Try it again? - one try */ + if (remap == TRUE) { + remap = FALSE; + m = m_defrag(*m_headp, M_NOWAIT); + if (m == NULL) { + adapter->mbuf_defrag_failed++; + m_freem(*m_headp); + *m_headp = NULL; + return (ENOBUFS); + } + *m_headp = m; + goto retry; + } else + return (error); + case ENOMEM: txr->no_tx_dma_setup++; return (error); - } else if (error != 0) { + default: txr->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } - } else if (error == ENOMEM) { - txr->no_tx_dma_setup++; - return (error); - } else if (error != 0) { - txr->no_tx_dma_setup++; - m_freem(*m_headp); - *m_headp = NULL; - return (error); } /* Make certain there are enough descriptors */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 00:02: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 37644CD0; Sat, 1 Dec 2012 00:02:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7B38FC15; Sat, 1 Dec 2012 00:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB102WDN083365; Sat, 1 Dec 2012 00:02:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB102Vas083342; Sat, 1 Dec 2012 00:02:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212010002.qB102Vas083342@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Dec 2012 00:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243734 - in vendor/openbsm/dist: bin/auditd bin/auditdistd bin/praudit libbsm sys/bsm X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 00:02:32 -0000 Author: rwatson Date: Sat Dec 1 00:02:31 2012 New Revision: 243734 URL: http://svnweb.freebsd.org/changeset/base/243734 Log: Merge a number of post-1.2-alpha2 changes to OpenBSM into the OpenBSM vendor area; these sort out various post-release issues, largely to do with integrating OpenBSM with the base FreeBSD build. All of these changes will appear in a future 1.2-alpha3: Change 219846 on 2012/11/26 by rwatson@rwatson_cinnamon Update several instances of Apple Computer to Apple; a change made in the FreeBSD tree some years ago but not propagated to OpenBSM. Change 219845 on 2012/11/26 by rwatson@rwatson_cinnamon Remove Apple acknowledgement clause from file with Christian Peron copyright (with permission from Christian). Change 219836 on 2012/11/23 by rwatson@rwatson_cinnamon Replace further instances of <> with "" for local includes in auditdistd. Change 219834 on 2012/11/23 by rwatson@rwatson_cinnamon For current-directory headers, use #include "" rather than #include <>. Change 219832 on 2012/11/23 by rwatson@rwatson_cinnamon Be more consistent with the remainder of OpenBSM and include config/config.h rather than config.h. Don't include config.h from synch.h, which is included only from .c files that already include config.h. Change 219831 on 2012/11/23 by pjd@pjd_anger Add Xref to auditdistd(8). Suggested by: rwatson Obtained from: TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Modified: vendor/openbsm/dist/bin/auditd/auditd.8 vendor/openbsm/dist/bin/auditdistd/auditdistd.c vendor/openbsm/dist/bin/auditdistd/parse.y vendor/openbsm/dist/bin/auditdistd/proto_tcp.c vendor/openbsm/dist/bin/auditdistd/proto_tls.c vendor/openbsm/dist/bin/auditdistd/proto_uds.c vendor/openbsm/dist/bin/auditdistd/receiver.c vendor/openbsm/dist/bin/auditdistd/sandbox.c vendor/openbsm/dist/bin/auditdistd/sender.c vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h vendor/openbsm/dist/bin/auditdistd/subr.c vendor/openbsm/dist/bin/auditdistd/synch.h vendor/openbsm/dist/bin/auditdistd/token.l vendor/openbsm/dist/bin/auditdistd/trail.c vendor/openbsm/dist/bin/praudit/praudit.c vendor/openbsm/dist/libbsm/audit_submit.3 vendor/openbsm/dist/libbsm/bsm_audit.c vendor/openbsm/dist/libbsm/bsm_class.c vendor/openbsm/dist/libbsm/bsm_io.c vendor/openbsm/dist/sys/bsm/audit_internal.h Modified: vendor/openbsm/dist/bin/auditd/auditd.8 ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd.8 Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditd/auditd.8 Sat Dec 1 00:02:31 2012 (r243734) @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#18 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ .\" .Dd December 11, 2008 .Dt AUDITD 8 @@ -122,6 +122,7 @@ and are no longer available as arguments .Xr audit_event 5 , .Xr audit_warn 5 , .Xr audit 8 , +.Xr auditdistd 8 , .Xr launchd 8 .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/auditdistd.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,10 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ -#include "config.h" +#include #include #if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BSWAP) @@ -75,9 +75,8 @@ #include "sigtimedwait.h" #endif -#include - #include "auditdistd.h" +#include "pjdlog.h" #include "proto.h" #include "subr.h" #include "synch.h" Modified: vendor/openbsm/dist/bin/auditdistd/parse.y ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/parse.y Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/parse.y Sat Dec 1 00:02:31 2012 (r243734) @@ -27,10 +27,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#3 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ -#include "config.h" +#include #include #include @@ -48,9 +48,8 @@ #include #endif -#include - #include "auditdistd.h" +#include "pjdlog.h" extern int depth; extern int lineno; Modified: vendor/openbsm/dist/bin/auditdistd/proto_tcp.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_tcp.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/proto_tcp.c Sat Dec 1 00:02:31 2012 (r243734) @@ -27,12 +27,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#2 $ */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include /* MAXHOSTNAMELEN */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto_tls.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_tls.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/proto_tls.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,12 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#2 $ */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include /* MAXHOSTNAMELEN */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto_uds.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_uds.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/proto_uds.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,14 +26,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#2 $ */ /* UDS - UNIX Domain Socket */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include #include Modified: vendor/openbsm/dist/bin/auditdistd/receiver.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/receiver.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/receiver.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,10 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#3 $ */ -#include "config.h" +#include #include #if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BSWAP) @@ -78,9 +78,8 @@ #include "renameat.h" #endif -#include - #include "auditdistd.h" +#include "pjdlog.h" #include "proto.h" #include "sandbox.h" #include "subr.h" Modified: vendor/openbsm/dist/bin/auditdistd/sandbox.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sandbox.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/sandbox.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,12 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#3 $ */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include #ifdef HAVE_JAIL @@ -50,8 +48,7 @@ #include #include -#include - +#include "pjdlog.h" #include "sandbox.h" static int Modified: vendor/openbsm/dist/bin/auditdistd/sender.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sender.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/sender.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,10 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#3 $ */ -#include "config.h" +#include #include #if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BSWAP) @@ -72,9 +72,8 @@ #include "sigtimedwait.h" #endif -#include - #include "auditdistd.h" +#include "pjdlog.h" #include "proto.h" #include "sandbox.h" #include "subr.h" Modified: vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h Sat Dec 1 00:02:31 2012 (r243734) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#2 $ */ #ifndef _SIGTIMEDWAIT_H_ @@ -42,7 +42,7 @@ #include #include -#include +#include "pjdlog.h" static int sigtimedwait(const sigset_t *set, siginfo_t *info, Modified: vendor/openbsm/dist/bin/auditdistd/subr.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/subr.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/subr.c Sat Dec 1 00:02:31 2012 (r243734) @@ -23,10 +23,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#3 $ */ -#include "config.h" +#include #ifdef HAVE_KQUEUE #include @@ -48,9 +48,8 @@ #include #endif -#include - #include "auditdistd.h" +#include "pjdlog.h" #include "subr.h" int Modified: vendor/openbsm/dist/bin/auditdistd/synch.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/synch.h Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/synch.h Sat Dec 1 00:02:31 2012 (r243734) @@ -26,16 +26,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#3 $ */ #ifndef _SYNCH_H_ #define _SYNCH_H_ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #ifdef HAVE_PTHREAD_NP_H @@ -44,7 +40,7 @@ #include #include -#include +#include "pjdlog.h" #ifndef PJDLOG_ASSERT #include Modified: vendor/openbsm/dist/bin/auditdistd/token.l ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/token.l Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/token.l Sat Dec 1 00:02:31 2012 (r243734) @@ -27,10 +27,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ */ -#include "config.h" +#include #include #include Modified: vendor/openbsm/dist/bin/auditdistd/trail.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/trail.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/trail.c Sat Dec 1 00:02:31 2012 (r243734) @@ -26,10 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#3 $ */ -#include "config.h" +#include #include #include @@ -60,8 +60,7 @@ #include "unlinkat.h" #endif -#include - +#include "pjdlog.h" #include "trail.h" #define TRAIL_MAGIC 0x79a11 Modified: vendor/openbsm/dist/bin/praudit/praudit.c ============================================================================== --- vendor/openbsm/dist/bin/praudit/praudit.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/praudit/praudit.c Sat Dec 1 00:02:31 2012 (r243734) @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/praudit/praudit.c#15 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/praudit/praudit.c#16 $ */ /* Modified: vendor/openbsm/dist/libbsm/audit_submit.3 ============================================================================== --- vendor/openbsm/dist/libbsm/audit_submit.3 Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/libbsm/audit_submit.3 Sat Dec 1 00:02:31 2012 (r243734) @@ -11,9 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -.\" its contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -27,7 +24,7 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/audit_submit.3#18 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/audit_submit.3#19 $ .\" .Dd January 18, 2008 .Dt AUDIT_SUBMIT 3 Modified: vendor/openbsm/dist/libbsm/bsm_audit.c ============================================================================== --- vendor/openbsm/dist/libbsm/bsm_audit.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/libbsm/bsm_audit.c Sat Dec 1 00:02:31 2012 (r243734) @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#36 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#37 $ */ #include Modified: vendor/openbsm/dist/libbsm/bsm_class.c ============================================================================== --- vendor/openbsm/dist/libbsm/bsm_class.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/libbsm/bsm_class.c Sat Dec 1 00:02:31 2012 (r243734) @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#15 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#16 $ */ #include Modified: vendor/openbsm/dist/libbsm/bsm_io.c ============================================================================== --- vendor/openbsm/dist/libbsm/bsm_io.c Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/libbsm/bsm_io.c Sat Dec 1 00:02:31 2012 (r243734) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -32,7 +32,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#74 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#75 $ */ #include Modified: vendor/openbsm/dist/sys/bsm/audit_internal.h ============================================================================== --- vendor/openbsm/dist/sys/bsm/audit_internal.h Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/sys/bsm/audit_internal.h Sat Dec 1 00:02:31 2012 (r243734) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -30,7 +30,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#5 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#6 $ */ #ifndef _AUDIT_INTERNAL_H From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 00:04:00 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 CA871E37; Sat, 1 Dec 2012 00:04:00 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5C368FC16; Sat, 1 Dec 2012 00:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB103xNq083980; Sat, 1 Dec 2012 00:03:59 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB103xUD083978; Sat, 1 Dec 2012 00:03:59 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201212010003.qB103xUD083978@svn.freebsd.org> From: Jack F Vogel Date: Sat, 1 Dec 2012 00:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243735 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 00:04:00 -0000 Author: jfv Date: Sat Dec 1 00:03:58 2012 New Revision: 243735 URL: http://svnweb.freebsd.org/changeset/base/243735 Log: Patch #10 Performance - this changes the protocol offload interface and code in the TX path,making it tighter and hopefully more efficient. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:02:31 2012 (r243734) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:03:58 2012 (r243735) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 9"; +char ixgbe_driver_version[] = "2.5.0 - 10"; /********************************************************************* * PCI Device ID Table @@ -165,8 +165,10 @@ static int ixgbe_dma_malloc(struct adapt static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); static void ixgbe_add_process_limit(struct adapter *, const char *, const char *, u16 *, u16); -static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); -static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); +static int ixgbe_tx_ctx_setup(struct tx_ring *, + struct mbuf *, u32 *, u32 *); +static int ixgbe_tso_setup(struct tx_ring *, + struct mbuf *, u32 *, u32 *); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); static void ixgbe_configure_ivars(struct adapter *); static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -1737,7 +1739,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m { struct adapter *adapter = txr->adapter; u32 olinfo_status = 0, cmd_type_len; - u32 paylen = 0; int i, j, error, nsegs; int first, last = 0; bool remap = TRUE; @@ -1814,16 +1815,12 @@ retry: ** Set up the appropriate offload context ** this will consume the first descriptor */ - if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - if (ixgbe_tso_setup(txr, m_head, &paylen, &olinfo_status)) { - cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; - olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; - ++txr->tso_tx; - } else - return (ENXIO); - } else if (ixgbe_tx_ctx_setup(txr, m_head)) - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + error = ixgbe_tx_ctx_setup(txr, m_head, &cmd_type_len, &olinfo_status); + if (__predict_false(error)) { + if (error == ENOBUFS) + *m_headp = NULL; + return (error); + } #ifdef IXGBE_FDIR /* Do the flow director magic */ @@ -1835,10 +1832,6 @@ retry: } } #endif - /* Record payload length */ - if (paylen == 0) - olinfo_status |= m_head->m_pkthdr.len << - IXGBE_ADVTXD_PAYLEN_SHIFT; i = txr->next_avail_desc; for (j = 0; j < nsegs; j++) { @@ -3218,31 +3211,37 @@ ixgbe_free_transmit_buffers(struct tx_ri /********************************************************************* * - * Advanced Context Descriptor setup for VLAN or CSUM + * Advanced Context Descriptor setup for VLAN, CSUM or TSO * **********************************************************************/ -static bool -ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp) +static int +ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, + u32 *cmd_type_len, u32 *olinfo_status) { struct ixgbe_adv_tx_context_desc *TXD; - struct ixgbe_tx_buf *tx_buffer; - u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; struct ether_vlan_header *eh; struct ip *ip; struct ip6_hdr *ip6; - int ehdrlen, ip_hlen = 0; + u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; + int ehdrlen, ip_hlen = 0; u16 etype; u8 ipproto = 0; - bool offload = TRUE; - int ctxd = txr->next_avail_desc; - u16 vtag = 0; - + int offload = TRUE; + int ctxd = txr->next_avail_desc; + u16 vtag = 0; + + /* First check if TSO is to be used */ + if (mp->m_pkthdr.csum_flags & CSUM_TSO) + return (ixgbe_tso_setup(txr, mp, cmd_type_len, olinfo_status)); if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) offload = FALSE; - tx_buffer = &txr->tx_buffers[ctxd]; + /* Indicate the whole packet as payload when not doing TSO */ + *olinfo_status |= mp->m_pkthdr.len << IXGBE_ADVTXD_PAYLEN_SHIFT; + + /* Now ready a context descriptor */ TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; /* @@ -3253,8 +3252,8 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, if (mp->m_flags & M_VLANTAG) { vtag = htole16(mp->m_pkthdr.ether_vtag); vlan_macip_lens |= (vtag << IXGBE_ADVTXD_VLAN_SHIFT); - } else if (offload == FALSE) - return FALSE; + } else if (offload == FALSE) /* ... no offload to do */ + return (0); /* * Determine where frame payload starts. @@ -3317,22 +3316,22 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, break; } + if (offload) /* For the TX descriptor setup */ + *olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + /* Now copy bits into descriptor */ TXD->vlan_macip_lens |= htole32(vlan_macip_lens); TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); TXD->seqnum_seed = htole32(0); TXD->mss_l4len_idx = htole32(0); - tx_buffer->m_head = NULL; - tx_buffer->eop_index = -1; - /* We've consumed the first desc, adjust counters */ if (++ctxd == txr->num_desc) ctxd = 0; txr->next_avail_desc = ctxd; --txr->tx_avail; - return (offload); + return (0); } /********************************************************************** @@ -3341,14 +3340,13 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, * adapters using advanced tx descriptors * **********************************************************************/ -static bool -ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen, - u32 *olinfo_status) +static int +ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, + u32 *cmd_type_len, u32 *olinfo_status) { struct ixgbe_adv_tx_context_desc *TXD; - struct ixgbe_tx_buf *tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; - u32 mss_l4len_idx = 0, len; + u32 mss_l4len_idx = 0, paylen; u16 vtag = 0, eh_type; int ctxd, ehdrlen, ip_hlen, tcp_hlen; struct ether_vlan_header *eh; @@ -3374,18 +3372,15 @@ ixgbe_tso_setup(struct tx_ring *txr, str eh_type = eh->evl_encap_proto; } - /* Ensure we have at least the IP+TCP header in the first mbuf. */ - len = ehdrlen + sizeof(struct tcphdr); switch (ntohs(eh_type)) { #ifdef INET6 case ETHERTYPE_IPV6: - if (mp->m_len < len + sizeof(struct ip6_hdr)) - return FALSE; ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); /* XXX-BZ For now we do not pretend to support ext. hdrs. */ if (ip6->ip6_nxt != IPPROTO_TCP) - return FALSE; + return (ENXIO); ip_hlen = sizeof(struct ip6_hdr); + ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen); th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; @@ -3393,11 +3388,9 @@ ixgbe_tso_setup(struct tx_ring *txr, str #endif #ifdef INET case ETHERTYPE_IP: - if (mp->m_len < len + sizeof(struct ip)) - return FALSE; ip = (struct ip *)(mp->m_data + ehdrlen); if (ip->ip_p != IPPROTO_TCP) - return FALSE; + return (ENXIO); ip->ip_sum = 0; ip_hlen = ip->ip_hl << 2; th = (struct tcphdr *)((caddr_t)ip + ip_hlen); @@ -3415,13 +3408,12 @@ ixgbe_tso_setup(struct tx_ring *txr, str } ctxd = txr->next_avail_desc; - tx_buffer = &txr->tx_buffers[ctxd]; TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; tcp_hlen = th->th_off << 2; /* This is used in the transmit desc in encap */ - *paylen = mp->m_pkthdr.len - ehdrlen - ip_hlen - tcp_hlen; + paylen = mp->m_pkthdr.len - ehdrlen - ip_hlen - tcp_hlen; /* VLAN MACLEN IPLEN */ if (mp->m_flags & M_VLANTAG) { @@ -3444,15 +3436,17 @@ ixgbe_tso_setup(struct tx_ring *txr, str TXD->mss_l4len_idx = htole32(mss_l4len_idx); TXD->seqnum_seed = htole32(0); - tx_buffer->m_head = NULL; - tx_buffer->eop_index = -1; if (++ctxd == txr->num_desc) ctxd = 0; txr->tx_avail--; txr->next_avail_desc = ctxd; - return TRUE; + *cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; + *olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + *olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; + ++txr->tso_tx; + return (0); } #ifdef IXGBE_FDIR From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 00:11:24 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 A809C1E8; Sat, 1 Dec 2012 00:11:24 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5DE8FC14; Sat, 1 Dec 2012 00:11:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB10BOhc085600; Sat, 1 Dec 2012 00:11:24 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB10BO0Q085598; Sat, 1 Dec 2012 00:11:24 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201212010011.qB10BO0Q085598@svn.freebsd.org> From: Jack F Vogel Date: Sat, 1 Dec 2012 00:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243736 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 00:11:24 -0000 Author: jfv Date: Sat Dec 1 00:11:24 2012 New Revision: 243736 URL: http://svnweb.freebsd.org/changeset/base/243736 Log: Patch #11 - The final patch: this one greatly improves the TX hot path by getting rid of index calculations and simply managing pointers. Much of the creative code is due to my coworker here at Intel, Alex Duyck, thanks Alex! Also, this whole series of patches was given the critical eye of Gleb Smirnoff and is all the better for it, thanks Gleb! Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:03:58 2012 (r243735) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:11:24 2012 (r243736) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0 - 10"; +char ixgbe_driver_version[] = "2.5.0"; /********************************************************************* * PCI Device ID Table @@ -1740,7 +1740,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m struct adapter *adapter = txr->adapter; u32 olinfo_status = 0, cmd_type_len; int i, j, error, nsegs; - int first, last = 0; + int first; bool remap = TRUE; struct mbuf *m_head; bus_dma_segment_t segs[adapter->num_segs]; @@ -1847,13 +1847,9 @@ retry: txd->read.cmd_type_len = htole32(txr->txd_cmd | cmd_type_len |seglen); txd->read.olinfo_status = htole32(olinfo_status); - last = i; /* descriptor that will get completion IRQ */ if (++i == txr->num_desc) i = 0; - - txbuf->m_head = NULL; - txbuf->eop_index = -1; } txd->read.cmd_type_len |= @@ -1872,9 +1868,9 @@ retry: txbuf->map = map; bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE); - /* Set the index of the descriptor that will be marked done */ + /* Set the EOP descriptor that will be marked done */ txbuf = &txr->tx_buffers[first]; - txbuf->eop_index = last; + txbuf->eop = txd; bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -3023,8 +3019,8 @@ ixgbe_setup_transmit_ring(struct tx_ring netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } #endif /* DEV_NETMAP */ - /* Clear the EOP index */ - txbuf->eop_index = -1; + /* Clear the EOP descriptor pointer */ + txbuf->eop = NULL; } #ifdef IXGBE_FDIR @@ -3083,7 +3079,7 @@ ixgbe_initialize_transmit_units(struct a (tdba & 0x00000000ffffffffULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i), - adapter->num_tx_desc * sizeof(struct ixgbe_legacy_tx_desc)); + adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc)); /* Setup the HW Tx Head and Tail descriptor pointers */ IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0); @@ -3320,8 +3316,8 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, *olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; /* Now copy bits into descriptor */ - TXD->vlan_macip_lens |= htole32(vlan_macip_lens); - TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); + TXD->vlan_macip_lens = htole32(vlan_macip_lens); + TXD->type_tucmd_mlhl = htole32(type_tucmd_mlhl); TXD->seqnum_seed = htole32(0); TXD->mss_l4len_idx = htole32(0); @@ -3423,12 +3419,12 @@ ixgbe_tso_setup(struct tx_ring *txr, str vlan_macip_lens |= ehdrlen << IXGBE_ADVTXD_MACLEN_SHIFT; vlan_macip_lens |= ip_hlen; - TXD->vlan_macip_lens |= htole32(vlan_macip_lens); + TXD->vlan_macip_lens = htole32(vlan_macip_lens); /* ADV DTYPE TUCMD */ type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; - TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); + TXD->type_tucmd_mlhl = htole32(type_tucmd_mlhl); /* MSS L4LEN IDX */ mss_l4len_idx |= (mp->m_pkthdr.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT); @@ -3535,11 +3531,12 @@ ixgbe_atr(struct tx_ring *txr, struct mb static bool ixgbe_txeof(struct tx_ring *txr) { - struct adapter *adapter = txr->adapter; - struct ifnet *ifp = adapter->ifp; - u32 first, last, done, processed; - struct ixgbe_tx_buf *tx_buffer; - struct ixgbe_legacy_tx_desc *tx_desc, *eop_desc; + struct adapter *adapter = txr->adapter; + struct ifnet *ifp = adapter->ifp; + u32 work, processed = 0; + u16 limit = txr->process_limit; + struct ixgbe_tx_buf *buf; + union ixgbe_adv_tx_desc *txd; mtx_assert(&txr->tx_mtx, MA_OWNED); @@ -3547,9 +3544,7 @@ ixgbe_txeof(struct tx_ring *txr) if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->tx_rings[txr->me]; - - tx_desc = (struct ixgbe_legacy_tx_desc *)txr->tx_base; - + txd = txr->tx_base; bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); /* @@ -3572,8 +3567,7 @@ ixgbe_txeof(struct tx_ring *txr) */ if (!netmap_mitigate || (kring->nr_kflags < kring->nkr_num_slots && - tx_desc[kring->nr_kflags].upper.fields.status & - IXGBE_TXD_STAT_DD)) { + txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) { kring->nr_kflags = kring->nkr_num_slots; selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); IXGBE_TX_UNLOCK(txr); @@ -3591,79 +3585,87 @@ ixgbe_txeof(struct tx_ring *txr) return FALSE; } - processed = 0; - first = txr->next_to_clean; - tx_buffer = &txr->tx_buffers[first]; - /* For cleanup we just use legacy struct */ - tx_desc = (struct ixgbe_legacy_tx_desc *)&txr->tx_base[first]; - last = tx_buffer->eop_index; - if (last == -1) - return FALSE; - eop_desc = (struct ixgbe_legacy_tx_desc *)&txr->tx_base[last]; - - /* - ** Get the index of the first descriptor - ** BEYOND the EOP and call that 'done'. - ** I do this so the comparison in the - ** inner while loop below can be simple - */ - if (++last == adapter->num_tx_desc) last = 0; - done = last; - + /* Get work starting point */ + work = txr->next_to_clean; + buf = &txr->tx_buffers[work]; + txd = &txr->tx_base[work]; + work -= txr->num_desc; /* The distance to ring end */ bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); - /* - ** Only the EOP descriptor of a packet now has the DD - ** bit set, this is what we look for... - */ - while (eop_desc->upper.fields.status & IXGBE_TXD_STAT_DD) { - /* We clean the range of the packet */ - while (first != done) { - tx_desc->upper.data = 0; - tx_desc->lower.data = 0; - tx_desc->buffer_addr = 0; - ++txr->tx_avail; - ++processed; - if (tx_buffer->m_head) { + do { + union ixgbe_adv_tx_desc *eop= buf->eop; + if (eop == NULL) /* No work */ + break; + + if ((eop->wb.status & IXGBE_TXD_STAT_DD) == 0) + break; /* I/O not complete */ + + if (buf->m_head) { + txr->bytes += + buf->m_head->m_pkthdr.len; + bus_dmamap_sync(txr->txtag, + buf->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txr->txtag, + buf->map); + m_freem(buf->m_head); + buf->m_head = NULL; + buf->map = NULL; + } + buf->eop = NULL; + ++txr->tx_avail; + + /* We clean the range if multi segment */ + while (txd != eop) { + ++txd; + ++buf; + ++work; + /* wrap the ring? */ + if (__predict_false(!work)) { + work -= txr->num_desc; + buf = txr->tx_buffers; + txd = txr->tx_base; + } + if (buf->m_head) { txr->bytes += - tx_buffer->m_head->m_pkthdr.len; + buf->m_head->m_pkthdr.len; bus_dmamap_sync(txr->txtag, - tx_buffer->map, + buf->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txr->txtag, - tx_buffer->map); - m_freem(tx_buffer->m_head); - tx_buffer->m_head = NULL; - tx_buffer->map = NULL; + buf->map); + m_freem(buf->m_head); + buf->m_head = NULL; + buf->map = NULL; } - tx_buffer->eop_index = -1; - txr->watchdog_time = ticks; - - if (++first == adapter->num_tx_desc) - first = 0; + ++txr->tx_avail; + buf->eop = NULL; - tx_buffer = &txr->tx_buffers[first]; - tx_desc = - (struct ixgbe_legacy_tx_desc *)&txr->tx_base[first]; } ++txr->packets; + ++processed; ++ifp->if_opackets; - /* See if there is more work now */ - last = tx_buffer->eop_index; - if (last != -1) { - eop_desc = - (struct ixgbe_legacy_tx_desc *)&txr->tx_base[last]; - /* Get next done point */ - if (++last == adapter->num_tx_desc) last = 0; - done = last; - } else - break; - } + txr->watchdog_time = ticks; + + /* Try the next packet */ + ++txd; + ++buf; + ++work; + /* reset with a wrap */ + if (__predict_false(!work)) { + work -= txr->num_desc; + buf = txr->tx_buffers; + txd = txr->tx_base; + } + prefetch(txd); + } while (__predict_true(--limit)); + bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - txr->next_to_clean = first; + work += txr->num_desc; + txr->next_to_clean = work; /* ** Watchdog calculation, we know there's Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Sat Dec 1 00:03:58 2012 (r243735) +++ head/sys/dev/ixgbe/ixgbe.h Sat Dec 1 00:11:24 2012 (r243736) @@ -239,7 +239,7 @@ struct ixgbe_i2c_req { }; struct ixgbe_tx_buf { - u32 eop_index; + union ixgbe_adv_tx_desc *eop; struct mbuf *m_head; bus_dmamap_t map; }; From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 00:56:20 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 0A5D6629; Sat, 1 Dec 2012 00:56:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D6EBF8FC0C; Sat, 1 Dec 2012 00:56:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB10uJ3x091653; Sat, 1 Dec 2012 00:56:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB10uJY2091651; Sat, 1 Dec 2012 00:56:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201212010056.qB10uJY2091651@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 1 Dec 2012 00:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243737 - in head/sys: amd64/pci i386/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 00:56:20 -0000 Author: jkim Date: Sat Dec 1 00:56:19 2012 New Revision: 243737 URL: http://svnweb.freebsd.org/changeset/base/243737 Log: Remove duplicate code. Reduce diff between amd64 and i386. Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- head/sys/amd64/pci/pci_cfgreg.c Sat Dec 1 00:11:24 2012 (r243736) +++ head/sys/amd64/pci/pci_cfgreg.c Sat Dec 1 00:56:19 2012 (r243737) @@ -295,6 +295,13 @@ pcie_cfgregopen(uint64_t base, uint8_t m return (1); } +#define PCIE_VADDR(base, reg, bus, slot, func) \ + ((base) + \ + ((((bus) & 0xff) << 20) | \ + (((slot) & 0x1f) << 15) | \ + (((func) & 0x7) << 12) | \ + ((reg) & 0xfff))) + /* * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h * have a requirement that all accesses to the memory mapped PCI configuration @@ -302,12 +309,6 @@ pcie_cfgregopen(uint64_t base, uint8_t m * Since other vendors do not currently have any contradicting requirements * the AMD access pattern is applied universally. */ -#define PCIE_VADDR(base, reg, bus, slot, func) \ - ((base) + \ - ((((bus) & 0xff) << 20) | \ - (((slot) & 0x1f) << 15) | \ - (((func) & 0x7) << 12) | \ - ((reg) & 0xfff))) static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, Modified: head/sys/i386/pci/pci_cfgreg.c ============================================================================== --- head/sys/i386/pci/pci_cfgreg.c Sat Dec 1 00:11:24 2012 (r243736) +++ head/sys/i386/pci/pci_cfgreg.c Sat Dec 1 00:56:19 2012 (r243737) @@ -610,25 +610,29 @@ pcie_cfgregopen(uint64_t base, uint8_t m } #endif /* !XEN */ -#define PCIE_PADDR(bar, reg, bus, slot, func) \ - ((bar) | \ - (((bus) & 0xff) << 20) | \ +#define PCIE_PADDR(base, reg, bus, slot, func) \ + ((base) + \ + ((((bus) & 0xff) << 20) | \ (((slot) & 0x1f) << 15) | \ (((func) & 0x7) << 12) | \ - ((reg) & 0xfff)) + ((reg) & 0xfff))) -/* - * Find an element in the cache that matches the physical page desired, or - * create a new mapping from the least recently used element. - * A very simple LRU algorithm is used here, does it need to be more - * efficient? - */ -static __inline struct pcie_cfg_elem * -pciereg_findelem(vm_paddr_t papage) +static __inline vm_offset_t +pciereg_findaddr(int bus, unsigned slot, unsigned func, unsigned reg) { struct pcie_cfg_list *pcielist; struct pcie_cfg_elem *elem; + vm_paddr_t pa, papage; + pa = PCIE_PADDR(pcie_base, reg, bus, slot, func); + papage = pa & ~PAGE_MASK; + + /* + * Find an element in the cache that matches the physical page desired, + * or create a new mapping from the least recently used element. + * A very simple LRU algorithm is used here, does it need to be more + * efficient? + */ pcielist = &pcie_list[PCPU_GET(cpuid)]; TAILQ_FOREACH(elem, pcielist, elem) { if (elem->papage == papage) @@ -649,7 +653,7 @@ pciereg_findelem(vm_paddr_t papage) TAILQ_REMOVE(pcielist, elem, elem); TAILQ_INSERT_HEAD(pcielist, elem, elem); } - return (elem); + return (elem->vapage | (pa & PAGE_MASK)); } /* @@ -664,9 +668,7 @@ static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) { - struct pcie_cfg_elem *elem; vm_offset_t va; - vm_paddr_t pa, papage; int data = -1; if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || @@ -674,10 +676,7 @@ pciereg_cfgread(int bus, unsigned slot, return (-1); critical_enter(); - pa = PCIE_PADDR(pcie_base, reg, bus, slot, func); - papage = pa & ~PAGE_MASK; - elem = pciereg_findelem(papage); - va = elem->vapage | (pa & PAGE_MASK); + va = pciereg_findaddr(bus, slot, func, reg); switch (bytes) { case 4: @@ -702,19 +701,14 @@ static void pciereg_cfgwrite(int bus, unsigned slot, unsigned func, unsigned reg, int data, unsigned bytes) { - struct pcie_cfg_elem *elem; vm_offset_t va; - vm_paddr_t pa, papage; if (bus < pcie_minbus || bus > pcie_maxbus || slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCIE_REGMAX) return; critical_enter(); - pa = PCIE_PADDR(pcie_base, reg, bus, slot, func); - papage = pa & ~PAGE_MASK; - elem = pciereg_findelem(papage); - va = elem->vapage | (pa & PAGE_MASK); + va = pciereg_findaddr(bus, slot, func, reg); switch (bytes) { case 4: From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 01:07:51 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 C0BD1A02; Sat, 1 Dec 2012 01:07:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A64E18FC12; Sat, 1 Dec 2012 01:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB117pZ5093745; Sat, 1 Dec 2012 01:07:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB117pv5093741; Sat, 1 Dec 2012 01:07:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212010107.qB117pv5093741@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 Dec 2012 01:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243738 - in stable/9/sys: fs/nfsserver nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:07:51 -0000 Author: rmacklem Date: Sat Dec 1 01:07:51 2012 New Revision: 243738 URL: http://svnweb.freebsd.org/changeset/base/243738 Log: MFC: r241561 Add two new options to the nfssvc(2) syscall that allow processes running as root to suspend/resume execution of the kernel nfsd threads. An earlier version of this patch was tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/9/sys/fs/nfsserver/nfs_nfsdport.c stable/9/sys/nfs/nfs_nfssvc.c stable/9/sys/nfs/nfssvc.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat Dec 1 01:07:51 2012 (r243738) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include NFSDLOCKMUTEX; +NFSV4ROOTLOCKMUTEX; +struct nfsv4lock nfsd_suspend_lock; /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. @@ -221,9 +223,24 @@ nfssvc_program(struct svc_req *rqst, SVC #ifdef MAC mac_cred_associate_nfsd(nd.nd_cred); #endif + /* + * Get a refcnt (shared lock) on nfsd_suspend_lock. + * NFSSVC_SUSPENDNFSD will take an exclusive lock on + * nfsd_suspend_lock to suspend these threads. + * This must be done here, before the check of + * nfsv4root exports by nfsvno_v4rootexport(). + */ + NFSLOCKV4ROOTMUTEX(); + nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); + NFSUNLOCKV4ROOTMUTEX(); + if ((nd.nd_flag & ND_NFSV4) != 0) { nd.nd_repstat = nfsvno_v4rootexport(&nd); if (nd.nd_repstat != 0) { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); @@ -233,6 +250,9 @@ nfssvc_program(struct svc_req *rqst, SVC cacherep = nfs_proc(&nd, rqst->rq_xid, xprt->xp_socket, xprt->xp_sockref, &rp); + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); } else { NFSMGET(nd.nd_mreq); nd.nd_mreq->m_len = 0; Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sat Dec 1 01:07:51 2012 (r243738) @@ -57,6 +57,7 @@ extern struct mount nfsv4root_mnt; extern struct nfsrv_stablefirst nfsrv_stablefirst; extern void (*nfsd_call_servertimer)(void); extern SVCPOOL *nfsrvd_pool; +extern struct nfsv4lock nfsd_suspend_lock; struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; NFSDLOCKMUTEX; struct mtx nfs_cache_mutex; @@ -3104,8 +3105,9 @@ nfssvc_srvcall(struct thread *p, struct struct nfsd_dumplocks *dumplocks; struct nameidata nd; vnode_t vp; - int error = EINVAL; + int error = EINVAL, igotlock; struct proc *procp; + static int suspend_nfsd = 0; if (uap->flag & NFSSVC_PUBLICFH) { NFSBZERO((caddr_t)&nfs_pubfh.nfsrvfh_data, @@ -3184,6 +3186,26 @@ nfssvc_srvcall(struct thread *p, struct nfsd_master_start = procp->p_stats->p_start; nfsd_master_proc = procp; PROC_UNLOCK(procp); + } else if ((uap->flag & NFSSVC_SUSPENDNFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd == 0) { + /* Lock out all nfsd threads */ + do { + igotlock = nfsv4_lock(&nfsd_suspend_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (igotlock == 0 && suspend_nfsd == 0); + suspend_nfsd = 1; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; + } else if ((uap->flag & NFSSVC_RESUMENFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd != 0) { + nfsv4_unlock(&nfsd_suspend_lock, 0); + suspend_nfsd = 0; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; } NFSEXITCODE(error); Modified: stable/9/sys/nfs/nfs_nfssvc.c ============================================================================== --- stable/9/sys/nfs/nfs_nfssvc.c Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/nfs/nfs_nfssvc.c Sat Dec 1 01:07:51 2012 (r243738) @@ -102,7 +102,8 @@ sys_nfssvc(struct thread *td, struct nfs else if ((uap->flag & (NFSSVC_NFSDNFSD | NFSSVC_NFSDADDSOCK | NFSSVC_PUBLICFH | NFSSVC_V4ROOTEXPORT | NFSSVC_NOPUBLICFH | NFSSVC_STABLERESTART | NFSSVC_ADMINREVOKE | - NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE)) && + NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE | + NFSSVC_SUSPENDNFSD | NFSSVC_RESUMENFSD)) && nfsd_call_nfsd != NULL) error = (*nfsd_call_nfsd)(td, uap); if (error == EINTR || error == ERESTART) Modified: stable/9/sys/nfs/nfssvc.h ============================================================================== --- stable/9/sys/nfs/nfssvc.h Sat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/nfs/nfssvc.h Sat Dec 1 01:07:51 2012 (r243738) @@ -66,5 +66,7 @@ #define NFSSVC_BACKUPSTABLE 0x00800000 #define NFSSVC_ZEROCLTSTATS 0x01000000 /* modifier for GETSTATS */ #define NFSSVC_ZEROSRVSTATS 0x02000000 /* modifier for GETSTATS */ +#define NFSSVC_SUSPENDNFSD 0x04000000 +#define NFSSVC_RESUMENFSD 0x08000000 #endif /* _NFS_NFSSVC_H */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 01:12:00 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 94E10B79; Sat, 1 Dec 2012 01:12:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DA0B8FC0C; Sat, 1 Dec 2012 01:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB11C0Q7094521; Sat, 1 Dec 2012 01:12:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB11C0cM094520; Sat, 1 Dec 2012 01:12:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212010112.qB11C0cM094520@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 Dec 2012 01:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243739 - stable/9/usr.sbin/mountd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:12:00 -0000 Author: rmacklem Date: Sat Dec 1 01:11:59 2012 New Revision: 243739 URL: http://svnweb.freebsd.org/changeset/base/243739 Log: MFC: r241568 Add a new '-S' option to mountd, which tells it to suspend execution of the nfsd threads while it is reloading the exports. This avoids clients from getting intermittent access errors when the exports are being reloaded non-atomically. It is not an ideal solution, since requests will back up while the nfsd threads are suspended. Also, when this option is used, if mountd crashes while reloading exports, mountd will have to be restarted to get the nfsd threads to resume execution. This has been tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). The nfse patch offers a more comprehensive solution for this issue. Modified: stable/9/usr.sbin/mountd/mountd.c Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.c ============================================================================== --- stable/9/usr.sbin/mountd/mountd.c Sat Dec 1 01:07:51 2012 (r243738) +++ stable/9/usr.sbin/mountd/mountd.c Sat Dec 1 01:11:59 2012 (r243739) @@ -246,6 +246,7 @@ static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; static int sock_fdpos; +static int suspend_nfsd = 0; int opt_flags; static int have_v6 = 1; @@ -311,7 +312,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnop:r")) != -1) + while ((c = getopt(argc, argv, "2deh:lnop:rS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -363,6 +364,9 @@ main(int argc, char **argv) out_of_mem(); } break; + case 'S': + suspend_nfsd = 1; + break; default: usage(); }; @@ -921,7 +925,7 @@ usage(void) { fprintf(stderr, "usage: mountd [-2] [-d] [-e] [-l] [-n] [-p ] [-r] " - "[-h ] [export_file ...]\n"); + "[-S] [-h ] [export_file ...]\n"); exit(1); } @@ -1660,6 +1664,8 @@ get_exportlist(void) int done; struct nfsex_args eargs; + if (suspend_nfsd != 0) + (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); v4root_dirpath[0] = '\0'; bzero(&export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; @@ -1790,6 +1796,9 @@ get_exportlist(void) */ if (run_v4server > 0 && has_publicfh == 0) (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); + + /* Resume the nfsd. If they weren't suspended, this is harmless. */ + (void)nfssvc(NFSSVC_RESUMENFSD, NULL); } /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 01:16:41 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 44EB7CF2; Sat, 1 Dec 2012 01:16:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27DD08FC08; Sat, 1 Dec 2012 01:16:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB11Gfuj095316; Sat, 1 Dec 2012 01:16:41 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB11GeLS095315; Sat, 1 Dec 2012 01:16:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212010116.qB11GeLS095315@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 Dec 2012 01:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243740 - stable/9/usr.sbin/mountd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:16:41 -0000 Author: rmacklem Date: Sat Dec 1 01:16:40 2012 New Revision: 243740 URL: http://svnweb.freebsd.org/changeset/base/243740 Log: MFC: r241569 Document the -S option added by r241568. Modified: stable/9/usr.sbin/mountd/mountd.8 Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.8 ============================================================================== --- stable/9/usr.sbin/mountd/mountd.8 Sat Dec 1 01:11:59 2012 (r243739) +++ stable/9/usr.sbin/mountd/mountd.8 Sat Dec 1 01:16:40 2012 (r243740) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 23, 2011 +.Dd October 14, 2012 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnor +.Op Fl 2delnorS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -131,6 +131,19 @@ flag. Specify an alternate location for the exports file. More than one exports file can be specified. +.It Fl S +Tell mountd to suspend/resume execution of the nfsd threads whenever +the exports list is being reloaded. +This avoids intermittent access +errors for clients that do NFS RPCs while the exports are being +reloaded, but introduces a delay in RPC response while the reload +is in progress. +If +.Nm +crashes while an exports load is in progress, +.Nm +must be restarted to get the nfsd threads running again, if this +option is used. .El .Pp When From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 01:24:41 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 F137DE98; Sat, 1 Dec 2012 01:24:40 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4BB48FC14; Sat, 1 Dec 2012 01:24:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB11OeJA096414; Sat, 1 Dec 2012 01:24:40 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB11OefS096413; Sat, 1 Dec 2012 01:24:40 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201212010124.qB11OefS096413@svn.freebsd.org> From: Jack F Vogel Date: Sat, 1 Dec 2012 01:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243741 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:24:41 -0000 Author: jfv Date: Sat Dec 1 01:24:40 2012 New Revision: 243741 URL: http://svnweb.freebsd.org/changeset/base/243741 Log: Patch #12 OK, I said there was only 11 patches, but unfortunately the revamped sysctl code did not work, and needed a change. This makes the limit get set at the time that all sysctl stats are created and is actually more elegant imho anyway. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 01:16:40 2012 (r243740) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 01:24:40 2012 (r243741) @@ -163,8 +163,6 @@ static int ixgbe_set_thermal_test(SYSCTL static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); -static void ixgbe_add_process_limit(struct adapter *, const char *, - const char *, u16 *, u16); static int ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static int ixgbe_tso_setup(struct tx_ring *, @@ -3070,11 +3068,6 @@ ixgbe_initialize_transmit_units(struct a u64 tdba = txr->txdma.dma_paddr; u32 txctrl; - /* Sysctl for limiting work done in tx clean */ - ixgbe_add_process_limit(adapter, "tx_processing_limit", - "max number of packets to process", &txr->process_limit, - ixgbe_tx_process_limit); - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba & 0x00000000ffffffffULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); @@ -4119,11 +4112,6 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; - /* Sysctl for limiting work done in rx clean */ - ixgbe_add_process_limit(adapter, "rx_processing_limit", - "max number of packets to process", &rxr->process_limit, - ixgbe_rx_process_limit); - /* Setup the Base and Length of the Rx Descriptor Ring */ IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), (rdba & 0x00000000ffffffffULL)); @@ -5185,6 +5173,23 @@ ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ return 0; } +/** ixgbe_sysctl_tx_process_limit - Handler function + * Set the limit value for TX processing + */ +static int +ixgbe_sysctl_tx_process_limit(SYSCTL_HANDLER_ARGS) +{ + int error; + + struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1); + if (!txr) return 0; + + error = sysctl_handle_int(oidp, &ixgbe_tx_process_limit, 0, req); + if (error || !req->newptr) + return error; + return 0; +} + /** ixgbe_sysctl_rdh_handler - Handler function * Retrieves the RDH value from the hardware */ @@ -5221,6 +5226,23 @@ ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ return 0; } +/** ixgbe_sysctl_rx_process_limit - Handler function + * Set the limit value for RX processing + */ +static int +ixgbe_sysctl_rx_process_limit(SYSCTL_HANDLER_ARGS) +{ + int error; + + struct rx_ring *rxr = ((struct rx_ring *)oidp->oid_arg1); + if (!rxr) return 0; + + error = sysctl_handle_int(oidp, &ixgbe_rx_process_limit, 0, req); + if (error || !req->newptr) + return error; + return 0; +} + static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS) { @@ -5308,6 +5330,10 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "tx_process_limit", + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), + ixgbe_sysctl_tx_process_limit, "IU", + "Transmit Process Limit"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tso_tx", CTLFLAG_RD, &txr->tso_tx, "TSO"); @@ -5343,6 +5369,10 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdt_handler, "IU", "Receive Descriptor Tail"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rx_process_limit", + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), + ixgbe_sysctl_rx_process_limit, "IU", + "Receive Process Limit"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", CTLFLAG_RD, &rxr->rx_packets, "Queue Packets Received"); @@ -5543,16 +5573,6 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) return error; } -static void -ixgbe_add_process_limit(struct adapter *adapter, const char *name, - const char *description, u16 *limit, u16 value) -{ - *limit = value; - SYSCTL_ADD_UINT(device_get_sysctl_ctx(adapter->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_UINT|CTLFLAG_RW, limit, value, description); -} - /* ** Control link advertise speed: ** 1 - advertise only 1G From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 02:02:20 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 54A0F357; Sat, 1 Dec 2012 02:02:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39CD18FC16; Sat, 1 Dec 2012 02:02:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB122KT0001993; Sat, 1 Dec 2012 02:02:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB122K7c001991; Sat, 1 Dec 2012 02:02:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201212010202.qB122K7c001991@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Dec 2012 02:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243742 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 02:02:20 -0000 Author: pfg Date: Sat Dec 1 02:02:19 2012 New Revision: 243742 URL: http://svnweb.freebsd.org/changeset/base/243742 Log: MFC r243562: Update some definitions or make them match NetBSD's headers. Bring several definitions required for newer ext4 features. Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it is not being used yet and the new name is more compatible with NetBSD and Linux. This change is purely cosmetic. Obtained from: NetBSD Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Dec 1 01:24:40 2012 (r243741) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Dec 1 02:02:19 2012 (r243742) @@ -60,8 +60,15 @@ #define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ - -#define EXT2_HTREE 0x00001000 /* HTree-indexed directory */ +#define EXT2_INDEX 0x00001000 /* hash-indexed directory */ +#define EXT2_IMAGIC 0x00002000 /* AFS directory */ +#define EXT2_JOURNAL_DATA 0x00004000 /* file data should be journaled */ +#define EXT2_NOTAIL 0x00008000 /* file tail should not be merged */ +#define EXT2_DIRSYNC 0x00010000 /* dirsync behaviour */ +#define EXT2_TOPDIR 0x00020000 /* Top of directory hierarchies*/ +#define EXT2_HUGE_FILE 0x00040000 /* Set to each huge file */ +#define EXT2_EXTENTS 0x00080000 /* Inode uses extents */ +#define EXT2_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ /* * Definitions for nanosecond timestamps. @@ -95,9 +102,8 @@ struct ext2fs_dinode { uint32_t e2di_facl; /* 104: file ACL (not implemented) */ uint32_t e2di_dacl; /* 108: dir ACL (not implemented) */ uint32_t e2di_faddr; /* 112: fragment address */ - uint8_t e2di_nfrag; /* 116: fragment number */ - uint8_t e2di_fsize; /* 117: fragment size */ - uint16_t e2di_linux_reserved2; /* 118 */ + uint16_t e2di_nblock_high; /* 116: Blocks count bits 47:32 */ + uint16_t e2di_facl_high; /* 118: file ACL bits 47:32 */ uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Dec 1 01:24:40 2012 (r243741) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sat Dec 1 02:02:19 2012 (r243742) @@ -210,15 +210,23 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 -#define EXT2F_COMPAT_HTREE 0x0020 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT4F_ROCOMPAT_HUGE_FILE 0x0008 +#define EXT4F_ROCOMPAT_GDT_CSUM 0x0010 +#define EXT4F_ROCOMPAT_DIR_NLINK 0x0020 #define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040 #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT4F_INCOMPAT_META_BG 0x0010 +#define EXT4F_INCOMPAT_EXTENTS 0x0040 +#define EXT4F_INCOMPAT_64BIT 0x0080 +#define EXT4F_INCOMPAT_MMP 0x0100 +#define EXT4F_INCOMPAT_FLEX_BG 0x0200 /* * Features supported in this implementation From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 03:02: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 40C2E7AB; Sat, 1 Dec 2012 03:02:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id D1DE08FC08; Sat, 1 Dec 2012 03:02:57 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qB132kB2091040; Sat, 1 Dec 2012 05:02:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qB132kB2091040 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qB132kwD091039; Sat, 1 Dec 2012 05:02:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 Dec 2012 05:02:46 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r243726 - in head/sys: kern security/audit Message-ID: <20121201030246.GB3013@kib.kiev.ua> References: <201211302318.qAUNInIh074238@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4zKt6bo/V7G+vDr7" Content-Disposition: inline In-Reply-To: <201211302318.qAUNInIh074238@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 03:02:58 -0000 --4zKt6bo/V7G+vDr7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 30, 2012 at 11:18:49PM +0000, Pawel Jakub Dawidek wrote: > Modified: head/sys/security/audit/audit_bsm_klib.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:13:56 2012 (r2= 43725) > +++ head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:18:49 2012 (r2= 43726) > @@ -462,13 +462,13 @@ auditon_command_event(int cmd) > * leave the filename starting with '/' in the audit log in this case. > */ > void > -audit_canon_path(struct thread *td, char *path, char *cpath) > +audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath) > { > struct vnode *cvnp, *rvnp; > char *rbuf, *fbuf, *copy; > struct filedesc *fdp; > struct sbuf sbf; > - int error, cwir; > + int error, needslash, vfslocked; > =20 > WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d", > __func__, __FILE__, __LINE__); > @@ -491,10 +491,27 @@ audit_canon_path(struct thread *td, char > * path. > */ > if (*path !=3D '/') { > - cvnp =3D fdp->fd_cdir; > - vhold(cvnp); > + if (dirfd =3D=3D AT_FDCWD) { > + cvnp =3D fdp->fd_cdir; > + vhold(cvnp); > + } else { > + /* XXX: fgetvp() that vhold()s vnode instead of vref()ing it would be= better */ This line is too long. > + error =3D fgetvp(td, dirfd, 0, &cvnp); > + if (error) { > + cpath[0] =3D '\0'; > + if (rvnp !=3D NULL) > + vdrop(rvnp); > + return; > + } > + vhold(cvnp); > + vfslocked =3D VFS_LOCK_GIANT(cvnp->v_mount); > + vrele(cvnp); > + VFS_UNLOCK_GIANT(vfslocked); And this cannot compile. --4zKt6bo/V7G+vDr7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQuXNVAAoJEJDCuSvBvK1Bgj8P+gJIDB0T09KV7mb1Nvf0L89j D8AuwntTmYIkFb7LMyMlq268GrZaNAqiXE8kcPTlpI6aCegVHuGv5395fgdRjY+c FG0kenH+nGLezyC5PYVwJXVgLmfIpmcaxWsArP3ukFSi3LiC8FSqmUfv9+/FQpw2 i7hzImg4eH0ogVyNm9iyiKla/niQHIt+wtX3bTpkclf3pW+fS20MBbgboCPN73QQ Cn1JJzlyLj+d5M3rsFaIXGvR8eCvc1mdQixz3BM+VF/iA97AOxGvIMz0AQXP6Gzw qvamP0A+PKSLMNbZda+Hix2XBz05LKKJfTCWwa+zNmmSe10M5Uxt97+g+n2EOV5v eN+N3Ngj5nDObtOwQ8QqBV5Zkl9rO1KIgeBJzGNdw4PyKGzUGauChWL6GINVpT8U MZTPpDVnR8zuutaYD5YLq1CuSUTPnA99QdSmQyNiMqUckHdJGqaqoL5+oPWZyS9g gpeP1NXDuyb/Pj1ltMgdkb+5NJj2Vkj6WAe57+QqpBRrlO+13WotgwO3nXI+sWHY E3tHMIFvmmvQF7duP9SukWf2WDZ3OEnI9wAwYsKPukTNrnMBXZh1qeHdE0dyrEcY 2vX5fCs7XpQwKHey4Szdexh5jiQPFCaPxYzK60Ac4oXpxIedlDA8O4L/HweTHWjM fHD39fNonZcZRj/dLxdI =9wZP -----END PGP SIGNATURE----- --4zKt6bo/V7G+vDr7-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 03:48:11 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 E1F1FDFF; Sat, 1 Dec 2012 03:48:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF198FC08; Sat, 1 Dec 2012 03:48:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB13mB7d017387; Sat, 1 Dec 2012 03:48:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB13mBpZ017385; Sat, 1 Dec 2012 03:48:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212010348.qB13mBpZ017385@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Dec 2012 03:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243743 - in head/sys/dev/ath/ath_hal: . ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 03:48:12 -0000 Author: adrian Date: Sat Dec 1 03:48:11 2012 New Revision: 243743 URL: http://svnweb.freebsd.org/changeset/base/243743 Log: Add a new HAL capability - check and enforce whether the NIC supports enforcing the TXOP and TBTT limits: * Frames which will overlap with TBTT will not TX; * Frames which will exceed TXOP will be filtered. This is not enabled by default; it's intended to be enabled by the TDMA code on 802.11n capable chipsets. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sat Dec 1 02:02:19 2012 (r243742) +++ head/sys/dev/ath/ath_hal/ah.h Sat Dec 1 03:48:11 2012 (r243743) @@ -192,6 +192,7 @@ typedef enum { HAL_CAP_LONG_RXDESC_TSF = 243, /* hardware supports 32bit TSF in RX descriptor */ HAL_CAP_BB_READ_WAR = 244, /* baseband read WAR */ HAL_CAP_SERIALISE_WAR = 245, /* serialise register access on PCI */ + HAL_CAP_ENFORCE_TXOP = 246, /* Enforce TXOP if supported */ } HAL_CAPABILITY_TYPE; /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Dec 1 02:02:19 2012 (r243742) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Dec 1 03:48:11 2012 (r243743) @@ -451,6 +451,10 @@ ar5416GetCapability(struct ath_hal *ah, HAL_OK : HAL_ENOTSUPP; case HAL_CAP_DIVERSITY: /* disable classic fast diversity */ return HAL_ENXIO; + case HAL_CAP_ENFORCE_TXOP: + (*result) = + !! (AH5212(ah)->ah_miscMode & AR_PCU_TXOP_TBTT_LIMIT_ENA); + return (HAL_OK); default: break; } @@ -480,6 +484,19 @@ ar5416SetCapability(struct ath_hal *ah, else pCap->halTxStreams = 1; return AH_TRUE; + case HAL_CAP_ENFORCE_TXOP: + if (setting) { + AH5212(ah)->ah_miscMode + |= AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_SET_BIT(ah, AR_MISC_MODE, + AR_PCU_TXOP_TBTT_LIMIT_ENA); + } else { + AH5212(ah)->ah_miscMode + &= ~AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_CLR_BIT(ah, AR_MISC_MODE, + AR_PCU_TXOP_TBTT_LIMIT_ENA); + } + return AH_TRUE; default: break; } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 08:41: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 1B4FAC29 for ; Sat, 1 Dec 2012 08:41:05 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 98DFF8FC14 for ; Sat, 1 Dec 2012 08:41:04 +0000 (UTC) Received: (qmail 77701 invoked from network); 1 Dec 2012 10:12:01 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Dec 2012 10:12:01 -0000 Message-ID: <50B9C291.4030107@freebsd.org> Date: Sat, 01 Dec 2012 09:40:49 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Jack F Vogel Subject: Re: svn commit: r243714 - in head/sys/dev: ixgbe netmap References: <201211302219.qAUMJIkI065470@svn.freebsd.org> In-Reply-To: <201211302219.qAUMJIkI065470@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 08:41:05 -0000 On 30.11.2012 23:19, Jack F Vogel wrote: > Author: jfv > Date: Fri Nov 30 22:19:18 2012 > New Revision: 243714 > URL: http://svnweb.freebsd.org/changeset/base/243714 > > Log: > First of a series of 11 patches leading to new ixgbe version 2.5.0 > This removes the header split and supporting code from the driver. You did this because the datasheet says the header split feature is not supported and using it gives unpredictable results? -- Andre From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 08:51:40 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 9B12DDA6; Sat, 1 Dec 2012 08:51:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8048F8FC08; Sat, 1 Dec 2012 08:51:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB18peX3067078; Sat, 1 Dec 2012 08:51:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB18pea1067077; Sat, 1 Dec 2012 08:51:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212010851.qB18pea1067077@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 Dec 2012 08:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243745 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 08:51:40 -0000 Author: pjd Date: Sat Dec 1 08:51:40 2012 New Revision: 243745 URL: http://svnweb.freebsd.org/changeset/base/243745 Log: IFp4 @219811: VFS is now fully MPSAFE, fix compilation. Modified: head/sys/security/audit/audit_bsm_klib.c Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Sat Dec 1 05:07:49 2012 (r243744) +++ head/sys/security/audit/audit_bsm_klib.c Sat Dec 1 08:51:40 2012 (r243745) @@ -468,7 +468,7 @@ audit_canon_path(struct thread *td, int char *rbuf, *fbuf, *copy; struct filedesc *fdp; struct sbuf sbf; - int error, needslash, vfslocked; + int error, needslash; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d", __func__, __FILE__, __LINE__); @@ -504,9 +504,7 @@ audit_canon_path(struct thread *td, int return; } vhold(cvnp); - vfslocked = VFS_LOCK_GIANT(cvnp->v_mount); vrele(cvnp); - VFS_UNLOCK_GIANT(vfslocked); } needslash = (fdp->fd_rdir != cvnp); } else { From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 08:53:01 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 F070AEC4; Sat, 1 Dec 2012 08:53:00 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7EB6A8FC14; Sat, 1 Dec 2012 08:52:59 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so591533bkc.13 for ; Sat, 01 Dec 2012 00:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GA5Bj+t0CJ/sU59TOjjJFr0yM5/R9fVjgtHHIaQHufI=; b=Jp58U62652WDMQvLhVLVQYYgVQ4/sEi7L95QvEsuq2StHOEi7TqtwNjKnCINSwOnP9 BVGWK1NcF+B8dl6hi3aw2fN0USBBHC6Ypsg6Tcdhuxc3UmpLtDMqFIzjyHHracFZKF6F STOFoCpNclh6csCP+JBsfElx9SMd4MPv3G6ugxuZ4tz9Y41U3QAEtWHinXi2pH4s3AsT 0+YDK/eZ1iEI4VDR1iYY7a0ul9njYsKpowwZax85O4bgMG/KyimB8A8Mf3vCuwagov0Z BexBU0xz5PTm1yLZFtLFJmlg2XUja1HOwvTMlwadt0r5DKJpmFc/Gi0GAxY0P/yySPfb 6xwA== MIME-Version: 1.0 Received: by 10.204.150.137 with SMTP id y9mr1148240bkv.103.1354351973100; Sat, 01 Dec 2012 00:52:53 -0800 (PST) Received: by 10.204.167.71 with HTTP; Sat, 1 Dec 2012 00:52:52 -0800 (PST) Received: by 10.204.167.71 with HTTP; Sat, 1 Dec 2012 00:52:52 -0800 (PST) In-Reply-To: <20121130144040.99559ed924a48b909cbd3c4b@FreeBSD.org> References: <201211260511.qAQ5B7DQ002346@svn.freebsd.org> <20121128170032.730be5fab68dba2a09aaa14e@FreeBSD.org> <20121128183422.714562856f27371c95d2a84e@FreeBSD.org> <20121129073846.GG97474@ithaqua.etoilebsd.net> <20121130144040.99559ed924a48b909cbd3c4b@FreeBSD.org> Date: Sat, 1 Dec 2012 08:52:52 +0000 Message-ID: Subject: Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version From: Chris Rees To: Stanislav Sedov Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Baptiste Daroussin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 08:53:01 -0000 On 30 Nov 2012 22:41, "Stanislav Sedov" wrote: > > On Thu, 29 Nov 2012 08:38:47 +0100 > Baptiste Daroussin mentioned: > > > > > pkg is no more experimental at all, it is not perfect there are large rooms for > > improvements, but it is perfectly ready to be used, if you have any concern > > about some missing "feature" just report it; > > > > Concerning a landmine, when you have big flashy lights all over the place: > > http://lists.freebsd.org/pipermail/freebsd-ports-announce/2012-October/000032.html > > http://lists.freebsd.org/pipermail/freebsd-current/2012-October/037001.html > > a fanfare playing in front of it saying beware landsmine: > > http://svnweb.freebsd.org/ports?view=revision&revision=305637 > > and maps available all over the places to explains where the mine are how to > > workaround them, or be mine proof: > > http://svnweb.freebsd.org/ports/head/CHANGES (entry 20121010) > > http://svnweb.freebsd.org/ports/head/UPDATING (entry 20121010) > > > > I'd say in that case it is no more considered as a landmine but just a new safe > > way. > > It is a new way forced on users. I didn't ask to use pkgng on my system, neither > I got any warning when it silently stopped creating entries in /var/db/pkg. Do > you expect all users to read UPDATING and/or svn commit logs each time they update? UPDATING, yes. Also as I reminded you in IRC last week, users of -CURRENT are expected to follow -current@. Users of ports are also strongly recommended to read -ports-announce. > Switching to pkgng was not a community descision, it was a decision made by a small > group of people (alledgedly, considering input from the community). Personally, > I don't see why it should be that way, and why the default had to be forceably > changed. It is an open question (at least for me) whether pkgng is any better > than the old tools, and there is at least on drawback in using pkgng, namely sqlite > database, which will make you lose all packages in the case of a small fs corruption. > That problem was raised before numerous times starting when developing a new pkg > tool was proposed. But it is a design decision, and I respect it. What I don't > like is that the switch to the new pkg system lacks any legitemacy, as it was largely > a portmgr descision. If instead you ran it alongside for some time and it ended up > being used by majority of users compared to the legacy pkg, and then pulled the switch, > then it'd a different story. > > The bottom line is that I ended up with a corrupted pkg database for no particular > reason. And it didn't have to be that way. What are you trying to achieve here? You discussed this previously, and got exactly the same answer. There were extensive discussions over it in ports@. You got burned because you weren't paying attention. Get over it. Chris From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 08:59:36 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 AC35B9F; Sat, 1 Dec 2012 08:59:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 917748FC08; Sat, 1 Dec 2012 08:59:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB18xaww068491; Sat, 1 Dec 2012 08:59:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB18xa9u068490; Sat, 1 Dec 2012 08:59:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212010859.qB18xa9u068490@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 Dec 2012 08:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243746 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 08:59:36 -0000 Author: pjd Date: Sat Dec 1 08:59:36 2012 New Revision: 243746 URL: http://svnweb.freebsd.org/changeset/base/243746 Log: Fix one more compilation issue. Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Dec 1 08:51:40 2012 (r243745) +++ head/sys/kern/vfs_lookup.c Sat Dec 1 08:59:36 2012 (r243746) @@ -211,9 +211,9 @@ namei(struct nameidata *ndp) * If we are auditing the kernel pathname, save the user pathname. */ if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_UPATH1(td, ndp->ni_dirfd, , cnp->cn_pnbuf); + AUDIT_ARG_UPATH1(td, ndp->ni_dirfd, cnp->cn_pnbuf); if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_UPATH2(td, ndp->ni_dirfd, , cnp->cn_pnbuf); + AUDIT_ARG_UPATH2(td, ndp->ni_dirfd, cnp->cn_pnbuf); dp = NULL; if (cnp->cn_pnbuf[0] != '/') { From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 09:48:50 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 DCDBD79C; Sat, 1 Dec 2012 09:48:49 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5EB8FC12; Sat, 1 Dec 2012 09:48:48 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so341835vba.13 for ; Sat, 01 Dec 2012 01:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=G9nGLg49LDLGywuvstQ3FyFLWnGKxTxh/11NsbXme60=; b=eQHleEJIee+D8aAKXu+mndg2rApm5kqAVDuI71X7gFJlSgXYCc1ZpwL371gCaI/U8M d65Kht6CUIrIVdOlDPkmWnXHX5ZWY5tRfd0tTJ8CqU+cZMI78WV+4E0xf0s3ToduxEpS 08JKGfNdE27GFCc0otfrWzncFvYAbl4OBR27oPikIeAl0KMY8UR0jp9ycExYR2uR664y ye2/PPZ8ZgzJatUxTNRBzRKfCZntf5nAp7jaWD4Mhz2Lim/5T4FZXOPo8tR7k/G1sEKz aBvi7nWGEwyJR5ycF4LG+8fqZhPVpeoeVxnWJU70C4yJq+JFlGs0Po69tRkljBjxtLne 85ZQ== MIME-Version: 1.0 Received: by 10.220.153.201 with SMTP id l9mr3373949vcw.33.1354355322134; Sat, 01 Dec 2012 01:48:42 -0800 (PST) Received: by 10.220.50.6 with HTTP; Sat, 1 Dec 2012 01:48:41 -0800 (PST) In-Reply-To: <50B9C291.4030107@freebsd.org> References: <201211302219.qAUMJIkI065470@svn.freebsd.org> <50B9C291.4030107@freebsd.org> Date: Sat, 1 Dec 2012 01:48:41 -0800 Message-ID: Subject: Re: svn commit: r243714 - in head/sys/dev: ixgbe netmap From: Jack Vogel To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 09:48:50 -0000 On Sat, Dec 1, 2012 at 12:40 AM, Andre Oppermann wrote: > On 30.11.2012 23:19, Jack F Vogel wrote: > >> Author: jfv >> Date: Fri Nov 30 22:19:18 2012 >> New Revision: 243714 >> URL: http://svnweb.freebsd.org/**changeset/base/243714 >> >> Log: >> First of a series of 11 patches leading to new ixgbe version 2.5.0 >> This removes the header split and supporting code from the driver. >> > > You did this because the datasheet says the header split feature is > not supported and using it gives unpredictable results? > I'm not sure what the datasheet says, but yes there is a hardware issue on some of the 10G adapters if using header split. I have left the code in in a disabled state for a long time, thinking it would be there as example code, but I think it best to remove it and simplify the code at this point. Oh, and yes, results have always been mixed with the feature in my experience anyway. Regards, Jack From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 10:23:16 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 EC583A85 for ; Sat, 1 Dec 2012 10:23:16 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 493EF8FC16 for ; Sat, 1 Dec 2012 10:23:15 +0000 (UTC) Received: (qmail 78104 invoked from network); 1 Dec 2012 11:54:11 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Dec 2012 11:54:11 -0000 Message-ID: <50B9DA84.8070701@freebsd.org> Date: Sat, 01 Dec 2012 11:23:00 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Jack Vogel Subject: Re: svn commit: r243714 - in head/sys/dev: ixgbe netmap References: <201211302219.qAUMJIkI065470@svn.freebsd.org> <50B9C291.4030107@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 10:23:17 -0000 On 01.12.2012 10:48, Jack Vogel wrote: > > > On Sat, Dec 1, 2012 at 12:40 AM, Andre Oppermann > wrote: > > On 30.11.2012 23:19, Jack F Vogel wrote: > > Author: jfv > Date: Fri Nov 30 22:19:18 2012 > New Revision: 243714 > URL: http://svnweb.freebsd.org/__changeset/base/243714 > > > Log: > First of a series of 11 patches leading to new ixgbe version 2.5.0 > This removes the header split and supporting code from the driver. > > > You did this because the datasheet says the header split feature is > not supported and using it gives unpredictable results? > > > I'm not sure what the datasheet says, but yes there is a hardware issue > on some of the 10G adapters if using header split. I have left the code in > in a disabled state for a long time, thinking it would be there as example > code, but I think it best to remove it and simplify the code at this point. It says so in section 7.1.10 Header Splitting: Note: Header Splitting mode might cause unpredictable behavior and should not be used with the 82599. For more information, see the product specification update errata on this subject. > Oh, and yes, results have always been mixed with the feature in my > experience anyway. I can imagine. Considering how we work with the packet through the stack and in the socket buffers there isn't much benefit from header splitting. -- Andre From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 11:03:19 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 EE8EEDC5; Sat, 1 Dec 2012 11:03:19 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B89348FC12; Sat, 1 Dec 2012 11:03:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1B3JR5092929; Sat, 1 Dec 2012 11:03:19 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1B3JdA092928; Sat, 1 Dec 2012 11:03:19 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201212011103.qB1B3JdA092928@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 1 Dec 2012 11:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243747 - stable/9/contrib/sendmail/src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 11:03:20 -0000 Author: ume Date: Sat Dec 1 11:03:19 2012 New Revision: 243747 URL: http://svnweb.freebsd.org/changeset/base/243747 Log: MFC r243649: cyrus-sasl 2.1.26 was released. In this version, the type of callback functions was changed from "unsigned long" to "size_t". Modified: stable/9/contrib/sendmail/src/sasl.c Directory Properties: stable/9/contrib/sendmail/ (props changed) Modified: stable/9/contrib/sendmail/src/sasl.c ============================================================================== --- stable/9/contrib/sendmail/src/sasl.c Sat Dec 1 08:59:36 2012 (r243746) +++ stable/9/contrib/sendmail/src/sasl.c Sat Dec 1 11:03:19 2012 (r243747) @@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08 ** using unsigned long: for portability, it should be size_t. */ -void *sm_sasl_malloc __P((unsigned long)); -static void *sm_sasl_calloc __P((unsigned long, unsigned long)); -static void *sm_sasl_realloc __P((void *, unsigned long)); +#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a +#define SM_SASL_SIZE_T size_t +#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ +#define SM_SASL_SIZE_T unsigned long +#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ + +void *sm_sasl_malloc __P((SM_SASL_SIZE_T)); +static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T)); +static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T)); void sm_sasl_free __P((void *)); /* @@ -50,7 +56,7 @@ void sm_sasl_free __P((void *)); void * sm_sasl_malloc(size) - unsigned long size; + SM_SASL_SIZE_T size; { return sm_malloc((size_t) size); } @@ -71,8 +77,8 @@ sm_sasl_malloc(size) static void * sm_sasl_calloc(nelem, elemsize) - unsigned long nelem; - unsigned long elemsize; + SM_SASL_SIZE_T nelem; + SM_SASL_SIZE_T elemsize; { size_t size; void *p; @@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize) static void * sm_sasl_realloc(o, size) void *o; - unsigned long size; + SM_SASL_SIZE_T size; { return sm_realloc(o, (size_t) size); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 11:08:47 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 6540AF39; Sat, 1 Dec 2012 11:08:47 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F5AC8FC16; Sat, 1 Dec 2012 11:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1B8l0R094185; Sat, 1 Dec 2012 11:08:47 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1B8lLJ094184; Sat, 1 Dec 2012 11:08:47 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201212011108.qB1B8lLJ094184@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 1 Dec 2012 11:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243748 - stable/8/contrib/sendmail/src X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 11:08:47 -0000 Author: ume Date: Sat Dec 1 11:08:46 2012 New Revision: 243748 URL: http://svnweb.freebsd.org/changeset/base/243748 Log: MFC r243649: cyrus-sasl 2.1.26 was released. In this version, the type of callback functions was changed from "unsigned long" to "size_t". Modified: stable/8/contrib/sendmail/src/sasl.c Directory Properties: stable/8/contrib/sendmail/ (props changed) Modified: stable/8/contrib/sendmail/src/sasl.c ============================================================================== --- stable/8/contrib/sendmail/src/sasl.c Sat Dec 1 11:03:19 2012 (r243747) +++ stable/8/contrib/sendmail/src/sasl.c Sat Dec 1 11:08:46 2012 (r243748) @@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08 ** using unsigned long: for portability, it should be size_t. */ -void *sm_sasl_malloc __P((unsigned long)); -static void *sm_sasl_calloc __P((unsigned long, unsigned long)); -static void *sm_sasl_realloc __P((void *, unsigned long)); +#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a +#define SM_SASL_SIZE_T size_t +#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ +#define SM_SASL_SIZE_T unsigned long +#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ + +void *sm_sasl_malloc __P((SM_SASL_SIZE_T)); +static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T)); +static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T)); void sm_sasl_free __P((void *)); /* @@ -50,7 +56,7 @@ void sm_sasl_free __P((void *)); void * sm_sasl_malloc(size) - unsigned long size; + SM_SASL_SIZE_T size; { return sm_malloc((size_t) size); } @@ -71,8 +77,8 @@ sm_sasl_malloc(size) static void * sm_sasl_calloc(nelem, elemsize) - unsigned long nelem; - unsigned long elemsize; + SM_SASL_SIZE_T nelem; + SM_SASL_SIZE_T elemsize; { size_t size; void *p; @@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize) static void * sm_sasl_realloc(o, size) void *o; - unsigned long size; + SM_SASL_SIZE_T size; { return sm_realloc(o, (size_t) size); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 11:12:04 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 E8FB4D8; Sat, 1 Dec 2012 11:12:04 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B51118FC1A; Sat, 1 Dec 2012 11:12:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1BC4m2095099; Sat, 1 Dec 2012 11:12:04 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1BC4VZ095098; Sat, 1 Dec 2012 11:12:04 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201212011112.qB1BC4VZ095098@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 1 Dec 2012 11:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243749 - stable/7/contrib/sendmail/src X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 11:12:05 -0000 Author: ume Date: Sat Dec 1 11:12:04 2012 New Revision: 243749 URL: http://svnweb.freebsd.org/changeset/base/243749 Log: MFC r243649: cyrus-sasl 2.1.26 was released. In this version, the type of callback functions was changed from "unsigned long" to "size_t". Modified: stable/7/contrib/sendmail/src/sasl.c Directory Properties: stable/7/contrib/sendmail/ (props changed) Modified: stable/7/contrib/sendmail/src/sasl.c ============================================================================== --- stable/7/contrib/sendmail/src/sasl.c Sat Dec 1 11:08:46 2012 (r243748) +++ stable/7/contrib/sendmail/src/sasl.c Sat Dec 1 11:12:04 2012 (r243749) @@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08 ** using unsigned long: for portability, it should be size_t. */ -void *sm_sasl_malloc __P((unsigned long)); -static void *sm_sasl_calloc __P((unsigned long, unsigned long)); -static void *sm_sasl_realloc __P((void *, unsigned long)); +#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a +#define SM_SASL_SIZE_T size_t +#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ +#define SM_SASL_SIZE_T unsigned long +#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */ + +void *sm_sasl_malloc __P((SM_SASL_SIZE_T)); +static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T)); +static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T)); void sm_sasl_free __P((void *)); /* @@ -50,7 +56,7 @@ void sm_sasl_free __P((void *)); void * sm_sasl_malloc(size) - unsigned long size; + SM_SASL_SIZE_T size; { return sm_malloc((size_t) size); } @@ -71,8 +77,8 @@ sm_sasl_malloc(size) static void * sm_sasl_calloc(nelem, elemsize) - unsigned long nelem; - unsigned long elemsize; + SM_SASL_SIZE_T nelem; + SM_SASL_SIZE_T elemsize; { size_t size; void *p; @@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize) static void * sm_sasl_realloc(o, size) void *o; - unsigned long size; + SM_SASL_SIZE_T size; { return sm_realloc(o, (size_t) size); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 11:58: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 F327D35B; Sat, 1 Dec 2012 11:58:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D40D18FC08; Sat, 1 Dec 2012 11:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1Bw8h4003623; Sat, 1 Dec 2012 11:58:08 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1Bw8Uo003611; Sat, 1 Dec 2012 11:58:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212011158.qB1Bw8Uo003611@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Dec 2012 11:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243750 - in head/contrib/openbsm: . bin bin/audit bin/auditd bin/auditdistd bin/auditfilterd bin/auditreduce bin/praudit bsm compat config etc libauditd libbsm m4 man modules modules/a... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 11:58:09 -0000 Author: rwatson Date: Sat Dec 1 11:58:08 2012 New Revision: 243750 URL: http://svnweb.freebsd.org/changeset/base/243750 Log: Merge OpenBSM 1.2-alpha2 from vendor branch to FreeBSD 10-CURRENT; the primary new feature is auditdistd. Obtained from: TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Added: head/contrib/openbsm/bin/auditdistd/ - copied from r243735, vendor/openbsm/dist/bin/auditdistd/ head/contrib/openbsm/compat/closefrom.h - copied unchanged from r243735, vendor/openbsm/dist/compat/closefrom.h head/contrib/openbsm/compat/compat.h - copied unchanged from r243735, vendor/openbsm/dist/compat/compat.h head/contrib/openbsm/compat/endian_enc.h - copied unchanged from r243735, vendor/openbsm/dist/compat/endian_enc.h head/contrib/openbsm/compat/flopen.h - copied unchanged from r243735, vendor/openbsm/dist/compat/flopen.h head/contrib/openbsm/compat/pidfile.h - copied unchanged from r243735, vendor/openbsm/dist/compat/pidfile.h head/contrib/openbsm/compat/vis.h - copied unchanged from r243735, vendor/openbsm/dist/compat/vis.h head/contrib/openbsm/config/ylwrap - copied unchanged from r243735, vendor/openbsm/dist/config/ylwrap head/contrib/openbsm/m4/ - copied from r243735, vendor/openbsm/dist/m4/ Modified: head/contrib/openbsm/CREDITS head/contrib/openbsm/INSTALL head/contrib/openbsm/LICENSE head/contrib/openbsm/Makefile.am head/contrib/openbsm/Makefile.in head/contrib/openbsm/NEWS head/contrib/openbsm/README head/contrib/openbsm/TODO head/contrib/openbsm/VERSION head/contrib/openbsm/aclocal.m4 head/contrib/openbsm/autogen.sh head/contrib/openbsm/bin/Makefile.am head/contrib/openbsm/bin/Makefile.in head/contrib/openbsm/bin/audit/Makefile.am head/contrib/openbsm/bin/audit/Makefile.in head/contrib/openbsm/bin/audit/audit.8 head/contrib/openbsm/bin/auditd/Makefile.am head/contrib/openbsm/bin/auditd/Makefile.in head/contrib/openbsm/bin/auditd/auditd.8 head/contrib/openbsm/bin/auditd/auditd.c head/contrib/openbsm/bin/auditfilterd/Makefile.am head/contrib/openbsm/bin/auditfilterd/Makefile.in head/contrib/openbsm/bin/auditreduce/Makefile.am head/contrib/openbsm/bin/auditreduce/Makefile.in head/contrib/openbsm/bin/auditreduce/auditreduce.1 head/contrib/openbsm/bin/praudit/Makefile.am head/contrib/openbsm/bin/praudit/Makefile.in head/contrib/openbsm/bin/praudit/praudit.1 head/contrib/openbsm/bin/praudit/praudit.c head/contrib/openbsm/bsm/Makefile.am head/contrib/openbsm/bsm/Makefile.in head/contrib/openbsm/bsm/auditd_lib.h head/contrib/openbsm/bsm/libbsm.h head/contrib/openbsm/compat/endian.h head/contrib/openbsm/config/config.h head/contrib/openbsm/config/config.h.in head/contrib/openbsm/config/ltmain.sh head/contrib/openbsm/configure head/contrib/openbsm/configure.ac head/contrib/openbsm/etc/audit_control head/contrib/openbsm/etc/audit_event head/contrib/openbsm/libauditd/Makefile.am head/contrib/openbsm/libauditd/Makefile.in head/contrib/openbsm/libauditd/auditd_lib.c head/contrib/openbsm/libbsm/Makefile.am head/contrib/openbsm/libbsm/Makefile.in head/contrib/openbsm/libbsm/au_control.3 head/contrib/openbsm/libbsm/au_fcntl_cmd.3 head/contrib/openbsm/libbsm/au_io.3 head/contrib/openbsm/libbsm/audit_submit.3 head/contrib/openbsm/libbsm/bsm_audit.c head/contrib/openbsm/libbsm/bsm_class.c head/contrib/openbsm/libbsm/bsm_control.c head/contrib/openbsm/libbsm/bsm_errno.c head/contrib/openbsm/libbsm/bsm_io.c head/contrib/openbsm/libbsm/bsm_token.c head/contrib/openbsm/libbsm/bsm_user.c head/contrib/openbsm/libbsm/bsm_wrappers.c head/contrib/openbsm/man/Makefile.am head/contrib/openbsm/man/Makefile.in head/contrib/openbsm/man/audit.log.5 head/contrib/openbsm/man/audit_control.5 head/contrib/openbsm/man/auditon.2 head/contrib/openbsm/man/getaudit.2 head/contrib/openbsm/man/setaudit.2 head/contrib/openbsm/modules/Makefile.am head/contrib/openbsm/modules/Makefile.in head/contrib/openbsm/modules/auditfilter_noop/Makefile.am head/contrib/openbsm/modules/auditfilter_noop/Makefile.in head/contrib/openbsm/sys/Makefile.am head/contrib/openbsm/sys/Makefile.in head/contrib/openbsm/sys/bsm/Makefile.am head/contrib/openbsm/sys/bsm/Makefile.in head/contrib/openbsm/sys/bsm/audit_errno.h head/contrib/openbsm/sys/bsm/audit_internal.h head/contrib/openbsm/sys/bsm/audit_kevents.h head/contrib/openbsm/test/Makefile.am head/contrib/openbsm/test/Makefile.in head/contrib/openbsm/test/bsm/Makefile.am head/contrib/openbsm/test/bsm/Makefile.in head/contrib/openbsm/tools/Makefile.am head/contrib/openbsm/tools/Makefile.in Directory Properties: head/contrib/openbsm/ (props changed) Modified: head/contrib/openbsm/CREDITS ============================================================================== --- head/contrib/openbsm/CREDITS Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/CREDITS Sat Dec 1 11:58:08 2012 (r243750) @@ -29,6 +29,12 @@ the development of OpenBSM: Stacey Son Todd Heberlein Gary Hoo + Dave Bertouille + Jonathan Anderson + Pawel Jakub Dawidek + Joel Dahl + Ryan Steinmetz + The FreeBSD Foundation In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel Software's FlexeLint tool were used to identify a number of bugs in the Modified: head/contrib/openbsm/INSTALL ============================================================================== --- head/contrib/openbsm/INSTALL Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/INSTALL Sat Dec 1 11:58:08 2012 (r243750) @@ -14,6 +14,12 @@ force the compile to fail if a warning i CFLAGS="-Wall -Werror" ./configure +On Linux systems, OpenSSL headers may have to be installed to support +encryption of on-the-wire audit streams using auditdistd; the following +appears to work on Ubuntu: + + sudo apt-get install libssl-dev + To install the library, binaries, and man pages, use: make install Modified: head/contrib/openbsm/LICENSE ============================================================================== --- head/contrib/openbsm/LICENSE Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/LICENSE Sat Dec 1 11:58:08 2012 (r243750) @@ -2,34 +2,37 @@ OpenBSM Copyrights and Licensing OpenBSM is covered by a number of copyrights, with licenses being either two or three clause BSD licenses. Individual file headers should be consulted -for specific copyrights on specific components. The TrustedBSD Project would -appreciate the contribution of fixes and enhancements under identical or -substantially similar licenses: - - * Copyright (c) - * 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. +for copyrights on specific elements of the distribution. -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#5 $ +The following copyright and license are asserted over the OpenBSM distribution +as a whole: + + Copyright (c) 2005-2012 Robert N.M. Watson + 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. + +The TrustedBSD Project would appreciate the contribution of fixes and +enhancements under an identical license in order to avoid potentially +confusing license proliferation. + +$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: head/contrib/openbsm/Makefile.am ============================================================================== --- head/contrib/openbsm/Makefile.am Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/Makefile.am Sat Dec 1 11:58:08 2012 (r243750) @@ -1,6 +1,6 @@ -# -# $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#4 $ -# +## +## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ +## SUBDIRS = \ bsm @@ -17,6 +17,7 @@ SUBDIRS += \ modules \ sys +ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ CHANGELOG \ Modified: head/contrib/openbsm/Makefile.in ============================================================================== --- head/contrib/openbsm/Makefile.in Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/Makefile.in Sat Dec 1 11:58:08 2012 (r243750) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,14 +13,28 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - -# -# $P4: //depot/projects/trustedbsd/openbsm/Makefile.in#10 $ -# VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -40,10 +54,14 @@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/config/config.h.in \ - $(top_srcdir)/configure INSTALL NEWS TODO config/config.guess \ - config/config.sub config/depcomp config/install-sh \ - config/ltmain.sh config/missing + $(srcdir)/Makefile.in $(top_srcdir)/config/config.guess \ + $(top_srcdir)/config/config.h.in \ + $(top_srcdir)/config/config.sub \ + $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ + $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ + NEWS TODO config/config.guess config/config.sub config/depcomp \ + config/install-sh config/ltmain.sh config/missing \ + config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -53,6 +71,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -62,21 +81,61 @@ RECURSIVE_TARGETS = all-recursive check- install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + cscope distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = bsm libauditd libbsm bin man modules sys DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -90,45 +149,52 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MIG = @MIG@ MKDIR_P = @MKDIR_P@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ @@ -137,13 +203,15 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -190,6 +258,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = bsm $(am__append_1) libbsm bin man modules sys +ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ CHANGELOG \ LICENSE \ @@ -200,21 +269,21 @@ EXTRA_DIST = \ all: all-recursive .SUFFIXES: -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -230,21 +299,20 @@ $(top_builddir)/config.status: $(top_src $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): config/config.h: config/stamp-h1 - @if test ! -f $@; then \ - rm -f config/stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f config/stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; else :; fi config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status @rm -f config/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config/config.h $(top_srcdir)/config/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f config/stamp-h1 touch $@ @@ -258,16 +326,16 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool + -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -276,7 +344,11 @@ $(RECURSIVE_TARGETS): done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -284,50 +356,23 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -335,14 +380,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -354,7 +399,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -363,36 +408,65 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) + +clean-cscope: + -rm -f cscope.files + +cscope.files: clean-cscope cscopelist-recursive cscopelist + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -408,66 +482,84 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -475,26 +567,31 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -515,14 +612,24 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -553,16 +660,22 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -583,6 +696,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -591,18 +706,28 @@ install-data-am: install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -625,24 +750,27 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am + all all-am am--refresh check check-am clean clean-cscope \ + clean-generic clean-libtool cscope cscopelist \ + cscopelist-recursive ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: head/contrib/openbsm/NEWS ============================================================================== --- head/contrib/openbsm/NEWS Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/NEWS Sat Dec 1 11:58:08 2012 (r243750) @@ -1,5 +1,30 @@ OpenBSM Version History +OpenBSM 1.2 alpha 2 + +- auditdistd, a distributed audit trail management daemon, has now been + merged. This allows trail files to be securely and reliably synced from + audited hosts to an audit server, and employs TLS encryption. Where + available, it uses Capsicum to sandbox the service. This work was + contributed by Pawel Jakub Dawidek under sponsorship from the FreeBSD + Foundation. + +OpenBSM 1.2 alpha 1 + +- Add Capsicum-related error numbers for FreeBSD: ENOTCAPABLE, ECAPMODE. +- Add Capsicum, process descriptor audit events for FreeBSD. +- Allow 0% minspace. +- Fixes from the clang static analyser. +- Fix expiration of trail files when the host parameter is used. +- Various typo fixes. +- Support for Solaris privilege and privilege set tokens. +- Documentation for getachost(), improvements for getacfilesz(). +- Fix a directory descriptor leak that happened when audit trail partitions + filled. +- Support for more Linux distributions with a partial contemporary endian.h. +- Improved escaping of XML-encapsulated BSM. +- A variety of minor documentation, style, and functional. + OpenBSM 1.1p2 - Fix audit_event definitions of AUE_OPENAT_RWT and AUE_OPENAT_RWTC. @@ -464,4 +489,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#43 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#53 $ Modified: head/contrib/openbsm/README ============================================================================== --- head/contrib/openbsm/README Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/README Sat Dec 1 11:58:08 2012 (r243750) @@ -1,4 +1,4 @@ -OpenBSM 1.1p2 +OpenBSM 1.2a2 Introduction @@ -38,6 +38,7 @@ The following programs are included with audit Command line audit control tool auditd Audit management daemon + auditdistd Audit trail distribution daemon auditfilterd Experimental event monitoring framework auditreduce Audit trail reduction tool audump Debugging tool to parse and print audit databases @@ -64,4 +65,4 @@ Information on TrustedBSD may be found o http://www.TrustedBSD.org/ -$P4: //depot/projects/trustedbsd/openbsm/README#37 $ +$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: head/contrib/openbsm/TODO ============================================================================== --- head/contrib/openbsm/TODO Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/TODO Sat Dec 1 11:58:08 2012 (r243750) @@ -21,5 +21,7 @@ OpenBSM TODO alternative locations can be used. - NLS support for au_strerror(3), which provides error strings for BSM errors not available on the local OS platform. +- Support for client certificates in auditdistd, to include certificate chain + validation. -$P4: //depot/projects/trustedbsd/openbsm/TODO#13 $ +$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: head/contrib/openbsm/VERSION ============================================================================== --- head/contrib/openbsm/VERSION Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/VERSION Sat Dec 1 11:58:08 2012 (r243750) @@ -1 +1 @@ -OPENBSM_1_1p2 +OPENBSM_1_2alpha2 Modified: head/contrib/openbsm/aclocal.m4 ============================================================================== --- head/contrib/openbsm/aclocal.m4 Sat Dec 1 11:12:04 2012 (r243749) +++ head/contrib/openbsm/aclocal.m4 Sat Dec 1 11:58:08 2012 (r243750) @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.12.2 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,108 +13,206 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.62],, -[m4_warning([this file was generated for autoconf 2.62. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 13:46:38 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 24E888F0; Sat, 1 Dec 2012 13:46:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09F9B8FC08; Sat, 1 Dec 2012 13:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1DkbNw024451; Sat, 1 Dec 2012 13:46:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1Dkb8v024446; Sat, 1 Dec 2012 13:46:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212011346.qB1Dkb8v024446@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Dec 2012 13:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243751 - in head/sys: bsm security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 13:46:38 -0000 Author: rwatson Date: Sat Dec 1 13:46:37 2012 New Revision: 243751 URL: http://svnweb.freebsd.org/changeset/base/243751 Log: Merge OpenBSM 1.2-alpha2 changes from contrib/openbsm to src/sys/{bsm,security/audit}. There are a few tweaks to help with the FreeBSD build environment that will be merged back to OpenBSM. No significant functional changes appear on the kernel side. Obtained from: TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Modified: head/sys/bsm/audit_errno.h head/sys/bsm/audit_internal.h head/sys/bsm/audit_record.h head/sys/security/audit/audit_bsm_errno.c head/sys/security/audit/audit_bsm_token.c Modified: head/sys/bsm/audit_errno.h ============================================================================== --- head/sys/bsm/audit_errno.h Sat Dec 1 11:58:08 2012 (r243750) +++ head/sys/bsm/audit_errno.h Sat Dec 1 13:46:37 2012 (r243751) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#5 + * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#7 * $FreeBSD$ */ Modified: head/sys/bsm/audit_internal.h ============================================================================== --- head/sys/bsm/audit_internal.h Sat Dec 1 11:58:08 2012 (r243750) +++ head/sys/bsm/audit_internal.h Sat Dec 1 13:46:37 2012 (r243751) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -30,7 +30,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#5 + * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#6 * $FreeBSD$ */ Modified: head/sys/bsm/audit_record.h ============================================================================== --- head/sys/bsm/audit_record.h Sat Dec 1 11:58:08 2012 (r243750) +++ head/sys/bsm/audit_record.h Sat Dec 1 13:46:37 2012 (r243751) @@ -234,6 +234,7 @@ token_t *au_to_ipc_perm(struct ipc_perm token_t *au_to_iport(uint16_t iport); token_t *au_to_opaque(const char *data, uint16_t bytes); token_t *au_to_path(const char *path); +token_t *au_to_privset(char *privtypestr, char *privstr); token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid); token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, @@ -279,6 +280,7 @@ token_t *au_to_exec_env(char **envp); token_t *au_to_text(const char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); +token_t *au_to_upriv(char sorf, char *priv); token_t *au_to_zonename(const char *zonename); /* Modified: head/sys/security/audit/audit_bsm_errno.c ============================================================================== --- head/sys/security/audit/audit_bsm_errno.c Sat Dec 1 11:58:08 2012 (r243750) +++ head/sys/security/audit/audit_bsm_errno.c Sat Dec 1 13:46:37 2012 (r243751) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#18 + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22 */ #include @@ -494,7 +494,7 @@ static const struct bsm_errno bsm_errnos #ifdef EPROCUNAVAIL EPROCUNAVAIL, #else - ERRNO_NO_LOCAL_MAPPING + ERRNO_NO_LOCAL_MAPPING, #endif ES("Bad procedure for program") }, { BSM_ERRNO_EFTYPE, @@ -666,7 +666,7 @@ static const struct bsm_errno bsm_errnos #endif ES("Required key not available") }, { BSM_ERRNO_EKEYEXPIRED, -#ifdef EKEEXPIRED +#ifdef EKEYEXPIRED EKEYEXPIRED, #else ERRNO_NO_LOCAL_MAPPING, @@ -680,7 +680,7 @@ static const struct bsm_errno bsm_errnos #endif ES("Key has been revoked") }, { BSM_ERRNO_EKEYREJECTED, -#ifdef EKEREJECTED +#ifdef EKEYREJECTED EKEYREJECTED, #else ERRNO_NO_LOCAL_MAPPING, Modified: head/sys/security/audit/audit_bsm_token.c ============================================================================== --- head/sys/security/audit/audit_bsm_token.c Sat Dec 1 11:58:08 2012 (r243750) +++ head/sys/security/audit/audit_bsm_token.c Sat Dec 1 13:46:37 2012 (r243751) @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#93 + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#99 */ #include @@ -68,6 +68,57 @@ __FBSDID("$FreeBSD$"); /* * token ID 1 byte + * success/failure 1 byte + * privstrlen 2 bytes + * privstr N bytes + 1 (\0 byte) + */ +token_t * +au_to_upriv(char sorf, char *priv) +{ + u_int16_t textlen; + u_char *dptr; + token_t *t; + + textlen = strlen(priv) + 1; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_char) + + sizeof(u_int16_t) + textlen); + + ADD_U_CHAR(dptr, AUT_UPRIV); + ADD_U_CHAR(dptr, sorf); + ADD_U_INT16(dptr, textlen); + ADD_STRING(dptr, priv, textlen); + return (t); +} + +/* + * token ID 1 byte + * privtstrlen 2 bytes + * privtstr N bytes + 1 + * privstrlen 2 bytes + * privstr N bytes + 1 + */ +token_t * +au_to_privset(char *privtypestr, char *privstr) +{ + u_int16_t type_len, priv_len; + u_char *dptr; + token_t *t; + + type_len = strlen(privtypestr) + 1; + priv_len = strlen(privstr) + 1; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int16_t) + type_len + priv_len); + + ADD_U_CHAR(dptr, AUT_PRIV); + ADD_U_INT16(dptr, type_len); + ADD_STRING(dptr, privtypestr, type_len); + ADD_U_INT16(dptr, priv_len); + ADD_STRING(dptr, privstr, priv_len); + return (t); +} + +/* + * token ID 1 byte * argument # 1 byte * argument value 4 bytes/8 bytes (32-bit/64-bit value) * text length 2 bytes @@ -1204,9 +1255,9 @@ au_to_me(void) auinfo.ai_asid, &auinfo.ai_termid)); } else { /* getaudit_addr(2) failed for some other reason. */ - return (NULL); + return (NULL); } - } + } return (au_to_subject32_ex(aia.ai_auid, geteuid(), getegid(), getuid(), getgid(), getpid(), aia.ai_asid, &aia.ai_termid)); @@ -1438,7 +1489,7 @@ au_to_header32_ex_tm(int rec_size, au_ev ADD_U_INT32(dptr, tm.tv_sec); ADD_U_INT32(dptr, timems); /* We need time in ms. */ - return (t); + return (t); } token_t * From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 15:11:47 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 5D13D7F1; Sat, 1 Dec 2012 15:11:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41DDF8FC12; Sat, 1 Dec 2012 15:11:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1FBlM8036826; Sat, 1 Dec 2012 15:11:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1FBkBA036816; Sat, 1 Dec 2012 15:11:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212011511.qB1FBkBA036816@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Dec 2012 15:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243752 - in head: etc etc/defaults etc/mail etc/mtree etc/rc.d share/man/man4 usr.sbin usr.sbin/auditdistd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 15:11:47 -0000 Author: rwatson Date: Sat Dec 1 15:11:46 2012 New Revision: 243752 URL: http://svnweb.freebsd.org/changeset/base/243752 Log: Merge a number of changes required to hook up OpenBSM 1.2-alpha2's auditdistd (distributed audit daemon) to the build: - Manual cross references - Makefile for auditdistd - rc.d script, rc.conf entrie - New group and user for auditdistd; associated aliases, etc. The audit trail distribution daemon provides reliable, cryptographically protected (and sandboxed) delivery of audit tails from live clients to audit server hosts in order to both allow centralised analysis, and improve resilience in the event of client compromises: clients are not permitted to change trail contents after submission. Submitted by: pjd Sponsored by: The FreeBSD Foundation (auditdistd) Added: head/etc/rc.d/auditdistd (contents, props changed) head/usr.sbin/auditdistd/ head/usr.sbin/auditdistd/Makefile (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/ftpusers head/etc/mail/aliases head/etc/master.passwd head/etc/mtree/BSD.var.dist head/etc/rc.d/Makefile head/share/man/man4/audit.4 head/usr.sbin/Makefile Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Dec 1 13:46:37 2012 (r243751) +++ head/etc/defaults/rc.conf Sat Dec 1 15:11:46 2012 (r243752) @@ -590,6 +590,9 @@ sendmail_rebuild_aliases="NO" # Run newa auditd_enable="NO" # Run the audit daemon. auditd_program="/usr/sbin/auditd" # Path to the audit daemon. auditd_flags="" # Which options to pass to the audit daemon. +auditdistd_enable="NO" # Run the audit daemon. +auditdistd_program="/usr/sbin/auditdistd" # Path to the auditdistd daemon. +auditdistd_flags="" # Which options to pass to the auditdistd daemon. cron_enable="YES" # Run the periodic job daemon. cron_program="/usr/sbin/cron" # Which cron executable to run (if enabled). cron_dst="YES" # Handle DST transitions intelligently (YES/NO) Modified: head/etc/ftpusers ============================================================================== --- head/etc/ftpusers Sat Dec 1 13:46:37 2012 (r243751) +++ head/etc/ftpusers Sat Dec 1 15:11:46 2012 (r243752) @@ -19,6 +19,7 @@ _pflogd _dhcp uucp pop +auditdistd www hast nobody Modified: head/etc/mail/aliases ============================================================================== --- head/etc/mail/aliases Sat Dec 1 13:46:37 2012 (r243751) +++ head/etc/mail/aliases Sat Dec 1 15:11:46 2012 (r243752) @@ -26,6 +26,7 @@ postmaster: root # General redirections for pseudo accounts _dhcp: root _pflogd: root +auditdistd: root bin: root bind: root daemon: root Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Sat Dec 1 13:46:37 2012 (r243751) +++ head/etc/master.passwd Sat Dec 1 15:11:46 2012 (r243752) @@ -20,6 +20,7 @@ _pflogd:*:64:64::0:0:pflogd privsep user _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Sat Dec 1 13:46:37 2012 (r243751) +++ head/etc/mtree/BSD.var.dist Sat Dec 1 15:11:46 2012 (r243752) @@ -19,6 +19,10 @@ /set gname=audit audit .. + dist uname=auditdistd gname=audit mode=0770 + .. + remote uname=auditdistd gname=wheel mode=0700 + .. /set gname=wheel backups .. Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Dec 1 13:46:37 2012 (r243751) +++ head/etc/rc.d/Makefile Sat Dec 1 15:11:46 2012 (r243752) @@ -19,6 +19,7 @@ FILES= DAEMON \ atm2 \ atm3 \ auditd \ + auditdistd \ bgfsck \ bluetooth \ bootparams \ Added: head/etc/rc.d/auditdistd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/auditdistd Sat Dec 1 15:11:46 2012 (r243752) @@ -0,0 +1,21 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: auditdistd +# REQUIRE: auditd +# BEFORE: DAEMON +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="auditdistd" +rcvar="${name}_enable" +pidfile="/var/run/${name}.pid" +command="/usr/sbin/${name}" +required_files="/etc/${name}.conf" +extra_commands="reload" + +load_rc_config $name +run_rc_command "$1" Modified: head/share/man/man4/audit.4 ============================================================================== --- head/share/man/man4/audit.4 Sat Dec 1 13:46:37 2012 (r243751) +++ head/share/man/man4/audit.4 Sat Dec 1 15:11:46 2012 (r243752) @@ -96,7 +96,8 @@ to track users and events in a fine-grai .Xr audit_warn 5 , .Xr rc.conf 5 , .Xr audit 8 , -.Xr auditd 8 +.Xr auditd 8 , +.Xr auditdistd 8 .Sh HISTORY The .Tn OpenBSM Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Dec 1 13:46:37 2012 (r243751) +++ head/usr.sbin/Makefile Sat Dec 1 15:11:46 2012 (r243752) @@ -110,6 +110,9 @@ SUBDIR+= amd .if ${MK_AUDIT} != "no" SUBDIR+= audit SUBDIR+= auditd +.if ${MK_OPENSSL} != "no" +SUBDIR+= auditdistd +.endif SUBDIR+= auditreduce SUBDIR+= praudit .endif Added: head/usr.sbin/auditdistd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/auditdistd/Makefile Sat Dec 1 15:11:46 2012 (r243752) @@ -0,0 +1,32 @@ +# +# $FreeBSD$ +# + +OPENBSMDIR=${.CURDIR}/../../contrib/openbsm +.PATH: ${OPENBSMDIR}/bin/auditdistd + +# Addition of auditdistd because otherwise generated parse.c can't find +# auditdistd.h. This seems like a makefile non-feature. +CFLAGS+=-I${OPENBSMDIR} -I${OPENBSMDIR}/bin/auditdistd + +NO_WFORMAT= + +PROG= auditdistd +SRCS= auditdistd.c +SRCS+= parse.y pjdlog.c +SRCS+= proto.c proto_common.c proto_socketpair.c proto_tcp.c proto_tls.c +SRCS+= receiver.c +SRCS+= sandbox.c sender.c subr.c +SRCS+= token.l trail.c +MAN= auditdistd.8 auditdistd.conf.5 + +DPADD= ${LIBL} ${LIBPTHREAD} ${LIBUTIL} +LDADD= -ll -lpthread -lutil +DPADD+= ${LIBCRYPTO} ${LIBSSL} +LDADD+= -lcrypto -lssl + +YFLAGS+=-v + +CLEANFILES=parse.c parse.h parse.output + +.include From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 15:25: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 71787A46; Sat, 1 Dec 2012 15:25:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 563588FC08; Sat, 1 Dec 2012 15:25:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1FPgYA038658; Sat, 1 Dec 2012 15:25:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1FPgQT038657; Sat, 1 Dec 2012 15:25:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212011525.qB1FPgQT038657@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Dec 2012 15:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243753 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 15:25:42 -0000 Author: eadler Date: Sat Dec 1 15:25:41 2012 New Revision: 243753 URL: http://svnweb.freebsd.org/changeset/base/243753 Log: The getline function returns the number of characters read, not written. Use clearer text for this. PR: docs/174023 Submitted by: Paul Procacci Approved by: bcr (mentor) MFC after: 1 week Modified: head/lib/libc/stdio/getline.3 Modified: head/lib/libc/stdio/getline.3 ============================================================================== --- head/lib/libc/stdio/getline.3 Sat Dec 1 15:11:46 2012 (r243752) +++ head/lib/libc/stdio/getline.3 Sat Dec 1 15:25:41 2012 (r243753) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2010 +.Dd November 30, 2012 .Dt GETLINE 3 .Os .Sh NAME @@ -76,7 +76,7 @@ The .Fn getdelim and .Fn getline -functions return the number of characters written, excluding the +functions return the number of characters stored in the buffer, excluding the terminating .Dv NUL character. From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 15:46:28 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 40646D49; Sat, 1 Dec 2012 15:46:28 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 250808FC13; Sat, 1 Dec 2012 15:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1FkSQY041347; Sat, 1 Dec 2012 15:46:28 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1FkRT0041346; Sat, 1 Dec 2012 15:46:27 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201212011546.qB1FkRT0041346@svn.freebsd.org> From: Chris Rees Date: Sat, 1 Dec 2012 15:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243754 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 15:46:28 -0000 Author: crees (ports committer) Date: Sat Dec 1 15:46:27 2012 New Revision: 243754 URL: http://svnweb.freebsd.org/changeset/base/243754 Log: MFC r242183: Allow spaces in _chroot Approved by: hrs Modified: stable/9/etc/rc.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.subr ============================================================================== --- stable/9/etc/rc.subr Sat Dec 1 15:25:41 2012 (r243753) +++ stable/9/etc/rc.subr Sat Dec 1 15:46:27 2012 (r243754) @@ -302,8 +302,8 @@ _find_processes() _pref= if [ $_interpreter != "." ]; then # an interpreted script - _script=${_chroot}${_chroot:+"/"}$_procname - if [ -r $_script ]; then + _script="${_chroot}${_chroot:+/}$_procname" + if [ -r "$_script" ]; then read _interp < $_script # read interpreter name case "$_interp" in \#!*) @@ -746,7 +746,7 @@ run_rc_command() return 1 fi - if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then + if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then warn "run_rc_command: cannot run $command" return 1 fi From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 15:53:19 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 858D9EE4; Sat, 1 Dec 2012 15:53:19 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6AEA88FC08; Sat, 1 Dec 2012 15:53:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1FrJKR042304; Sat, 1 Dec 2012 15:53:19 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1FrJR0042303; Sat, 1 Dec 2012 15:53:19 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201212011553.qB1FrJR0042303@svn.freebsd.org> From: Chris Rees Date: Sat, 1 Dec 2012 15:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243755 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 15:53:19 -0000 Author: crees (ports committer) Date: Sat Dec 1 15:53:19 2012 New Revision: 243755 URL: http://svnweb.freebsd.org/changeset/base/243755 Log: MFC r242183: Allow spaces in _chroot Approved by: hrs Modified: stable/8/etc/rc.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Sat Dec 1 15:46:27 2012 (r243754) +++ stable/8/etc/rc.subr Sat Dec 1 15:53:19 2012 (r243755) @@ -302,8 +302,8 @@ _find_processes() _pref= if [ $_interpreter != "." ]; then # an interpreted script - _script=${_chroot}${_chroot:+"/"}$_procname - if [ -r $_script ]; then + _script="${_chroot}${_chroot:+/}$_procname" + if [ -r "$_script" ]; then read _interp < $_script # read interpreter name case "$_interp" in \#!*) @@ -746,7 +746,7 @@ run_rc_command() return 1 fi - if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then + if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then warn "run_rc_command: cannot run $command" return 1 fi From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 15:54: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 D2DDD78; Sat, 1 Dec 2012 15:54:54 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6C5A8FC15; Sat, 1 Dec 2012 15:54:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1FssPX042547; Sat, 1 Dec 2012 15:54:54 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1FssPL042546; Sat, 1 Dec 2012 15:54:54 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201212011554.qB1FssPL042546@svn.freebsd.org> From: Chris Rees Date: Sat, 1 Dec 2012 15:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243756 - stable/7/etc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 15:54:54 -0000 Author: crees (ports committer) Date: Sat Dec 1 15:54:54 2012 New Revision: 243756 URL: http://svnweb.freebsd.org/changeset/base/243756 Log: MFC r242183: Allow spaces in _chroot Approved by: hrs Modified: stable/7/etc/rc.subr Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc.subr ============================================================================== --- stable/7/etc/rc.subr Sat Dec 1 15:53:19 2012 (r243755) +++ stable/7/etc/rc.subr Sat Dec 1 15:54:54 2012 (r243756) @@ -286,8 +286,8 @@ _find_processes() _pref= if [ $_interpreter != "." ]; then # an interpreted script - _script=${_chroot}${_chroot:+"/"}$_procname - if [ -r $_script ]; then + _script="${_chroot}${_chroot:+/}$_procname" + if [ -r "$_script" ]; then read _interp < $_script # read interpreter name case "$_interp" in \#!*) @@ -710,7 +710,7 @@ run_rc_command() return 1 fi - if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then + if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then warn "run_rc_command: cannot run $command" return 1 fi From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 16:44:34 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 3B40F59C; Sat, 1 Dec 2012 16:44:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF678FC08; Sat, 1 Dec 2012 16:44:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1GiXSE049810; Sat, 1 Dec 2012 16:44:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1GiX19049809; Sat, 1 Dec 2012 16:44:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212011644.qB1GiX19049809@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Dec 2012 16:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243757 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 16:44:34 -0000 Author: eadler Date: Sat Dec 1 16:44:33 2012 New Revision: 243757 URL: http://svnweb.freebsd.org/changeset/base/243757 Log: MFC r243080: Only pass ip[46].addr when _addrl contains a value Approved by: cperciva (implicit) Modified: stable/9/etc/rc.d/jail Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Sat Dec 1 15:54:54 2012 (r243756) +++ stable/9/etc/rc.d/jail Sat Dec 1 16:44:33 2012 (r243757) @@ -656,7 +656,8 @@ jail_start() done eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ - ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ + ${_addrl:+ip4.addr=\"${_addrl}\"} ${_addr6l:+ip6.addr=\"${_addr6l}\"} \ + ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ 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 3F759AB2; Sat, 1 Dec 2012 17:44:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 244858FC22; Sat, 1 Dec 2012 17:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1Hi7aO058736; Sat, 1 Dec 2012 17:44:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1Hi7mD058735; Sat, 1 Dec 2012 17:44:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201212011744.qB1Hi7mD058735@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 1 Dec 2012 17:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243758 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 17:44:07 -0000 Author: marcel Date: Sat Dec 1 17:44:06 2012 New Revision: 243758 URL: http://svnweb.freebsd.org/changeset/base/243758 Log: In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sat Dec 1 16:44:33 2012 (r243757) +++ head/lib/libc/gen/glob.c Sat Dec 1 17:44:06 2012 (r243758) @@ -718,13 +718,8 @@ globextend(const Char *path, glob_t *pgl pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + if (pathv == NULL) return (GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 17:50:39 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 C460AC46; Sat, 1 Dec 2012 17:50:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A83C38FC19; Sat, 1 Dec 2012 17:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1HodCW059718; Sat, 1 Dec 2012 17:50:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1HodxR059717; Sat, 1 Dec 2012 17:50:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201212011750.qB1HodxR059717@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 1 Dec 2012 17:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243759 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 17:50:39 -0000 Author: marcel Date: Sat Dec 1 17:50:39 2012 New Revision: 243759 URL: http://svnweb.freebsd.org/changeset/base/243759 Log: In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sat Dec 1 17:44:06 2012 (r243758) +++ head/lib/libc/gen/glob.c Sat Dec 1 17:50:39 2012 (r243759) @@ -715,9 +715,8 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); if (pathv == NULL) return (GLOB_NOSPACE); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 18:01: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 29CE4E4D; Sat, 1 Dec 2012 18:01:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF6AB8FC08; Sat, 1 Dec 2012 18:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1I1150061414; Sat, 1 Dec 2012 18:01:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1I11qN061413; Sat, 1 Dec 2012 18:01:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011801.qB1I11qN061413@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 18:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243760 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 18:01:02 -0000 Author: avg Date: Sat Dec 1 18:01:01 2012 New Revision: 243760 URL: http://svnweb.freebsd.org/changeset/base/243760 Log: acpi_cpu: change cpu_disable_idle to be a per-cpu flag... and make it safe to manipulate and check the flag With help from: jhb Tested by: trociny, emaste, dumbbell MFC after: 1 week Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Dec 1 17:50:39 2012 (r243759) +++ head/sys/dev/acpica/acpi_cpu.c Sat Dec 1 18:01:01 2012 (r243760) @@ -92,6 +92,7 @@ struct acpi_cpu_softc { struct sysctl_oid *cpu_sysctl_tree; int cpu_cx_lowest; int cpu_cx_lowest_lim; + int cpu_disable_idle; /* Disable entry to idle function */ char cpu_cx_supported[64]; }; @@ -138,9 +139,6 @@ static uint32_t cpu_smi_cmd; /* Value static uint8_t cpu_cst_cnt; /* Indicate we are _CST aware. */ static int cpu_quirks; /* Indicate any hardware bugs. */ -/* Runtime state. */ -static int cpu_disable_idle; /* Disable entry to idle function */ - /* Values for sysctl. */ static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; @@ -419,6 +417,39 @@ acpi_cpu_postattach(void *unused __unuse SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, acpi_cpu_postattach, NULL); +static void +disable_idle(struct acpi_cpu_softc *sc) +{ + cpuset_t cpuset; + + CPU_SETOF(sc->cpu_pcpu->pc_cpuid, &cpuset); + sc->cpu_disable_idle = TRUE; + + /* + * Ensure that the CPU is not in idle state or in acpi_cpu_idle(). + * Note that this code depends on the fact that the rendezvous IPI + * can not penetrate context where interrupts are disabled and acpi_cpu_idle + * is called and executed in such a context with interrupts being re-enabled + * right before return. + */ + smp_rendezvous_cpus(cpuset, smp_no_rendevous_barrier, NULL, + smp_no_rendevous_barrier, NULL); +} + +static void +enable_idle(struct acpi_cpu_softc *sc) +{ + + sc->cpu_disable_idle = FALSE; +} + +static int +is_idle_disabled(struct acpi_cpu_softc *sc) +{ + + return (sc->cpu_disable_idle); +} + /* * Disable any entry to the idle function during suspend and re-enable it * during resume. @@ -431,7 +462,7 @@ acpi_cpu_suspend(device_t dev) error = bus_generic_suspend(dev); if (error) return (error); - cpu_disable_idle = TRUE; + disable_idle(device_get_softc(dev)); return (0); } @@ -439,7 +470,7 @@ static int acpi_cpu_resume(device_t dev) { - cpu_disable_idle = FALSE; + enable_idle(device_get_softc(dev)); return (bus_generic_resume(dev)); } @@ -573,12 +604,14 @@ acpi_cpu_shutdown(device_t dev) bus_generic_shutdown(dev); /* - * Disable any entry to the idle function. There is a small race where - * an idle thread have passed this check but not gone to sleep. This - * is ok since device_shutdown() does not free the softc, otherwise - * we'd have to be sure all threads were evicted before returning. + * Disable any entry to the idle function. + */ + disable_idle(device_get_softc(dev)); + + /* + * CPU devices are not truely detached and remain referenced, + * so their resources are not freed. */ - cpu_disable_idle = TRUE; return_VALUE (0); } @@ -860,7 +893,10 @@ acpi_cpu_startup(void *arg) /* Take over idling from cpu_idle_default(). */ cpu_cx_lowest_lim = 0; - cpu_disable_idle = FALSE; + for (i = 0; i < cpu_ndevices; i++) { + sc = device_get_softc(cpu_devices[i]); + enable_idle(sc); + } cpu_idle_hook = acpi_cpu_idle; } @@ -926,12 +962,6 @@ acpi_cpu_idle() uint32_t start_time, end_time; int bm_active, cx_next_idx, i; - /* If disabled, return immediately. */ - if (cpu_disable_idle) { - ACPI_ENABLE_IRQS(); - return; - } - /* * Look up our CPU id to get our softc. If it's NULL, we'll use C1 * since there is no ACPI processor object for this CPU. This occurs @@ -943,6 +973,12 @@ acpi_cpu_idle() return; } + /* If disabled, return immediately. */ + if (is_idle_disabled(sc)) { + ACPI_ENABLE_IRQS(); + return; + } + /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; if (cpu_disable_deep_sleep) From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 18:06:06 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 1125CA6; Sat, 1 Dec 2012 18:06:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF1138FC0C; Sat, 1 Dec 2012 18:06:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1I65kS062472; Sat, 1 Dec 2012 18:06:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1I65EM062470; Sat, 1 Dec 2012 18:06:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011806.qB1I65EM062470@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 18:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243761 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 18:06:06 -0000 Author: avg Date: Sat Dec 1 18:06:05 2012 New Revision: 243761 URL: http://svnweb.freebsd.org/changeset/base/243761 Log: acpi_cpu_notify: disable acpi_cpu_idle while updating C-state data ... to avoid any races or inconsistencies. This should fix a regression introduced in r243404. Also, remove a stale comment that has not been true for quite a while now. Pointyhat to: avg Teested by: trociny, emaste, dumbbell (earlier version) MFC after: 1 week Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Dec 1 18:01:01 2012 (r243760) +++ head/sys/dev/acpica/acpi_cpu.c Sat Dec 1 18:06:05 2012 (r243761) @@ -973,9 +973,9 @@ acpi_cpu_idle() return; } - /* If disabled, return immediately. */ + /* If disabled, take the safe path. */ if (is_idle_disabled(sc)) { - ACPI_ENABLE_IRQS(); + acpi_cpu_c1(); return; } @@ -1081,23 +1081,31 @@ acpi_cpu_idle() /* * Re-evaluate the _CST object when we are notified that it changed. - * - * XXX Re-evaluation disabled until locking is done. */ static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context; - + if (notify != ACPI_NOTIFY_CX_STATES) return; + /* + * C-state data for target CPU is going to be in flux while we execute + * acpi_cpu_cx_cst, so disable entering acpi_cpu_idle. + * Also, it may happen that multiple ACPI taskqueues may concurrently + * execute notifications for the same CPU. ACPI_SERIAL is used to + * protect against that. + */ + ACPI_SERIAL_BEGIN(cpu); + disable_idle(sc); + /* Update the list of Cx states. */ acpi_cpu_cx_cst(sc); acpi_cpu_cx_list(sc); - - ACPI_SERIAL_BEGIN(cpu); acpi_cpu_set_cx_lowest(sc); + + enable_idle(sc); ACPI_SERIAL_END(cpu); acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 18:12:56 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 219BB240; Sat, 1 Dec 2012 18:12:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E17F78FC14; Sat, 1 Dec 2012 18:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1ICtP1063720; Sat, 1 Dec 2012 18:12:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1ICt7O063719; Sat, 1 Dec 2012 18:12:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011812.qB1ICt7O063719@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 18:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243762 - head/sys/cddl/contrib/opensolaris/uts/common/fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 18:12:56 -0000 Author: avg Date: Sat Dec 1 18:12:55 2012 New Revision: 243762 URL: http://svnweb.freebsd.org/changeset/base/243762 Log: gfs_file_inactive: replace bad code with ugly code Also, make it explicit that V_XATTRDIR is not properly supported in gfs code yet. The bad code was plain incorrect: (a) it spoiled handling of v_usecount reaching zero and (b) it leaked v_holdcnt. The ugly code employs potentially unsafe locking tricks. Ideally we should separate vnode lifecycle and gfs node lifecycle. A gfs node should have its own reference count where its child nodes should be accounted. PR: kern/151111 Reviewed by: kib MFC after: 13 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Dec 1 18:06:05 2012 (r243761) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Dec 1 18:12:55 2012 (r243762) @@ -665,8 +665,10 @@ gfs_file_inactive(vnode_t *vp) ge = NULL; found: +#ifdef TODO if (vp->v_flag & V_XATTRDIR) VI_LOCK(fp->gfs_parent); +#endif VI_LOCK(vp); /* * Really remove this vnode @@ -687,16 +689,17 @@ found: if (fp->gfs_parent) { if (dp) gfs_dir_unlock(dp); - VI_LOCK(fp->gfs_parent); - fp->gfs_parent->v_usecount--; - VI_UNLOCK(fp->gfs_parent); + VOP_UNLOCK(vp, 0); + VN_RELE(fp->gfs_parent); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } else { ASSERT(vp->v_vfsp != NULL); VFS_RELE(vp->v_vfsp); } +#ifdef TODO if (vp->v_flag & V_XATTRDIR) VI_UNLOCK(fp->gfs_parent); - +#endif return (data); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 18:13: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 491C7363; Sat, 1 Dec 2012 18:13:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DDAF8FC08; Sat, 1 Dec 2012 18:13:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1IDsdP063888; Sat, 1 Dec 2012 18:13:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1IDs4l063887; Sat, 1 Dec 2012 18:13:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011813.qB1IDs4l063887@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 18:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243763 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 18:13:54 -0000 Author: avg Date: Sat Dec 1 18:13:53 2012 New Revision: 243763 URL: http://svnweb.freebsd.org/changeset/base/243763 Log: zfs_getpages: make use of vm_page_readahead_finish Suggested by: kib MFC after: 5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 18:12:55 2012 (r243762) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 18:13:53 2012 (r243763) @@ -5675,27 +5675,11 @@ zfs_getpages(struct vnode *vp, vm_page_t VM_OBJECT_LOCK(object); for (i = reqstart; i < reqstart + reqsize; i++) { - m[i]->valid = VM_PAGE_BITS_ALL; + if (!error) + m[i]->valid = VM_PAGE_BITS_ALL; KASSERT(m[i]->dirty == 0, ("zfs_getpages: page %p is dirty", m[i])); - if (i != reqpage) { - if (!error) { - if (m[i]->oflags & VPO_WANTED) { - vm_page_lock(m[i]); - vm_page_activate(m[i]); - vm_page_unlock(m[i]); - } else { - vm_page_lock(m[i]); - vm_page_deactivate(m[i]); - vm_page_unlock(m[i]); - } - vm_page_wakeup(m[i]); - } else { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - } - + if (i != reqpage) + vm_page_readahead_finish(m[i]); } VM_OBJECT_UNLOCK(object); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 18:16:14 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 C27CA4D1; Sat, 1 Dec 2012 18:16:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8EFC68FC14; Sat, 1 Dec 2012 18:16:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1IGE2l064319; Sat, 1 Dec 2012 18:16:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1IGE2Y064317; Sat, 1 Dec 2012 18:16:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011816.qB1IGE2Y064317@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 18:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243764 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 18:16:14 -0000 Author: avg Date: Sat Dec 1 18:16:14 2012 New Revision: 243764 URL: http://svnweb.freebsd.org/changeset/base/243764 Log: ioapic_program_intpin: program high bits before low bits Programming the low bits has a side-effect if unmasking the pin if it is not disabled. So if an interrupt was pending then it would be delivered with the correct new vector but to the incorrect old LAPIC. This fix could be made clearer by preserving the mask bit while programming the low bits and then explicitly resetting the mask bit after all the programming is done. Probability to trip over the fixed bug could be increased by bootverbose because printing of the interrupt information in ioapic_assign_cpu lengthened the time window during which an interrupt could arrive while a pin is masked. Reported by: Andreas Longwitz Tested by: Andreas Longwitz MFC after: 12 days Modified: head/sys/x86/x86/io_apic.c Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Sat Dec 1 18:13:53 2012 (r243763) +++ head/sys/x86/x86/io_apic.c Sat Dec 1 18:16:14 2012 (r243764) @@ -311,12 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - intpin->io_lowreg = low; - ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); + intpin->io_lowreg = low; + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); } static int From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:05: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 466DB953; Sat, 1 Dec 2012 19:05:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11DA18FC08; Sat, 1 Dec 2012 19:05:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1J5UOw072223; Sat, 1 Dec 2012 19:05:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1J5UkY072221; Sat, 1 Dec 2012 19:05:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011905.qB1J5UkY072221@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243765 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:05:31 -0000 Author: avg Date: Sat Dec 1 19:05:30 2012 New Revision: 243765 URL: http://svnweb.freebsd.org/changeset/base/243765 Log: MFC r243271,243400: vnode_if: fix locking protocol description for lookup and cachedlookup Modified: stable/9/sys/kern/vfs_subr.c stable/9/sys/kern/vnode_if.src Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sat Dec 1 18:16:14 2012 (r243764) +++ stable/9/sys/kern/vfs_subr.c Sat Dec 1 19:05:30 2012 (r243765) @@ -4084,40 +4084,6 @@ vop_strategy_pre(void *ap) } void -vop_lookup_pre(void *ap) -{ -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - - a = ap; - dvp = a->a_dvp; - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); -#endif -} - -void -vop_lookup_post(void *ap, int rc) -{ -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - struct vnode *vp; - - a = ap; - dvp = a->a_dvp; - vp = *(a->a_vpp); - - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); - - if (!rc) - ASSERT_VOP_LOCKED(vp, "VOP_LOOKUP (child)"); -#endif -} - -void vop_lock_pre(void *ap) { #ifdef DEBUG_VFS_LOCKS Modified: stable/9/sys/kern/vnode_if.src ============================================================================== --- stable/9/sys/kern/vnode_if.src Sat Dec 1 18:16:14 2012 (r243764) +++ stable/9/sys/kern/vnode_if.src Sat Dec 1 19:05:30 2012 (r243765) @@ -63,10 +63,8 @@ vop_islocked { IN struct vnode *vp; }; -%% lookup dvp L ? ? +%% lookup dvp L L L %% lookup vpp - L - -%! lookup pre vop_lookup_pre -%! lookup post vop_lookup_post # XXX - the lookup locking protocol defies simple description and depends # on the flags and operation fields in the (cnp) structure. Note @@ -78,7 +76,7 @@ vop_lookup { IN struct componentname *cnp; }; -%% cachedlookup dvp L ? ? +%% cachedlookup dvp L L L %% cachedlookup vpp - L - # This must be an exact copy of lookup. See kern/vfs_cache.c for details. From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:05: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 AB665A61; Sat, 1 Dec 2012 19:05:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A5178FC13; Sat, 1 Dec 2012 19:05:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1J5m8W072315; Sat, 1 Dec 2012 19:05:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1J5m8K072313; Sat, 1 Dec 2012 19:05:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011905.qB1J5m8K072313@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243766 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:05:48 -0000 Author: avg Date: Sat Dec 1 19:05:47 2012 New Revision: 243766 URL: http://svnweb.freebsd.org/changeset/base/243766 Log: MFC r243271,243400: vnode_if: fix locking protocol description for lookup and cachedlookup Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/kern/vnode_if.src Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sat Dec 1 19:05:30 2012 (r243765) +++ stable/8/sys/kern/vfs_subr.c Sat Dec 1 19:05:47 2012 (r243766) @@ -3947,40 +3947,6 @@ vop_strategy_pre(void *ap) } void -vop_lookup_pre(void *ap) -{ -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - - a = ap; - dvp = a->a_dvp; - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); -#endif -} - -void -vop_lookup_post(void *ap, int rc) -{ -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - struct vnode *vp; - - a = ap; - dvp = a->a_dvp; - vp = *(a->a_vpp); - - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); - - if (!rc) - ASSERT_VOP_LOCKED(vp, "VOP_LOOKUP (child)"); -#endif -} - -void vop_lock_pre(void *ap) { #ifdef DEBUG_VFS_LOCKS Modified: stable/8/sys/kern/vnode_if.src ============================================================================== --- stable/8/sys/kern/vnode_if.src Sat Dec 1 19:05:30 2012 (r243765) +++ stable/8/sys/kern/vnode_if.src Sat Dec 1 19:05:47 2012 (r243766) @@ -63,10 +63,8 @@ vop_islocked { IN struct vnode *vp; }; -%% lookup dvp L ? ? +%% lookup dvp L L L %% lookup vpp - L - -%! lookup pre vop_lookup_pre -%! lookup post vop_lookup_post # XXX - the lookup locking protocol defies simple description and depends # on the flags and operation fields in the (cnp) structure. Note @@ -78,7 +76,7 @@ vop_lookup { IN struct componentname *cnp; }; -%% cachedlookup dvp L ? ? +%% cachedlookup dvp L L L %% cachedlookup vpp - L - # This must be an exact copy of lookup. See kern/vfs_cache.c for details. From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:12:44 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 4885DBBB; Sat, 1 Dec 2012 19:12:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5238FC0C; Sat, 1 Dec 2012 19:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JCiCb073776; Sat, 1 Dec 2012 19:12:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JCipk073775; Sat, 1 Dec 2012 19:12:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011912.qB1JCipk073775@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243767 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:12:44 -0000 Author: avg Date: Sat Dec 1 19:12:43 2012 New Revision: 243767 URL: http://svnweb.freebsd.org/changeset/base/243767 Log: MFC r242575: zfs_dirlook: bailout early if directory is unlinked Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Dec 1 19:05:47 2012 (r243766) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Dec 1 19:12:43 2012 (r243767) @@ -374,8 +374,15 @@ zfs_dirlook(znode_t *dzp, char *name, vn znode_t *zp; int error = 0; uint64_t parent; + int unlinked; if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) { + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + *vpp = ZTOV(dzp); VN_HOLD(*vpp); } else if (name[0] == '.' && name[1] == '.' && name[2] == 0) { @@ -394,6 +401,13 @@ zfs_dirlook(znode_t *dzp, char *name, vn NULL, NULL, NULL); return (error); } + + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + rw_enter(&dzp->z_parent_lock, RW_READER); error = zfs_zget(zfsvfs, parent, &zp); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:12:55 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 B96DCCC1; Sat, 1 Dec 2012 19:12:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 846A68FC12; Sat, 1 Dec 2012 19:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JCt0f073843; Sat, 1 Dec 2012 19:12:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JCtBZ073842; Sat, 1 Dec 2012 19:12:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011912.qB1JCtBZ073842@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243768 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:12:55 -0000 Author: avg Date: Sat Dec 1 19:12:55 2012 New Revision: 243768 URL: http://svnweb.freebsd.org/changeset/base/243768 Log: MFC r242575: zfs_dirlook: bailout early if directory is unlinked Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Dec 1 19:12:43 2012 (r243767) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Dec 1 19:12:55 2012 (r243768) @@ -374,8 +374,15 @@ zfs_dirlook(znode_t *dzp, char *name, vn znode_t *zp; int error = 0; uint64_t parent; + int unlinked; if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) { + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + *vpp = ZTOV(dzp); VN_HOLD(*vpp); } else if (name[0] == '.' && name[1] == '.' && name[2] == 0) { @@ -394,6 +401,13 @@ zfs_dirlook(znode_t *dzp, char *name, vn NULL, NULL, NULL); return (error); } + + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + rw_enter(&dzp->z_parent_lock, RW_READER); error = zfs_zget(zfsvfs, parent, &zp); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:14:36 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 7B0F5DDB; Sat, 1 Dec 2012 19:14:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3208FC08; Sat, 1 Dec 2012 19:14:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JEaBu074166; Sat, 1 Dec 2012 19:14:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JEaig074165; Sat, 1 Dec 2012 19:14:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011914.qB1JEaig074165@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243769 - stable/9/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:14:36 -0000 Author: avg Date: Sat Dec 1 19:14:35 2012 New Revision: 243769 URL: http://svnweb.freebsd.org/changeset/base/243769 Log: MFC r243498: opensolaris compat: terminate cmn_err mesages with a new line Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Dec 1 19:12:55 2012 (r243768) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Dec 1 19:14:35 2012 (r243769) @@ -60,6 +60,7 @@ vcmn_err(int ce, const char *fmt, va_lis if (ce != CE_IGNORE) { printf("%s", prefix); vprintf(fmt, adx); + printf("\n"); } } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:14: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 D988EEE1; Sat, 1 Dec 2012 19:14:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD46A8FC12; Sat, 1 Dec 2012 19:14:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JEmUo074233; Sat, 1 Dec 2012 19:14:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JEm0U074232; Sat, 1 Dec 2012 19:14:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011914.qB1JEm0U074232@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243770 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:14:48 -0000 Author: avg Date: Sat Dec 1 19:14:48 2012 New Revision: 243770 URL: http://svnweb.freebsd.org/changeset/base/243770 Log: MFC r243498: opensolaris compat: terminate cmn_err mesages with a new line Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Dec 1 19:14:35 2012 (r243769) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Dec 1 19:14:48 2012 (r243770) @@ -60,6 +60,7 @@ vcmn_err(int ce, const char *fmt, va_lis if (ce != CE_IGNORE) { printf("%s", prefix); vprintf(fmt, adx); + printf("\n"); } } From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:16:44 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 98C94FFB; Sat, 1 Dec 2012 19:16:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1528FC14; Sat, 1 Dec 2012 19:16:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JGiMn074618; Sat, 1 Dec 2012 19:16:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JGiYB074617; Sat, 1 Dec 2012 19:16:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011916.qB1JGiYB074617@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243771 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:16:44 -0000 Author: avg Date: Sat Dec 1 19:16:44 2012 New Revision: 243771 URL: http://svnweb.freebsd.org/changeset/base/243771 Log: MFC r243500: spa_import_rootpool: do not call spa_history_log_version Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:14:48 2012 (r243770) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:16:44 2012 (r243771) @@ -3848,8 +3848,6 @@ spa_import_rootpool(const char *name) return (error); } - spa_history_log_version(spa, LOG_POOL_IMPORT); - spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:16: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 7445317D; Sat, 1 Dec 2012 19:16:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 583F38FC15; Sat, 1 Dec 2012 19:16:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JGwVw074690; Sat, 1 Dec 2012 19:16:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JGwA5074689; Sat, 1 Dec 2012 19:16:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011916.qB1JGwA5074689@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243772 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:16:58 -0000 Author: avg Date: Sat Dec 1 19:16:57 2012 New Revision: 243772 URL: http://svnweb.freebsd.org/changeset/base/243772 Log: MFC r243500: spa_import_rootpool: do not call spa_history_log_version Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:16:44 2012 (r243771) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:16:57 2012 (r243772) @@ -3848,8 +3848,6 @@ spa_import_rootpool(const char *name) return (error); } - spa_history_log_version(spa, LOG_POOL_IMPORT); - spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:20: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 323652AE; Sat, 1 Dec 2012 19:20:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1690A8FC0C; Sat, 1 Dec 2012 19:20:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JK4K6075266; Sat, 1 Dec 2012 19:20:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JK4Mr075265; Sat, 1 Dec 2012 19:20:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011920.qB1JK4Mr075265@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243773 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:20:05 -0000 Author: avg Date: Sat Dec 1 19:20:04 2012 New Revision: 243773 URL: http://svnweb.freebsd.org/changeset/base/243773 Log: MFC r243501: spa_import_rootpool: initialize ub_version before calling spa_config_parse Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:16:57 2012 (r243772) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:20:04 2012 (r243773) @@ -3821,6 +3821,14 @@ spa_import_rootpool(const char *name) spa_remove(spa); } spa = spa_add(pname, config, NULL); + + /* + * Set spa_ubsync.ub_version as it can be used in vdev_alloc() + * via spa_version(). + */ + if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &spa->spa_ubsync.ub_version) != 0) + spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:20:20 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 127273B9; Sat, 1 Dec 2012 19:20:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EAA068FC12; Sat, 1 Dec 2012 19:20:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JKJAD075346; Sat, 1 Dec 2012 19:20:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JKJ41075345; Sat, 1 Dec 2012 19:20:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011920.qB1JKJ41075345@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243774 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:20:20 -0000 Author: avg Date: Sat Dec 1 19:20:19 2012 New Revision: 243774 URL: http://svnweb.freebsd.org/changeset/base/243774 Log: MFC r243501: spa_import_rootpool: initialize ub_version before calling spa_config_parse Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:20:04 2012 (r243773) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 1 19:20:19 2012 (r243774) @@ -3821,6 +3821,14 @@ spa_import_rootpool(const char *name) spa_remove(spa); } spa = spa_add(pname, config, NULL); + + /* + * Set spa_ubsync.ub_version as it can be used in vdev_alloc() + * via spa_version(). + */ + if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &spa->spa_ubsync.ub_version) != 0) + spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:22:01 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 E0C164D6; Sat, 1 Dec 2012 19:22:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C52348FC12; Sat, 1 Dec 2012 19:22:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JM1wX075742; Sat, 1 Dec 2012 19:22:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JM1ss075741; Sat, 1 Dec 2012 19:22:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011922.qB1JM1ss075741@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243775 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:22:02 -0000 Author: avg Date: Sat Dec 1 19:22:01 2012 New Revision: 243775 URL: http://svnweb.freebsd.org/changeset/base/243775 Log: MFC r243268: zfs_remove: set VV_NOSYNC flag if a node is unlinked Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:20:19 2012 (r243774) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:22:01 2012 (r243775) @@ -1940,6 +1940,9 @@ top: } else if (unlinked) { mutex_exit(&zp->z_lock); zfs_unlinked_add(zp, tx); +#ifdef __FreeBSD__ + vp->v_vflag |= VV_NOSYNC; +#endif } txtype = TX_REMOVE; From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:22:19 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 324BA5E4; Sat, 1 Dec 2012 19:22:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 169628FC08; Sat, 1 Dec 2012 19:22:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JMI6g075836; Sat, 1 Dec 2012 19:22:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JMIBQ075835; Sat, 1 Dec 2012 19:22:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011922.qB1JMIBQ075835@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243776 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:22:19 -0000 Author: avg Date: Sat Dec 1 19:22:18 2012 New Revision: 243776 URL: http://svnweb.freebsd.org/changeset/base/243776 Log: MFC r243268: zfs_remove: set VV_NOSYNC flag if a node is unlinked Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:22:01 2012 (r243775) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:22:18 2012 (r243776) @@ -1941,6 +1941,9 @@ top: } else if (unlinked) { mutex_exit(&zp->z_lock); zfs_unlinked_add(zp, tx); +#ifdef __FreeBSD__ + vp->v_vflag |= VV_NOSYNC; +#endif } txtype = TX_REMOVE; From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:24: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 CA3F171D; Sat, 1 Dec 2012 19:24:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADE8E8FC08; Sat, 1 Dec 2012 19:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JO9GX076205; Sat, 1 Dec 2012 19:24:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JO9ra076204; Sat, 1 Dec 2012 19:24:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011924.qB1JO9ra076204@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243777 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:24:09 -0000 Author: avg Date: Sat Dec 1 19:24:09 2012 New Revision: 243777 URL: http://svnweb.freebsd.org/changeset/base/243777 Log: MFC r243270: zfs_remove: assert that delete_now case is never true on FreeBSD Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:22:18 2012 (r243776) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:24:09 2012 (r243777) @@ -1911,6 +1911,9 @@ top: } if (delete_now) { +#ifdef __FreeBSD__ + panic("zfs_remove: delete_now branch taken"); +#endif if (xattr_obj_unlinked) { ASSERT3U(xzp->z_links, ==, 2); mutex_enter(&xzp->z_lock); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 19:24: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 C737883E; Sat, 1 Dec 2012 19:24:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA6D58FC13; Sat, 1 Dec 2012 19:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1JOR9w076282; Sat, 1 Dec 2012 19:24:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1JORFi076280; Sat, 1 Dec 2012 19:24:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011924.qB1JORFi076280@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 19:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243778 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 19:24:27 -0000 Author: avg Date: Sat Dec 1 19:24:27 2012 New Revision: 243778 URL: http://svnweb.freebsd.org/changeset/base/243778 Log: MFC r243270: zfs_remove: assert that delete_now case is never true on FreeBSD Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:24:09 2012 (r243777) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 1 19:24:27 2012 (r243778) @@ -1912,6 +1912,9 @@ top: } if (delete_now) { +#ifdef __FreeBSD__ + panic("zfs_remove: delete_now branch taken"); +#endif if (xattr_obj_unlinked) { ASSERT3U(xzp->z_links, ==, 2); mutex_enter(&xzp->z_lock); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 21:26:46 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 CC5EB5F7; Sat, 1 Dec 2012 21:26:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98FC48FC08; Sat, 1 Dec 2012 21:26:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1LQkXj098233; Sat, 1 Dec 2012 21:26:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1LQkjo098232; Sat, 1 Dec 2012 21:26:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201212012126.qB1LQkjo098232@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 1 Dec 2012 21:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243779 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 21:26:47 -0000 Author: marcel Date: Sat Dec 1 21:26:46 2012 New Revision: 243779 URL: http://svnweb.freebsd.org/changeset/base/243779 Log: Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sat Dec 1 19:24:27 2012 (r243778) +++ head/lib/libc/gen/glob.c Sat Dec 1 21:26:46 2012 (r243779) @@ -94,6 +94,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -153,15 +172,18 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -171,8 +193,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -186,11 +208,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -243,11 +264,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -266,7 +293,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -436,7 +464,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -529,7 +557,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -547,7 +575,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -563,6 +591,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return (0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -606,7 +643,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -652,6 +689,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -702,14 +752,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -731,6 +782,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 22:13:39 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 1E0B645A; Sat, 1 Dec 2012 22:13:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F27348FC12; Sat, 1 Dec 2012 22:13:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1MDc0P006371; Sat, 1 Dec 2012 22:13:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1MDcWA006369; Sat, 1 Dec 2012 22:13:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212012213.qB1MDcWA006369@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 1 Dec 2012 22:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243780 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 22:13:39 -0000 Author: hselasky Date: Sat Dec 1 22:13:38 2012 New Revision: 243780 URL: http://svnweb.freebsd.org/changeset/base/243780 Log: - Add support for Etron EJ168 USB 3.0 Host Controllers. This brand of controllers expects that the number of contexts specified in the input slot context points to an active endpoint context, else it refuses to operate. - Ring the correct doorbell when streams mode is used. - Wrap one or two long lines. Tested by: Markus Pfeiffer (DragonFlyBSD) MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sat Dec 1 21:26:46 2012 (r243779) +++ head/sys/dev/usb/controller/xhci.c Sat Dec 1 22:13:38 2012 (r243780) @@ -2045,7 +2045,9 @@ xhci_configure_mask(struct usb_device *u struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); struct usb_page_search buf_inp; struct xhci_input_dev_ctx *pinp; + uint32_t temp; uint8_t index; + uint8_t x; index = udev->controller_slot_id; @@ -2060,6 +2062,24 @@ xhci_configure_mask(struct usb_device *u } else { xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); + + /* find most significant set bit */ + for (x = 31; x != 1; x--) { + if (mask & (1 << x)) + break; + } + + /* adjust */ + x--; + + /* figure out maximum */ + if (x > sc->sc_hw.devs[index].context_num) { + sc->sc_hw.devs[index].context_num = x; + temp = xhci_ctx_get_le32(sc, &pinp->ctx_slot.dwSctx0); + temp &= ~XHCI_SCTX_0_CTX_NUM_SET(31); + temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1); + xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp); + } } return (0); } @@ -2311,16 +2331,9 @@ xhci_configure_device(struct usb_device DPRINTF("Route=0x%08x\n", route); - temp = XHCI_SCTX_0_ROUTE_SET(route); - - switch (sc->sc_hw.devs[index].state) { - case XHCI_ST_CONFIGURED: - temp |= XHCI_SCTX_0_CTX_NUM_SET(XHCI_MAX_ENDPOINTS - 1); - break; - default: - temp |= XHCI_SCTX_0_CTX_NUM_SET(1); - break; - } + temp = XHCI_SCTX_0_ROUTE_SET(route) | + XHCI_SCTX_0_CTX_NUM_SET( + sc->sc_hw.devs[index].context_num + 1); switch (udev->speed) { case USB_SPEED_LOW: @@ -2464,8 +2477,9 @@ xhci_alloc_device_ext(struct usb_device if (usb_pc_alloc_mem(pc, pg, sc->sc_ctx_is_64_byte ? (2 * sizeof(struct xhci_input_dev_ctx)) : - sizeof(struct xhci_input_dev_ctx), XHCI_PAGE_SIZE)) + sizeof(struct xhci_input_dev_ctx), XHCI_PAGE_SIZE)) { goto error; + } pc = &sc->sc_hw.devs[index].endpoint_pc; pg = &sc->sc_hw.devs[index].endpoint_pg; @@ -2473,15 +2487,18 @@ xhci_alloc_device_ext(struct usb_device /* need to initialize the page cache */ pc->tag_parent = sc->sc_bus.dma_parent_tag; - if (usb_pc_alloc_mem(pc, pg, sizeof(struct xhci_dev_endpoint_trbs), XHCI_PAGE_SIZE)) + if (usb_pc_alloc_mem(pc, pg, + sizeof(struct xhci_dev_endpoint_trbs), XHCI_PAGE_SIZE)) { goto error; + } /* initialise all endpoint LINK TRBs */ for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) { /* lookup endpoint TRB ring */ - usbd_get_page(pc, (uintptr_t)&((struct xhci_dev_endpoint_trbs *)0)->trb[i][0], &buf_ep); + usbd_get_page(pc, (uintptr_t)& + ((struct xhci_dev_endpoint_trbs *)0)->trb[i][0], &buf_ep); /* get TRB pointer */ trb = buf_ep.buffer; @@ -2568,8 +2585,10 @@ xhci_endpoint_doorbell(struct usb_xfer * epno = XHCI_EPNO2EPID(epno); index = xfer->xroot->udev->controller_slot_id; - if (xfer->xroot->udev->flags.self_suspended == 0) - XWRITE4(sc, door, XHCI_DOORBELL(index), epno | XHCI_DB_SID_SET(0)); + if (xfer->xroot->udev->flags.self_suspended == 0) { + XWRITE4(sc, door, XHCI_DOORBELL(index), + epno | XHCI_DB_SID_SET(xfer->stream_id)); + } } static void @@ -3584,7 +3603,7 @@ xhci_configure_reset_endpoint(struct usb * endpoint context state diagram in the XHCI specification: */ - xhci_configure_mask(udev, 1U << epno, 0); + xhci_configure_mask(udev, (1U << epno) | 1U, 0); err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); @@ -3858,6 +3877,7 @@ xhci_device_resume(struct usb_device *ud struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); uint8_t index; uint8_t n; + uint8_t p; DPRINTF("\n"); @@ -3873,8 +3893,12 @@ xhci_device_resume(struct usb_device *ud USB_BUS_LOCK(udev->bus); - for (n = 1; n != XHCI_MAX_ENDPOINTS; n++) - XWRITE4(sc, door, XHCI_DOORBELL(index), n | XHCI_DB_SID_SET(0)); + for (n = 1; n != XHCI_MAX_ENDPOINTS; n++) { + for (p = 0; p != XHCI_MAX_STREAMS; p++) { + XWRITE4(sc, door, XHCI_DOORBELL(index), + n | XHCI_DB_SID_SET(p)); + } + } USB_BUS_UNLOCK(udev->bus); @@ -3948,8 +3972,12 @@ xhci_device_state_change(struct usb_devi if (sc->sc_hw.devs[index].state == XHCI_ST_DEFAULT) break; + /* set default state */ sc->sc_hw.devs[index].state = XHCI_ST_DEFAULT; + /* reset number of contexts */ + sc->sc_hw.devs[index].context_num = 0; + err = xhci_cmd_reset_dev(sc, index); if (err != 0) { @@ -3976,11 +4004,15 @@ xhci_device_state_change(struct usb_devi if (sc->sc_hw.devs[index].state == XHCI_ST_CONFIGURED) break; + /* set configured state */ sc->sc_hw.devs[index].state = XHCI_ST_CONFIGURED; + /* reset number of contexts */ + sc->sc_hw.devs[index].context_num = 0; + usbd_get_page(&sc->sc_hw.devs[index].input_pc, 0, &buf_inp); - xhci_configure_mask(udev, 1, 0); + xhci_configure_mask(udev, 3, 0); err = xhci_configure_device(udev); if (err != 0) { Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Sat Dec 1 21:26:46 2012 (r243779) +++ head/sys/dev/usb/controller/xhci.h Sat Dec 1 22:13:38 2012 (r243780) @@ -394,7 +394,7 @@ struct xhci_hw_dev { uint8_t state; uint8_t nports; uint8_t tt; - uint8_t reserved; + uint8_t context_num; }; struct xhci_hw_softc {