From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 01:42:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB6BDD2; Sun, 9 Nov 2014 01:42:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7658B38; Sun, 9 Nov 2014 01:42:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA91gSjs062356; Sun, 9 Nov 2014 01:42:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA91gSBW062355; Sun, 9 Nov 2014 01:42:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411090142.sA91gSBW062355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 9 Nov 2014 01:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274303 - head/cddl/contrib/opensolaris/lib/libzpool/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 01:42:29 -0000 Author: delphij Date: Sun Nov 9 01:42:28 2014 New Revision: 274303 URL: https://svnweb.freebsd.org/changeset/base/274303 Log: Apply upstream 13597:3eac1e8e0f4c (git: illumos-gate@aa846ad9): Initialize tqent_flags in the userland taskq implementation. Without this the assertion of tq->tq_freelist != NULL may fail in taskq_destroy. The problem is that tqent_flags is never initialized in the userland implementation while the kernel one does initialize it. Without proper initialization, the flag may have its lowest bit set, making it treated as TQENT_FLAG_PREALLOC and never removing taskq_ent_t from tq_freelist. MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Nov 9 00:43:14 2014 (r274302) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Nov 9 01:42:28 2014 (r274303) @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Garrett D'Amore . All rights reserved. */ #include @@ -136,6 +137,7 @@ taskq_dispatch(taskq_t *tq, task_func_t t->tqent_prev->tqent_next = t; t->tqent_func = func; t->tqent_arg = arg; + t->tqent_flags = 0; cv_signal(&tq->tq_dispatch_cv); mutex_exit(&tq->tq_lock); return (1); From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 07:37:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66AD4220; Sun, 9 Nov 2014 07:37:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 506308DA; Sun, 9 Nov 2014 07:37:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA97b4bC008792; Sun, 9 Nov 2014 07:37:04 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA97b1iS008781; Sun, 9 Nov 2014 07:37:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411090737.sA97b1iS008781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 9 Nov 2014 07:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274304 - in head: cddl/contrib/opensolaris/lib/libzpool/common 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 07:37:04 -0000 Author: delphij Date: Sun Nov 9 07:37:00 2014 New Revision: 274304 URL: https://svnweb.freebsd.org/changeset/base/274304 Log: MFV r274272 and diff reduction with upstream. Illumos issue: 5244 zio pipeline callers should explicitly invoke next stage Tested with: ztest plus ZFS over GELI configuration MFC after: 1 month Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Nov 9 07:37:00 2014 (r274304) @@ -25,6 +25,7 @@ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2012 Garrett D'Amore . All rights reserved. + * Copyright (c) 2014 by Delphix. All rights reserved. */ #include @@ -33,8 +34,10 @@ int taskq_now; taskq_t *system_taskq; #define TASKQ_ACTIVE 0x00010000 +#define TASKQ_NAMELEN 31 struct taskq { + char tq_name[TASKQ_NAMELEN + 1]; kmutex_t tq_lock; krwlock_t tq_threadlock; kcondvar_t tq_dispatch_cv; @@ -247,6 +250,7 @@ taskq_create(const char *name, int nthre cv_init(&tq->tq_dispatch_cv, NULL, CV_DEFAULT, NULL); cv_init(&tq->tq_wait_cv, NULL, CV_DEFAULT, NULL); cv_init(&tq->tq_maxalloc_cv, NULL, CV_DEFAULT, NULL); + (void) strncpy(tq->tq_name, name, TASKQ_NAMELEN + 1); tq->tq_flags = flags | TASKQ_ACTIVE; tq->tq_active = nthreads; tq->tq_nthreads = nthreads; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sun Nov 9 07:37:00 2014 (r274304) @@ -60,7 +60,7 @@ typedef int vdev_open_func_t(vdev_t *vd, uint64_t *logical_ashift, uint64_t *physical_ashift); typedef void vdev_close_func_t(vdev_t *vd); typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); -typedef int vdev_io_start_func_t(zio_t *zio); +typedef void vdev_io_start_func_t(zio_t *zio); typedef void vdev_io_done_func_t(zio_t *zio); typedef void vdev_state_change_func_t(vdev_t *vd, int, int); typedef void vdev_hold_func_t(vdev_t *vd); 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 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun Nov 9 07:37:00 2014 (r274304) @@ -152,9 +152,6 @@ typedef enum zio_priority { ZIO_PRIORITY_NOW /* non-queued I/Os (e.g. ioctl) */ } zio_priority_t; -#define ZIO_PIPELINE_CONTINUE 0x100 -#define ZIO_PIPELINE_STOP 0x101 - enum zio_flag { /* * Flags inherited by gang, ddt, and vdev children, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sun Nov 9 07:37:00 2014 (r274304) @@ -715,7 +715,7 @@ vdev_disk_ioctl_done(void *zio_arg, int zio_interrupt(zio); } -static int +static void vdev_disk_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -732,7 +732,7 @@ vdev_disk_io_start(zio_t *zio) if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } if (zio->io_type == ZIO_TYPE_IOCTL) { @@ -740,7 +740,7 @@ vdev_disk_io_start(zio_t *zio) if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } switch (zio->io_cmd) { @@ -771,7 +771,7 @@ vdev_disk_io_start(zio_t *zio) * and will call vdev_disk_ioctl_done() * upon completion. */ - return (ZIO_PIPELINE_STOP); + return; } if (error == ENOTSUP || error == ENOTTY) { @@ -792,8 +792,8 @@ vdev_disk_io_start(zio_t *zio) zio->io_error = SET_ERROR(ENOTSUP); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); @@ -814,8 +814,6 @@ vdev_disk_io_start(zio_t *zio) /* ldi_strategy() will return non-zero only on programming errors */ VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0); - - return (ZIO_PIPELINE_STOP); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sun Nov 9 07:37:00 2014 (r274304) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -154,7 +154,7 @@ vdev_file_close(vdev_t *vd) vd->vdev_tsd = NULL; } -static int +static void vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -165,7 +165,7 @@ vdev_file_io_start(zio_t *zio) if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } vf = vd->vdev_tsd; @@ -181,8 +181,8 @@ vdev_file_io_start(zio_t *zio) zio->io_error = SET_ERROR(ENOTSUP); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } zio->io_error = vn_rdwr(zio->io_type == ZIO_TYPE_READ ? @@ -194,7 +194,10 @@ vdev_file_io_start(zio_t *zio) zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); +#ifdef illumos + VERIFY3U(taskq_dispatch(system_taskq, vdev_file_io_strategy, bp, + TQ_SLEEP), !=, 0); +#endif } /* ARGSUSED */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 9 07:37:00 2014 (r274304) @@ -788,7 +788,7 @@ vdev_geom_io_intr(struct bio *bp) zio_interrupt(zio); } -static int +static void vdev_geom_io_start(zio_t *zio) { vdev_t *vd; @@ -803,6 +803,8 @@ vdev_geom_io_start(zio_t *zio) /* XXPOLICY */ if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); + zio_interrupt(zio); + return; } else { switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: @@ -818,23 +820,23 @@ vdev_geom_io_start(zio_t *zio) } } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; case ZIO_TYPE_FREE: if (vd->vdev_notrim) { zio->io_error = SET_ERROR(ENOTSUP); } else if (!vdev_geom_bio_delete_disable) { goto sendreq; } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } sendreq: cp = vd->vdev_tsd; if (cp == NULL) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } bp = g_alloc_bio(); bp->bio_caller1 = zio; @@ -863,8 +865,6 @@ sendreq: bp->bio_done = vdev_geom_io_intr; g_io_request(bp, cp); - - return (ZIO_PIPELINE_STOP); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Sun Nov 9 07:37:00 2014 (r274304) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -425,7 +425,7 @@ vdev_mirror_child_select(zio_t *zio) return (-1); } -static int +static void vdev_mirror_io_start(zio_t *zio) { mirror_map_t *mm; @@ -450,8 +450,8 @@ vdev_mirror_io_start(zio_t *zio) zio->io_type, zio->io_priority, 0, vdev_mirror_scrub_done, mc)); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } /* * For normal reads just pick one child. @@ -478,8 +478,7 @@ vdev_mirror_io_start(zio_t *zio) c++; } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Sun Nov 9 07:37:00 2014 (r274304) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* @@ -67,12 +67,11 @@ vdev_missing_close(vdev_t *vd) } /* ARGSUSED */ -static int +static void vdev_missing_io_start(zio_t *zio) { zio->io_error = SET_ERROR(ENOTSUP); - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); } /* ARGSUSED */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sun Nov 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sun Nov 9 07:37:00 2014 (r274304) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1726,7 +1726,7 @@ vdev_raidz_child_done(zio_t *zio) * vdevs have had errors, then create zio read operations to the parity * columns' VDevs as well. */ -static int +static void vdev_raidz_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -1756,8 +1756,8 @@ vdev_raidz_io_start(zio_t *zio) vdev_raidz_child_done, rc)); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } if (zio->io_type == ZIO_TYPE_WRITE) { @@ -1789,8 +1789,8 @@ vdev_raidz_io_start(zio_t *zio) ZIO_FLAG_NODATA | ZIO_FLAG_OPTIONAL, NULL, NULL)); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } ASSERT(zio->io_type == ZIO_TYPE_READ); @@ -1830,8 +1830,7 @@ vdev_raidz_io_start(zio_t *zio) } } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); } 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 9 01:42:28 2014 (r274303) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Nov 9 07:37:00 2014 (r274304) @@ -90,6 +90,9 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX extern vmem_t *zio_alloc_arena; #endif +#define ZIO_PIPELINE_CONTINUE 0x100 +#define ZIO_PIPELINE_STOP 0x101 + /* * 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. @@ -2557,6 +2560,18 @@ zio_free_zil(spa_t *spa, uint64_t txg, b * Read, write and delete to physical devices * ========================================================================== */ + + +/* + * Issue an I/O to the underlying vdev. Typically the issue pipeline + * stops after this stage and will resume upon I/O completion. + * However, there are instances where the vdev layer may need to + * continue the pipeline when an I/O was not issued. Since the I/O + * that was sent to the vdev layer might be different than the one + * currently active in the pipeline (see vdev_queue_io()), we explicitly + * force the underlying vdev layers to call either zio_execute() or + * zio_interrupt() to ensure that the pipeline continues with the correct I/O. + */ static int zio_vdev_io_start(zio_t *zio) { @@ -2575,7 +2590,8 @@ zio_vdev_io_start(zio_t *zio) /* * The mirror_ops handle multiple DVAs in a single BP. */ - return (vdev_mirror_ops.vdev_op_io_start(zio)); + vdev_mirror_ops.vdev_op_io_start(zio); + return (ZIO_PIPELINE_STOP); } if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE && @@ -2589,7 +2605,7 @@ zio_vdev_io_start(zio_t *zio) * can quickly react to certain workloads. In particular, we care * about non-scrubbing, top-level reads and writes with the following * characteristics: - * - synchronous writes of user data to non-slog devices + * - synchronous writes of user data to non-slog devices * - any reads of user data * When these conditions are met, adjust the timestamp of spa_last_io * which allows the scan thread to adjust its workload accordingly. @@ -2693,10 +2709,8 @@ zio_vdev_io_start(zio_t *zio) return (ZIO_PIPELINE_STOP); } - ret = vd->vdev_ops->vdev_op_io_start(zio); - ASSERT(ret == ZIO_PIPELINE_STOP); - - return (ret); + vd->vdev_ops->vdev_op_io_start(zio); + return (ZIO_PIPELINE_STOP); } static int From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 09:44:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E00C67E; Sun, 9 Nov 2014 09:44:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D564B38C; Sun, 9 Nov 2014 09:44:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA99i95t070084; Sun, 9 Nov 2014 09:44:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA99i9NE070083; Sun, 9 Nov 2014 09:44:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411090944.sA99i9NE070083@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 9 Nov 2014 09:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274305 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 09:44:10 -0000 Author: kib Date: Sun Nov 9 09:44:09 2014 New Revision: 274305 URL: https://svnweb.freebsd.org/changeset/base/274305 Log: MFC r273967: Only trigger a panic when forced operation is done. Convert direct panic() call into KASSERT(). Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Sun Nov 9 07:37:00 2014 (r274304) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Sun Nov 9 09:44:09 2014 (r274305) @@ -735,7 +735,7 @@ static struct malloc_type *memtype[] = { static void check_clear_deps(struct mount *); static void softdep_error(char *, int); static int softdep_process_worklist(struct mount *, int); -static int softdep_waitidle(struct mount *); +static int softdep_waitidle(struct mount *, int); static void drain_output(struct vnode *); static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); static void clear_remove(struct mount *); @@ -1911,7 +1911,7 @@ softdep_flushworklist(oldmnt, countp, td } static int -softdep_waitidle(struct mount *mp) +softdep_waitidle(struct mount *mp, int flags __unused) { struct ufsmount *ump; int error; @@ -1921,8 +1921,9 @@ softdep_waitidle(struct mount *mp) ACQUIRE_LOCK(ump); for (i = 0; i < 10 && ump->softdep_deps; i++) { ump->softdep_req = 1; - if (ump->softdep_on_worklist) - panic("softdep_waitidle: work added after flush."); + KASSERT((flags & FORCECLOSE) == 0 || + ump->softdep_on_worklist == 0, + ("softdep_waitidle: work added after flush")); msleep(&ump->softdep_deps, LOCK_PTR(ump), PVM, "softdeps", 1); } ump->softdep_req = 0; @@ -1990,7 +1991,7 @@ retry_flush: error = EBUSY; } if (!error) - error = softdep_waitidle(oldmnt); + error = softdep_waitidle(oldmnt, flags); if (!error) { if (oldmnt->mnt_kern_flag & MNTK_UNMOUNT) { retry = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 11:11:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA6B61A1; Sun, 9 Nov 2014 11:11:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7114C9D; Sun, 9 Nov 2014 11:11:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9BB9xo010181; Sun, 9 Nov 2014 11:11:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9BB8uJ010176; Sun, 9 Nov 2014 11:11:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411091111.sA9BB8uJ010176@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 9 Nov 2014 11:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274306 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 11:11:10 -0000 Author: glebius Date: Sun Nov 9 11:11:08 2014 New Revision: 274306 URL: https://svnweb.freebsd.org/changeset/base/274306 Log: Use standard mtx(9), rwlock(9), sx(9) system initialization macros instead of doing initialization manually. Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/net/if.c head/sys/net/if_clone.c head/sys/net/if_clone.h head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Nov 9 09:44:09 2014 (r274305) +++ head/sys/net/if.c Sun Nov 9 11:11:08 2014 (r274306) @@ -159,7 +159,6 @@ static void if_attachdomain(void *); static void if_attachdomain1(struct ifnet *); static int ifconf(u_long, caddr_t); static void if_freemulti(struct ifmultiaddr *); -static void if_init(void *); static void if_grow(void); static void if_route(struct ifnet *, int flag, int fam); static int if_setflag(struct ifnet *, int, int, int *, int); @@ -207,7 +206,9 @@ VNET_DEFINE(struct ifnet **, ifindex_tab * inversions and deadlocks. */ struct rwlock ifnet_rwlock; +RW_SYSINIT_FLAGS(ifnet_rw, &ifnet_rwlock, "ifnet_rw", RW_RECURSE); struct sx ifnet_sxlock; +SX_SYSINIT_FLAGS(ifnet_sx, &ifnet_sxlock, "ifnet_sx", SX_RECURSE); /* * The allocation of network interfaces is a rather non-atomic affair; we @@ -364,17 +365,6 @@ vnet_if_init(const void *unused __unused VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init, NULL); -/* ARGSUSED*/ -static void -if_init(void *dummy __unused) -{ - - IFNET_LOCK_INIT(); - if_clone_init(); -} -SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL); - - #ifdef VIMAGE static void vnet_if_uninit(const void *unused __unused) Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sun Nov 9 09:44:09 2014 (r274305) +++ head/sys/net/if_clone.c Sun Nov 9 11:11:08 2014 (r274306) @@ -103,15 +103,14 @@ static int ifc_simple_match(struct i static int ifc_simple_create(struct if_clone *, char *, size_t, caddr_t); static int ifc_simple_destroy(struct if_clone *, struct ifnet *); -static struct mtx if_cloners_mtx; +static struct mtx if_cloners_mtx; +MTX_SYSINIT(if_cloners_lock, &if_cloners_mtx, "if_cloners lock", MTX_DEF); static VNET_DEFINE(int, if_cloners_count); VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); #define V_if_cloners_count VNET(if_cloners_count) #define V_if_cloners VNET(if_cloners) -#define IF_CLONERS_LOCK_INIT() \ - mtx_init(&if_cloners_mtx, "if_cloners lock", NULL, MTX_DEF) #define IF_CLONERS_LOCK_ASSERT() mtx_assert(&if_cloners_mtx, MA_OWNED) #define IF_CLONERS_LOCK() mtx_lock(&if_cloners_mtx) #define IF_CLONERS_UNLOCK() mtx_unlock(&if_cloners_mtx) @@ -169,13 +168,6 @@ vnet_if_clone_init(void) LIST_INIT(&V_if_cloners); } -void -if_clone_init(void) -{ - - IF_CLONERS_LOCK_INIT(); -} - /* * Lookup and create a clone network interface. */ Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Sun Nov 9 09:44:09 2014 (r274305) +++ head/sys/net/if_clone.h Sun Nov 9 11:11:08 2014 (r274306) @@ -65,7 +65,6 @@ EVENTHANDLER_DECLARE(if_clone_event, if_ #endif /* The below interfaces used only by net/if.c. */ -void if_clone_init(void); void vnet_if_clone_init(void); int if_clone_create(char *, size_t, caddr_t); int if_clone_destroy(const char *); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Nov 9 09:44:09 2014 (r274305) +++ head/sys/net/if_var.h Sun Nov 9 11:11:08 2014 (r274306) @@ -421,11 +421,6 @@ struct ifmultiaddr { extern struct rwlock ifnet_rwlock; extern struct sx ifnet_sxlock; -#define IFNET_LOCK_INIT() do { \ - rw_init_flags(&ifnet_rwlock, "ifnet_rw", RW_RECURSE); \ - sx_init_flags(&ifnet_sxlock, "ifnet_sx", SX_RECURSE); \ -} while(0) - #define IFNET_WLOCK() do { \ sx_xlock(&ifnet_sxlock); \ rw_wlock(&ifnet_rwlock); \ From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 11:13:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E18331B; Sun, 9 Nov 2014 11:13:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF9D2CB4; Sun, 9 Nov 2014 11:13:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9BDFOo012917; Sun, 9 Nov 2014 11:13:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9BDFbL012916; Sun, 9 Nov 2014 11:13:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411091113.sA9BDFbL012916@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 9 Nov 2014 11:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274307 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 11:13:16 -0000 Author: glebius Date: Sun Nov 9 11:13:15 2014 New Revision: 274307 URL: https://svnweb.freebsd.org/changeset/base/274307 Log: Remove remnants of if_ef(4). Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sun Nov 9 11:11:08 2014 (r274306) +++ head/sys/net/if_ethersubr.c Sun Nov 9 11:13:15 2014 (r274307) @@ -78,11 +78,6 @@ #ifdef INET6 #include #endif - -int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m); -int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp, - const struct sockaddr *dst, short *tp, int *hlen); - #include #ifdef CTASSERT From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 13:01:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AE0C1CC; Sun, 9 Nov 2014 13:01:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56E7381B; Sun, 9 Nov 2014 13:01:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9D1Blp063061; Sun, 9 Nov 2014 13:01:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9D19SI063049; Sun, 9 Nov 2014 13:01:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411091301.sA9D19SI063049@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 9 Nov 2014 13:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274308 - head/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 13:01:11 -0000 Author: trasz Date: Sun Nov 9 13:01:09 2014 New Revision: 274308 URL: https://svnweb.freebsd.org/changeset/base/274308 Log: Add support for sending redirections to iSCSI target. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/login.c head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sun Nov 9 11:13:15 2014 (r274307) +++ head/usr.sbin/ctld/ctl.conf.5 Sun Nov 9 13:01:09 2014 (r274308) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2014 +.Dd November 9, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -218,6 +218,17 @@ An IPv4 or IPv6 address and port to list .\".It Ic listen-iser Ar address .\"An IPv4 or IPv6 address and port to listen on for incoming connections .\"using iSER (iSCSI over RDMA) protocol. +.It Ic redirect Aq Ar address +IPv4 or IPv6 address to redirect initiators to. +When configured, all initiators attempting to connect to portal +belonging to this +.Sy portal-group +will get redirected using "Target moved temporarily" login response. +Redirection happens before authentication and any +.Sy initiator-name +or +.Sy initiator-portal +checks are skipped. .El .Ss target Context .Bl -tag -width indent @@ -296,6 +307,11 @@ The default portal group is .Qq Ar default , which makes the target available on TCP port 3260 on all configured IPv4 and IPv6 addresses. +.It Ic redirect Aq Ar address +IPv4 or IPv6 address to redirect initiators to. +When configured, all initiators attempting to connect to this target +will get redirected using "Target moved temporarily" login response. +Redirection happens after successful authentication. .It Ic lun Ar number Create a .Sy lun Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Sun Nov 9 11:13:15 2014 (r274307) +++ head/usr.sbin/ctld/ctld.c Sun Nov 9 13:01:09 2014 (r274308) @@ -622,6 +622,7 @@ portal_group_delete(struct portal_group TAILQ_FOREACH_SAFE(portal, &pg->pg_portals, p_next, tmp) portal_delete(portal); free(pg->pg_name); + free(pg->pg_redirection); free(pg); } @@ -1000,6 +1001,22 @@ portal_group_set_filter(struct portal_gr return (0); } +int +portal_group_set_redirection(struct portal_group *pg, const char *addr) +{ + + if (pg->pg_redirection != NULL) { + log_warnx("cannot set redirection to \"%s\" for " + "portal-group \"%s\"; already defined", + addr, pg->pg_name); + return (1); + } + + pg->pg_redirection = checked_strdup(addr); + + return (0); +} + static bool valid_hex(const char ch) { @@ -1144,6 +1161,7 @@ target_delete(struct target *targ) TAILQ_FOREACH_SAFE(lun, &targ->t_luns, l_next, tmp) lun_delete(lun); free(targ->t_name); + free(targ->t_redirection); free(targ); } @@ -1160,6 +1178,22 @@ target_find(struct conf *conf, const cha return (NULL); } +int +target_set_redirection(struct target *target, const char *addr) +{ + + if (target->t_redirection != NULL) { + log_warnx("cannot set redirection to \"%s\" for " + "target \"%s\"; already defined", + addr, target->t_name); + return (1); + } + + target->t_redirection = checked_strdup(addr); + + return (0); +} + struct lun * lun_new(struct target *targ, int lun_id) { @@ -1486,10 +1520,15 @@ conf_verify(struct conf *conf) return (error); found = true; } - if (!found) { + if (!found && targ->t_redirection == NULL) { log_warnx("no LUNs defined for target \"%s\"", targ->t_name); } + if (found && targ->t_redirection != NULL) { + log_debugx("target \"%s\" contains luns, " + " but configured for redirection", + targ->t_name); + } } TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { assert(pg->pg_name != NULL); @@ -1506,13 +1545,22 @@ conf_verify(struct conf *conf) if (targ->t_portal_group == pg) break; } - if (targ == NULL) { + if (pg->pg_redirection != NULL) { + if (targ != NULL) { + log_debugx("portal-group \"%s\" assigned " + "to target \"%s\", but configured " + "for redirection", + pg->pg_name, targ->t_name); + } + pg->pg_unassigned = false; + } else if (targ != NULL) { + pg->pg_unassigned = false; + } else { if (strcmp(pg->pg_name, "default") != 0) log_warnx("portal-group \"%s\" not assigned " "to any target", pg->pg_name); pg->pg_unassigned = true; - } else - pg->pg_unassigned = false; + } } TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) { if (ag->ag_name == NULL) Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Sun Nov 9 11:13:15 2014 (r274307) +++ head/usr.sbin/ctld/ctld.h Sun Nov 9 13:01:09 2014 (r274308) @@ -117,6 +117,7 @@ struct portal_group { int pg_discovery_filter; bool pg_unassigned; TAILQ_HEAD(, portal) pg_portals; + char *pg_redirection; uint16_t pg_tag; }; @@ -151,6 +152,7 @@ struct target { struct portal_group *t_portal_group; char *t_name; char *t_alias; + char *t_redirection; }; struct isns { @@ -301,6 +303,8 @@ int portal_group_add_listen(struct por const char *listen, bool iser); int portal_group_set_filter(struct portal_group *pg, const char *filter); +int portal_group_set_redirection(struct portal_group *pg, + const char *addr); int isns_new(struct conf *conf, const char *addr); void isns_delete(struct isns *is); @@ -312,6 +316,8 @@ struct target *target_new(struct conf * void target_delete(struct target *target); struct target *target_find(struct conf *conf, const char *name); +int target_set_redirection(struct target *target, + const char *addr); struct lun *lun_new(struct target *target, int lun_id); void lun_delete(struct lun *lun); Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sun Nov 9 11:13:15 2014 (r274307) +++ head/usr.sbin/ctld/login.c Sun Nov 9 13:01:09 2014 (r274308) @@ -613,6 +613,66 @@ login_negotiate_key(struct pdu *request, } static void +login_redirect(struct pdu *request, const char *target_address) +{ + struct pdu *response; + struct iscsi_bhs_login_response *bhslr2; + struct keys *response_keys; + + response = login_new_response(request); + bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs; + bhslr2->bhslr_status_class = 0x01; + bhslr2->bhslr_status_detail = 0x01; + login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); + login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); + + response_keys = keys_new(); + keys_add(response_keys, "TargetAddress", target_address); + + keys_save(response_keys, response); + pdu_send(response); + pdu_delete(response); + keys_delete(response_keys); +} + +static bool +login_portal_redirect(struct connection *conn, struct pdu *request) +{ + const struct portal_group *pg; + + pg = conn->conn_portal->p_portal_group; + if (pg->pg_redirection == NULL) + return (false); + + log_debugx("portal-group \"%s\" configured to redirect to %s", + pg->pg_name, pg->pg_redirection); + login_redirect(request, pg->pg_redirection); + + return (true); +} + +static bool +login_target_redirect(struct connection *conn, struct pdu *request) +{ + const char *target_address; + + assert(conn->conn_portal->p_portal_group->pg_redirection == NULL); + + if (conn->conn_target == NULL) + return (false); + + target_address = conn->conn_target->t_redirection; + if (target_address == NULL) + return (false); + + log_debugx("target \"%s\" configured to redirect to %s", + conn->conn_target->t_name, target_address); + login_redirect(request, target_address); + + return (true); +} + +static void login_negotiate(struct connection *conn, struct pdu *request) { struct pdu *response; @@ -680,6 +740,7 @@ login(struct connection *conn) struct portal_group *pg; const char *initiator_name, *initiator_alias, *session_type, *target_name, *auth_method; + bool redirected; /* * Handle the initial Login Request - figure out required authentication @@ -722,6 +783,12 @@ login(struct connection *conn) */ setproctitle("%s (%s)", conn->conn_initiator_addr, conn->conn_initiator_name); + redirected = login_portal_redirect(conn, request); + if (redirected) { + log_debugx("initiator redirected; exiting"); + exit(0); + } + initiator_alias = keys_find(request_keys, "InitiatorAlias"); if (initiator_alias != NULL) conn->conn_initiator_alias = checked_strdup(initiator_alias); @@ -809,6 +876,12 @@ login(struct connection *conn) keys_delete(request_keys); + redirected = login_target_redirect(conn, request); + if (redirected) { + log_debugx("initiator redirected; exiting"); + exit(0); + } + log_debugx("initiator skipped the authentication, " "and we don't need it; proceeding with negotiation"); login_negotiate(conn, request); @@ -820,6 +893,12 @@ login(struct connection *conn) * Initiator might want to to authenticate, * but we don't need it. */ + redirected = login_target_redirect(conn, request); + if (redirected) { + log_debugx("initiator redirected; exiting"); + exit(0); + } + log_debugx("authentication not required; " "transitioning to operational parameter negotiation"); @@ -908,5 +987,17 @@ login(struct connection *conn) login_chap(conn, ag); + /* + * RFC 3720, 10.13.5. Status-Class and Status-Detail, says + * the redirection SHOULD be accepted by the initiator before + * authentication, but MUST be be accepted afterwards; that's + * why we're doing it here and not earlier. + */ + redirected = login_target_redirect(conn, request); + if (redirected) { + log_debugx("initiator redirected; exiting"); + exit(0); + } + login_negotiate(conn, NULL); } Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Sun Nov 9 11:13:15 2014 (r274307) +++ head/usr.sbin/ctld/parse.y Sun Nov 9 13:01:09 2014 (r274308) @@ -61,7 +61,8 @@ extern void yyrestart(FILE *); %token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP DISCOVERY_FILTER %token INITIATOR_NAME INITIATOR_PORTAL ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %token LISTEN LISTEN_ISER LUN MAXPROC OPENING_BRACKET OPTION -%token PATH PIDFILE PORTAL_GROUP SEMICOLON SERIAL SIZE STR TARGET TIMEOUT +%token PATH PIDFILE PORTAL_GROUP REDIRECT SEMICOLON SERIAL SIZE STR +%token TARGET TIMEOUT %union { @@ -338,6 +339,8 @@ portal_group_entry: portal_group_listen | portal_group_listen_iser + | + portal_group_redirect ; portal_group_discovery_auth_group: DISCOVERY_AUTH_GROUP STR @@ -393,6 +396,17 @@ portal_group_listen_iser: LISTEN_ISER ST } ; +portal_group_redirect: REDIRECT STR + { + int error; + + error = portal_group_set_redirection(portal_group, $2); + free($2); + if (error != 0) + return (1); + } + ; + target: TARGET target_name OPENING_BRACKET target_entries CLOSING_BRACKET { @@ -433,6 +447,8 @@ target_entry: | target_portal_group | + target_redirect + | target_lun ; @@ -635,6 +651,17 @@ target_portal_group: PORTAL_GROUP STR } ; +target_redirect: REDIRECT STR + { + int error; + + error = target_set_redirection(target, $2); + free($2); + if (error != 0) + return (1); + } + ; + target_lun: LUN lun_number OPENING_BRACKET lun_entries CLOSING_BRACKET { Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Sun Nov 9 11:13:15 2014 (r274307) +++ head/usr.sbin/ctld/token.l Sun Nov 9 13:01:09 2014 (r274308) @@ -72,6 +72,7 @@ isns-server { return ISNS_SERVER; } isns-period { return ISNS_PERIOD; } isns-timeout { return ISNS_TIMEOUT; } portal-group { return PORTAL_GROUP; } +redirect { return REDIRECT; } serial { return SERIAL; } size { return SIZE; } target { return TARGET; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 13:25:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 230D2400 for ; Sun, 9 Nov 2014 13:25:50 +0000 (UTC) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3719A9 for ; Sun, 9 Nov 2014 13:25:49 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so7874646wiv.2 for ; Sun, 09 Nov 2014 05:25:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=tORmOiBHuKurCXLDBbfmkK2s+rc/4ZJx1Uz/0tX1PeY=; b=HQlYHnY38JGQo5GWXg/iffTFz07cRPh3WRQ/aNifV9TfZGNQ00Np//5bgcrQx9dFaA aBE2Hpffhjbc0tdwoiNy05Mj47Btqa61YnjLbJKvGaAAnYXJslCeaIpYdlKhJ2SfIKY8 zIybmC0Nt8tMrRjh3L7y94983M6o7IqNvjrn4jTNElAtqAYhGPuqAzt6pGAwiEbzlDE8 kJtpSZ5LF2hcaJr1rX5fHq0emxcHEfJCSrXF9H1l+XTIuZb+FHbcEccfwawDwtig9/5R DT32RqnO0YgoWH+rFRTV373qvVrombEQNfzdyuuEGD7Fboe61Y5MpV3Wlvl+8/e/aCau QPQQ== X-Gm-Message-State: ALoCoQkLBARAjEDoxj85Nkn5feGB3BnL47N3VOcEqq7gtQVsoiUu1rGWbUCe7wseLvsKuk84ldEX X-Received: by 10.194.63.145 with SMTP id g17mr35144132wjs.80.1415539541807; Sun, 09 Nov 2014 05:25:41 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id cx9sm19159933wjc.25.2014.11.09.05.25.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Nov 2014 05:25:40 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <545F6B63.1020601@freebsd.org> Date: Sun, 09 Nov 2014 13:25:55 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274304 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys References: <201411090737.sA97b1iS008781@svn.freebsd.org> In-Reply-To: <201411090737.sA97b1iS008781@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 13:25:50 -0000 We need to keep an eye on this one as it replaces a number of zio_interrupt calls with zio_execute which will increase stack usage. Xin did you do any tests on i386 at all? Regards Steve On 09/11/2014 07:37, Xin LI wrote: > Author: delphij > Date: Sun Nov 9 07:37:00 2014 > New Revision: 274304 > URL: https://svnweb.freebsd.org/changeset/base/274304 > > Log: > MFV r274272 and diff reduction with upstream. > > Illumos issue: > 5244 zio pipeline callers should explicitly invoke next stage > > Tested with: ztest plus ZFS over GELI configuration > MFC after: 1 month > > Modified: > head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > Directory Properties: > head/cddl/contrib/opensolaris/ (props changed) > head/sys/cddl/contrib/opensolaris/ (props changed) > > Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c > ============================================================================== > --- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -25,6 +25,7 @@ > /* > * Copyright 2011 Nexenta Systems, Inc. All rights reserved. > * Copyright 2012 Garrett D'Amore . All rights reserved. > + * Copyright (c) 2014 by Delphix. All rights reserved. > */ > > #include > @@ -33,8 +34,10 @@ int taskq_now; > taskq_t *system_taskq; > > #define TASKQ_ACTIVE 0x00010000 > +#define TASKQ_NAMELEN 31 > > struct taskq { > + char tq_name[TASKQ_NAMELEN + 1]; > kmutex_t tq_lock; > krwlock_t tq_threadlock; > kcondvar_t tq_dispatch_cv; > @@ -247,6 +250,7 @@ taskq_create(const char *name, int nthre > cv_init(&tq->tq_dispatch_cv, NULL, CV_DEFAULT, NULL); > cv_init(&tq->tq_wait_cv, NULL, CV_DEFAULT, NULL); > cv_init(&tq->tq_maxalloc_cv, NULL, CV_DEFAULT, NULL); > + (void) strncpy(tq->tq_name, name, TASKQ_NAMELEN + 1); > tq->tq_flags = flags | TASKQ_ACTIVE; > tq->tq_active = nthreads; > tq->tq_nthreads = nthreads; > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sun Nov 9 07:37:00 2014 (r274304) > @@ -60,7 +60,7 @@ typedef int vdev_open_func_t(vdev_t *vd, > uint64_t *logical_ashift, uint64_t *physical_ashift); > typedef void vdev_close_func_t(vdev_t *vd); > typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); > -typedef int vdev_io_start_func_t(zio_t *zio); > +typedef void vdev_io_start_func_t(zio_t *zio); > typedef void vdev_io_done_func_t(zio_t *zio); > typedef void vdev_state_change_func_t(vdev_t *vd, int, int); > typedef void vdev_hold_func_t(vdev_t *vd); > > 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 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun Nov 9 07:37:00 2014 (r274304) > @@ -152,9 +152,6 @@ typedef enum zio_priority { > ZIO_PRIORITY_NOW /* non-queued I/Os (e.g. ioctl) */ > } zio_priority_t; > > -#define ZIO_PIPELINE_CONTINUE 0x100 > -#define ZIO_PIPELINE_STOP 0x101 > - > enum zio_flag { > /* > * Flags inherited by gang, ddt, and vdev children, > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -715,7 +715,7 @@ vdev_disk_ioctl_done(void *zio_arg, int > zio_interrupt(zio); > } > > -static int > +static void > vdev_disk_io_start(zio_t *zio) > { > vdev_t *vd = zio->io_vd; > @@ -732,7 +732,7 @@ vdev_disk_io_start(zio_t *zio) > if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) { > zio->io_error = SET_ERROR(ENXIO); > zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + return; > } > > if (zio->io_type == ZIO_TYPE_IOCTL) { > @@ -740,7 +740,7 @@ vdev_disk_io_start(zio_t *zio) > if (!vdev_readable(vd)) { > zio->io_error = SET_ERROR(ENXIO); > zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + return; > } > > switch (zio->io_cmd) { > @@ -771,7 +771,7 @@ vdev_disk_io_start(zio_t *zio) > * and will call vdev_disk_ioctl_done() > * upon completion. > */ > - return (ZIO_PIPELINE_STOP); > + return; > } > > if (error == ENOTSUP || error == ENOTTY) { > @@ -792,8 +792,8 @@ vdev_disk_io_start(zio_t *zio) > zio->io_error = SET_ERROR(ENOTSUP); > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > } > > vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); > @@ -814,8 +814,6 @@ vdev_disk_io_start(zio_t *zio) > > /* ldi_strategy() will return non-zero only on programming errors */ > VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0); > - > - return (ZIO_PIPELINE_STOP); > } > > static void > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -20,7 +20,7 @@ > */ > /* > * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. > - * Copyright (c) 2013 by Delphix. All rights reserved. > + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. > */ > > #include > @@ -154,7 +154,7 @@ vdev_file_close(vdev_t *vd) > vd->vdev_tsd = NULL; > } > > -static int > +static void > vdev_file_io_start(zio_t *zio) > { > vdev_t *vd = zio->io_vd; > @@ -165,7 +165,7 @@ vdev_file_io_start(zio_t *zio) > if (!vdev_readable(vd)) { > zio->io_error = SET_ERROR(ENXIO); > zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + return; > } > > vf = vd->vdev_tsd; > @@ -181,8 +181,8 @@ vdev_file_io_start(zio_t *zio) > zio->io_error = SET_ERROR(ENOTSUP); > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > } > > zio->io_error = vn_rdwr(zio->io_type == ZIO_TYPE_READ ? > @@ -194,7 +194,10 @@ vdev_file_io_start(zio_t *zio) > > zio_interrupt(zio); > > - return (ZIO_PIPELINE_STOP); > +#ifdef illumos > + VERIFY3U(taskq_dispatch(system_taskq, vdev_file_io_strategy, bp, > + TQ_SLEEP), !=, 0); > +#endif > } > > /* ARGSUSED */ > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -788,7 +788,7 @@ vdev_geom_io_intr(struct bio *bp) > zio_interrupt(zio); > } > > -static int > +static void > vdev_geom_io_start(zio_t *zio) > { > vdev_t *vd; > @@ -803,6 +803,8 @@ vdev_geom_io_start(zio_t *zio) > /* XXPOLICY */ > if (!vdev_readable(vd)) { > zio->io_error = SET_ERROR(ENXIO); > + zio_interrupt(zio); > + return; > } else { > switch (zio->io_cmd) { > case DKIOCFLUSHWRITECACHE: > @@ -818,23 +820,23 @@ vdev_geom_io_start(zio_t *zio) > } > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > case ZIO_TYPE_FREE: > if (vd->vdev_notrim) { > zio->io_error = SET_ERROR(ENOTSUP); > } else if (!vdev_geom_bio_delete_disable) { > goto sendreq; > } > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > } > sendreq: > cp = vd->vdev_tsd; > if (cp == NULL) { > zio->io_error = SET_ERROR(ENXIO); > zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + return; > } > bp = g_alloc_bio(); > bp->bio_caller1 = zio; > @@ -863,8 +865,6 @@ sendreq: > bp->bio_done = vdev_geom_io_intr; > > g_io_request(bp, cp); > - > - return (ZIO_PIPELINE_STOP); > } > > static void > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -24,7 +24,7 @@ > */ > > /* > - * Copyright (c) 2013 by Delphix. All rights reserved. > + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. > */ > > #include > @@ -425,7 +425,7 @@ vdev_mirror_child_select(zio_t *zio) > return (-1); > } > > -static int > +static void > vdev_mirror_io_start(zio_t *zio) > { > mirror_map_t *mm; > @@ -450,8 +450,8 @@ vdev_mirror_io_start(zio_t *zio) > zio->io_type, zio->io_priority, 0, > vdev_mirror_scrub_done, mc)); > } > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > } > /* > * For normal reads just pick one child. > @@ -478,8 +478,7 @@ vdev_mirror_io_start(zio_t *zio) > c++; > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > } > > static int > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -24,7 +24,7 @@ > */ > > /* > - * Copyright (c) 2013 by Delphix. All rights reserved. > + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. > */ > > /* > @@ -67,12 +67,11 @@ vdev_missing_close(vdev_t *vd) > } > > /* ARGSUSED */ > -static int > +static void > vdev_missing_io_start(zio_t *zio) > { > zio->io_error = SET_ERROR(ENOTSUP); > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > } > > /* ARGSUSED */ > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sun Nov 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -21,7 +21,7 @@ > > /* > * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. > - * Copyright (c) 2013 by Delphix. All rights reserved. > + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. > * Copyright (c) 2013, Joyent, Inc. All rights reserved. > */ > > @@ -1726,7 +1726,7 @@ vdev_raidz_child_done(zio_t *zio) > * vdevs have had errors, then create zio read operations to the parity > * columns' VDevs as well. > */ > -static int > +static void > vdev_raidz_io_start(zio_t *zio) > { > vdev_t *vd = zio->io_vd; > @@ -1756,8 +1756,8 @@ vdev_raidz_io_start(zio_t *zio) > vdev_raidz_child_done, rc)); > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > } > > if (zio->io_type == ZIO_TYPE_WRITE) { > @@ -1789,8 +1789,8 @@ vdev_raidz_io_start(zio_t *zio) > ZIO_FLAG_NODATA | ZIO_FLAG_OPTIONAL, NULL, NULL)); > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > + return; > } > > ASSERT(zio->io_type == ZIO_TYPE_READ); > @@ -1830,8 +1830,7 @@ vdev_raidz_io_start(zio_t *zio) > } > } > > - zio_interrupt(zio); > - return (ZIO_PIPELINE_STOP); > + zio_execute(zio); > } > > > > 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 9 01:42:28 2014 (r274303) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Nov 9 07:37:00 2014 (r274304) > @@ -90,6 +90,9 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX > extern vmem_t *zio_alloc_arena; > #endif > > +#define ZIO_PIPELINE_CONTINUE 0x100 > +#define ZIO_PIPELINE_STOP 0x101 > + > /* > * 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. > @@ -2557,6 +2560,18 @@ zio_free_zil(spa_t *spa, uint64_t txg, b > * Read, write and delete to physical devices > * ========================================================================== > */ > + > + > +/* > + * Issue an I/O to the underlying vdev. Typically the issue pipeline > + * stops after this stage and will resume upon I/O completion. > + * However, there are instances where the vdev layer may need to > + * continue the pipeline when an I/O was not issued. Since the I/O > + * that was sent to the vdev layer might be different than the one > + * currently active in the pipeline (see vdev_queue_io()), we explicitly > + * force the underlying vdev layers to call either zio_execute() or > + * zio_interrupt() to ensure that the pipeline continues with the correct I/O. > + */ > static int > zio_vdev_io_start(zio_t *zio) > { > @@ -2575,7 +2590,8 @@ zio_vdev_io_start(zio_t *zio) > /* > * The mirror_ops handle multiple DVAs in a single BP. > */ > - return (vdev_mirror_ops.vdev_op_io_start(zio)); > + vdev_mirror_ops.vdev_op_io_start(zio); > + return (ZIO_PIPELINE_STOP); > } > > if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE && > @@ -2589,7 +2605,7 @@ zio_vdev_io_start(zio_t *zio) > * can quickly react to certain workloads. In particular, we care > * about non-scrubbing, top-level reads and writes with the following > * characteristics: > - * - synchronous writes of user data to non-slog devices > + * - synchronous writes of user data to non-slog devices > * - any reads of user data > * When these conditions are met, adjust the timestamp of spa_last_io > * which allows the scan thread to adjust its workload accordingly. > @@ -2693,10 +2709,8 @@ zio_vdev_io_start(zio_t *zio) > return (ZIO_PIPELINE_STOP); > } > > - ret = vd->vdev_ops->vdev_op_io_start(zio); > - ASSERT(ret == ZIO_PIPELINE_STOP); > - > - return (ret); > + vd->vdev_ops->vdev_op_io_start(zio); > + return (ZIO_PIPELINE_STOP); > } > > static int > From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 13:30:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7231061B; Sun, 9 Nov 2014 13:30:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53DDB9C8; Sun, 9 Nov 2014 13:30:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9DU3p8074526; Sun, 9 Nov 2014 13:30:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9DU3b6074525; Sun, 9 Nov 2014 13:30:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411091330.sA9DU3b6074525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 9 Nov 2014 13:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274309 - head/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 13:30:03 -0000 Author: trasz Date: Sun Nov 9 13:30:02 2014 New Revision: 274309 URL: https://svnweb.freebsd.org/changeset/base/274309 Log: Fix several nits in redirection handling - don't use wrong CSG, and avoid use-after-free. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sun Nov 9 13:01:09 2014 (r274308) +++ head/usr.sbin/ctld/login.c Sun Nov 9 13:30:02 2014 (r274309) @@ -620,11 +620,10 @@ login_redirect(struct pdu *request, cons struct keys *response_keys; response = login_new_response(request); + login_set_csg(response, login_csg(request)); bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs; bhslr2->bhslr_status_class = 0x01; bhslr2->bhslr_status_detail = 0x01; - login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); - login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); response_keys = keys_new(); keys_add(response_keys, "TargetAddress", target_address); @@ -679,7 +678,7 @@ login_negotiate(struct connection *conn, struct iscsi_bhs_login_response *bhslr2; struct keys *request_keys, *response_keys; int i; - bool skipped_security; + bool redirected, skipped_security; if (request == NULL) { log_debugx("beginning operational parameter negotiation; " @@ -689,6 +688,18 @@ login_negotiate(struct connection *conn, } else skipped_security = true; + /* + * RFC 3720, 10.13.5. Status-Class and Status-Detail, says + * the redirection SHOULD be accepted by the initiator before + * authentication, but MUST be be accepted afterwards; that's + * why we're doing it here and not earlier. + */ + redirected = login_target_redirect(conn, request); + if (redirected) { + log_debugx("initiator redirected; exiting"); + exit(0); + } + request_keys = keys_new(); keys_load(request_keys, request); @@ -876,12 +887,6 @@ login(struct connection *conn) keys_delete(request_keys); - redirected = login_target_redirect(conn, request); - if (redirected) { - log_debugx("initiator redirected; exiting"); - exit(0); - } - log_debugx("initiator skipped the authentication, " "and we don't need it; proceeding with negotiation"); login_negotiate(conn, request); @@ -893,12 +898,6 @@ login(struct connection *conn) * Initiator might want to to authenticate, * but we don't need it. */ - redirected = login_target_redirect(conn, request); - if (redirected) { - log_debugx("initiator redirected; exiting"); - exit(0); - } - log_debugx("authentication not required; " "transitioning to operational parameter negotiation"); @@ -987,17 +986,5 @@ login(struct connection *conn) login_chap(conn, ag); - /* - * RFC 3720, 10.13.5. Status-Class and Status-Detail, says - * the redirection SHOULD be accepted by the initiator before - * authentication, but MUST be be accepted afterwards; that's - * why we're doing it here and not earlier. - */ - redirected = login_target_redirect(conn, request); - if (redirected) { - log_debugx("initiator redirected; exiting"); - exit(0); - } - login_negotiate(conn, NULL); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 13:45:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92461863; Sun, 9 Nov 2014 13:45:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EEE6B24; Sun, 9 Nov 2014 13:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9Djaq2083154; Sun, 9 Nov 2014 13:45:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9DjatX083153; Sun, 9 Nov 2014 13:45:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411091345.sA9DjatX083153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 9 Nov 2014 13:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274310 - head/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 13:45:36 -0000 Author: trasz Date: Sun Nov 9 13:45:35 2014 New Revision: 274310 URL: https://svnweb.freebsd.org/changeset/base/274310 Log: Add HISTORY section to ctld(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.8 Modified: head/usr.sbin/ctld/ctld.8 ============================================================================== --- head/usr.sbin/ctld/ctld.8 Sun Nov 9 13:30:02 2014 (r274309) +++ head/usr.sbin/ctld/ctld.8 Sun Nov 9 13:45:35 2014 (r274310) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2014 +.Dd November 9, 2014 .Dt CTLD 8 .Os .Sh NAME @@ -105,6 +105,11 @@ utility exits 0 on success, and >0 if an .Xr ctl 4 , .Xr ctl.conf 5 , .Xr ctladm 8 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 10.0 . .Sh AUTHORS The .Nm From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 15:33:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06B264FB; Sun, 9 Nov 2014 15:33:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6DFE650; Sun, 9 Nov 2014 15:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9FXVLd033623; Sun, 9 Nov 2014 15:33:31 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9FXVJL033622; Sun, 9 Nov 2014 15:33:31 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201411091533.sA9FXVJL033622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 9 Nov 2014 15:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274312 - head/tools/tools/sysbuild 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 15:33:32 -0000 Author: phk Date: Sun Nov 9 15:33:31 2014 New Revision: 274312 URL: https://svnweb.freebsd.org/changeset/base/274312 Log: Handle full-path-resolutions to detect the magic-ness of the pkg port. Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Sun Nov 9 14:07:24 2014 (r274311) +++ head/tools/tools/sysbuild/sysbuild.sh Sun Nov 9 15:33:31 2014 (r274312) @@ -160,7 +160,6 @@ fi set -e log_it() ( - set +x a="$*" set `cat /tmp/_sb_log` TX=`date +%s` @@ -175,7 +174,6 @@ log_it() ( ports_recurse() ( - set +x t=$1 shift if [ "x$t" = "x." ] ; then @@ -218,7 +216,6 @@ ports_recurse() ( ) ports_build() ( - set +x ports_recurse . $PORTS_WE_WANT @@ -229,20 +226,24 @@ ports_build() ( t=`echo $p | sed 's,/usr/ports/,,'` pn=`cd $p && make package-name` - if pkg info $pn > /dev/null 2>&1 ; then - log_it "Already installed: $t ($pn)" - continue - fi - - if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" ] ; then + if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" -o \ + "x$p" == "x/freebsd/ports/ports-mgmt/pkg" ] ; then log_it "Very Special: $t ($pn)" + ( cd $p - make clean all install ${PORTS_OPTS} + make clean ${PORTS_OPTS} + make all ${PORTS_OPTS} + make install ${PORTS_OPTS} ) > _.$b 2>&1 < /dev/null continue fi + if pkg info $pn > /dev/null 2>&1 ; then + log_it "Already installed: $t ($pn)" + continue + fi + if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.txz ] ; then if [ "x$use_pkg" = "x-p" ] ; then log_it "Install $t ($pn)" @@ -380,7 +381,6 @@ done ####################################################################### if [ "x$1" = "xchroot_script" ] ; then - set +x set -e shift From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 15:52:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C86E82A; Sun, 9 Nov 2014 15:52:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5899383C; Sun, 9 Nov 2014 15:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9FqCnG042618; Sun, 9 Nov 2014 15:52:12 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9FqC5N042617; Sun, 9 Nov 2014 15:52:12 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201411091552.sA9FqC5N042617@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 9 Nov 2014 15:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274313 - head/sys/geom/bde 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 15:52:12 -0000 Author: phk Date: Sun Nov 9 15:52:11 2014 New Revision: 274313 URL: https://svnweb.freebsd.org/changeset/base/274313 Log: Translate the errno to gctl_error() texts. Spotted by: mwlucas Modified: head/sys/geom/bde/g_bde.c Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Sun Nov 9 15:33:31 2014 (r274312) +++ head/sys/geom/bde/g_bde.c Sun Nov 9 15:52:11 2014 (r274313) @@ -204,6 +204,23 @@ g_bde_create_geom(struct gctl_req *req, if (gp->softc != NULL) g_free(gp->softc); g_destroy_geom(gp); + switch (error) { + case ENOENT: + gctl_error(req, "Lock was destroyed"); + break; + case ESRCH: + gctl_error(req, "Lock was nuked"); + break; + case EINVAL: + gctl_error(req, "Could not open lock"); + break; + case ENOTDIR: + gctl_error(req, "Lock not found"); + break; + default: + gctl_error(req, "Could not open lock (%d)", error); + break; + } return; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 15:53:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58B0D9A5; Sun, 9 Nov 2014 15:53:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A30584A; Sun, 9 Nov 2014 15:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9FrUBU042800; Sun, 9 Nov 2014 15:53:30 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9FrTCO042798; Sun, 9 Nov 2014 15:53:29 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201411091553.sA9FrTCO042798@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 9 Nov 2014 15:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274314 - head/sbin/gbde 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 15:53:30 -0000 Author: phk Date: Sun Nov 9 15:53:29 2014 New Revision: 274314 URL: https://svnweb.freebsd.org/changeset/base/274314 Log: Report the 1-based key numbers rather than the 0-based ones to be consistent. Fix documentation for destroy command. Not sure how the wrong explanation happened. Spotted by: mwlucas Modified: head/sbin/gbde/gbde.8 head/sbin/gbde/gbde.c Modified: head/sbin/gbde/gbde.8 ============================================================================== --- head/sbin/gbde/gbde.8 Sun Nov 9 15:52:11 2014 (r274313) +++ head/sbin/gbde/gbde.8 Sun Nov 9 15:53:29 2014 (r274314) @@ -233,9 +233,23 @@ pass-phrase: .Pp .Dl "gbde setkey ada0s1f -n 2 -P foo -L key2.lockfile" .Pp -To destroy all copies of the masterkey: +To invalidate your own masterkey: +.Pp +.Dl "gbde nuke ada0s1f" +.Pp +This will overwrite your masterkey sector with zeros, and results in +a diagnostic if you try to use the key again. +You can also destroy the other three copies of the masterkey with the +-n argument. +.Pp +You can also invalidate your masterkey without leaving a tell-tale sector +full of zeros: .Pp .Dl "gbde destroy ada0s1f" +.Pp +This will overwrite the information fields in your masterkey sector, +encrypt it and write it back. +You get a (different) diagnostic if you try to use it. .Sh SEE ALSO .Xr gbde 4 , .Xr geom 4 Modified: head/sbin/gbde/gbde.c ============================================================================== --- head/sbin/gbde/gbde.c Sun Nov 9 15:52:11 2014 (r274313) +++ head/sbin/gbde/gbde.c Sun Nov 9 15:53:29 2014 (r274314) @@ -300,7 +300,6 @@ cmd_attach(const struct g_bde_softc *sc, gctl_ro_param(r, "key", 16, buf); close(ffd); } - /* gctl_dump(r, stdout); */ errstr = gctl_issue(r); if (errstr != NULL) errx(1, "Attach to %s failed: %s", dest, errstr); @@ -371,7 +370,7 @@ cmd_open(struct g_bde_softc *sc, int dfd if (error != 0) errx(1, "Error %d decrypting lock", error); if (nkey) - printf("Opened with key %u\n", *nkey); + printf("Opened with key %u\n", 1 + *nkey); return; } @@ -392,7 +391,7 @@ cmd_nuke(struct g_bde_key *gl, int dfd , free(sbuf); if (i != (int)gl->sectorsize) err(1, "write"); - printf("Nuked key %d\n", key); + printf("Nuked key %d\n", 1 + key); } static void @@ -493,7 +492,7 @@ cmd_destroy(struct g_bde_key *gl, int nk bzero(&gl->sector0, sizeof gl->sector0); bzero(&gl->sectorN, sizeof gl->sectorN); bzero(&gl->keyoffset, sizeof gl->keyoffset); - bzero(&gl->flags, sizeof gl->flags); + gl->flags &= GBDE_F_SECT0; bzero(gl->mkey, sizeof gl->mkey); for (i = 0; i < G_BDE_MAXKEYS; i++) if (i != nkey) From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 16:15:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE3C2EFF; Sun, 9 Nov 2014 16:15:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9ADC9F7; Sun, 9 Nov 2014 16:15:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9GFT1L052512; Sun, 9 Nov 2014 16:15:29 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9GFTL6052510; Sun, 9 Nov 2014 16:15:29 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411091615.sA9GFTL6052510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 9 Nov 2014 16:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274315 - in head/sys/netpfil: ipfw pf 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 16:15:29 -0000 Author: melifaro Date: Sun Nov 9 16:15:28 2014 New Revision: 274315 URL: https://svnweb.freebsd.org/changeset/base/274315 Log: Remove unused 'struct route' fields. Modified: head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 15:53:29 2014 (r274314) +++ head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 16:15:28 2014 (r274315) @@ -66,14 +66,12 @@ enum { */ struct _ip6dn_args { struct ip6_pktopts *opt_or; - struct route_in6 ro_or; int flags_or; struct ip6_moptions *im6o_or; struct ifnet *origifp_or; struct ifnet *ifp_or; struct sockaddr_in6 dst_or; u_long mtu_or; - struct route_in6 ro_pmtu_or; }; Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Nov 9 15:53:29 2014 (r274314) +++ head/sys/netpfil/pf/pf.c Sun Nov 9 16:15:28 2014 (r274315) @@ -140,14 +140,12 @@ struct pf_send_entry { PFSE_ICMP6, } pfse_type; union { - struct route ro; struct { int type; int code; int mtu; } icmpopts; } u; -#define pfse_ro u.ro #define pfse_icmp_type u.icmpopts.type #define pfse_icmp_code u.icmpopts.code #define pfse_icmp_mtu u.icmpopts.mtu From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 16:20:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8FD92EA; Sun, 9 Nov 2014 16:20:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A36AA3B; Sun, 9 Nov 2014 16:20:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9GKSVI054253; Sun, 9 Nov 2014 16:20:28 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9GKRQl054250; Sun, 9 Nov 2014 16:20:27 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411091620.sA9GKRQl054250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 9 Nov 2014 16:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274316 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 16:20:28 -0000 Author: melifaro Date: Sun Nov 9 16:20:27 2014 New Revision: 274316 URL: https://svnweb.freebsd.org/changeset/base/274316 Log: Remove unused 'struct route *' argument from nd6_output_flush(). Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Nov 9 16:15:28 2014 (r274315) +++ head/sys/netinet6/nd6.c Sun Nov 9 16:20:27 2014 (r274316) @@ -1763,7 +1763,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru ln = NULL; } if (chain) - nd6_output_flush(ifp, ifp, chain, &sin6, NULL); + nd6_output_flush(ifp, ifp, chain, &sin6); /* * When the link-layer address of a router changes, select the @@ -2156,7 +2156,7 @@ nd6_output_lle(struct ifnet *ifp, struct int nd6_output_flush(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain, - struct sockaddr_in6 *dst, struct route *ro) + struct sockaddr_in6 *dst) { struct mbuf *m, *m_head; struct ifnet *outifp; @@ -2171,7 +2171,7 @@ nd6_output_flush(struct ifnet *ifp, stru while (m_head) { m = m_head; m_head = m_head->m_nextpkt; - error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, ro); + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL); } /* Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Sun Nov 9 16:15:28 2014 (r274315) +++ head/sys/netinet6/nd6.h Sun Nov 9 16:20:27 2014 (r274316) @@ -413,7 +413,7 @@ int nd6_output_lle(struct ifnet *, struc struct sockaddr_in6 *, struct rtentry *, struct llentry *, struct mbuf **); int nd6_output_flush(struct ifnet *, struct ifnet *, struct mbuf *, - struct sockaddr_in6 *, struct route *); + struct sockaddr_in6 *); int nd6_need_cache(struct ifnet *); int nd6_add_ifa_lle(struct in6_ifaddr *); void nd6_rem_ifa_lle(struct in6_ifaddr *); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Nov 9 16:15:28 2014 (r274315) +++ head/sys/netinet6/nd6_nbr.c Sun Nov 9 16:20:27 2014 (r274316) @@ -921,7 +921,7 @@ nd6_na_input(struct mbuf *m, int off, in LLE_WUNLOCK(ln); if (chain) - nd6_output_flush(ifp, ifp, chain, &sin6, NULL); + nd6_output_flush(ifp, ifp, chain, &sin6); } if (checklink) pfxlist_onlink_check(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 16:29:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6F7A66B; Sun, 9 Nov 2014 16:29:33 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A47EB04; Sun, 9 Nov 2014 16:29:33 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA9GTRCX054337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Nov 2014 18:29:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA9GTRCX054337 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA9GTRtX054336; Sun, 9 Nov 2014 18:29:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 9 Nov 2014 18:29:27 +0200 From: Konstantin Belousov To: "Alexander V. Chernikov" Subject: Re: svn commit: r274315 - in head/sys/netpfil: ipfw pf Message-ID: <20141109162927.GA53947@kib.kiev.ua> References: <201411091615.sA9GFTL6052510@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411091615.sA9GFTL6052510@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 16:29:33 -0000 On Sun, Nov 09, 2014 at 04:15:29PM +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sun Nov 9 16:15:28 2014 > New Revision: 274315 > URL: https://svnweb.freebsd.org/changeset/base/274315 > > Log: > Remove unused 'struct route' fields. > > Modified: > head/sys/netpfil/ipfw/ip_fw_private.h > head/sys/netpfil/pf/pf.c > > Modified: head/sys/netpfil/ipfw/ip_fw_private.h > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 15:53:29 2014 (r274314) > +++ head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 16:15:28 2014 (r274315) > @@ -66,14 +66,12 @@ enum { > */ > struct _ip6dn_args { > struct ip6_pktopts *opt_or; > - struct route_in6 ro_or; > int flags_or; > struct ip6_moptions *im6o_or; > struct ifnet *origifp_or; > struct ifnet *ifp_or; > struct sockaddr_in6 dst_or; > u_long mtu_or; > - struct route_in6 ro_pmtu_or; > }; > > > > Modified: head/sys/netpfil/pf/pf.c > ============================================================================== > --- head/sys/netpfil/pf/pf.c Sun Nov 9 15:53:29 2014 (r274314) > +++ head/sys/netpfil/pf/pf.c Sun Nov 9 16:15:28 2014 (r274315) > @@ -140,14 +140,12 @@ struct pf_send_entry { > PFSE_ICMP6, > } pfse_type; > union { > - struct route ro; > struct { > int type; > int code; > int mtu; > } icmpopts; > } u; There is a single member of union u now. Is the union needed still ? > -#define pfse_ro u.ro > #define pfse_icmp_type u.icmpopts.type > #define pfse_icmp_code u.icmpopts.code > #define pfse_icmp_mtu u.icmpopts.mtu From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 17:01:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A016F84; Sun, 9 Nov 2014 17:01:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55BA1E0B; Sun, 9 Nov 2014 17:01:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9H1tP3076332; Sun, 9 Nov 2014 17:01:55 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9H1t7V076330; Sun, 9 Nov 2014 17:01:55 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411091701.sA9H1t7V076330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 9 Nov 2014 17:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274320 - head/sys/netpfil/pf 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 17:01:55 -0000 Author: melifaro Date: Sun Nov 9 17:01:54 2014 New Revision: 274320 URL: https://svnweb.freebsd.org/changeset/base/274320 Log: Finish r274315: remove union 'u' from struct pf_send_entry. Suggested by: kib Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Nov 9 16:58:36 2014 (r274319) +++ head/sys/netpfil/pf/pf.c Sun Nov 9 17:01:54 2014 (r274320) @@ -139,16 +139,11 @@ struct pf_send_entry { PFSE_ICMP, PFSE_ICMP6, } pfse_type; - union { - struct { - int type; - int code; - int mtu; - } icmpopts; - } u; -#define pfse_icmp_type u.icmpopts.type -#define pfse_icmp_code u.icmpopts.code -#define pfse_icmp_mtu u.icmpopts.mtu + struct { + int type; + int code; + int mtu; + } icmpopts; }; STAILQ_HEAD(pf_send_head, pf_send_entry); @@ -1368,8 +1363,8 @@ pf_intr(void *v) ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL); break; case PFSE_ICMP: - icmp_error(pfse->pfse_m, pfse->pfse_icmp_type, - pfse->pfse_icmp_code, 0, pfse->pfse_icmp_mtu); + icmp_error(pfse->pfse_m, pfse->icmpopts.type, + pfse->icmpopts.code, 0, pfse->icmpopts.mtu); break; #endif /* INET */ #ifdef INET6 @@ -1378,8 +1373,8 @@ pf_intr(void *v) NULL); break; case PFSE_ICMP6: - icmp6_error(pfse->pfse_m, pfse->pfse_icmp_type, - pfse->pfse_icmp_code, pfse->pfse_icmp_mtu); + icmp6_error(pfse->pfse_m, pfse->icmpopts.type, + pfse->icmpopts.code, pfse->icmpopts.mtu); break; #endif /* INET6 */ default: @@ -2411,8 +2406,8 @@ pf_send_icmp(struct mbuf *m, u_int8_t ty #endif /* INET6 */ } pfse->pfse_m = m0; - pfse->pfse_icmp_type = type; - pfse->pfse_icmp_code = code; + pfse->icmpopts.type = type; + pfse->icmpopts.code = code; pf_send(pfse); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 17:02:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFADD14B; Sun, 9 Nov 2014 17:02:34 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9144DE12; Sun, 9 Nov 2014 17:02:34 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XnRs6-000EZQ-Ba; Sun, 09 Nov 2014 16:45:34 +0400 Message-ID: <545F9D90.1000901@FreeBSD.org> Date: Sun, 09 Nov 2014 21:00:00 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r274315 - in head/sys/netpfil: ipfw pf References: <201411091615.sA9GFTL6052510@svn.freebsd.org> <20141109162927.GA53947@kib.kiev.ua> In-Reply-To: <20141109162927.GA53947@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 17:02:34 -0000 On 09.11.2014 20:29, Konstantin Belousov wrote: > On Sun, Nov 09, 2014 at 04:15:29PM +0000, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Sun Nov 9 16:15:28 2014 >> New Revision: 274315 >> URL: https://svnweb.freebsd.org/changeset/base/274315 >> >> Log: >> Remove unused 'struct route' fields. >> >> Modified: >> head/sys/netpfil/ipfw/ip_fw_private.h >> head/sys/netpfil/pf/pf.c >> >> Modified: head/sys/netpfil/ipfw/ip_fw_private.h >> ============================================================================== >> --- head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 15:53:29 2014 (r274314) >> +++ head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 16:15:28 2014 (r274315) >> @@ -66,14 +66,12 @@ enum { >> */ >> struct _ip6dn_args { >> struct ip6_pktopts *opt_or; >> - struct route_in6 ro_or; >> int flags_or; >> struct ip6_moptions *im6o_or; >> struct ifnet *origifp_or; >> struct ifnet *ifp_or; >> struct sockaddr_in6 dst_or; >> u_long mtu_or; >> - struct route_in6 ro_pmtu_or; >> }; >> >> >> >> Modified: head/sys/netpfil/pf/pf.c >> ============================================================================== >> --- head/sys/netpfil/pf/pf.c Sun Nov 9 15:53:29 2014 (r274314) >> +++ head/sys/netpfil/pf/pf.c Sun Nov 9 16:15:28 2014 (r274315) >> @@ -140,14 +140,12 @@ struct pf_send_entry { >> PFSE_ICMP6, >> } pfse_type; >> union { >> - struct route ro; >> struct { >> int type; >> int code; >> int mtu; >> } icmpopts; >> } u; > There is a single member of union u now. Is the union needed still ? No. Fixed in r274320, thank you! > >> -#define pfse_ro u.ro >> #define pfse_icmp_type u.icmpopts.type >> #define pfse_icmp_code u.icmpopts.code >> #define pfse_icmp_mtu u.icmpopts.mtu From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 17:07:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70D5D2AB; Sun, 9 Nov 2014 17:07:43 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F141DE2D; Sun, 9 Nov 2014 17:07:42 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA9H7bVj063299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Nov 2014 19:07:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA9H7bVj063299 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA9H7bTm063298; Sun, 9 Nov 2014 19:07:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 9 Nov 2014 19:07:37 +0200 From: Konstantin Belousov To: "Alexander V. Chernikov" Subject: Re: svn commit: r274315 - in head/sys/netpfil: ipfw pf Message-ID: <20141109170737.GB53947@kib.kiev.ua> References: <201411091615.sA9GFTL6052510@svn.freebsd.org> <20141109162927.GA53947@kib.kiev.ua> <545F9D90.1000901@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <545F9D90.1000901@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 17:07:43 -0000 On Sun, Nov 09, 2014 at 09:00:00PM +0400, Alexander V. Chernikov wrote: > On 09.11.2014 20:29, Konstantin Belousov wrote: > > On Sun, Nov 09, 2014 at 04:15:29PM +0000, Alexander V. Chernikov wrote: > >> Author: melifaro > >> Date: Sun Nov 9 16:15:28 2014 > >> New Revision: 274315 > >> URL: https://svnweb.freebsd.org/changeset/base/274315 > >> > >> Log: > >> Remove unused 'struct route' fields. > >> > >> Modified: > >> head/sys/netpfil/ipfw/ip_fw_private.h > >> head/sys/netpfil/pf/pf.c > >> > >> Modified: head/sys/netpfil/ipfw/ip_fw_private.h > >> ============================================================================== > >> --- head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 15:53:29 2014 (r274314) > >> +++ head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 16:15:28 2014 (r274315) > >> @@ -66,14 +66,12 @@ enum { > >> */ > >> struct _ip6dn_args { > >> struct ip6_pktopts *opt_or; > >> - struct route_in6 ro_or; > >> int flags_or; > >> struct ip6_moptions *im6o_or; > >> struct ifnet *origifp_or; > >> struct ifnet *ifp_or; > >> struct sockaddr_in6 dst_or; > >> u_long mtu_or; > >> - struct route_in6 ro_pmtu_or; > >> }; > >> > >> > >> > >> Modified: head/sys/netpfil/pf/pf.c > >> ============================================================================== > >> --- head/sys/netpfil/pf/pf.c Sun Nov 9 15:53:29 2014 (r274314) > >> +++ head/sys/netpfil/pf/pf.c Sun Nov 9 16:15:28 2014 (r274315) > >> @@ -140,14 +140,12 @@ struct pf_send_entry { > >> PFSE_ICMP6, > >> } pfse_type; > >> union { > >> - struct route ro; > >> struct { > >> int type; > >> int code; > >> int mtu; > >> } icmpopts; > >> } u; > > There is a single member of union u now. Is the union needed still ? > No. Fixed in r274320, thank you! Well, next question is why icmpopts is struct, instead of using directly members of the containing structure. It made sense when icmpopts was overlapped with ro, but for what it is kept around now ? > > > >> -#define pfse_ro u.ro > >> #define pfse_icmp_type u.icmpopts.type > >> #define pfse_icmp_code u.icmpopts.code > >> #define pfse_icmp_mtu u.icmpopts.mtu From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 18:13:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FDC1B90; Sun, 9 Nov 2014 18:13:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C27D697; Sun, 9 Nov 2014 18:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9ID9Jv009022; Sun, 9 Nov 2014 18:13:09 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9ID9li009021; Sun, 9 Nov 2014 18:13:09 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411091813.sA9ID9li009021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sun, 9 Nov 2014 18:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274322 - head/sbin/camcontrol 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 18:13:09 -0000 Author: bryanv Date: Sun Nov 9 18:13:08 2014 New Revision: 274322 URL: https://svnweb.freebsd.org/changeset/base/274322 Log: Attempt to report a better error if sanitize is not supported MFC after: 1 month Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Nov 9 17:32:07 2014 (r274321) +++ head/sbin/camcontrol/camcontrol.c Sun Nov 9 18:13:08 2014 (r274322) @@ -5827,15 +5827,31 @@ scsisanitize(struct cam_device *device, if (arglist & CAM_ARG_ERR_RECOVER) ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; - if (((retval = cam_send_ccb(device, ccb)) < 0) - || ((immediate == 0) - && ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP))) { - const char errstr[] = "error sending sanitize command"; + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending sanitize command"); + error = 1; + goto scsisanitize_bailout; + } - if (retval < 0) - warn(errstr); - else - warnx(errstr); + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + struct scsi_sense_data *sense; + int error_code, sense_key, asc, ascq; + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_SCSI_STATUS_ERROR) { + sense = &ccb->csio.sense_data; + scsi_extract_sense_len(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, &error_code, &sense_key, + &asc, &ascq, /*show_errors*/ 1); + + if (sense_key == SSD_KEY_ILLEGAL_REQUEST && + asc == 0x20 && ascq == 0x00) + warnx("sanitize is not supported by " + "this device"); + else + warnx("error sanitizing this device"); + } else + warnx("error sanitizing this device"); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 19:56:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E166029E; Sun, 9 Nov 2014 19:56:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD2BDFB3; Sun, 9 Nov 2014 19:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9JuQBN072471; Sun, 9 Nov 2014 19:56:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9JuQjV072470; Sun, 9 Nov 2014 19:56:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411091956.sA9JuQjV072470@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 9 Nov 2014 19:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274323 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 19:56:27 -0000 Author: ian Date: Sun Nov 9 19:56:26 2014 New Revision: 274323 URL: https://svnweb.freebsd.org/changeset/base/274323 Log: Fix an apparent mis-merge that happened in r274082. Before that, on the 10-stable branch, this makefile had WARNS=2, and on head the value is still 2, but in the MFC done in r274082 it got changed to 3, causing build failures when building with gcc. This direct commit to 10 goes back to WARNS=2. Modified: stable/10/usr.sbin/pw/Makefile Modified: stable/10/usr.sbin/pw/Makefile ============================================================================== --- stable/10/usr.sbin/pw/Makefile Sun Nov 9 18:13:08 2014 (r274322) +++ stable/10/usr.sbin/pw/Makefile Sun Nov 9 19:56:26 2014 (r274323) @@ -8,7 +8,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group. grupd.c pwupd.c fileupd.c psdate.c \ bitmap.c cpdir.c rm_r.c -WARNS?= 3 +WARNS?= 2 DPADD= ${LIBCRYPT} ${LIBUTIL} LDADD= -lcrypt -lutil From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 19:58:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80F9754A; Sun, 9 Nov 2014 19:58:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C394699DC; Sun, 9 Nov 2014 19:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9JwVpg072812; Sun, 9 Nov 2014 19:58:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9JwVrs072811; Sun, 9 Nov 2014 19:58:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411091958.sA9JwVrs072811@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 9 Nov 2014 19:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274324 - head/sys/amd64/amd64 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 19:58:31 -0000 Author: glebius Date: Sun Nov 9 19:58:30 2014 New Revision: 274324 URL: https://svnweb.freebsd.org/changeset/base/274324 Log: Remove unused includes. Reviewed by: kib Modified: head/sys/amd64/amd64/genassym.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sun Nov 9 19:56:26 2014 (r274323) +++ head/sys/amd64/amd64/genassym.c Sun Nov 9 19:58:30 2014 (r274324) @@ -61,11 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 20:04:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BFCC88F; Sun, 9 Nov 2014 20:04:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17EC569AEA; Sun, 9 Nov 2014 20:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9K4CmV077197; Sun, 9 Nov 2014 20:04:12 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9K4ChE077196; Sun, 9 Nov 2014 20:04:12 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411092004.sA9K4ChE077196@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sun, 9 Nov 2014 20:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274325 - head/sys/dev/virtio/network 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 20:04:13 -0000 Author: bryanv Date: Sun Nov 9 20:04:12 2014 New Revision: 274325 URL: https://svnweb.freebsd.org/changeset/base/274325 Log: Enable LRO by default when available on vtnet interfaces The prior change to not enable LRO by default has confused several people. The configurations where LRO is problematic is not the typical use case for VirtIO, and due to other issues, this often requires checksum offloading to be disabled anyways. PR: 185864 MFC after: 2 weeks Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sun Nov 9 19:58:30 2014 (r274324) +++ head/sys/dev/virtio/network/if_vtnet.c Sun Nov 9 20:04:12 2014 (r274325) @@ -967,9 +967,14 @@ vtnet_setup_interface(struct vtnet_softc ifp->if_capabilities |= IFCAP_VLAN_HWTSO; } - if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_CSUM)) + if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_CSUM)) { ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; + if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO4) || + virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO6)) + ifp->if_capabilities |= IFCAP_LRO; + } + if (ifp->if_capabilities & IFCAP_HWCSUM) { /* * VirtIO does not support VLAN tagging, but we can fake @@ -987,12 +992,6 @@ vtnet_setup_interface(struct vtnet_softc * Capabilities after here are not enabled by default. */ - if (ifp->if_capabilities & IFCAP_RXCSUM) { - if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO4) || - virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO6)) - ifp->if_capabilities |= IFCAP_LRO; - } - if (sc->vtnet_flags & VTNET_FLAG_VLAN_FILTER) { ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 20:04:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C30C09CF; Sun, 9 Nov 2014 20:04:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A43AB69AF1; Sun, 9 Nov 2014 20:04:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9K4Ujx077293; Sun, 9 Nov 2014 20:04:30 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9K4Tl4077286; Sun, 9 Nov 2014 20:04:29 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201411092004.sA9K4Tl4077286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Sun, 9 Nov 2014 20:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274326 - in stable/10/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 20:04:30 -0000 Author: jpaetzel Date: Sun Nov 9 20:04:29 2014 New Revision: 274326 URL: https://svnweb.freebsd.org/changeset/base/274326 Log: MFC: 273641 This change addresses 4 bugs in ZFS exposed by Richard Kojedzinszky's crash.sh script attached to FreeNAS bug 4109: https://bugs.freenas.org/issues/4109 Three are in the snapshot layer: a) AVG explains in his notes: https://wiki.freebsd.org/AvgVfsSolarisVsFreeBSD "VOP_INACTIVE must not do any destructive actions to a vnode and its filesystem node, nor invalidate them in any way." gfs_vop_inactive and zfsctl_snapshot_inactive did just that. In OpenSolaris VOP_INACTIVE is much closer to FreeBSD's VOP_RECLAIM. Rename & move them to gfs_vop_reclaim and zfsctl_snapshot_reclaim and merge in the requisite vnode_destroy from zfsctl_common_reclaim. b) gfs_lookup_dot and various zfsctl functions do not honor the FreeBSD VFS convention of only locking from the root downward. When looking up ".." the convention is to drop the current leaf vnode lock before acquiring the directory vnode and then subsequently re-acquiring the lock on the leaf vnode. This fixes that in all the places that our exercised by crash.sh. c) The snapshot may already be unmounted when the directory vnode is reclaimed. Check for this case and return. One in the common layer: d) Callers of traverse expect the reference to the vnode passed in to be maintained. Don't release it. This last one may be an unclear contract. There may in fact be some callers that do expect the reference to be dropped on success in addition to callers that expect it to be released. In this case a further audit of the callers is needed and a consensus on the correct behavior. PR: 184677 Submitted by: kmacy Reviewed by: delphij, will, avg Sponsored by: iXsystems Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sun Nov 9 20:04:12 2014 (r274325) +++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sun Nov 9 20:04:29 2014 (r274326) @@ -91,11 +91,11 @@ traverse(vnode_t **cvpp, int lktype) error = vfs_busy(vfsp, 0); /* * tvp is NULL for *cvpp vnode, which we can't unlock. + * At least some callers expect the reference to be + * maintained to the original *cvpp */ if (tvp != NULL) vput(cvp); - else - vrele(cvp); if (error) return (error); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sun Nov 9 20:04:12 2014 (r274325) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sun Nov 9 20:04:29 2014 (r274326) @@ -90,7 +90,7 @@ * gfs_dir_lookup() * gfs_dir_readdir() * - * gfs_vop_inactive() + * gfs_vop_reclaim() * gfs_vop_lookup() * gfs_vop_readdir() * gfs_vop_map() @@ -435,6 +435,8 @@ gfs_readdir_fini(gfs_readdir_state_t *st int gfs_lookup_dot(vnode_t **vpp, vnode_t *dvp, vnode_t *pvp, const char *nm) { + int ltype; + if (*nm == '\0' || strcmp(nm, ".") == 0) { VN_HOLD(dvp); *vpp = dvp; @@ -444,11 +446,15 @@ gfs_lookup_dot(vnode_t **vpp, vnode_t *d ASSERT(dvp->v_flag & VROOT); VN_HOLD(dvp); *vpp = dvp; + ASSERT_VOP_ELOCKED(dvp, "gfs_lookup_dot: non-locked dvp"); } else { + ltype = VOP_ISLOCKED(dvp); + VOP_UNLOCK(dvp, 0); VN_HOLD(pvp); *vpp = pvp; + vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(dvp, ltype | LK_RETRY); } - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); return (0); } @@ -618,7 +624,7 @@ gfs_root_create_file(size_t size, vfs_t /* * gfs_file_inactive() * - * Called from the VOP_INACTIVE() routine. If necessary, this routine will + * Called from the VOP_RECLAIM() routine. If necessary, this routine will * remove the given vnode from the parent directory and clean up any references * in the VFS layer. * @@ -1215,15 +1221,15 @@ gfs_vop_map(vnode_t *vp, offset_t off, s #endif /* sun */ /* - * gfs_vop_inactive: VOP_INACTIVE() entry point + * gfs_vop_reclaim: VOP_RECLAIM() entry point (solaris' VOP_INACTIVE()) * * Given a vnode that is a GFS file or directory, call gfs_file_inactive() or * gfs_dir_inactive() as necessary, and kmem_free()s associated private data. */ /* ARGSUSED */ int -gfs_vop_inactive(ap) - struct vop_inactive_args /* { +gfs_vop_reclaim(ap) + struct vop_reclaim_args /* { struct vnode *a_vp; struct thread *a_td; } */ *ap; @@ -1236,6 +1242,7 @@ gfs_vop_inactive(ap) else gfs_file_inactive(vp); + vnode_destroy_vobject(vp); VI_LOCK(vp); vp->v_data = NULL; VI_UNLOCK(vp); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Nov 9 20:04:12 2014 (r274325) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Nov 9 20:04:29 2014 (r274326) @@ -603,16 +603,27 @@ zfsctl_freebsd_root_lookup(ap) int nameiop = ap->a_cnp->cn_nameiop; char nm[NAME_MAX + 1]; int err; + int ltype; if ((flags & ISLASTCN) && (nameiop == RENAME || nameiop == CREATE)) return (EOPNOTSUPP); ASSERT(ap->a_cnp->cn_namelen < sizeof(nm)); strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1); - err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, NULL); - if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) + if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) { + ltype = VOP_ISLOCKED(dvp); + if (flags & ISDOTDOT) { + VN_HOLD(*vpp); + VOP_UNLOCK(dvp, 0); + } vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + if (flags & ISDOTDOT) { + VN_RELE(*vpp); + vn_lock(dvp, ltype| LK_RETRY); + } + } + return (err); } @@ -625,8 +636,8 @@ static struct vop_vector zfsctl_ops_root .vop_access = zfsctl_common_access, .vop_readdir = gfs_vop_readdir, .vop_lookup = zfsctl_freebsd_root_lookup, - .vop_inactive = gfs_vop_inactive, - .vop_reclaim = zfsctl_common_reclaim, + .vop_inactive = VOP_NULL, + .vop_reclaim = gfs_vop_reclaim, #ifdef TODO .vop_pathconf = zfsctl_pathconf, #endif @@ -679,7 +690,7 @@ zfsctl_unmount_snap(zfs_snapentry_t *sep * the sd_lock mutex held by our caller. */ ASSERT(svp->v_count == 1); - gfs_vop_inactive(svp, cr, NULL); + gfs_vop_reclaim(svp, cr, NULL); kmem_free(sep->se_name, strlen(sep->se_name) + 1); kmem_free(sep, sizeof (zfs_snapentry_t)); @@ -949,7 +960,7 @@ zfsctl_snapdir_lookup(ap) avl_index_t where; zfsvfs_t *zfsvfs = dvp->v_vfsp->vfs_data; int err; - int flags = 0; + int ltype, flags = 0; /* * No extended attributes allowed under .zfs @@ -973,7 +984,6 @@ zfsctl_snapdir_lookup(ap) return (SET_ERROR(ENOENT)); ZFS_ENTER(zfsvfs); - if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) { ZFS_EXIT(zfsvfs); return (0); @@ -1420,8 +1430,8 @@ static struct vop_vector zfsctl_ops_shar .vop_access = zfsctl_common_access, .vop_readdir = zfsctl_shares_readdir, .vop_lookup = zfsctl_shares_lookup, - .vop_inactive = gfs_vop_inactive, - .vop_reclaim = zfsctl_common_reclaim, + .vop_inactive = VOP_NULL, + .vop_reclaim = gfs_vop_reclaim, .vop_fid = zfsctl_shares_fid, }; #endif /* !sun */ @@ -1449,8 +1459,9 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin return (vp); } + static int -zfsctl_snapshot_inactive(ap) +zfsctl_snapshot_reclaim(ap) struct vop_inactive_args /* { struct vnode *a_vp; struct thread *a_td; @@ -1458,19 +1469,20 @@ zfsctl_snapshot_inactive(ap) { vnode_t *vp = ap->a_vp; cred_t *cr = ap->a_td->td_ucred; - struct vop_inactive_args iap; + struct vop_reclaim_args iap; zfsctl_snapdir_t *sdp; zfs_snapentry_t *sep, *next; int locked; vnode_t *dvp; - if (vp->v_count > 0) - goto end; - VERIFY(gfs_dir_lookup(vp, "..", &dvp, cr, 0, NULL, NULL) == 0); sdp = dvp->v_data; VOP_UNLOCK(dvp, 0); - + /* this may already have been unmounted */ + if (sdp == NULL) { + VN_RELE(dvp); + return (0); + } if (!(locked = MUTEX_HELD(&sdp->sd_lock))) mutex_enter(&sdp->sd_lock); @@ -1494,7 +1506,6 @@ zfsctl_snapshot_inactive(ap) mutex_exit(&sdp->sd_lock); VN_RELE(dvp); -end: /* * Dispose of the vnode for the snapshot mount point. * This is safe to do because once this entry has been removed @@ -1503,7 +1514,9 @@ end: * creating a new vnode. */ iap.a_vp = vp; - return (gfs_vop_inactive(&iap)); + gfs_vop_reclaim(&iap); + return (0); + } static int @@ -1587,8 +1600,15 @@ zfsctl_snapshot_lookup(ap) error = zfsctl_root_lookup(zfsvfs->z_ctldir, "snapshot", vpp, NULL, 0, NULL, cr, NULL, NULL, NULL); - if (error == 0) + if (error == 0) { + int ltype = VOP_ISLOCKED(dvp); + VN_HOLD(*vpp); + VOP_UNLOCK(dvp, 0); vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + VN_RELE(*vpp); + vn_lock(dvp, ltype | LK_RETRY); + } + return (error); } @@ -1640,9 +1660,9 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc */ static struct vop_vector zfsctl_ops_snapshot = { .vop_default = &default_vnodeops, - .vop_inactive = zfsctl_snapshot_inactive, + .vop_inactive = VOP_NULL, .vop_lookup = zfsctl_snapshot_lookup, - .vop_reclaim = zfsctl_common_reclaim, + .vop_reclaim = zfsctl_snapshot_reclaim, .vop_getattr = zfsctl_snapshot_getattr, .vop_fid = zfsctl_snapshot_fid, .vop_vptocnp = zfsctl_snapshot_vptocnp, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h Sun Nov 9 20:04:12 2014 (r274325) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h Sun Nov 9 20:04:29 2014 (r274326) @@ -149,7 +149,7 @@ extern int gfs_get_parent_ino(vnode_t *, extern int gfs_lookup_dot(vnode_t **, vnode_t *, vnode_t *, const char *); extern int gfs_vop_readdir(struct vop_readdir_args *); -extern int gfs_vop_inactive(struct vop_inactive_args *); +extern int gfs_vop_reclaim(struct vop_reclaim_args *); #ifdef __cplusplus From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 20:08:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC09FB42; Sun, 9 Nov 2014 20:08:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B71B069B1B; Sun, 9 Nov 2014 20:08:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9K8iDO077926; Sun, 9 Nov 2014 20:08:44 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9K8i6J077923; Sun, 9 Nov 2014 20:08:44 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201411092008.sA9K8i6J077923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Sun, 9 Nov 2014 20:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274327 - in stable/10: etc/rc.d share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 20:08:44 -0000 Author: jpaetzel Date: Sun Nov 9 20:08:43 2014 New Revision: 274327 URL: https://svnweb.freebsd.org/changeset/base/274327 Log: MFC: 258080 Add support for multiple instances of ftp-proxy and pflog devices. PR: conf/158171 Submitted by: Thomas Johnson Modified: stable/10/etc/rc.d/ftp-proxy stable/10/etc/rc.d/pflog stable/10/share/man/man5/rc.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/ftp-proxy ============================================================================== --- stable/10/etc/rc.d/ftp-proxy Sun Nov 9 20:04:29 2014 (r274326) +++ stable/10/etc/rc.d/ftp-proxy Sun Nov 9 20:08:43 2014 (r274327) @@ -14,4 +14,62 @@ rcvar="ftpproxy_enable" command="/usr/sbin/ftp-proxy" load_rc_config $name -run_rc_command "$1" + +# +# manage_pid argument +# Create or remove a pidfile manually, for daemons that can't be bothered +# to do it themselves. Takes one argument, which is the argument provided +# to the rc script. The pidfile will be named /var/run/<$name>.pid, +# unless $pidfile is defined. +# +# The method used to determine the pid is rather hacky; grep ps output to +# find '$procname|$command', then grep for ${name}_flags. If at all +# possible, use another method if at all possible, to avoid that dirty- +# code feeling. +# +manage_pid() { + local search_string ps_pid + case $1 in + *start) + cmd_string=`basename ${procname:-${command}}` + eval flag_string=\"\$${name}_flags\" + # Determine the pid. + ps_pid=`ps ax -o pid= -o command= | grep $cmd_string | grep -e "$flag_string" | grep -v grep | awk '{ print $1 }'` + # Write the pidfile depending on $pidfile status. + echo $ps_pid > ${pidfile:-"/var/run/$name.pid"} + ;; + stop) + rm $pidfile + ;; + esac +} + +# Allow ftp-proxy to start up in two different ways. The typical behavior +# is to start up one instance of ftp-proxy by setting ftpproxy_enable and +# ftpproxy_flags. The alternate behavior allows multiple instances of ftp- +# proxy to be started, allowing different types of proxy behavior. To use the +# new behavior, a list of instances must be defined, and a list of flags for +# each instance. For example, if we want to start two instances of ftp-proxy, +# foo and bar, we would set the following vars. +# ftpproxy_enable="YES" +# ftpproxy_instances="foo bar" +# ftpproxy_foo="" +# ftpproxy_bar="" +# +# Starting more than one ftp-proxy? +if [ "$ftpproxy_instances" ] && [ -n "${ftpproxy_instances}" ]; then + # Iterate through instance list. + for i in $ftpproxy_instances; do + #eval ftpproxy_${i}_flags=\$ftpproxy_${i} + #eval name=ftpproxy_${i} + # Set flags for this instance. + eval ftpproxy_flags=\$ftpproxy_${i} + # Define a unique pid file name. + pidfile="/var/run/ftp-proxy.$i.pid" + run_rc_command "$1" + manage_pid $1 + done +else + # Traditional single-instance behavior + run_rc_command "$1" +fi Modified: stable/10/etc/rc.d/pflog ============================================================================== --- stable/10/etc/rc.d/pflog Sun Nov 9 20:04:29 2014 (r274326) +++ stable/10/etc/rc.d/pflog Sun Nov 9 20:08:43 2014 (r274327) @@ -24,25 +24,41 @@ pflog_prestart() { load_kld pflog || return 1 - # set pflog0 interface to up state - if ! ifconfig pflog0 up; then - warn 'could not bring up pflog0.' + # set pflog_dev interface to up state + if ! ifconfig $pflog_dev up; then + warn "could not bring up $pflog_dev." return 1 fi # prepare the command line for pflogd - rc_flags="-f $pflog_logfile $rc_flags" + rc_flags="-f $pflog_logfile -i $pflog_dev $rc_flags" # report we're ready to run pflogd return 0 } +pflog_poststart() { + # Allow child pflogd to settle + sleep 0.10 + # More elegant(?) method for getting a unique pid + if [ -f /var/run/pflogd.pid ]; then + mv /var/run/pflogd.pid $pidfile + else + warn "/var/run/pflogd.pid does not exist. Too fast." + fi +} + pflog_poststop() { - if ! ifconfig pflog0 down; then - warn 'could not bring down pflog0.' + if ! ifconfig $pflog_dev down; then + warn "could not bring down $pflog_dev." return 1 fi + + if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then + rm $pidfile + fi + return 0 } @@ -53,4 +69,33 @@ pflog_resync() } load_rc_config $name -run_rc_command "$1" + +# Check if spawning multiple pflogd +echo "Starting pflogd: $pflog_instances" +if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then + start_postcmd="pflog_poststart" + # Interate through requested instances. + for i in $pflog_instances; do + # Set required variables + eval pflog_dev=\$pflog_${i}_dev + eval pflog_logfile=\$pflog_${i}_logfile + eval pflog_flags=\$pflog_${i}_flags + # Check that required vars have non-zero length, warn if not. + if [ -z $pflog_dev ]; then + warn "pflog_dev not set" + continue + fi + if [ -z $pflog_logfile ]; then + warn "pflog_logfile not set" + continue + fi + # pflogd sets a pidfile, but the name is hardcoded. Concoct a + # unique pidfile name. + pidfile="/var/run/pflogd.$i.pid" + run_rc_command "$1" + done +else + # Typical case, spawn single instance only. + pflog_dev=${pflog_dev:-"pflog0"} + run_rc_command "$1" +fi Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Sun Nov 9 20:04:29 2014 (r274326) +++ stable/10/share/man/man5/rc.conf.5 Sun Nov 9 20:08:43 2014 (r274327) @@ -936,6 +936,33 @@ Empty by default. This variable contains additional flags passed to the .Xr pflogd 8 program. +.It Va pflog_instances +.Pq Vt str +If logging to more than one +.Xr pflog 4 +interface is desired, +.Va pflog_instances +is set to the list of +.Xr pflogd 8 +instances that should be started at system boot time. If +.Va pflog_instances +is set, for each whitespace-seperated +.Ar element +in the list, +.Ao Ar element Ac Ns Va _dev +and +.Ao Ar element Ac Ns Va _logfile +elements are assumed to exist. +.Ao Ar element Ac Ns Va _dev +must contain the +.Xr pflog 4 +interface to be watched by the named +.Xr pflogd 8 +instance. +.Ao Ar element Ac Ns Va _logfile +must contain the name of the logfile that will be used by the +.Xr pflogd 8 +instance. .It Va ftpproxy_enable .Pq Vt bool Set to @@ -954,6 +981,19 @@ Empty by default. This variable contains additional flags passed to the .Xr ftp-proxy 8 program. +.It Va ftpproxy_instances +.Pq Vt str +Empty by default. If multiple instances of +.Xr ftp-proxy 8 +are desired at boot time, +.Va ftpproxy_instances +should contain a whitespace-seperated list of instance names. For each +.Ar element +in the list, a variable named +.Ao Ar element Ac Ns Va _flags +should be defined, containing the command-line flags to be passed to the +.Xr ftp-proxy 8 +instance. .It Va pfsync_enable .Pq Vt bool Set to From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 20:39:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FCF1410; Sun, 9 Nov 2014 20:39:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4073069E21; Sun, 9 Nov 2014 20:39:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9Kd91p092407; Sun, 9 Nov 2014 20:39:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9Kd8wR092404; Sun, 9 Nov 2014 20:39:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411092039.sA9Kd8wR092404@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Nov 2014 20:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274328 - in head/usr.sbin: ctld iscsid 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 20:39:09 -0000 Author: mav Date: Sun Nov 9 20:39:08 2014 New Revision: 274328 URL: https://svnweb.freebsd.org/changeset/base/274328 Log: Make both iSCSI initiator and target support base64 encoded CHAP data. While all tested initiators and targets use hex-encoded CHAP data, RFC also allows base64 encoding there, and Microsoft certificaition tool uses it. Reviewed by: trasz (earlier version) MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/ctld/chap.c head/usr.sbin/iscsid/chap.c Modified: head/usr.sbin/ctld/chap.c ============================================================================== --- head/usr.sbin/ctld/chap.c Sun Nov 9 20:08:43 2014 (r274327) +++ head/usr.sbin/ctld/chap.c Sun Nov 9 20:39:08 2014 (r274328) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -105,6 +107,29 @@ chap_hex2int(const char hex) } } +static int +chap_b642bin(const char *b64, void **binp, size_t *bin_lenp) +{ + char *bin; + int b64_len, bin_len; + + b64_len = strlen(b64); + bin_len = (b64_len + 3) / 4 * 3; + bin = calloc(bin_len, 1); + if (bin == NULL) + log_err(1, "calloc"); + + bin_len = b64_pton(b64, bin, bin_len); + if (bin_len < 0) { + log_warnx("malformed base64 variable"); + free(bin); + return (-1); + } + *binp = bin; + *bin_lenp = bin_len; + return (0); +} + /* * XXX: Review this _carefully_. */ @@ -116,8 +141,12 @@ chap_hex2bin(const char *hex, void **bin char *bin; size_t bin_off, bin_len; + if (strncasecmp(hex, "0b", strlen("0b")) == 0) + return (chap_b642bin(hex + 2, binp, bin_lenp)); + if (strncasecmp(hex, "0x", strlen("0x")) != 0) { - log_warnx("malformed variable, should start with \"0x\""); + log_warnx("malformed variable, should start with \"0x\"" + " or \"0b\""); return (-1); } @@ -160,6 +189,25 @@ chap_hex2bin(const char *hex, void **bin return (0); } +#ifdef USE_BASE64 +static char * +chap_bin2hex(const char *bin, size_t bin_len) +{ + unsigned char *b64, *tmp; + size_t b64_len; + + b64_len = (bin_len + 2) / 3 * 4 + 3; /* +2 for "0b", +1 for '\0'. */ + b64 = malloc(b64_len); + if (b64 == NULL) + log_err(1, "malloc"); + + tmp = b64; + tmp += sprintf(tmp, "0b"); + b64_ntop(bin, bin_len, tmp, b64_len - 2); + + return (b64); +} +#else static char * chap_bin2hex(const char *bin, size_t bin_len) { @@ -181,6 +229,7 @@ chap_bin2hex(const char *bin, size_t bin return (hex); } +#endif /* !USE_BASE64 */ struct chap * chap_new(void) Modified: head/usr.sbin/iscsid/chap.c ============================================================================== --- head/usr.sbin/iscsid/chap.c Sun Nov 9 20:08:43 2014 (r274327) +++ head/usr.sbin/iscsid/chap.c Sun Nov 9 20:39:08 2014 (r274328) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -105,6 +107,29 @@ chap_hex2int(const char hex) } } +static int +chap_b642bin(const char *b64, void **binp, size_t *bin_lenp) +{ + char *bin; + int b64_len, bin_len; + + b64_len = strlen(b64); + bin_len = (b64_len + 3) / 4 * 3; + bin = calloc(bin_len, 1); + if (bin == NULL) + log_err(1, "calloc"); + + bin_len = b64_pton(b64, bin, bin_len); + if (bin_len < 0) { + log_warnx("malformed base64 variable"); + free(bin); + return (-1); + } + *binp = bin; + *bin_lenp = bin_len; + return (0); +} + /* * XXX: Review this _carefully_. */ @@ -116,8 +141,12 @@ chap_hex2bin(const char *hex, void **bin char *bin; size_t bin_off, bin_len; + if (strncasecmp(hex, "0b", strlen("0b")) == 0) + return (chap_b642bin(hex + 2, binp, bin_lenp)); + if (strncasecmp(hex, "0x", strlen("0x")) != 0) { - log_warnx("malformed variable, should start with \"0x\""); + log_warnx("malformed variable, should start with \"0x\"" + " or \"0b\""); return (-1); } @@ -160,6 +189,25 @@ chap_hex2bin(const char *hex, void **bin return (0); } +#ifdef USE_BASE64 +static char * +chap_bin2hex(const char *bin, size_t bin_len) +{ + unsigned char *b64, *tmp; + size_t b64_len; + + b64_len = (bin_len + 2) / 3 * 4 + 3; /* +2 for "0b", +1 for '\0'. */ + b64 = malloc(b64_len); + if (b64 == NULL) + log_err(1, "malloc"); + + tmp = b64; + tmp += sprintf(tmp, "0b"); + b64_ntop(bin, bin_len, tmp, b64_len - 2); + + return (b64); +} +#else static char * chap_bin2hex(const char *bin, size_t bin_len) { @@ -181,6 +229,7 @@ chap_bin2hex(const char *bin, size_t bin return (hex); } +#endif /* !USE_BASE64 */ struct chap * chap_new(void) From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 20:43:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99711612; Sun, 9 Nov 2014 20:43:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85E0569EDE; Sun, 9 Nov 2014 20:43:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9KhpAR096431; Sun, 9 Nov 2014 20:43:51 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9KhpZe096430; Sun, 9 Nov 2014 20:43:51 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201411092043.sA9KhpZe096430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sun, 9 Nov 2014 20:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274329 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 20:43:51 -0000 Author: netchild Date: Sun Nov 9 20:43:50 2014 New Revision: 274329 URL: https://svnweb.freebsd.org/changeset/base/274329 Log: We moved to ada a while ago, reflect that in the example. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Nov 9 20:39:08 2014 (r274328) +++ head/UPDATING Sun Nov 9 20:43:50 2014 (r274329) @@ -833,8 +833,8 @@ COMMON ITEMS: 2.) update the ZFS boot block on your boot drive The following example updates the ZFS boot block on the first - partition (freebsd-boot) of a GPT partitioned drive ad0: - "gpart bootcode -p /boot/gptzfsboot -i 1 ad0" + partition (freebsd-boot) of a GPT partitioned drive ada0: + "gpart bootcode -p /boot/gptzfsboot -i 1 ada0" Non-boot pools do not need these updates. From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 21:08:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66526F29; Sun, 9 Nov 2014 21:08:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52A9E1C2; Sun, 9 Nov 2014 21:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9L8rP0007092; Sun, 9 Nov 2014 21:08:53 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9L8rAh007091; Sun, 9 Nov 2014 21:08:53 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201411092108.sA9L8rAh007091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Sun, 9 Nov 2014 21:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274330 - head/usr.sbin/bhyve 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 21:08:53 -0000 Author: tychon Date: Sun Nov 9 21:08:52 2014 New Revision: 274330 URL: https://svnweb.freebsd.org/changeset/base/274330 Log: To allow a request to be submitted from within the callback routine of a completing one increase the total by 1 but don't advertise it. Reviewed by: grehan Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Sun Nov 9 20:43:50 2014 (r274329) +++ head/usr.sbin/bhyve/block_if.c Sun Nov 9 21:08:52 2014 (r274330) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 -#define BLOCKIF_MAXREQ 32 +#define BLOCKIF_MAXREQ 33 enum blockop { BOP_READ, @@ -600,7 +600,7 @@ blockif_queuesz(struct blockif_ctxt *bc) { assert(bc->bc_magic == BLOCKIF_SIG); - return (BLOCKIF_MAXREQ); + return (BLOCKIF_MAXREQ - 1); } int From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 21:33:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 717E7BF9; Sun, 9 Nov 2014 21:33:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59C876B2; Sun, 9 Nov 2014 21:33:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9LXHWW021168; Sun, 9 Nov 2014 21:33:17 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9LX2FI021044; Sun, 9 Nov 2014 21:33:02 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411092133.sA9LX2FI021044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 9 Nov 2014 21:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274331 - in head: . etc etc/defaults etc/rc.d lib/libc/net release/picobsd/bridge release/picobsd/qemu share/man/man4 share/man/man5 sys/amd64/conf sys/arm/conf sys/boot/forth 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 21:33:17 -0000 Author: melifaro Date: Sun Nov 9 21:33:01 2014 New Revision: 274331 URL: https://svnweb.freebsd.org/changeset/base/274331 Log: Renove faith(4) and faithd(8) from base. It looks like industry have chosen different (and more traditional) stateless/statuful NAT64 as translation mechanism. Last non-trivial commits to both faith(4) and faithd(8) happened more than 12 years ago, so I assume it is time to drop RFC3142 in FreeBSD. No objections from: net@ Deleted: head/etc/rc.d/faith head/share/man/man4/faith.4 head/sys/modules/if_faith/ head/sys/net/if_faith.c head/usr.sbin/faithd/ Modified: head/ObsoleteFiles.inc head/UPDATING head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/Makefile head/etc/rc.d/NETWORKING head/etc/rc.d/bridge head/etc/rc.d/defaultroute head/etc/rc.d/routing head/lib/libc/net/getaddrinfo.c head/lib/libc/net/getnameinfo.c head/release/picobsd/bridge/PICOBSD head/release/picobsd/qemu/PICOBSD head/share/man/man4/Makefile head/share/man/man4/inet6.4 head/share/man/man4/ip6.4 head/share/man/man5/rc.conf.5 head/sys/amd64/conf/GENERIC head/sys/arm/conf/ATMEL head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/SAM9260EK head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX head/sys/i386/conf/XEN head/sys/mips/conf/GXEMUL head/sys/mips/conf/GXEMUL32 head/sys/mips/conf/OCTEON1 head/sys/mips/rmi/rootfs_list.txt head/sys/modules/Makefile head/sys/net/if_types.h head/sys/netinet/in.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h head/sys/netinet6/raw_ip6.c head/sys/netinet6/sctp6_usrreq.c head/sys/netinet6/udp6_usrreq.c head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/WII head/sys/sparc64/conf/GENERIC head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/tools/nanobsd/pcengines/ALIX_DSK head/tools/tools/nanobsd/pcengines/ALIX_NFS head/tools/tools/sysdoc/tunables.mdoc head/tools/tools/tinybsd/conf/default/TINYBSD head/tools/tools/tinybsd/conf/vpn/TINYBSD head/tools/tools/tinybsd/conf/wrap/TINYBSD head/usr.sbin/Makefile head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/inetd/inetd.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 9 21:08:52 2014 (r274330) +++ head/ObsoleteFiles.inc Sun Nov 9 21:33:01 2014 (r274331) @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20141109: faith/faithd removal +OLD_FILES+=etc/rc.d/faith +OLD_FILES+=usr/share/man/man4/faith.4.gz +OLD_FILES+=usr/share/man/man4/if_faith.4.gz +OLD_FILES+=usr/sbin/faithd +OLD_FILES+=usr/share/man/man8/faithd.8.gz # 20141102: postrandom obsoleted by new /dev/random code OLD_FILES+=etc/rc.d/postrandom # 20141031: initrandom obsoleted by new /dev/random code Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Nov 9 21:08:52 2014 (r274330) +++ head/UPDATING Sun Nov 9 21:33:01 2014 (r274331) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20141109: + faith(4) and faithd(8) has been removed from base system. It + has been obsolete for a very long time. + 20141104: vt(4), the new console driver, is enabled by default. It brings support for Unicode and double-width characters, as well as Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/defaults/rc.conf Sun Nov 9 21:33:01 2014 (r274331) @@ -514,9 +514,6 @@ stf_interface_ipv4plen="0" # Prefix leng stf_interface_ipv6_ifid="0:0:0:1" # IPv6 interface id for stf0. # If you like, you can set "AUTO" for this. stf_interface_ipv6_slaid="0000" # IPv6 Site Level Aggregator for stf0 -ipv6_faith_prefix="NO" # Set faith prefix to enable a FAITH - # IPv6-to-IPv4 TCP translator. You also need - # faithd(8) setup. ipv6_ipv4mapping="NO" # Set to "YES" to enable IPv4 mapped IPv6 addr # communication. (like ::ffff:a.b.c.d) ipv6_ipfilter_rules="/etc/ipf6.rules" # rules definition file for ipfilter, Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/network.subr Sun Nov 9 21:33:01 2014 (r274331) @@ -372,7 +372,6 @@ dhcpif() case $1 in lo[0-9]*|\ stf[0-9]*|\ - faith[0-9]*|\ lp[0-9]*|\ sl[0-9]*) return 1 @@ -591,7 +590,6 @@ ipv6_autoconfif() case $_if in lo[0-9]*|\ stf[0-9]*|\ - faith[0-9]*|\ lp[0-9]*|\ sl[0-9]*) return 1 Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/rc.d/Makefile Sun Nov 9 21:33:01 2014 (r274331) @@ -42,7 +42,6 @@ FILES= DAEMON \ dhclient \ dmesg \ dumpon \ - faith \ fsck \ ftpd \ gbde \ Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/rc.d/NETWORKING Sun Nov 9 21:33:01 2014 (r274331) @@ -4,7 +4,7 @@ # # PROVIDE: NETWORKING NETWORK -# REQUIRE: netif netoptions routing ppp ipfw stf faith +# REQUIRE: netif netoptions routing ppp ipfw stf # REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp local_unbound Modified: head/etc/rc.d/bridge ============================================================================== --- head/etc/rc.d/bridge Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/rc.d/bridge Sun Nov 9 21:33:01 2014 (r274331) @@ -26,7 +26,7 @@ # # PROVIDE: bridge -# REQUIRE: netif faith ppp stf +# REQUIRE: netif ppp stf # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/defaultroute ============================================================================== --- head/etc/rc.d/defaultroute Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/rc.d/defaultroute Sun Nov 9 21:33:01 2014 (r274331) @@ -6,7 +6,7 @@ # # PROVIDE: defaultroute -# REQUIRE: devd faith netif stf +# REQUIRE: devd netif stf # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sun Nov 9 21:08:52 2014 (r274330) +++ head/etc/rc.d/routing Sun Nov 9 21:33:01 2014 (r274331) @@ -6,7 +6,7 @@ # # PROVIDE: routing -# REQUIRE: faith netif ppp stf +# REQUIRE: netif ppp stf # KEYWORD: nojailvnet . /etc/rc.subr @@ -245,7 +245,7 @@ static_inet6() [Nn][Oo][Nn][Ee]) return ;; - lo0|faith[0-9]*) + lo0) continue ;; esac Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/lib/libc/net/getaddrinfo.c Sun Nov 9 21:33:01 2014 (r274331) @@ -30,8 +30,6 @@ */ /* - * "#ifdef FAITH" part is local hack for supporting IPv4-v6 translator. - * * Issues to be discussed: * - Return values. There are nonstandard return values defined and used * in the source code. This is because RFC2553 is silent about which error @@ -101,10 +99,6 @@ __FBSDID("$FreeBSD$"); #include "nscache.h" #endif -#if defined(__KAME__) && defined(INET6) -# define FAITH -#endif - #define ANY 0 #define YES 1 #define NO 0 @@ -1316,47 +1310,6 @@ get_ai(const struct addrinfo *pai, const { char *p; struct addrinfo *ai; -#ifdef FAITH - struct in6_addr faith_prefix; - char *fp_str; - int translate = 0; -#endif - -#ifdef FAITH - /* - * Transfrom an IPv4 addr into a special IPv6 addr format for - * IPv6->IPv4 translation gateway. (only TCP is supported now) - * - * +-----------------------------------+------------+ - * | faith prefix part (12 bytes) | embedded | - * | | IPv4 addr part (4 bytes) - * +-----------------------------------+------------+ - * - * faith prefix part is specified as ascii IPv6 addr format - * in environmental variable GAI. - * For FAITH to work correctly, routing to faith prefix must be - * setup toward a machine where a FAITH daemon operates. - * Also, the machine must enable some mechanizm - * (e.g. faith interface hack) to divert those packet with - * faith prefixed destination addr to user-land FAITH daemon. - */ - fp_str = getenv("GAI"); - if (fp_str && inet_pton(AF_INET6, fp_str, &faith_prefix) == 1 && - afd->a_af == AF_INET && pai->ai_socktype == SOCK_STREAM) { - u_int32_t v4a; - u_int8_t v4a_top; - - memcpy(&v4a, addr, sizeof v4a); - v4a_top = v4a >> IN_CLASSA_NSHIFT; - if (!IN_MULTICAST(v4a) && !IN_EXPERIMENTAL(v4a) && - v4a_top != 0 && v4a != IN_LOOPBACKNET) { - afd = &afdl[N_INET6]; - memcpy(&faith_prefix.s6_addr[12], addr, - sizeof(struct in_addr)); - translate = 1; - } - } -#endif ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); @@ -1370,11 +1323,6 @@ get_ai(const struct addrinfo *pai, const ai->ai_addrlen = afd->a_socklen; ai->ai_addr->sa_family = ai->ai_family = afd->a_af; p = (char *)(void *)(ai->ai_addr); -#ifdef FAITH - if (translate == 1) - memcpy(p + afd->a_off, &faith_prefix, (size_t)afd->a_addrlen); - else -#endif memcpy(p + afd->a_off, addr, (size_t)afd->a_addrlen); return ai; } Modified: head/lib/libc/net/getnameinfo.c ============================================================================== --- head/lib/libc/net/getnameinfo.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/lib/libc/net/getnameinfo.c Sun Nov 9 21:33:01 2014 (r274331) @@ -414,7 +414,6 @@ getnameinfo_link(const struct sockaddr * /* * The following have zero-length addresses. * IFT_ATM (net/if_atmsubr.c) - * IFT_FAITH (net/if_faith.c) * IFT_GIF (net/if_gif.c) * IFT_LOOP (net/if_loop.c) * IFT_PPP (net/if_ppp.c, net/if_spppsubr.c) Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Sun Nov 9 21:08:52 2014 (r274330) +++ head/release/picobsd/bridge/PICOBSD Sun Nov 9 21:33:01 2014 (r274331) @@ -109,7 +109,6 @@ device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" #device gif 4 # IPv6 and IPv4 tunneling -#device faith 1 # IPv6-to-IPv4 relaying (translation) device tap #options DEVICE_POLLING Modified: head/release/picobsd/qemu/PICOBSD ============================================================================== --- head/release/picobsd/qemu/PICOBSD Sun Nov 9 21:08:52 2014 (r274330) +++ head/release/picobsd/qemu/PICOBSD Sun Nov 9 21:33:01 2014 (r274331) @@ -114,7 +114,6 @@ device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" #device gif 4 # IPv6 and IPv4 tunneling -#device faith 1 # IPv6-to-IPv4 relaying (translation) device tap #options VIMAGE # soner or later we may want to test this Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Nov 9 21:08:52 2014 (r274330) +++ head/share/man/man4/Makefile Sun Nov 9 21:33:01 2014 (r274331) @@ -132,7 +132,6 @@ MAN= aac.4 \ et.4 \ eventtimers.4 \ exca.4 \ - faith.4 \ fatm.4 \ fd.4 \ fdc.4 \ @@ -637,7 +636,6 @@ MLINKS+=en.4 if_en.4 MLINKS+=enc.4 if_enc.4 MLINKS+=epair.4 if_epair.4 MLINKS+=et.4 if_et.4 -MLINKS+=faith.4 if_faith.4 MLINKS+=fatm.4 if_fatm.4 MLINKS+=fd.4 stderr.4 \ fd.4 stdin.4 \ Modified: head/share/man/man4/inet6.4 ============================================================================== --- head/share/man/man4/inet6.4 Sun Nov 9 21:08:52 2014 (r274330) +++ head/share/man/man4/inet6.4 Sun Nov 9 21:33:01 2014 (r274331) @@ -241,17 +241,6 @@ Defaults to off. Boolean: the default value of a per-interface flag to enable/disable performing automatic link-local address configuration. Defaults to on. -.It Dv IPV6CTL_KEEPFAITH -.Pq ip6.keepfaith -Boolean: enable/disable -.Dq FAITH -TCP relay IPv6-to-IPv4 translator code in the kernel. -Refer -.Xr faith 4 -and -.Xr faithd 8 -for detail. -Defaults to off. .It Dv IPV6CTL_LOG_INTERVAL .Pq ip6.log_interval Integer: default interval between Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Sun Nov 9 21:08:52 2014 (r274330) +++ head/share/man/man4/ip6.4 Sun Nov 9 21:33:01 2014 (r274331) @@ -393,10 +393,6 @@ For wildcard sockets, this can restrict .\".Ox .\"IPv6 sockets are always IPv6-only, so the socket option is read-only .\"(not modifiable). -.It Dv IPV6_FAITH Fa "int *" -Get or set the status of whether -.Xr faith 4 -connections can be made to this socket. .It Dv IPV6_USE_MIN_MTU Fa "int *" Get or set whether the minimal IPv6 maximum transmission unit (MTU) size will be used to avoid fragmentation from occurring for subsequent Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun Nov 9 21:08:52 2014 (r274330) +++ head/share/man/man5/rc.conf.5 Sun Nov 9 21:33:01 2014 (r274331) @@ -2948,15 +2948,6 @@ This can be set to .Pq Vt str IPv6 Site Level Aggregator for .Xr stf 4 . -.It Va ipv6_faith_prefix -.Pq Vt str -If not set to -.Dq Li NO , -this is the faith prefix to enable a FAITH IPv6-to-IPv4 TCP -translator. -You also need -.Xr faithd 8 -setup. .It Va ipv6_ipv4mapping .Pq Vt bool If set to Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/amd64/conf/GENERIC Sun Nov 9 21:33:01 2014 (r274331) @@ -310,7 +310,6 @@ device vlan # 802.1Q VLAN support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/ATMEL Sun Nov 9 21:33:01 2014 (r274331) @@ -143,7 +143,6 @@ device vlan # 802.1Q VLAN support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module # SCSI peripherals Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/DOCKSTAR Sun Nov 9 21:33:01 2014 (r274331) @@ -54,7 +54,6 @@ options FDT_DTB_STATIC # Misc pseudo devices device bpf # Required for DHCP -device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware(9) required for USB wlan device gif # IPv6 and IPv4 tunneling device loop # Network loopback Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/DREAMPLUG-1001 Sun Nov 9 21:33:01 2014 (r274331) @@ -57,7 +57,6 @@ options FDT_DTB_STATIC # Misc pseudo devices device bpf # Required for DHCP -device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware(9) required for USB wlan device gif # IPv6 and IPv4 tunneling device loop # Network loopback Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/EFIKA_MX Sun Nov 9 21:33:01 2014 (r274331) @@ -104,7 +104,6 @@ device ether # Ethernet support #device tun # Packet tunnel. #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module # Serial (COM) ports Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/ETHERNUT5 Sun Nov 9 21:33:01 2014 (r274331) @@ -136,7 +136,6 @@ device ether # Ethernet support #device tun # Packet tunnel. #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module # SCSI peripherals Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/IMX53 Sun Nov 9 21:33:01 2014 (r274331) @@ -92,7 +92,6 @@ device ether # Ethernet support #device tun # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module # Ethernet Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/IMX6 Sun Nov 9 21:33:01 2014 (r274331) @@ -75,7 +75,6 @@ device vlan # 802.1Q VLAN support device tun # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module device ether # Ethernet support device miibus # Required for ethernet Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/arm/conf/SAM9260EK Sun Nov 9 21:33:01 2014 (r274331) @@ -146,7 +146,6 @@ device ether # Ethernet support #device tun # Packet tunnel. #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module # SCSI peripherals Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/boot/forth/loader.conf Sun Nov 9 21:33:01 2014 (r274331) @@ -254,7 +254,6 @@ if_disc_load="NO" # Discard device if_ef_load="NO" # pseudo-device providing support for multiple # ethernet frame types if_epair_load="NO" # Virtual b-t-b Ethernet-like interface pair -if_faith_load="NO" # IPv6-to-IPv4 TCP relay capturing interface if_gif_load="NO" # generic tunnel interface if_gre_load="NO" # encapsulating network device if_stf_load="NO" # 6to4 tunnel interface Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/conf/NOTES Sun Nov 9 21:33:01 2014 (r274331) @@ -890,10 +890,7 @@ device gre device me options XBONEHACK -# The `faith' device captures packets sent to it and diverts them -# to the IPv4/IPv6 translation daemon. # The `stf' device implements 6to4 encapsulation. -device faith device stf # The pf packet filter consists of three devices: Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/conf/files Sun Nov 9 21:33:01 2014 (r274331) @@ -3229,7 +3229,6 @@ net/if_edsc.c optional edsc net/if_enc.c optional enc ipsec inet | enc ipsec inet6 net/if_epair.c optional epair net/if_ethersubr.c optional ether -net/if_faith.c optional faith net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip net/if_gif.c optional gif inet | gif inet6 | \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/i386/conf/GENERIC Sun Nov 9 21:33:01 2014 (r274331) @@ -318,7 +318,6 @@ device vlan # 802.1Q VLAN support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/i386/conf/XBOX Sun Nov 9 21:33:01 2014 (r274331) @@ -66,7 +66,6 @@ device ether # Ethernet support #device tun # Packet tunnel. #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device faith # IPv6-to-IPv4 relaying (translation) # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/i386/conf/XEN Sun Nov 9 21:33:01 2014 (r274331) @@ -82,7 +82,6 @@ device ether # Ethernet support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) # Wireless cards options IEEE80211_SUPPORT_MESH Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/mips/conf/GXEMUL Sun Nov 9 21:33:01 2014 (r274331) @@ -55,7 +55,6 @@ device ether # Ethernet support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/mips/conf/GXEMUL32 ============================================================================== --- head/sys/mips/conf/GXEMUL32 Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/mips/conf/GXEMUL32 Sun Nov 9 21:33:01 2014 (r274331) @@ -53,7 +53,6 @@ device ether # Ethernet support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/mips/conf/OCTEON1 Sun Nov 9 21:33:01 2014 (r274331) @@ -261,7 +261,6 @@ device vlan # 802.1Q VLAN support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. Modified: head/sys/mips/rmi/rootfs_list.txt ============================================================================== --- head/sys/mips/rmi/rootfs_list.txt Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/mips/rmi/rootfs_list.txt Sun Nov 9 21:33:01 2014 (r274331) @@ -197,7 +197,6 @@ ./etc/rc.d/dmesg ./etc/rc.d/dumpon ./etc/rc.d/encswap -./etc/rc.d/faith ./etc/rc.d/fsck ./etc/rc.d/ftp-proxy ./etc/rc.d/ftpd Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/modules/Makefile Sun Nov 9 21:33:01 2014 (r274331) @@ -145,7 +145,6 @@ SUBDIR= \ if_disc \ if_edsc \ if_epair \ - if_faith \ ${_if_gif} \ ${_if_gre} \ ${_if_me} \ Modified: head/sys/net/if_types.h ============================================================================== --- head/sys/net/if_types.h Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/net/if_types.h Sun Nov 9 21:33:01 2014 (r274331) @@ -246,7 +246,6 @@ /* not based on IANA assignments */ #define IFT_GIF 0xf0 #define IFT_PVC 0xf1 -#define IFT_FAITH 0xf2 #define IFT_ENC 0xf4 #define IFT_PFLOG 0xf6 #define IFT_PFSYNC 0xf7 Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet/in.h Sun Nov 9 21:33:01 2014 (r274331) @@ -428,8 +428,7 @@ __END_DECLS #define IP_RECVIF 20 /* bool; receive reception if w/dgram */ /* for IPSEC */ #define IP_IPSEC_POLICY 21 /* int; set/get security policy */ -#define IP_FAITH 22 /* bool; accept FAITH'ed connections */ - + /* unused; was IP_FAITH */ #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ #define IP_BINDANY 24 /* bool: allow bind to any address */ #define IP_BINDMULTI 25 /* bool: allow multiple listeners on a tuple */ @@ -630,7 +629,7 @@ int getsourcefilter(int, uint32_t, struc #define IPCTL_STATS 12 /* ipstat structure */ #define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ #define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ -#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */ + /* 15, unused, was: IPCTL_KEEPFAITH */ #define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ #endif /* __BSD_VISIBLE */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet/in_pcb.c Sun Nov 9 21:33:01 2014 (r274331) @@ -1645,11 +1645,6 @@ in_pcblookup_group(struct inpcbinfo *pcb inp->inp_lport != lport) continue; - /* XXX inp locking */ - if (ifp && ifp->if_type == IFT_FAITH && - (inp->inp_flags & INP_FAITH) == 0) - continue; - injail = prison_flag(inp->inp_cred, PR_IP4); if (injail) { if (prison_check_ip4(inp->inp_cred, @@ -1724,11 +1719,6 @@ in_pcblookup_group(struct inpcbinfo *pcb inp->inp_lport != lport) continue; - /* XXX inp locking */ - if (ifp && ifp->if_type == IFT_FAITH && - (inp->inp_flags & INP_FAITH) == 0) - continue; - injail = prison_flag(inp->inp_cred, PR_IP4); if (injail) { if (prison_check_ip4(inp->inp_cred, @@ -1869,11 +1859,6 @@ in_pcblookup_hash_locked(struct inpcbinf inp->inp_lport != lport) continue; - /* XXX inp locking */ - if (ifp && ifp->if_type == IFT_FAITH && - (inp->inp_flags & INP_FAITH) == 0) - continue; - injail = prison_flag(inp->inp_cred, PR_IP4); if (injail) { if (prison_check_ip4(inp->inp_cred, @@ -2468,10 +2453,6 @@ db_print_inpflags(int inp_flags) db_printf("%sINP_MTUDISC", comma ? ", " : ""); comma = 1; } - if (inp_flags & INP_FAITH) { - db_printf("%sINP_FAITH", comma ? ", " : ""); - comma = 1; - } if (inp_flags & INP_RECVTTL) { db_printf("%sINP_RECVTTL", comma ? ", " : ""); comma = 1; Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet/in_pcb.h Sun Nov 9 21:33:01 2014 (r274331) @@ -511,7 +511,7 @@ short inp_so_options(const struct inpcb #define INP_ANONPORT 0x00000040 /* port chosen for user */ #define INP_RECVIF 0x00000080 /* receive incoming interface */ #define INP_MTUDISC 0x00000100 /* user can do MTU discovery */ -#define INP_FAITH 0x00000200 /* accept FAITH'ed connections */ + /* 0x000200 unused: was INP_FAITH */ #define INP_RECVTTL 0x00000400 /* receive incoming IP TTL */ #define INP_DONTFRAG 0x00000800 /* don't fragment packet */ #define INP_BINDANY 0x00001000 /* allow bind to any address */ Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet/ip_icmp.c Sun Nov 9 21:33:01 2014 (r274331) @@ -410,19 +410,6 @@ icmp_input(struct mbuf **mp, int *offp, m->m_len += hlen; m->m_data -= hlen; - if (m->m_pkthdr.rcvif && m->m_pkthdr.rcvif->if_type == IFT_FAITH) { - /* - * Deliver very specific ICMP type only. - */ - switch (icp->icmp_type) { - case ICMP_UNREACH: - case ICMP_TIMXCEED: - break; - default: - goto freeit; - } - } - #ifdef ICMPPRINTFS if (icmpprintfs) printf("icmp_input, type %d code %d\n", icp->icmp_type, Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet/ip_input.c Sun Nov 9 21:33:01 2014 (r274331) @@ -104,12 +104,6 @@ SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIR &VNET_NAME(ipsendredirects), 0, "Enable sending IP redirects"); -static VNET_DEFINE(int, ip_keepfaith); -#define V_ip_keepfaith VNET(ip_keepfaith) -SYSCTL_INT(_net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(ip_keepfaith), 0, - "Enable packet capture for FAITH IPv4->IPv6 translater daemon"); - static VNET_DEFINE(int, ip_sendsourcequench); #define V_ip_sendsourcequench VNET(ip_sendsourcequench) SYSCTL_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_VNET | CTLFLAG_RW, @@ -753,18 +747,6 @@ passin: goto ours; /* - * FAITH(Firewall Aided Internet Translator) - */ - if (ifp && ifp->if_type == IFT_FAITH) { - if (V_ip_keepfaith) { - if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_ICMP) - goto ours; - } - m_freem(m); - return; - } - - /* * Not for us; forward if possible and desirable. */ if (V_ipforwarding == 0) { Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet/ip_output.c Sun Nov 9 21:33:01 2014 (r274331) @@ -991,7 +991,6 @@ ip_ctloutput(struct socket *so, struct s case IP_RECVDSTADDR: case IP_RECVTTL: case IP_RECVIF: - case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: case IP_RECVTOS: @@ -1058,10 +1057,6 @@ ip_ctloutput(struct socket *so, struct s OPTSET(INP_RECVIF); break; - case IP_FAITH: - OPTSET(INP_FAITH); - break; - case IP_ONESBCAST: OPTSET(INP_ONESBCAST); break; @@ -1200,7 +1195,6 @@ ip_ctloutput(struct socket *so, struct s case IP_RECVTTL: case IP_RECVIF: case IP_PORTRANGE: - case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: case IP_BINDANY: @@ -1259,10 +1253,6 @@ ip_ctloutput(struct socket *so, struct s optval = 0; break; - case IP_FAITH: - optval = OPTBIT(INP_FAITH); - break; - case IP_ONESBCAST: optval = OPTBIT(INP_ONESBCAST); break; Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/icmp6.c Sun Nov 9 21:33:01 2014 (r274331) @@ -482,22 +482,6 @@ icmp6_input(struct mbuf **mp, int *offp, goto freeit; } - if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { - /* - * Deliver very specific ICMP6 type only. - * This is important to deliver TOOBIG. Otherwise PMTUD - * will not work. - */ - switch (icmp6->icmp6_type) { - case ICMP6_DST_UNREACH: - case ICMP6_PACKET_TOO_BIG: - case ICMP6_TIME_EXCEEDED: - break; - default: - goto freeit; - } - } - ICMP6STAT_INC(icp6s_inhist[icmp6->icmp6_type]); icmp6_ifstat_inc(ifp, ifs6_in_msg); if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK) Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/in6.c Sun Nov 9 21:33:01 2014 (r274331) @@ -137,8 +137,6 @@ static int in6_notify_ifa(struct ifnet * struct in6_aliasreq *, int); static void in6_unlink_ifa(struct in6_ifaddr *, struct ifnet *); -int (*faithprefix_p)(struct in6_addr *); - static int in6_validate_ifra(struct ifnet *, struct in6_aliasreq *, struct in6_ifaddr *, int); static struct in6_ifaddr *in6_alloc_ifa(struct ifnet *, @@ -1948,34 +1946,20 @@ in6if_do_dad(struct ifnet *ifp) if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) return (0); - switch (ifp->if_type) { -#ifdef IFT_DUMMY - case IFT_DUMMY: -#endif - case IFT_FAITH: - /* - * These interfaces do not have the IFF_LOOPBACK flag, - * but loop packets back. We do not have to do DAD on such - * interfaces. We should even omit it, because loop-backed - * NS would confuse the DAD procedure. - */ + /* + * Our DAD routine requires the interface up and running. + * However, some interfaces can be up before the RUNNING + * status. Additionaly, users may try to assign addresses + * before the interface becomes up (or running). + * We simply skip DAD in such a case as a work around. + * XXX: we should rather mark "tentative" on such addresses, + * and do DAD after the interface becomes ready. + */ + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) return (0); - default: - /* - * Our DAD routine requires the interface up and running. - * However, some interfaces can be up before the RUNNING - * status. Additionaly, users may try to assign addresses - * before the interface becomes up (or running). - * We simply skip DAD in such a case as a work around. - * XXX: we should rather mark "tentative" on such addresses, - * and do DAD after the interface becomes ready. - */ - if (!((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING))) - return (0); - return (1); - } + return (1); } /* Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/in6.h Sun Nov 9 21:33:01 2014 (r274331) @@ -424,8 +424,7 @@ struct route_in6 { #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ #endif /* IPSEC */ -#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ - + /* 29; unused; was IPV6_FAITH */ #if 1 /* IPV6FIREWALL */ #define IPV6_FW_ADD 30 /* add a firewall rule to chain */ #define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ @@ -580,7 +579,7 @@ struct ip6_mtuinfo { #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ #define IPV6CTL_ACCEPT_RTADV 12 -#define IPV6CTL_KEEPFAITH 13 + /* 13; unused; was: IPV6CTL_KEEPFAITH */ #define IPV6CTL_LOG_INTERVAL 14 #define IPV6CTL_HDRNESTLIMIT 15 #define IPV6CTL_DAD_COUNT 16 @@ -669,7 +668,6 @@ extern void addrsel_policy_init(void); #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) -extern int (*faithprefix_p)(struct in6_addr *); #endif /* _KERNEL */ #ifndef _SIZE_T_DECLARED Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/in6_pcb.c Sun Nov 9 21:33:01 2014 (r274331) @@ -870,12 +870,6 @@ in6_pcblookup_group(struct inpcbinfo *pc struct inpcbhead *head; struct inpcb *inp, *tmpinp; u_short fport = fport_arg, lport = lport_arg; - int faith; - - if (faithprefix_p != NULL) - faith = (*faithprefix_p)(laddr); - else - faith = 0; /* * First look for an exact match. @@ -935,10 +929,6 @@ in6_pcblookup_group(struct inpcbinfo *pc continue; } - /* XXX inp locking */ - if (faith && (inp->inp_flags & INP_FAITH) == 0) - continue; - injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { if (prison_check_ip6(inp->inp_cred, @@ -1001,10 +991,6 @@ in6_pcblookup_group(struct inpcbinfo *pc continue; } - /* XXX inp locking */ - if (faith && (inp->inp_flags & INP_FAITH) == 0) - continue; - injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { if (prison_check_ip6(inp->inp_cred, @@ -1069,18 +1055,12 @@ in6_pcblookup_hash_locked(struct inpcbin struct inpcbhead *head; struct inpcb *inp, *tmpinp; u_short fport = fport_arg, lport = lport_arg; - int faith; KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); INP_HASH_LOCK_ASSERT(pcbinfo); - if (faithprefix_p != NULL) - faith = (*faithprefix_p)(laddr); - else - faith = 0; - /* * First look for an exact match. */ @@ -1137,10 +1117,6 @@ in6_pcblookup_hash_locked(struct inpcbin continue; } - /* XXX inp locking */ - if (faith && (inp->inp_flags & INP_FAITH) == 0) - continue; - injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { if (prison_check_ip6(inp->inp_cred, Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/in6_proto.c Sun Nov 9 21:33:01 2014 (r274331) @@ -434,7 +434,6 @@ VNET_DEFINE(int, ip6_rr_prune) = 5; /* r VNET_DEFINE(int, ip6_mcast_pmtu) = 0; /* enable pMTU discovery for multicast? */ VNET_DEFINE(int, ip6_v6only) = 1; -VNET_DEFINE(int, ip6_keepfaith) = 0; VNET_DEFINE(time_t, ip6_log_time) = (time_t)0L; #ifdef IPSTEALTH VNET_DEFINE(int, ip6stealth) = 0; @@ -543,8 +542,6 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RFC62 CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_rfc6204w3), 0, "Accept the default router list from ICMPv6 RA messages even " "when packet forwarding enabled."); -SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_keepfaith), 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_log_interval), 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/ip6_output.c Sun Nov 9 21:33:01 2014 (r274331) @@ -1408,7 +1408,6 @@ ip6_ctloutput(struct socket *so, struct /* FALLTHROUGH */ case IPV6_UNICAST_HOPS: case IPV6_HOPLIMIT: - case IPV6_FAITH: case IPV6_RECVPKTINFO: case IPV6_RECVHOPLIMIT: @@ -1552,10 +1551,6 @@ do { \ OPTSET(IN6P_RTHDR); break; - case IPV6_FAITH: - OPTSET(INP_FAITH); - break; - case IPV6_RECVPATHMTU: /* * We ignore this option for TCP @@ -1823,7 +1818,6 @@ do { \ case IPV6_RECVRTHDR: case IPV6_RECVPATHMTU: - case IPV6_FAITH: case IPV6_V6ONLY: case IPV6_PORTRANGE: case IPV6_RECVTCLASS: @@ -1868,10 +1862,6 @@ do { \ optval = OPTBIT(IN6P_MTU); break; - case IPV6_FAITH: - optval = OPTBIT(INP_FAITH); - break; - case IPV6_V6ONLY: optval = OPTBIT(IN6P_IPV6_V6ONLY); break; Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/ip6_var.h Sun Nov 9 21:33:01 2014 (r274331) @@ -296,7 +296,6 @@ VNET_DECLARE(int, ip6_norbit_raif); /* D * receiving IF. */ VNET_DECLARE(int, ip6_rfc6204w3); /* Accept defroute from RA even when forwarding enabled */ -VNET_DECLARE(int, ip6_keepfaith); /* Firewall Aided Internet Translator */ VNET_DECLARE(int, ip6_log_interval); VNET_DECLARE(time_t, ip6_log_time); VNET_DECLARE(int, ip6_hdrnestlimit); /* upper limit of # of extension @@ -310,7 +309,6 @@ VNET_DECLARE(int, ip6_dad_count); /* Dup #define V_ip6_no_radr VNET(ip6_no_radr) #define V_ip6_norbit_raif VNET(ip6_norbit_raif) #define V_ip6_rfc6204w3 VNET(ip6_rfc6204w3) -#define V_ip6_keepfaith VNET(ip6_keepfaith) #define V_ip6_log_interval VNET(ip6_log_interval) #define V_ip6_log_time VNET(ip6_log_time) #define V_ip6_hdrnestlimit VNET(ip6_hdrnestlimit) Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/raw_ip6.c Sun Nov 9 21:33:01 2014 (r274331) @@ -169,12 +169,6 @@ rip6_input(struct mbuf **mp, int *offp, RIP6STAT_INC(rip6s_ipackets); - if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { - /* XXX Send icmp6 host/port unreach? */ - m_freem(m); - return (IPPROTO_DONE); - } - init_sin6(&fromsa, m); /* general init */ ifp = m->m_pkthdr.rcvif; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/sctp6_usrreq.c Sun Nov 9 21:33:01 2014 (r274331) @@ -149,10 +149,6 @@ sctp6_input_with_port(struct mbuf **i_pa if (in6_setscope(&dst.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { goto out; } - if (faithprefix_p != NULL && (*faithprefix_p) (&dst.sin6_addr)) { - /* XXX send icmp6 host/port unreach? */ - goto out; - } length = ntohs(ip6->ip6_plen) + iphlen; /* Validate mbuf chain length with IP payload length. */ if (SCTP_HEADER_LEN(m) != length) { Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/netinet6/udp6_usrreq.c Sun Nov 9 21:33:01 2014 (r274331) @@ -208,12 +208,6 @@ udp6_input(struct mbuf **mp, int *offp, ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); - if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { - /* XXX send icmp6 host/port unreach? */ - m_freem(m); - return (IPPROTO_DONE); - } - #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, sizeof(struct udphdr), IPPROTO_DONE); ip6 = mtod(m, struct ip6_hdr *); Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Nov 9 21:08:52 2014 (r274330) +++ head/sys/pc98/conf/GENERIC Sun Nov 9 21:33:01 2014 (r274331) @@ -231,7 +231,6 @@ device vlan # 802.1Q VLAN support device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware assist module *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 22:38:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA844A72; Sun, 9 Nov 2014 22:38:08 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6D3CD5; Sun, 9 Nov 2014 22:38:08 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id BC5BD3C2D5A; Mon, 10 Nov 2014 09:38:00 +1100 (AEDT) Date: Mon, 10 Nov 2014 09:38:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r274315 - in head/sys/netpfil: ipfw pf In-Reply-To: <20141109170737.GB53947@kib.kiev.ua> Message-ID: <20141110092221.E903@besplex.bde.org> References: <201411091615.sA9GFTL6052510@svn.freebsd.org> <20141109162927.GA53947@kib.kiev.ua> <545F9D90.1000901@FreeBSD.org> <20141109170737.GB53947@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.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=Zd1L08CrHkzd07uKUEUA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Alexander V. Chernikov" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 22:38:09 -0000 On Sun, 9 Nov 2014, Konstantin Belousov wrote: > On Sun, Nov 09, 2014 at 09:00:00PM +0400, Alexander V. Chernikov wrote: >> On 09.11.2014 20:29, Konstantin Belousov wrote: >>> On Sun, Nov 09, 2014 at 04:15:29PM +0000, Alexander V. Chernikov wrote: >>>> Author: melifaro >>>> Date: Sun Nov 9 16:15:28 2014 >>>> New Revision: 274315 >>>> URL: https://svnweb.freebsd.org/changeset/base/274315 >>>> >>>> Log: >>>> Remove unused 'struct route' fields. >>>> >>>> Modified: >>>> head/sys/netpfil/ipfw/ip_fw_private.h >>>> head/sys/netpfil/pf/pf.c >>>> >>>> Modified: head/sys/netpfil/ipfw/ip_fw_private.h >>>> ============================================================================== >>>> --- head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 15:53:29 2014 (r274314) >>>> +++ head/sys/netpfil/ipfw/ip_fw_private.h Sun Nov 9 16:15:28 2014 (r274315) >>>> @@ -66,14 +66,12 @@ enum { >>>> */ >>>> struct _ip6dn_args { >>>> struct ip6_pktopts *opt_or; >>>> - struct route_in6 ro_or; >>>> int flags_or; >>>> struct ip6_moptions *im6o_or; >>>> struct ifnet *origifp_or; >>>> struct ifnet *ifp_or; >>>> struct sockaddr_in6 dst_or; >>>> u_long mtu_or; >>>> - struct route_in6 ro_pmtu_or; >>>> }; >>>> >>>> >>>> >>>> Modified: head/sys/netpfil/pf/pf.c >>>> ============================================================================== >>>> --- head/sys/netpfil/pf/pf.c Sun Nov 9 15:53:29 2014 (r274314) >>>> +++ head/sys/netpfil/pf/pf.c Sun Nov 9 16:15:28 2014 (r274315) >>>> @@ -140,14 +140,12 @@ struct pf_send_entry { >>>> PFSE_ICMP6, >>>> } pfse_type; >>>> union { >>>> - struct route ro; >>>> struct { >>>> int type; >>>> int code; >>>> int mtu; >>>> } icmpopts; >>>> } u; >>> There is a single member of union u now. Is the union needed still ? >> No. Fixed in r274320, thank you! > Well, next question is why icmpopts is struct, instead of using > directly members of the containing structure. It made sense when icmpopts > was overlapped with ro, but for what it is kept around now ? > >>> >>>> -#define pfse_ro u.ro >>>> #define pfse_icmp_type u.icmpopts.type >>>> #define pfse_icmp_code u.icmpopts.code >>>> #define pfse_icmp_mtu u.icmpopts.mtu Question after the next is why the struct member names and indentation are so bad. The short names (without unique prefixes) made some sense for nested struct/union member names. Full, excessively verbose prefixes were used in the #defined values. Now, no prefixes are used for the replacements. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 22:43:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E02D4C2A; Sun, 9 Nov 2014 22:43:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCB1BD85; Sun, 9 Nov 2014 22:43:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9MhUsW054567; Sun, 9 Nov 2014 22:43:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9MhU5h054565; Sun, 9 Nov 2014 22:43:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411092243.sA9MhU5h054565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Nov 2014 22:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274333 - head/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 22:43:31 -0000 Author: mav Date: Sun Nov 9 22:43:29 2014 New Revision: 274333 URL: https://svnweb.freebsd.org/changeset/base/274333 Log: Handle PREEMPT AND ABORT service action equal to PREEMPT. With command serialization used in CTL, there are no other commands to abort when PREEMPT AND ABORT gets to run, so it is practically equal to PREEMPT. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Nov 9 22:16:50 2014 (r274332) +++ head/sys/cam/ctl/ctl.c Sun Nov 9 22:43:29 2014 (r274333) @@ -8914,7 +8914,8 @@ ctl_persistent_reserve_out(struct ctl_sc } break; - case SPRO_PREEMPT: { + case SPRO_PREEMPT: + case SPRO_PRE_ABO: { int nretval; nretval = ctl_pro_preempt(softc, lun, res_key, sa_res_key, type, Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Sun Nov 9 22:16:50 2014 (r274332) +++ head/sys/cam/ctl/ctl_cmd_table.c Sun Nov 9 22:43:29 2014 (r274333) @@ -180,7 +180,16 @@ const struct ctl_cmd_entry ctl_cmd_table 10, { 0x04, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 05 PREEMPT AND ABORT */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE, + 10, { 0x05, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 06 REGISTER AND IGNORE EXISTING KEY */ {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | From owner-svn-src-all@FreeBSD.ORG Sun Nov 9 22:54:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDA3119B; Sun, 9 Nov 2014 22:54:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA3BCE6F; Sun, 9 Nov 2014 22:54:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA9MsfPd059581; Sun, 9 Nov 2014 22:54:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA9MsfKM059580; Sun, 9 Nov 2014 22:54:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411092254.sA9MsfKM059580@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 9 Nov 2014 22:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274334 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 09 Nov 2014 22:54:41 -0000 Author: ae Date: Sun Nov 9 22:54:40 2014 New Revision: 274334 URL: https://svnweb.freebsd.org/changeset/base/274334 Log: Use embedded scope zone id to determine outgoing interface for link-local and node-local addresses. Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Nov 9 22:43:29 2014 (r274333) +++ head/sys/netinet6/in6_src.c Sun Nov 9 22:54:40 2014 (r274334) @@ -555,6 +555,7 @@ selectroute(struct sockaddr_in6 *dstsock struct sockaddr_in6 *sin6_next; struct in6_pktinfo *pi = NULL; struct in6_addr *dst = &dstsock->sin6_addr; + uint32_t zoneid; #if 0 char ip6buf[INET6_ADDRSTRLEN]; @@ -585,7 +586,18 @@ selectroute(struct sockaddr_in6 *dstsock } else goto getroute; } - + /* + * If destination address is LLA or link- or node-local multicast, + * use it's embedded scope zone id to determine outgoing interface. + */ + if (IN6_IS_SCOPE_LINKLOCAL(dst) || + IN6_IS_ADDR_MC_NODELOCAL(dst)) { + zoneid = ntohs(in6_getscope(dst)); + if (zoneid > 0) { + ifp = in6_getlinkifnet(zoneid); + goto done; + } + } /* * If the destination address is a multicast address and the outgoing * interface for the address is specified by the caller, use it. From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 08:20:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAB7E1D2; Mon, 10 Nov 2014 08:20:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3D8ADC7; Mon, 10 Nov 2014 08:20:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAA8KSUD020434; Mon, 10 Nov 2014 08:20:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAA8KMSO019943; Mon, 10 Nov 2014 08:20:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411100820.sAA8KMSO019943@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 10 Nov 2014 08:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274337 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris... 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 08:20:29 -0000 Author: delphij Date: Mon Nov 10 08:20:21 2014 New Revision: 274337 URL: https://svnweb.freebsd.org/changeset/base/274337 Log: MFV r274273: ZFS large block support. Please note that booting from datasets that have recordsize greater than 128KB is not supported (but it's Okay to enable the feature on the pool). This *may* remain unchanged because of memory constraint. Limited safety belt is provided for mounted root filesystem but use caution is advised. Illumos issue: 5027 zfs large block support MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/boot/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c 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 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Nov 10 08:20:21 2014 (r274337) @@ -2147,6 +2147,8 @@ dump_label(const char *dev) (void) close(fd); } +static uint64_t num_large_blocks; + /*ARGSUSED*/ static int dump_one_dir(const char *dsname, void *arg) @@ -2159,6 +2161,8 @@ dump_one_dir(const char *dsname, void *a (void) printf("Could not open %s, error %d\n", dsname, error); return (0); } + if (dmu_objset_ds(os)->ds_large_blocks) + num_large_blocks++; dump_dir(os); dmu_objset_disown(os, FTAG); fuid_table_destroy(); @@ -2169,7 +2173,7 @@ dump_one_dir(const char *dsname, void *a /* * Block statistics. */ -#define PSIZE_HISTO_SIZE (SPA_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1) +#define PSIZE_HISTO_SIZE (SPA_OLD_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 2) typedef struct zdb_blkstats { uint64_t zb_asize; uint64_t zb_lsize; @@ -2234,7 +2238,15 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * zb->zb_lsize += BP_GET_LSIZE(bp); zb->zb_psize += BP_GET_PSIZE(bp); zb->zb_count++; - zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++; + + /* + * The histogram is only big enough to record blocks up to + * SPA_OLD_MAXBLOCKSIZE; larger blocks go into the last, + * "other", bucket. + */ + int idx = BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT; + idx = MIN(idx, SPA_OLD_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1); + zb->zb_psize_histogram[idx]++; zb->zb_gangs += BP_COUNT_GANG(bp); @@ -2946,6 +2958,7 @@ dump_zpool(spa_t *spa) dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { + uint64_t refcount; dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { dump_bpobj(&spa->spa_deferred_bpobj, @@ -2965,8 +2978,21 @@ dump_zpool(spa_t *spa) } (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); + + (void) feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_LARGE_BLOCKS], &refcount); + if (num_large_blocks != refcount) { + (void) printf("large_blocks feature refcount mismatch: " + "expected %lld != actual %lld\n", + (longlong_t)num_large_blocks, + (longlong_t)refcount); + rc = 2; + } else { + (void) printf("Verified large_blocks feature refcount " + "is correct (%llu)\n", (longlong_t)refcount); + } } - if (dump_opt['b'] || dump_opt['c']) + if (rc == 0 && (dump_opt['b'] || dump_opt['c'])) rc = dump_block_stats(spa); if (rc == 0) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 10 08:20:21 2014 (r274337) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2014 +.Dd November 10, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -179,12 +179,12 @@ .Ar bookmark .Nm .Cm send -.Op Fl DnPpRve +.Op Fl DnPpRveL .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm .Cm send -.Op Fl e +.Op Fl eL .Op Fl i Ar snapshot Ns | Ns bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm @@ -1187,6 +1187,12 @@ systems is strongly discouraged, and may .Pp The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes. +If the +.Sy large_blocks +feature is enabled on the pool, the size may be up to 1 Mbyte. +See +.Xr zpool-features 7 +for details on ZFS feature flags. .Pp Changing the file system's .Sy recordsize @@ -2477,7 +2483,7 @@ feature. .It Xo .Nm .Cm send -.Op Fl DnPpRve +.Op Fl DnPpRveL .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Xc @@ -2549,6 +2555,22 @@ be used regardless of the dataset's property, but performance will be much better if the filesystem uses a dedup-capable checksum (eg. .Sy sha256 ) . +.It Fl L +Generate a stream which may contain blocks larger than 128KB. +This flag +has no effect if the +.Sy large_blocks +pool feature is disabled, or if the +.Sy recordsize +property of this filesystem has never been set above 128KB. +The receiving system must have the +.Sy large_blocks +pool feature enabled as well. +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy large_blocks +feature. .It Fl e Generate a more compact stream by using WRITE_EMBEDDED records for blocks which are stored more compactly on disk by the @@ -2596,7 +2618,7 @@ on future versions of .It Xo .Nm .Cm send -.Op Fl e +.Op Fl eL .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc @@ -2622,6 +2644,22 @@ specified as the last component of the n If the incremental target is a clone, the incremental source can be the origin snapshot, or an earlier snapshot in the origin's filesystem, or the origin's origin, etc. +.It Fl L +Generate a stream which may contain blocks larger than 128KB. +This flag +has no effect if the +.Sy large_blocks +pool feature is disabled, or if the +.Sy recordsize +property of this filesystem has never been set above 128KB. +The receiving system must have the +.Sy large_blocks +pool feature enabled as well. +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy large_blocks +feature. .It Fl e Generate a more compact stream by using WRITE_EMBEDDED records for blocks which are stored more compactly on disk by the Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Nov 10 08:20:21 2014 (r274337) @@ -274,9 +274,9 @@ get_usage(zfs_help_t idx) case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRve] [-[iI] snapshot] " + return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] " "\n" - "\tsend [-e] [-i snapshot|bookmark] " + "\tsend [-Le] [-i snapshot|bookmark] " "\n")); case HELP_SET: return (gettext("\tset " @@ -3709,7 +3709,7 @@ zfs_do_send(int argc, char **argv) boolean_t extraverbose = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnPe")) != -1) { + while ((c = getopt(argc, argv, ":i:I:RDpvnPLe")) != -1) { switch (c) { case 'i': if (fromname) @@ -3744,6 +3744,9 @@ zfs_do_send(int argc, char **argv) case 'n': flags.dryrun = B_TRUE; break; + case 'L': + flags.largeblock = B_TRUE; + break; case 'e': flags.embed_data = B_TRUE; break; @@ -3800,6 +3803,8 @@ zfs_do_send(int argc, char **argv) if (zhp == NULL) return (1); + if (flags.largeblock) + lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (flags.embed_data) lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Nov 10 08:20:21 2014 (r274337) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2014 +.Dd November 10, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -427,6 +427,33 @@ This feature becomes as soon as it is enabled and will never return to being .Sy enabled . +.It Sy large_blocks +.Bl -column "READ\-ONLY COMPATIBLE" "org.open-zfs:large_block" +.It GUID Ta org.open-zfs:large_block +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta extensible_dataset +.El +.Pp +The +.Sy large_block +feature allows the record size on a dataset to be +set larger than 128KB. +.Pp +This feature becomes +.Sy active +once a +.Sy recordsize +property has been set larger than 128KB, and will return to being +.Sy enabled +once all filesystems that have ever had their recordsize larger than 128KB +are destroyed. +.Pp +Please note that booting from datasets that have recordsize greater than +128KB is +.Em NOT +supported by the +.Fx +boot loader. .El .Sh SEE ALSO .Xr zpool 8 Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Mon Nov 10 08:20:21 2014 (r274337) @@ -54,7 +54,6 @@ uint64_t total_stream_len = 0; FILE *send_stream = 0; boolean_t do_byteswap = B_FALSE; boolean_t do_cksum = B_TRUE; -#define INITIAL_BUFLEN (1<<20) static void usage(void) @@ -67,6 +66,18 @@ usage(void) exit(1); } +static void * +safe_malloc(size_t size) +{ + void *rv = malloc(size); + if (rv == NULL) { + (void) fprintf(stderr, "ERROR; failed to allocate %zu bytes\n", + size); + abort(); + } + return (rv); +} + /* * ssread - send stream read. * @@ -158,7 +169,7 @@ print_block(char *buf, int length) int main(int argc, char *argv[]) { - char *buf = malloc(INITIAL_BUFLEN); + char *buf = safe_malloc(SPA_MAXBLOCKSIZE); uint64_t drr_record_count[DRR_NUMTYPES] = { 0 }; uint64_t total_records = 0; dmu_replay_record_t thedrr; @@ -307,9 +318,9 @@ main(int argc, char *argv[]) nvlist_t *nv; int sz = drr->drr_payloadlen; - if (sz > INITIAL_BUFLEN) { + if (sz > SPA_MAXBLOCKSIZE) { free(buf); - buf = malloc(sz); + buf = safe_malloc(sz); } (void) ssread(buf, sz, &zc); if (ferror(send_stream)) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Nov 10 08:20:21 2014 (r274337) @@ -987,9 +987,15 @@ ztest_spa_get_ashift() { static int ztest_random_blocksize(void) { - // Choose a block size >= the ashift. - uint64_t block_shift = - ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1); + uint64_t block_shift; + /* + * Choose a block size >= the ashift. + * If the SPA supports new MAXBLOCKSIZE, test up to 1MB blocks. + */ + int maxbs = SPA_OLD_MAXBLOCKSHIFT; + if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE) + maxbs = 20; + block_shift = ztest_random(maxbs - ztest_spa_get_ashift() + 1); return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } @@ -4789,7 +4795,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 char path0[MAXPATHLEN]; char pathrand[MAXPATHLEN]; size_t fsize; - int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ + int bshift = SPA_OLD_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ int iters = 1000; int maxfaults; int mirror_save; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Nov 10 08:20:21 2014 (r274337) @@ -609,6 +609,9 @@ typedef struct sendflags { /* show progress (ie. -v) */ boolean_t progress; + /* large blocks (>128K) are permitted */ + boolean_t largeblock; + /* WRITE_EMBEDDED records of type DATA are permitted */ boolean_t embed_data; } sendflags_t; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Nov 10 08:20:21 2014 (r274337) @@ -1080,21 +1080,36 @@ zfs_valid_proplist(libzfs_handle_t *hdl, break; } - case ZFS_PROP_RECORDSIZE: case ZFS_PROP_VOLBLOCKSIZE: - /* must be power of two within SPA_{MIN,MAX}BLOCKSIZE */ + case ZFS_PROP_RECORDSIZE: + { + int maxbs = SPA_MAXBLOCKSIZE; + if (zhp != NULL) { + maxbs = zpool_get_prop_int(zhp->zpool_hdl, + ZPOOL_PROP_MAXBLOCKSIZE, NULL); + } + /* + * Volumes are limited to a volblocksize of 128KB, + * because they typically service workloads with + * small random writes, which incur a large performance + * penalty with large blocks. + */ + if (prop == ZFS_PROP_VOLBLOCKSIZE) + maxbs = SPA_OLD_MAXBLOCKSIZE; + /* + * The value must be a power of two between + * SPA_MINBLOCKSIZE and maxbs. + */ if (intval < SPA_MINBLOCKSIZE || - intval > SPA_MAXBLOCKSIZE || !ISP2(intval)) { + intval > maxbs || !ISP2(intval)) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "'%s' must be power of 2 from %u " - "to %uk"), propname, - (uint_t)SPA_MINBLOCKSIZE, - (uint_t)SPA_MAXBLOCKSIZE >> 10); + "'%s' must be power of 2 from 512B " + "to %uKB"), propname, maxbs >> 10); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } break; - + } case ZFS_PROP_MLSLABEL: { #ifdef sun @@ -1471,7 +1486,9 @@ zfs_setprop_error(libzfs_handle_t *hdl, break; case ERANGE: - if (prop == ZFS_PROP_COMPRESSION) { + case EDOM: + if (prop == ZFS_PROP_COMPRESSION || + prop == ZFS_PROP_RECORDSIZE) { (void) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "property setting is not allowed on " "bootable datasets")); @@ -3197,9 +3214,7 @@ zfs_create(libzfs_handle_t *hdl, const c case EDOM: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "volume block size must be power of 2 from " - "%u to %uk"), - (uint_t)SPA_MINBLOCKSIZE, - (uint_t)SPA_MAXBLOCKSIZE >> 10); + "512B to 128KB")); return (zfs_error(hdl, EZFS_BADPROP, errbuf)); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Nov 10 08:20:21 2014 (r274337) @@ -215,7 +215,7 @@ static void * cksummer(void *arg) { dedup_arg_t *dda = arg; - char *buf = malloc(1<<20); + char *buf = zfs_alloc(dda->dedup_hdl, SPA_MAXBLOCKSIZE); dmu_replay_record_t thedrr; dmu_replay_record_t *drr = &thedrr; struct drr_begin *drrb = &thedrr.drr_u.drr_begin; @@ -280,9 +280,9 @@ cksummer(void *arg) DMU_COMPOUNDSTREAM && drr->drr_payloadlen != 0) { int sz = drr->drr_payloadlen; - if (sz > 1<<20) { - free(buf); - buf = malloc(sz); + if (sz > SPA_MAXBLOCKSIZE) { + buf = zfs_realloc(dda->dedup_hdl, buf, + SPA_MAXBLOCKSIZE, sz); } (void) ssread(buf, sz, ofp); if (ferror(stdin)) @@ -815,7 +815,7 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable, progress, embed_data; + boolean_t verbose, dryrun, parsable, progress, embed_data, large_block; int outfd; boolean_t err; nvlist_t *fss; @@ -1163,6 +1163,8 @@ dump_snapshot(zfs_handle_t *zhp, void *a } enum lzc_send_flags flags = 0; + if (sdd->large_block) + flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (sdd->embed_data) flags |= LZC_SEND_FLAG_EMBED_DATA; @@ -1511,6 +1513,7 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.parsable = flags->parsable; sdd.progress = flags->progress; sdd.dryrun = flags->dryrun; + sdd.large_block = flags->largeblock; sdd.embed_data = flags->embed_data; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; @@ -2545,7 +2548,7 @@ static int recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byteswap) { dmu_replay_record_t *drr; - void *buf = malloc(1<<20); + void *buf = zfs_alloc(hdl, SPA_MAXBLOCKSIZE); char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Nov 10 08:20:21 2014 (r274337) @@ -502,6 +502,10 @@ lzc_get_holds(const char *snapname, nvli * * "fd" is the file descriptor to write the send stream to. * + * If "flags" contains LZC_SEND_FLAG_LARGE_BLOCK, the stream is permitted + * to contain DRR_WRITE records with drr_length > 128K, and DRR_OBJECT + * records with drr_blksz > 128K. + * * If "flags" contains LZC_SEND_FLAG_EMBED_DATA, the stream is permitted * to contain DRR_WRITE_EMBEDDED records with drr_etype==BP_EMBEDDED_TYPE_DATA, * which the receiving system must support (as indicated by support @@ -518,6 +522,8 @@ lzc_send(const char *snapname, const cha fnvlist_add_int32(args, "fd", fd); if (from != NULL) fnvlist_add_string(args, "fromsnap", from); + if (flags & LZC_SEND_FLAG_LARGE_BLOCK) + fnvlist_add_boolean(args, "largeblockok"); if (flags & LZC_SEND_FLAG_EMBED_DATA) fnvlist_add_boolean(args, "embedok"); err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL); Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Mon Nov 10 00:07:06 2014 (r274336) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Mon Nov 10 08:20:21 2014 (r274337) @@ -54,7 +54,8 @@ int lzc_release(nvlist_t *, nvlist_t **) int lzc_get_holds(const char *, nvlist_t **); enum lzc_send_flags { - LZC_SEND_FLAG_EMBED_DATA = 1 << 0 + LZC_SEND_FLAG_EMBED_DATA = 1 << 0, + LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1 }; int lzc_send(const char *, const char *, int, enum lzc_send_flags); Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/boot/zfs/zfsimpl.c Mon Nov 10 08:20:21 2014 (r274337) @@ -57,6 +57,7 @@ static const char *features_for_read[] = "com.delphix:hole_birth", "com.delphix:extensible_dataset", "com.delphix:embedded_data", + "org.open-zfs:large_blocks", NULL }; @@ -1222,6 +1223,11 @@ dnode_read(const spa_t *spa, const dnode int nlevels = dnode->dn_nlevels; int i, rc; + if (bsize > SPA_MAXBLOCKSIZE) { + printf("ZFS: I/O error - blocks larger than 128K are not supported\n"); + return (EIO); + } + /* * Note: bsize may not be a power of two here so we need to do an * actual divide rather than a bitshift. Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/boot/zfs/zfsimpl.h Mon Nov 10 08:20:21 2014 (r274337) @@ -113,17 +113,14 @@ #define BSWAP_64(x) ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32)) /* - * We currently support nine block sizes, from 512 bytes to 128K. - * We could go higher, but the benefits are near-zero and the cost - * of COWing a giant block to modify one byte would become excessive. + * Note: the boot loader can't actually read blocks larger than 128KB, + * due to lack of memory. Therefore its SPA_MAXBLOCKSIZE is still 128KB. */ #define SPA_MINBLOCKSHIFT 9 #define SPA_MAXBLOCKSHIFT 17 #define SPA_MINBLOCKSIZE (1ULL << SPA_MINBLOCKSHIFT) #define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT) -#define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) - /* * The DVA size encodings for LSIZE and PSIZE support blocks up to 32MB. * The ASIZE encoding should be at least 64 times larger (6 more bits) Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Nov 10 08:20:21 2014 (r274337) @@ -56,7 +56,8 @@ valid_char(char c, boolean_t after_colon { return ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || - c == (after_colon ? '_' : '.')); + (after_colon && c == '_') || + (!after_colon && (c == '.' || c == '-'))); } /* @@ -220,4 +221,13 @@ zpool_feature_init(void) "com.delphix:embedded_data", "embedded_data", "Blocks which compress very well use even less space.", B_FALSE, B_TRUE, B_TRUE, NULL); + + static const spa_feature_t large_blocks_deps[] = { + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURE_NONE + }; + zfeature_register(SPA_FEATURE_LARGE_BLOCKS, + "org.open-zfs:large_blocks", "large_blocks", + "Support for blocks larger than 128KB.", B_FALSE, B_FALSE, B_FALSE, + large_blocks_deps); } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Nov 10 08:20:21 2014 (r274337) @@ -50,6 +50,7 @@ typedef enum spa_feature { SPA_FEATURE_EMBEDDED_DATA, SPA_FEATURE_BOOKMARKS, SPA_FEATURE_FS_SS_LIMIT, + SPA_FEATURE_LARGE_BLOCKS, SPA_FEATURES } spa_feature_t; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Nov 10 08:20:21 2014 (r274337) @@ -409,8 +409,8 @@ zfs_prop_init(void) /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", - SPA_MAXBLOCKSIZE, PROP_INHERIT, - ZFS_TYPE_FILESYSTEM, "512 to 128k, power of 2", "RECSIZE"); + SPA_OLD_MAXBLOCKSIZE, PROP_INHERIT, + ZFS_TYPE_FILESYSTEM, "512 to 1M, power of 2", "RECSIZE"); /* hidden properties */ zprop_register_hidden(ZFS_PROP_CREATETXG, "createtxg", PROP_TYPE_NUMBER, Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Mon Nov 10 08:20:21 2014 (r274337) @@ -127,6 +127,8 @@ zpool_prop_init(void) /* hidden properties */ zprop_register_hidden(ZPOOL_PROP_NAME, "name", PROP_TYPE_STRING, PROP_READONLY, ZFS_TYPE_POOL, "NAME"); + zprop_register_hidden(ZPOOL_PROP_MAXBLOCKSIZE, "maxblocksize", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXBLOCKSIZE"); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Mon Nov 10 08:20:21 2014 (r274337) @@ -43,7 +43,7 @@ bpobj_alloc_empty(objset_t *os, int bloc if (!spa_feature_is_active(spa, SPA_FEATURE_EMPTY_BPOBJ)) { ASSERT0(dp->dp_empty_bpobj); dp->dp_empty_bpobj = - bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); + bpobj_alloc(os, SPA_OLD_MAXBLOCKSIZE, tx); VERIFY(zap_add(os, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, @@ -398,7 +398,8 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 dmu_buf_will_dirty(bpo->bpo_dbuf, tx); if (bpo->bpo_phys->bpo_subobjs == 0) { bpo->bpo_phys->bpo_subobjs = dmu_object_alloc(bpo->bpo_os, - DMU_OT_BPOBJ_SUBOBJ, SPA_MAXBLOCKSIZE, DMU_OT_NONE, 0, tx); + DMU_OT_BPOBJ_SUBOBJ, SPA_OLD_MAXBLOCKSIZE, + DMU_OT_NONE, 0, tx); } dmu_object_info_t doi; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Nov 10 08:20:21 2014 (r274337) @@ -65,7 +65,7 @@ bptree_alloc(objset_t *os, dmu_tx_t *tx) bptree_phys_t *bt; obj = dmu_object_alloc(os, DMU_OTN_UINT64_METADATA, - SPA_MAXBLOCKSIZE, DMU_OTN_UINT64_METADATA, + SPA_OLD_MAXBLOCKSIZE, DMU_OTN_UINT64_METADATA, sizeof (bptree_phys_t), tx); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Nov 10 08:20:21 2014 (r274337) @@ -2022,10 +2022,8 @@ dbuf_spill_set_blksz(dmu_buf_t *db_fake, return (SET_ERROR(ENOTSUP)); if (blksz == 0) blksz = SPA_MINBLOCKSIZE; - if (blksz > SPA_MAXBLOCKSIZE) - blksz = SPA_MAXBLOCKSIZE; - else - blksz = P2ROUNDUP(blksz, SPA_MINBLOCKSIZE); + ASSERT3U(blksz, <=, spa_maxblocksize(dmu_objset_spa(db->db_objset))); + blksz = P2ROUNDUP(blksz, SPA_MINBLOCKSIZE); DB_DNODE_ENTER(db); dn = DB_DNODE(db); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Nov 10 08:20:21 2014 (r274337) @@ -255,6 +255,14 @@ logbias_changed_cb(void *arg, uint64_t n zil_set_logbias(os->os_zil, newval); } +static void +recordsize_changed_cb(void *arg, uint64_t newval) +{ + objset_t *os = arg; + + os->os_recordsize = newval; +} + void dmu_objset_byteswap(void *buf, size_t size) { @@ -384,6 +392,11 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat ZFS_PROP_REDUNDANT_METADATA), redundant_metadata_changed_cb, os); } + if (err == 0) { + err = dsl_prop_register(ds, + zfs_prop_to_name(ZFS_PROP_RECORDSIZE), + recordsize_changed_cb, os); + } } if (err != 0) { VERIFY(arc_buf_remove_ref(os->os_phys_buf, @@ -642,6 +655,9 @@ dmu_objset_evict(objset_t *os) VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_REDUNDANT_METADATA), redundant_metadata_changed_cb, os)); + VERIFY0(dsl_prop_unregister(ds, + zfs_prop_to_name(ZFS_PROP_RECORDSIZE), + recordsize_changed_cb, os)); } VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_PRIMARYCACHE), Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Nov 10 08:20:21 2014 (r274337) @@ -227,11 +227,12 @@ dump_write(dmu_sendarg_t *dsp, dmu_objec drrw->drr_offset = offset; drrw->drr_length = blksz; drrw->drr_toguid = dsp->dsa_toguid; - if (BP_IS_EMBEDDED(bp)) { + if (bp == NULL || BP_IS_EMBEDDED(bp)) { /* - * There's no pre-computed checksum of embedded BP's, so - * (like fletcher4-checkummed blocks) userland will have - * to compute a dedup-capable checksum itself. + * There's no pre-computed checksum for partial-block + * writes or embedded BP's, so (like + * fletcher4-checkummed blocks) userland will have to + * compute a dedup-capable checksum itself. */ drrw->drr_checksumtype = ZIO_CHECKSUM_OFF; } else { @@ -393,6 +394,10 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t drro->drr_compress = dnp->dn_compress; drro->drr_toguid = dsp->dsa_toguid; + if (!(dsp->dsa_featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + drro->drr_blksz > SPA_OLD_MAXBLOCKSIZE) + drro->drr_blksz = SPA_OLD_MAXBLOCKSIZE; + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (SET_ERROR(EINTR)); @@ -512,6 +517,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co uint32_t aflags = ARC_WAIT; arc_buf_t *abuf; int blksz = BP_GET_LSIZE(bp); + uint64_t offset; ASSERT3U(blksz, ==, dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); ASSERT0(zb->zb_level); @@ -532,8 +538,24 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } } - err = dump_write(dsp, type, zb->zb_object, zb->zb_blkid * blksz, - blksz, bp, abuf->b_data); + offset = zb->zb_blkid * blksz; + + if (!(dsp->dsa_featureflags & + DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + blksz > SPA_OLD_MAXBLOCKSIZE) { + char *buf = abuf->b_data; + while (blksz > 0 && err == 0) { + int n = MIN(blksz, SPA_OLD_MAXBLOCKSIZE); + err = dump_write(dsp, type, zb->zb_object, + offset, n, NULL, buf); + offset += n; + buf += n; + blksz -= n; + } + } else { + err = dump_write(dsp, type, zb->zb_object, + offset, blksz, bp, abuf->b_data); + } (void) arc_buf_remove_ref(abuf, &abuf); } @@ -548,9 +570,9 @@ static int dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *ds, zfs_bookmark_phys_t *fromzb, boolean_t is_clone, boolean_t embedok, #ifdef illumos - int outfd, vnode_t *vp, offset_t *off) + boolean_t large_block_ok, int outfd, vnode_t *vp, offset_t *off) #else - int outfd, struct file *fp, offset_t *off) + boolean_t large_block_ok, int outfd, struct file *fp, offset_t *off) #endif { objset_t *os; @@ -586,6 +608,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, } #endif + if (large_block_ok && ds->ds_large_blocks) + featureflags |= DMU_BACKUP_FEATURE_LARGE_BLOCKS; if (embedok && spa_feature_is_active(dp->dp_spa, SPA_FEATURE_EMBEDDED_DATA)) { featureflags |= DMU_BACKUP_FEATURE_EMBED_DATA; @@ -682,10 +706,11 @@ out: int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, + boolean_t embedok, boolean_t large_block_ok, #ifdef illumos - boolean_t embedok, int outfd, vnode_t *vp, offset_t *off) + int outfd, vnode_t *vp, offset_t *off) #else - boolean_t embedok, int outfd, struct file *fp, offset_t *off) + int outfd, struct file *fp, offset_t *off) #endif { dsl_pool_t *dp; @@ -720,18 +745,19 @@ dmu_send_obj(const char *pool, uint64_t zb.zbm_guid = fromds->ds_phys->ds_guid; is_clone = (fromds->ds_dir != ds->ds_dir); dsl_dataset_rele(fromds, FTAG); - err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, embedok, - outfd, fp, off); + err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, + embedok, large_block_ok, outfd, fp, off); } else { - err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, embedok, - outfd, fp, off); + err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, + embedok, large_block_ok, outfd, fp, off); } dsl_dataset_rele(ds, FTAG); return (err); } int -dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok, +dmu_send(const char *tosnap, const char *fromsnap, + boolean_t embedok, boolean_t large_block_ok, #ifdef illumos int outfd, vnode_t *vp, offset_t *off) #else @@ -802,11 +828,11 @@ dmu_send(const char *tosnap, const char dsl_pool_rele(dp, FTAG); return (err); } - err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, embedok, - outfd, fp, off); + err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, + embedok, large_block_ok, outfd, fp, off); } else { - err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, embedok, - outfd, fp, off); + err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, + embedok, large_block_ok, outfd, fp, off); } if (owned) dsl_dataset_disown(ds, FTAG); @@ -1006,6 +1032,15 @@ dmu_recv_begin_check(void *arg, dmu_tx_t !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LZ4_COMPRESS)) return (SET_ERROR(ENOTSUP)); + /* + * The receiving code doesn't know how to translate large blocks + * to smaller ones, so the pool must have the LARGE_BLOCKS + * feature enabled if the stream has LARGE_BLOCKS. + */ + if ((featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) + return (SET_ERROR(ENOTSUP)); + error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* target fs already exists; recv into temp clone */ @@ -1131,6 +1166,13 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } VERIFY0(dsl_dataset_own_obj(dp, dsobj, dmu_recv_tag, &newds)); + if ((DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) & + DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + !newds->ds_large_blocks) { + dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); + newds->ds_large_blocks = B_TRUE; + } + dmu_buf_will_dirty(newds->ds_dbuf, tx); newds->ds_phys->ds_flags |= DS_FLAG_INCONSISTENT; @@ -1283,6 +1325,7 @@ restore_read(struct restorearg *ra, int /* some things will require 8-byte alignment, so everything must */ ASSERT0(len % 8); + ASSERT3U(len, <=, ra->bufsize); while (done < len) { ssize_t resid; @@ -1420,7 +1463,7 @@ restore_object(struct restorearg *ra, ob drro->drr_compress >= ZIO_COMPRESS_FUNCTIONS || P2PHASE(drro->drr_blksz, SPA_MINBLOCKSIZE) || drro->drr_blksz < SPA_MINBLOCKSIZE || - drro->drr_blksz > SPA_MAXBLOCKSIZE || + drro->drr_blksz > spa_maxblocksize(dmu_objset_spa(os)) || drro->drr_bonuslen > DN_MAX_BONUSLEN) { return (SET_ERROR(EINVAL)); } @@ -1693,7 +1736,7 @@ restore_spill(struct restorearg *ra, obj int err; if (drrs->drr_length < SPA_MINBLOCKSIZE || - drrs->drr_length > SPA_MAXBLOCKSIZE) + drrs->drr_length > spa_maxblocksize(dmu_objset_spa(os))) return (SET_ERROR(EINVAL)); data = restore_read(ra, drrs->drr_length, NULL); @@ -1781,7 +1824,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, ra.td = curthread; ra.fp = fp; ra.voff = *voffp; - ra.bufsize = 1<<20; + ra.bufsize = SPA_MAXBLOCKSIZE; ra.buf = kmem_alloc(ra.bufsize, KM_SLEEP); /* these were verified in dmu_recv_begin */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Nov 10 08:20:21 2014 (r274337) @@ -224,7 +224,7 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u return; min_bs = SPA_MINBLOCKSHIFT; - max_bs = SPA_MAXBLOCKSHIFT; + max_bs = highbit64(txh->txh_tx->tx_objset->os_recordsize) - 1; min_ibs = DN_MIN_INDBLKSHIFT; max_ibs = DN_MAX_INDBLKSHIFT; @@ -293,6 +293,14 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u */ ASSERT(dn->dn_datablkshift != 0); min_bs = max_bs = dn->dn_datablkshift; + } else { + /* + * The blocksize can increase up to the recordsize, + * or if it is already more than the recordsize, + * up to the next power of 2. + */ + min_bs = highbit64(dn->dn_datablksz - 1); + max_bs = MAX(max_bs, highbit64(dn->dn_datablksz - 1)); } /* @@ -751,11 +759,11 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o bp = &dn->dn_phys->dn_blkptr[0]; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, bp, bp->blk_birth)) - txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; + txh->txh_space_tooverwrite += MZAP_MAX_BLKSZ; else - txh->txh_space_towrite += SPA_MAXBLOCKSIZE; + txh->txh_space_towrite += MZAP_MAX_BLKSZ; if (!BP_IS_HOLE(bp)) - txh->txh_space_tounref += SPA_MAXBLOCKSIZE; + txh->txh_space_tounref += MZAP_MAX_BLKSZ; return; } @@ -1549,18 +1557,18 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t /* If blkptr doesn't exist then add space to towrite */ if (!(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) { - txh->txh_space_towrite += SPA_MAXBLOCKSIZE; + txh->txh_space_towrite += SPA_OLD_MAXBLOCKSIZE; } else { blkptr_t *bp; bp = &dn->dn_phys->dn_spill; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, bp, bp->blk_birth)) - txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; + txh->txh_space_tooverwrite += SPA_OLD_MAXBLOCKSIZE; else - txh->txh_space_towrite += SPA_MAXBLOCKSIZE; + txh->txh_space_towrite += SPA_OLD_MAXBLOCKSIZE; if (!BP_IS_HOLE(bp)) - txh->txh_space_tounref += SPA_MAXBLOCKSIZE; + txh->txh_space_tounref += SPA_OLD_MAXBLOCKSIZE; } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Nov 10 00:07:06 2014 (r274336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Nov 10 08:20:21 2014 (r274337) @@ -513,10 +513,10 @@ dnode_allocate(dnode_t *dn, dmu_object_t { int i; + ASSERT3U(blocksize, <=, + spa_maxblocksize(dmu_objset_spa(dn->dn_objset))); if (blocksize == 0) blocksize = 1 << zfs_default_bs; - else if (blocksize > SPA_MAXBLOCKSIZE) - blocksize = SPA_MAXBLOCKSIZE; else blocksize = P2ROUNDUP(blocksize, SPA_MINBLOCKSIZE); @@ -597,7 +597,8 @@ dnode_reallocate(dnode_t *dn, dmu_object int nblkptr; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 08:31:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60D533D8; Mon, 10 Nov 2014 08:31:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DB0BF44; Mon, 10 Nov 2014 08:31:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAA8Vv55028193; Mon, 10 Nov 2014 08:31:57 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAA8VvIf028192; Mon, 10 Nov 2014 08:31:57 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411100831.sAA8VvIf028192@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Mon, 10 Nov 2014 08:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274338 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 08:31:57 -0000 Author: luigi Date: Mon Nov 10 08:31:56 2014 New Revision: 274338 URL: https://svnweb.freebsd.org/changeset/base/274338 Log: return kernel-supplied error if available. Also fix field names in a comment. Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Mon Nov 10 08:20:21 2014 (r274337) +++ head/sys/net/netmap_user.h Mon Nov 10 08:31:56 2014 (r274338) @@ -40,7 +40,7 @@ * From there: * struct netmap_ring *NETMAP_TXRING(nifp, index) * struct netmap_ring *NETMAP_RXRING(nifp, index) - * we can access ring->nr_cur, ring->nr_avail, ring->nr_flags + * we can access ring->cur, ring->head, ring->tail, etc. * * ring->slot[i] gives us the i-th slot (we can access * directly len, flags, buf_idx) @@ -543,7 +543,8 @@ fail: nm_close(d); if (errmsg) D("%s %s", errmsg, ifname); - errno = EINVAL; + if (errno == 0) + errno = EINVAL; return NULL; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 09:11:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF1ACDDE; Mon, 10 Nov 2014 09:11:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99A443A4; Mon, 10 Nov 2014 09:11:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAA9BOwE044930; Mon, 10 Nov 2014 09:11:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAA9BOUw044929; Mon, 10 Nov 2014 09:11:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411100911.sAA9BOUw044929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Nov 2014 09:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274339 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 09:11:24 -0000 Author: kib Date: Mon Nov 10 09:11:23 2014 New Revision: 274339 URL: https://svnweb.freebsd.org/changeset/base/274339 Log: MFC r274038: Clean up confusing comment. Modified: stable/10/sys/kern/kern_thr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thr.c ============================================================================== --- stable/10/sys/kern/kern_thr.c Mon Nov 10 08:31:56 2014 (r274338) +++ stable/10/sys/kern/kern_thr.c Mon Nov 10 09:11:23 2014 (r274339) @@ -317,10 +317,6 @@ sys_thr_exit(struct thread *td, struct t PROC_LOCK(p); - /* - * Shutting down last thread in the proc. This will actually - * call exit() in the trampoline when it returns. - */ if (p->p_numthreads != 1) { racct_sub(p, RACCT_NTHR, 1); LIST_REMOVE(td, td_hash); @@ -331,6 +327,12 @@ sys_thr_exit(struct thread *td, struct t thread_exit(); /* NOTREACHED */ } + + /* + * Ignore attempts to shut down last thread in the proc. This + * will actually call _exit(2) in the usermode trampoline when + * it returns. + */ PROC_UNLOCK(p); rw_wunlock(&tidhash_lock); return (0); From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 09:44:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B669852; Mon, 10 Nov 2014 09:44:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D22E92E; Mon, 10 Nov 2014 09:44:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAA9ieHZ061967; Mon, 10 Nov 2014 09:44:40 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAA9icnN061962; Mon, 10 Nov 2014 09:44:38 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411100944.sAA9icnN061962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 10 Nov 2014 09:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 09:44:40 -0000 Author: des Date: Mon Nov 10 09:44:38 2014 New Revision: 274340 URL: https://svnweb.freebsd.org/changeset/base/274340 Log: Constify the AES code and propagate to consumers. This allows us to update the Fortuna code to use SHAd-256 as defined in FS&K. Approved by: so (self) Modified: head/sys/crypto/rijndael/rijndael-api-fst.c head/sys/crypto/rijndael/rijndael-api-fst.h head/sys/dev/random/fortuna.c head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/sys/geom/bde/g_bde.h Modified: head/sys/crypto/rijndael/rijndael-api-fst.c ============================================================================== --- head/sys/crypto/rijndael/rijndael-api-fst.c Mon Nov 10 09:11:23 2014 (r274339) +++ head/sys/crypto/rijndael/rijndael-api-fst.c Mon Nov 10 09:44:38 2014 (r274340) @@ -34,7 +34,8 @@ __FBSDID("$FreeBSD$"); typedef u_int8_t BYTE; -int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen, char *keyMaterial) { +int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen, + const char *keyMaterial) { u_int8_t cipherKey[RIJNDAEL_MAXKB]; if (key == NULL) { @@ -83,7 +84,7 @@ int rijndael_cipherInit(cipherInstance * } int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key, - BYTE *input, int inputLen, BYTE *outBuffer) { + const BYTE *input, int inputLen, BYTE *outBuffer) { int i, k, numBlocks; u_int8_t block[16], iv[4][4]; @@ -198,7 +199,7 @@ int rijndael_blockEncrypt(cipherInstance * @return length in octets (not bits) of the encrypted output buffer. */ int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key, - BYTE *input, int inputOctets, BYTE *outBuffer) { + const BYTE *input, int inputOctets, BYTE *outBuffer) { int i, numBlocks, padLen; u_int8_t block[16], *iv, *cp; @@ -261,7 +262,7 @@ int rijndael_padEncrypt(cipherInstance * } int rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key, - BYTE *input, int inputLen, BYTE *outBuffer) { + const BYTE *input, int inputLen, BYTE *outBuffer) { int i, k, numBlocks; u_int8_t block[16], iv[4][4]; @@ -360,7 +361,7 @@ int rijndael_blockDecrypt(cipherInstance } int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key, - BYTE *input, int inputOctets, BYTE *outBuffer) { + const BYTE *input, int inputOctets, BYTE *outBuffer) { int i, numBlocks, padLen; u_int8_t block[16]; u_int32_t iv[4]; Modified: head/sys/crypto/rijndael/rijndael-api-fst.h ============================================================================== --- head/sys/crypto/rijndael/rijndael-api-fst.h Mon Nov 10 09:11:23 2014 (r274339) +++ head/sys/crypto/rijndael/rijndael-api-fst.h Mon Nov 10 09:44:38 2014 (r274340) @@ -56,18 +56,18 @@ typedef struct { /* c /* Function prototypes */ -int rijndael_makeKey(keyInstance *, u_int8_t, int, char *); +int rijndael_makeKey(keyInstance *, u_int8_t, int, const char *); int rijndael_cipherInit(cipherInstance *, u_int8_t, char *); -int rijndael_blockEncrypt(cipherInstance *, keyInstance *, u_int8_t *, int, - u_int8_t *); -int rijndael_padEncrypt(cipherInstance *, keyInstance *, u_int8_t *, int, - u_int8_t *); - -int rijndael_blockDecrypt(cipherInstance *, keyInstance *, u_int8_t *, int, - u_int8_t *); -int rijndael_padDecrypt(cipherInstance *, keyInstance *, u_int8_t *, int, - u_int8_t *); +int rijndael_blockEncrypt(cipherInstance *, keyInstance *, const u_int8_t *, + int, u_int8_t *); +int rijndael_padEncrypt(cipherInstance *, keyInstance *, const u_int8_t *, + int, u_int8_t *); + +int rijndael_blockDecrypt(cipherInstance *, keyInstance *, const u_int8_t *, + int, u_int8_t *); +int rijndael_padDecrypt(cipherInstance *, keyInstance *, const u_int8_t *, + int, u_int8_t *); #endif /* __RIJNDAEL_API_FST_H */ Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon Nov 10 09:11:23 2014 (r274339) +++ head/sys/dev/random/fortuna.c Mon Nov 10 09:44:38 2014 (r274340) @@ -27,13 +27,11 @@ /* This implementation of Fortuna is based on the descriptions found in * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and Schneier - * ("K&S"). + * ("F&S"). * - * The above book is superceded by ISBN 978-0-470-47424-2 "Cryptography - * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). - * - * This code has not yet caught up with FS&K, but differences are not - * expected to be complex. + * The above book is superseded by ISBN 978-0-470-47424-2 "Cryptography + * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). The code has + * not yet fully caught up with FS&K. */ #include @@ -252,12 +250,9 @@ reseed(uint8_t *junk, u_int length) mtx_assert(&random_reseed_mtx, MA_OWNED); #endif - /* F&S - K = Hd(K|s) where Hd(m) is H(H(m)) */ + /* FS&K - K = Hd(K|s) where Hd(m) is H(H(0^512|m)) */ randomdev_hash_init(&context); -#if 0 - /* FS&K defines Hd(m) as H(H(0^512|m)) */ - randomdev_hash_iterate(&context, zero_region, KEYSIZE); -#endif + randomdev_hash_iterate(&context, zero_region, 512/8); randomdev_hash_iterate(&context, &fortuna_state.key, sizeof(fortuna_state.key)); randomdev_hash_iterate(&context, junk, length); randomdev_hash_finish(&context, hash); @@ -270,7 +265,7 @@ reseed(uint8_t *junk, u_int length) /* Unblock the device if it was blocked due to being unseeded */ if (uint128_is_zero(fortuna_state.counter.whole)) random_adaptor_unblock(); - /* F&S - C = C + 1 */ + /* FS&K - C = C + 1 */ uint128_increment(&fortuna_state.counter.whole); } Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Mon Nov 10 09:11:23 2014 (r274339) +++ head/sys/dev/random/hash.c Mon Nov 10 09:44:38 2014 (r274340) @@ -60,7 +60,7 @@ randomdev_hash_init(struct randomdev_has /* Iterate the hash */ void -randomdev_hash_iterate(struct randomdev_hash *context, void *data, size_t size) +randomdev_hash_iterate(struct randomdev_hash *context, const void *data, size_t size) { SHA256_Update(&context->sha, data, size); @@ -81,7 +81,7 @@ randomdev_hash_finish(struct randomdev_h * data. Use CBC mode for better avalanche. */ void -randomdev_encrypt_init(struct randomdev_key *context, void *data) +randomdev_encrypt_init(struct randomdev_key *context, const void *data) { rijndael_cipherInit(&context->cipher, MODE_CBC, NULL); @@ -93,7 +93,7 @@ randomdev_encrypt_init(struct randomdev_ * a multiple of BLOCKSIZE. */ void -randomdev_encrypt(struct randomdev_key *context, void *d_in, void *d_out, u_int length) +randomdev_encrypt(struct randomdev_key *context, const void *d_in, void *d_out, u_int length) { rijndael_blockEncrypt(&context->cipher, &context->key, d_in, length*8, d_out); Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Mon Nov 10 09:11:23 2014 (r274339) +++ head/sys/dev/random/hash.h Mon Nov 10 09:44:38 2014 (r274340) @@ -42,9 +42,9 @@ struct randomdev_key { /* Big! Make sta }; void randomdev_hash_init(struct randomdev_hash *); -void randomdev_hash_iterate(struct randomdev_hash *, void *, size_t); +void randomdev_hash_iterate(struct randomdev_hash *, const void *, size_t); void randomdev_hash_finish(struct randomdev_hash *, void *); -void randomdev_encrypt_init(struct randomdev_key *, void *); -void randomdev_encrypt(struct randomdev_key *context, void *, void *, u_int); +void randomdev_encrypt_init(struct randomdev_key *, const void *); +void randomdev_encrypt(struct randomdev_key *context, const void *, void *, u_int); #endif Modified: head/sys/geom/bde/g_bde.h ============================================================================== --- head/sys/geom/bde/g_bde.h Mon Nov 10 09:11:23 2014 (r274339) +++ head/sys/geom/bde/g_bde.h Mon Nov 10 09:44:38 2014 (r274340) @@ -182,7 +182,7 @@ AES_init(cipherInstance *ci) } static __inline void -AES_makekey(keyInstance *ki, int dir, u_int len, void *key) +AES_makekey(keyInstance *ki, int dir, u_int len, const void *key) { int error; @@ -191,7 +191,7 @@ AES_makekey(keyInstance *ki, int dir, u_ } static __inline void -AES_encrypt(cipherInstance *ci, keyInstance *ki, void *in, void *out, u_int len) +AES_encrypt(cipherInstance *ci, keyInstance *ki, const void *in, void *out, u_int len) { int error; @@ -200,7 +200,7 @@ AES_encrypt(cipherInstance *ci, keyInsta } static __inline void -AES_decrypt(cipherInstance *ci, keyInstance *ki, void *in, void *out, u_int len) +AES_decrypt(cipherInstance *ci, keyInstance *ki, const void *in, void *out, u_int len) { int error; From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 09:55:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B02DAF0; Mon, 10 Nov 2014 09:55:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77477A39; Mon, 10 Nov 2014 09:55:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAA9tbiK066798; Mon, 10 Nov 2014 09:55:37 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAA9tZVR066792; Mon, 10 Nov 2014 09:55:35 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411100955.sAA9tZVR066792@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 10 Nov 2014 09:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274341 - in head/sys: crypto/rijndael dev/random geom/bde 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 09:55:37 -0000 Author: des Date: Mon Nov 10 09:55:35 2014 New Revision: 274341 URL: https://svnweb.freebsd.org/changeset/base/274341 Log: I just realized that the previous commit message makes no sense: the first sentence should have read "Constify the AES and SHA-256 code and wrappers". This allows us to feed zero_region (which is const) to the hash function during reseeding and thereby implement the FS&K version of SHAd-256 instead of the older F&S version. Approved by: so (self) Modified: head/sys/crypto/rijndael/rijndael-api-fst.c head/sys/crypto/rijndael/rijndael-api-fst.h head/sys/dev/random/fortuna.c head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/sys/geom/bde/g_bde.h Modified: head/sys/crypto/rijndael/rijndael-api-fst.c ============================================================================== Modified: head/sys/crypto/rijndael/rijndael-api-fst.h ============================================================================== Modified: head/sys/dev/random/fortuna.c ============================================================================== Modified: head/sys/dev/random/hash.c ============================================================================== Modified: head/sys/dev/random/hash.h ============================================================================== Modified: head/sys/geom/bde/g_bde.h ============================================================================== From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 10:59:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F2F1A65; Mon, 10 Nov 2014 10:59:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C10F12D; Mon, 10 Nov 2014 10:59:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAAx9XK095253; Mon, 10 Nov 2014 10:59:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAAx93m095252; Mon, 10 Nov 2014 10:59:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411101059.sAAAx93m095252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 10 Nov 2014 10:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274342 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 10:59:09 -0000 Author: ae Date: Mon Nov 10 10:59:08 2014 New Revision: 274342 URL: https://svnweb.freebsd.org/changeset/base/274342 Log: For now handle only multicast addresses, we still use routes to LLA unicasts yet. Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Mon Nov 10 09:55:35 2014 (r274341) +++ head/sys/netinet6/in6_src.c Mon Nov 10 10:59:08 2014 (r274342) @@ -587,10 +587,18 @@ selectroute(struct sockaddr_in6 *dstsock goto getroute; } /* + * If the destination address is a multicast address and the outgoing + * interface for the address is specified by the caller, use it. + */ + if (IN6_IS_ADDR_MULTICAST(dst) && + mopts != NULL && (ifp = mopts->im6o_multicast_ifp) != NULL) { + goto done; /* we do not need a route for multicast. */ + } + /* * If destination address is LLA or link- or node-local multicast, * use it's embedded scope zone id to determine outgoing interface. */ - if (IN6_IS_SCOPE_LINKLOCAL(dst) || + if (IN6_IS_ADDR_MC_LINKLOCAL(dst) || IN6_IS_ADDR_MC_NODELOCAL(dst)) { zoneid = ntohs(in6_getscope(dst)); if (zoneid > 0) { @@ -598,14 +606,6 @@ selectroute(struct sockaddr_in6 *dstsock goto done; } } - /* - * If the destination address is a multicast address and the outgoing - * interface for the address is specified by the caller, use it. - */ - if (IN6_IS_ADDR_MULTICAST(dst) && - mopts != NULL && (ifp = mopts->im6o_multicast_ifp) != NULL) { - goto done; /* we do not need a route for multicast. */ - } getroute: /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 14:11:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F7AB164; Mon, 10 Nov 2014 14:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C3A88EA; Mon, 10 Nov 2014 14:11:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAEBHP0087256; Mon, 10 Nov 2014 14:11:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAEBHZf087254; Mon, 10 Nov 2014 14:11:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411101411.sAAEBHZf087254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Nov 2014 14:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274343 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 14:11:18 -0000 Author: kib Date: Mon Nov 10 14:11:17 2014 New Revision: 274343 URL: https://svnweb.freebsd.org/changeset/base/274343 Log: When sleeping waiting for the profiling stop, always set P_STOPPROF before dropping process lock. Clear P_STOPPROF when doing wakeup. Both issues caused thread to hang in stopprofclock() "stopprof" sleep. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_clock.c head/sys/kern/subr_prof.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Nov 10 10:59:08 2014 (r274342) +++ head/sys/kern/kern_clock.c Mon Nov 10 14:11:17 2014 (r274343) @@ -668,11 +668,11 @@ stopprofclock(p) PROC_LOCK_ASSERT(p, MA_OWNED); if (p->p_flag & P_PROFIL) { if (p->p_profthreads != 0) { - p->p_flag |= P_STOPPROF; - while (p->p_profthreads != 0) + while (p->p_profthreads != 0) { + p->p_flag |= P_STOPPROF; msleep(&p->p_profthreads, &p->p_mtx, PPAUSE, "stopprof", 0); - p->p_flag &= ~P_STOPPROF; + } } if ((p->p_flag & P_PROFIL) == 0) return; Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Mon Nov 10 10:59:08 2014 (r274342) +++ head/sys/kern/subr_prof.c Mon Nov 10 14:11:17 2014 (r274343) @@ -533,6 +533,7 @@ out: if (--p->p_profthreads == 0) { if (p->p_flag & P_STOPPROF) { wakeup(&p->p_profthreads); + p->p_flag &= ~P_STOPPROF; stop = 0; } } From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 14:26:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A88B8D8; Mon, 10 Nov 2014 14:26:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85DF7ACD; Mon, 10 Nov 2014 14:26:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAEQvV3092854; Mon, 10 Nov 2014 14:26:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAEQvuT092852; Mon, 10 Nov 2014 14:26:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411101426.sAAEQvuT092852@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Nov 2014 14:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274344 - in stable/10: . etc/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 14:26:57 -0000 Author: emaste Date: Mon Nov 10 14:26:56 2014 New Revision: 274344 URL: https://svnweb.freebsd.org/changeset/base/274344 Log: Add missing /usr/lib/debug directories Directories for /usr/lib{,32}/{i18n,private} were missing from the mtree file, which caused installworld to install the files that should be in the directory as the name of the directory. MFC of r273780 Modified: stable/10/ObsoleteFiles.inc stable/10/etc/mtree/BSD.debug.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Mon Nov 10 14:11:17 2014 (r274343) +++ stable/10/ObsoleteFiles.inc Mon Nov 10 14:26:56 2014 (r274344) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20141028: debug files accidentally installed as directory name +OLD_FILES+=usr/lib/debug/usr/lib/i18n +OLD_FILES+=usr/lib/debug/usr/lib/private +OLD_FILES+=usr/lib/debug/usr/lib32/i18n +OLD_FILES+=usr/lib/debug/usr/lib32/private # 20141015: OpenSSL 1.0.1j import OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz # 20141010: rc.d/kerberos removed Modified: stable/10/etc/mtree/BSD.debug.dist ============================================================================== --- stable/10/etc/mtree/BSD.debug.dist Mon Nov 10 14:11:17 2014 (r274343) +++ stable/10/etc/mtree/BSD.debug.dist Mon Nov 10 14:26:56 2014 (r274344) @@ -26,8 +26,16 @@ lib engines .. + i18n + .. + private + .. .. lib32 + i18n + .. + private + .. .. libexec bsdinstall From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 15:10:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A0AA3A3; Mon, 10 Nov 2014 15:10:58 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CD370EFD; Mon, 10 Nov 2014 15:10:57 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2E52025D388C; Mon, 10 Nov 2014 15:10:46 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 539C2C77040; Mon, 10 Nov 2014 15:10:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Puo7unnbglcu; Mon, 10 Nov 2014 15:10:41 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C4CA2C76FCD; Mon, 10 Nov 2014 15:10:39 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde From: "Bjoern A. Zeeb" In-Reply-To: <201411100944.sAA9icnN061962@svn.freebsd.org> Date: Mon, 10 Nov 2014 15:10:36 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> References: <201411100944.sAA9icnN061962@svn.freebsd.org> To: =?windows-1252?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1878.6) 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 15:10:58 -0000 On 10 Nov 2014, at 09:44 , Dag-Erling Sm=F8rgrav = wrote: > Author: des > Date: Mon Nov 10 09:44:38 2014 > New Revision: 274340 > URL: https://svnweb.freebsd.org/changeset/base/274340 >=20 > Log: > Constify the AES code and propagate to consumers. This allows us to > update the Fortuna code to use SHAd-256 as defined in FS&K. >=20 > Approved by: so (self) This fails to compile on all gcc platforms. cc1: warnings being treated as errors = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c: In function 'rijndael_padEncrypt': = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:236: warning: cast discards qualifiers from pointer = target type = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:237: warning: cast discards qualifiers from pointer = target type = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:238: warning: cast discards qualifiers from pointer = target type = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:239: warning: cast discards qualifiers from pointer = target type --- rijndael-api-fst.o --- *** [rijndael-api-fst.o] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde cc1: warnings being treated as errors = /scratch/tmp/bz/head.svn/sys/modules/random/../../crypto/rijndael/rijndael= -api-fst.c: In function 'rijndael_padEncrypt': = /scratch/tmp/bz/head.svn/sys/modules/random/../../crypto/rijndael/rijndael= -api-fst.c:236: warning: cast discards qualifiers from pointer target = type = /scratch/tmp/bz/head.svn/sys/modules/random/../../crypto/rijndael/rijndael= -api-fst.c:237: warning: cast discards qualifiers from pointer target = type = /scratch/tmp/bz/head.svn/sys/modules/random/../../crypto/rijndael/rijndael= -api-fst.c:238: warning: cast discards qualifiers from pointer target = type = /scratch/tmp/bz/head.svn/sys/modules/random/../../crypto/rijndael/rijndael= -api-fst.c:239: warning: cast discards qualifiers from pointer target = type --- rijndael-api-fst.o --- *** [rijndael-api-fst.o] Error code 1 =85 >=20 > Modified: > head/sys/crypto/rijndael/rijndael-api-fst.c > head/sys/crypto/rijndael/rijndael-api-fst.h > head/sys/dev/random/fortuna.c > head/sys/dev/random/hash.c > head/sys/dev/random/hash.h > head/sys/geom/bde/g_bde.h >=20 > Modified: head/sys/crypto/rijndael/rijndael-api-fst.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/crypto/rijndael/rijndael-api-fst.c Mon Nov 10 = 09:11:23 2014 (r274339) > +++ head/sys/crypto/rijndael/rijndael-api-fst.c Mon Nov 10 = 09:44:38 2014 (r274340) > @@ -34,7 +34,8 @@ __FBSDID("$FreeBSD$"); >=20 > typedef u_int8_t BYTE; >=20 > -int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen, = char *keyMaterial) { > +int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen, > + const char *keyMaterial) { > u_int8_t cipherKey[RIJNDAEL_MAXKB]; >=20 > if (key =3D=3D NULL) { > @@ -83,7 +84,7 @@ int rijndael_cipherInit(cipherInstance * > } >=20 > int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key, > - BYTE *input, int inputLen, BYTE *outBuffer) { > + const BYTE *input, int inputLen, BYTE *outBuffer) { > int i, k, numBlocks; > u_int8_t block[16], iv[4][4]; >=20 > @@ -198,7 +199,7 @@ int rijndael_blockEncrypt(cipherInstance > * @return length in octets (not bits) of the encrypted output = buffer. > */ > int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key, > - BYTE *input, int inputOctets, BYTE *outBuffer) { > + const BYTE *input, int inputOctets, BYTE *outBuffer) { > int i, numBlocks, padLen; > u_int8_t block[16], *iv, *cp; >=20 > @@ -261,7 +262,7 @@ int rijndael_padEncrypt(cipherInstance * > } >=20 > int rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key, > - BYTE *input, int inputLen, BYTE *outBuffer) { > + const BYTE *input, int inputLen, BYTE *outBuffer) { > int i, k, numBlocks; > u_int8_t block[16], iv[4][4]; >=20 > @@ -360,7 +361,7 @@ int rijndael_blockDecrypt(cipherInstance > } >=20 > int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key, > - BYTE *input, int inputOctets, BYTE *outBuffer) { > + const BYTE *input, int inputOctets, BYTE *outBuffer) { > int i, numBlocks, padLen; > u_int8_t block[16]; > u_int32_t iv[4]; >=20 > Modified: head/sys/crypto/rijndael/rijndael-api-fst.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/sys/crypto/rijndael/rijndael-api-fst.h Mon Nov 10 = 09:11:23 2014 (r274339) > +++ head/sys/crypto/rijndael/rijndael-api-fst.h Mon Nov 10 = 09:44:38 2014 (r274340) > @@ -56,18 +56,18 @@ typedef struct { /* c >=20 > /* Function prototypes */ >=20 > -int rijndael_makeKey(keyInstance *, u_int8_t, int, char *); > +int rijndael_makeKey(keyInstance *, u_int8_t, int, const char *); >=20 > int rijndael_cipherInit(cipherInstance *, u_int8_t, char *); >=20 > -int rijndael_blockEncrypt(cipherInstance *, keyInstance *, u_int8_t = *, int, > - u_int8_t *); > -int rijndael_padEncrypt(cipherInstance *, keyInstance *, u_int8_t *, = int, > - u_int8_t *); > - > -int rijndael_blockDecrypt(cipherInstance *, keyInstance *, u_int8_t = *, int, > - u_int8_t *); > -int rijndael_padDecrypt(cipherInstance *, keyInstance *, u_int8_t *, = int, > - u_int8_t *); > +int rijndael_blockEncrypt(cipherInstance *, keyInstance *, const = u_int8_t *, > + int, u_int8_t *); > +int rijndael_padEncrypt(cipherInstance *, keyInstance *, const = u_int8_t *, > + int, u_int8_t *); > + > +int rijndael_blockDecrypt(cipherInstance *, keyInstance *, const = u_int8_t *, > + int, u_int8_t *); > +int rijndael_padDecrypt(cipherInstance *, keyInstance *, const = u_int8_t *, > + int, u_int8_t *); >=20 > #endif /* __RIJNDAEL_API_FST_H */ >=20 > Modified: head/sys/dev/random/fortuna.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/dev/random/fortuna.c Mon Nov 10 09:11:23 2014 = (r274339) > +++ head/sys/dev/random/fortuna.c Mon Nov 10 09:44:38 2014 = (r274340) > @@ -27,13 +27,11 @@ >=20 > /* This implementation of Fortuna is based on the descriptions found = in > * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and = Schneier > - * ("K&S"). > + * ("F&S"). > * > - * The above book is superceded by ISBN 978-0-470-47424-2 = "Cryptography > - * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). > - * > - * This code has not yet caught up with FS&K, but differences are not > - * expected to be complex. > + * The above book is superseded by ISBN 978-0-470-47424-2 = "Cryptography > + * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). The code = has > + * not yet fully caught up with FS&K. > */ >=20 > #include > @@ -252,12 +250,9 @@ reseed(uint8_t *junk, u_int length) > mtx_assert(&random_reseed_mtx, MA_OWNED); > #endif >=20 > - /* F&S - K =3D Hd(K|s) where Hd(m) is H(H(m)) */ > + /* FS&K - K =3D Hd(K|s) where Hd(m) is H(H(0^512|m)) */ > randomdev_hash_init(&context); > -#if 0 > - /* FS&K defines Hd(m) as H(H(0^512|m)) */ > - randomdev_hash_iterate(&context, zero_region, KEYSIZE); > -#endif > + randomdev_hash_iterate(&context, zero_region, 512/8); > randomdev_hash_iterate(&context, &fortuna_state.key, = sizeof(fortuna_state.key)); > randomdev_hash_iterate(&context, junk, length); > randomdev_hash_finish(&context, hash); > @@ -270,7 +265,7 @@ reseed(uint8_t *junk, u_int length) > /* Unblock the device if it was blocked due to being unseeded */ > if (uint128_is_zero(fortuna_state.counter.whole)) > random_adaptor_unblock(); > - /* F&S - C =3D C + 1 */ > + /* FS&K - C =3D C + 1 */ > uint128_increment(&fortuna_state.counter.whole); > } >=20 >=20 > Modified: head/sys/dev/random/hash.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/dev/random/hash.c Mon Nov 10 09:11:23 2014 = (r274339) > +++ head/sys/dev/random/hash.c Mon Nov 10 09:44:38 2014 = (r274340) > @@ -60,7 +60,7 @@ randomdev_hash_init(struct randomdev_has >=20 > /* Iterate the hash */ > void > -randomdev_hash_iterate(struct randomdev_hash *context, void *data, = size_t size) > +randomdev_hash_iterate(struct randomdev_hash *context, const void = *data, size_t size) > { >=20 > SHA256_Update(&context->sha, data, size); > @@ -81,7 +81,7 @@ randomdev_hash_finish(struct randomdev_h > * data. Use CBC mode for better avalanche. > */ > void > -randomdev_encrypt_init(struct randomdev_key *context, void *data) > +randomdev_encrypt_init(struct randomdev_key *context, const void = *data) > { >=20 > rijndael_cipherInit(&context->cipher, MODE_CBC, NULL); > @@ -93,7 +93,7 @@ randomdev_encrypt_init(struct randomdev_ > * a multiple of BLOCKSIZE. > */ > void > -randomdev_encrypt(struct randomdev_key *context, void *d_in, void = *d_out, u_int length) > +randomdev_encrypt(struct randomdev_key *context, const void *d_in, = void *d_out, u_int length) > { >=20 > rijndael_blockEncrypt(&context->cipher, &context->key, d_in, = length*8, d_out); >=20 > Modified: head/sys/dev/random/hash.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/sys/dev/random/hash.h Mon Nov 10 09:11:23 2014 = (r274339) > +++ head/sys/dev/random/hash.h Mon Nov 10 09:44:38 2014 = (r274340) > @@ -42,9 +42,9 @@ struct randomdev_key { /* Big! Make sta > }; >=20 > void randomdev_hash_init(struct randomdev_hash *); > -void randomdev_hash_iterate(struct randomdev_hash *, void *, size_t); > +void randomdev_hash_iterate(struct randomdev_hash *, const void *, = size_t); > void randomdev_hash_finish(struct randomdev_hash *, void *); > -void randomdev_encrypt_init(struct randomdev_key *, void *); > -void randomdev_encrypt(struct randomdev_key *context, void *, void *, = u_int); > +void randomdev_encrypt_init(struct randomdev_key *, const void *); > +void randomdev_encrypt(struct randomdev_key *context, const void *, = void *, u_int); >=20 > #endif >=20 > Modified: head/sys/geom/bde/g_bde.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/sys/geom/bde/g_bde.h Mon Nov 10 09:11:23 2014 = (r274339) > +++ head/sys/geom/bde/g_bde.h Mon Nov 10 09:44:38 2014 = (r274340) > @@ -182,7 +182,7 @@ AES_init(cipherInstance *ci) > } >=20 > static __inline void > -AES_makekey(keyInstance *ki, int dir, u_int len, void *key) > +AES_makekey(keyInstance *ki, int dir, u_int len, const void *key) > { > int error; >=20 > @@ -191,7 +191,7 @@ AES_makekey(keyInstance *ki, int dir, u_ > } >=20 > static __inline void > -AES_encrypt(cipherInstance *ci, keyInstance *ki, void *in, void *out, = u_int len) > +AES_encrypt(cipherInstance *ci, keyInstance *ki, const void *in, void = *out, u_int len) > { > int error; >=20 > @@ -200,7 +200,7 @@ AES_encrypt(cipherInstance *ci, keyInsta > } >=20 > static __inline void > -AES_decrypt(cipherInstance *ci, keyInstance *ki, void *in, void *out, = u_int len) > +AES_decrypt(cipherInstance *ci, keyInstance *ki, const void *in, void = *out, u_int len) > { > int error; >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 15:56:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06854C85; Mon, 10 Nov 2014 15:56:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB72A608; Mon, 10 Nov 2014 15:56:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAFuVCm035168; Mon, 10 Nov 2014 15:56:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAFuUNO035162; Mon, 10 Nov 2014 15:56:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411101556.sAAFuUNO035162@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 10 Nov 2014 15:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274345 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 15:56:32 -0000 Author: glebius Date: Mon Nov 10 15:56:30 2014 New Revision: 274345 URL: https://svnweb.freebsd.org/changeset/base/274345 Log: Consistently use if_link. Reviewed by: ae, melifaro Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/nd6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Mon Nov 10 14:26:56 2014 (r274344) +++ head/sys/netinet6/icmp6.c Mon Nov 10 15:56:30 2014 (r274345) @@ -1748,7 +1748,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, st } IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_list) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { addrsofif = 0; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -1835,7 +1835,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *n ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet); again: - for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) { + for (; ifp; ifp = TAILQ_NEXT(ifp, if_link)) { IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Nov 10 14:26:56 2014 (r274344) +++ head/sys/netinet6/in6.c Mon Nov 10 15:56:30 2014 (r274345) @@ -1973,7 +1973,7 @@ in6_setmaxmtu(void) struct ifnet *ifp; IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_list) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { /* this function can be called during ifnet initialization */ if (!ifp->if_afdata[AF_INET6]) continue; Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Mon Nov 10 14:26:56 2014 (r274344) +++ head/sys/netinet6/in6_ifattach.c Mon Nov 10 15:56:30 2014 (r274345) @@ -407,7 +407,7 @@ get_ifid(struct ifnet *ifp0, struct ifne /* next, try to get it from some other hardware interface */ IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_list) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp == ifp0) continue; if (in6_get_hw_ifid(ifp, in6) != 0) @@ -847,7 +847,7 @@ in6_tmpaddrtimer(void *arg) V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, curvnet); bzero(nullbuf, sizeof(nullbuf)); - TAILQ_FOREACH(ifp, &V_ifnet, if_list) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_afdata[AF_INET6] == NULL) continue; ndi = ND_IFINFO(ifp); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Nov 10 14:26:56 2014 (r274344) +++ head/sys/netinet6/nd6.c Mon Nov 10 15:56:30 2014 (r274345) @@ -1811,7 +1811,7 @@ nd6_slowtimo(void *arg) callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_list) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_afdata[AF_INET6] == NULL) continue; nd6if = ND_IFINFO(ifp); From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 16:01:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F277E41; Mon, 10 Nov 2014 16:01:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 017E6656; Mon, 10 Nov 2014 16:01:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAG1V2C038743; Mon, 10 Nov 2014 16:01:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAG1VW8038741; Mon, 10 Nov 2014 16:01:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411101601.sAAG1VW8038741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 10 Nov 2014 16:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274346 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 16:01:32 -0000 Author: ae Date: Mon Nov 10 16:01:31 2014 New Revision: 274346 URL: https://svnweb.freebsd.org/changeset/base/274346 Log: Remove link-local multicast routes remnants from in6_purgeaddr. Also merge in6_purgeaddr_mc with in6_purgeaddr. Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Nov 10 15:56:30 2014 (r274345) +++ head/sys/netinet6/in6.c Mon Nov 10 16:01:31 2014 (r274346) @@ -1283,51 +1283,18 @@ in6_broadcast_ifa(struct ifnet *ifp, str return (error); } -/* - * Leave from multicast groups we have joined for the interface. - */ -static int -in6_purgeaddr_mc(struct ifnet *ifp, struct in6_ifaddr *ia, struct ifaddr *ifa0) -{ - struct in6_multi_mship *imm; - - while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { - LIST_REMOVE(imm, i6mm_chain); - in6_leavegroup(imm); - } - return (0); -} - void in6_purgeaddr(struct ifaddr *ifa) { struct ifnet *ifp = ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa; + struct in6_multi_mship *imm; int plen, error; - struct ifaddr *ifa0; if (ifa->ifa_carp) (*carp_detach_p)(ifa); /* - * find another IPv6 address as the gateway for the - * link-local and node-local all-nodes multicast - * address routes - */ - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa0, &ifp->if_addrhead, ifa_link) { - if ((ifa0->ifa_addr->sa_family != AF_INET6) || - memcmp(&satosin6(ifa0->ifa_addr)->sin6_addr, - &ia->ia_addr.sin6_addr, sizeof(struct in6_addr)) == 0) - continue; - else - break; - } - if (ifa0 != NULL) - ifa_ref(ifa0); - IF_ADDR_RUNLOCK(ifp); - - /* * Remove the loopback route to the interface address. * The check for the current setting of "nd6_useloopback" * is not needed. @@ -1346,11 +1313,10 @@ in6_purgeaddr(struct ifaddr *ifa) nd6_rem_ifa_lle(ia); /* Leave multicast groups. */ - error = in6_purgeaddr_mc(ifp, ia, ifa0); - - if (ifa0 != NULL) - ifa_free(ifa0); - + while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { + LIST_REMOVE(imm, i6mm_chain); + in6_leavegroup(imm); + } plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { error = rtinit(&(ia->ia_ifa), RTM_DELETE, ia->ia_flags | From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 16:01:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C44DF7B; Mon, 10 Nov 2014 16:01:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D72865C; Mon, 10 Nov 2014 16:01:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAG1enr038796; Mon, 10 Nov 2014 16:01:40 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAG1dlF038794; Mon, 10 Nov 2014 16:01:39 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411101601.sAAG1dlF038794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 10 Nov 2014 16:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274347 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 16:01:40 -0000 Author: melifaro Date: Mon Nov 10 16:01:39 2014 New Revision: 274347 URL: https://svnweb.freebsd.org/changeset/base/274347 Log: * Make nd6_dad_duplicated() constant. * Simplify refcounting by using nd6_dad_add() / nd6_dad_del(). Reviewed by: ae MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Mon Nov 10 16:01:31 2014 (r274346) +++ head/sys/netinet6/nd6.h Mon Nov 10 16:01:39 2014 (r274347) @@ -430,7 +430,6 @@ void nd6_ns_output(struct ifnet *, const caddr_t nd6_ifptomac(struct ifnet *); void nd6_dad_start(struct ifaddr *, int); void nd6_dad_stop(struct ifaddr *); -void nd6_dad_duplicated(struct ifaddr *); /* nd6_rtr.c */ void nd6_rs_input(struct mbuf *, int, int); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Nov 10 16:01:31 2014 (r274346) +++ head/sys/netinet6/nd6_nbr.c Mon Nov 10 16:01:39 2014 (r274347) @@ -79,9 +79,12 @@ __FBSDID("$FreeBSD$"); struct dadq; static struct dadq *nd6_dad_find(struct ifaddr *); +static void nd6_dad_add(struct dadq *dp); +static void nd6_dad_del(struct dadq *dp); static void nd6_dad_starttimer(struct dadq *, int); static void nd6_dad_stoptimer(struct dadq *); static void nd6_dad_timer(struct dadq *); +static void nd6_dad_duplicated(struct ifaddr *, struct dadq *); static void nd6_dad_ns_output(struct dadq *, struct ifaddr *); static void nd6_dad_ns_input(struct ifaddr *); static void nd6_dad_na_input(struct ifaddr *); @@ -1179,6 +1182,26 @@ static VNET_DEFINE(struct rwlock, dad_rw #define DADQ_WLOCK() rw_wlock(&V_dad_rwlock) #define DADQ_WUNLOCK() rw_wunlock(&V_dad_rwlock) +static void +nd6_dad_add(struct dadq *dp) +{ + + ifa_ref(dp->dad_ifa); /* just for safety */ + DADQ_WLOCK(); + TAILQ_INSERT_TAIL(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); +} + +static void +nd6_dad_del(struct dadq *dp) +{ + + ifa_free(dp->dad_ifa); + DADQ_WLOCK(); + TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); +} + static struct dadq * nd6_dad_find(struct ifaddr *ifa) { @@ -1270,10 +1293,6 @@ nd6_dad_start(struct ifaddr *ifa, int de #ifdef VIMAGE dp->dad_vnet = curvnet; #endif - DADQ_WLOCK(); - TAILQ_INSERT_TAIL(&V_dadq, (struct dadq *)dp, dad_list); - DADQ_WUNLOCK(); - nd6log((LOG_DEBUG, "%s: starting DAD for %s\n", if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); @@ -1284,10 +1303,10 @@ nd6_dad_start(struct ifaddr *ifa, int de * (re)initialization. */ dp->dad_ifa = ifa; - ifa_ref(ifa); /* just for safety */ dp->dad_count = V_ip6_dad_count; dp->dad_ns_icount = dp->dad_na_icount = 0; dp->dad_ns_ocount = dp->dad_ns_tcount = 0; + nd6_dad_add(dp); if (delay == 0) { nd6_dad_ns_output(dp, ifa); nd6_dad_starttimer(dp, @@ -1315,12 +1334,8 @@ nd6_dad_stop(struct ifaddr *ifa) nd6_dad_stoptimer(dp); - DADQ_WLOCK(); - TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); - DADQ_WUNLOCK(); + nd6_dad_del(dp); free(dp, M_IP6NDP); - dp = NULL; - ifa_free(ifa); } static void @@ -1367,12 +1382,9 @@ nd6_dad_timer(struct dadq *dp) nd6log((LOG_INFO, "%s: could not run DAD, driver problem?\n", if_name(ifa->ifa_ifp))); - DADQ_WLOCK(); - TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); - DADQ_WUNLOCK(); + nd6_dad_del(dp); free(dp, M_IP6NDP); dp = NULL; - ifa_free(ifa); goto done; } @@ -1408,8 +1420,8 @@ nd6_dad_timer(struct dadq *dp) if (duplicate) { /* (*dp) will be freed in nd6_dad_duplicated() */ + nd6_dad_duplicated(ifa, dp); dp = NULL; - nd6_dad_duplicated(ifa); } else { /* * We are done with DAD. No NA came, no NS came. @@ -1425,12 +1437,9 @@ nd6_dad_timer(struct dadq *dp) if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); - DADQ_WLOCK(); - TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); - DADQ_WUNLOCK(); + nd6_dad_del(dp); free(dp, M_IP6NDP); dp = NULL; - ifa_free(ifa); } } @@ -1439,19 +1448,12 @@ done: } void -nd6_dad_duplicated(struct ifaddr *ifa) +nd6_dad_duplicated(struct ifaddr *ifa, struct dadq *dp) { struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct ifnet *ifp; - struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; - dp = nd6_dad_find(ifa); - if (dp == NULL) { - log(LOG_ERR, "nd6_dad_duplicated: DAD structure not found\n"); - return; - } - log(LOG_ERR, "%s: DAD detected duplicate IPv6 address %s: " "NS in/out=%d/%d, NA in=%d\n", if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), @@ -1504,12 +1506,8 @@ nd6_dad_duplicated(struct ifaddr *ifa) } } - DADQ_WLOCK(); - TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); - DADQ_WUNLOCK(); + nd6_dad_del(dp); free(dp, M_IP6NDP); - dp = NULL; - ifa_free(ifa); } static void @@ -1568,8 +1566,8 @@ nd6_dad_ns_input(struct ifaddr *ifa) /* XXX more checks for loopback situation - see nd6_dad_timer too */ if (duplicate) { + nd6_dad_duplicated(ifa, dp); dp = NULL; /* will be freed in nd6_dad_duplicated() */ - nd6_dad_duplicated(ifa); } else { /* * not sure if I got a duplicate. @@ -1593,5 +1591,5 @@ nd6_dad_na_input(struct ifaddr *ifa) dp->dad_na_icount++; /* remove the address. */ - nd6_dad_duplicated(ifa); + nd6_dad_duplicated(ifa, dp); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 16:12:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF78A2FA; Mon, 10 Nov 2014 16:12:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91E2687F; Mon, 10 Nov 2014 16:12:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAGCqh5044287; Mon, 10 Nov 2014 16:12:52 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAGCqds044284; Mon, 10 Nov 2014 16:12:52 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411101612.sAAGCqds044284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 10 Nov 2014 16:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274348 - head/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 16:12:52 -0000 Author: ae Date: Mon Nov 10 16:12:51 2014 New Revision: 274348 URL: https://svnweb.freebsd.org/changeset/base/274348 Log: Add sa6_checkzone_ifp() function. It checks correctness of struct sockaddr_in6, usually obtained from the user level through ioctl. It initializes sin6_scope_id using given interface. Sponsored by: Yandex LLC Modified: head/sys/netinet6/scope6.c head/sys/netinet6/scope6_var.h Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Mon Nov 10 16:01:39 2014 (r274347) +++ head/sys/netinet6/scope6.c Mon Nov 10 16:12:51 2014 (r274348) @@ -532,4 +532,25 @@ sa6_checkzone(struct sockaddr_in6 *sa6) return (sa6->sin6_scope_id ? 0: EADDRNOTAVAIL); } +/* + * This function is similar to sa6_checkzone, but it uses given ifp + * to initialize sin6_scope_id. + */ +int +sa6_checkzone_ifp(struct ifnet *ifp, struct sockaddr_in6 *sa6) +{ + int scope; + + scope = in6_addrscope(&sa6->sin6_addr); + if (scope == IPV6_ADDR_SCOPE_LINKLOCAL || + scope == IPV6_ADDR_SCOPE_INTFACELOCAL) { + if (sa6->sin6_scope_id == 0) { + sa6->sin6_scope_id = in6_getscopezone(ifp, scope); + return (0); + } else if (sa6->sin6_scope_id != in6_getscopezone(ifp, scope)) + return (EADDRNOTAVAIL); + } + return (sa6_checkzone(sa6)); +} + Modified: head/sys/netinet6/scope6_var.h ============================================================================== --- head/sys/netinet6/scope6_var.h Mon Nov 10 16:01:39 2014 (r274347) +++ head/sys/netinet6/scope6_var.h Mon Nov 10 16:12:51 2014 (r274348) @@ -58,6 +58,7 @@ u_int32_t scope6_addr2default(struct in6 int sa6_embedscope(struct sockaddr_in6 *, int); int sa6_recoverscope(struct sockaddr_in6 *); int sa6_checkzone(struct sockaddr_in6 *); +int sa6_checkzone_ifp(struct ifnet *, struct sockaddr_in6 *); int in6_setscope(struct in6_addr *, struct ifnet *, u_int32_t *); int in6_clearscope(struct in6_addr *); uint16_t in6_getscope(struct in6_addr *); From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 18:20:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F250130; Mon, 10 Nov 2014 18:20:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1CC8B5; Mon, 10 Nov 2014 18:20:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAIKlTG004579; Mon, 10 Nov 2014 18:20:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAIKl1h004578; Mon, 10 Nov 2014 18:20:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411101820.sAAIKl1h004578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Nov 2014 18:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274349 - head/share/man/man7 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 18:20:47 -0000 Author: emaste Date: Mon Nov 10 18:20:46 2014 New Revision: 274349 URL: https://svnweb.freebsd.org/changeset/base/274349 Log: Add /usr/lib/debug directory to hier(7) The canonical standalone debug directory established by the GNU toolchain is /usr/lib/debug, and we use it when WITH_DEBUG_FILES is set. Mention it in the file system hierarchy page. Reviewed by: bcr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1134 Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Nov 10 16:12:51 2014 (r274348) +++ head/share/man/man7/hier.7 Mon Nov 10 18:20:46 2014 (r274349) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd July 25, 2014 +.Dd November 10, 2014 .Dt HIER 7 .Os .Sh NAME @@ -380,6 +380,8 @@ shared libraries for compatibility .It Pa aout/ a.out backward compatibility libraries .El +.It Pa debug/ +standalone debug data for the base system libraries and binaries .It Pa dtrace/ DTrace library scripts .It Pa engines/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 19:12:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D05F0B5D; Mon, 10 Nov 2014 19:12:34 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D217D99; Mon, 10 Nov 2014 19:12:34 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::96f:bc74:b3c9:9d0e] (unknown [IPv6:2001:7b8:3a7:0:96f:bc74:b3c9:9d0e]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 93D78B80A; Mon, 10 Nov 2014 20:12:30 +0100 (CET) Subject: Re: svn commit: r274250 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b1 From: Dimitry Andric In-Reply-To: <201411072010.sA7KAAkp026433@svn.freebsd.org> Date: Mon, 10 Nov 2014 20:12:24 +0100 Message-Id: <2BDD3161-15BE-43FF-95CB-7DC6D01DAA58@FreeBSD.org> References: <201411072010.sA7KAAkp026433@svn.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1990.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 19:12:34 -0000 --Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 07 Nov 2014, at 21:10, Konstantin Belousov wrote: >=20 > Author: kib > Date: Fri Nov 7 20:10:09 2014 > New Revision: 274250 > URL: https://svnweb.freebsd.org/changeset/base/274250 >=20 > Log: > Simplify assembler in ivy.c. Move the copying of the random bits = into > buffer from asm to C, which reduces amount of arguments for inline = asm > and simplifies constraints. Use unsigned types consistently. >=20 > Submitted by: bde > Approved by: secteam (delphij) > Reviewed by: markm > MFC after: 1 week >=20 > Modified: > head/sys/dev/random/ivy.c >=20 > Modified: head/sys/dev/random/ivy.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/dev/random/ivy.c Fri Nov 7 19:34:10 2014 = (r274249) > +++ head/sys/dev/random/ivy.c Fri Nov 7 20:10:09 2014 = (r274250) > @@ -61,42 +61,41 @@ static struct live_entropy_source random > }; >=20 > static inline int > -ivy_rng_store(long *buf) > +ivy_rng_store(u_long *buf) > { > #ifdef __GNUCLIKE_ASM > - long tmp; > + u_long rndval; > int retry; >=20 > retry =3D RETRY_COUNT; > __asm __volatile( > "1:\n\t" > - "rdrand %2\n\t" /* read randomness into tmp */ > - "jb 2f\n\t" /* CF is set on success, exit retry loop = */ > + "rdrand %1\n\t" /* read randomness into tmp */ > + "jc 2f\n\t" /* CF is set on success, exit retry loop = */ You might want to update the first comment to "read randomness into rndval", for consistency. -Dimitry --Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlRhDh0ACgkQsF6jCi4glqMzoACfX+b7r5HXj+5MV6XQIV5zG2E/ TbcAni1wvBIUgO3ptDNDliKhE1sc4NC8 =OgKx -----END PGP SIGNATURE----- --Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 19:45:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36C9B4EE; Mon, 10 Nov 2014 19:45:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E37109; Mon, 10 Nov 2014 19:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAJjUQU044037; Mon, 10 Nov 2014 19:45:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAJjSN4044029; Mon, 10 Nov 2014 19:45:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201411101945.sAAJjSN4044029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 10 Nov 2014 19:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274351 - head/sys/dev/cxgbe/firmware 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 19:45:30 -0000 Author: np Date: Mon Nov 10 19:45:28 2014 New Revision: 274351 URL: https://svnweb.freebsd.org/changeset/base/274351 Log: cxgbe(4): adjust PMRX and PMTX parameters. MFC after: 1 week Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt head/sys/dev/cxgbe/firmware/t5fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Mon Nov 10 18:47:59 2014 (r274350) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Mon Nov 10 19:45:28 2014 (r274351) @@ -28,8 +28,8 @@ tp_ntxch = 0 # TP rx and tx payload memory (% of the total EDRAM + DDR3). - tp_pmrx = 38 - tp_pmtx = 60 + tp_pmrx = 38, 512 + tp_pmtx = 60, 512 tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K @@ -160,7 +160,7 @@ [fini] version = 0x1 - checksum = 0x6a1f8858 + checksum = 0xb4168add # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt Mon Nov 10 18:47:59 2014 (r274350) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt Mon Nov 10 19:45:28 2014 (r274351) @@ -125,7 +125,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP RX payload - tp_pmrx = 34 + tp_pmrx = 34, 512 # TP RX payload page size tp_pmrx_pagesize = 64K @@ -135,7 +135,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP TX payload - tp_pmtx = 32 + tp_pmtx = 32, 512 # TP TX payload page size tp_pmtx_pagesize = 64K @@ -544,7 +544,7 @@ [fini] version = 0x14250012 - checksum = 0xd9ae0325 + checksum = 0x22f592a9 # Total resources used by above allocations: # Virtual Interfaces: 104 Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Nov 10 18:47:59 2014 (r274350) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Nov 10 19:45:28 2014 (r274351) @@ -37,8 +37,8 @@ tp_ntxch = 0 # TP rx and tx payload memory (% of the total EDRAM + DDR3). - tp_pmrx = 38 - tp_pmtx = 60 + tp_pmrx = 38, 512 + tp_pmtx = 60, 512 tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K @@ -173,7 +173,7 @@ [fini] version = 0x1 - checksum = 0xa0ee1715 + checksum = 0x4f45e608 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt Mon Nov 10 18:47:59 2014 (r274350) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt Mon Nov 10 19:45:28 2014 (r274351) @@ -149,7 +149,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP RX payload - tp_pmrx = 30 + tp_pmrx = 30, 512 # TP RX payload page size tp_pmrx_pagesize = 64K @@ -159,7 +159,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP TX payload - tp_pmtx = 50 + tp_pmtx = 50, 512 # TP TX payload page size tp_pmtx_pagesize = 64K @@ -463,7 +463,7 @@ [fini] version = 0x1425000d - checksum = 0xe56cb999 + checksum = 0x22f1530b # Total resources used by above allocations: # Virtual Interfaces: 104 Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Mon Nov 10 18:47:59 2014 (r274350) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Mon Nov 10 19:45:28 2014 (r274351) @@ -153,7 +153,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP RX payload - tp_pmrx = 30 + tp_pmrx = 30, 512 # TP RX payload page size tp_pmrx_pagesize = 64K @@ -163,7 +163,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP TX payload - tp_pmtx = 50 + tp_pmtx = 50, 512 # TP TX payload page size tp_pmtx_pagesize = 64K @@ -587,7 +587,7 @@ [fini] version = 0x14250016 - checksum = 0x5d740273 + checksum = 0xafaf8723 # Total resources used by above allocations: # Virtual Interfaces: 104 From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 19:53:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 145647DA; Mon, 10 Nov 2014 19:53:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA80A1F7; Mon, 10 Nov 2014 19:53:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAJrdJB048472; Mon, 10 Nov 2014 19:53:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAJrddT048471; Mon, 10 Nov 2014 19:53:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411101953.sAAJrddT048471@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 10 Nov 2014 19:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274352 - releng/10.1/usr.sbin/etcupdate 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 19:53:40 -0000 Author: jhb Date: Mon Nov 10 19:53:39 2014 New Revision: 274352 URL: https://svnweb.freebsd.org/changeset/base/274352 Log: MFstable10 273998: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Approved by: re (delphij) Modified: releng/10.1/usr.sbin/etcupdate/etcupdate.8 Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- releng/10.1/usr.sbin/etcupdate/etcupdate.8 Mon Nov 10 19:45:28 2014 (r274351) +++ releng/10.1/usr.sbin/etcupdate/etcupdate.8 Mon Nov 10 19:53:39 2014 (r274352) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 19:56:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D07E993A; Mon, 10 Nov 2014 19:56:12 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C2921F; Mon, 10 Nov 2014 19:56:12 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::96f:bc74:b3c9:9d0e] (unknown [IPv6:2001:7b8:3a7:0:96f:bc74:b3c9:9d0e]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 52654B80A; Mon, 10 Nov 2014 20:56:01 +0100 (CET) Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: multipart/signed; boundary="Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b1 From: Dimitry Andric In-Reply-To: <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> Date: Mon, 10 Nov 2014 20:55:46 +0100 Message-Id: References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1990.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 19:56:13 -0000 --Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 10 Nov 2014, at 16:10, Bjoern A. Zeeb wrote: >=20 > On 10 Nov 2014, at 09:44 , Dag-Erling Sm=F8rgrav = wrote: >=20 >> Author: des >> Date: Mon Nov 10 09:44:38 2014 >> New Revision: 274340 >> URL: https://svnweb.freebsd.org/changeset/base/274340 >>=20 >> Log: >> Constify the AES code and propagate to consumers. This allows us to >> update the Fortuna code to use SHAd-256 as defined in FS&K. >>=20 >> Approved by: so (self) >=20 > This fails to compile on all gcc platforms. >=20 > cc1: warnings being treated as errors > = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c: In function 'rijndael_padEncrypt': > = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:236: warning: cast discards qualifiers from pointer = target type > = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:237: warning: cast discards qualifiers from pointer = target type > = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:238: warning: cast discards qualifiers from pointer = target type > = /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae= l/rijndael-api-fst.c:239: warning: cast discards qualifiers from pointer = target type > --- rijndael-api-fst.o --- > *** [rijndael-api-fst.o] Error code 1 Proposed fix (the lines were too long anyway, so I didn't see reason to = change that): Index: sys/crypto/rijndael/rijndael-api-fst.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 --- sys/crypto/rijndael/rijndael-api-fst.c (revision 274350) +++ sys/crypto/rijndael/rijndael-api-fst.c (working copy) @@ -233,10 +233,10 @@ case MODE_CBC: iv =3D cipher->IV; for (i =3D numBlocks; i > 0; i--) { - ((u_int32_t*)block)[0] =3D = ((u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0]; - ((u_int32_t*)block)[1] =3D = ((u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1]; - ((u_int32_t*)block)[2] =3D = ((u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2]; - ((u_int32_t*)block)[3] =3D = ((u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3]; + ((u_int32_t*)block)[0] =3D ((const = u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0]; + ((u_int32_t*)block)[1] =3D ((const = u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1]; + ((u_int32_t*)block)[2] =3D ((const = u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2]; + ((u_int32_t*)block)[3] =3D ((const = u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3]; rijndaelEncrypt(key->rk, key->Nr, block, = outBuffer); iv =3D outBuffer; input +=3D 16; -Dimitry --Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlRhGFAACgkQsF6jCi4glqOidACgmCde+diAOGfa+D3zLdIbSusP UBAAn2++W5nL4Qg988Dnhz17VB2LV7om =MUKa -----END PGP SIGNATURE----- --Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 20:13:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FB9DCF1; Mon, 10 Nov 2014 20:13:22 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A9E060E; Mon, 10 Nov 2014 20:13:21 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::96f:bc74:b3c9:9d0e] (unknown [IPv6:2001:7b8:3a7:0:96f:bc74:b3c9:9d0e]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C605CB80A; Mon, 10 Nov 2014 21:13:15 +0100 (CET) Subject: Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: multipart/signed; boundary="Apple-Mail=_60FEF507-7367-4F03-AE0B-9B5C57F9F9BD"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b1 From: Dimitry Andric In-Reply-To: Date: Mon, 10 Nov 2014 21:13:08 +0100 Message-Id: References: <201410181936.s9IJaCwu018930@svn.freebsd.org> <20141019032038.GA41067@onelab2.iet.unipi.it> To: Adrian Chadd X-Mailer: Apple Mail (2.1990.1) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Luigi Rizzo , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 20:13:22 -0000 --Apple-Mail=_60FEF507-7367-4F03-AE0B-9B5C57F9F9BD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I noted something similar for kgdb, when compiled with gcc: cc1: warnings being treated as errors /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c: In function = 'kgdb_trgt_fetch_tss': /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c:142: warning: comparison is = always false due to limited range of data type In gnu/usr.bin/gdb/kgdb/kgdb.h, there is: struct kthr { struct kthr *next; uintptr_t paddr; uintptr_t kaddr; uintptr_t kstack; uintptr_t pcb; int tid; int pid; u_char cpu; }; The cpu field is assigned from td.td_oncpu (which is an int) in kgdb_thr_add_procs(), so I think it should be safe to change it to an int too: Index: gnu/usr.bin/gdb/kgdb/kgdb.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 --- gnu/usr.bin/gdb/kgdb/kgdb.h (revision 274350) +++ gnu/usr.bin/gdb/kgdb/kgdb.h (working copy) @@ -41,7 +41,7 @@ uintptr_t pcb; int tid; int pid; - u_char cpu; + int cpu; }; extern struct kthr *curkthr; -Dimitry > On 19 Oct 2014, at 06:38, Adrian Chadd wrote: >=20 > Rebuilt, tested, committed to -HEAD. >=20 > Thanks! >=20 > -a >=20 >=20 > On 18 October 2014 20:51, Adrian Chadd wrote: >> .. actually, try this: >>=20 >> adrian@testbox1:~/work/freebsd/head/src % svn diff sys/kern/ >> Index: sys/kern/kern_intr.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 >> --- sys/kern/kern_intr.c (revision 272839) >> +++ sys/kern/kern_intr.c (working copy) >> @@ -362,8 +362,7 @@ >> { >> struct intr_event *ie; >> cpuset_t *mask; >> - u_char cpu; >> - int n; >> + int cpu, n; >>=20 >> mask =3D m; >> cpu =3D NOCPU; >> @@ -377,7 +376,7 @@ >> continue; >> if (cpu !=3D NOCPU) >> return (EINVAL); >> - cpu =3D (u_char)n; >> + cpu =3D n; >> } >> } >> ie =3D intr_lookup(irq); >>=20 >>=20 >>=20 >>=20 >> -a >=20 --Apple-Mail=_60FEF507-7367-4F03-AE0B-9B5C57F9F9BD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlRhHFoACgkQsF6jCi4glqPehgCgm902ras5wndbFy/8cQvKpkeq ZbEAoO1cWl7EuyvQt+pEJHQUk3rAxlFi =TYaL -----END PGP SIGNATURE----- --Apple-Mail=_60FEF507-7367-4F03-AE0B-9B5C57F9F9BD-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 20:18:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49B2CF0; Mon, 10 Nov 2014 20:18:25 +0000 (UTC) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FC76643; Mon, 10 Nov 2014 20:18:25 +0000 (UTC) Received: by mail-ig0-f176.google.com with SMTP id l13so18719537iga.9 for ; Mon, 10 Nov 2014 12:18:24 -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:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=joDqa7h/c/S6lqfeSYeaMZfLXcihPt4+PFcXPKKU35U=; b=GMOvGv6cMxcIpw2q/LZqXSnuRX4JYiqJT2u1ECXv4Rphigg03xEFUv02/JtCrmqsTH oIOJiLl5ZdayTdLSli7ppbGoPlp8c2vY5Vu3P/K0yDUlWUnjCLT/utB7tR+ZbslA2brV n8OUjMSwnfuMAcqN7jwT1LgGx9M/UVsNz1wV/wzY+QveiGfzWEjHmBX2ZrXwTCJhfNuZ qrMo1qZhbCWr7+F+wV/gvxoqUvHXlbStKXNzgAadx4U42uMq+IbPjb3O2hnCrWisgrmL jZOlC2JSS9R0ZCtLNOY6dRWnmU2lqkCuQhCLCpi/v3GKnSX4N7YzjokzOyn/GYsoqlgA SQXw== X-Received: by 10.107.40.141 with SMTP id o135mr21029952ioo.26.1415650704396; Mon, 10 Nov 2014 12:18:24 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.29.207 with HTTP; Mon, 10 Nov 2014 12:18:04 -0800 (PST) In-Reply-To: <201410240948.s9O9mxNP019487@svn.freebsd.org> References: <201410240948.s9O9mxNP019487@svn.freebsd.org> From: Ed Maste Date: Mon, 10 Nov 2014 15:18:04 -0500 X-Google-Sender-Auth: ndbsls0d0p9yurK8Gm49YwPosaQ Message-ID: Subject: Re: svn commit: r273582 - in head/sys/amd64: amd64 include To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 20:18:25 -0000 On 24 October 2014 05:48, Roger Pau Monn=C3=A9 wrote: > Author: royger > Date: Fri Oct 24 09:48:58 2014 > New Revision: 273582 > URL: https://svnweb.freebsd.org/changeset/base/273582 > > Log: > amd64: make uiomove_fromphys functional for pages not mapped by the DMA= P UEFI boot fails after this commit. I haven't yet investigated in depth, but it appears to hang after the loader transfers execution to the kernel. It's likely a panic before the vt console is ready, I think. From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 20:19:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45862279; Mon, 10 Nov 2014 20:19:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32C29655; Mon, 10 Nov 2014 20:19:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAKJxhP059532; Mon, 10 Nov 2014 20:19:59 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAKJxaa059531; Mon, 10 Nov 2014 20:19:59 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411102019.sAAKJxaa059531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Mon, 10 Nov 2014 20:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274353 - head/sys/dev/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 20:19:59 -0000 Author: luigi Date: Mon Nov 10 20:19:58 2014 New Revision: 274353 URL: https://svnweb.freebsd.org/changeset/base/274353 Log: sync a comment with our internal repo Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Mon Nov 10 19:53:39 2014 (r274352) +++ head/sys/dev/netmap/netmap_generic.c Mon Nov 10 20:19:58 2014 (r274353) @@ -821,7 +821,7 @@ generic_netmap_attach(struct ifnet *ifp) num_tx_desc = num_rx_desc = netmap_generic_ringsize; /* starting point */ - generic_find_num_desc(ifp, &num_tx_desc, &num_rx_desc); + generic_find_num_desc(ifp, &num_tx_desc, &num_rx_desc); /* ignore errors */ ND("Netmap ring size: TX = %d, RX = %d", num_tx_desc, num_rx_desc); if (num_tx_desc == 0 || num_rx_desc == 0) { D("Device has no hw slots (tx %u, rx %u)", num_tx_desc, num_rx_desc); From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 20:25:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AF6C61F; Mon, 10 Nov 2014 20:25:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78743783; Mon, 10 Nov 2014 20:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAKPYaO063939; Mon, 10 Nov 2014 20:25:34 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAKPYtA063938; Mon, 10 Nov 2014 20:25:34 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411102025.sAAKPYtA063938@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Mon, 10 Nov 2014 20:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274354 - head/sys/dev/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 20:25:34 -0000 Author: luigi Date: Mon Nov 10 20:25:33 2014 New Revision: 274354 URL: https://svnweb.freebsd.org/changeset/base/274354 Log: initialize *color if passed as an argument Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Nov 10 20:19:58 2014 (r274353) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Nov 10 20:25:33 2014 (r274354) @@ -466,6 +466,8 @@ netmap_dev_pager_ctor(void *handle, vm_o if (netmap_verbose) D("handle %p size %jd prot %d foff %jd", handle, (intmax_t)size, prot, (intmax_t)foff); + if (color) + *color = 0; dev_ref(vmh->dev); return 0; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 20:41:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B98C2B3F; Mon, 10 Nov 2014 20:41:15 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9A2954; Mon, 10 Nov 2014 20:41:15 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 645ABB923; Mon, 10 Nov 2014 15:41:14 -0500 (EST) From: John Baldwin To: Dimitry Andric Subject: Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys Date: Mon, 10 Nov 2014 15:35:23 -0500 Message-ID: <3279406.bOBVrcribU@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: References: <201410181936.s9IJaCwu018930@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 10 Nov 2014 15:41:14 -0500 (EST) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Luigi Rizzo , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 20:41:15 -0000 On Monday, November 10, 2014 09:13:08 PM Dimitry Andric wrote: > I noted something similar for kgdb, when compiled with gcc: > > cc1: warnings being treated as errors > /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c: In function > 'kgdb_trgt_fetch_tss': /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c:142: > warning: comparison is always false due to limited range of data type > > In gnu/usr.bin/gdb/kgdb/kgdb.h, there is: > > struct kthr { > struct kthr *next; > uintptr_t paddr; > uintptr_t kaddr; > uintptr_t kstack; > uintptr_t pcb; > int tid; > int pid; > u_char cpu; > }; > > The cpu field is assigned from td.td_oncpu (which is an int) in > kgdb_thr_add_procs(), so I think it should be safe to change it to an > int too: > > Index: gnu/usr.bin/gdb/kgdb/kgdb.h > =================================================================== > --- gnu/usr.bin/gdb/kgdb/kgdb.h (revision 274350) > +++ gnu/usr.bin/gdb/kgdb/kgdb.h (working copy) > @@ -41,7 +41,7 @@ > uintptr_t pcb; > int tid; > int pid; > - u_char cpu; > + int cpu; > }; > > extern struct kthr *curkthr; Yes, please commit. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 21:00:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7C59371; Mon, 10 Nov 2014 21:00:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5C04B08; Mon, 10 Nov 2014 21:00:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAAL0N4C079188; Mon, 10 Nov 2014 21:00:23 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAAL0Nvh079187; Mon, 10 Nov 2014 21:00:23 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411102100.sAAL0Nvh079187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Mon, 10 Nov 2014 21:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274355 - head/sys/dev/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 21:00:24 -0000 Author: luigi Date: Mon Nov 10 21:00:23 2014 New Revision: 274355 URL: https://svnweb.freebsd.org/changeset/base/274355 Log: fix a typo Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Nov 10 20:25:33 2014 (r274354) +++ head/sys/dev/netmap/netmap_kern.h Mon Nov 10 21:00:23 2014 (r274355) @@ -266,7 +266,7 @@ struct netmap_kring { struct netmap_adapter *na; - /* The folloiwing fields are for VALE switch support */ + /* The following fields are for VALE switch support */ struct nm_bdg_fwd *nkr_ft; uint32_t *nkr_leases; #define NR_NOSLOT ((uint32_t)~0) /* used in nkr_*lease* */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 21:30:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AA65C18; Mon, 10 Nov 2014 21:30:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 038F2E07; Mon, 10 Nov 2014 21:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAALU8pp093511; Mon, 10 Nov 2014 21:30:08 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAALU4Sv093478; Mon, 10 Nov 2014 21:30:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201411102130.sAALU4Sv093478@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 10 Nov 2014 21:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274357 - in vendor-sys/acpica/dist: . generate/unix/acpiexec generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/component... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 21:30:09 -0000 Author: jkim Date: Mon Nov 10 21:30:04 2014 New Revision: 274357 URL: https://svnweb.freebsd.org/changeset/base/274357 Log: Import ACPICA 20141107. Added: vendor-sys/acpica/dist/source/compiler/aslprintf.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslprune.c (contents, props changed) vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c (contents, props changed) vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmap.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslparser.y vendor-sys/acpica/dist/source/compiler/aslrules.y vendor-sys/acpica/dist/source/compiler/asltokens.y vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/asltypes.y vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dtsubtable.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmutils.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsargs.c vendor-sys/acpica/dist/source/components/dispatcher/dscontrol.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dsmthdat.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswexec.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c vendor-sys/acpica/dist/source/components/dispatcher/dswstate.c vendor-sys/acpica/dist/source/components/events/evhandler.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/events/evrgnini.c vendor-sys/acpica/dist/source/components/events/evxface.c vendor-sys/acpica/dist/source/components/events/evxfevnt.c vendor-sys/acpica/dist/source/components/events/evxfgpe.c vendor-sys/acpica/dist/source/components/events/evxfregn.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exconvrt.c vendor-sys/acpica/dist/source/components/executer/excreate.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exfield.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/executer/exmisc.c vendor-sys/acpica/dist/source/components/executer/exmutex.c vendor-sys/acpica/dist/source/components/executer/exnames.c vendor-sys/acpica/dist/source/components/executer/exoparg1.c vendor-sys/acpica/dist/source/components/executer/exoparg2.c vendor-sys/acpica/dist/source/components/executer/exoparg3.c vendor-sys/acpica/dist/source/components/executer/exoparg6.c vendor-sys/acpica/dist/source/components/executer/exprep.c vendor-sys/acpica/dist/source/components/executer/exregion.c vendor-sys/acpica/dist/source/components/executer/exresnte.c vendor-sys/acpica/dist/source/components/executer/exresolv.c vendor-sys/acpica/dist/source/components/executer/exresop.c vendor-sys/acpica/dist/source/components/executer/exstore.c vendor-sys/acpica/dist/source/components/executer/exstoren.c vendor-sys/acpica/dist/source/components/executer/exstorob.c vendor-sys/acpica/dist/source/components/executer/exsystem.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/hardware/hwacpi.c vendor-sys/acpica/dist/source/components/hardware/hwpci.c vendor-sys/acpica/dist/source/components/hardware/hwregs.c vendor-sys/acpica/dist/source/components/hardware/hwvalid.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/namespace/nsalloc.c vendor-sys/acpica/dist/source/components/namespace/nsconvert.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nsdumpdv.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsload.c vendor-sys/acpica/dist/source/components/namespace/nsnames.c vendor-sys/acpica/dist/source/components/namespace/nsobject.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/namespace/nssearch.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/namespace/nswalk.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/namespace/nsxfname.c vendor-sys/acpica/dist/source/components/namespace/nsxfobj.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/parser/pstree.c vendor-sys/acpica/dist/source/components/parser/psxface.c vendor-sys/acpica/dist/source/components/resources/rsaddr.c vendor-sys/acpica/dist/source/components/resources/rscalc.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsinfo.c vendor-sys/acpica/dist/source/components/resources/rsio.c vendor-sys/acpica/dist/source/components/resources/rsirq.c vendor-sys/acpica/dist/source/components/resources/rslist.c vendor-sys/acpica/dist/source/components/resources/rsmemory.c vendor-sys/acpica/dist/source/components/resources/rsmisc.c vendor-sys/acpica/dist/source/components/resources/rsserial.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/resources/rsxface.c vendor-sys/acpica/dist/source/components/tables/tbdata.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbfind.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxface.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/tables/tbxfroot.c vendor-sys/acpica/dist/source/components/utilities/utaddress.c vendor-sys/acpica/dist/source/components/utilities/utalloc.c vendor-sys/acpica/dist/source/components/utilities/utbuffer.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utcopy.c vendor-sys/acpica/dist/source/components/utilities/utdebug.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/uterror.c vendor-sys/acpica/dist/source/components/utilities/uteval.c vendor-sys/acpica/dist/source/components/utilities/utexcep.c vendor-sys/acpica/dist/source/components/utilities/utglobal.c vendor-sys/acpica/dist/source/components/utilities/uthex.c vendor-sys/acpica/dist/source/components/utilities/utids.c vendor-sys/acpica/dist/source/components/utilities/utinit.c vendor-sys/acpica/dist/source/components/utilities/utlock.c vendor-sys/acpica/dist/source/components/utilities/utmath.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utmutex.c vendor-sys/acpica/dist/source/components/utilities/utobject.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/components/utilities/utownerid.c vendor-sys/acpica/dist/source/components/utilities/utpredef.c vendor-sys/acpica/dist/source/components/utilities/utresrc.c vendor-sys/acpica/dist/source/components/utilities/utstate.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utuuid.c vendor-sys/acpica/dist/source/components/utilities/utxface.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/components/utilities/utxfmutex.c vendor-sys/acpica/dist/source/include/acbuffer.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/examples/examples.c vendor-sys/acpica/dist/source/tools/examples/extables.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/changes.txt Mon Nov 10 21:30:04 2014 (r274357) @@ -1,4 +1,183 @@ ---------------------------------------- +07 November 2014. Summary of changes for version 20141107: + +This release is available at https://acpica.org/downloads + +This release introduces and implements language extensions to ASL that +provide support for symbolic ("C-style") operators and expressions. These +language extensions are known collectively as ASL+. + + +1) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem with disassembly of the UartSerialBus +macro. Changed "StopBitsNone" to the correct "StopBitsZero". David E. +Box. + +Disassembler: Fixed the Unicode macro support to add escape sequences. +All non-printable ASCII values are emitted as escape sequences, as well +as the standard escapes for quote and backslash. Ensures that the +disassembled macro can be correctly recompiled. + +iASL: Added Printf/Fprintf macros for formatted output. These macros are +translated to existing AML Concatenate and Store operations. Printf +writes to the ASL Debug object. Fprintf allows the specification of an +ASL name as the target. Only a single format specifier is required, %o, +since the AML interpreter dynamically converts objects to the required +type. David E. Box. + + (old) Store (Concatenate (Concatenate (Concatenate (Concatenate + (Concatenate (Concatenate (Concatenate ("", Arg0), + ": Unexpected value for "), Arg1), ", "), Arg2), + " at line "), Arg3), Debug) + + (new) Printf ("%o: Unexpected value for %o, %o at line %o", + Arg0, Arg1, Arg2, Arg3) + + (old) Store (Concatenate (Concatenate (Concatenate (Concatenate + ("", Arg1), ": "), Arg0), " Successful"), STR1) + + (new) Fprintf (STR1, "%o: %o Successful", Arg1, Arg0) + +iASL: Added debug options (-bp, -bt) to dynamically prune levels of the +ASL parse tree before the AML code is generated. This allows blocks of +ASL code to be removed in order to help locate and identify problem +devices and/or code. David E. Box. + +AcpiExec: Added support (-fi) for an optional namespace object +initialization file. This file specifies initial values for namespace +objects as necessary for debugging and testing different ASL code paths +that may be taken as a result of BIOS options. + + +2) Overview of symbolic operator support for ASL (ASL+) +------------------------------------------------------- + +As an extension to the ASL language, iASL implements support for symbolic +(C-style) operators for math and logical expressions. This can greatly +simplify ASL code as well as improve both readability and +maintainability. These language extensions can exist concurrently with +all legacy ASL code and expressions. + +The symbolic extensions are 100% compatible with existing AML +interpreters, since no new AML opcodes are created. To implement the +extensions, the iASL compiler transforms the symbolic expressions into +the legacy ASL/AML equivalents at compile time. + +Full symbolic expressions are supported, along with the standard C +precedence and associativity rules. + +Full disassembler support for the symbolic expressions is provided, and +creates an automatic migration path for existing ASL code to ASL+ code +via the disassembly process. By default, the disassembler now emits ASL+ +code with symbolic expressions. An option (-dl) is provided to force the +disassembler to emit legacy ASL code if desired. + +Below is the complete list of the currently supported symbolic operators +with examples. See the iASL User Guide for additional information. + + +ASL+ Syntax Legacy ASL Equivalent +----------- --------------------- + + // Math operators + +Z = X + Y Add (X, Y, Z) +Z = X - Y Subtract (X, Y, Z) +Z = X * Y Multiply (X, Y, Z) +Z = X / Y Divide (X, Y, , Z) +Z = X % Y Mod (X, Y, Z) +Z = X << Y ShiftLeft (X, Y, Z) +Z = X >> Y ShiftRight (X, Y, Z) +Z = X & Y And (X, Y, Z) +Z = X | Y Or (X, Y, Z) +Z = X ^ Y Xor (X, Y, Z) +Z = ~X Not (X, Z) +X++ Increment (X) +X-- Decrement (X) + + // Logical operators + +(X == Y) LEqual (X, Y) +(X != Y) LNotEqual (X, Y) +(X < Y) LLess (X, Y) +(X > Y) LGreater (X, Y) +(X <= Y) LLessEqual (X, Y) +(X >= Y) LGreaterEqual (X, Y) +(X && Y) LAnd (X, Y) +(X || Y) LOr (X, Y) +(!X) LNot (X) + + // Assignment and compound assignment operations + +X = Y Store (Y, X) +X += Y Add (X, Y, X) +X -= Y Subtract (X, Y, X) +X *= Y Multiply (X, Y, X) +X /= Y Divide (X, Y, , X) +X %= Y Mod (X, Y, X) +X <<= Y ShiftLeft (X, Y, X) +X >>= Y ShiftRight (X, Y, X) +X &= Y And (X, Y, X) +X |= Y Or (X, Y, X) +X ^= Y Xor (X, Y, X) + + +3) ASL+ Examples: +----------------- + +Legacy ASL: + If (LOr (LOr (LEqual (And (R510, 0x03FB), 0x02E0), LEqual ( + And (R520, 0x03FB), 0x02E0)), LOr (LEqual (And (R530, +0x03FB), + 0x02E0), LEqual (And (R540, 0x03FB), 0x02E0)))) + { + And (MEMB, 0xFFFFFFF0, SRMB) + Store (MEMB, Local2) + Store (PDBM, Local1) + And (PDBM, 0xFFFFFFFFFFFFFFF9, PDBM) + Store (SRMB, MEMB) + Or (PDBM, 0x02, PDBM) + } + +ASL+ version: + If (((R510 & 0x03FB) == 0x02E0) || + ((R520 & 0x03FB) == 0x02E0) || + ((R530 & 0x03FB) == 0x02E0) || + ((R540 & 0x03FB) == 0x02E0)) + { + SRMB = (MEMB & 0xFFFFFFF0) + Local2 = MEMB + Local1 = PDBM + PDBM &= 0xFFFFFFFFFFFFFFF9 + MEMB = SRMB + PDBM |= 0x02 + } + +Legacy ASL: + Store (0x1234, Local1) + Multiply (Add (Add (Local1, TEST), 0x20), Local2, Local3) + Multiply (Local2, Add (Add (Local1, TEST), 0x20), Local3) + Add (Local1, Add (TEST, Multiply (0x20, Local2)), Local3) + Store (Index (PKG1, 0x03), Local6) + Store (Add (Local3, Local2), Debug) + Add (Local1, 0x0F, Local2) + Add (Local1, Multiply (Local2, Local3), Local2) + Multiply (Add (Add (Local1, TEST), 0x20), ToBCD (Local1), Local3) + +ASL+ version: + Local1 = 0x1234 + Local3 = (((Local1 + TEST) + 0x20) * Local2) + Local3 = (Local2 * ((Local1 + TEST) + 0x20)) + Local3 = (Local1 + (TEST + (0x20 * Local2))) + Local6 = Index (PKG1, 0x03) + Debug = (Local3 + Local2) + Local2 = (Local1 + 0x0F) + Local2 = (Local1 + (Local2 * Local3)) + Local3 = (((Local1 + TEST) + 0x20) * ToBCD (Local1)) + + +---------------------------------------- 26 September 2014. Summary of changes for version 20140926: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Mon Nov 10 21:30:04 2014 (r274357) @@ -42,6 +42,7 @@ OBJECTS = \ $(OBJDIR)/acgetline.o\ $(OBJDIR)/aeexec.o\ $(OBJDIR)/aehandlers.o\ + $(OBJDIR)/aeinitfile.o\ $(OBJDIR)/aemain.o\ $(OBJDIR)/aeregion.o\ $(OBJDIR)/aetables.o\ @@ -62,6 +63,7 @@ OBJECTS = \ $(OBJDIR)/dbutils.o\ $(OBJDIR)/dbxface.o\ $(OBJDIR)/dmbuffer.o\ + $(OBJDIR)/dmcstyle.o\ $(OBJDIR)/dmdeferred.o\ $(OBJDIR)/dmnames.o\ $(OBJDIR)/dmobject.o\ Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Mon Nov 10 21:30:04 2014 (r274357) @@ -79,6 +79,8 @@ OBJECTS = \ $(OBJDIR)/asloptions.o\ $(OBJDIR)/aslpredef.o\ $(OBJDIR)/aslprepkg.o\ + $(OBJDIR)/aslprintf.o\ + $(OBJDIR)/aslprune.o\ $(OBJDIR)/aslresource.o\ $(OBJDIR)/aslrestype1.o\ $(OBJDIR)/aslrestype1i.o\ @@ -97,16 +99,9 @@ OBJECTS = \ $(OBJDIR)/aslwalks.o\ $(OBJDIR)/aslxref.o\ $(OBJDIR)/cmfsize.o\ - $(OBJDIR)/dtcompile.o\ - $(OBJDIR)/dtexpress.o\ - $(OBJDIR)/dtfield.o\ - $(OBJDIR)/dtio.o\ - $(OBJDIR)/dtsubtable.o\ - $(OBJDIR)/dttable.o\ - $(OBJDIR)/dttemplate.o\ - $(OBJDIR)/dtutils.o\ $(OBJDIR)/dbfileio.o\ $(OBJDIR)/dmbuffer.o\ + $(OBJDIR)/dmcstyle.o\ $(OBJDIR)/dmdeferred.o\ $(OBJDIR)/dmextern.o\ $(OBJDIR)/dmnames.o\ @@ -133,6 +128,14 @@ OBJECTS = \ $(OBJDIR)/dswload2.o\ $(OBJDIR)/dswscope.o\ $(OBJDIR)/dswstate.o\ + $(OBJDIR)/dtcompile.o\ + $(OBJDIR)/dtexpress.o\ + $(OBJDIR)/dtfield.o\ + $(OBJDIR)/dtio.o\ + $(OBJDIR)/dtsubtable.o\ + $(OBJDIR)/dttable.o\ + $(OBJDIR)/dttemplate.o\ + $(OBJDIR)/dtutils.o\ $(OBJDIR)/exconvrt.o\ $(OBJDIR)/excreate.o\ $(OBJDIR)/exdump.o\ Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/common/adisasm.c Mon Nov 10 21:30:04 2014 (r274357) @@ -544,12 +544,26 @@ AdDisassemblerHeader ( { time_t Timer; + time (&Timer); /* Header and input table info */ AcpiOsPrintf ("/*\n"); - AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * ")); + AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * ")); + + if (AcpiGbl_CstyleDisassembly) + { + AcpiOsPrintf ( + " * Disassembling to symbolic ASL+ operators\n" + " *\n"); + } + else + { + AcpiOsPrintf ( + " * Disassembling to non-symbolic legacy ASL operators\n" + " *\n"); + } AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer)); AcpiOsPrintf (" *\n"); Modified: vendor-sys/acpica/dist/source/compiler/aslbtypes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslbtypes.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslbtypes.c Mon Nov 10 21:30:04 2014 (r274357) @@ -374,6 +374,12 @@ AnGetBtype ( UINT32 ThisNodeBtype = 0; + if (!Op) + { + AcpiOsPrintf ("Null Op in AnGetBtype\n"); + return (ACPI_UINT32_MAX); + } + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Mon Nov 10 21:30:04 2014 (r274357) @@ -107,6 +107,12 @@ CgGenerateAmlOutput ( TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, CgAmlWriteWalk, NULL, NULL); + + DbgPrint (ASL_TREE_OUTPUT, + "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" + " Parent Child Next Flags AcTyp Final Col L\n", + 76, " "); + CgCloseTable (); } @@ -138,7 +144,8 @@ CgAmlWriteWalk ( DbgPrint (ASL_TREE_OUTPUT, "Final parse tree used for AML output:\n"); DbgPrint (ASL_TREE_OUTPUT, - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n", + "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" + " Parent Child Next Flags AcTyp Final Col L\n", 76, " "); } @@ -161,7 +168,8 @@ CgAmlWriteWalk ( } DbgPrint (ASL_TREE_OUTPUT, - "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n", + "%08X %04X %04X %01X %04X %04X %04X %04X " + "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n", /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -171,13 +179,14 @@ CgAmlWriteWalk ( /* 7 */ Op->Asl.AmlSubtreeLength, /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, /* 9 */ Op, - /* 10 */ Op->Asl.Child, - /* 11 */ Op->Asl.Parent, - /* 12 */ Op->Asl.CompileFlags, - /* 13 */ Op->Asl.AcpiBtype, - /* 14 */ Op->Asl.FinalAmlLength, - /* 15 */ Op->Asl.Column, - /* 16 */ Op->Asl.LineNumber); + /* 10 */ Op->Asl.Parent, + /* 11 */ Op->Asl.Child, + /* 12 */ Op->Asl.Next, + /* 13 */ Op->Asl.CompileFlags, + /* 14 */ Op->Asl.AcpiBtype, + /* 15 */ Op->Asl.FinalAmlLength, + /* 16 */ Op->Asl.Column, + /* 17 */ Op->Asl.LineNumber); /* Generate the AML for this node */ Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Mon Nov 10 21:30:04 2014 (r274357) @@ -147,6 +147,13 @@ CmDoCompile ( Event = UtBeginEvent ("Flush source input"); CmFlushSourceCode (); + /* Prune the parse tree if requested (debug purposes only) */ + + if (Gbl_PruneParseTree) + { + AslPruneParseTree (Gbl_PruneDepth, Gbl_PruneType); + } + /* Optional parse tree dump, compiler debug output only */ LsDumpParseTree (); Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Nov 10 21:30:04 2014 (r274357) @@ -543,6 +543,27 @@ OptOptimizeNamePath ( /* + * aslprintf - Printf/Fprintf macros + */ +void +OpcDoPrintf ( + ACPI_PARSE_OBJECT *Op); + +void +OpcDoFprintf ( + ACPI_PARSE_OBJECT *Op); + + +/* + * aslprune - parse tree pruner + */ +void +AslPruneParseTree ( + UINT32 PruneDepth, + UINT32 Type); + + +/* * aslcodegen - code generation */ void @@ -684,6 +705,16 @@ TrCreateLeafNode ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * +TrCreateAssignmentNode ( + ACPI_PARSE_OBJECT *Target, + ACPI_PARSE_OBJECT *Source); + +ACPI_PARSE_OBJECT * +TrCreateTargetOperand ( + ACPI_PARSE_OBJECT *OriginalOp, + ACPI_PARSE_OBJECT *ParentOp); + +ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, UINT64 Value); Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Mon Nov 10 21:30:04 2014 (r274357) @@ -117,7 +117,49 @@ NamePathTail [.]{NameSeg} else {yyterminate ();} } ";" { count (0); return(';'); } + /* ASL Extension: Standard C operators */ +"~" { count (3); return (PARSEOP_EXP_NOT); } +"!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); } +"*" { count (3); return (PARSEOP_EXP_MULTIPLY); } +"/" { count (3); return (PARSEOP_EXP_DIVIDE); } +"%" { count (3); return (PARSEOP_EXP_MODULO); } +"+" { count (3); return (PARSEOP_EXP_ADD); } +"-" { count (3); return (PARSEOP_EXP_SUBTRACT); } +">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); } +"<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); } +"<" { count (3); return (PARSEOP_EXP_LESS); } +">" { count (3); return (PARSEOP_EXP_GREATER); } +"&" { count (3); return (PARSEOP_EXP_AND); } +"<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); } +">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); } +"==" { count (3); return (PARSEOP_EXP_EQUAL); } +"!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); } +"|" { count (3); return (PARSEOP_EXP_OR); } +"&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); } +"||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); } +"++" { count (3); return (PARSEOP_EXP_INCREMENT); } +"--" { count (3); return (PARSEOP_EXP_DECREMENT); } +"^ " { count (3); return (PARSEOP_EXP_XOR); } + + /* ASL Extension: Standard C assignment operators */ + +"=" { count (3); return (PARSEOP_EXP_EQUALS); } +"+=" { count (3); return (PARSEOP_EXP_ADD_EQ); } +"-=" { count (3); return (PARSEOP_EXP_SUB_EQ); } +"*=" { count (3); return (PARSEOP_EXP_MUL_EQ); } +"/=" { count (3); return (PARSEOP_EXP_DIV_EQ); } +"%=" { count (3); return (PARSEOP_EXP_MOD_EQ); } +"<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); } +">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); } +"&=" { count (3); return (PARSEOP_EXP_AND_EQ); } +"^=" { count (3); return (PARSEOP_EXP_XOR_EQ); } +"|=" { count (3); return (PARSEOP_EXP_OR_EQ); } + + + /* + * Begin standard ASL grammar + */ 0[xX]{HexDigitChar}+ | {DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext); count (1); return (PARSEOP_INTEGER); } @@ -592,6 +634,44 @@ NamePathTail [.]{NameSeg} "Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); } "Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); } + /* ToPld macro */ + +"ToPLD" { count (0); return (PARSEOP_TOPLD); } + +"PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); } +"PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); } +"PLD_Red" { count (0); return (PARSEOP_PLD_RED); } +"PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); } +"PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); } +"PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); } +"PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); } +"PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); } +"PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); } +"PLD_Lid" { count (0); return (PARSEOP_PLD_LID); } +"PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); } +"PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); } +"PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); } +"PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); } +"PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); } +"PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); } +"PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); } +"PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); } +"PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); } +"PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); } +"PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); } +"PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); } +"PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); } +"PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); } +"PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); } +"PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); } +"PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); } +"PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); } + + + /* printf debug macros */ +"printf" { count (0); return (PARSEOP_PRINTF); } +"fprintf" { count (0); return (PARSEOP_FPRINTF); } + /* Predefined compiler names */ "__DATE__" { count (0); return (PARSEOP___DATE__); } @@ -628,10 +708,6 @@ NamePathTail [.]{NameSeg} DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s); return (PARSEOP_NAMESTRING); } -"*" | -"/" { count (1); - AslCompilererror ("Parse error, expecting ASL keyword or name");} - . { count (1); sprintf (MsgBuffer, "Invalid character (0x%2.2X), expecting ASL keyword or name", Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Mon Nov 10 21:30:04 2014 (r274357) @@ -49,8 +49,8 @@ * Compiler versions and names */ #define ASL_REVISION ACPI_CA_VERSION -#define ASL_COMPILER_NAME "ASL Optimizing Compiler" -#define AML_DISASSEMBLER_NAME "AML Disassembler" +#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler" +#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler" #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Nov 10 21:30:04 2014 (r274357) @@ -173,6 +173,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE); #define HEX_OUTPUT_NONE 0 @@ -251,6 +252,8 @@ ASL_EXTERN UINT32 ASL_ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG"); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID"); +ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_PruneDepth, 0); +ASL_EXTERN UINT16 ASL_INIT_GLOBAL (Gbl_PruneType, 0); /* Static structures */ Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Mon Nov 10 21:30:04 2014 (r274357) @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __ASLLOAD_C__ - #include "aslcompiler.h" #include "amlcode.h" #include "acdispat.h" Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Nov 10 21:30:04 2014 (r274357) @@ -187,13 +187,17 @@ Usage ( ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates"); ACPI_OPTION ("-dc ", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)"); + ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)"); ACPI_OPTION ("-e ", "Include ACPI table(s) for external symbol resolution"); ACPI_OPTION ("-fe ", "Specify external symbol declaration file"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); printf ("\nDebug Options:\n"); - ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)"); + ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)"); + ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)"); + ACPI_OPTION ("-bp ", "Prune ASL parse tree"); + ACPI_OPTION ("-bt ", "Object type to be pruned from the parse tree"); ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); ACPI_OPTION ("-m ", "Set internal line buffer size (in Kbytes)"); ACPI_OPTION ("-n", "Parse only, no output generation"); Modified: vendor-sys/acpica/dist/source/compiler/aslmap.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmap.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslmap.c Mon Nov 10 21:30:04 2014 (r274357) @@ -446,7 +446,38 @@ const ASL_MAPPING_ENTRY AslKeywordMa /* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER), /* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER), - +/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER), +/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* RED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* GREEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* BLUE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* WIDTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* HEIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* USERVISIBLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* DOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* LID */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* PANEL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* VERTICALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* HORIZONTALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* SHAPE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* GROUPORIENTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* GROUPTOKEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* GROUPPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* BAY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* EJECTABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* EJECTREQUIRED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* CABINETNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* CARDCAGENUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* REFERENCE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* ROTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* ORDER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* RESERVED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* VERTICALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* HORIZONTALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* PRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE), +/* FPRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE), /*! [End] no source code translation !*/ }; Modified: vendor-sys/acpica/dist/source/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Mon Nov 10 21:10:50 2014 (r274356) +++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Mon Nov 10 21:30:04 2014 (r274357) @@ -68,9 +68,62 @@ OpcDoEisaId ( ACPI_PARSE_OBJECT *Op); static void +OpcDoPld ( + ACPI_PARSE_OBJECT *Op); + +static void OpcDoUuId ( ACPI_PARSE_OBJECT *Op); +static UINT8 * +OpcEncodePldBuffer ( + ACPI_PLD_INFO *PldInfo); + + +/* ToPld strings */ + +static char *AslPldPanelList[] = +{ + "TOP", + "BOTTOM", + "LEFT", + "RIGHT", + "FRONT", + "BACK", + "UNKNOWN", + NULL +}; + +static char *AslPldVerticalPositionList[] = +{ + "UPPER", + "CENTER", + "LOWER", + NULL +}; + +static char *AslPldHorizontalPositionList[] = +{ + "LEFT", + "CENTER", + "RIGHT", + NULL +}; + +static char *AslPldShapeList[] = +{ + "ROUND", + "OVAL", + "SQUARE", + "VERTICALRECTANGLE", + "HORIZONTALRECTANGLE", + "VERTICALTRAPEZOID", + "HORIZONTALTRAPEZOID", + "UNKNOWN", + "CHAMFERED", + NULL +}; + /******************************************************************************* * @@ -653,9 +706,698 @@ OpcDoEisaId ( /******************************************************************************* * + * FUNCTION: OpcEncodePldBuffer + * + * PARAMETERS: PldInfo - _PLD buffer struct (Using local struct) + * + * RETURN: Encode _PLD buffer suitable for return value from _PLD + * + * DESCRIPTION: Bit-packs a _PLD buffer struct. + * + ******************************************************************************/ + +static UINT8 * +OpcEncodePldBuffer ( + ACPI_PLD_INFO *PldInfo) +{ + UINT32 *Buffer; + UINT32 Dword; + + + Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE); + if (!Buffer) + { + return (NULL); + } + + /* First 32 bits */ + + Dword = 0; + ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision); + ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor); + ACPI_PLD_SET_RED (&Dword, PldInfo->Red); + ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green); + ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue); + ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword); + + /* Second 32 bits */ + + Dword = 0; + ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width); + ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height); + ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword); + + /* Third 32 bits */ + + Dword = 0; + ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible); + ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock); + ACPI_PLD_SET_LID (&Dword, PldInfo->Lid); + ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel); + ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition); + ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition); + ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape); + ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation); + ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken); + ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition); + ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay); + ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword); + + /* Fourth 32 bits */ + + Dword = 0; + ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable); + ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired); + ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber); + ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber); + ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference); + ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation); + ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order); + ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword); + + if (PldInfo->Revision >= 2) + { + /* Fifth 32 bits */ + + Dword = 0; + ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset); + ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset); + ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword); + } + + return (ACPI_CAST_PTR (UINT8, Buffer)); +} + + +/******************************************************************************* + * + * FUNCTION: OpcStrupr (strupr) + * + * PARAMETERS: SrcString - The source string to convert + * + * RETURN: None + * + * DESCRIPTION: Convert string to uppercase + * + * NOTE: This is not a POSIX function, so it appears here, not in utclib.c + * + ******************************************************************************/ + +static void +OpcStrupr ( + char *SrcString) +{ + char *String; + + + if (!SrcString) + { + return; + } + + /* Walk entire string, uppercasing the letters */ + + for (String = SrcString; *String; String++) + { + *String = (char) toupper ((int) *String); + } + + return; +} + + +/******************************************************************************* + * + * FUNCTION: OpcFindName + * + * PARAMETERS: List - Array of char strings to be searched + * Name - Char string to string for + * Index - Index value to set if found + * + * RETURN: TRUE if any names matched, FALSE otherwise + * + * DESCRIPTION: Match PLD name to value in lookup table. Sets Value to + * equivalent parameter value. + * + ******************************************************************************/ + +static BOOLEAN +OpcFindName ( + char **List, + char *Name, + UINT64 *Index) +{ + char *Str; + UINT32 i; + + + OpcStrupr (Name); + + for (i = 0, Str = List[0]; Str; i++, Str = List[i]) + { + if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name)))) + { + *Index = i; + return (TRUE); + } + } + + return (FALSE); +} + + +/******************************************************************************* + * + * FUNCTION: OpcDoPld + * + * PARAMETERS: Op - Parse node + * + * RETURN: None + * + * DESCRIPTION: Convert ToPLD macro to 20-byte buffer + * + ******************************************************************************/ + +static void +OpcDoPld ( + ACPI_PARSE_OBJECT *Op) +{ + UINT8 *Buffer; + ACPI_PARSE_OBJECT *Node; + ACPI_PLD_INFO PldInfo; + ACPI_PARSE_OBJECT *NewOp; + + + if (!Op) + { + AslError(ASL_ERROR, ASL_MSG_NOT_EXIST, Op, NULL); + return; + } + + if (Op->Asl.ParseOpcode != PARSEOP_TOPLD) + { + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Op, NULL); + return; + } + + Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE); + if (!Buffer) + { + AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL); + return; + } + + ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); + + Node = Op->Asl.Child; + while (Node) + { + switch (Node->Asl.ParseOpcode) + { + case PARSEOP_PLD_REVISION: + + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER) + { + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL); + break; + } + + if (Node->Asl.Child->Asl.Value.Integer > 127) + { + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL); + break; + } + + PldInfo.Revision = (UINT8) Node->Asl.Child->Asl.Value.Integer; + break; + + case PARSEOP_PLD_IGNORECOLOR: + + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER) + { + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL); + break; + } + + if (Node->Asl.Child->Asl.Value.Integer > 1) + { + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL); + break; + } + + PldInfo.IgnoreColor = (UINT8) Node->Asl.Child->Asl.Value.Integer; + break; + + case PARSEOP_PLD_RED: + case PARSEOP_PLD_GREEN: + case PARSEOP_PLD_BLUE: + + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER) + { + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL); + break; + } + + if (Node->Asl.Child->Asl.Value.Integer > 255) + { + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL); + break; + } + + if (Node->Asl.ParseOpcode == PARSEOP_PLD_RED) + { + PldInfo.Red = (UINT8) Node->Asl.Child->Asl.Value.Integer; + } + else if (Node->Asl.ParseOpcode == PARSEOP_PLD_GREEN) + { + PldInfo.Green = (UINT8) Node->Asl.Child->Asl.Value.Integer; + } + else /* PARSEOP_PLD_BLUE */ + { + PldInfo.Blue = (UINT8) Node->Asl.Child->Asl.Value.Integer; + } + break; + + case PARSEOP_PLD_WIDTH: + case PARSEOP_PLD_HEIGHT: + + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER) + { + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL); + break; + } + + if (Node->Asl.Child->Asl.Value.Integer > 65535) + { + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL); + break; + } + + if (Node->Asl.ParseOpcode == PARSEOP_PLD_WIDTH) + { + PldInfo.Width = (UINT16) Node->Asl.Child->Asl.Value.Integer; + } + else /* PARSEOP_PLD_HEIGHT */ + { + PldInfo.Height = (UINT16) Node->Asl.Child->Asl.Value.Integer; + } + + break; + + case PARSEOP_PLD_USERVISIBLE: + case PARSEOP_PLD_DOCK: + case PARSEOP_PLD_LID: + + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER) + { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 21:31:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F71BD5D; Mon, 10 Nov 2014 21:31:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13315E1A; Mon, 10 Nov 2014 21:31:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAALVElQ096260; Mon, 10 Nov 2014 21:31:14 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAALVEoI096250; Mon, 10 Nov 2014 21:31:14 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201411102131.sAALVEoI096250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 10 Nov 2014 21:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274358 - vendor-sys/acpica/20141107 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 21:31:15 -0000 Author: jkim Date: Mon Nov 10 21:31:14 2014 New Revision: 274358 URL: https://svnweb.freebsd.org/changeset/base/274358 Log: Tag ACPICA 20141107. Added: vendor-sys/acpica/20141107/ - copied from r274357, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 21:31:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DCC5E84; Mon, 10 Nov 2014 21:31:25 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 629E2E1E; Mon, 10 Nov 2014 21:31:25 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NEU00I21EFSDG50@st11p02mm-asmtp001.mac.com>; Mon, 10 Nov 2014 21:31:06 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-11-10_04:2014-11-10,2014-11-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1411100163 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r273762 - head/sys/modules/dtrace/dtraceall From: Rui Paulo In-reply-to: <201410280418.s9S4I9qh094390@svn.freebsd.org> Date: Mon, 10 Nov 2014 13:31:04 -0800 Content-transfer-encoding: quoted-printable Message-id: <54C440DD-F04D-44DA-AE6D-51020F3DB9C4@me.com> References: <201410280418.s9S4I9qh094390@svn.freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1990.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 21:31:25 -0000 On Oct 27, 2014, at 21:18, Julian Elischer wrote: >=20 > Author: julian > Date: Tue Oct 28 04:18:09 2014 > New Revision: 273762 > URL: https://svnweb.freebsd.org/changeset/base/273762 >=20 > Log: > Allow loading of dtraceall without nfscl if what you really wnat is = nfsclient >=20 > Obtained from: Panzura tree > MFC after: 1 week >=20 > Modified: > head/sys/modules/dtrace/dtraceall/dtraceall.c >=20 > Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 = 03:42:09 2014 (r273761) > +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 = 04:18:09 2014 (r273762) > @@ -67,7 +67,9 @@ MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1 > MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); > +#if defined(NFSCLIENT) > MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); > +#endif > #if defined(NFSCLIENT) > MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); > #endif This change is wrong. NFSCLIENT is the old NFS client implementation = and NFSCL is the new client implementation. The DTrace modules match = them respectively. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 23:10:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEB7B72A; Mon, 10 Nov 2014 23:10:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFF8AAB5; Mon, 10 Nov 2014 23:10:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAANA3dR042298; Mon, 10 Nov 2014 23:10:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAANA2GA042280; Mon, 10 Nov 2014 23:10:02 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411102310.sAANA2GA042280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 10 Nov 2014 23:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274359 - in head: sys/netinet sys/sys tools/tools/sysdoc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 23:10:04 -0000 Author: melifaro Date: Mon Nov 10 23:10:01 2014 New Revision: 274359 URL: https://svnweb.freebsd.org/changeset/base/274359 Log: Remove kernel handling of ICMP_SOURCEQUENCH. It hasn't been used for a very long time. Additionally, it was deprecated by RFC 6633. Modified: head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/tcp_subr.c head/sys/sys/protosw.h head/tools/tools/sysdoc/tunables.mdoc Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Mon Nov 10 21:31:14 2014 (r274358) +++ head/sys/netinet/ip_fastfwd.c Mon Nov 10 23:10:01 2014 (r274359) @@ -502,7 +502,6 @@ passout: if ((ifp->if_snd.ifq_len + ip_len / ifp->if_mtu + 1) >= ifp->if_snd.ifq_maxlen) { IPSTAT_INC(ips_odropped); - /* would send source quench here but that is depreciated */ goto drop; } #endif Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Mon Nov 10 21:31:14 2014 (r274358) +++ head/sys/netinet/ip_icmp.c Mon Nov 10 23:10:01 2014 (r274359) @@ -486,12 +486,6 @@ icmp_input(struct mbuf **mp, int *offp, if (code > 1) goto badcode; code = PRC_PARAMPROB; - goto deliver; - - case ICMP_SOURCEQUENCH: - if (code) - goto badcode; - code = PRC_QUENCH; deliver: /* * Problem with datagram; advise higher level routines. @@ -670,6 +664,7 @@ reflect: case ICMP_TSTAMPREPLY: case ICMP_IREQREPLY: case ICMP_MASKREPLY: + case ICMP_SOURCEQUENCH: default: break; } Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Nov 10 21:31:14 2014 (r274358) +++ head/sys/netinet/ip_input.c Mon Nov 10 23:10:01 2014 (r274359) @@ -104,12 +104,6 @@ SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIR &VNET_NAME(ipsendredirects), 0, "Enable sending IP redirects"); -static VNET_DEFINE(int, ip_sendsourcequench); -#define V_ip_sendsourcequench VNET(ip_sendsourcequench) -SYSCTL_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(ip_sendsourcequench), 0, - "Enable the transmission of source quench packets"); - VNET_DEFINE(int, ip_do_randomid); SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_do_randomid), 0, @@ -1647,25 +1641,6 @@ ip_forward(struct mbuf *m, int srcrt) break; case ENOBUFS: - /* - * A router should not generate ICMP_SOURCEQUENCH as - * required in RFC1812 Requirements for IP Version 4 Routers. - * Source quench could be a big problem under DoS attacks, - * or if the underlying interface is rate-limited. - * Those who need source quench packets may re-enable them - * via the net.inet.ip.sendsourcequench sysctl. - */ - if (V_ip_sendsourcequench == 0) { - m_freem(mcopy); - if (ia != NULL) - ifa_free(&ia->ia_ifa); - return; - } else { - type = ICMP_SOURCEQUENCH; - code = 0; - } - break; - case EACCES: /* ipfw denied packet */ m_freem(mcopy); if (ia != NULL) Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Nov 10 21:31:14 2014 (r274358) +++ head/sys/netinet/tcp_subr.c Mon Nov 10 23:10:01 2014 (r274359) @@ -1430,11 +1430,6 @@ tcp_ctlinput(int cmd, struct sockaddr *s else if (PRC_IS_REDIRECT(cmd)) return; /* - * Source quench is depreciated. - */ - else if (cmd == PRC_QUENCH) - return; - /* * Hostdead is ugly because it goes linearly through all PCBs. * XXX: We never get this from ICMP, otherwise it makes an * excellent DoS attack on machines with many connections. @@ -1539,9 +1534,6 @@ tcp6_ctlinput(int cmd, struct sockaddr * else if (!PRC_IS_REDIRECT(cmd) && ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0)) return; - /* Source quench is depreciated. */ - else if (cmd == PRC_QUENCH) - return; /* if the parameter is from icmp6, decode it. */ if (d != NULL) { Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Mon Nov 10 21:31:14 2014 (r274358) +++ head/sys/sys/protosw.h Mon Nov 10 23:10:01 2014 (r274359) @@ -274,8 +274,8 @@ int pru_sopoll_notsupp(struct socket *so #define PRC_IFDOWN 0 /* interface transition */ #define PRC_ROUTEDEAD 1 /* select new route if possible ??? */ #define PRC_IFUP 2 /* interface has come back up */ -#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */ -#define PRC_QUENCH 4 /* some one said to slow down */ +/* was PRC_QUENCH2 3 DEC congestion bit says slow down */ +/* was PRC_QUENCH 4 Deprecated by RFC 6633 */ #define PRC_MSGSIZE 5 /* message size forced drop */ #define PRC_HOSTDEAD 6 /* host appears to be down */ #define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */ Modified: head/tools/tools/sysdoc/tunables.mdoc ============================================================================== --- head/tools/tools/sysdoc/tunables.mdoc Mon Nov 10 21:31:14 2014 (r274358) +++ head/tools/tools/sysdoc/tunables.mdoc Mon Nov 10 23:10:01 2014 (r274359) @@ -1347,15 +1347,6 @@ See for more information. --- -net.inet.ip.sendsourcequench -bool - -This -.Nm -enables or disables the transmission of -source quench packets. - ---- net.inet.ip.sourceroute bool From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 23:17:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBE029BC; Mon, 10 Nov 2014 23:17:02 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6813FB8C; Mon, 10 Nov 2014 23:17:02 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id m15so10178613wgh.21 for ; Mon, 10 Nov 2014 15:17:00 -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:message-id:subject :from:to:cc:content-type; bh=Lpqtfu4rTyneUSTFvrLvTVsiuN4xj65NT18ES3cf9Ec=; b=befDMRlGwaeMP+XWknt+8AZdL28dclh7DAiL6GMEgimt/D2YfdKSSaE/1gqIOlVwBu 9n6p8u/p3IAuIaRt6BOHnTiomd2yVYJ6gl3vgW+B9QDbUoBAvwz1PoekTt9FCn3JwMU/ zfIStnoiE15XhrcIzpIJgqnh9Cz3Sr+fTGj//3ecZu2jzoB9P5B1j+aNW1nO5xIBJLJ2 P22mLKEDBkWZUFZxR69swW+MWUPF5Xlf5r9YwJ8JU11ezFa2OiIWIG6WQFgbMKg2bOg8 aRU04JumB7ESBKTNt5eqlY7uw8bI/qE/fwc2pSS06KfpMcsRWzhP9/dfk1NRGGCE3q5x mhlQ== MIME-Version: 1.0 X-Received: by 10.194.47.226 with SMTP id g2mr47452308wjn.68.1415661420728; Mon, 10 Nov 2014 15:17:00 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Mon, 10 Nov 2014 15:17:00 -0800 (PST) In-Reply-To: <3279406.bOBVrcribU@ralph.baldwin.cx> References: <201410181936.s9IJaCwu018930@svn.freebsd.org> <3279406.bOBVrcribU@ralph.baldwin.cx> Date: Mon, 10 Nov 2014 15:17:00 -0800 X-Google-Sender-Auth: xX73eUbZMniolgYkH4kKSJbUybM Message-ID: Subject: Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Luigi Rizzo , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 23:17:03 -0000 just double-check that the cpu id isn't used to size anything; I've seen it used as an offset into stuff, and NOCPU would've been entry 255 in the array, not -1. Ian pointed this out to me recently and I've only just started digging into it. -adrian On 10 November 2014 12:35, John Baldwin wrote: > On Monday, November 10, 2014 09:13:08 PM Dimitry Andric wrote: >> I noted something similar for kgdb, when compiled with gcc: >> >> cc1: warnings being treated as errors >> /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c: In function >> 'kgdb_trgt_fetch_tss': /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c:142: >> warning: comparison is always false due to limited range of data type >> >> In gnu/usr.bin/gdb/kgdb/kgdb.h, there is: >> >> struct kthr { >> struct kthr *next; >> uintptr_t paddr; >> uintptr_t kaddr; >> uintptr_t kstack; >> uintptr_t pcb; >> int tid; >> int pid; >> u_char cpu; >> }; >> >> The cpu field is assigned from td.td_oncpu (which is an int) in >> kgdb_thr_add_procs(), so I think it should be safe to change it to an >> int too: >> >> Index: gnu/usr.bin/gdb/kgdb/kgdb.h >> =================================================================== >> --- gnu/usr.bin/gdb/kgdb/kgdb.h (revision 274350) >> +++ gnu/usr.bin/gdb/kgdb/kgdb.h (working copy) >> @@ -41,7 +41,7 @@ >> uintptr_t pcb; >> int tid; >> int pid; >> - u_char cpu; >> + int cpu; >> }; >> >> extern struct kthr *curkthr; > > Yes, please commit. > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 10 23:56:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD9DB24B; Mon, 10 Nov 2014 23:56:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A886CF19; Mon, 10 Nov 2014 23:56:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAANu7Ud069421; Mon, 10 Nov 2014 23:56:07 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAANu6ov069409; Mon, 10 Nov 2014 23:56:06 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201411102356.sAANu6ov069409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Mon, 10 Nov 2014 23:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274360 - in stable/10/sys: dev/ixl modules/ixlv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 10 Nov 2014 23:56:07 -0000 Author: jfv Date: Mon Nov 10 23:56:06 2014 New Revision: 274360 URL: https://svnweb.freebsd.org/changeset/base/274360 Log: MFC Intel I40E drivers: r274205,r274218, and r274228 The MFC was pushed early as it fixes a panic in the exiting driver of 10.1 that Intel discovered in validation. Added: stable/10/sys/dev/ixl/ixlv_vc_mgr.h - copied unchanged from r274218, head/sys/dev/ixl/ixlv_vc_mgr.h Deleted: stable/10/sys/dev/ixl/i40e_register_x710_int.h Modified: stable/10/sys/dev/ixl/i40e_osdep.c stable/10/sys/dev/ixl/i40e_osdep.h stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/if_ixlv.c stable/10/sys/dev/ixl/ixl.h stable/10/sys/dev/ixl/ixl_txrx.c stable/10/sys/dev/ixl/ixlv.h stable/10/sys/dev/ixl/ixlvc.c stable/10/sys/modules/ixlv/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/i40e_osdep.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_osdep.c Mon Nov 10 23:10:01 2014 (r274359) +++ stable/10/sys/dev/ixl/i40e_osdep.c Mon Nov 10 23:56:06 2014 (r274360) @@ -107,6 +107,7 @@ i40e_allocate_dma_mem(struct i40e_hw *hw "error %u\n", err); goto fail_2; } + mem->nseg = 1; mem->size = size; bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); Modified: stable/10/sys/dev/ixl/i40e_osdep.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_osdep.h Mon Nov 10 23:10:01 2014 (r274359) +++ stable/10/sys/dev/ixl/i40e_osdep.h Mon Nov 10 23:56:06 2014 (r274360) @@ -147,11 +147,11 @@ void prefetch(void *x) #define prefetch(x) #endif -struct i40e_osdep -{ +struct i40e_osdep { bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; + uint32_t flush_reg; struct device *dev; }; @@ -208,6 +208,13 @@ wr32_osdep(struct i40e_osdep *osdep, uin osdep->mem_bus_space_handle, reg, value); } +static __inline void +ixl_flush_osdep(struct i40e_osdep *osdep) +{ + + rd32_osdep(osdep, osdep->flush_reg); +} + #define rd32(a, reg) rd32_osdep((a)->back, (reg)) #define wr32(a, reg, value) wr32_osdep((a)->back, (reg), (value)) @@ -221,9 +228,6 @@ wr32_osdep(struct i40e_osdep *osdep, uin ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ reg, value)) -#define ixl_flush(a) (\ - bus_space_read_4( ((struct i40e_osdep *)(a)->back)->mem_bus_space_tag, \ - ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ - I40E_GLGEN_STAT)) +#define ixl_flush(a) ixl_flush_osdep((a)->back) #endif /* _I40E_OSDEP_H_ */ Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Mon Nov 10 23:10:01 2014 (r274359) +++ stable/10/sys/dev/ixl/if_ixl.c Mon Nov 10 23:56:06 2014 (r274360) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.2.2"; +char ixl_driver_version[] = "1.2.8"; /********************************************************************* * PCI Device ID Table @@ -109,6 +109,7 @@ static bool ixl_config_link(struct i40e_ static void ixl_config_rss(struct ixl_vsi *); static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); +static int ixl_set_advertised_speeds(struct ixl_pf *, int); static void ixl_enable_rings(struct ixl_vsi *); static void ixl_disable_rings(struct ixl_vsi *); @@ -155,6 +156,7 @@ static void ixl_do_adminq(void *, int); static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); static int ixl_current_speed(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); /* Statistics */ static void ixl_add_hw_stats(struct ixl_pf *); @@ -176,7 +178,8 @@ static void ixl_stat_update32(struct i40 static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS); #endif @@ -276,6 +279,7 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif + static char *ixl_fc_string[6] = { "None", "Rx", @@ -398,6 +402,11 @@ ixl_attach(device_t dev) OID_AUTO, "current_speed", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_current_speed, "A", "Current Port Speed"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rx_itr", CTLFLAG_RW, @@ -436,8 +445,13 @@ ixl_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hw_res_info", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_hw_res_info, "A", "HW Resource Allocation"); + OID_AUTO, "hw_res_alloc", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_hw_res_alloc, "A", "HW Resource Allocation"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -445,7 +459,7 @@ ixl_attach(device_t dev) pf, 0, ixl_sysctl_dump_txd, "I", "Desc dump"); #endif - /* Save off the information about this board */ + /* Save off the PCI information */ hw->vendor_id = pci_get_vendor(dev); hw->device_id = pci_get_device(dev); hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); @@ -593,6 +607,7 @@ ixl_attach(device_t dev) bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); i40e_get_port_mac_addr(hw, hw->mac.port_addr); + /* Set up VSI and queues */ if (ixl_setup_stations(pf) != 0) { device_printf(dev, "setup stations failed!\n"); error = ENOMEM; @@ -630,8 +645,11 @@ ixl_attach(device_t dev) "an unqualified module was detected\n"); /* Setup OS specific network interface */ - if (ixl_setup_interface(dev, vsi) != 0) + if (ixl_setup_interface(dev, vsi) != 0) { + device_printf(dev, "interface setup failed!\n"); + error = EIO; goto err_late; + } /* Get the bus configuration and set the shared code */ bus = ixl_get_bus_info(hw, dev); @@ -642,25 +660,32 @@ ixl_attach(device_t dev) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* Reset port's advertised speeds */ + if (!i40e_is_40G_device(hw->device_id)) { + pf->advertised_speed = 0x7; + ixl_set_advertised_speeds(pf, 0x7); + } + /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); + INIT_DEBUGOUT("ixl_attach: end"); return (0); err_late: - ixl_free_vsi(vsi); + if (vsi->ifp != NULL) + if_free(vsi->ifp); err_mac_hmc: i40e_shutdown_lan_hmc(hw); err_get_cap: i40e_shutdown_adminq(hw); err_out: - if (vsi->ifp != NULL) - if_free(vsi->ifp); ixl_free_pci_resources(pf); + ixl_free_vsi(vsi); IXL_PF_LOCK_DESTROY(pf); return (error); } @@ -725,6 +750,7 @@ ixl_detach(device_t dev) ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); + ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -2177,6 +2203,7 @@ ixl_allocate_pci_resources(struct ixl_pf pf->osdep.mem_bus_space_handle = rman_get_bushandle(pf->pci_mem); pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); + pf->osdep.flush_reg = I40E_GLGEN_STAT; pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; pf->hw.back = &pf->osdep; @@ -2245,6 +2272,34 @@ early: return; } +static void +ixl_add_ifmedia(struct ixl_vsi *vsi, u32 phy_type) +{ + /* Display supported media types */ + if (phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); +} /********************************************************************* * @@ -2275,14 +2330,16 @@ ixl_setup_interface(device_t dev, struct ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixl_ioctl; +#if __FreeBSD_version >= 1100036 + if_setgetcounterfn(ifp, ixl_get_counter); +#endif + ifp->if_transmit = ixl_mq_start; ifp->if_qflush = ixl_qflush; ifp->if_snd.ifq_maxlen = que->num_desc - 2; - ether_ifattach(ifp, hw->mac.addr); - vsi->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; @@ -2323,40 +2380,26 @@ ixl_setup_interface(device_t dev, struct ixl_media_status); aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); - if (aq_error) { - printf("Error getting supported media types, AQ error %d\n", aq_error); - return (EPERM); - } - - /* Display supported media types */ - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) { + /* Need delay to detect fiber correctly */ + i40e_msec_delay(200); + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) + device_printf(dev, "Unknown PHY type detected!\n"); + else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); + } else if (aq_error) { + device_printf(dev, "Error getting supported media types, err %d," + " AQ error %d\n", aq_error, hw->aq.asq_last_status); + } else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); /* Use autoselect media by default */ ifmedia_add(&vsi->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&vsi->media, IFM_ETHER | IFM_AUTO); + ether_ifattach(ifp, hw->mac.addr); + return (0); } @@ -3700,7 +3743,6 @@ ixl_update_stats_counters(struct ixl_pf { struct i40e_hw *hw = &pf->hw; struct ixl_vsi *vsi = &pf->vsi; - struct ifnet *ifp = vsi->ifp; struct i40e_hw_port_stats *nsd = &pf->stats; struct i40e_hw_port_stats *osd = &pf->stats_offsets; @@ -3724,10 +3766,6 @@ ixl_update_stats_counters(struct ixl_pf pf->stat_offsets_loaded, &osd->eth.rx_discards, &nsd->eth.rx_discards); - ixl_stat_update32(hw, I40E_GLPRT_TDPC(hw->port), - pf->stat_offsets_loaded, - &osd->eth.tx_discards, - &nsd->eth.tx_discards); ixl_stat_update48(hw, I40E_GLPRT_UPRCH(hw->port), I40E_GLPRT_UPRCL(hw->port), pf->stat_offsets_loaded, @@ -3893,7 +3931,7 @@ ixl_update_stats_counters(struct ixl_pf /* OS statistics */ // ERJ - these are per-port, update all vsis? - ifp->if_ierrors = nsd->crc_errors + nsd->illegal_bytes; + IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes); } /* @@ -3911,8 +3949,8 @@ ixl_do_adminq(void *context, int pending u32 reg, loop = 0; u16 opcode, result; - event.msg_len = IXL_AQ_BUF_SZ; - event.msg_buf = malloc(event.msg_len, + event.buf_len = IXL_AQ_BUF_SZ; + event.msg_buf = malloc(event.buf_len, M_DEVBUF, M_NOWAIT | M_ZERO); if (!event.msg_buf) { printf("Unable to allocate adminq memory\n"); @@ -4027,13 +4065,16 @@ void ixl_update_eth_stats(struct ixl_vsi { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct i40e_hw *hw = &pf->hw; - struct ifnet *ifp = vsi->ifp; struct i40e_eth_stats *es; struct i40e_eth_stats *oes; + int i; + uint64_t tx_discards; + struct i40e_hw_port_stats *nsd; u16 stat_idx = vsi->info.stat_counter_idx; es = &vsi->eth_stats; oes = &vsi->eth_stats_offsets; + nsd = &pf->stats; /* Gather up the stats that the hw collects */ ixl_stat_update32(hw, I40E_GLV_TEPC(stat_idx), @@ -4078,22 +4119,27 @@ void ixl_update_eth_stats(struct ixl_vsi &oes->tx_broadcast, &es->tx_broadcast); vsi->stat_offsets_loaded = true; + tx_discards = es->tx_discards + nsd->tx_dropped_link_down; + for (i = 0; i < vsi->num_queues; i++) + tx_discards += vsi->queues[i].txr.br->br_drops; + /* Update ifnet stats */ - ifp->if_ipackets = es->rx_unicast + + IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + - es->rx_broadcast; - ifp->if_opackets = es->tx_unicast + + es->rx_broadcast); + IXL_SET_OPACKETS(vsi, es->tx_unicast + es->tx_multicast + - es->tx_broadcast; - ifp->if_ibytes = es->rx_bytes; - ifp->if_obytes = es->tx_bytes; - ifp->if_imcasts = es->rx_multicast; - ifp->if_omcasts = es->tx_multicast; - - ifp->if_oerrors = es->tx_errors; - ifp->if_iqdrops = es->rx_discards; - ifp->if_noproto = es->rx_unknown_protocol; - ifp->if_collisions = 0; + es->tx_broadcast); + IXL_SET_IBYTES(vsi, es->rx_bytes); + IXL_SET_OBYTES(vsi, es->tx_bytes); + IXL_SET_IMCASTS(vsi, es->rx_multicast); + IXL_SET_OMCASTS(vsi, es->tx_multicast); + + IXL_SET_OERRORS(vsi, es->tx_errors); + IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); + IXL_SET_OQDROPS(vsi, tx_discards); + IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); + IXL_SET_COLLISIONS(vsi, 0); } /** @@ -4288,6 +4334,52 @@ ixl_current_speed(SYSCTL_HANDLER_ARGS) return (error); } +static int +ixl_set_advertised_speeds(struct ixl_pf *pf, int speeds) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + /* Prepare new config */ + bzero(&config, sizeof(config)); + config.phy_type = abilities.phy_type; + config.abilities = abilities.abilities + | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + /* Translate into aq cmd link_speed */ + if (speeds & 0x4) + config.link_speed |= I40E_LINK_SPEED_10GB; + if (speeds & 0x2) + config.link_speed |= I40E_LINK_SPEED_1GB; + if (speeds & 0x1) + config.link_speed |= I40E_LINK_SPEED_100MB; + + /* Do aq command & restart link */ + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + return (0); +} + /* ** Control link advertise speed: ** Flags: @@ -4303,10 +4395,7 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - struct i40e_aq_get_phy_abilities_resp abilities; - struct i40e_aq_set_phy_config config; int requested_ls = 0; - enum i40e_status_code aq_error = 0; int error = 0; /* @@ -4331,39 +4420,9 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) if (pf->advertised_speed == requested_ls) return (0); - /* Get current capability information */ - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); - if (aq_error) { - device_printf(dev, "%s: Error getting phy capabilities %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } - - /* Prepare new config */ - bzero(&config, sizeof(config)); - config.phy_type = abilities.phy_type; - config.abilities = abilities.abilities - | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; - config.eee_capability = abilities.eee_capability; - config.eeer = abilities.eeer_val; - config.low_power_ctrl = abilities.d3_lpan; - /* Translate into aq cmd link_speed */ - if (requested_ls & 0x4) - config.link_speed |= I40E_LINK_SPEED_10GB; - if (requested_ls & 0x2) - config.link_speed |= I40E_LINK_SPEED_1GB; - if (requested_ls & 0x1) - config.link_speed |= I40E_LINK_SPEED_100MB; - - /* Do aq command & restart link */ - aq_error = i40e_aq_set_phy_config(hw, &config, NULL); - if (aq_error) { - device_printf(dev, "%s: Error setting new phy config %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } + error = ixl_set_advertised_speeds(pf, requested_ls); + if (error) + return (error); pf->advertised_speed = requested_ls; ixl_update_link_status(pf); @@ -4442,6 +4501,26 @@ ixl_get_bus_info(struct i40e_hw *hw, dev return (link); } +static int +ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + char buf[32]; + + snprintf(buf, sizeof(buf), + "f%d.%d a%d.%d n%02x.%02x e%08x", + hw->aq.fw_maj_ver, hw->aq.fw_min_ver, + hw->aq.api_maj_ver, hw->aq.api_min_ver, + (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >> + IXL_NVM_VERSION_HI_SHIFT, + (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >> + IXL_NVM_VERSION_LO_SHIFT, + hw->nvm.eetrack); + return (sysctl_handle_string(oidp, buf, strlen(buf), req)); +} + + #ifdef IXL_DEBUG static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS) @@ -4551,7 +4630,7 @@ ixl_sysctl_sw_filter_list(SYSCTL_HANDLER #define IXL_SW_RES_SIZE 0x14 static int -ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS) +ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; @@ -4608,7 +4687,120 @@ ixl_sysctl_hw_res_info(SYSCTL_HANDLER_AR device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return error; +} +/* +** Caller must init and delete sbuf; this function will clear and +** finish it for caller. +*/ +static char * +ixl_switch_element_string(struct sbuf *s, u16 seid, bool uplink) +{ + sbuf_clear(s); + + if (seid == 0 && uplink) + sbuf_cat(s, "Network"); + else if (seid == 0) + sbuf_cat(s, "Host"); + else if (seid == 1) + sbuf_cat(s, "EMP"); + else if (seid <= 5) + sbuf_printf(s, "MAC %d", seid - 2); + else if (seid <= 15) + sbuf_cat(s, "Reserved"); + else if (seid <= 31) + sbuf_printf(s, "PF %d", seid - 16); + else if (seid <= 159) + sbuf_printf(s, "VF %d", seid - 32); + else if (seid <= 287) + sbuf_cat(s, "Reserved"); + else if (seid <= 511) + sbuf_cat(s, "Other"); // for other structures + else if (seid <= 895) + sbuf_printf(s, "VSI %d", seid - 512); + else if (seid <= 1023) + sbuf_printf(s, "Reserved"); + else + sbuf_cat(s, "Invalid"); + + sbuf_finish(s); + return sbuf_data(s); +} + +static int +ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct sbuf *buf; + struct sbuf *nmbuf; + int error = 0; + u8 aq_buf[I40E_AQ_LARGE_BUF]; + + u16 next = 0; + struct i40e_aqc_get_switch_config_resp *sw_config; + sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; + + buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for sysctl output.\n"); + return (ENOMEM); + } + + error = i40e_aq_get_switch_config(hw, sw_config, + sizeof(aq_buf), &next, NULL); + if (error) { + device_printf(dev, "%s: aq_get_switch_config() error %d, aq error %d\n", + __func__, error, hw->aq.asq_last_status); + sbuf_delete(buf); + return error; + } + + nmbuf = sbuf_new_auto(); + if (!nmbuf) { + device_printf(dev, "Could not allocate sbuf for name output.\n"); + return (ENOMEM); + } + + sbuf_cat(buf, "\n"); + // Assuming <= 255 elements in switch + sbuf_printf(buf, "# of elements: %d\n", sw_config->header.num_reported); + /* Exclude: + ** Revision -- all elements are revision 1 for now + */ + sbuf_printf(buf, + "SEID ( Name ) | Uplink | Downlink | Conn Type\n" + " | | | (uplink)\n"); + for (int i = 0; i < sw_config->header.num_reported; i++) { + // "%4d (%8s) | %8s %8s %#8x", + sbuf_printf(buf, "%4d", sw_config->element[i].seid); + sbuf_cat(buf, " "); + sbuf_printf(buf, "(%8s)", ixl_switch_element_string(nmbuf, sw_config->element[i].seid, false)); + sbuf_cat(buf, " | "); + sbuf_printf(buf, "%8s", ixl_switch_element_string(nmbuf, sw_config->element[i].uplink_seid, true)); + sbuf_cat(buf, " "); + sbuf_printf(buf, "%8s", ixl_switch_element_string(nmbuf, sw_config->element[i].downlink_seid, false)); + sbuf_cat(buf, " "); + sbuf_printf(buf, "%#8x", sw_config->element[i].connection_type); + if (i < sw_config->header.num_reported - 1) + sbuf_cat(buf, "\n"); + } + sbuf_delete(nmbuf); + + error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + sbuf_delete(buf); + return error; + } + + error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); + if (error) + device_printf(dev, "sysctl error: %d\n", error); + sbuf_delete(buf); + + return (error); } /* Modified: stable/10/sys/dev/ixl/if_ixlv.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixlv.c Mon Nov 10 23:10:01 2014 (r274359) +++ stable/10/sys/dev/ixl/if_ixlv.c Mon Nov 10 23:56:06 2014 (r274360) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixlv_driver_version[] = "1.1.4"; +char ixlv_driver_version[] = "1.1.18"; /********************************************************************* * PCI Device ID Table @@ -87,7 +87,6 @@ static void ixlv_config_rss(struct ixlv_ static void ixlv_stop(struct ixlv_sc *); static void ixlv_add_multi(struct ixl_vsi *); static void ixlv_del_multi(struct ixl_vsi *); -static void ixlv_update_link_status(struct ixlv_sc *); static void ixlv_free_queues(struct ixl_vsi *); static int ixlv_setup_interface(device_t, struct ixlv_sc *); @@ -97,18 +96,21 @@ static void ixlv_media_status(struct ifn static void ixlv_local_timer(void *); static int ixlv_add_mac_filter(struct ixlv_sc *, u8 *, u16); +static int ixlv_del_mac_filter(struct ixlv_sc *sc, u8 *macaddr); static void ixlv_init_filters(struct ixlv_sc *); static void ixlv_free_filters(struct ixlv_sc *); static void ixlv_msix_que(void *); static void ixlv_msix_adminq(void *); static void ixlv_do_adminq(void *, int); -static void ixlv_sched_aq(void *); +static void ixlv_do_adminq_locked(struct ixlv_sc *sc); static void ixlv_handle_que(void *, int); static int ixlv_reset(struct ixlv_sc *); static int ixlv_reset_complete(struct i40e_hw *); static void ixlv_set_queue_rx_itr(struct ixl_queue *); static void ixlv_set_queue_tx_itr(struct ixl_queue *); +static void ixl_init_cmd_complete(struct ixl_vc_cmd *, void *, + enum i40e_status_code); static void ixlv_enable_adminq_irq(struct i40e_hw *); static void ixlv_disable_adminq_irq(struct i40e_hw *); @@ -119,10 +121,16 @@ static void ixlv_setup_vlan_filters(stru static void ixlv_register_vlan(void *, struct ifnet *, u16); static void ixlv_unregister_vlan(void *, struct ifnet *, u16); +static void ixlv_init_hw(struct ixlv_sc *); +static int ixlv_setup_vc(struct ixlv_sc *); +static int ixlv_vf_config(struct ixlv_sc *); + static void ixlv_cap_txcsum_tso(struct ixl_vsi *, struct ifnet *, int); -static void ixlv_add_stats_sysctls(struct ixlv_sc *); +static void ixlv_add_sysctls(struct ixlv_sc *); +static int ixlv_sysctl_qtx_tail_handler(SYSCTL_HANDLER_ARGS); +static int ixlv_sysctl_qrx_tail_handler(SYSCTL_HANDLER_ARGS); /********************************************************************* * FreeBSD Device Interface Entry Points @@ -271,7 +279,7 @@ ixlv_attach(device_t dev) struct ixlv_sc *sc; struct i40e_hw *hw; struct ixl_vsi *vsi; - int bufsz, error = 0, retries = 0; + int error = 0; INIT_DBG_DEV(dev, "begin"); @@ -282,30 +290,18 @@ ixlv_attach(device_t dev) vsi = &sc->vsi; vsi->dev = dev; + /* Initialize hw struct */ + ixlv_init_hw(sc); + /* Allocate filter lists */ ixlv_init_filters(sc); /* Core Lock Init*/ mtx_init(&sc->mtx, device_get_nameunit(dev), "IXL SC Lock", MTX_DEF); - mtx_init(&sc->aq_task_mtx, device_get_nameunit(dev), - "IXL AQ Task Lock", MTX_DEF); - /* Set up the timer & aq watchdog callouts */ + /* Set up the timer callout */ callout_init_mtx(&sc->timer, &sc->mtx, 0); - callout_init_mtx(&sc->aq_task, &sc->aq_task_mtx, 0); - - /* Save off the information about this board */ - hw->vendor_id = pci_get_vendor(dev); - hw->device_id = pci_get_device(dev); - hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); - hw->subsystem_vendor_id = - pci_read_config(dev, PCIR_SUBVEND_0, 2); - hw->subsystem_device_id = - pci_read_config(dev, PCIR_SUBDEV_0, 2); - - hw->bus.device = pci_get_slot(dev); - hw->bus.func = pci_get_function(dev); /* Do PCI setup - map BAR0, etc */ if (ixlv_allocate_pci_resources(sc)) { @@ -333,50 +329,16 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "VF Device is ready for configuration"); - hw->aq.num_arq_entries = IXL_AQ_LEN; - hw->aq.num_asq_entries = IXL_AQ_LEN; - hw->aq.arq_buf_size = IXL_AQ_BUFSZ; - hw->aq.asq_buf_size = IXL_AQ_BUFSZ; - - error = i40e_init_adminq(hw); + error = ixlv_setup_vc(sc); if (error) { - device_printf(dev, "%s: init_adminq failed: %d\n", + device_printf(dev, "%s: Error setting up PF comms, %d\n", __func__, error); goto err_pci_res; } - INIT_DBG_DEV(dev, "Initialized Admin Queue"); - - error = ixlv_send_api_ver(sc); - if (error) { - device_printf(dev, "%s: unable to send to PF (%d)\n", - __func__, error); - goto err_aq; - } - - while (!i40e_asq_done(hw)) { - if (++retries > IXLV_AQ_MAX_ERR) { - device_printf(dev, "%s: Admin Queue timeout " - "(waiting for send_api_ver)\n", __func__); - error = ENXIO; - goto err_aq; - } - i40e_msec_delay(10); - } - - INIT_DBG_DEV(dev, "Sent API version message to PF"); - - /* Wait for API version msg to arrive */ - error = ixlv_verify_api_ver(sc); - if (error) { - device_printf(dev, - "%s: Unable to verify API version, error %d\n", - __func__, error); - goto err_aq; - } - INIT_DBG_DEV(dev, "PF API version verified"); + /* TODO: Figure out why MDD events occur when this reset is removed. */ /* Need API version before sending reset message */ error = ixlv_reset(sc); if (error) { @@ -387,49 +349,14 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "VF reset complete"); /* Ask for VF config from PF */ - error = ixlv_send_vf_config_msg(sc); + error = ixlv_vf_config(sc); if (error) { - device_printf(dev, - "%s: Unable to send VF config request, error %d\n", - __func__, error); - goto err_aq; - } - - retries = 0; - while (!i40e_asq_done(hw)) { - if (++retries > IXLV_AQ_MAX_ERR) { - device_printf(dev, "%s: Admin Queue timeout " - "(waiting for send_vf_config_msg)\n", __func__); - error = ENXIO; - goto err_aq; - } - i40e_msec_delay(10); - } - - INIT_DBG_DEV(dev, "Sent VF config message to PF"); - - bufsz = sizeof(struct i40e_virtchnl_vf_resource) + - (I40E_MAX_VF_VSI * sizeof(struct i40e_virtchnl_vsi_resource)); - sc->vf_res = malloc(bufsz, M_DEVBUF, M_NOWAIT); - if (!sc->vf_res) { - device_printf(dev, - "%s: Unable to allocate memory for VF configuration" - " message from PF\n", __func__); - error = ENOMEM; + device_printf(dev, "Error getting configuration from PF: %d\n", + error); goto err_aq; } - /* Check for VF config response */ - error = ixlv_get_vf_config(sc); - if (error) { - device_printf(dev, - "%s: Unable to get VF configuration from PF\n", - __func__); - error = EBUSY; - goto err_res_buf; - } - - INIT_DBG_DEV(dev, "Received valid VF config from PF"); + INIT_DBG_DEV(dev, "VF config from PF:"); INIT_DBG_DEV(dev, "VSIs %d, Queues %d, Max Vectors %d, Max MTU %d", sc->vf_res->num_vsis, sc->vf_res->num_queue_pairs, @@ -438,6 +365,7 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "Offload flags: %#010x", sc->vf_res->vf_offload_flags); + // TODO: Move this into ixlv_vf_config? /* got VF config message back from PF, now we can parse it */ for (int i = 0; i < sc->vf_res->num_vsis; i++) { if (sc->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV) @@ -445,6 +373,7 @@ ixlv_attach(device_t dev) } if (!sc->vsi_res) { device_printf(dev, "%s: no LAN VSI found\n", __func__); + error = EIO; goto err_res_buf; } @@ -461,14 +390,13 @@ ixlv_attach(device_t dev) vsi->id = sc->vsi_res->vsi_id; vsi->back = (void *)sc; - - /* Link in this virtual environment is always 'up' */ vsi->link_up = TRUE; /* This allocates the memory and early settings */ if (ixlv_setup_queues(sc) != 0) { device_printf(dev, "%s: setup queues failed!\n", __func__); + error = EIO; goto out; } @@ -476,6 +404,7 @@ ixlv_attach(device_t dev) if (ixlv_setup_interface(dev, sc) != 0) { device_printf(dev, "%s: setup interface failed!\n", __func__); + error = EIO; goto out; } @@ -487,12 +416,9 @@ ixlv_attach(device_t dev) /* Start AdminQ taskqueue */ ixlv_init_taskqueue(sc); - /* Start the admin queue scheduler timer */ - callout_reset(&sc->aq_task, 2 * hz, ixlv_sched_aq, sc); - /* Initialize stats */ bzero(&sc->vsi.eth_stats, sizeof(struct i40e_eth_stats)); - ixlv_add_stats_sysctls(sc); + ixlv_add_sysctls(sc); /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, @@ -504,10 +430,10 @@ ixlv_attach(device_t dev) ixlv_enable_adminq_irq(hw); /* Set things up to run init */ - sc->aq_pending = 0; - sc->aq_required = 0; sc->init_state = IXLV_INIT_READY; + ixl_vc_init_mgr(sc, &sc->vc_mgr); + INIT_DBG_DEV(dev, "end"); return (error); @@ -521,7 +447,6 @@ err_pci_res: ixlv_free_pci_resources(sc); err_early: mtx_destroy(&sc->mtx); - mtx_destroy(&sc->aq_task_mtx); ixlv_free_filters(sc); INIT_DBG_DEV(dev, "end: error %d", error); return (error); @@ -542,7 +467,6 @@ ixlv_detach(device_t dev) { struct ixlv_sc *sc = device_get_softc(dev); struct ixl_vsi *vsi = &sc->vsi; - int retries = 0; INIT_DBG_DEV(dev, "begin"); @@ -554,23 +478,11 @@ ixlv_detach(device_t dev) } /* Stop driver */ + ether_ifdetach(vsi->ifp); if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { mtx_lock(&sc->mtx); ixlv_stop(sc); mtx_unlock(&sc->mtx); - - /* - ** Ensure queues are disabled before examining - ** admin queue state later in detach. - */ - while (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING - && ++retries < IXLV_AQ_MAX_ERR) { - i40e_msec_delay(10); - } -#ifdef IXL_DEBUG - if (retries >= IXLV_AQ_MAX_ERR) - device_printf(dev, "Issue disabling queues for detach\n"); -#endif } /* Unregister VLAN events */ @@ -579,37 +491,16 @@ ixlv_detach(device_t dev) if (vsi->vlan_detach != NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 00:10:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78D7863E; Tue, 11 Nov 2014 00:10:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65D22125; Tue, 11 Nov 2014 00:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB0Ajbb078300; Tue, 11 Nov 2014 00:10:45 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB0Ajqs078299; Tue, 11 Nov 2014 00:10:45 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411110010.sAB0Ajqs078299@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 11 Nov 2014 00:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274361 - head/sys/dev/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 00:10:45 -0000 Author: luigi Date: Tue Nov 11 00:10:44 2014 New Revision: 274361 URL: https://svnweb.freebsd.org/changeset/base/274361 Log: - fix typo: use ring size from the rx ring, not the tx one (they should be the same, but just in case); - reuse the previously computed len-1 value Modified: head/sys/dev/netmap/netmap_pipe.c Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Mon Nov 10 23:56:06 2014 (r274360) +++ head/sys/dev/netmap/netmap_pipe.c Tue Nov 11 00:10:44 2014 (r274361) @@ -197,10 +197,10 @@ netmap_pipe_txsync(struct netmap_kring * if (m < 0) m += txkring->nkr_num_slots; limit = m; - m = rxkring->nkr_num_slots - 1; /* max avail space on destination */ + m = lim_rx; /* max avail space on destination */ busy = j - rxkring->nr_hwcur; /* busy slots */ if (busy < 0) - busy += txkring->nkr_num_slots; + busy += rxkring->nkr_num_slots; m -= busy; /* subtract busy slots */ ND(2, "m %d limit %d", m, limit); if (m < limit) From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 00:13:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBCD6805; Tue, 11 Nov 2014 00:13:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACDCD146; Tue, 11 Nov 2014 00:13:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB0DSZg081240; Tue, 11 Nov 2014 00:13:28 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB0DSXV081239; Tue, 11 Nov 2014 00:13:28 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411110013.sAB0DSXV081239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 11 Nov 2014 00:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274362 - head/sys/dev/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 00:13:29 -0000 Author: luigi Date: Tue Nov 11 00:13:28 2014 New Revision: 274362 URL: https://svnweb.freebsd.org/changeset/base/274362 Log: in the Linux section, properly define the NMG_LOCK type. Also import WITH_GENERIC in preparation to adding fine-grained options to disable specific netmap components. Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Tue Nov 11 00:10:44 2014 (r274361) +++ head/sys/dev/netmap/netmap_kern.h Tue Nov 11 00:13:28 2014 (r274362) @@ -37,6 +37,7 @@ #define WITH_VALE // comment out to disable VALE support #define WITH_PIPES #define WITH_MONITOR +#define WITH_GENERIC #if defined(__FreeBSD__) @@ -44,6 +45,8 @@ #define unlikely(x) __builtin_expect((long)!!(x), 0L) #define NM_LOCK_T struct mtx + +/* netmap global lock */ #define NMG_LOCK_T struct sx #define NMG_LOCK_INIT() sx_init(&netmap_global_lock, \ "netmap global lock") @@ -107,13 +110,20 @@ struct hrtimer { #define NM_ATOMIC_T volatile long unsigned int -// XXX a mtx would suffice here too 20130404 gl -#define NMG_LOCK_T struct semaphore -#define NMG_LOCK_INIT() sema_init(&netmap_global_lock, 1) -#define NMG_LOCK_DESTROY() -#define NMG_LOCK() down(&netmap_global_lock) -#define NMG_UNLOCK() up(&netmap_global_lock) -#define NMG_LOCK_ASSERT() // XXX to be completed +#define NM_MTX_T struct mutex +#define NM_MTX_INIT(m, s) do { (void)s; mutex_init(&(m)); } while (0) +#define NM_MTX_DESTROY(m) do { (void)m; } while (0) +#define NM_MTX_LOCK(m) mutex_lock(&(m)) +#define NM_MTX_UNLOCK(m) mutex_unlock(&(m)) +#define NM_MTX_LOCK_ASSERT(m) mutex_is_locked(&(m)) + +#define NMG_LOCK_T NM_MTX_T +#define NMG_LOCK_INIT() NM_MTX_INIT(netmap_global_lock, \ + "netmap_global_lock") +#define NMG_LOCK_DESTROY() NM_MTX_DESTROY(netmap_global_lock) +#define NMG_LOCK() NM_MTX_LOCK(netmap_global_lock) +#define NMG_UNLOCK() NM_MTX_UNLOCK(netmap_global_lock) +#define NMG_LOCK_ASSERT() NM_MTX_LOCK_ASSERT(netmap_global_lock) #ifndef DEV_NETMAP #define DEV_NETMAP @@ -641,6 +651,7 @@ struct netmap_hw_adapter { /* physical d int (*nm_hw_register)(struct netmap_adapter *, int onoff); }; +#ifdef WITH_GENERIC /* Mitigation support. */ struct nm_generic_mit { struct hrtimer mit_timer; @@ -668,6 +679,7 @@ struct netmap_generic_adapter { /* emula netdev_tx_t (*save_start_xmit)(struct mbuf *, struct ifnet *); #endif }; +#endif /* WITH_GENERIC */ static __inline int netmap_real_tx_rings(struct netmap_adapter *na) @@ -1481,6 +1493,7 @@ struct netmap_monitor_adapter { #endif /* WITH_MONITOR */ +#ifdef WITH_GENERIC /* * generic netmap emulation for devices that do not have * native netmap support. @@ -1512,6 +1525,7 @@ void netmap_mitigation_start(struct nm_g void netmap_mitigation_restart(struct nm_generic_mit *mit); int netmap_mitigation_active(struct nm_generic_mit *mit); void netmap_mitigation_cleanup(struct nm_generic_mit *mit); +#endif /* WITH_GENERIC */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 02:52:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7736F9B7; Tue, 11 Nov 2014 02:52:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60E4C1E2; Tue, 11 Nov 2014 02:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB2qiak068200; Tue, 11 Nov 2014 02:52:44 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB2qeYj068176; Tue, 11 Nov 2014 02:52:40 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411110252.sAB2qeYj068176@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 11 Nov 2014 02:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274363 - in head: sbin/route share/man/man4 share/man/man7 sys/netinet sys/netinet6 tools/tools/sysdoc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 02:52:44 -0000 Author: melifaro Date: Tue Nov 11 02:52:40 2014 New Revision: 274363 URL: https://svnweb.freebsd.org/changeset/base/274363 Log: Kill custom in_matroute() radix mathing function removing one rte mutex lock. Initially in_matrote() in_clsroute() in their current state was introduced by r4105 20 years ago. Instead of deleting inactive routes immediately, we kept them in route table, setting RTPRF_OURS flag and some expire time. After that, either GC came or RTPRF_OURS got removed on first-packet. It was a good solution in that days (and probably another decade after that) to keep TCP metrics. However, after moving metrics to TCP hostcache in r122922, most of in_rmx functionality became unused. It might had been used for flushing icmp-originated routes before rte mutexes/refcounting, but I'm not sure about that. So it looks like this is nearly impossible to make GC do its work nowadays: in_rtkill() ignores non-RTPRF_OURS routes. route can only become RTPRF_OURS after dropping last reference via rtfree() which calls in_clsroute(), which, it turn, ignores UP and non-RTF_DYNAMIC routes. Dynamic routes can still be installed via received redirect, but they have default lifetime (no specific rt_expire) and no one has another trie walker to call RTFREE() on them. So, the changelist: * remove custom rnh_match / rnh_close matching function. * remove all GC functions * partially revert r256695 (proto3 is no more used inside kernel, it is not possible to use rt_expire from user point of view, proto3 support is not complete) * Finish r241884 (similar to this commit) and remove remaining IPv6 parts MFC after: 1 month Modified: head/sbin/route/keywords head/sbin/route/route.8 head/sbin/route/route.c head/share/man/man4/inet.4 head/share/man/man4/inet6.4 head/share/man/man7/security.7 head/sys/netinet/in.h head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet6/in6.h head/sys/netinet6/in6_rmx.c head/tools/tools/sysdoc/tunables.mdoc Modified: head/sbin/route/keywords ============================================================================== --- head/sbin/route/keywords Tue Nov 11 00:13:28 2014 (r274362) +++ head/sbin/route/keywords Tue Nov 11 02:52:40 2014 (r274363) @@ -40,7 +40,6 @@ osi prefixlen proto1 proto2 -proto3 proxy recvpipe reject Modified: head/sbin/route/route.8 ============================================================================== --- head/sbin/route/route.8 Tue Nov 11 00:13:28 2014 (r274362) +++ head/sbin/route/route.8 Tue Nov 11 02:52:40 2014 (r274363) @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd January 11, 2014 +.Dd November 11, 2014 .Dt ROUTE 8 .Os .Sh NAME @@ -315,7 +315,6 @@ by indicating the following correspondin -blackhole RTF_BLACKHOLE - silently discard pkts (during updates) -proto1 RTF_PROTO1 - set protocol specific routing flag #1 -proto2 RTF_PROTO2 - set protocol specific routing flag #2 --proto3 RTF_PROTO3 - set protocol specific routing flag #3 .Ed .Pp The optional modifiers Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Tue Nov 11 00:13:28 2014 (r274362) +++ head/sbin/route/route.c Tue Nov 11 02:52:40 2014 (r274363) @@ -847,9 +847,6 @@ newroute(int argc, char **argv) case K_PROTO2: flags |= RTF_PROTO2; break; - case K_PROTO3: - flags |= RTF_PROTO3; - break; case K_PROXY: nrflags |= F_PROXY; break; Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Tue Nov 11 00:13:28 2014 (r274362) +++ head/share/man/man4/inet.4 Tue Nov 11 02:52:40 2014 (r274363) @@ -211,21 +211,6 @@ Boolean: enable/disable accepting of sou .It Dv IPCTL_SOURCEROUTE .Pq ip.sourceroute Boolean: enable/disable forwarding of source-routed IP packets (default false). -.It Dv IPCTL_RTEXPIRE -.Pq ip.rtexpire -Integer: lifetime in seconds of protocol-cloned -.Tn IP -routes after the last reference drops (default one hour). -This value varies dynamically as described above. -.It Dv IPCTL_RTMINEXPIRE -.Pq ip.rtminexpire -Integer: minimum value of ip.rtexpire (default ten seconds). -This value has no effect on user modifications, but restricts the dynamic -adaptation described above. -.It Dv IPCTL_RTMAXCACHE -.Pq ip.rtmaxcache -Integer: trigger level of cached, unreferenced, protocol-cloned routes -which initiates dynamic adaptation (default 128). .It Va ip.process_options Integer: control IP options processing. By setting this variable to 0, all IP options in the incoming packets Modified: head/share/man/man4/inet6.4 ============================================================================== --- head/share/man/man4/inet6.4 Tue Nov 11 00:13:28 2014 (r274362) +++ head/share/man/man4/inet6.4 Tue Nov 11 02:52:40 2014 (r274363) @@ -312,21 +312,6 @@ mapped address on .Dv AF_INET6 sockets. Defaults to on. -.It Dv IPV6CTL_RTEXPIRE -.Pq ip6.rtexpire -Integer: lifetime in seconds of protocol-cloned -.Tn IP -routes after the last reference drops (default one hour). -.\"This value varies dynamically as described above. -.It Dv IPV6CTL_RTMINEXPIRE -.Pq ip6.rtminexpire -Integer: minimum value of ip.rtexpire (default ten seconds). -.\"This value has no effect on user modifications, but restricts the dynamic -.\"adaptation described above. -.It Dv IPV6CTL_RTMAXCACHE -.Pq ip6.rtmaxcache -Integer: trigger level of cached, unreferenced, protocol-cloned routes -which initiates dynamic adaptation (default 128). .El .Ss Interaction between IPv4/v6 sockets By default, Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Tue Nov 11 00:13:28 2014 (r274362) +++ head/share/man/man7/security.7 Tue Nov 11 02:52:40 2014 (r274363) @@ -894,41 +894,6 @@ A competent sysadmin will turn off all of these .Xr inetd 8 Ns -internal test services. -.Pp -Spoofed packet attacks may also be used to overload the kernel route cache. -Refer to the -.Va net.inet.ip.rtexpire , net.inet.ip.rtminexpire , -and -.Va net.inet.ip.rtmaxcache -.Xr sysctl 8 -variables. -A spoofed packet attack that uses a random source IP will cause -the kernel to generate a temporary cached route in the route table, viewable -with -.Dq Li "netstat -rna | fgrep W3" . -These routes typically timeout in 1600 -seconds or so. -If the kernel detects that the cached route table has gotten -too big it will dynamically reduce the -.Va rtexpire -but will never decrease it to -less than -.Va rtminexpire . -There are two problems: (1) The kernel does not react -quickly enough when a lightly loaded server is suddenly attacked, and (2) The -.Va rtminexpire -is not low enough for the kernel to survive a sustained attack. -If your servers are connected to the internet via a T3 or better it may be -prudent to manually override both -.Va rtexpire -and -.Va rtminexpire -via -.Xr sysctl 8 . -Never set either parameter to zero -(unless you want to crash the machine :-)). -Setting both parameters to 2 seconds should be sufficient to protect the route -table from attack. .Sh ACCESS ISSUES WITH KERBEROS AND SSH There are a few issues with both Kerberos and SSH that need to be addressed if you intend to use them. Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet/in.h Tue Nov 11 02:52:40 2014 (r274363) @@ -619,9 +619,9 @@ int getsourcefilter(int, uint32_t, struc #ifdef notyet #define IPCTL_DEFMTU 4 /* default MTU */ #endif -#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ -#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ -#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ +/* IPCTL_RTEXPIRE 5 deprecated */ +/* IPCTL_RTMINEXPIRE 6 deprecated */ +/* IPCTL_RTMAXCACHE 7 deprecated */ #define IPCTL_SOURCEROUTE 8 /* may perform source routes */ #define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ #define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet/in_rmx.c Tue Nov 11 02:52:40 2014 (r274363) @@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include @@ -55,8 +53,6 @@ extern int in_inithead(void **head, int extern int in_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. */ @@ -110,238 +106,6 @@ in_addroute(void *v_arg, void *n_arg, st return (rn_addroute(v_arg, n_arg, head, treenodes)); } -/* - * This code is the inverse of in_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 * -in_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_expire = 0; - } - RT_UNLOCK(rt); - } - return rn; -} - -static VNET_DEFINE(int, rtq_reallyold) = 60*60; /* one hour is "really old" */ -#define V_rtq_reallyold VNET(rtq_reallyold) -SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(rtq_reallyold), 0, - "Default expiration time on dynamically learned routes"); - -/* never automatically crank down to less */ -static VNET_DEFINE(int, rtq_minreallyold) = 10; -#define V_rtq_minreallyold VNET(rtq_minreallyold) -SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(rtq_minreallyold), 0, - "Minimum time to attempt to hold onto dynamically learned routes"); - -/* 128 cached routes is "too many" */ -static VNET_DEFINE(int, rtq_toomany) = 128; -#define V_rtq_toomany VNET(rtq_toomany) -SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(rtq_toomany), 0, - "Upper limit on dynamically learned routes"); - -/* - * On last reference drop, mark the route as belong to us so that it can be - * timed out. - */ -static void -in_clsroute(struct radix_node *rn, struct radix_node_head *head) -{ - struct rtentry *rt = (struct rtentry *)rn; - - RT_LOCK_ASSERT(rt); - - if (!(rt->rt_flags & RTF_UP)) - return; /* prophylactic measures */ - - if (rt->rt_flags & RTPRF_OURS) - return; - - if (!(rt->rt_flags & RTF_DYNAMIC)) - return; - - /* - * If rtq_reallyold is 0, just delete the route without - * waiting for a timeout cycle to kill it. - */ - if (V_rtq_reallyold != 0) { - rt->rt_flags |= RTPRF_OURS; - rt->rt_expire = time_uptime + V_rtq_reallyold; - } else - rt_expunge(head, rt); -} - -struct rtqk_arg { - struct radix_node_head *rnh; - int draining; - int killed; - int found; - int updating; - time_t nextstop; -}; - -/* - * 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_reallyold. - */ -static int -in_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_expire <= time_uptime) { - if (rt->rt_refcnt > 0) - panic("rtqkill route really not free"); - - err = in_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, "in_rtqkill: error %d\n", err); - } else { - ap->killed++; - } - } else { - if (ap->updating && - (rt->rt_expire - time_uptime > V_rtq_reallyold)) - rt->rt_expire = time_uptime + V_rtq_reallyold; - ap->nextstop = lmin(ap->nextstop, rt->rt_expire); - } - } - - return 0; -} - -#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout) = RTQ_TIMEOUT; -static VNET_DEFINE(struct callout, rtq_timer); - -#define V_rtq_timeout VNET(rtq_timeout) -#define V_rtq_timer VNET(rtq_timer) - -static void in_rtqtimo_one(void *rock); - -static void -in_rtqtimo(void *rock) -{ - CURVNET_SET((struct vnet *) rock); - int fibnum; - void *newrock; - struct timeval atv; - - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - newrock = rt_tables_get_rnh(fibnum, AF_INET); - if (newrock != NULL) - in_rtqtimo_one(newrock); - } - atv.tv_usec = 0; - atv.tv_sec = V_rtq_timeout; - callout_reset(&V_rtq_timer, tvtohz(&atv), in_rtqtimo, rock); - CURVNET_RESTORE(); -} - -static void -in_rtqtimo_one(void *rock) -{ - struct radix_node_head *rnh = rock; - 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_timeout; - arg.draining = arg.updating = 0; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in_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_timeout seconds, to keep from cranking down too - * hard. - */ - if ((arg.found - arg.killed > V_rtq_toomany) && - (time_uptime - last_adjusted_timeout >= V_rtq_timeout) && - V_rtq_reallyold > V_rtq_minreallyold) { - V_rtq_reallyold = 2 * V_rtq_reallyold / 3; - if (V_rtq_reallyold < V_rtq_minreallyold) { - V_rtq_reallyold = V_rtq_minreallyold; - } - - last_adjusted_timeout = time_uptime; -#ifdef DIAGNOSTIC - log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n", - V_rtq_reallyold); -#endif - arg.found = arg.killed = 0; - arg.updating = 1; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - } - -} - -void -in_rtqdrain(void) -{ - VNET_ITERATOR_DECL(vnet_iter); - struct radix_node_head *rnh; - struct rtqk_arg arg; - int fibnum; - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - - for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET); - arg.found = arg.killed = 0; - arg.rnh = rnh; - arg.nextstop = 0; - arg.draining = 1; - arg.updating = 0; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - } - CURVNET_RESTORE(); - } - 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. @@ -358,11 +122,7 @@ in_inithead(void **head, int off) RADIX_NODE_HEAD_LOCK_INIT(rnh); rnh->rnh_addaddr = in_addroute; - in_setmatchfunc(rnh, V_drop_redirect); - rnh->rnh_close = in_clsroute; if (_in_rt_was_here == 0 ) { - callout_init(&V_rtq_timer, CALLOUT_MPSAFE); - callout_reset(&V_rtq_timer, 1, in_rtqtimo, curvnet); _in_rt_was_here = 1; } return 1; @@ -373,7 +133,6 @@ int in_detachhead(void **head, int off) { - callout_drain(&V_rtq_timer); return (1); } #endif Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet/in_var.h Tue Nov 11 02:52:40 2014 (r274363) @@ -407,7 +407,6 @@ int in_leavegroup_locked(struct in_multi /*const*/ struct in_mfilter *); int in_control(struct socket *, u_long, caddr_t, struct ifnet *, struct thread *); -void in_rtqdrain(void); int in_addprefix(struct in_ifaddr *, int); int in_scrubprefix(struct in_ifaddr *, u_int); void ip_input(struct mbuf *); @@ -426,7 +425,6 @@ 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: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet/ip_icmp.c Tue Nov 11 02:52:40 2014 (r274363) @@ -115,6 +115,9 @@ SYSCTL_UINT(_net_inet_icmp, OID_AUTO, ma "Fake reply to ICMP Address Mask Request packets."); VNET_DEFINE(int, drop_redirect) = 0; +#define V_drop_redirect VNET(drop_redirect) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(drop_redirect), 0, "Ignore ICMP redirects"); static VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) @@ -163,39 +166,6 @@ 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_PROC(_net_inet_icmp, OID_AUTO, drop_redirect, - CTLFLAG_VNET | 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: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet/ip_input.c Tue Nov 11 02:52:40 2014 (r274363) @@ -1330,7 +1330,6 @@ ip_drain(void) } IPQ_UNLOCK(); VNET_LIST_RUNLOCK_NOSLEEP(); - in_rtqdrain(); } /* Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet6/in6.h Tue Nov 11 02:52:40 2014 (r274363) @@ -593,9 +593,9 @@ struct ip6_mtuinfo { #define IPV6CTL_MAPPED_ADDR 23 #endif #define IPV6CTL_V6ONLY 24 -#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ -#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ -#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ +/* IPV6CTL_RTEXPIRE 25 deprecated */ +/* IPV6CTL_RTMINEXPIRE 26 deprecated */ +/* IPV6CTL_RTMAXCACHE 27 deprecated */ #define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ #define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Tue Nov 11 00:13:28 2014 (r274362) +++ head/sys/netinet6/in6_rmx.c Tue Nov 11 02:52:40 2014 (r274363) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -179,24 +178,6 @@ in6_addroute(void *v_arg, void *n_arg, s return (ret); } -SYSCTL_DECL(_net_inet6_ip6); - -static VNET_DEFINE(int, rtq_toomany6) = 128; - /* 128 cached routes is ``too many'' */ -#define V_rtq_toomany6 VNET(rtq_toomany6) -SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMAXCACHE, rtmaxcache, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(rtq_toomany6) , 0, ""); - -struct rtqk_arg { - struct radix_node_head *rnh; - int mode; - int updating; - int draining; - int killed; - int found; - time_t nextstop; -}; - /* * Age old PMTUs. */ Modified: head/tools/tools/sysdoc/tunables.mdoc ============================================================================== --- head/tools/tools/sysdoc/tunables.mdoc Tue Nov 11 00:13:28 2014 (r274362) +++ head/tools/tools/sysdoc/tunables.mdoc Tue Nov 11 02:52:40 2014 (r274363) @@ -1325,28 +1325,6 @@ Controls the sending of ICMP redirects i packets. --- -net.inet.ip.rtexpire -int - -Lifetime in seconds of protocol-cloned IP routes after the last -reference drops (default one hour). - ---- -net.inet.ip.rtmaxcache -int - -Trigger level of cached, unreferenced, protocol-cloned -routes which initiates dynamic adaptation. - ---- -net.inet.ip.rtminexpire -int - -See -.Xr inet 4 -for more information. - ---- net.inet.ip.sourceroute bool From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 04:06:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0621886; Tue, 11 Nov 2014 04:06:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA8DB92; Tue, 11 Nov 2014 04:06:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB469M8003739; Tue, 11 Nov 2014 04:06:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB466wB003719; Tue, 11 Nov 2014 04:06:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411110406.sAB466wB003719@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 11 Nov 2014 04:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274364 - in head: contrib/telnet/arpa contrib/telnet/telnet contrib/telnet/telnetd contrib/tzcode/stdtime libexec/telnetd 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 04:06:09 -0000 Author: ngie Date: Tue Nov 11 04:06:05 2014 New Revision: 274364 URL: https://svnweb.freebsd.org/changeset/base/274364 Log: Add baud rate support to telnet(1) This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Added: head/contrib/telnet/telnet/baud.h (contents, props changed) Modified: head/contrib/telnet/arpa/telnet.h head/contrib/telnet/telnet/commands.c head/contrib/telnet/telnet/externs.h head/contrib/telnet/telnet/main.c head/contrib/telnet/telnet/sys_bsd.c head/contrib/telnet/telnet/telnet.1 head/contrib/telnet/telnet/telnet.c head/contrib/telnet/telnet/types.h head/contrib/telnet/telnetd/sys_term.c head/contrib/tzcode/stdtime/localtime.c head/libexec/telnetd/Makefile Modified: head/contrib/telnet/arpa/telnet.h ============================================================================== --- head/contrib/telnet/arpa/telnet.h Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/arpa/telnet.h Tue Nov 11 04:06:05 2014 (r274364) @@ -127,6 +127,7 @@ extern char *telcmds[]; #define TELOPT_KERMIT 47 /* RFC2840 - Kermit */ #define TELOPT_EXOPL 255 /* extended-options-list */ +#define COMPORT_SET_BAUDRATE 1 /* RFC2217 - Com Port Set Baud Rate */ #define NTELOPTS (1+TELOPT_KERMIT) #ifdef TELOPTS Added: head/contrib/telnet/telnet/baud.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/telnet/telnet/baud.h Tue Nov 11 04:06:05 2014 (r274364) @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014 EMC Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * 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$ + */ + +/* + * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). + */ +#if B4800 != 4800 +#define DECODE_BAUD +#endif + +#ifdef DECODE_BAUD +#ifndef B7200 +#define B7200 B4800 +#endif + +#ifndef B14400 +#define B14400 B9600 +#endif + +#ifndef B19200 +#define B19200 B14400 +#endif + +#ifndef B28800 +#define B28800 B19200 +#endif + +#ifndef B38400 +#define B38400 B28800 +#endif + +#ifndef B57600 +#define B57600 B38400 +#endif + +#ifndef B76800 +#define B76800 B57600 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif +#endif + +#ifndef B230400 +#define B230400 B115200 +#endif + +/* + * A table of available terminal speeds + */ +struct termspeeds termspeeds[] = { + { 0, B0 }, + { 50, B50 }, + { 75, B75 }, + { 110, B110 }, + { 134, B134 }, + { 150, B150 }, + { 200, B200 }, + { 300, B300 }, + { 600, B600 }, + { 1200, B1200 }, + { 1800, B1800 }, + { 2400, B2400 }, + { 4800, B4800 }, +#ifdef B7200 + { 7200, B7200 }, +#endif + { 9600, B9600 }, +#ifdef B14400 + { 14400, B14400 }, +#endif +#ifdef B19200 + { 19200, B19200 }, +#endif +#ifdef B28800 + { 28800, B28800 }, +#endif +#ifdef B38400 + { 38400, B38400 }, +#endif +#ifdef B57600 + { 57600, B57600 }, +#endif +#ifdef B115200 + { 115200, B115200 }, +#endif +#ifdef B230400 + { 230400, B230400 }, +#endif + { -1, 0 } +}; Modified: head/contrib/telnet/telnet/commands.c ============================================================================== --- head/contrib/telnet/telnet/commands.c Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/commands.c Tue Nov 11 04:06:05 2014 (r274364) @@ -896,6 +896,7 @@ static struct setlist Setlist[] = { { "forw1", "alternate end of line character", NULL, termForw1Charp }, { "forw2", "alternate end of line character", NULL, termForw2Charp }, { "ayt", "alternate AYT character", NULL, termAytCharp }, + { "baudrate", "set remote baud rate", DoBaudRate, ComPortBaudRate }, { NULL, NULL, NULL, NULL } }; Modified: head/contrib/telnet/telnet/externs.h ============================================================================== --- head/contrib/telnet/telnet/externs.h Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/externs.h Tue Nov 11 04:06:05 2014 (r274364) @@ -231,6 +231,10 @@ extern unsigned char NetTraceFile[]; /* Name of file where debugging output goes */ extern void SetNetTrace(char *); /* Function to change where debugging goes */ +extern unsigned char + ComPortBaudRate[]; /* Baud rate of the remote end */ +extern void + DoBaudRate(char *); /* Function to set the baud rate of the remote end */ extern jmp_buf toplevel; /* For error conditions. */ @@ -475,6 +479,16 @@ extern cc_t termAytChar; # endif #endif +typedef struct { + int + system, /* what the current time is */ + echotoggle, /* last time user entered echo character */ + modenegotiated, /* last time operating mode negotiated */ + didnetreceive, /* last time we read data from network */ + gotDM; /* when did we last see a data mark */ +} Clocks; + +extern Clocks clocks; /* Ring buffer structures which are shared */ Modified: head/contrib/telnet/telnet/main.c ============================================================================== --- head/contrib/telnet/telnet/main.c Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/main.c Tue Nov 11 04:06:05 2014 (r274364) @@ -91,10 +91,10 @@ usage(void) fprintf(stderr, "usage: %s %s%s%s%s\n", prompt, #ifdef AUTHENTICATION - "[-4] [-6] [-8] [-E] [-K] [-L] [-N] [-S tos] [-X atype] [-c] [-d]", - "\n\t[-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", + "[-4] [-6] [-8] [-B baudrate] [-E] [-K] [-L] [-N] [-S tos] [-X atype]", + "\n\t[-c] [-d] [-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", #else - "[-4] [-6] [-8] [-E] [-L] [-N] [-S tos] [-c] [-d]", + "[-4] [-6] [-8] [-B baudrate] [-E] [-L] [-N] [-S tos] [-c] [-d]", "\n\t[-e char] [-l user] [-n tracefile] ", #endif "[-r] [-s src_addr] [-u] ", @@ -154,7 +154,7 @@ main(int argc, char *argv[]) #define IPSECOPT #endif while ((ch = getopt(argc, argv, - "468EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) + "468B:EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) #undef IPSECOPT { switch(ch) { @@ -169,6 +169,9 @@ main(int argc, char *argv[]) case '8': eight = 3; /* binary output and input */ break; + case 'B': + DoBaudRate(optarg); + break; case 'E': rlogin = escape = _POSIX_VDISABLE; break; Modified: head/contrib/telnet/telnet/sys_bsd.c ============================================================================== --- head/contrib/telnet/telnet/sys_bsd.c Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/sys_bsd.c Tue Nov 11 04:06:05 2014 (r274364) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "defines.h" #include "externs.h" #include "types.h" +#include "baud.h" int tout, /* Output file descriptor */ @@ -682,71 +683,6 @@ TerminalNewMode(int f) } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD -#ifndef B7200 -#define B7200 B4800 -#endif - -#ifndef B14400 -#define B14400 B9600 -#endif - -#ifndef B19200 -# define B19200 B14400 -#endif - -#ifndef B28800 -#define B28800 B19200 -#endif - -#ifndef B38400 -# define B38400 B28800 -#endif - -#ifndef B57600 -#define B57600 B38400 -#endif - -#ifndef B76800 -#define B76800 B57600 -#endif - -#ifndef B115200 -#define B115200 B76800 -#endif - -#ifndef B230400 -#define B230400 B115200 -#endif - - -/* - * This code assumes that the values B0, B50, B75... - * are in ascending order. They do not have to be - * contiguous. - */ -struct termspeeds { - long speed; - long value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, { 7200, B7200 }, { 9600, B9600 }, - { 14400, B14400 }, { 19200, B19200 }, { 28800, B28800 }, - { 38400, B38400 }, { 57600, B57600 }, { 115200, B115200 }, - { 230400, B230400 }, { -1, B230400 } -}; -#endif /* DECODE_BAUD */ - void TerminalSpeeds(long *ispeed, long *ospeed) { Modified: head/contrib/telnet/telnet/telnet.1 ============================================================================== --- head/contrib/telnet/telnet/telnet.1 Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/telnet.1 Tue Nov 11 04:06:05 2014 (r274364) @@ -43,6 +43,7 @@ protocol .Sh SYNOPSIS .Nm .Op Fl 468EFKLNacdfruxy +.Op Fl B Ar baudrate .Op Fl S Ar tos .Op Fl X Ar authtype .Op Fl e Ar escapechar @@ -89,6 +90,9 @@ This causes an attempt to negotiate the .Dv TELNET BINARY option on both input and output. +.It Fl B Ar baudrate +Sets the baud rate to +.Ar baudrate . .It Fl E Stops any character from being recognized as an escape character. .It Fl F Modified: head/contrib/telnet/telnet/telnet.c ============================================================================== --- head/contrib/telnet/telnet/telnet.c Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/telnet.c Tue Nov 11 04:06:05 2014 (r274364) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "ring.h" @@ -68,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include - + #define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x)) static unsigned char subbuffer[SUBBUFSIZE], @@ -162,7 +163,7 @@ static int is_unique(char *, char **, ch */ Clocks clocks; - + /* * Initialize telnet environment. */ @@ -196,7 +197,7 @@ init_telnet(void) flushline = 1; telrcv_state = TS_DATA; } - + /* * These routines are in charge of sending option negotiations @@ -206,6 +207,42 @@ init_telnet(void) * is in disagreement as to what the current state should be. */ +unsigned char ComPortBaudRate[256]; + +void +DoBaudRate(char *arg) +{ + char *temp, temp2[10]; + int i; + uint32_t baudrate; + + errno = 0; + baudrate = (uint32_t)strtol(arg, &temp, 10); + if (temp[0] != '\0' || (baudrate == 0 && errno != 0)) + ExitString("Invalid baud rate provided.\n", 1); + + for (i = 1; termspeeds[i].speed != -1; i++) + if (baudrate == termspeeds[i].speed) + break; + if (termspeeds[i].speed == -1) + ExitString("Invalid baud rate provided.\n", 1); + + strlcpy(ComPortBaudRate, arg, sizeof(ComPortBaudRate)); + + if (NETROOM() < sizeof(temp2)) { + ExitString("No room in buffer for baud rate.\n", 1); + /* NOTREACHED */ + } + + snprintf(temp2, sizeof(temp2), "%c%c%c%c....%c%c", IAC, SB, TELOPT_COMPORT, + COMPORT_SET_BAUDRATE, IAC, SE); + + baudrate = htonl(baudrate); + memcpy(&temp2[4], &baudrate, sizeof(baudrate)); + ring_supply_data(&netoring, temp2, sizeof(temp2)); + printsub('>', &temp[2], sizeof(temp2) - 2); +} + void send_do(int c, int init) { @@ -1084,7 +1121,7 @@ lm_mode(unsigned char *cmd, int len, int setconnmode(0); /* set changed mode */ } - + /* * slc() @@ -1628,7 +1665,7 @@ env_opt_end(int emptyok) } } - + int telrcv(void) @@ -2013,7 +2050,7 @@ telsnd(void) ring_consumed(&ttyiring, count); return returnValue||count; /* Non-zero if we did anything */ } - + /* * Scheduler() * Modified: head/contrib/telnet/telnet/types.h ============================================================================== --- head/contrib/telnet/telnet/types.h Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnet/types.h Tue Nov 11 04:06:05 2014 (r274364) @@ -40,13 +40,9 @@ typedef struct { extern Modelist modelist[]; -typedef struct { - int - system, /* what the current time is */ - echotoggle, /* last time user entered echo character */ - modenegotiated, /* last time operating mode negotiated */ - didnetreceive, /* last time we read data from network */ - gotDM; /* when did we last see a data mark */ -} Clocks; +struct termspeeds { + int speed; + int value; +}; -extern Clocks clocks; +extern struct termspeeds termspeeds[]; Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/telnet/telnetd/sys_term.c Tue Nov 11 04:06:05 2014 (r274364) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include "telnetd.h" #include "pathnames.h" +#include "types.h" +#include "baud.h" #ifdef AUTHENTICATION #include @@ -743,56 +745,6 @@ tty_iscrnl(void) #endif } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD - -/* - * A table of available terminal speeds - */ -struct termspeeds { - int speed; - int value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, -#ifdef B7200 - { 7200, B7200 }, -#endif - { 9600, B9600 }, -#ifdef B14400 - { 14400, B14400 }, -#endif -#ifdef B19200 - { 19200, B19200 }, -#endif -#ifdef B28800 - { 28800, B28800 }, -#endif -#ifdef B38400 - { 38400, B38400 }, -#endif -#ifdef B57600 - { 57600, B57600 }, -#endif -#ifdef B115200 - { 115200, B115200 }, -#endif -#ifdef B230400 - { 230400, B230400 }, -#endif - { -1, 0 } -}; -#endif /* DECODE_BAUD */ - void tty_tspeed(int val) { Modified: head/contrib/tzcode/stdtime/localtime.c ============================================================================== --- head/contrib/tzcode/stdtime/localtime.c Tue Nov 11 02:52:40 2014 (r274363) +++ head/contrib/tzcode/stdtime/localtime.c Tue Nov 11 04:06:05 2014 (r274364) @@ -1792,7 +1792,11 @@ int delta; number0 = *number; *number += delta; - return (*number < number0) != (delta < 0); + if ((*number < number0) != (delta < 0)) { + errno = EOVERFLOW; + return (1); + } + return (0); } static int @@ -1804,7 +1808,11 @@ int delta; number0 = *number; *number += delta; - return (*number < number0) != (delta < 0); + if ((*number < number0) != (delta < 0)) { + errno = EOVERFLOW; + return (1); + } + return (0); } static int Modified: head/libexec/telnetd/Makefile ============================================================================== --- head/libexec/telnetd/Makefile Tue Nov 11 02:52:40 2014 (r274363) +++ head/libexec/telnetd/Makefile Tue Nov 11 04:06:05 2014 (r274364) @@ -25,6 +25,7 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I${TELNETDIR} +CFLAGS+= -I${TELNETDIR}/telnet LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 04:07:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80A30A21; Tue, 11 Nov 2014 04:07:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D213BAD; Tue, 11 Nov 2014 04:07:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB47gO5003977; Tue, 11 Nov 2014 04:07:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB47gBT003976; Tue, 11 Nov 2014 04:07:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411110407.sAB47gBT003976@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 11 Nov 2014 04:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274365 - head/contrib/tzcode/stdtime 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 04:07:42 -0000 Author: ngie Date: Tue Nov 11 04:07:41 2014 New Revision: 274365 URL: https://svnweb.freebsd.org/changeset/base/274365 Log: Revert WiP to contrib/tzcode accidentally committed with r274364 Modified: head/contrib/tzcode/stdtime/localtime.c Modified: head/contrib/tzcode/stdtime/localtime.c ============================================================================== --- head/contrib/tzcode/stdtime/localtime.c Tue Nov 11 04:06:05 2014 (r274364) +++ head/contrib/tzcode/stdtime/localtime.c Tue Nov 11 04:07:41 2014 (r274365) @@ -1792,11 +1792,7 @@ int delta; number0 = *number; *number += delta; - if ((*number < number0) != (delta < 0)) { - errno = EOVERFLOW; - return (1); - } - return (0); + return (*number < number0) != (delta < 0); } static int @@ -1808,11 +1804,7 @@ int delta; number0 = *number; *number += delta; - if ((*number < number0) != (delta < 0)) { - errno = EOVERFLOW; - return (1); - } - return (0); + return (*number < number0) != (delta < 0); } static int From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 04:48:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F92A24F; Tue, 11 Nov 2014 04:48:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9E2F26; Tue, 11 Nov 2014 04:48:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB4mBEt022304; Tue, 11 Nov 2014 04:48:11 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB4mABC022300; Tue, 11 Nov 2014 04:48:10 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201411110448.sAB4mABC022300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 11 Nov 2014 04:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274366 - in head/sys: dev/null geom 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 04:48:11 -0000 Author: pjd Date: Tue Nov 11 04:48:09 2014 New Revision: 274366 URL: https://svnweb.freebsd.org/changeset/base/274366 Log: Add missing privilege check when setting the dump device. Before that change it was possible for a regular user to setup the dump device if he had write access to the given device. In theory it is a security issue as user might get access to kernel's memory after provoking kernel crash, but in practise it is not recommended to give regular users direct access to storage devices. Rework the code so that we do privileges check within the set_dumper() function to avoid similar problems in the future. Discussed with: secteam Modified: head/sys/dev/null/null.c head/sys/geom/geom_dev.c head/sys/kern/kern_shutdown.c head/sys/sys/conf.h Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Tue Nov 11 04:07:41 2014 (r274365) +++ head/sys/dev/null/null.c Tue Nov 11 04:48:09 2014 (r274366) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -110,9 +109,7 @@ null_ioctl(struct cdev *dev __unused, u_ switch (cmd) { case DIOCSKERNELDUMP: - error = priv_check(td, PRIV_SETDUMPER); - if (error == 0) - error = set_dumper(NULL, NULL); + error = set_dumper(NULL, NULL, td); break; case FIONBIO: break; Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Nov 11 04:07:41 2014 (r274365) +++ head/sys/geom/geom_dev.c Tue Nov 11 04:48:09 2014 (r274366) @@ -127,14 +127,14 @@ g_dev_fini(struct g_class *mp) } static int -g_dev_setdumpdev(struct cdev *dev) +g_dev_setdumpdev(struct cdev *dev, struct thread *td) { struct g_kerneldump kd; struct g_consumer *cp; int error, len; if (dev == NULL) - return (set_dumper(NULL, NULL)); + return (set_dumper(NULL, NULL, td)); cp = dev->si_drv2; len = sizeof(kd); @@ -142,7 +142,7 @@ g_dev_setdumpdev(struct cdev *dev) kd.length = OFF_MAX; error = g_io_getattr("GEOM::kerneldump", cp, &len, &kd); if (error == 0) { - error = set_dumper(&kd.di, devtoname(dev)); + error = set_dumper(&kd.di, devtoname(dev), td); if (error == 0) dev->si_flags |= SI_DUMPDEV; } @@ -157,7 +157,7 @@ init_dumpdev(struct cdev *dev) return; if (strcmp(devtoname(dev), dumpdev) != 0) return; - if (g_dev_setdumpdev(dev) == 0) { + if (g_dev_setdumpdev(dev, curthread) == 0) { freeenv(dumpdev); dumpdev = NULL; } @@ -453,9 +453,9 @@ g_dev_ioctl(struct cdev *dev, u_long cmd break; case DIOCSKERNELDUMP: if (*(u_int *)data == 0) - error = g_dev_setdumpdev(NULL); + error = g_dev_setdumpdev(NULL, td); else - error = g_dev_setdumpdev(dev); + error = g_dev_setdumpdev(dev, td); break; case DIOCGFLUSH: error = g_io_flush(cp); @@ -673,7 +673,7 @@ g_dev_orphan(struct g_consumer *cp) /* Reset any dump-area set on this device */ if (dev->si_flags & SI_DUMPDEV) - (void)set_dumper(NULL, NULL); + (void)set_dumper(NULL, NULL, curthread); /* Destroy the struct cdev *so we get no more requests */ destroy_dev_sched_cb(dev, g_dev_callback, cp); Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Nov 11 04:07:41 2014 (r274365) +++ head/sys/kern/kern_shutdown.c Tue Nov 11 04:48:09 2014 (r274366) @@ -827,9 +827,14 @@ SYSCTL_STRING(_kern_shutdown, OID_AUTO, /* Registration of dumpers */ int -set_dumper(struct dumperinfo *di, const char *devname) +set_dumper(struct dumperinfo *di, const char *devname, struct thread *td) { size_t wantcopy; + int error; + + error = priv_check(td, PRIV_SETDUMPER); + if (error != 0) + return (error); if (di == NULL) { bzero(&dumper, sizeof dumper); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Tue Nov 11 04:07:41 2014 (r274365) +++ head/sys/sys/conf.h Tue Nov 11 04:48:09 2014 (r274366) @@ -336,7 +336,7 @@ struct dumperinfo { off_t mediasize; /* Space available in bytes. */ }; -int set_dumper(struct dumperinfo *, const char *_devname); +int set_dumper(struct dumperinfo *, const char *_devname, struct thread *td); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); int dumpsys(struct dumperinfo *); int doadump(boolean_t); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 05:00:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BAB23F5; Tue, 11 Nov 2014 05:00:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB106FF9; Tue, 11 Nov 2014 05:00:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB50q5h029233; Tue, 11 Nov 2014 05:00:52 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB50q6v029222; Tue, 11 Nov 2014 05:00:52 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201411110500.sAB50q6v029222@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Tue, 11 Nov 2014 05:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274367 - in releng/10.1/sys: dev/ixl modules/ixlv 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 05:00:53 -0000 Author: jfv Date: Tue Nov 11 05:00:51 2014 New Revision: 274367 URL: https://svnweb.freebsd.org/changeset/base/274367 Log: Update the Intel ixl/ixlv drivers to fix a panic in the boot/install kernel if the system has a fiber-based Intel XL710 adapter installed. In addition ixl version 1.2.8 and ixlv version 1.1.18 give: - Improved VF stability (thanks to Ryan Stone for this) - RSS fixes - link detection in the ixlv driver - new sysctl's added - corrected media reporting Submitted by: jfv Approved by: re Added: releng/10.1/sys/dev/ixl/ixlv_vc_mgr.h - copied unchanged from r274360, stable/10/sys/dev/ixl/ixlv_vc_mgr.h Deleted: releng/10.1/sys/dev/ixl/i40e_register_x710_int.h Modified: releng/10.1/sys/dev/ixl/i40e_osdep.c releng/10.1/sys/dev/ixl/i40e_osdep.h releng/10.1/sys/dev/ixl/if_ixl.c releng/10.1/sys/dev/ixl/if_ixlv.c releng/10.1/sys/dev/ixl/ixl.h releng/10.1/sys/dev/ixl/ixl_txrx.c releng/10.1/sys/dev/ixl/ixlv.h releng/10.1/sys/dev/ixl/ixlvc.c releng/10.1/sys/modules/ixlv/Makefile Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/sys/dev/ixl/i40e_osdep.c ============================================================================== --- releng/10.1/sys/dev/ixl/i40e_osdep.c Tue Nov 11 04:48:09 2014 (r274366) +++ releng/10.1/sys/dev/ixl/i40e_osdep.c Tue Nov 11 05:00:51 2014 (r274367) @@ -107,6 +107,7 @@ i40e_allocate_dma_mem(struct i40e_hw *hw "error %u\n", err); goto fail_2; } + mem->nseg = 1; mem->size = size; bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); Modified: releng/10.1/sys/dev/ixl/i40e_osdep.h ============================================================================== --- releng/10.1/sys/dev/ixl/i40e_osdep.h Tue Nov 11 04:48:09 2014 (r274366) +++ releng/10.1/sys/dev/ixl/i40e_osdep.h Tue Nov 11 05:00:51 2014 (r274367) @@ -147,11 +147,11 @@ void prefetch(void *x) #define prefetch(x) #endif -struct i40e_osdep -{ +struct i40e_osdep { bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; + uint32_t flush_reg; struct device *dev; }; @@ -208,6 +208,13 @@ wr32_osdep(struct i40e_osdep *osdep, uin osdep->mem_bus_space_handle, reg, value); } +static __inline void +ixl_flush_osdep(struct i40e_osdep *osdep) +{ + + rd32_osdep(osdep, osdep->flush_reg); +} + #define rd32(a, reg) rd32_osdep((a)->back, (reg)) #define wr32(a, reg, value) wr32_osdep((a)->back, (reg), (value)) @@ -221,9 +228,6 @@ wr32_osdep(struct i40e_osdep *osdep, uin ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ reg, value)) -#define ixl_flush(a) (\ - bus_space_read_4( ((struct i40e_osdep *)(a)->back)->mem_bus_space_tag, \ - ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ - I40E_GLGEN_STAT)) +#define ixl_flush(a) ixl_flush_osdep((a)->back) #endif /* _I40E_OSDEP_H_ */ Modified: releng/10.1/sys/dev/ixl/if_ixl.c ============================================================================== --- releng/10.1/sys/dev/ixl/if_ixl.c Tue Nov 11 04:48:09 2014 (r274366) +++ releng/10.1/sys/dev/ixl/if_ixl.c Tue Nov 11 05:00:51 2014 (r274367) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.2.2"; +char ixl_driver_version[] = "1.2.8"; /********************************************************************* * PCI Device ID Table @@ -109,6 +109,7 @@ static bool ixl_config_link(struct i40e_ static void ixl_config_rss(struct ixl_vsi *); static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); +static int ixl_set_advertised_speeds(struct ixl_pf *, int); static void ixl_enable_rings(struct ixl_vsi *); static void ixl_disable_rings(struct ixl_vsi *); @@ -155,6 +156,7 @@ static void ixl_do_adminq(void *, int); static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); static int ixl_current_speed(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); /* Statistics */ static void ixl_add_hw_stats(struct ixl_pf *); @@ -176,7 +178,8 @@ static void ixl_stat_update32(struct i40 static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS); #endif @@ -276,6 +279,7 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif + static char *ixl_fc_string[6] = { "None", "Rx", @@ -398,6 +402,11 @@ ixl_attach(device_t dev) OID_AUTO, "current_speed", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_current_speed, "A", "Current Port Speed"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rx_itr", CTLTYPE_INT | CTLFLAG_RW, @@ -436,8 +445,13 @@ ixl_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hw_res_info", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_hw_res_info, "A", "HW Resource Allocation"); + OID_AUTO, "hw_res_alloc", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_hw_res_alloc, "A", "HW Resource Allocation"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -445,7 +459,7 @@ ixl_attach(device_t dev) pf, 0, ixl_sysctl_dump_txd, "I", "Desc dump"); #endif - /* Save off the information about this board */ + /* Save off the PCI information */ hw->vendor_id = pci_get_vendor(dev); hw->device_id = pci_get_device(dev); hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); @@ -593,6 +607,7 @@ ixl_attach(device_t dev) bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); i40e_get_port_mac_addr(hw, hw->mac.port_addr); + /* Set up VSI and queues */ if (ixl_setup_stations(pf) != 0) { device_printf(dev, "setup stations failed!\n"); error = ENOMEM; @@ -630,8 +645,11 @@ ixl_attach(device_t dev) "an unqualified module was detected\n"); /* Setup OS specific network interface */ - if (ixl_setup_interface(dev, vsi) != 0) + if (ixl_setup_interface(dev, vsi) != 0) { + device_printf(dev, "interface setup failed!\n"); + error = EIO; goto err_late; + } /* Get the bus configuration and set the shared code */ bus = ixl_get_bus_info(hw, dev); @@ -642,25 +660,32 @@ ixl_attach(device_t dev) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* Reset port's advertised speeds */ + if (!i40e_is_40G_device(hw->device_id)) { + pf->advertised_speed = 0x7; + ixl_set_advertised_speeds(pf, 0x7); + } + /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); + INIT_DEBUGOUT("ixl_attach: end"); return (0); err_late: - ixl_free_vsi(vsi); + if (vsi->ifp != NULL) + if_free(vsi->ifp); err_mac_hmc: i40e_shutdown_lan_hmc(hw); err_get_cap: i40e_shutdown_adminq(hw); err_out: - if (vsi->ifp != NULL) - if_free(vsi->ifp); ixl_free_pci_resources(pf); + ixl_free_vsi(vsi); IXL_PF_LOCK_DESTROY(pf); return (error); } @@ -725,6 +750,7 @@ ixl_detach(device_t dev) ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); + ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -2177,6 +2203,7 @@ ixl_allocate_pci_resources(struct ixl_pf pf->osdep.mem_bus_space_handle = rman_get_bushandle(pf->pci_mem); pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); + pf->osdep.flush_reg = I40E_GLGEN_STAT; pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; pf->hw.back = &pf->osdep; @@ -2245,6 +2272,34 @@ early: return; } +static void +ixl_add_ifmedia(struct ixl_vsi *vsi, u32 phy_type) +{ + /* Display supported media types */ + if (phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); +} /********************************************************************* * @@ -2275,14 +2330,16 @@ ixl_setup_interface(device_t dev, struct ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixl_ioctl; +#if __FreeBSD_version >= 1100036 + if_setgetcounterfn(ifp, ixl_get_counter); +#endif + ifp->if_transmit = ixl_mq_start; ifp->if_qflush = ixl_qflush; ifp->if_snd.ifq_maxlen = que->num_desc - 2; - ether_ifattach(ifp, hw->mac.addr); - vsi->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; @@ -2323,40 +2380,26 @@ ixl_setup_interface(device_t dev, struct ixl_media_status); aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); - if (aq_error) { - printf("Error getting supported media types, AQ error %d\n", aq_error); - return (EPERM); - } - - /* Display supported media types */ - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) { + /* Need delay to detect fiber correctly */ + i40e_msec_delay(200); + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) + device_printf(dev, "Unknown PHY type detected!\n"); + else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); + } else if (aq_error) { + device_printf(dev, "Error getting supported media types, err %d," + " AQ error %d\n", aq_error, hw->aq.asq_last_status); + } else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); /* Use autoselect media by default */ ifmedia_add(&vsi->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&vsi->media, IFM_ETHER | IFM_AUTO); + ether_ifattach(ifp, hw->mac.addr); + return (0); } @@ -3700,7 +3743,6 @@ ixl_update_stats_counters(struct ixl_pf { struct i40e_hw *hw = &pf->hw; struct ixl_vsi *vsi = &pf->vsi; - struct ifnet *ifp = vsi->ifp; struct i40e_hw_port_stats *nsd = &pf->stats; struct i40e_hw_port_stats *osd = &pf->stats_offsets; @@ -3724,10 +3766,6 @@ ixl_update_stats_counters(struct ixl_pf pf->stat_offsets_loaded, &osd->eth.rx_discards, &nsd->eth.rx_discards); - ixl_stat_update32(hw, I40E_GLPRT_TDPC(hw->port), - pf->stat_offsets_loaded, - &osd->eth.tx_discards, - &nsd->eth.tx_discards); ixl_stat_update48(hw, I40E_GLPRT_UPRCH(hw->port), I40E_GLPRT_UPRCL(hw->port), pf->stat_offsets_loaded, @@ -3893,7 +3931,7 @@ ixl_update_stats_counters(struct ixl_pf /* OS statistics */ // ERJ - these are per-port, update all vsis? - ifp->if_ierrors = nsd->crc_errors + nsd->illegal_bytes; + IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes); } /* @@ -3911,8 +3949,8 @@ ixl_do_adminq(void *context, int pending u32 reg, loop = 0; u16 opcode, result; - event.msg_len = IXL_AQ_BUF_SZ; - event.msg_buf = malloc(event.msg_len, + event.buf_len = IXL_AQ_BUF_SZ; + event.msg_buf = malloc(event.buf_len, M_DEVBUF, M_NOWAIT | M_ZERO); if (!event.msg_buf) { printf("Unable to allocate adminq memory\n"); @@ -4027,13 +4065,16 @@ void ixl_update_eth_stats(struct ixl_vsi { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct i40e_hw *hw = &pf->hw; - struct ifnet *ifp = vsi->ifp; struct i40e_eth_stats *es; struct i40e_eth_stats *oes; + int i; + uint64_t tx_discards; + struct i40e_hw_port_stats *nsd; u16 stat_idx = vsi->info.stat_counter_idx; es = &vsi->eth_stats; oes = &vsi->eth_stats_offsets; + nsd = &pf->stats; /* Gather up the stats that the hw collects */ ixl_stat_update32(hw, I40E_GLV_TEPC(stat_idx), @@ -4078,22 +4119,27 @@ void ixl_update_eth_stats(struct ixl_vsi &oes->tx_broadcast, &es->tx_broadcast); vsi->stat_offsets_loaded = true; + tx_discards = es->tx_discards + nsd->tx_dropped_link_down; + for (i = 0; i < vsi->num_queues; i++) + tx_discards += vsi->queues[i].txr.br->br_drops; + /* Update ifnet stats */ - ifp->if_ipackets = es->rx_unicast + + IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + - es->rx_broadcast; - ifp->if_opackets = es->tx_unicast + + es->rx_broadcast); + IXL_SET_OPACKETS(vsi, es->tx_unicast + es->tx_multicast + - es->tx_broadcast; - ifp->if_ibytes = es->rx_bytes; - ifp->if_obytes = es->tx_bytes; - ifp->if_imcasts = es->rx_multicast; - ifp->if_omcasts = es->tx_multicast; - - ifp->if_oerrors = es->tx_errors; - ifp->if_iqdrops = es->rx_discards; - ifp->if_noproto = es->rx_unknown_protocol; - ifp->if_collisions = 0; + es->tx_broadcast); + IXL_SET_IBYTES(vsi, es->rx_bytes); + IXL_SET_OBYTES(vsi, es->tx_bytes); + IXL_SET_IMCASTS(vsi, es->rx_multicast); + IXL_SET_OMCASTS(vsi, es->tx_multicast); + + IXL_SET_OERRORS(vsi, es->tx_errors); + IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); + IXL_SET_OQDROPS(vsi, tx_discards); + IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); + IXL_SET_COLLISIONS(vsi, 0); } /** @@ -4288,6 +4334,52 @@ ixl_current_speed(SYSCTL_HANDLER_ARGS) return (error); } +static int +ixl_set_advertised_speeds(struct ixl_pf *pf, int speeds) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + /* Prepare new config */ + bzero(&config, sizeof(config)); + config.phy_type = abilities.phy_type; + config.abilities = abilities.abilities + | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + /* Translate into aq cmd link_speed */ + if (speeds & 0x4) + config.link_speed |= I40E_LINK_SPEED_10GB; + if (speeds & 0x2) + config.link_speed |= I40E_LINK_SPEED_1GB; + if (speeds & 0x1) + config.link_speed |= I40E_LINK_SPEED_100MB; + + /* Do aq command & restart link */ + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + return (0); +} + /* ** Control link advertise speed: ** Flags: @@ -4303,10 +4395,7 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - struct i40e_aq_get_phy_abilities_resp abilities; - struct i40e_aq_set_phy_config config; int requested_ls = 0; - enum i40e_status_code aq_error = 0; int error = 0; /* @@ -4331,39 +4420,9 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) if (pf->advertised_speed == requested_ls) return (0); - /* Get current capability information */ - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); - if (aq_error) { - device_printf(dev, "%s: Error getting phy capabilities %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } - - /* Prepare new config */ - bzero(&config, sizeof(config)); - config.phy_type = abilities.phy_type; - config.abilities = abilities.abilities - | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; - config.eee_capability = abilities.eee_capability; - config.eeer = abilities.eeer_val; - config.low_power_ctrl = abilities.d3_lpan; - /* Translate into aq cmd link_speed */ - if (requested_ls & 0x4) - config.link_speed |= I40E_LINK_SPEED_10GB; - if (requested_ls & 0x2) - config.link_speed |= I40E_LINK_SPEED_1GB; - if (requested_ls & 0x1) - config.link_speed |= I40E_LINK_SPEED_100MB; - - /* Do aq command & restart link */ - aq_error = i40e_aq_set_phy_config(hw, &config, NULL); - if (aq_error) { - device_printf(dev, "%s: Error setting new phy config %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } + error = ixl_set_advertised_speeds(pf, requested_ls); + if (error) + return (error); pf->advertised_speed = requested_ls; ixl_update_link_status(pf); @@ -4442,6 +4501,26 @@ ixl_get_bus_info(struct i40e_hw *hw, dev return (link); } +static int +ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + char buf[32]; + + snprintf(buf, sizeof(buf), + "f%d.%d a%d.%d n%02x.%02x e%08x", + hw->aq.fw_maj_ver, hw->aq.fw_min_ver, + hw->aq.api_maj_ver, hw->aq.api_min_ver, + (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >> + IXL_NVM_VERSION_HI_SHIFT, + (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >> + IXL_NVM_VERSION_LO_SHIFT, + hw->nvm.eetrack); + return (sysctl_handle_string(oidp, buf, strlen(buf), req)); +} + + #ifdef IXL_DEBUG static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS) @@ -4551,7 +4630,7 @@ ixl_sysctl_sw_filter_list(SYSCTL_HANDLER #define IXL_SW_RES_SIZE 0x14 static int -ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS) +ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; @@ -4608,7 +4687,120 @@ ixl_sysctl_hw_res_info(SYSCTL_HANDLER_AR device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return error; +} +/* +** Caller must init and delete sbuf; this function will clear and +** finish it for caller. +*/ +static char * +ixl_switch_element_string(struct sbuf *s, u16 seid, bool uplink) +{ + sbuf_clear(s); + + if (seid == 0 && uplink) + sbuf_cat(s, "Network"); + else if (seid == 0) + sbuf_cat(s, "Host"); + else if (seid == 1) + sbuf_cat(s, "EMP"); + else if (seid <= 5) + sbuf_printf(s, "MAC %d", seid - 2); + else if (seid <= 15) + sbuf_cat(s, "Reserved"); + else if (seid <= 31) + sbuf_printf(s, "PF %d", seid - 16); + else if (seid <= 159) + sbuf_printf(s, "VF %d", seid - 32); + else if (seid <= 287) + sbuf_cat(s, "Reserved"); + else if (seid <= 511) + sbuf_cat(s, "Other"); // for other structures + else if (seid <= 895) + sbuf_printf(s, "VSI %d", seid - 512); + else if (seid <= 1023) + sbuf_printf(s, "Reserved"); + else + sbuf_cat(s, "Invalid"); + + sbuf_finish(s); + return sbuf_data(s); +} + +static int +ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct sbuf *buf; + struct sbuf *nmbuf; + int error = 0; + u8 aq_buf[I40E_AQ_LARGE_BUF]; + + u16 next = 0; + struct i40e_aqc_get_switch_config_resp *sw_config; + sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; + + buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for sysctl output.\n"); + return (ENOMEM); + } + + error = i40e_aq_get_switch_config(hw, sw_config, + sizeof(aq_buf), &next, NULL); + if (error) { + device_printf(dev, "%s: aq_get_switch_config() error %d, aq error %d\n", + __func__, error, hw->aq.asq_last_status); + sbuf_delete(buf); + return error; + } + + nmbuf = sbuf_new_auto(); + if (!nmbuf) { + device_printf(dev, "Could not allocate sbuf for name output.\n"); + return (ENOMEM); + } + + sbuf_cat(buf, "\n"); + // Assuming <= 255 elements in switch + sbuf_printf(buf, "# of elements: %d\n", sw_config->header.num_reported); + /* Exclude: + ** Revision -- all elements are revision 1 for now + */ + sbuf_printf(buf, + "SEID ( Name ) | Uplink | Downlink | Conn Type\n" + " | | | (uplink)\n"); + for (int i = 0; i < sw_config->header.num_reported; i++) { + // "%4d (%8s) | %8s %8s %#8x", + sbuf_printf(buf, "%4d", sw_config->element[i].seid); + sbuf_cat(buf, " "); + sbuf_printf(buf, "(%8s)", ixl_switch_element_string(nmbuf, sw_config->element[i].seid, false)); + sbuf_cat(buf, " | "); + sbuf_printf(buf, "%8s", ixl_switch_element_string(nmbuf, sw_config->element[i].uplink_seid, true)); + sbuf_cat(buf, " "); + sbuf_printf(buf, "%8s", ixl_switch_element_string(nmbuf, sw_config->element[i].downlink_seid, false)); + sbuf_cat(buf, " "); + sbuf_printf(buf, "%#8x", sw_config->element[i].connection_type); + if (i < sw_config->header.num_reported - 1) + sbuf_cat(buf, "\n"); + } + sbuf_delete(nmbuf); + + error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + sbuf_delete(buf); + return error; + } + + error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); + if (error) + device_printf(dev, "sysctl error: %d\n", error); + sbuf_delete(buf); + + return (error); } /* Modified: releng/10.1/sys/dev/ixl/if_ixlv.c ============================================================================== --- releng/10.1/sys/dev/ixl/if_ixlv.c Tue Nov 11 04:48:09 2014 (r274366) +++ releng/10.1/sys/dev/ixl/if_ixlv.c Tue Nov 11 05:00:51 2014 (r274367) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixlv_driver_version[] = "1.1.4"; +char ixlv_driver_version[] = "1.1.18"; /********************************************************************* * PCI Device ID Table @@ -87,7 +87,6 @@ static void ixlv_config_rss(struct ixlv_ static void ixlv_stop(struct ixlv_sc *); static void ixlv_add_multi(struct ixl_vsi *); static void ixlv_del_multi(struct ixl_vsi *); -static void ixlv_update_link_status(struct ixlv_sc *); static void ixlv_free_queues(struct ixl_vsi *); static int ixlv_setup_interface(device_t, struct ixlv_sc *); @@ -97,18 +96,21 @@ static void ixlv_media_status(struct ifn static void ixlv_local_timer(void *); static int ixlv_add_mac_filter(struct ixlv_sc *, u8 *, u16); +static int ixlv_del_mac_filter(struct ixlv_sc *sc, u8 *macaddr); static void ixlv_init_filters(struct ixlv_sc *); static void ixlv_free_filters(struct ixlv_sc *); static void ixlv_msix_que(void *); static void ixlv_msix_adminq(void *); static void ixlv_do_adminq(void *, int); -static void ixlv_sched_aq(void *); +static void ixlv_do_adminq_locked(struct ixlv_sc *sc); static void ixlv_handle_que(void *, int); static int ixlv_reset(struct ixlv_sc *); static int ixlv_reset_complete(struct i40e_hw *); static void ixlv_set_queue_rx_itr(struct ixl_queue *); static void ixlv_set_queue_tx_itr(struct ixl_queue *); +static void ixl_init_cmd_complete(struct ixl_vc_cmd *, void *, + enum i40e_status_code); static void ixlv_enable_adminq_irq(struct i40e_hw *); static void ixlv_disable_adminq_irq(struct i40e_hw *); @@ -119,10 +121,16 @@ static void ixlv_setup_vlan_filters(stru static void ixlv_register_vlan(void *, struct ifnet *, u16); static void ixlv_unregister_vlan(void *, struct ifnet *, u16); +static void ixlv_init_hw(struct ixlv_sc *); +static int ixlv_setup_vc(struct ixlv_sc *); +static int ixlv_vf_config(struct ixlv_sc *); + static void ixlv_cap_txcsum_tso(struct ixl_vsi *, struct ifnet *, int); -static void ixlv_add_stats_sysctls(struct ixlv_sc *); +static void ixlv_add_sysctls(struct ixlv_sc *); +static int ixlv_sysctl_qtx_tail_handler(SYSCTL_HANDLER_ARGS); +static int ixlv_sysctl_qrx_tail_handler(SYSCTL_HANDLER_ARGS); /********************************************************************* * FreeBSD Device Interface Entry Points @@ -271,7 +279,7 @@ ixlv_attach(device_t dev) struct ixlv_sc *sc; struct i40e_hw *hw; struct ixl_vsi *vsi; - int bufsz, error = 0, retries = 0; + int error = 0; INIT_DBG_DEV(dev, "begin"); @@ -282,30 +290,18 @@ ixlv_attach(device_t dev) vsi = &sc->vsi; vsi->dev = dev; + /* Initialize hw struct */ + ixlv_init_hw(sc); + /* Allocate filter lists */ ixlv_init_filters(sc); /* Core Lock Init*/ mtx_init(&sc->mtx, device_get_nameunit(dev), "IXL SC Lock", MTX_DEF); - mtx_init(&sc->aq_task_mtx, device_get_nameunit(dev), - "IXL AQ Task Lock", MTX_DEF); - /* Set up the timer & aq watchdog callouts */ + /* Set up the timer callout */ callout_init_mtx(&sc->timer, &sc->mtx, 0); - callout_init_mtx(&sc->aq_task, &sc->aq_task_mtx, 0); - - /* Save off the information about this board */ - hw->vendor_id = pci_get_vendor(dev); - hw->device_id = pci_get_device(dev); - hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); - hw->subsystem_vendor_id = - pci_read_config(dev, PCIR_SUBVEND_0, 2); - hw->subsystem_device_id = - pci_read_config(dev, PCIR_SUBDEV_0, 2); - - hw->bus.device = pci_get_slot(dev); - hw->bus.func = pci_get_function(dev); /* Do PCI setup - map BAR0, etc */ if (ixlv_allocate_pci_resources(sc)) { @@ -333,50 +329,16 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "VF Device is ready for configuration"); - hw->aq.num_arq_entries = IXL_AQ_LEN; - hw->aq.num_asq_entries = IXL_AQ_LEN; - hw->aq.arq_buf_size = IXL_AQ_BUFSZ; - hw->aq.asq_buf_size = IXL_AQ_BUFSZ; - - error = i40e_init_adminq(hw); + error = ixlv_setup_vc(sc); if (error) { - device_printf(dev, "%s: init_adminq failed: %d\n", + device_printf(dev, "%s: Error setting up PF comms, %d\n", __func__, error); goto err_pci_res; } - INIT_DBG_DEV(dev, "Initialized Admin Queue"); - - error = ixlv_send_api_ver(sc); - if (error) { - device_printf(dev, "%s: unable to send to PF (%d)\n", - __func__, error); - goto err_aq; - } - - while (!i40e_asq_done(hw)) { - if (++retries > IXLV_AQ_MAX_ERR) { - device_printf(dev, "%s: Admin Queue timeout " - "(waiting for send_api_ver)\n", __func__); - error = ENXIO; - goto err_aq; - } - i40e_msec_delay(10); - } - - INIT_DBG_DEV(dev, "Sent API version message to PF"); - - /* Wait for API version msg to arrive */ - error = ixlv_verify_api_ver(sc); - if (error) { - device_printf(dev, - "%s: Unable to verify API version, error %d\n", - __func__, error); - goto err_aq; - } - INIT_DBG_DEV(dev, "PF API version verified"); + /* TODO: Figure out why MDD events occur when this reset is removed. */ /* Need API version before sending reset message */ error = ixlv_reset(sc); if (error) { @@ -387,49 +349,14 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "VF reset complete"); /* Ask for VF config from PF */ - error = ixlv_send_vf_config_msg(sc); + error = ixlv_vf_config(sc); if (error) { - device_printf(dev, - "%s: Unable to send VF config request, error %d\n", - __func__, error); - goto err_aq; - } - - retries = 0; - while (!i40e_asq_done(hw)) { - if (++retries > IXLV_AQ_MAX_ERR) { - device_printf(dev, "%s: Admin Queue timeout " - "(waiting for send_vf_config_msg)\n", __func__); - error = ENXIO; - goto err_aq; - } - i40e_msec_delay(10); - } - - INIT_DBG_DEV(dev, "Sent VF config message to PF"); - - bufsz = sizeof(struct i40e_virtchnl_vf_resource) + - (I40E_MAX_VF_VSI * sizeof(struct i40e_virtchnl_vsi_resource)); - sc->vf_res = malloc(bufsz, M_DEVBUF, M_NOWAIT); - if (!sc->vf_res) { - device_printf(dev, - "%s: Unable to allocate memory for VF configuration" - " message from PF\n", __func__); - error = ENOMEM; + device_printf(dev, "Error getting configuration from PF: %d\n", + error); goto err_aq; } - /* Check for VF config response */ - error = ixlv_get_vf_config(sc); - if (error) { - device_printf(dev, - "%s: Unable to get VF configuration from PF\n", - __func__); - error = EBUSY; - goto err_res_buf; - } - - INIT_DBG_DEV(dev, "Received valid VF config from PF"); + INIT_DBG_DEV(dev, "VF config from PF:"); INIT_DBG_DEV(dev, "VSIs %d, Queues %d, Max Vectors %d, Max MTU %d", sc->vf_res->num_vsis, sc->vf_res->num_queue_pairs, @@ -438,6 +365,7 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "Offload flags: %#010x", sc->vf_res->vf_offload_flags); + // TODO: Move this into ixlv_vf_config? /* got VF config message back from PF, now we can parse it */ for (int i = 0; i < sc->vf_res->num_vsis; i++) { if (sc->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV) @@ -445,6 +373,7 @@ ixlv_attach(device_t dev) } if (!sc->vsi_res) { device_printf(dev, "%s: no LAN VSI found\n", __func__); + error = EIO; goto err_res_buf; } @@ -461,14 +390,13 @@ ixlv_attach(device_t dev) vsi->id = sc->vsi_res->vsi_id; vsi->back = (void *)sc; - - /* Link in this virtual environment is always 'up' */ vsi->link_up = TRUE; /* This allocates the memory and early settings */ if (ixlv_setup_queues(sc) != 0) { device_printf(dev, "%s: setup queues failed!\n", __func__); + error = EIO; goto out; } @@ -476,6 +404,7 @@ ixlv_attach(device_t dev) if (ixlv_setup_interface(dev, sc) != 0) { device_printf(dev, "%s: setup interface failed!\n", __func__); + error = EIO; goto out; } @@ -487,12 +416,9 @@ ixlv_attach(device_t dev) /* Start AdminQ taskqueue */ ixlv_init_taskqueue(sc); - /* Start the admin queue scheduler timer */ - callout_reset(&sc->aq_task, 2 * hz, ixlv_sched_aq, sc); - /* Initialize stats */ bzero(&sc->vsi.eth_stats, sizeof(struct i40e_eth_stats)); - ixlv_add_stats_sysctls(sc); + ixlv_add_sysctls(sc); /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, @@ -504,10 +430,10 @@ ixlv_attach(device_t dev) ixlv_enable_adminq_irq(hw); /* Set things up to run init */ - sc->aq_pending = 0; - sc->aq_required = 0; sc->init_state = IXLV_INIT_READY; + ixl_vc_init_mgr(sc, &sc->vc_mgr); + INIT_DBG_DEV(dev, "end"); return (error); @@ -521,7 +447,6 @@ err_pci_res: ixlv_free_pci_resources(sc); err_early: mtx_destroy(&sc->mtx); - mtx_destroy(&sc->aq_task_mtx); ixlv_free_filters(sc); INIT_DBG_DEV(dev, "end: error %d", error); return (error); @@ -542,7 +467,6 @@ ixlv_detach(device_t dev) { struct ixlv_sc *sc = device_get_softc(dev); struct ixl_vsi *vsi = &sc->vsi; - int retries = 0; INIT_DBG_DEV(dev, "begin"); @@ -554,23 +478,11 @@ ixlv_detach(device_t dev) } /* Stop driver */ + ether_ifdetach(vsi->ifp); if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { mtx_lock(&sc->mtx); ixlv_stop(sc); mtx_unlock(&sc->mtx); - - /* - ** Ensure queues are disabled before examining - ** admin queue state later in detach. - */ - while (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING - && ++retries < IXLV_AQ_MAX_ERR) { - i40e_msec_delay(10); - } -#ifdef IXL_DEBUG - if (retries >= IXLV_AQ_MAX_ERR) - device_printf(dev, "Issue disabling queues for detach\n"); -#endif } /* Unregister VLAN events */ @@ -579,37 +491,16 @@ ixlv_detach(device_t dev) if (vsi->vlan_detach != NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 05:46:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AA178AA; Tue, 11 Nov 2014 05:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2A1B664; Tue, 11 Nov 2014 05:46:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB5kAV5050127; Tue, 11 Nov 2014 05:46:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB5kAQJ050126; Tue, 11 Nov 2014 05:46:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411110546.sAB5kAQJ050126@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 11 Nov 2014 05:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274368 - releng/10.1/release/doc/en_US.ISO8859-1/errata 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 05:46:11 -0000 Author: gjb Date: Tue Nov 11 05:46:10 2014 New Revision: 274368 URL: https://svnweb.freebsd.org/changeset/base/274368 Log: Document incompatibility between bsdconfig(8) and pkg(8) in 10.1-RELEASE, and provide steps to install the on-disc packages via alternative method. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/release/doc/en_US.ISO8859-1/errata/article.xml Modified: releng/10.1/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- releng/10.1/release/doc/en_US.ISO8859-1/errata/article.xml Tue Nov 11 05:00:51 2014 (r274367) +++ releng/10.1/release/doc/en_US.ISO8859-1/errata/article.xml Tue Nov 11 05:46:10 2014 (r274368) @@ -175,6 +175,56 @@ boot directly. + + + Due to an incompatibility between &man.bsdconfig.8; + and &man.pkg.8; version 1.3, packages included on the + &os; dvd installer will not be recognized by + &man.bsdconfig.8;. + + To install packages from the dvd1.iso + installer, create the /dist target directory, and + manually mount the dvd1.iso + ISO: + + &prompt.root; mkdir -p /dist +&prompt.root; mount -t cd9660 /dev/cd0 /dist + + + Be sure to use the correct /dev device path for the + dvd1.iso ISO + installer. + + + Next, set REPOS_DIR to the path of the + repos/ directory + within the installer so &man.pkg.8; will use the correct + repository metadata. + + If using &man.sh.1;: + + &prompt.root; export REPOS_DIR=/dist/packages/repos + + If using &man.csh.1;: + + &prompt.root; setenv REPOS_DIR /dist/packages/repos + + + Keep in mind that REPOS_DIR will need + to be set again after the current shell session is + terminated, if continuing to use the packages provided on + the dvd1.iso installer. + + + Finally, bootstrap &man.pkg.8; from the + ISO, and install required + packages: + + &prompt.root; pkg bootstrap +&prompt.root; pkg install xorg-server xorg gnome2 [...] + From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 05:49:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60762A60; Tue, 11 Nov 2014 05:49:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D00768D; Tue, 11 Nov 2014 05:49:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB5naPB050602; Tue, 11 Nov 2014 05:49:36 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB5natm050601; Tue, 11 Nov 2014 05:49:36 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411110549.sAB5natm050601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 11 Nov 2014 05:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274369 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 05:49:36 -0000 Author: gjb Date: Tue Nov 11 05:49:35 2014 New Revision: 274369 URL: https://svnweb.freebsd.org/changeset/base/274369 Log: Anticipate when we'll be ready to announce 10.1-RELEASE. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Tue Nov 11 05:46:10 2014 (r274368) +++ stable/10/UPDATING Tue Nov 11 05:49:35 2014 (r274369) @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141118: + 10.1-RELEASE. + 20140904: The ofwfb driver, used to provide a graphics console on PowerPC when using vt(4), no longer allows mmap() of all of physical memory. This From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 05:49:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D970B8F; Tue, 11 Nov 2014 05:49:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A6BE695; Tue, 11 Nov 2014 05:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB5nwQ9050684; Tue, 11 Nov 2014 05:49:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB5nw2k050683; Tue, 11 Nov 2014 05:49:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411110549.sAB5nw2k050683@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 11 Nov 2014 05:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274370 - head/contrib/hyperv/tools 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 05:49:58 -0000 Author: delphij Date: Tue Nov 11 05:49:57 2014 New Revision: 274370 URL: https://svnweb.freebsd.org/changeset/base/274370 Log: Rename variable name from 'index' to 'idx' to avoid shadowing index(3). Noticed by: dim MFC after: 2 weeks Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Tue Nov 11 05:49:35 2014 (r274369) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Tue Nov 11 05:49:57 2014 (r274370) @@ -511,25 +511,25 @@ kvp_get_value(int pool, __u8 *key, int k static int -kvp_pool_enumerate(int pool, int index, __u8 *key, int key_size, +kvp_pool_enumerate(int pool, int idx, __u8 *key, int key_size, __u8 *value, int value_size) { struct kvp_record *record; KVP_LOG(LOG_DEBUG, "kvp_pool_enumerate: pool = %d, index = %d\n,", - pool, index); + pool, idx); /* First update our in-memory state first. */ kvp_update_mem_state(pool); record = kvp_pools[pool].records; /* Index starts with 0 */ - if (index >= kvp_pools[pool].num_records) { + if (idx >= kvp_pools[pool].num_records) { return (1); } - memcpy(key, record[index].key, key_size); - memcpy(value, record[index].value, value_size); + memcpy(key, record[idx].key, key_size); + memcpy(value, record[idx].value, value_size); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 05:54:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67760D04; Tue, 11 Nov 2014 05:54:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 543DD79D; Tue, 11 Nov 2014 05:54:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB5spx5054761; Tue, 11 Nov 2014 05:54:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB5spDw054760; Tue, 11 Nov 2014 05:54:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411110554.sAB5spDw054760@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 11 Nov 2014 05:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274371 - releng/10.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 05:54:51 -0000 Author: gjb Date: Tue Nov 11 05:54:50 2014 New Revision: 274371 URL: https://svnweb.freebsd.org/changeset/base/274371 Log: Update releng/10.1 to -RELEASE status, and prepare for final 10.1-RELEASE builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/sys/conf/newvers.sh Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== --- releng/10.1/sys/conf/newvers.sh Tue Nov 11 05:49:57 2014 (r274370) +++ releng/10.1/sys/conf/newvers.sh Tue Nov 11 05:54:50 2014 (r274371) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RC4-p1" +BRANCH="RELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 05:55:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A872E2D; Tue, 11 Nov 2014 05:55:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4407A3; Tue, 11 Nov 2014 05:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB5tcxT054963; Tue, 11 Nov 2014 05:55:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB5tbW0054955; Tue, 11 Nov 2014 05:55:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411110555.sAB5tbW0054955@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 11 Nov 2014 05:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274372 - in stable/10: contrib/hyperv/tools share/man/man8 tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 05:55:38 -0000 Author: delphij Date: Tue Nov 11 05:55:37 2014 New Revision: 274372 URL: https://svnweb.freebsd.org/changeset/base/274372 Log: MFV r273747: Remove an extra copy of hv_kvp_daemon(8) [1]. While I'm there also correct typos in OptionalObsoleteFiles and add information of the command line options for hv_kvp_daemon(8). Reported by: jmg [1] Reviewed by: jmg Deleted: stable/10/share/man/man8/hv_kvp_daemon.8 Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.8 stable/10/share/man/man8/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.8 ============================================================================== --- stable/10/contrib/hyperv/tools/hv_kvp_daemon.8 Tue Nov 11 05:54:50 2014 (r274371) +++ stable/10/contrib/hyperv/tools/hv_kvp_daemon.8 Tue Nov 11 05:55:37 2014 (r274372) @@ -22,41 +22,71 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 10, 2013 -.Dt HYPER-V 4 +.\" $FreeBSD$ +.Dd October 27, 2014 +.Dt HV_KVP_DAEMON 8 .Os .Sh NAME .Nm hv_kvp_daemon .Nd Hyper-V Key Value Pair Daemon .Sh SYNOPSIS -The \fBhv_kvp_daemon\fP daemon provides the ability to store, retrieve, modify and delete -Key Value pairs for FreeBSD guest partitions running on Hyper-V. +.Nm +.Op Fl dn .Sh DESCRIPTION +The +.Nm +daemon provides the ability to store, retrieve, modify and delete +Key Value pairs for +.Fx +guest partitions running on Hyper-V. +.Pp Hyper-V allows administrators to store custom metadata in the form -of Key Value pairs inside the FreeBSD guest partition. Administrators can +of Key Value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, modify and delete such Key Value pairs. - -The \fBhv_kvp_daemon\fP accepts Key Value pair management requests from the -\fBhv_utils\fP driver and performs the actual metadata management on the file-system. - +.Pp +The +.Nm +accepts Key Value pair management requests from the +.Xr hv_utils 4 +driver and performs the actual metadata management on the file-system. +.Pp The same daemon and driver combination is also used to set and get -IP addresses from a FreeBSD guest. - +IP addresses from a +.Fx +guest. +.Pp The set functionality is particularly -useful when the FreeBSD guest is assigned a static IP address and is failed -over from one Hyper-V host to another. After failover, Hyper-V uses the set IP +useful when the +.Fx +guest is assigned a static IP address and is failed +over from one Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically -update the FreeBSD guest's IP address to its original static value. - +update the +.Fx +guest's IP address to its original static value. +.Pp On the other hand, the get IP functionality is used to update the guest IP address in the Hyper-V management console window. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d +Run as regular process instead of a daemon for debugging purpose. +.It Fl n +Generate debugging output. +.El .Sh SEE ALSO .Xr hv_vmbus 4 , .Xr hv_utils 4 , .Xr hv_netvsc 4 , .Xr hv_storvsc 4 , -.Xr hv_ata_pci_disengage 4 +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp 4 .Sh HISTORY Support for Hyper-V in the form of ports was first released in September 2013. The daemon was developed through a joint effort between Citrix Inc., @@ -64,5 +94,7 @@ Microsoft Corp. and Network Appliance In .Sh AUTHORS .An -nosplit .Fx -support for \fBhv_kvp_daemon\fP was first added by -.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq Mt bsdic@microsoft.com . Modified: stable/10/share/man/man8/Makefile ============================================================================== --- stable/10/share/man/man8/Makefile Tue Nov 11 05:54:50 2014 (r274371) +++ stable/10/share/man/man8/Makefile Tue Nov 11 05:55:37 2014 (r274372) @@ -3,7 +3,6 @@ MAN= crash.8 \ diskless.8 \ - hv_kvp_daemon.8 \ intro.8 \ nanobsd.8 \ picobsd.8 \ Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Nov 11 05:54:50 2014 (r274371) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Nov 11 05:55:37 2014 (r274372) @@ -4694,5 +4694,6 @@ OLD_FILES+=etc/devd/hyperv.conf OLD_FILES+=usr/libexec/hyperv/hv_set_ifconfig OLD_FILES+=usr/libexec/hyperv/hv_get_dns_info OLD_FILES+=usr/libexec/hyperv/hv_get_dhcp_info -OLD_FILES+=usr/sbin/hv_kvpd +OLD_FILES+=usr/sbin/hv_kvp_daemon +OLD_FILES+=usr/share/man/man8/hv_kvp_daemon.8.gz .endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 07:22:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85379C64; Tue, 11 Nov 2014 07:22:41 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DD12F9C; Tue, 11 Nov 2014 07:22:40 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::96f:bc74:b3c9:9d0e] (unknown [IPv6:2001:7b8:3a7:0:96f:bc74:b3c9:9d0e]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 33D9BB80A; Tue, 11 Nov 2014 08:22:36 +0100 (CET) Subject: Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BAF2B536-5000-401D-B0A4-A69E296D9104"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b1 From: Dimitry Andric In-Reply-To: Date: Tue, 11 Nov 2014 08:22:31 +0100 Message-Id: <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org> References: <201410181936.s9IJaCwu018930@svn.freebsd.org> <3279406.bOBVrcribU@ralph.baldwin.cx> To: Adrian Chadd X-Mailer: Apple Mail (2.1990.1) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Luigi Rizzo , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 07:22:41 -0000 --Apple-Mail=_BAF2B536-5000-401D-B0A4-A69E296D9104 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii It is indeed used to calculate an address offset, but as it is already checked against NOCPU, it should be good: gnu/usr.bin/gdb/kgdb/kthr.c: kt->cpu =3D td.td_oncpu; gnu/usr.bin/gdb/kgdb/trgt_i386.c: if (kt =3D=3D NULL || kt->cpu =3D=3D= NOCPU) gnu/usr.bin/gdb/kgdb/trgt_i386.c: addr +=3D (kt->cpu * NGDT + = GPROC0_SEL) * sizeof(sd); Maybe the test could be strengthened to check that kt->cpu >=3D 0, but = it might be overkill. -Dimitry > On 11 Nov 2014, at 00:17, Adrian Chadd wrote: >=20 > just double-check that the cpu id isn't used to size anything; I've > seen it used as an offset into stuff, and NOCPU would've been entry > 255 in the array, not -1. >=20 > Ian pointed this out to me recently and I've only just started digging = into it. >=20 >=20 >=20 > -adrian >=20 >=20 > On 10 November 2014 12:35, John Baldwin wrote: >> On Monday, November 10, 2014 09:13:08 PM Dimitry Andric wrote: >>> I noted something similar for kgdb, when compiled with gcc: >>>=20 >>> cc1: warnings being treated as errors >>> /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c: In function >>> 'kgdb_trgt_fetch_tss': = /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c:142: >>> warning: comparison is always false due to limited range of data = type >>>=20 >>> In gnu/usr.bin/gdb/kgdb/kgdb.h, there is: >>>=20 >>> struct kthr { >>> struct kthr *next; >>> uintptr_t paddr; >>> uintptr_t kaddr; >>> uintptr_t kstack; >>> uintptr_t pcb; >>> int tid; >>> int pid; >>> u_char cpu; >>> }; >>>=20 >>> The cpu field is assigned from td.td_oncpu (which is an int) in >>> kgdb_thr_add_procs(), so I think it should be safe to change it to = an >>> int too: >>>=20 >>> Index: gnu/usr.bin/gdb/kgdb/kgdb.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 >>> --- gnu/usr.bin/gdb/kgdb/kgdb.h (revision 274350) >>> +++ gnu/usr.bin/gdb/kgdb/kgdb.h (working copy) >>> @@ -41,7 +41,7 @@ >>> uintptr_t pcb; >>> int tid; >>> int pid; >>> - u_char cpu; >>> + int cpu; >>> }; >>>=20 >>> extern struct kthr *curkthr; >>=20 >> Yes, please commit. >>=20 >> -- >> John Baldwin --Apple-Mail=_BAF2B536-5000-401D-B0A4-A69E296D9104 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlRhuTsACgkQsF6jCi4glqMwGwCgy/uDSpIvgrmjqZykyBOB71FO aJYAoPysTm2dAAiqQR7Cclu2Nqg1FqHm =EfcO -----END PGP SIGNATURE----- --Apple-Mail=_BAF2B536-5000-401D-B0A4-A69E296D9104-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 08:00:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 163FA360; Tue, 11 Nov 2014 08:00:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EABB235C; Tue, 11 Nov 2014 08:00:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB80o58013422; Tue, 11 Nov 2014 08:00:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB80oGi013420; Tue, 11 Nov 2014 08:00:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411110800.sAB80oGi013420@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 11 Nov 2014 08:00:50 +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: r274373 - in stable: 10/contrib/llvm/lib/MC/MCParser 10/contrib/llvm/patches 9/contrib/llvm/lib/MC/MCParser 9/contrib/llvm/patches 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 08:00:51 -0000 Author: dim Date: Tue Nov 11 08:00:49 2014 New Revision: 274373 URL: https://svnweb.freebsd.org/changeset/base/274373 Log: MFC r274286: Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. There is code in the wild that relies on $0 not being expanded. This fixes some cases of using $ signs in literals being incorrectly assembled. Reported by: Richard Henderson Upstream PR: http://llvm.org/PR21500 MFC r274294: Add llvm patch corresponding to r274286. Added: stable/9/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff - copied unchanged from r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Modified: stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Changes in other areas also in this revision: Added: stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff - copied unchanged from r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Modified: stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Nov 11 05:55:37 2014 (r274372) +++ stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Nov 11 08:00:49 2014 (r274373) @@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ const MCAsmMacroParameters &Parameters, const MCAsmMacroArguments &A, const SMLoc &L) { unsigned NParameters = Parameters.size(); - if (NParameters != 0 && NParameters != A.size()) + if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) return Error(L, "Wrong number of arguments"); // A macro without parameters is handled differently on Darwin: @@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ std::size_t End = Body.size(), Pos = 0; for (; Pos != End; ++Pos) { // Check for a substitution or escape. - if (!NParameters) { + if (IsDarwin && !NParameters) { // This macro has no parameters, look for $0, $1, etc. if (Body[Pos] != '$' || Pos + 1 == End) continue; @@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ if (Pos == End) break; - if (!NParameters) { + if (IsDarwin && !NParameters) { switch (Body[Pos + 1]) { // $$ => $ case '$': Copied: stable/9/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff (from r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Tue Nov 11 08:00:49 2014 (r274373, copy of r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff) @@ -0,0 +1,55 @@ +Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): + + AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. + + There is code in the wild that relies on $0 not being expanded. + +This fixes some cases of using $ signs in literals being incorrectly +assembled. + +Reported by: Richard Henderson +Upstream PR: http://llvm.org/PR21500 + +Introduced here: http://svnweb.freebsd.org/changeset/base/274286 + +Index: lib/MC/MCParser/AsmParser.cpp +=================================================================== +--- lib/MC/MCParser/AsmParser.cpp ++++ lib/MC/MCParser/AsmParser.cpp +@@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + const MCAsmMacroParameters &Parameters, + const MCAsmMacroArguments &A, const SMLoc &L) { + unsigned NParameters = Parameters.size(); +- if (NParameters != 0 && NParameters != A.size()) ++ if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) + return Error(L, "Wrong number of arguments"); + + // A macro without parameters is handled differently on Darwin: +@@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + std::size_t End = Body.size(), Pos = 0; + for (; Pos != End; ++Pos) { + // Check for a substitution or escape. +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + // This macro has no parameters, look for $0, $1, etc. + if (Body[Pos] != '$' || Pos + 1 == End) + continue; +@@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + if (Pos == End) + break; + +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + switch (Body[Pos + 1]) { + // $$ => $ + case '$': +Index: test/MC/AsmParser/exprs.s +=================================================================== +--- test/MC/AsmParser/exprs.s ++++ test/MC/AsmParser/exprs.s +@@ -1,4 +1,4 @@ +-// RUN: llvm-mc -triple i386-unknown-unknown %s > %t ++// RUN: llvm-mc -triple i386-apple-darwin %s + + .macro check_expr + .if ($0) != ($1) From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 08:00:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D17EC361; Tue, 11 Nov 2014 08:00:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B406035E; Tue, 11 Nov 2014 08:00:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB80pfK013429; Tue, 11 Nov 2014 08:00:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB80piA013427; Tue, 11 Nov 2014 08:00:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411110800.sAB80piA013427@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 11 Nov 2014 08:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274373 - in stable: 10/contrib/llvm/lib/MC/MCParser 10/contrib/llvm/patches 9/contrib/llvm/lib/MC/MCParser 9/contrib/llvm/patches X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 08:00:51 -0000 Author: dim Date: Tue Nov 11 08:00:49 2014 New Revision: 274373 URL: https://svnweb.freebsd.org/changeset/base/274373 Log: MFC r274286: Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. There is code in the wild that relies on $0 not being expanded. This fixes some cases of using $ signs in literals being incorrectly assembled. Reported by: Richard Henderson Upstream PR: http://llvm.org/PR21500 MFC r274294: Add llvm patch corresponding to r274286. Added: stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff - copied unchanged from r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Modified: stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff - copied unchanged from r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Modified: stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Nov 11 05:55:37 2014 (r274372) +++ stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Nov 11 08:00:49 2014 (r274373) @@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ const MCAsmMacroParameters &Parameters, const MCAsmMacroArguments &A, const SMLoc &L) { unsigned NParameters = Parameters.size(); - if (NParameters != 0 && NParameters != A.size()) + if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) return Error(L, "Wrong number of arguments"); // A macro without parameters is handled differently on Darwin: @@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ std::size_t End = Body.size(), Pos = 0; for (; Pos != End; ++Pos) { // Check for a substitution or escape. - if (!NParameters) { + if (IsDarwin && !NParameters) { // This macro has no parameters, look for $0, $1, etc. if (Body[Pos] != '$' || Pos + 1 == End) continue; @@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ if (Pos == End) break; - if (!NParameters) { + if (IsDarwin && !NParameters) { switch (Body[Pos + 1]) { // $$ => $ case '$': Copied: stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff (from r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Tue Nov 11 08:00:49 2014 (r274373, copy of r274294, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff) @@ -0,0 +1,55 @@ +Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): + + AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. + + There is code in the wild that relies on $0 not being expanded. + +This fixes some cases of using $ signs in literals being incorrectly +assembled. + +Reported by: Richard Henderson +Upstream PR: http://llvm.org/PR21500 + +Introduced here: http://svnweb.freebsd.org/changeset/base/274286 + +Index: lib/MC/MCParser/AsmParser.cpp +=================================================================== +--- lib/MC/MCParser/AsmParser.cpp ++++ lib/MC/MCParser/AsmParser.cpp +@@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + const MCAsmMacroParameters &Parameters, + const MCAsmMacroArguments &A, const SMLoc &L) { + unsigned NParameters = Parameters.size(); +- if (NParameters != 0 && NParameters != A.size()) ++ if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) + return Error(L, "Wrong number of arguments"); + + // A macro without parameters is handled differently on Darwin: +@@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + std::size_t End = Body.size(), Pos = 0; + for (; Pos != End; ++Pos) { + // Check for a substitution or escape. +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + // This macro has no parameters, look for $0, $1, etc. + if (Body[Pos] != '$' || Pos + 1 == End) + continue; +@@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + if (Pos == End) + break; + +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + switch (Body[Pos + 1]) { + // $$ => $ + case '$': +Index: test/MC/AsmParser/exprs.s +=================================================================== +--- test/MC/AsmParser/exprs.s ++++ test/MC/AsmParser/exprs.s +@@ -1,4 +1,4 @@ +-// RUN: llvm-mc -triple i386-unknown-unknown %s > %t ++// RUN: llvm-mc -triple i386-apple-darwin %s + + .macro check_expr + .if ($0) != ($1) From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 10:02:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90A6792D; Tue, 11 Nov 2014 10:02:41 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 50E2F12B; Tue, 11 Nov 2014 10:02:40 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 26D64AE96; Tue, 11 Nov 2014 10:02:34 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 03491161B; Tue, 11 Nov 2014 11:02:32 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Bjoern A. Zeeb" Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> Date: Tue, 11 Nov 2014 11:02:32 +0100 In-Reply-To: <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> (Bjoern A. Zeeb's message of "Mon, 10 Nov 2014 15:10:36 +0000") Message-ID: <86sihq5a2v.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 10:02:41 -0000 "Bjoern A. Zeeb" writes: > This fails to compile on all gcc platforms. > > cc1: warnings being treated as errors > /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijnda= el/rijndael-api-fst.c: > In function 'rijndael_padEncrypt': > /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijnda= el/rijndael-api-fst.c:236: > warning: cast discards qualifiers from pointer target type > [...] The code is quite clearly wrong. Why doesn't clang complain? I'll commit dim@'s fix. Thank you. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 10:22:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 088BEDBE; Tue, 11 Nov 2014 10:22:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFC3336D; Tue, 11 Nov 2014 10:22:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABAMYJD087873; Tue, 11 Nov 2014 10:22:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABAMYfh087871; Tue, 11 Nov 2014 10:22:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411111022.sABAMYfh087871@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 11 Nov 2014 10:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274374 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 10:22:35 -0000 Author: glebius Date: Tue Nov 11 10:22:33 2014 New Revision: 274374 URL: https://svnweb.freebsd.org/changeset/base/274374 Log: Move struct ether_vlan_header to ethernet.h, out of if_vlan_var.h, since this structure is protocol definition, not part of implementation. Modified: head/sys/net/ethernet.h head/sys/net/if_vlan_var.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Tue Nov 11 08:00:49 2014 (r274373) +++ head/sys/net/ethernet.h Tue Nov 11 10:22:33 2014 (r274374) @@ -73,6 +73,25 @@ struct ether_addr { #define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ /* + * 802.1q Virtual LAN header. + */ +struct ether_vlan_header { + uint8_t evl_dhost[ETHER_ADDR_LEN]; + uint8_t evl_shost[ETHER_ADDR_LEN]; + uint16_t evl_encap_proto; + uint16_t evl_tag; + uint16_t evl_proto; +} __packed; + +#define EVL_VLID_MASK 0x0FFF +#define EVL_PRI_MASK 0xE000 +#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK) +#define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7) +#define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1) +#define EVL_MAKETAG(vlid, pri, cfi) \ + ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) + +/* * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields. * However, there are some conflicts. */ Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Tue Nov 11 08:00:49 2014 (r274373) +++ head/sys/net/if_vlan_var.h Tue Nov 11 10:22:33 2014 (r274374) @@ -32,22 +32,6 @@ #ifndef _NET_IF_VLAN_VAR_H_ #define _NET_IF_VLAN_VAR_H_ 1 -struct ether_vlan_header { - u_char evl_dhost[ETHER_ADDR_LEN]; - u_char evl_shost[ETHER_ADDR_LEN]; - u_int16_t evl_encap_proto; - u_int16_t evl_tag; - u_int16_t evl_proto; -}; - -#define EVL_VLID_MASK 0x0FFF -#define EVL_PRI_MASK 0xE000 -#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK) -#define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7) -#define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1) -#define EVL_MAKETAG(vlid, pri, cfi) \ - ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) - /* Set the VLAN ID in an mbuf packet header non-destructively. */ #define EVL_APPLY_VLID(m, vlid) \ do { \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 10:45:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B12E22E9; Tue, 11 Nov 2014 10:45:04 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 226007D2; Tue, 11 Nov 2014 10:45:03 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sABAiwiP025072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Nov 2014 12:44:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sABAiwiP025072 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sABAiw4M025071; Tue, 11 Nov 2014 12:44:58 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 11 Nov 2014 12:44:58 +0200 From: Konstantin Belousov To: Ed Maste Subject: Re: svn commit: r273582 - in head/sys/amd64: amd64 include Message-ID: <20141111104458.GG17068@kib.kiev.ua> References: <201410240948.s9O9mxNP019487@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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 autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Roger Pau Monn?? , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 10:45:04 -0000 On Mon, Nov 10, 2014 at 03:18:04PM -0500, Ed Maste wrote: > On 24 October 2014 05:48, Roger Pau Monn?? wrote: > > Author: royger > > Date: Fri Oct 24 09:48:58 2014 > > New Revision: 273582 > > URL: https://svnweb.freebsd.org/changeset/base/273582 > > > > Log: > > amd64: make uiomove_fromphys functional for pages not mapped by the DMAP > > UEFI boot fails after this commit. I haven't yet investigated in > depth, but it appears to hang after the loader transfers execution to > the kernel. It's likely a panic before the vt console is ready, I > think. > This is weird. The patch does not touch anything which could be used before e.g. filesystem i/o is started. I cannot outright exclude a possibility that it is used too early, but indeed we need a panic message and backtrace, if any. Do you have serial console ? BTW, are you sure that this is EFI-related ? Wouldn't it panic with legacy boot ? From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 11:06:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D7D87F4; Tue, 11 Nov 2014 11:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D45079B4; Tue, 11 Nov 2014 11:06:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABB6BY8011274; Tue, 11 Nov 2014 11:06:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABB6B4o011272; Tue, 11 Nov 2014 11:06:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411111106.sABB6B4o011272@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Nov 2014 11:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274375 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 11:06:12 -0000 Author: kib Date: Tue Nov 11 11:06:10 2014 New Revision: 274375 URL: https://svnweb.freebsd.org/changeset/base/274375 Log: MFC r274100: Fix mis-spelling of bits and types names in the default_pager_putpages() and swap_pager_putpages(). Modified: stable/10/sys/vm/default_pager.c stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/default_pager.c ============================================================================== --- stable/10/sys/vm/default_pager.c Tue Nov 11 10:22:33 2014 (r274374) +++ stable/10/sys/vm/default_pager.c Tue Nov 11 11:06:10 2014 (r274375) @@ -137,14 +137,11 @@ default_pager_getpages(object, m, count, * cache to the free list. */ static void -default_pager_putpages(object, m, c, sync, rtvals) - vm_object_t object; - vm_page_t *m; - int c; - boolean_t sync; - int *rtvals; +default_pager_putpages(vm_object_t object, vm_page_t *m, int count, + int flags, int *rtvals) { - swappagerops.pgo_putpages(object, m, c, sync, rtvals); + + swappagerops.pgo_putpages(object, m, count, flags, rtvals); } /* Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Tue Nov 11 10:22:33 2014 (r274374) +++ stable/10/sys/vm/swap_pager.c Tue Nov 11 11:06:10 2014 (r274375) @@ -1280,10 +1280,10 @@ swap_pager_getpages(vm_object_t object, */ void swap_pager_putpages(vm_object_t object, vm_page_t *m, int count, - boolean_t sync, int *rtvals) + int flags, int *rtvals) { - int i; - int n = 0; + int i, n; + boolean_t sync; if (count && m[0]->object != object) { panic("swap_pager_putpages: object mismatch %p/%p", @@ -1303,8 +1303,11 @@ swap_pager_putpages(vm_object_t object, swp_pager_meta_build(object, 0, SWAPBLK_NONE); VM_OBJECT_WUNLOCK(object); + n = 0; if (curproc != pageproc) sync = TRUE; + else + sync = (flags & VM_PAGER_PUT_SYNC) != 0; /* * Step 2 From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 11:48:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9678CFE5; Tue, 11 Nov 2014 11:48:47 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 56ECFDE3; Tue, 11 Nov 2014 11:48:46 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 7A688790D0D; Tue, 11 Nov 2014 22:48:37 +1100 (AEDT) Date: Tue, 11 Nov 2014 22:48:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde In-Reply-To: <86sihq5a2v.fsf@nine.des.no> Message-ID: <20141111223756.F3519@besplex.bde.org> References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=6I5d2MoRAAAA:8 a=qcF6j0GAqgwrQElzdWIA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 11:48:47 -0000 On Tue, 11 Nov 2014, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > "Bjoern A. Zeeb" writes: >> This fails to compile on all gcc platforms. >> >> cc1: warnings being treated as errors >> /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijnd= ael/rijndael-api-fst.c: >> In function 'rijndael_padEncrypt': >> /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijnd= ael/rijndael-api-fst.c:236: >> warning: cast discards qualifiers from pointer target type >> [...] > > The code is quite clearly wrong. Why doesn't clang complain? -Wcast-qual is broken (has no effect) with clang. This is incompatible with gcc and defeats the reason of existence of -Wcast-qual. -Wcast-qual is not a very good warning option since the official way to remove qualifiers in C is to cast them away. Casting them away is better than using the __DECONST() abomination. The option exists because it is too easy for sloppy code to cast away const without really intending to or when casting away const is done intentionally but is an error. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 12:06:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 673A75F5; Tue, 11 Nov 2014 12:06:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5393BFC9; Tue, 11 Nov 2014 12:06:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABC61B2044723; Tue, 11 Nov 2014 12:06:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABC60Z5044716; Tue, 11 Nov 2014 12:06:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411111206.sABC60Z5044716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 11 Nov 2014 12:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274376 - in head/sys: net 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 12:06:01 -0000 Author: hselasky Date: Tue Nov 11 12:05:59 2014 New Revision: 274376 URL: https://svnweb.freebsd.org/changeset/base/274376 Log: Fix some minor TSO issues: - Improve description of TSO limits. - Remove a not needed KASSERT() - Remove some not needed variable casts. Sponsored by: Mellanox Technologies Discussed with: lstewart @ MFC after: 1 week Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/netinet/tcp_output.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Nov 11 11:06:10 2014 (r274375) +++ head/sys/net/if.c Tue Nov 11 12:05:59 2014 (r274376) @@ -717,13 +717,6 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_hw_tsomaxsegsize); } } - /* - * If the "if_hw_tsomax" limit is set, check if it is - * too small: - */ - KASSERT(ifp->if_hw_tsomax == 0 || - ifp->if_hw_tsomax >= (IP_MAXPACKET / 8), - ("%s: if_hw_tsomax is outside of range", __func__)); #endif } #ifdef VIMAGE Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Nov 11 11:06:10 2014 (r274375) +++ head/sys/net/if_var.h Tue Nov 11 12:05:59 2014 (r274376) @@ -232,16 +232,24 @@ struct ifnet { counter_u64_t if_counters[IFCOUNTERS]; /* Stuff that's only temporary and doesn't belong here. */ - u_int if_hw_tsomax; /* TSO total burst length - * limit in bytes. A value of - * zero means no limit. Have - * to find a better place for - * it eventually. */ /* - * TSO fields for segment limits. If a field below is zero, - * there is no TSO segment limit. + * Network adapter TSO limits: + * =========================== + * + * If the "if_hw_tsomax" field is zero the maximum segment + * length limit does not apply. If the "if_hw_tsomaxsegcount" + * or the "if_hw_tsomaxsegsize" field is zero the TSO segment + * count limit does not apply. If all three fields are zero, + * there is no TSO limit. + * + * NOTE: The TSO limits only apply to the data payload part of + * a TCP/IP packet. That means there is no need to subtract + * space for ethernet-, vlan-, IP- or TCP- headers from the + * TSO limits unless the hardware driver in question requires + * so. */ + u_int if_hw_tsomax; /* TSO maximum size in bytes */ u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Nov 11 11:06:10 2014 (r274375) +++ head/sys/netinet/tcp_output.c Tue Nov 11 12:05:59 2014 (r274376) @@ -802,9 +802,9 @@ send: max_len = (if_hw_tsomax - hdrlen); if (max_len <= 0) { len = 0; - } else if (len > (u_int)max_len) { + } else if (len > max_len) { sendalot = 1; - len = (u_int)max_len; + len = max_len; } } @@ -817,7 +817,7 @@ send: max_len = 0; mb = sbsndmbuf(&so->so_snd, off, &moff); - while (mb != NULL && (u_int)max_len < len) { + while (mb != NULL && max_len < len) { u_int mlen; u_int frags; @@ -851,9 +851,9 @@ send: } if (max_len <= 0) { len = 0; - } else if (len > (u_int)max_len) { + } else if (len > max_len) { sendalot = 1; - len = (u_int)max_len; + len = max_len; } } @@ -864,7 +864,7 @@ send: */ max_len = (tp->t_maxopd - optlen); if ((off + len) < so->so_snd.sb_cc) { - moff = len % (u_int)max_len; + moff = len % max_len; if (moff != 0) { len -= moff; sendalot = 1; @@ -875,8 +875,8 @@ send: * In case there are too many small fragments * don't use TSO: */ - if (len <= (u_int)max_len) { - len = (u_int)max_len; + if (len <= max_len) { + len = max_len; sendalot = 1; tso = 0; } From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 12:37:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A75A8BF2; Tue, 11 Nov 2014 12:37:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93EB63CB; Tue, 11 Nov 2014 12:37:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABCbEbK061630; Tue, 11 Nov 2014 12:37:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABCbEOW061629; Tue, 11 Nov 2014 12:37:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411111237.sABCbEOW061629@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Nov 2014 12:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274377 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 12:37:14 -0000 Author: kib Date: Tue Nov 11 12:37:13 2014 New Revision: 274377 URL: https://svnweb.freebsd.org/changeset/base/274377 Log: On 965 and higher, map GTT as write-combining. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue Nov 11 12:05:59 2014 (r274376) +++ head/sys/dev/agp/agp_i810.c Tue Nov 11 12:37:13 2014 (r274377) @@ -115,6 +115,8 @@ static int agp_sb_get_gtt_total_entries( static int agp_i810_install_gatt(device_t dev); static int agp_i830_install_gatt(device_t dev); +static int agp_i965_install_gatt(device_t dev); +static int agp_g4x_install_gatt(device_t dev); static void agp_i810_deinstall_gatt(device_t dev); static void agp_i830_deinstall_gatt(device_t dev); @@ -397,7 +399,7 @@ static const struct agp_i810_driver agp_ .get_stolen_size = agp_i915_get_stolen_size, .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, .get_gtt_total_entries = agp_i965_get_gtt_total_entries, - .install_gatt = agp_i830_install_gatt, + .install_gatt = agp_i965_install_gatt, .deinstall_gatt = agp_i830_deinstall_gatt, .write_gtt = agp_i965_write_gtt, .install_gtt_pte = agp_i965_install_gtt_pte, @@ -466,7 +468,7 @@ static const struct agp_i810_driver agp_ .get_stolen_size = agp_i915_get_stolen_size, .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, .get_gtt_total_entries = agp_gen5_get_gtt_total_entries, - .install_gatt = agp_i830_install_gatt, + .install_gatt = agp_g4x_install_gatt, .deinstall_gatt = agp_i830_deinstall_gatt, .write_gtt = agp_g4x_write_gtt, .install_gtt_pte = agp_g4x_install_gtt_pte, @@ -489,7 +491,7 @@ static const struct agp_i810_driver agp_ .get_stolen_size = agp_sb_get_stolen_size, .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, .get_gtt_total_entries = agp_sb_get_gtt_total_entries, - .install_gatt = agp_i830_install_gatt, + .install_gatt = agp_g4x_install_gatt, .deinstall_gatt = agp_i830_deinstall_gatt, .write_gtt = agp_sb_write_gtt, .install_gtt_pte = agp_sb_install_gtt_pte, @@ -1406,14 +1408,11 @@ agp_i810_install_gatt(device_t dev) return (0); } -static int -agp_i830_install_gatt(device_t dev) +static void +agp_i830_install_gatt_init(struct agp_i810_softc *sc) { - struct agp_i810_softc *sc; uint32_t pgtblctl; - sc = device_get_softc(dev); - /* * The i830 automatically initializes the 128k gatt on boot. * GATT address is already in there, make sure it's enabled. @@ -1423,10 +1422,46 @@ agp_i830_install_gatt(device_t dev) bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, pgtblctl); sc->gatt->ag_physical = pgtblctl & ~1; +} + +static int +agp_i830_install_gatt(device_t dev) +{ + struct agp_i810_softc *sc; + + sc = device_get_softc(dev); + agp_i830_install_gatt_init(sc); return (0); } static int +agp_gen4_install_gatt(device_t dev, const vm_size_t gtt_offset) +{ + struct agp_i810_softc *sc; + + sc = device_get_softc(dev); + pmap_change_attr((vm_offset_t)rman_get_virtual(sc->sc_res[0]) + + gtt_offset, rman_get_size(sc->sc_res[0]) - gtt_offset, + VM_MEMATTR_WRITE_COMBINING); + agp_i830_install_gatt_init(sc); + return (0); +} + +static int +agp_i965_install_gatt(device_t dev) +{ + + return (agp_gen4_install_gatt(dev, 512 * 1024)); +} + +static int +agp_g4x_install_gatt(device_t dev) +{ + + return (agp_gen4_install_gatt(dev, 2 * 1024 * 1024)); +} + +static int agp_i810_attach(device_t dev) { struct agp_i810_softc *sc; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 12:52:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0F04119; Tue, 11 Nov 2014 12:52:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DFB28B0; Tue, 11 Nov 2014 12:52:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABCqkbB071584; Tue, 11 Nov 2014 12:52:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABCqkK1071583; Tue, 11 Nov 2014 12:52:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411111252.sABCqkK1071583@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Nov 2014 12:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274378 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 12:52:46 -0000 Author: kib Date: Tue Nov 11 12:52:45 2014 New Revision: 274378 URL: https://svnweb.freebsd.org/changeset/base/274378 Log: Based on some BIOS configuration (GGC register in host bridge, bit 1), IGP may declare subclass as either VGA-compatible, or non-VGA. The difference is that in the later case, IGP does not claim VGA cycles. Other than that, the device functions normally, and agp_i810 should attach to it. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue Nov 11 12:37:13 2014 (r274377) +++ head/sys/dev/agp/agp_i810.c Tue Nov 11 12:52:45 2014 (r274378) @@ -749,7 +749,8 @@ agp_i810_match(device_t dev) int i, devid; if (pci_get_class(dev) != PCIC_DISPLAY - || pci_get_subclass(dev) != PCIS_DISPLAY_VGA) + || (pci_get_subclass(dev) != PCIS_DISPLAY_VGA && + pci_get_subclass(dev) != PCIS_DISPLAY_OTHER)) return (NULL); devid = pci_get_devid(dev); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 12:56:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59AA6396; Tue, 11 Nov 2014 12:56:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CEDC8EE; Tue, 11 Nov 2014 12:56:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABCuVan072533; Tue, 11 Nov 2014 12:56:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABCuVT0072531; Tue, 11 Nov 2014 12:56:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411111256.sABCuVT0072531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Nov 2014 12:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274379 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 12:56:31 -0000 Author: kib Date: Tue Nov 11 12:56:30 2014 New Revision: 274379 URL: https://svnweb.freebsd.org/changeset/base/274379 Log: Initial attachment of the agp(4) to Haswell IGP. There is no handling of cacheablility control bits in GTT PTEs yet. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue Nov 11 12:52:45 2014 (r274378) +++ head/sys/dev/agp/agp_i810.c Tue Nov 11 12:56:30 2014 (r274379) @@ -503,6 +503,29 @@ static const struct agp_i810_driver agp_ .chipset_flush = agp_i810_chipset_flush, }; +static const struct agp_i810_driver agp_i810_hsw_driver = { + .chiptype = CHIP_SB, + .gen = 7, + .busdma_addr_mask_sz = 40, + .res_spec = agp_g4x_res_spec, + .check_active = agp_sb_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_sb_dump_regs, + .get_stolen_size = agp_sb_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_sb_get_gtt_total_entries, + .install_gatt = agp_g4x_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_sb_write_gtt, + .install_gtt_pte = agp_sb_install_gtt_pte, + .read_gtt_pte = agp_g4x_read_gtt_pte, + .read_gtt_pte_paddr = agp_sb_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i810_chipset_flush, +}; + /* For adding new devices, devid is the id of the graphics controller * (pci:0:2:0, for example). The placeholder (usually at pci:0:2:1) for the * second head should never be added. The bridge_offset is the offset to @@ -739,6 +762,41 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { + .devid = 0x04028086, + .name = "Haswell desktop GT1", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x04128086, + .name = "Haswell desktop GT2", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x040a8086, + .name = "Haswell server GT1", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x041a8086, + .name = "Haswell server GT2", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x04068086, + .name = "Haswell mobile GT1", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x04168086, + .name = "Haswell mobile GT2", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x0c168086, + .name = "Haswell SDV", + .driver = &agp_i810_hsw_driver + }, + { .devid = 0, } }; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 13:37:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F300CF5; Tue, 11 Nov 2014 13:37:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE84CB8; Tue, 11 Nov 2014 13:37:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABDbTlT096612; Tue, 11 Nov 2014 13:37:29 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABDbTnB096611; Tue, 11 Nov 2014 13:37:29 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411111337.sABDbTnB096611@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 11 Nov 2014 13:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274380 - head/sys/crypto/rijndael 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 13:37:29 -0000 Author: des Date: Tue Nov 11 13:37:28 2014 New Revision: 274380 URL: https://svnweb.freebsd.org/changeset/base/274380 Log: Fix gcc build: preserve const qualifier when casting input values. Noticed by: bz@ Submitted by: dim@ Modified: head/sys/crypto/rijndael/rijndael-api-fst.c Modified: head/sys/crypto/rijndael/rijndael-api-fst.c ============================================================================== --- head/sys/crypto/rijndael/rijndael-api-fst.c Tue Nov 11 12:56:30 2014 (r274379) +++ head/sys/crypto/rijndael/rijndael-api-fst.c Tue Nov 11 13:37:28 2014 (r274380) @@ -233,10 +233,10 @@ int rijndael_padEncrypt(cipherInstance * case MODE_CBC: iv = cipher->IV; for (i = numBlocks; i > 0; i--) { - ((u_int32_t*)block)[0] = ((u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0]; - ((u_int32_t*)block)[1] = ((u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1]; - ((u_int32_t*)block)[2] = ((u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2]; - ((u_int32_t*)block)[3] = ((u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3]; + ((u_int32_t*)block)[0] = ((const u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0]; + ((u_int32_t*)block)[1] = ((const u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1]; + ((u_int32_t*)block)[2] = ((const u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2]; + ((u_int32_t*)block)[3] = ((const u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3]; rijndaelEncrypt(key->rk, key->Nr, block, outBuffer); iv = outBuffer; input += 16; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 13:39:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61299E54 for ; Tue, 11 Nov 2014 13:39:46 +0000 (UTC) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 129D5CCB for ; Tue, 11 Nov 2014 13:39:45 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id q1so9473697lam.24 for ; Tue, 11 Nov 2014 05:39:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=kAxXQykdP7WZinkcg2F6p1PwR6OxBslJV3SR5nrWyLA=; b=FwU9c0a9iG5vIQ0Z0sWJRwi7E1ZXplqmmxA3s8htdhZrdvCLhTFHzK61/Yp8cdbA7P BbawDy9rK5U1zZGo0lxSxDQ5Sbt/ZbrB24ekDq/5QudIcVyMlfpyi20EMo74kKxw/VYM Rq9QALKXMVaA01Mh7Cp+Jyw/hzgyQWlIkfNDSLIcu1Bbsq2SOYQwB2n4cbZIq8/9mRoZ lqgIUNxJq4dSveTqPs1M8vT1o/eAcjps5w9WFdNlR5E+KRy9H/U2jNN5Vf5KWgm0RGCf hLNQFrmSxflTHbDgn3J1g0TPeelEy7fDAAE09OQDNU0q7ZCcMEenY/ZSlvF8Zu8OblBd Pfbg== X-Gm-Message-State: ALoCoQmHBA3tCW15yl3NO26Ml8qefKAQ/kd9IoluvEr7XefjS9wPeKNd0D/J8kiJmJ1TiZvgzxjY X-Received: by 10.152.234.227 with SMTP id uh3mr36570988lac.69.1415712837316; Tue, 11 Nov 2014 05:33:57 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id t6sm5987501lbb.23.2014.11.11.05.33.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Nov 2014 05:33:56 -0800 (PST) Message-ID: <54621043.9000502@freebsd.org> Date: Tue, 11 Nov 2014 16:33:55 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274365 - head/contrib/tzcode/stdtime References: <201411110407.sAB47gBT003976@svn.freebsd.org> In-Reply-To: <201411110407.sAB47gBT003976@svn.freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 13:39:46 -0000 On 11.11.2014 7:07, Garrett Cooper wrote: > Author: ngie > Date: Tue Nov 11 04:07:41 2014 > New Revision: 274365 > URL: https://svnweb.freebsd.org/changeset/base/274365 > > Log: > Revert WiP to contrib/tzcode accidentally committed with r274364 This code is wrong in any case, setting EOVERFLOW even in unneeded no-error cases like breaking from the loop. See how NetBSD does it correctly instead. > > Modified: > head/contrib/tzcode/stdtime/localtime.c > > Modified: head/contrib/tzcode/stdtime/localtime.c > ============================================================================== > --- head/contrib/tzcode/stdtime/localtime.c Tue Nov 11 04:06:05 2014 (r274364) > +++ head/contrib/tzcode/stdtime/localtime.c Tue Nov 11 04:07:41 2014 (r274365) > @@ -1792,11 +1792,7 @@ int delta; > > number0 = *number; > *number += delta; > - if ((*number < number0) != (delta < 0)) { > - errno = EOVERFLOW; > - return (1); > - } > - return (0); > + return (*number < number0) != (delta < 0); > } > > static int > @@ -1808,11 +1804,7 @@ int delta; > > number0 = *number; > *number += delta; > - if ((*number < number0) != (delta < 0)) { > - errno = EOVERFLOW; > - return (1); > - } > - return (0); > + return (*number < number0) != (delta < 0); > } > > static int > -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 14:07:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D10D319; Tue, 11 Nov 2014 14:07:58 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3E496F95; Tue, 11 Nov 2014 14:07:57 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 98993A1CE; Tue, 11 Nov 2014 14:07:55 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 986CC16CA; Tue, 11 Nov 2014 15:07:54 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> Date: Tue, 11 Nov 2014 15:07:54 +0100 In-Reply-To: <20141111223756.F3519@besplex.bde.org> (Bruce Evans's message of "Tue, 11 Nov 2014 22:48:36 +1100 (EST)") Message-ID: <86oasd6dad.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 14:07:58 -0000 Bruce Evans writes: > -Wcast-qual is not a very good warning option since the official way > to remove qualifiers in C is to cast them away. Casting them away is > better than using the __DECONST() abomination. The option exists > because it is too easy for sloppy code to cast away const without > really intending to or when casting away const is done intentionally > but is an error. I agree that __DECONST() is ugly (not least because it strips all qualifiers, not just const, so it should be DEQUAL()), but the alternative is worse. In my experience, the majority of cases where a cast discards a qualifier are bugs, with struct iov being one of very few legitimate use cases. In the same vein, you could also argue that it is wrong of gcc and clang to warn about underparanthesized boolean expressions or about using an assignment as a truth value. Yet these warnings are extremely useful, because code that triggers them is often either incorrect or easily misinterpreted by a casual reader. Apple's "goto fail" certificate verification bug was caused by code that was perfectly legal and looked fine at first glance but would have been caught by -Wunreachable-code. Unfortunately, turning it on in our tree breaks the build in non-trivially-fixable ways because it is triggered by const propagation into inline functions. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 14:30:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBA99752; Tue, 11 Nov 2014 14:30:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C875722C; Tue, 11 Nov 2014 14:30:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABEUZAA022386; Tue, 11 Nov 2014 14:30:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABEUZD4022385; Tue, 11 Nov 2014 14:30:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411111430.sABEUZD4022385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Nov 2014 14:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274381 - head/sys/dev/random 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 14:30:36 -0000 Author: kib Date: Tue Nov 11 14:30:35 2014 New Revision: 274381 URL: https://svnweb.freebsd.org/changeset/base/274381 Log: Update comment. Noted by: dim Approved by: secteam (des) MFC after: 4 days Modified: head/sys/dev/random/ivy.c Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Tue Nov 11 13:37:28 2014 (r274380) +++ head/sys/dev/random/ivy.c Tue Nov 11 14:30:35 2014 (r274381) @@ -70,7 +70,7 @@ ivy_rng_store(u_long *buf) retry = RETRY_COUNT; __asm __volatile( "1:\n\t" - "rdrand %1\n\t" /* read randomness into tmp */ + "rdrand %1\n\t" /* read randomness into rndval */ "jc 2f\n\t" /* CF is set on success, exit retry loop */ "dec %0\n\t" /* otherwise, retry-- */ "jne 1b\n\t" /* and loop if retries are not exhausted */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 14:59:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17FC3E45; Tue, 11 Nov 2014 14:59:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 049AD7FA; Tue, 11 Nov 2014 14:59:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABExkIS035736; Tue, 11 Nov 2014 14:59:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABExkAU035735; Tue, 11 Nov 2014 14:59:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411111459.sABExkAU035735@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 11 Nov 2014 14:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274382 - head/sys/amd64/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 14:59:47 -0000 Author: emaste Date: Tue Nov 11 14:59:46 2014 New Revision: 274382 URL: https://svnweb.freebsd.org/changeset/base/274382 Log: Add workaround for vt efifb's early use of PHYS_TO_DMAP In vt_efifb_init the framebuffer's physaddr is passed to PHYS_TO_DMAP before the DMAP is setup. The result is not actually accessed until after the mapping is setup, though. Loosen the assertion in PHYS_TO_DMAP for now, to allow use when dmaplimit == 0. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1142 Modified: head/sys/amd64/include/vmparam.h Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Tue Nov 11 14:30:35 2014 (r274381) +++ head/sys/amd64/include/vmparam.h Tue Nov 11 14:59:46 2014 (r274382) @@ -175,8 +175,14 @@ #define VM_MAX_ADDRESS UPT_MAX_ADDRESS #define VM_MIN_ADDRESS (0) +/* + * XXX Allowing dmaplimit == 0 is a temporary workaround for vt(4) efifb's + * early use of PHYS_TO_DMAP before the mapping is actually setup. This works + * because the result is not actually accessed until later, but the early + * vt fb startup needs to be reworked. + */ #define PHYS_TO_DMAP(x) ({ \ - KASSERT((x) < dmaplimit, \ + KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ ("physical address %#jx not covered by the DMAP", \ (uintmax_t)x)); \ (x) | DMAP_MIN_ADDRESS; }) From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 15:34:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 773F789F; Tue, 11 Nov 2014 15:34:07 +0000 (UTC) Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com [IPv6:2607:f8b0:400e:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CDBC88; Tue, 11 Nov 2014 15:34:07 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id z10so10347978pdj.29 for ; Tue, 11 Nov 2014 07:34:06 -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:from:subject:date:to; bh=KkIshoCp4R1Lf3R2RGJmUxxIO1AhjIeFLIyHPTNTMoc=; b=sdaS16Y1aMnsYApCgr8cBEZc2Jq1IouKARbavEi312p5mzAjT1RjjicveZ3fBN8fOW BWIhaE5aOmQZiNtSokOf0tRe28BQKi3ry6HHWrULGrBbPbwzmnnAQk+k74o5ngrkar8/ mWcF+45z44cnq9o2ZsbtOz6J12pLcXaLTxLA+P53uup5PSH9RiaNlwpwCO/L36MkWlkp SKHfIHwLRccLeXwt39qAL4aOCsN7OuzOnTcl09ze4cfWYC/WHlSQD+I3JvQ+WmbK65Yk FXRte8l8nwB3XtbQt7tgof8SfGzl9vaAn/uXFSiO1OPOyx9Yif07H78CpDWqW7asuHjs pRXg== X-Received: by 10.68.68.235 with SMTP id z11mr40188869pbt.102.1415720046688; Tue, 11 Nov 2014 07:34:06 -0800 (PST) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id b16sm15589675pdl.56.2014.11.11.07.34.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Nov 2014 07:34:05 -0800 (PST) References: <201411110407.sAB47gBT003976@svn.freebsd.org> <54621043.9000502@freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <54621043.9000502@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <920BE50C-2DBA-4DCE-BFAB-ACFC11C5A09E@gmail.com> X-Mailer: iPhone Mail (12B411) From: Garrett Cooper Subject: Re: svn commit: r274365 - head/contrib/tzcode/stdtime Date: Tue, 11 Nov 2014 07:34:04 -0800 To: Andrey Chernov Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 15:34:07 -0000 > On Nov 11, 2014, at 05:33, Andrey Chernov wrote: >=20 >> On 11.11.2014 7:07, Garrett Cooper wrote: >> Author: ngie >> Date: Tue Nov 11 04:07:41 2014 >> New Revision: 274365 >> URL: https://svnweb.freebsd.org/changeset/base/274365 >>=20 >> Log: >> Revert WiP to contrib/tzcode accidentally committed with r274364 >=20 > This code is wrong in any case, setting EOVERFLOW even in unneeded > no-error cases like breaking from the loop. See how NetBSD does it > correctly instead. Hi! I saw your reply earlier but hadn't gotten an opportunity to revise the p= atch like you suggested. I'll look at the NetBSD code and see if I can adapt= it to our copy of tzcode. Thank you!= From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 16:06:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DDBFCF for ; Tue, 11 Nov 2014 16:06:34 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E202CF74 for ; Tue, 11 Nov 2014 16:06:33 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id 10so7730152lbg.21 for ; Tue, 11 Nov 2014 08:06:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DU72SveHGJoIAz4uwDaZhBMeXmm8zTh+fc2Uk7HNqdo=; b=YirKDnGs/WGpzA9+RByUp5LmLiia3rB7oORiUt3dKQdJioxrbJYoIB87jcJ9IDb/6d W+dti2IWXe4TRwvAD4qQNdAZKhHQxCHccFxNgxFhzoVa/crbikoeVBUwgnmmxNC2w39E lDWYENpHJp6Uzrl/vViy1UgsZUHS7wtuBjsGGshwmKNEWBRBAVpDk6eHdyd5dfewPyyQ rn/K4GrITPtXy1xyGWAS7f0fV04TmeoW1NEgccYoj1IMC7KuZ3rOtp950E+/sGmFcLbn 4fVUNtiQyJVwpkwCTE395zdlOkbZmt9ceJd7NV1QGaGw2i7qQ8I4QwEn9duXbO2vT8Lq MdAw== X-Gm-Message-State: ALoCoQmWCYWmN4E9MPFyFaGoEyblt0xJH68XK7voq1EyZyStbMDwDKv4VmLk+bA6BjurwrvjYLA3 X-Received: by 10.112.11.133 with SMTP id q5mr16229164lbb.77.1415721985573; Tue, 11 Nov 2014 08:06:25 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id j6sm6077820lbs.9.2014.11.11.08.06.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Nov 2014 08:06:24 -0800 (PST) Message-ID: <54623400.1080407@freebsd.org> Date: Tue, 11 Nov 2014 19:06:24 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r274365 - head/contrib/tzcode/stdtime References: <201411110407.sAB47gBT003976@svn.freebsd.org> <54621043.9000502@freebsd.org> <920BE50C-2DBA-4DCE-BFAB-ACFC11C5A09E@gmail.com> In-Reply-To: <920BE50C-2DBA-4DCE-BFAB-ACFC11C5A09E@gmail.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 16:06:34 -0000 On 11.11.2014 18:34, Garrett Cooper wrote: >> This code is wrong in any case, setting EOVERFLOW even in unneeded >> no-error cases like breaking from the loop. See how NetBSD does it >> correctly instead. > > Hi! > I saw your reply earlier but hadn't gotten an opportunity to revise the patch like you suggested. I'll look at the NetBSD code and see if I can adapt it to our copy of tzcode. > Thank you! > Currently as we need only EOVERFLOW parts from it, I don't think it will be hard task to merge only them. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 16:37:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0D64874; Tue, 11 Nov 2014 16:37:04 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id A8A81386; Tue, 11 Nov 2014 16:37:04 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id EBBBF5A9F0C; Tue, 11 Nov 2014 16:31:05 +0000 (UTC) Date: Tue, 11 Nov 2014 16:31:05 +0000 From: Brooks Davis To: Dag-Erling Sm?rgrav Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde Message-ID: <20141111163105.GA69731@spindle.one-eyed-alien.net> References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> <86oasd6dad.fsf@nine.des.no> 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: <86oasd6dad.fsf@nine.des.no> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 16:37:04 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 11, 2014 at 03:07:54PM +0100, Dag-Erling Sm?rgrav wrote: > Bruce Evans writes: > > -Wcast-qual is not a very good warning option since the official way > > to remove qualifiers in C is to cast them away. Casting them away is > > better than using the __DECONST() abomination. The option exists > > because it is too easy for sloppy code to cast away const without > > really intending to or when casting away const is done intentionally > > but is an error. >=20 > I agree that __DECONST() is ugly (not least because it strips all > qualifiers, not just const, so it should be DEQUAL()), but the > alternative is worse. In my experience, the majority of cases where a > cast discards a qualifier are bugs, with struct iov being one of very > few legitimate use cases. On the processor we (SRI and Cambridge) are working on, pointers are not integers (we support some integer behaviors, but not pointer->int->pointer casts except in limited cases) and the current __DECONST implementation will need to die[0]. For existing C versions some sort of compiler support for __DECONST is probably the right thing to do. In general, we need to fix the C/C++ standard to us express the things we actually mean when we use const (for example see strchr()'s use of const). I believe the last issue now being tracked on Google's internal list of deficiencies in the C++ standard. -- Brooks [0] The recently discussed _ALIGN also needs to die and be replaced with something that increments the pointer (or returns how much to increment) rather than jamming it though a long. --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRiOcgACgkQXY6L6fI4GtTrRACfT999XBInar6dHmsmVrxRBx/f BF8AoN9pD0cIDbQn+7wpgyBqyMI/mwZD =qLQb -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 16:39:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D02EDAB1; Tue, 11 Nov 2014 16:39:55 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4443A1; Tue, 11 Nov 2014 16:39:55 +0000 (UTC) Received: from [172.17.156.35] (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.14.9/8.14.9) with ESMTP id sABGdkLe041780 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 11 Nov 2014 16:39:48 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be [172.17.156.35] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde From: David Chisnall In-Reply-To: <20141111163105.GA69731@spindle.one-eyed-alien.net> Date: Tue, 11 Nov 2014 16:39:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> <86oasd6dad.fsf@nine.des.no> <20141111163105.GA69731@spindle.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.1878.6) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org, Dag-Erling Sm?rgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 16:39:55 -0000 On 11 Nov 2014, at 16:31, Brooks Davis wrote: > In general, we need to fix the C/C++ standard to us express the > things we actually mean when we use const (for example see strchr()'s > use of const). I believe the last issue now being tracked on Google's > internal list of deficiencies in the C++ standard. One of the reviewers for a paper involving this pointed me at Jeffrey = Foster's work on qualifier polymorphism for C, which would address these issues. Unfortunately, = this work is quite old and didn't make it into the standard. David From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 16:49:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C0BEEE7; Tue, 11 Nov 2014 16:49:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88D39881; Tue, 11 Nov 2014 16:49:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABGnYDZ087271; Tue, 11 Nov 2014 16:49:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABGnYna087270; Tue, 11 Nov 2014 16:49:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411111649.sABGnYna087270@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 11 Nov 2014 16:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274383 - head/contrib/hyperv/tools 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 16:49:34 -0000 Author: delphij Date: Tue Nov 11 16:49:33 2014 New Revision: 274383 URL: https://svnweb.freebsd.org/changeset/base/274383 Log: Test errno against EEXIST as well. MFC after: 3 days Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Tue Nov 11 14:59:46 2014 (r274382) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Tue Nov 11 16:49:33 2014 (r274383) @@ -285,7 +285,7 @@ kvp_file_init(void) int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK; if (mkdir("/var/db/hyperv/pool", S_IRUSR | S_IWUSR | S_IROTH) < 0 && - errno != EISDIR) { + (errno != EEXIST && errno != EISDIR)) { KVP_LOG(LOG_ERR, " Failed to create /var/db/hyperv/pool\n"); exit(EXIT_FAILURE); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 16:51:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04500E0; Tue, 11 Nov 2014 16:51:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E51CF89D; Tue, 11 Nov 2014 16:51:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABGp037088602; Tue, 11 Nov 2014 16:51:00 GMT (envelope-from davidch@FreeBSD.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABGp0WW088601; Tue, 11 Nov 2014 16:51:00 GMT (envelope-from davidch@FreeBSD.org) Message-Id: <201411111651.sABGp0WW088601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidch set sender to davidch@FreeBSD.org using -f From: David Christensen Date: Tue, 11 Nov 2014 16:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274384 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 16:51:01 -0000 Author: davidch Date: Tue Nov 11 16:51:00 2014 New Revision: 274384 URL: https://svnweb.freebsd.org/changeset/base/274384 Log: Remove myself from bxe(4) maintenance. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Nov 11 16:49:33 2014 (r274383) +++ head/MAINTAINERS Tue Nov 11 16:51:00 2014 (r274384) @@ -48,7 +48,6 @@ cd(4) ken Pre-commit review requested. pass(4) ken Pre-commit review requested. ch(4) ken Pre-commit review requested. em(4) jfv Pre-commit review requested. -bxe(4) davidch Pre-commit review requested. tdfx(4) cokane Just keep me informed of changes, try not to break it. sendmail gshapiro Pre-commit review requested. etc/mail gshapiro Pre-commit review requested. From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:13:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 588CF5E9; Tue, 11 Nov 2014 17:13:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44BD0B33; Tue, 11 Nov 2014 17:13:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABHD48s000624; Tue, 11 Nov 2014 17:13:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABHD49g000623; Tue, 11 Nov 2014 17:13:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411111713.sABHD49g000623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 11 Nov 2014 17:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274385 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:13:04 -0000 Author: mav Date: Tue Nov 11 17:13:03 2014 New Revision: 274385 URL: https://svnweb.freebsd.org/changeset/base/274385 Log: MFC r272936: Update isp_tgt_map and send new arrival notification if target that departed earlier has returned. Previously that code worked only once, confusing CTL. Modified: stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue Nov 11 16:51:00 2014 (r274384) +++ stable/10/sys/dev/isp/isp_library.c Tue Nov 11 17:13:03 2014 (r274385) @@ -2540,6 +2540,10 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c isp_prt(isp, ISP_LOGWARN, "Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x reentered", chan, (unsigned long long) lp->port_wwn, lp->handle, lp->portid); } + if (fcp->isp_tgt_map[nphdl] == 0) { + fcp->isp_tgt_map[nphdl] = i + 1; + goto notify; + } return; } @@ -2573,6 +2577,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c isp_prt(isp, ISP_LOGTINFO, "Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x vtgt %d %s added", chan, (unsigned long long) ini, nphdl, s_id, fcp->isp_tgt_map[nphdl] - 1, buf); +notify: ISP_MEMZERO(&nt, sizeof (nt)); nt.nt_hba = isp; nt.nt_wwn = ini; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:14:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 649AA7C5; Tue, 11 Nov 2014 17:14:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B64AB56; Tue, 11 Nov 2014 17:14:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CC737B93B; Tue, 11 Nov 2014 12:14:02 -0500 (EST) From: John Baldwin To: Andrey Chernov Subject: Re: svn commit: r274365 - head/contrib/tzcode/stdtime Date: Tue, 11 Nov 2014 11:34:52 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201411110407.sAB47gBT003976@svn.freebsd.org> <920BE50C-2DBA-4DCE-BFAB-ACFC11C5A09E@gmail.com> <54623400.1080407@freebsd.org> In-Reply-To: <54623400.1080407@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201411111134.52984.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 11 Nov 2014 12:14:02 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Garrett Cooper , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:14:06 -0000 On Tuesday, November 11, 2014 11:06:24 am Andrey Chernov wrote: > On 11.11.2014 18:34, Garrett Cooper wrote: > >> This code is wrong in any case, setting EOVERFLOW even in unneeded > >> no-error cases like breaking from the loop. See how NetBSD does it > >> correctly instead. > > > > Hi! > > I saw your reply earlier but hadn't gotten an opportunity to revise the patch like you suggested. I'll look at the NetBSD code and see if I can adapt it to our copy of tzcode. > > Thank you! > > > > Currently as we need only EOVERFLOW parts from it, I don't think it will > be hard task to merge only them. Do you know if it is fixed upstream? I want to import newer tzcode from upstream to get implementations of the extensions to allow use of arbitrary time zones (mktime_z, etc.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:14:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09A78A6F; Tue, 11 Nov 2014 17:14:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA637B59; Tue, 11 Nov 2014 17:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABHECWn000856; Tue, 11 Nov 2014 17:14:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABHECKp000854; Tue, 11 Nov 2014 17:14:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201411111714.sABHECKp000854@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 11 Nov 2014 17:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274386 - in head/sys/dev: acpica 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:14:13 -0000 Author: adrian Date: Tue Nov 11 17:14:11 2014 New Revision: 274386 URL: https://svnweb.freebsd.org/changeset/base/274386 Log: Use the correct device (child) when asking the bus layer about which power state said device should go into. This was a snafu introduced in the ACPI/PCI awareness separation. When putting a device into a power state, the bus (and thus firmware, eg ACPI) should be asked before hand to check whether the device can indeed go into that power state. There's a set of nodes in ACPI under each device - the _SxD nodes - which state which ACPI power state to put the device into when the system is going into power save state 'x'. So when going into S3, the existence of an _S3D node would override whatever the system was trying to do. By default the PCI code wants to put devices into D3 before suspending. I have a laptop here (Asus Zenbook - check the PR) whose EHCI controller really wants to be in D2 during suspend, not D3. So if we put it into D3 and then try to enter S3, everything hangs. The device itself can go into D3 - it just can't be there when the call to ACPI to enter S3 occurs. The PCI patch fixes this. jkim@ noticed that the same is needed for the ACPI child device enumeration. Thankyou to Matt Dillon (the programmer, not the actor) for buying me this particular laptop so I could debug the issues with the Atheros AR9485 that is in it. It's his fault that I ended up with this laptop and was sufficiently annoyed by the lack of USB suspend to go down this rabbit hole. Tested: * Thinkpad T400 * Thinkpad X230 * Thinkpad T42 * Thinkpad T60 * Asus Zenbook (see PR) * Asus EEEPC 701 * Asus EEEPC 1001PX TODO: * Figure out what we should do about devices we unload drivers for that want to be in a specific state when entering S3 / S4 - the "put devices into D3 if they're not bound to a driver" option may also mess with things. PR: kern/194884 Reviewed by: jhb, jkim MFC after: 1 week Relnotes: yes Sponsored by: Matt Dillon (hardware) Modified: head/sys/dev/acpica/acpi.c head/sys/dev/pci/pci.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Nov 11 17:13:03 2014 (r274385) +++ head/sys/dev/acpica/acpi.c Tue Nov 11 17:14:11 2014 (r274386) @@ -710,7 +710,7 @@ acpi_set_power_children(device_t dev, in child = devlist[i]; dstate = state; if (device_is_attached(child) && - acpi_device_pwr_for_sleep(parent, dev, &dstate) == 0) + acpi_device_pwr_for_sleep(parent, child, &dstate) == 0) acpi_set_powerstate(child, dstate); } free(devlist, M_TEMP); Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Nov 11 17:13:03 2014 (r274385) +++ head/sys/dev/pci/pci.c Tue Nov 11 17:14:11 2014 (r274386) @@ -3651,7 +3651,7 @@ pci_set_power_child(device_t dev, device dinfo = device_get_ivars(child); dstate = state; if (device_is_attached(child) && - PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) + PCIB_POWER_FOR_SLEEP(pcib, child, &dstate) == 0) pci_set_powerstate(child, dstate); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:14:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 331B3BD6; Tue, 11 Nov 2014 17:14:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CE1CB67; Tue, 11 Nov 2014 17:14:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABHEZ2x000968; Tue, 11 Nov 2014 17:14:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABHEZKl000967; Tue, 11 Nov 2014 17:14:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411111714.sABHEZKl000967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 11 Nov 2014 17:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274387 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:14:36 -0000 Author: mav Date: Tue Nov 11 17:14:35 2014 New Revision: 274387 URL: https://svnweb.freebsd.org/changeset/base/274387 Log: MFC r274253: Fix LUN resize broken by r272911 commit. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Tue Nov 11 17:14:11 2014 (r274386) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Tue Nov 11 17:14:35 2014 (r274387) @@ -2369,7 +2369,7 @@ ctl_be_block_modify(struct ctl_be_block_ be_lun->params.lun_size_bytes = params->lun_size_bytes; - oldsize = be_lun->size_blocks; + oldsize = be_lun->size_bytes; if (be_lun->vn == NULL) error = ctl_be_block_open(softc, be_lun, req); else if (be_lun->vn->v_type == VREG) @@ -2377,7 +2377,7 @@ ctl_be_block_modify(struct ctl_be_block_ else error = ctl_be_block_modify_dev(be_lun, req); - if (error == 0 && be_lun->size_blocks != oldsize) { + if (error == 0 && be_lun->size_bytes != oldsize) { be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:17:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1235CD77; Tue, 11 Nov 2014 17:17:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7762B90; Tue, 11 Nov 2014 17:17:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABHHfqn001450; Tue, 11 Nov 2014 17:17:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABHHfmK001449; Tue, 11 Nov 2014 17:17:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411111717.sABHHfmK001449@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 11 Nov 2014 17:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274388 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:17:42 -0000 Author: mav Date: Tue Nov 11 17:17:41 2014 New Revision: 274388 URL: https://svnweb.freebsd.org/changeset/base/274388 Log: MFC r274080: Improve error handling around duplicate lun and port enable. This fixes kernel panic if port enabled twice and then disabled. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Nov 11 17:14:35 2014 (r274387) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Nov 11 17:17:41 2014 (r274388) @@ -1796,6 +1796,7 @@ ctlfe_online(void *arg) struct cam_path *path; cam_status status; struct ctlfe_lun_softc *lun_softc; + struct cam_periph *periph; bus_softc = (struct ctlfe_softc *)arg; @@ -1821,13 +1822,17 @@ ctlfe_online(void *arg) } xpt_path_lock(path); + periph = cam_periph_find(path, "ctl"); + if (periph != NULL) { + /* We've already got a periph, no need to alloc a new one. */ + xpt_path_unlock(path); + xpt_free_path(path); + free(lun_softc, M_CTLFE); + return; + } lun_softc->parent_softc = bus_softc; lun_softc->flags |= CTLFE_LUN_WILDCARD; - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); - status = cam_periph_alloc(ctlferegister, ctlfeoninvalidate, ctlfecleanup, @@ -1843,14 +1848,17 @@ ctlfe_online(void *arg) const struct cam_status_entry *entry; entry = cam_fetch_status_entry(status); - printf("%s: CAM error %s (%#x) returned from " "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); + free(lun_softc, M_CTLFE); + } else { + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); + ctlfe_onoffline(arg, /*online*/ 1); } - ctlfe_onoffline(arg, /*online*/ 1); - xpt_path_unlock(path); xpt_free_path(path); } @@ -1924,11 +1932,7 @@ ctlfe_lun_enable(void *arg, struct ctl_i free(softc, M_CTLFE); return (0); } - softc->parent_softc = bus_softc; - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); status = cam_periph_alloc(ctlferegister, ctlfeoninvalidate, @@ -1941,6 +1945,21 @@ ctlfe_lun_enable(void *arg, struct ctl_i 0, softc); + if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(status); + printf("%s: CAM error %s (%#x) returned from " + "cam_periph_alloc()\n", __func__, (entry != NULL) ? + entry->status_text : "Unknown", status); + free(softc, M_CTLFE); + } else { + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); + ctlfe_onoffline(arg, /*online*/ 1); + } + xpt_path_unlock(path); xpt_free_path(path); return (0); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:18:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28554EBD; Tue, 11 Nov 2014 17:18:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 149C0BA1; Tue, 11 Nov 2014 17:18:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABHIpZo001661; Tue, 11 Nov 2014 17:18:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABHIpbx001660; Tue, 11 Nov 2014 17:18:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411111718.sABHIpbx001660@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 11 Nov 2014 17:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274389 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:18:52 -0000 Author: mav Date: Tue Nov 11 17:18:51 2014 New Revision: 274389 URL: https://svnweb.freebsd.org/changeset/base/274389 Log: MFC r274081: Fix residual copy/paste in r274080. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Nov 11 17:17:41 2014 (r274388) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Nov 11 17:18:51 2014 (r274389) @@ -1957,7 +1957,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i mtx_lock(&bus_softc->lun_softc_mtx); STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); mtx_unlock(&bus_softc->lun_softc_mtx); - ctlfe_onoffline(arg, /*online*/ 1); } xpt_path_unlock(path); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:29:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C433A203; Tue, 11 Nov 2014 17:29:45 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 9C4401A40; Tue, 11 Nov 2014 17:29:44 +0000 (UTC) Message-ID: <54624770.5010303@FreeBSD.org> Date: Tue, 11 Nov 2014 20:29:20 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274151 - head/usr.bin/w References: <201411052354.sA5NsXTX072329@svn.freebsd.org> In-Reply-To: <201411052354.sA5NsXTX072329@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:29:45 -0000 On 06.11.2014 02:54, Marcel Moolenaar wrote: > Author: marcel > Date: Wed Nov 5 23:54:33 2014 > New Revision: 274151 > URL: https://svnweb.freebsd.org/changeset/base/274151 > > - (void)printf(" %d user%s", nusers, nusers == 1 ? "" : "s"); > + xo_emit(" {:users/%d} user%s", nusers, nusers == 1 ? "" : "s"); ^^^^ It looks like there is formatting problem. -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:33:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C20644D; Tue, 11 Nov 2014 17:33:06 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 352E71E22; Tue, 11 Nov 2014 17:33:04 +0000 (UTC) Message-ID: <54624839.4090807@FreeBSD.org> Date: Tue, 11 Nov 2014 20:32:41 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274151 - head/usr.bin/w References: <201411052354.sA5NsXTX072329@svn.freebsd.org> <54624770.5010303@FreeBSD.org> In-Reply-To: <54624770.5010303@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:33:06 -0000 On 11.11.2014 20:29, Andrey V. Elsukov wrote: > On 06.11.2014 02:54, Marcel Moolenaar wrote: >> Author: marcel >> Date: Wed Nov 5 23:54:33 2014 >> New Revision: 274151 >> URL: https://svnweb.freebsd.org/changeset/base/274151 >> >> - (void)printf(" %d user%s", nusers, nusers == 1 ? "" : "s"); >> + xo_emit(" {:users/%d} user%s", nusers, nusers == 1 ? "" : "s"); > ^^^^ > It looks like there is formatting problem. > Also we discovered the problem: # env LIBXO_OPTIONS="eatmem" uptime Segmentation fault (core dumped) # ls -lh *.core -rw------- 1 root wheel 18G Nov 11 21:37 uptime.core -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:47:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A2D77D7 for ; Tue, 11 Nov 2014 17:47:44 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF560EB2 for ; Tue, 11 Nov 2014 17:47:43 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id 10so7889371lbg.21 for ; Tue, 11 Nov 2014 09:47:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=/JZORMLLN9BcuaXVj0lsb5OhW2d4r65MSnTpMTrGBrc=; b=Hgk096RLoGsoCskJHB9Sl9idsWVmZOSH5ZurhYmIk7bx/4+DVifbCfH+utctCJ+P9H vM2hs3jvYhWjaKAA96Z3gl+8QLOCPrMx9ohYyeXOscWVF0lFYkRjK27XtjBg/7Bv0KDe tLmXJQWJPwJID/abCOGe9iBHnTEUInEqR8bmXjxSGlaK2girYD+2uZ/93de3p+afdYKI ORNXoS/mQKWIo3ksphrigBdTMOb6xP0bWSpUBsli+KXBPNXnabVJ/CoCSAgVebljEyRr UawKBg2FOhp29eQhD4u8gxGc4e+KaV3AxSUgLfqXZ7ecGAJsOdWxgT88rKcfjWnECGbA PDCQ== X-Gm-Message-State: ALoCoQkQ59MCa+yxh/b5oNxtw8np8vE5W5OZ9DEcTKZ0sVOPBbiK5fPQxEM4Yo2V/oxAWfnQcAzH X-Received: by 10.112.136.164 with SMTP id qb4mr37781587lbb.62.1415728061408; Tue, 11 Nov 2014 09:47:41 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id rd3sm3691570lbc.27.2014.11.11.09.47.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Nov 2014 09:47:40 -0800 (PST) Message-ID: <54624BBC.3070006@freebsd.org> Date: Tue, 11 Nov 2014 20:47:40 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r274365 - head/contrib/tzcode/stdtime References: <201411110407.sAB47gBT003976@svn.freebsd.org> <920BE50C-2DBA-4DCE-BFAB-ACFC11C5A09E@gmail.com> <54623400.1080407@freebsd.org> <201411111134.52984.jhb@freebsd.org> In-Reply-To: <201411111134.52984.jhb@freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Garrett Cooper , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:47:44 -0000 On 11.11.2014 19:34, John Baldwin wrote: > On Tuesday, November 11, 2014 11:06:24 am Andrey Chernov wrote: >> On 11.11.2014 18:34, Garrett Cooper wrote: >>>> This code is wrong in any case, setting EOVERFLOW even in unneeded >>>> no-error cases like breaking from the loop. See how NetBSD does it >>>> correctly instead. >>> >>> Hi! >>> I saw your reply earlier but hadn't gotten an opportunity to revise > the patch like you suggested. I'll look at the NetBSD code and see if I can > adapt it to our copy of tzcode. >>> Thank you! >>> >> >> Currently as we need only EOVERFLOW parts from it, I don't think it will >> be hard task to merge only them. > > Do you know if it is fixed upstream? I want to import newer tzcode from > upstream to get implementations of the extensions to allow use of arbitrary > time zones (mktime_z, etc.) > If you mean https://github.com/eggert/tz some NetBSD fixes, including part of EOVERFLOW fixes are merged there by Christos Zoulas reports, see the history in https://github.com/eggert/tz/commits/master/localtime.c But not all of them, NetBSD have more places with EOVERFLOW set (still missing in upstream). F.e. time2sub EOVERFLOW checks are not merged yet. BTW, latest NetBSD version claims that they merge 2014i tz code, so have mktime_z, etc too. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:59:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0303E28; Tue, 11 Nov 2014 17:59:24 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D81182; Tue, 11 Nov 2014 17:59:24 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x13so12317311wgg.8 for ; Tue, 11 Nov 2014 09:59:22 -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:message-id:subject :from:to:cc:content-type; bh=TyfxFAz7/KbqjZOQesFJdJxeWDhhQsPsDvAiYULQJ9o=; b=vNK+5+crzO+MUSqctHPAxGVvd1DrrwAUYGc6ZvU+XdNqK6VxXbfwERBKzsZSoEVHZ7 QZ7t9K8dGH3Brzxh5pF2AHIKCB2XKSccIHaO3oZYkrDDPe11L7h5Z0kevvcPZObhQ5qX 12u59aYkjGp+EjvE+Di7hQMYC8PK6F/YAJAtOyegvOoip2WC+eMhqfr6H5u63TXvpV9k ooW7xmnQau5TnuqNJChAyHVN21qUiHugBSU+g2ke81Mxo7FXV8woZq4us7Cm4fy1eZSN T+NwvAfzjLJCl3HJIjv4kJ/rXdLsmd8PXLCKUwJ3rcIuqL4unBhA6klZoDbsA3a4BnUN /I6w== MIME-Version: 1.0 X-Received: by 10.180.99.105 with SMTP id ep9mr42842814wib.26.1415728762688; Tue, 11 Nov 2014 09:59:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 11 Nov 2014 09:59:22 -0800 (PST) In-Reply-To: <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org> References: <201410181936.s9IJaCwu018930@svn.freebsd.org> <3279406.bOBVrcribU@ralph.baldwin.cx> <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org> Date: Tue, 11 Nov 2014 09:59:22 -0800 X-Google-Sender-Auth: M1sBJeW5-YbyQ-Lw8a1tKSg5fSo Message-ID: Subject: Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Luigi Rizzo , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 17:59:24 -0000 On 10 November 2014 23:22, Dimitry Andric wrote: > It is indeed used to calculate an address offset, but as it is already > checked against NOCPU, it should be good: > > gnu/usr.bin/gdb/kgdb/kthr.c: kt->cpu = td.td_oncpu; > gnu/usr.bin/gdb/kgdb/trgt_i386.c: if (kt == NULL || kt->cpu == NOCPU) > gnu/usr.bin/gdb/kgdb/trgt_i386.c: addr += (kt->cpu * NGDT + GPROC0_SEL) * sizeof(sd); > > Maybe the test could be strengthened to check that kt->cpu >= 0, but it > might be overkill. Ok, cool. Yeah, please do check that; it shouldn't ever be used as an address offset calculator if it's NOCPU. Thanks! -adrian From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 18:15:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61657759; Tue, 11 Nov 2014 18:15:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 421C3673; Tue, 11 Nov 2014 18:15:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABIF7b5029540; Tue, 11 Nov 2014 18:15:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABIF6fI029534; Tue, 11 Nov 2014 18:15:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411111815.sABIF6fI029534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Nov 2014 18:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274390 - head/sys/dev/rp 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 18:15:07 -0000 Author: jhb Date: Tue Nov 11 18:15:05 2014 New Revision: 274390 URL: https://svnweb.freebsd.org/changeset/base/274390 Log: Use the callout(9) API instead of timeout(9). To do this more cleanly, convert a global timer to a per-controller timer. This works much better with locking and removes the need for several global lookup tables. Tested by: ambrisko Modified: head/sys/dev/rp/rp.c head/sys/dev/rp/rp_pci.c head/sys/dev/rp/rpreg.h head/sys/dev/rp/rpvar.h Modified: head/sys/dev/rp/rp.c ============================================================================== --- head/sys/dev/rp/rp.c Tue Nov 11 17:18:51 2014 (r274389) +++ head/sys/dev/rp/rp.c Tue Nov 11 18:15:05 2014 (r274390) @@ -552,24 +552,12 @@ void sDisInterrupts(CHANNEL_T *ChP,Word_ Begin FreeBsd-specific driver code **********************************************************************/ -struct callout_handle rp_callout_handle; - -static int rp_num_ports_open = 0; -static int rp_ndevs = 0; - -static int rp_num_ports[4]; /* Number of ports on each controller */ - -#define POLL_INTERVAL 1 +#define POLL_INTERVAL (hz / 100) #define RP_ISMULTIPORT(dev) ((dev)->id_flags & 0x1) #define RP_MPMASTER(dev) (((dev)->id_flags >> 8) & 0xff) #define RP_NOTAST4(dev) ((dev)->id_flags & 0x04) -static struct rp_port *p_rp_addr[4]; -static struct rp_port *p_rp_table[MAX_RP_PORTS]; -#define rp_addr(unit) (p_rp_addr[unit]) -#define rp_table(port) (p_rp_table[port]) - /* * The top-level routines begin here */ @@ -676,46 +664,31 @@ static void rp_handle_port(struct rp_por */ } -static void rp_do_poll(void *not_used) +static void rp_do_poll(void *arg) { CONTROLLER_t *ctl; struct rp_port *rp; struct tty *tp; - int unit, aiop, ch, line, count; + int count; unsigned char CtlMask, AiopMask; - for(unit = 0; unit < rp_ndevs; unit++) { - rp = rp_addr(unit); + rp = arg; + tp = rp->rp_tty; + tty_lock_assert(tp, MA_OWNED); ctl = rp->rp_ctlp; CtlMask = ctl->ctlmask(ctl); - for(aiop=0; CtlMask; CtlMask >>=1, aiop++) { - if(CtlMask & 1) { - AiopMask = sGetAiopIntStatus(ctl, aiop); - for(ch = 0; AiopMask; AiopMask >>=1, ch++) { - if(AiopMask & 1) { - line = (unit << 5) | (aiop << 3) | ch; - rp = rp_table(line); - rp_handle_port(rp); - } - } + if (CtlMask & (1 << rp->rp_aiop)) { + AiopMask = sGetAiopIntStatus(ctl, rp->rp_aiop); + if (AiopMask & (1 << rp->rp_chan)) { + rp_handle_port(rp); } } - for(line = 0, rp = rp_addr(unit); line < rp_num_ports[unit]; - line++, rp++) { - tp = rp->rp_tty; - tty_lock(tp); - count = sGetTxCnt(&rp->rp_channel); - if (count >= 0 && - (count <= rp->rp_restart)) { - rpstart(tp); - } - tty_unlock(tp); + count = sGetTxCnt(&rp->rp_channel); + if (count >= 0 && (count <= rp->rp_restart)) { + rpstart(tp); } - } - if(rp_num_ports_open) - rp_callout_handle = timeout(rp_do_poll, - (void *)NULL, POLL_INTERVAL); + callout_schedule(&rp->rp_timer, POLL_INTERVAL); } static struct ttydevsw rp_tty_class = { @@ -745,7 +718,7 @@ rp_attachcommon(CONTROLLER_T *ctlp, int int unit; int num_chan; int aiop, chan, port; - int ChanStatus, line, count; + int ChanStatus; int retval; struct rp_port *rp; struct tty *tp; @@ -754,9 +727,8 @@ rp_attachcommon(CONTROLLER_T *ctlp, int printf("RocketPort%d (Version %s) %d ports.\n", unit, RocketPortVersion, num_ports); - rp_num_ports[unit] = num_ports; - callout_handle_init(&rp_callout_handle); + ctlp->num_ports = num_ports; ctlp->rp = rp = (struct rp_port *) malloc(sizeof(struct rp_port) * num_ports, M_DEVBUF, M_NOWAIT | M_ZERO); if (rp == NULL) { @@ -765,16 +737,12 @@ rp_attachcommon(CONTROLLER_T *ctlp, int goto nogo; } - count = unit * 32; /* board times max ports per card SG */ - - bzero(rp, sizeof(struct rp_port) * num_ports); - rp_addr(unit) = rp; - port = 0; for(aiop=0; aiop < num_aiops; aiop++) { num_chan = sGetAiopNumChan(ctlp, aiop); for(chan=0; chan < num_chan; chan++, port++, rp++) { rp->rp_tty = tp = tty_alloc(&rp_tty_class, rp); + callout_init_mtx(&rp->rp_timer, tty_getlock(tp), 0); rp->rp_port = port; rp->rp_ctlp = ctlp; rp->rp_unit = unit; @@ -794,13 +762,10 @@ rp_attachcommon(CONTROLLER_T *ctlp, int } ChanStatus = sGetChanStatus(&rp->rp_channel); rp->rp_cts = (ChanStatus & CTS_ACT) != 0; - line = (unit << 5) | (aiop << 3) | chan; - rp_table(line) = rp; tty_makedev(tp, NULL, "R%r%r", unit, port); } } - rp_ndevs++; mtx_init(&ctlp->hwmtx, "rp_hwmtx", NULL, MTX_DEF); ctlp->hwmtx_init = 1; return (0); @@ -814,40 +779,26 @@ nogo: void rp_releaseresource(CONTROLLER_t *ctlp) { - int i, unit; struct rp_port *rp; + int i; - - unit = device_get_unit(ctlp->dev); - if (rp_addr(unit) != NULL) { - for (i = 0; i < rp_num_ports[unit]; i++) { - rp = rp_addr(unit) + i; + if (ctlp->rp != NULL) { + for (i = 0; i < ctlp->num_ports; i++) { + rp = ctlp->rp + i; atomic_add_32(&ctlp->free, 1); tty_lock(rp->rp_tty); tty_rel_gone(rp->rp_tty); } + free(ctlp->rp, M_DEVBUF); + ctlp->rp = NULL; } while (ctlp->free != 0) { pause("rpwt", hz / 10); } - if (ctlp->rp != NULL) { - for (i = 0 ; i < sizeof(p_rp_addr) / sizeof(*p_rp_addr) ; i++) - if (p_rp_addr[i] == ctlp->rp) - p_rp_addr[i] = NULL; - for (i = 0 ; i < sizeof(p_rp_table) / sizeof(*p_rp_table) ; i++) - if (p_rp_table[i] == ctlp->rp) - p_rp_table[i] = NULL; - free(ctlp->rp, M_DEVBUF); - ctlp->rp = NULL; - } -} - -void -rp_untimeout(void) -{ - untimeout(rp_do_poll, (void *)NULL, rp_callout_handle); + if (ctlp->hwmtx_init) + mtx_destroy(&ctlp->hwmtx); } static int @@ -893,15 +844,11 @@ rpopen(struct tty *tp) sSetRTS(&rp->rp_channel); */ - rp_num_ports_open++; - IntMask = sGetChanIntID(&rp->rp_channel); IntMask = IntMask & rp->rp_intmask; ChanStatus = sGetChanStatus(&rp->rp_channel); - if(rp_num_ports_open == 1) - rp_callout_handle = timeout(rp_do_poll, - (void *)NULL, POLL_INTERVAL); + callout_reset(&rp->rp_timer, POLL_INTERVAL, rp_do_poll, rp); device_busy(rp->rp_ctlp->dev); return(0); @@ -913,6 +860,7 @@ rpclose(struct tty *tp) struct rp_port *rp; rp = tty_softc(tp); + callout_stop(&rp->rp_timer); rphardclose(tp); device_unbusy(rp->rp_ctlp->dev); } Modified: head/sys/dev/rp/rp_pci.c ============================================================================== --- head/sys/dev/rp/rp_pci.c Tue Nov 11 17:18:51 2014 (r274389) +++ head/sys/dev/rp/rp_pci.c Tue Nov 11 18:15:05 2014 (r274390) @@ -237,7 +237,7 @@ rp_pcishutdown(device_t dev) static void rp_pcireleaseresource(CONTROLLER_t *ctlp) { - rp_untimeout(); + rp_releaseresource(ctlp); if (ctlp->io != NULL) { if (ctlp->io[0] != NULL) bus_release_resource(ctlp->dev, SYS_RES_IOPORT, ctlp->io_rid[0], ctlp->io[0]); @@ -248,7 +248,6 @@ rp_pcireleaseresource(CONTROLLER_t *ctlp free(ctlp->io_rid, M_DEVBUF); ctlp->io = NULL; } - rp_releaseresource(ctlp); } static int Modified: head/sys/dev/rp/rpreg.h ============================================================================== --- head/sys/dev/rp/rpreg.h Tue Nov 11 17:18:51 2014 (r274389) +++ head/sys/dev/rp/rpreg.h Tue Nov 11 18:15:05 2014 (r274390) @@ -364,6 +364,7 @@ struct CONTROLLER_str struct mtx hwmtx; /* Spinlock protecting hardware. */ int hwmtx_init; int free; + int num_ports; /* Device and resource management */ device_t dev; /* device */ @@ -1008,18 +1009,17 @@ void sEnInterrupts(CHANNEL_T *ChP,Word_t void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags); int rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports); void rp_releaseresource(CONTROLLER_t *ctlp); -void rp_untimeout(void); static __inline void rp_lock(CONTROLLER_T *CtlP) { if (CtlP->hwmtx_init != 0) - mtx_lock_spin(&CtlP->hwmtx); + mtx_lock(&CtlP->hwmtx); } static __inline void rp_unlock(CONTROLLER_T *CtlP) { if (CtlP->hwmtx_init != 0) - mtx_unlock_spin(&CtlP->hwmtx); + mtx_unlock(&CtlP->hwmtx); } #ifndef ROCKET_C Modified: head/sys/dev/rp/rpvar.h ============================================================================== --- head/sys/dev/rp/rpvar.h Tue Nov 11 17:18:51 2014 (r274389) +++ head/sys/dev/rp/rpvar.h Tue Nov 11 18:15:05 2014 (r274390) @@ -43,6 +43,7 @@ struct rp_port { struct tty * rp_tty; /* cross reference */ + struct callout rp_timer; unsigned char state; /* state of dtr */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 18:47:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0909410E; Tue, 11 Nov 2014 18:47:29 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB9CAEB; Tue, 11 Nov 2014 18:47:27 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sABIlI32091697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 11 Nov 2014 21:47:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sABIlIw3091696; Tue, 11 Nov 2014 21:47:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 11 Nov 2014 21:47:18 +0300 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r274376 - in head/sys: net netinet Message-ID: <20141111184717.GF1031@FreeBSD.org> References: <201411111206.sABC60Z5044716@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411111206.sABC60Z5044716@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 18:47:29 -0000 On Tue, Nov 11, 2014 at 12:06:00PM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Tue Nov 11 12:05:59 2014 H> New Revision: 274376 H> URL: https://svnweb.freebsd.org/changeset/base/274376 H> H> Log: H> Fix some minor TSO issues: H> - Improve description of TSO limits. H> - Remove a not needed KASSERT() H> - Remove some not needed variable casts. H> H> Sponsored by: Mellanox Technologies H> Discussed with: lstewart @ H> MFC after: 1 week Thanks a lot for comments in if_var.h and removed KASSERT in if.c. I'm working on new ifnet API in my private branch and today spent half an hour trying to understand conventions around these three fields. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 18:54:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CDC93AB; Tue, 11 Nov 2014 18:54:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59B18C1A; Tue, 11 Nov 2014 18:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABIswcM048476; Tue, 11 Nov 2014 18:54:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABIsvD4048474; Tue, 11 Nov 2014 18:54:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411111854.sABIsvD4048474@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 11 Nov 2014 18:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274391 - head/gnu/usr.bin/gdb/kgdb 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 18:54:58 -0000 Author: dim Date: Tue Nov 11 18:54:57 2014 New Revision: 274391 URL: https://svnweb.freebsd.org/changeset/base/274391 Log: Change kbdb's kthr::cpu field into an int, to avoid gcc warnings about comparing it with NOCPU, which became -1 recently. While here, avoid using it for address calculations if it is negative. Reviewed by: jhb, adrian MFC after: 1 week Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.h head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.h ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kgdb.h Tue Nov 11 18:15:05 2014 (r274390) +++ head/gnu/usr.bin/gdb/kgdb/kgdb.h Tue Nov 11 18:54:57 2014 (r274391) @@ -41,7 +41,7 @@ struct kthr { uintptr_t pcb; int tid; int pid; - u_char cpu; + int cpu; }; extern struct kthr *curkthr; Modified: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Tue Nov 11 18:15:05 2014 (r274390) +++ head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Tue Nov 11 18:54:57 2014 (r274391) @@ -139,7 +139,7 @@ kgdb_trgt_fetch_tss(void) uintptr_t addr, cpu0prvpage, tss; kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid)); - if (kt == NULL || kt->cpu == NOCPU) + if (kt == NULL || kt->cpu == NOCPU || kt->cpu < 0) return (0); addr = kgdb_lookup("gdt"); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:28:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5896731A; Tue, 11 Nov 2014 19:28:57 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB4FFB7; Tue, 11 Nov 2014 19:28:57 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0A4E4B999; Tue, 11 Nov 2014 14:28:55 -0500 (EST) From: John Baldwin To: Andrey Chernov Subject: Re: svn commit: r274365 - head/contrib/tzcode/stdtime Date: Tue, 11 Nov 2014 14:04:16 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201411110407.sAB47gBT003976@svn.freebsd.org> <201411111134.52984.jhb@freebsd.org> <54624BBC.3070006@freebsd.org> In-Reply-To: <54624BBC.3070006@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201411111404.16812.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 11 Nov 2014 14:28:55 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Garrett Cooper , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:28:57 -0000 On Tuesday, November 11, 2014 12:47:40 pm Andrey Chernov wrote: > On 11.11.2014 19:34, John Baldwin wrote: > > On Tuesday, November 11, 2014 11:06:24 am Andrey Chernov wrote: > >> On 11.11.2014 18:34, Garrett Cooper wrote: > >>>> This code is wrong in any case, setting EOVERFLOW even in unneeded > >>>> no-error cases like breaking from the loop. See how NetBSD does it > >>>> correctly instead. > >>> > >>> Hi! > >>> I saw your reply earlier but hadn't gotten an opportunity to revise > > the patch like you suggested. I'll look at the NetBSD code and see if I can > > adapt it to our copy of tzcode. > >>> Thank you! > >>> > >> > >> Currently as we need only EOVERFLOW parts from it, I don't think it will > >> be hard task to merge only them. > > > > Do you know if it is fixed upstream? I want to import newer tzcode from > > upstream to get implementations of the extensions to allow use of arbitrary > > time zones (mktime_z, etc.) > > > > If you mean https://github.com/eggert/tz some NetBSD fixes, including > part of EOVERFLOW fixes are merged there by Christos Zoulas reports, see > the history in > https://github.com/eggert/tz/commits/master/localtime.c > But not all of them, NetBSD have more places with EOVERFLOW set (still > missing in upstream). F.e. time2sub EOVERFLOW checks are not merged yet. > BTW, latest NetBSD version claims that they merge 2014i tz code, so have > mktime_z, etc too. Yes, I mean that as the upstream. Sounds like merging in updated tzcode would be compatible with both of our goals (though more EOVERFLOW fixes might be needed afterward). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:37:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B452B832; Tue, 11 Nov 2014 19:37:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86CF6117; Tue, 11 Nov 2014 19:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABJbIti067880; Tue, 11 Nov 2014 19:37:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABJbHLl067878; Tue, 11 Nov 2014 19:37:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411111937.sABJbHLl067878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 11 Nov 2014 19:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274394 - in head/usr.sbin: bsdconfig/timezone tzsetup 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:37:18 -0000 Author: dteske Date: Tue Nov 11 19:37:17 2014 New Revision: 274394 URL: https://svnweb.freebsd.org/changeset/base/274394 Log: Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM. Recommended by: cperciva Reviewed by: cperciva Relnotes: tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC Modified: head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Tue Nov 11 19:12:57 2014 (r274393) +++ head/usr.sbin/bsdconfig/timezone/timezone Tue Nov 11 19:37:17 2014 (r274394) @@ -62,7 +62,7 @@ _PATH_WALL_CMOS_CLOCK="/etc/wall_cmos_cl REALLYDOIT=1 REINSTALL= USEDIALOG=1 -SKIPUTC= +SKIPUTC= # See MAIN VERBOSE= TZ_OR_FAIL= CHROOTENV= @@ -119,6 +119,9 @@ dialog_menu_main() ############################################################ MAIN +# Skip initial question regarding UTC v. Wall-Clock time if run in VM +[ "$( sysctl -n kern.vm_guest 2> /dev/null )" = "none" ] || SKIPUTC=1 + # Incorporate rc-file if it exists [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:12:57 2014 (r274393) +++ head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:37:17 2014 (r274394) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -910,8 +911,16 @@ main(int argc, char **argv) { char title[64], prompt[128]; int c, fd, rv, skiputc; + char vm_guest[16] = ""; + size_t len = sizeof(vm_guest); skiputc = 0; + + /* Default skiputc to 1 for VM guests */ + if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 && + strcmp(vm_guest, "none") != 0) + skiputc = 1; + while ((c = getopt(argc, argv, "C:nrs")) != -1) { switch(c) { case 'C': From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:41:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CB8CBB0; Tue, 11 Nov 2014 19:41:57 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCB251D9; Tue, 11 Nov 2014 19:41:56 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.14.9/8.14.9) with ESMTP id sABJfnMq027537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Nov 2014 11:41:49 -0800 Message-ID: <5462667D.9020804@freebsd.org> Date: Tue, 11 Nov 2014 11:41:49 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274394 - in head/usr.sbin: bsdconfig/timezone tzsetup References: <201411111937.sABJbHLl067878@svn.freebsd.org> In-Reply-To: <201411111937.sABJbHLl067878@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVb3g2bmxMCzAZ7ob4wduF+UKv5ZaLRhnDpqKCqPFheB9nSvNWC65KZadUY6il9NTgVy49l/9DaP4KgvBBOxdDjPDoY7RkKgh8M= X-Sonic-ID: C;gqsmx9pp5BGl4MqcqJ4NOg== M;Lu9ex9pp5BGl4MqcqJ4NOg== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:41:57 -0000 On 11/11/14 11:37, Devin Teske wrote: > Author: dteske > Date: Tue Nov 11 19:37:17 2014 > New Revision: 274394 > URL: https://svnweb.freebsd.org/changeset/base/274394 > > Log: > Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM. > > Recommended by: cperciva > Reviewed by: cperciva > Relnotes: tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC > > Modified: > head/usr.sbin/bsdconfig/timezone/timezone > head/usr.sbin/tzsetup/tzsetup.c > > Modified: head/usr.sbin/bsdconfig/timezone/timezone > ============================================================================== > --- head/usr.sbin/bsdconfig/timezone/timezone Tue Nov 11 19:12:57 2014 (r274393) > +++ head/usr.sbin/bsdconfig/timezone/timezone Tue Nov 11 19:37:17 2014 (r274394) > @@ -62,7 +62,7 @@ _PATH_WALL_CMOS_CLOCK="/etc/wall_cmos_cl > REALLYDOIT=1 > REINSTALL= > USEDIALOG=1 > -SKIPUTC= > +SKIPUTC= # See MAIN > VERBOSE= > TZ_OR_FAIL= > CHROOTENV= > @@ -119,6 +119,9 @@ dialog_menu_main() > > ############################################################ MAIN > > +# Skip initial question regarding UTC v. Wall-Clock time if run in VM > +[ "$( sysctl -n kern.vm_guest 2> /dev/null )" = "none" ] || SKIPUTC=1 > + > # Incorporate rc-file if it exists > [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" > > > Modified: head/usr.sbin/tzsetup/tzsetup.c > ============================================================================== > --- head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:12:57 2014 (r274393) > +++ head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:37:17 2014 (r274394) > @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > > @@ -910,8 +911,16 @@ main(int argc, char **argv) > { > char title[64], prompt[128]; > int c, fd, rv, skiputc; > + char vm_guest[16] = ""; > + size_t len = sizeof(vm_guest); > > skiputc = 0; > + > + /* Default skiputc to 1 for VM guests */ > + if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 && > + strcmp(vm_guest, "none") != 0) > + skiputc = 1; > + > while ((c = getopt(argc, argv, "C:nrs")) != -1) { > switch(c) { > case 'C': > You've mixed tabs and spaces here. Could you fix it? -Nathan From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:42:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFD5ECF7; Tue, 11 Nov 2014 19:42:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCF521E1; Tue, 11 Nov 2014 19:42:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABJgApk072032; Tue, 11 Nov 2014 19:42:10 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABJgA7W072031; Tue, 11 Nov 2014 19:42:10 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201411111942.sABJgA7W072031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 11 Nov 2014 19:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274397 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:42:11 -0000 Author: jkim Date: Tue Nov 11 19:42:10 2014 New Revision: 274397 URL: https://svnweb.freebsd.org/changeset/base/274397 Log: Use the correct device. Note this commit complements r274386. PR: 194884 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Nov 11 19:40:05 2014 (r274396) +++ head/sys/dev/acpica/acpi.c Tue Nov 11 19:42:10 2014 (r274397) @@ -694,7 +694,7 @@ acpi_attach(device_t dev) static void acpi_set_power_children(device_t dev, int state) { - device_t child, parent; + device_t child; device_t *devlist; int dstate, i, numdevs; @@ -705,12 +705,11 @@ acpi_set_power_children(device_t dev, in * Retrieve and set D-state for the sleep state if _SxD is present. * Skip children who aren't attached since they are handled separately. */ - parent = device_get_parent(dev); for (i = 0; i < numdevs; i++) { child = devlist[i]; dstate = state; if (device_is_attached(child) && - acpi_device_pwr_for_sleep(parent, child, &dstate) == 0) + acpi_device_pwr_for_sleep(dev, child, &dstate) == 0) acpi_set_powerstate(child, dstate); } free(devlist, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:45:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B290FA4; Tue, 11 Nov 2014 19:45:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72891218; Tue, 11 Nov 2014 19:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABJj0Wx072462; Tue, 11 Nov 2014 19:45:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABJj0xY072461; Tue, 11 Nov 2014 19:45:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411111945.sABJj0xY072461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Nov 2014 19:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274398 - head/sys/boot/i386/loader 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:45:00 -0000 Author: jhb Date: Tue Nov 11 19:44:59 2014 New Revision: 274398 URL: https://svnweb.freebsd.org/changeset/base/274398 Log: Move NFS and TFTP filesystems before the synthetic filesystems (bzip, gzip, and split). "Real" filesystems should always be listed first so that the "bare" filename is tried before alternate filenames. For PXE booting in particular this can remove a lot of spurious pathname lookups. While here, move splitfs to the bottom after the bzip and gzip filesystems as it is the least often used. Tested by: Prokash Sinha MFC after: 1 week Modified: head/sys/boot/i386/loader/conf.c Modified: head/sys/boot/i386/loader/conf.c ============================================================================== --- head/sys/boot/i386/loader/conf.c Tue Nov 11 19:42:10 2014 (r274397) +++ head/sys/boot/i386/loader/conf.c Tue Nov 11 19:44:59 2014 (r274398) @@ -80,8 +80,11 @@ struct fs_ops *file_system[] = { #if defined(LOADER_NANDFS_SUPPORT) &nandfs_fsops, #endif -#ifdef LOADER_SPLIT_SUPPORT - &splitfs_fsops, +#ifdef LOADER_NFS_SUPPORT + &nfs_fsops, +#endif +#ifdef LOADER_TFTP_SUPPORT + &tftp_fsops, #endif #ifdef LOADER_GZIP_SUPPORT &gzipfs_fsops, @@ -89,11 +92,8 @@ struct fs_ops *file_system[] = { #ifdef LOADER_BZIP2_SUPPORT &bzipfs_fsops, #endif -#ifdef LOADER_NFS_SUPPORT - &nfs_fsops, -#endif -#ifdef LOADER_TFTP_SUPPORT - &tftp_fsops, +#ifdef LOADER_SPLIT_SUPPORT + &splitfs_fsops, #endif NULL }; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:45:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C4D316E; Tue, 11 Nov 2014 19:45:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18EF2220; Tue, 11 Nov 2014 19:45:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABJjEM8072576; Tue, 11 Nov 2014 19:45:14 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABJjEj8072575; Tue, 11 Nov 2014 19:45:14 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411111945.sABJjEj8072575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 11 Nov 2014 19:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274399 - head/usr.sbin/tzsetup 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:45:15 -0000 Author: dteske Date: Tue Nov 11 19:45:14 2014 New Revision: 274399 URL: https://svnweb.freebsd.org/changeset/base/274399 Log: Fix whitespace. Thanks to: nwhitehorn Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:44:59 2014 (r274398) +++ head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:45:14 2014 (r274399) @@ -911,15 +911,15 @@ main(int argc, char **argv) { char title[64], prompt[128]; int c, fd, rv, skiputc; - char vm_guest[16] = ""; - size_t len = sizeof(vm_guest); + char vm_guest[16] = ""; + size_t len = sizeof(vm_guest); skiputc = 0; /* Default skiputc to 1 for VM guests */ - if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 && + if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 && strcmp(vm_guest, "none") != 0) - skiputc = 1; + skiputc = 1; while ((c = getopt(argc, argv, "C:nrs")) != -1) { switch(c) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:45:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAFDC39A; Tue, 11 Nov 2014 19:45:40 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B46F6233; Tue, 11 Nov 2014 19:45:40 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:60586 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Xo413-000OAz-UN; Mon, 10 Nov 2014 21:29:22 -0800 From: To: "'Nathan Whitehorn'" , "'Devin Teske'" , , , References: <201411111937.sABJbHLl067878@svn.freebsd.org> <5462667D.9020804@freebsd.org> In-Reply-To: <5462667D.9020804@freebsd.org> Subject: RE: svn commit: r274394 - in head/usr.sbin: bsdconfig/timezone tzsetup Date: Tue, 11 Nov 2014 11:45:31 -0800 Message-ID: <057b01cffde8$0db68860$29239920$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQFs1uS4cpB7ad/hsDKSWNYD3DA9RgGUY1BInRV/ITA= Content-Language: en-us Sender: devin@shxd.cx Cc: 'Devin Teske' X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:45:41 -0000 > -----Original Message----- > From: owner-src-committers@freebsd.org [mailto:owner-src- > committers@freebsd.org] On Behalf Of Nathan Whitehorn > Sent: Tuesday, November 11, 2014 11:42 AM > To: Devin Teske; src-committers@freebsd.org; svn-src-all@freebsd.org; = svn- > src-head@freebsd.org > Subject: Re: svn commit: r274394 - in head/usr.sbin: = bsdconfig/timezone > tzsetup >=20 >=20 > On 11/11/14 11:37, Devin Teske wrote: > > Author: dteske > > Date: Tue Nov 11 19:37:17 2014 > > New Revision: 274394 > > URL: https://svnweb.freebsd.org/changeset/base/274394 > > > > Log: > > Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM. > > > > Recommended by: cperciva > > Reviewed by: cperciva > > Relnotes: tzsetup and bsdconfig now assume that the "hardware" = clock > inside a VM is set to UTC > > > > Modified: > > head/usr.sbin/bsdconfig/timezone/timezone > > head/usr.sbin/tzsetup/tzsetup.c > > > > Modified: head/usr.sbin/bsdconfig/timezone/timezone > > > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.sbin/bsdconfig/timezone/timezone Tue Nov 11 19:12:57 > 2014 (r274393) > > +++ head/usr.sbin/bsdconfig/timezone/timezone Tue Nov 11 19:37:17 > 2014 (r274394) > > @@ -62,7 +62,7 @@ _PATH_WALL_CMOS_CLOCK=3D"/etc/wall_cmos_cl > > REALLYDOIT=3D1 > > REINSTALL=3D > > USEDIALOG=3D1 > > -SKIPUTC=3D > > +SKIPUTC=3D # See MAIN > > VERBOSE=3D > > TZ_OR_FAIL=3D > > CHROOTENV=3D > > @@ -119,6 +119,9 @@ dialog_menu_main() > > > > > ########################################################## > ## MAIN > > > > +# Skip initial question regarding UTC v. Wall-Clock time if run in = VM > > +[ "$( sysctl -n kern.vm_guest 2> /dev/null )" =3D "none" ] || = SKIPUTC=3D1 > > + > > # Incorporate rc-file if it exists > > [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" > > > > > > Modified: head/usr.sbin/tzsetup/tzsetup.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/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:12:57 2014 > (r274393) > > +++ head/usr.sbin/tzsetup/tzsetup.c Tue Nov 11 19:37:17 2014 > (r274394) > > @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > > > #include > > > > @@ -910,8 +911,16 @@ main(int argc, char **argv) > > { > > char title[64], prompt[128]; > > int c, fd, rv, skiputc; > > + char vm_guest[16] =3D ""; > > + size_t len =3D sizeof(vm_guest); > > > > skiputc =3D 0; > > + > > + /* Default skiputc to 1 for VM guests */ > > + if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) = =3D=3D 0 && > > + strcmp(vm_guest, "none") !=3D 0) > > + skiputc =3D 1; > > + > > while ((c =3D getopt(argc, argv, "C:nrs")) !=3D -1) { > > switch(c) { > > case 'C': > > >=20 > You've mixed tabs and spaces here. Could you fix it? Fixed. Thanks. --=20 Devin From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:49:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A1F0615; Tue, 11 Nov 2014 19:49:17 +0000 (UTC) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4DBC269; Tue, 11 Nov 2014 19:49:16 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id at20so12203520iec.3 for ; Tue, 11 Nov 2014 11:49:16 -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:message-id:subject :from:to:cc:content-type; bh=LgqJFXYHuSOdbeVDYt0h/E033av8B/sqYj+vgv1x/4Y=; b=0W8pZ0rz4G+hJoYv8eNnNYNyHlg6cVWlZMWla4astgZMVeTqTX3VbyCl1ZWnWiGpaW haaPdxvW1FamcpWcjsHoZMfQ4uSp6zTj748s6ahzMmzOiyqsRVN2lblOTlSqd9fMu8xS DuHiLpsECSxkPQwfwR+qvkmF+HEflaL1Rbq/jcgdrSjVRdde0e3xuIQbvmn3gORKxhz6 BxoPqLHMs7aTLkKnJmzb9NvrF2gKP1Uo4nETOlxQhFH9b/PG4YFEGZ/aIRHwkXFN+F7z TbyzBZdAEfUq6zwpaczB3O4J7lHJqrWC5jtBBhciMbDP25UdoI+RaQu36Safwe+On0XW uptw== MIME-Version: 1.0 X-Received: by 10.107.10.160 with SMTP id 32mr3000180iok.85.1415735356270; Tue, 11 Nov 2014 11:49:16 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.50.232.180 with HTTP; Tue, 11 Nov 2014 11:49:16 -0800 (PST) In-Reply-To: <201411111942.sABJgA7W072031@svn.freebsd.org> References: <201411111942.sABJgA7W072031@svn.freebsd.org> Date: Tue, 11 Nov 2014 11:49:16 -0800 X-Google-Sender-Auth: 8_LXcc3LeY_M3lExYgOC6_czN-I Message-ID: Subject: Re: svn commit: r274397 - head/sys/dev/acpica From: Adrian Chadd To: Jung-uk Kim 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:49:17 -0000 Hah, good catch! -adrian On 11 November 2014 11:42, Jung-uk Kim wrote: > Author: jkim > Date: Tue Nov 11 19:42:10 2014 > New Revision: 274397 > URL: https://svnweb.freebsd.org/changeset/base/274397 > > Log: > Use the correct device. Note this commit complements r274386. > > PR: 194884 > > Modified: > head/sys/dev/acpica/acpi.c > > Modified: head/sys/dev/acpica/acpi.c > ============================================================================== > --- head/sys/dev/acpica/acpi.c Tue Nov 11 19:40:05 2014 (r274396) > +++ head/sys/dev/acpica/acpi.c Tue Nov 11 19:42:10 2014 (r274397) > @@ -694,7 +694,7 @@ acpi_attach(device_t dev) > static void > acpi_set_power_children(device_t dev, int state) > { > - device_t child, parent; > + device_t child; > device_t *devlist; > int dstate, i, numdevs; > > @@ -705,12 +705,11 @@ acpi_set_power_children(device_t dev, in > * Retrieve and set D-state for the sleep state if _SxD is present. > * Skip children who aren't attached since they are handled separately. > */ > - parent = device_get_parent(dev); > for (i = 0; i < numdevs; i++) { > child = devlist[i]; > dstate = state; > if (device_is_attached(child) && > - acpi_device_pwr_for_sleep(parent, child, &dstate) == 0) > + acpi_device_pwr_for_sleep(dev, child, &dstate) == 0) > acpi_set_powerstate(child, dstate); > } > free(devlist, M_TEMP); > From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:51:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A1E577B; Tue, 11 Nov 2014 19:51:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16D46283; Tue, 11 Nov 2014 19:51:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABJpRG9076597; Tue, 11 Nov 2014 19:51:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABJpRYr076596; Tue, 11 Nov 2014 19:51:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411111951.sABJpRYr076596@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 11 Nov 2014 19:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274400 - releng/10.1/lib/csu/common 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:51:28 -0000 Author: gjb Date: Tue Nov 11 19:51:27 2014 New Revision: 274400 URL: https://svnweb.freebsd.org/changeset/base/274400 Log: Set static abitag to the current value of __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/lib/csu/common/crtbrand.c Modified: releng/10.1/lib/csu/common/crtbrand.c ============================================================================== --- releng/10.1/lib/csu/common/crtbrand.c Tue Nov 11 19:45:14 2014 (r274399) +++ releng/10.1/lib/csu/common/crtbrand.c Tue Nov 11 19:51:27 2014 (r274400) @@ -62,5 +62,5 @@ static const struct { .descsz = sizeof(int32_t), .type = ABI_NOTETYPE, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1001000 }; From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 19:52:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2072C9CD; Tue, 11 Nov 2014 19:52:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7B2234A; Tue, 11 Nov 2014 19:52:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABJqOq5077070; Tue, 11 Nov 2014 19:52:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABJqOwT077069; Tue, 11 Nov 2014 19:52:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411111952.sABJqOwT077069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 11 Nov 2014 19:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274401 - releng/10.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 19:52:25 -0000 Author: gjb Date: Tue Nov 11 19:52:24 2014 New Revision: 274401 URL: https://svnweb.freebsd.org/changeset/base/274401 Log: Forced commit to sys/conf/newvers.sh to mark the real 10.1-RELEASE point. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/sys/conf/newvers.sh Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 20:05:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C292CBD; Tue, 11 Nov 2014 20:05:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48C26662; Tue, 11 Nov 2014 20:05:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABK5pWe082290; Tue, 11 Nov 2014 20:05:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABK5pNp082289; Tue, 11 Nov 2014 20:05:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411112005.sABK5pNp082289@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Nov 2014 20:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274402 - head/sys/dev/cxgbe 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 20:05:51 -0000 Author: jhb Date: Tue Nov 11 20:05:50 2014 New Revision: 274402 URL: https://svnweb.freebsd.org/changeset/base/274402 Log: Add device ID for the T502-BT (dual-port 1G) adapter. Reviewed by: np MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Nov 11 19:52:24 2014 (r274401) +++ head/sys/dev/cxgbe/t4_main.c Tue Nov 11 20:05:50 2014 (r274402) @@ -490,6 +490,7 @@ struct { {0x5411, "Chelsio T520-LL-CR"}, /* 2 x 10G */ {0x5412, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */ {0x5414, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */ + {0x5415, "Chelsio T502-BT"}, /* 2 x 1G */ #ifdef notyet {0x5404, "Chelsio T520-BCH"}, {0x5405, "Chelsio T540-BCH"}, From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 20:32:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DB7A575; Tue, 11 Nov 2014 20:32:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E4299A; Tue, 11 Nov 2014 20:32:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABKWmkF096137; Tue, 11 Nov 2014 20:32:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABKWlVl096129; Tue, 11 Nov 2014 20:32:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411112032.sABKWlVl096129@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 11 Nov 2014 20:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274403 - in head/sys: compat/freebsd32 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 20:32:48 -0000 Author: glebius Date: Tue Nov 11 20:32:46 2014 New Revision: 274403 URL: https://svnweb.freebsd.org/changeset/base/274403 Log: Remove SF_KQUEUE code. This code was developed at Netflix, but was not ever used. It didn't go into stable/10, neither was documented. It might be useful, but we collectively decided to remove it, rather leave it abandoned and unmaintained. It is removed in one single commit, so restoring it should be easy, if anyone wants to reopen this idea. Sponsored by: Netflix Deleted: head/sys/sys/sf_base.h head/sys/sys/sf_sync.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_descrip.c head/sys/kern/uipc_syscalls.c head/sys/sys/file.h head/sys/sys/socket.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 11 20:05:50 2014 (r274402) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 11 20:32:46 2014 (r274403) @@ -83,10 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #ifdef INET #include @@ -1567,26 +1563,16 @@ struct sf_hdtr32 { int trl_cnt; }; -struct sf_hdtr_kq32 { - int kq_fd; - uint32_t kq_flags; - uint32_t kq_udata; /* 32-bit void ptr */ - uint32_t kq_ident; /* 32-bit uintptr_t */ -}; - static int freebsd32_do_sendfile(struct thread *td, struct freebsd32_sendfile_args *uap, int compat) { struct sf_hdtr32 hdtr32; struct sf_hdtr hdtr; - struct sf_hdtr_kq32 hdtr_kq32; - struct sf_hdtr_kq hdtr_kq; struct uio *hdr_uio, *trl_uio; struct iovec32 *iov32; - off_t offset; + off_t offset, sbytes; int error; - off_t sbytes; offset = PAIR32TO64(off_t, uap->offset); if (offset < 0) @@ -1617,31 +1603,17 @@ freebsd32_do_sendfile(struct thread *td, if (error) goto out; } - - /* - * If SF_KQUEUE is set, then we need to also copy in - * the kqueue data after the normal hdtr set and set do_kqueue=1. - */ - if (uap->flags & SF_KQUEUE) { - error = copyin(((char *) uap->hdtr) + sizeof(hdtr32), - &hdtr_kq32, - sizeof(hdtr_kq32)); - if (error != 0) - goto out; - - /* 32->64 bit fields */ - CP(hdtr_kq32, hdtr_kq, kq_fd); - CP(hdtr_kq32, hdtr_kq, kq_flags); - PTRIN_CP(hdtr_kq32, hdtr_kq, kq_udata); - CP(hdtr_kq32, hdtr_kq, kq_ident); - } } + AUDIT_ARG_FD(uap->fd); - /* Call sendfile */ - /* XXX stack depth! */ - error = _do_sendfile(td, uap->fd, uap->s, uap->flags, compat, - offset, uap->nbytes, &sbytes, hdr_uio, trl_uio, &hdtr_kq); + if ((error = fget_read(td, uap->fd, + cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) + goto out; + + error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, offset, + uap->nbytes, &sbytes, uap->flags, compat ? SFK_COMPAT : 0, td); + fdrop(fp, td); if (uap->sbytes != NULL) copyout(&sbytes, uap->sbytes, sizeof(off_t)); Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Nov 11 20:05:50 2014 (r274402) +++ head/sys/kern/kern_descrip.c Tue Nov 11 20:32:46 2014 (r274403) @@ -3684,7 +3684,7 @@ badfo_chown(struct file *fp, uid_t uid, static int badfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct sendfile_sync *sfs, struct thread *td) + int kflags, struct thread *td) { return (EBADF); @@ -3770,7 +3770,7 @@ invfo_chown(struct file *fp, uid_t uid, int invfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct sendfile_sync *sfs, struct thread *td) + int kflags, struct thread *td) { return (EINVAL); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Nov 11 20:05:50 2014 (r274402) +++ head/sys/kern/uipc_syscalls.c Tue Nov 11 20:32:46 2014 (r274403) @@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include @@ -115,10 +113,6 @@ static int getpeername1(struct thread *t counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; -static int filt_sfsync_attach(struct knote *kn); -static void filt_sfsync_detach(struct knote *kn); -static int filt_sfsync(struct knote *kn, long hint); - /* * sendfile(2)-related variables and associated sysctls */ @@ -128,28 +122,6 @@ static int sfreadahead = 1; SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); -#ifdef SFSYNC_DEBUG -static int sf_sync_debug = 0; -SYSCTL_INT(_debug, OID_AUTO, sf_sync_debug, CTLFLAG_RW, - &sf_sync_debug, 0, "Output debugging during sf_sync lifecycle"); -#define SFSYNC_DPRINTF(s, ...) \ - do { \ - if (sf_sync_debug) \ - printf((s), ##__VA_ARGS__); \ - } while (0) -#else -#define SFSYNC_DPRINTF(c, ...) -#endif - -static uma_zone_t zone_sfsync; - -static struct filterops sendfile_filtops = { - .f_isfd = 0, - .f_attach = filt_sfsync_attach, - .f_detach = filt_sfsync_detach, - .f_event = filt_sfsync, -}; - static void sfstat_init(const void *unused) { @@ -159,19 +131,6 @@ sfstat_init(const void *unused) } SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); -static void -sf_sync_init(const void *unused) -{ - - zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), - NULL, NULL, - NULL, NULL, - UMA_ALIGN_CACHE, - 0); - kqueue_add_filteropts(EVFILT_SENDFILE, &sendfile_filtops); -} -SYSINIT(sf_sync, SI_SUB_MBUF, SI_ORDER_FIRST, sf_sync_init, NULL); - static int sfstat_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1864,116 +1823,11 @@ getsockaddr(namp, uaddr, len) return (error); } -static int -filt_sfsync_attach(struct knote *kn) -{ - struct sendfile_sync *sfs = (struct sendfile_sync *) kn->kn_sdata; - struct knlist *knl = &sfs->klist; - - SFSYNC_DPRINTF("%s: kn=%p, sfs=%p\n", __func__, kn, sfs); - - /* - * Validate that we actually received this via the kernel API. - */ - if ((kn->kn_flags & EV_FLAG1) == 0) - return (EPERM); - - kn->kn_ptr.p_v = sfs; - kn->kn_flags &= ~EV_FLAG1; - - knl->kl_lock(knl->kl_lockarg); - /* - * If we're in the "freeing" state, - * don't allow the add. That way we don't - * end up racing with some other thread that - * is trying to finish some setup. - */ - if (sfs->state == SF_STATE_FREEING) { - knl->kl_unlock(knl->kl_lockarg); - return (EINVAL); - } - knlist_add(&sfs->klist, kn, 1); - knl->kl_unlock(knl->kl_lockarg); - - return (0); -} - -/* - * Called when a knote is being detached. - */ -static void -filt_sfsync_detach(struct knote *kn) -{ - struct knlist *knl; - struct sendfile_sync *sfs; - int do_free = 0; - - sfs = kn->kn_ptr.p_v; - knl = &sfs->klist; - - SFSYNC_DPRINTF("%s: kn=%p, sfs=%p\n", __func__, kn, sfs); - - knl->kl_lock(knl->kl_lockarg); - if (!knlist_empty(knl)) - knlist_remove(knl, kn, 1); - - /* - * If the list is empty _AND_ the refcount is 0 - * _AND_ we've finished the setup phase and now - * we're in the running phase, we can free the - * underlying sendfile_sync. - * - * But we shouldn't do it before finishing the - * underlying divorce from the knote. - * - * So, we have the sfsync lock held; transition - * it to "freeing", then unlock, then free - * normally. - */ - if (knlist_empty(knl)) { - if (sfs->state == SF_STATE_COMPLETED && sfs->count == 0) { - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; completed, " - "count==0, empty list: time to free!\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); - do_free = 1; - } - } - knl->kl_unlock(knl->kl_lockarg); - - /* - * Only call free if we're the one who has transitioned things - * to free. Otherwise we could race with another thread that - * is currently tearing things down. - */ - if (do_free == 1) { - SFSYNC_DPRINTF("%s: (%llu) sfs=%p, %s:%d\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs, - __FILE__, - __LINE__); - sf_sync_free(sfs); - } -} - -static int -filt_sfsync(struct knote *kn, long hint) -{ - struct sendfile_sync *sfs = (struct sendfile_sync *) kn->kn_ptr.p_v; - int ret; - - SFSYNC_DPRINTF("%s: kn=%p, sfs=%p\n", __func__, kn, sfs); - - /* - * XXX add a lock assertion here! - */ - ret = (sfs->count == 0 && sfs->state == SF_STATE_COMPLETED); - - return (ret); -} +struct sendfile_sync { + struct mtx mtx; + struct cv cv; + unsigned count; +}; /* * Add more references to a vm_page + sf_buf + sendfile_sync. @@ -2022,344 +1876,13 @@ sf_ext_free(void *arg1, void *arg2) vm_page_free(pg); vm_page_unlock(pg); - if (sfs != NULL) - sf_sync_deref(sfs); -} - -/* - * Called to remove a reference to a sf_sync object. - * - * This is generally done during the mbuf free path to signify - * that one of the mbufs in the transaction has been completed. - * - * If we're doing SF_SYNC and the refcount is zero then we'll wake - * up any waiters. - * - * IF we're doing SF_KQUEUE and the refcount is zero then we'll - * fire off the knote. - */ -void -sf_sync_deref(struct sendfile_sync *sfs) -{ - int do_free = 0; - - if (sfs == NULL) - return; - - mtx_lock(&sfs->mtx); - KASSERT(sfs->count> 0, ("Sendfile sync botchup count == 0")); - sfs->count --; - - /* - * Only fire off the wakeup / kqueue notification if - * we are in the running state. - */ - if (sfs->count == 0 && sfs->state == SF_STATE_COMPLETED) { - if (sfs->flags & SF_SYNC) + if (sfs != NULL) { + mtx_lock(&sfs->mtx); + KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); + if (--sfs->count == 0) cv_signal(&sfs->cv); - - if (sfs->flags & SF_KQUEUE) { - SFSYNC_DPRINTF("%s: (%llu) sfs=%p: knote!\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - KNOTE_LOCKED(&sfs->klist, 1); - } - - /* - * If we're not waiting around for a sync, - * check if the knote list is empty. - * If it is, we transition to free. - * - * XXX I think it's about time I added some state - * or flag that says whether we're supposed to be - * waiting around until we've done a signal. - * - * XXX Ie, the reason that I don't free it here - * is because the caller will free the last reference, - * not us. That should be codified in some flag - * that indicates "self-free" rather than checking - * for SF_SYNC all the time. - */ - if ((sfs->flags & SF_SYNC) == 0 && knlist_empty(&sfs->klist)) { - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; completed, " - "count==0, empty list: time to free!\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); - do_free = 1; - } - - } - mtx_unlock(&sfs->mtx); - - /* - * Attempt to do a free here. - * - * We do this outside of the lock because it may destroy the - * lock in question as it frees things. We can optimise this - * later. - * - * XXX yes, we should make it a requirement to hold the - * lock across sf_sync_free(). - */ - if (do_free == 1) { - SFSYNC_DPRINTF("%s: (%llu) sfs=%p\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - sf_sync_free(sfs); - } -} - -/* - * Allocate a sendfile_sync state structure. - * - * For now this only knows about the "sleep" sync, but later it will - * grow various other personalities. - */ -struct sendfile_sync * -sf_sync_alloc(uint32_t flags) -{ - struct sendfile_sync *sfs; - - sfs = uma_zalloc(zone_sfsync, M_WAITOK | M_ZERO); - mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); - cv_init(&sfs->cv, "sendfile"); - sfs->flags = flags; - sfs->state = SF_STATE_SETUP; - knlist_init_mtx(&sfs->klist, &sfs->mtx); - - SFSYNC_DPRINTF("%s: sfs=%p, flags=0x%08x\n", __func__, sfs, sfs->flags); - - return (sfs); -} - -/* - * Take a reference to a sfsync instance. - * - * This has to map 1:1 to free calls coming in via sf_ext_free(), - * so typically this will be referenced once for each mbuf allocated. - */ -void -sf_sync_ref(struct sendfile_sync *sfs) -{ - - if (sfs == NULL) - return; - - mtx_lock(&sfs->mtx); - sfs->count++; - mtx_unlock(&sfs->mtx); -} - -void -sf_sync_syscall_wait(struct sendfile_sync *sfs) -{ - - if (sfs == NULL) - return; - - KASSERT(mtx_owned(&sfs->mtx), ("%s: sfs=%p: not locked but should be!", - __func__, - sfs)); - - /* - * If we're not requested to wait during the syscall, - * don't bother waiting. - */ - if ((sfs->flags & SF_SYNC) == 0) - goto out; - - /* - * This is a bit suboptimal and confusing, so bear with me. - * - * Ideally sf_sync_syscall_wait() will wait until - * all pending mbuf transmit operations are done. - * This means that when sendfile becomes async, it'll - * run in the background and will transition from - * RUNNING to COMPLETED when it's finished acquiring - * new things to send. Then, when the mbufs finish - * sending, COMPLETED + sfs->count == 0 is enough to - * know that no further work is being done. - * - * So, we will sleep on both RUNNING and COMPLETED. - * It's up to the (in progress) async sendfile loop - * to transition the sf_sync from RUNNING to - * COMPLETED so the wakeup above will actually - * do the cv_signal() call. - */ - if (sfs->state != SF_STATE_COMPLETED && sfs->state != SF_STATE_RUNNING) - goto out; - - if (sfs->count != 0) - cv_wait(&sfs->cv, &sfs->mtx); - KASSERT(sfs->count == 0, ("sendfile sync still busy")); - -out: - return; -} - -/* - * Free an sf_sync if it's appropriate to. - */ -void -sf_sync_free(struct sendfile_sync *sfs) -{ - - if (sfs == NULL) - return; - - SFSYNC_DPRINTF("%s: (%lld) sfs=%p; called; state=%d, flags=0x%08x " - "count=%d\n", - __func__, - (long long) curthread->td_tid, - sfs, - sfs->state, - sfs->flags, - sfs->count); - - mtx_lock(&sfs->mtx); - - /* - * We keep the sf_sync around if the state is active, - * we are doing kqueue notification and we have active - * knotes. - * - * If the caller wants to free us right this second it - * should transition this to the freeing state. - * - * So, complain loudly if they break this rule. - */ - if (sfs->state != SF_STATE_FREEING) { - printf("%s: (%llu) sfs=%p; not freeing; let's wait!\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); mtx_unlock(&sfs->mtx); - return; } - - KASSERT(sfs->count == 0, ("sendfile sync still busy")); - cv_destroy(&sfs->cv); - /* - * This doesn't call knlist_detach() on each knote; it just frees - * the entire list. - */ - knlist_delete(&sfs->klist, curthread, 1); - mtx_destroy(&sfs->mtx); - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; freeing\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - uma_zfree(zone_sfsync, sfs); -} - -/* - * Setup a sf_sync to post a kqueue notification when things are complete. - */ -int -sf_sync_kqueue_setup(struct sendfile_sync *sfs, struct sf_hdtr_kq *sfkq) -{ - struct kevent kev; - int error; - - sfs->flags |= SF_KQUEUE; - - /* Check the flags are valid */ - if ((sfkq->kq_flags & ~(EV_CLEAR | EV_DISPATCH | EV_ONESHOT)) != 0) - return (EINVAL); - - SFSYNC_DPRINTF("%s: sfs=%p: kqfd=%d, flags=0x%08x, ident=%p, udata=%p\n", - __func__, - sfs, - sfkq->kq_fd, - sfkq->kq_flags, - (void *) sfkq->kq_ident, - (void *) sfkq->kq_udata); - - /* Setup and register a knote on the given kqfd. */ - kev.ident = (uintptr_t) sfkq->kq_ident; - kev.filter = EVFILT_SENDFILE; - kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | sfkq->kq_flags; - kev.data = (intptr_t) sfs; - kev.udata = sfkq->kq_udata; - - error = kqfd_register(sfkq->kq_fd, &kev, curthread, 1); - if (error != 0) { - SFSYNC_DPRINTF("%s: returned %d\n", __func__, error); - } - return (error); -} - -void -sf_sync_set_state(struct sendfile_sync *sfs, sendfile_sync_state_t state, - int islocked) -{ - sendfile_sync_state_t old_state; - - if (! islocked) - mtx_lock(&sfs->mtx); - - /* - * Update our current state. - */ - old_state = sfs->state; - sfs->state = state; - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; going from %d to %d\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs, - old_state, - state); - - /* - * If we're transitioning from RUNNING to COMPLETED and the count is - * zero, then post the knote. The caller may have completed the - * send before we updated the state to COMPLETED and we need to make - * sure this is communicated. - */ - if (old_state == SF_STATE_RUNNING - && state == SF_STATE_COMPLETED - && sfs->count == 0 - && sfs->flags & SF_KQUEUE) { - SFSYNC_DPRINTF("%s: (%llu) sfs=%p: triggering knote!\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - KNOTE_LOCKED(&sfs->klist, 1); - } - - if (! islocked) - mtx_unlock(&sfs->mtx); -} - -/* - * Set the retval/errno for the given transaction. - * - * This will eventually/ideally be used when the KNOTE is fired off - * to signify the completion of this transaction. - * - * The sfsync lock should be held before entering this function. - */ -void -sf_sync_set_retval(struct sendfile_sync *sfs, off_t retval, int xerrno) -{ - - KASSERT(mtx_owned(&sfs->mtx), ("%s: sfs=%p: not locked but should be!", - __func__, - sfs)); - - SFSYNC_DPRINTF("%s: (%llu) sfs=%p: errno=%d, retval=%jd\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs, - xerrno, - (intmax_t) retval); - - sfs->retval = retval; - sfs->xerrno = xerrno; } /* @@ -2380,174 +1903,15 @@ sys_sendfile(struct thread *td, struct s return (do_sendfile(td, uap, 0)); } -int -_do_sendfile(struct thread *td, int src_fd, int sock_fd, int flags, - int compat, off_t offset, size_t nbytes, off_t *sbytes, - struct uio *hdr_uio, - struct uio *trl_uio, struct sf_hdtr_kq *hdtr_kq) -{ - cap_rights_t rights; - struct sendfile_sync *sfs = NULL; - struct file *fp; - int error; - int do_kqueue = 0; - int do_free = 0; - - AUDIT_ARG_FD(src_fd); - - if (hdtr_kq != NULL) - do_kqueue = 1; - - /* - * sendfile(2) can start at any offset within a file so we require - * CAP_READ+CAP_SEEK = CAP_PREAD. - */ - if ((error = fget_read(td, src_fd, - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { - goto out; - } - - /* - * IF SF_KQUEUE is set but we haven't copied in anything for - * kqueue data, error out. - */ - if (flags & SF_KQUEUE && do_kqueue == 0) { - SFSYNC_DPRINTF("%s: SF_KQUEUE but no KQUEUE data!\n", __func__); - goto out; - } - - /* - * If we need to wait for completion, initialise the sfsync - * state here. - */ - if (flags & (SF_SYNC | SF_KQUEUE)) - sfs = sf_sync_alloc(flags & (SF_SYNC | SF_KQUEUE)); - - if (flags & SF_KQUEUE) { - error = sf_sync_kqueue_setup(sfs, hdtr_kq); - if (error) { - SFSYNC_DPRINTF("%s: (%llu) error; sfs=%p\n", - __func__, - (unsigned long long) curthread->td_tid, - sfs); - sf_sync_set_state(sfs, SF_STATE_FREEING, 0); - sf_sync_free(sfs); - goto out; - } - } - - /* - * Do the sendfile call. - * - * If this fails, it'll free the mbuf chain which will free up the - * sendfile_sync references. - */ - error = fo_sendfile(fp, sock_fd, hdr_uio, trl_uio, offset, - nbytes, sbytes, flags, compat ? SFK_COMPAT : 0, sfs, td); - - /* - * If the sendfile call succeeded, transition the sf_sync state - * to RUNNING, then COMPLETED. - * - * If the sendfile call failed, then the sendfile call may have - * actually sent some data first - so we check to see whether - * any data was sent. If some data was queued (ie, count > 0) - * then we can't call free; we have to wait until the partial - * transaction completes before we continue along. - * - * This has the side effect of firing off the knote - * if the refcount has hit zero by the time we get here. - */ - if (sfs != NULL) { - mtx_lock(&sfs->mtx); - if (error == 0 || sfs->count > 0) { - /* - * When it's time to do async sendfile, the transition - * to RUNNING signifies that we're actually actively - * adding and completing mbufs. When the last disk - * buffer is read (ie, when we're not doing any - * further read IO and all subsequent stuff is mbuf - * transmissions) we'll transition to COMPLETED - * and when the final mbuf is freed, the completion - * will be signaled. - */ - sf_sync_set_state(sfs, SF_STATE_RUNNING, 1); - - /* - * Set the retval before we signal completed. - * If we do it the other way around then transitioning to - * COMPLETED may post the knote before you set the return - * status! - * - * XXX for now, errno is always 0, as we don't post - * knotes if sendfile failed. Maybe that'll change later. - */ - sf_sync_set_retval(sfs, *sbytes, error); - - /* - * And now transition to completed, which will kick off - * the knote if required. - */ - sf_sync_set_state(sfs, SF_STATE_COMPLETED, 1); - } else { - /* - * Error isn't zero, sfs_count is zero, so we - * won't have some other thing to wake things up. - * Thus free. - */ - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); - do_free = 1; - } - - /* - * Next - wait if appropriate. - */ - sf_sync_syscall_wait(sfs); - - /* - * If we're not doing kqueue notifications, we can - * transition this immediately to the freeing state. - */ - if ((sfs->flags & SF_KQUEUE) == 0) { - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); - do_free = 1; - } - - mtx_unlock(&sfs->mtx); - } - - /* - * If do_free is set, free here. - * - * If we're doing no-kqueue notification and it's just sleep notification, - * we also do free; it's the only chance we have. - */ - if (sfs != NULL && do_free == 1) { - sf_sync_free(sfs); - } - - /* - * XXX Should we wait until the send has completed before freeing the source - * file handle? It's the previous behaviour, sure, but is it required? - * We've wired down the page references after all. - */ - fdrop(fp, td); - -out: - /* Return error */ - return (error); -} - - static int do_sendfile(struct thread *td, struct sendfile_args *uap, int compat) { struct sf_hdtr hdtr; - struct sf_hdtr_kq hdtr_kq; struct uio *hdr_uio, *trl_uio; - int error; + struct file *fp; + cap_rights_t rights; off_t sbytes; - int do_kqueue = 0; + int error; /* * File offset must be positive. If it goes beyond EOF @@ -2563,38 +1927,37 @@ do_sendfile(struct thread *td, struct se if (error != 0) goto out; if (hdtr.headers != NULL) { - error = copyinuio(hdtr.headers, hdtr.hdr_cnt, &hdr_uio); + error = copyinuio(hdtr.headers, hdtr.hdr_cnt, + &hdr_uio); if (error != 0) goto out; } if (hdtr.trailers != NULL) { - error = copyinuio(hdtr.trailers, hdtr.trl_cnt, &trl_uio); + error = copyinuio(hdtr.trailers, hdtr.trl_cnt, + &trl_uio); if (error != 0) goto out; } + } - /* - * If SF_KQUEUE is set, then we need to also copy in - * the kqueue data after the normal hdtr set and set - * do_kqueue=1. - */ - if (uap->flags & SF_KQUEUE) { - error = copyin(((char *) uap->hdtr) + sizeof(hdtr), - &hdtr_kq, - sizeof(hdtr_kq)); - if (error != 0) - goto out; - do_kqueue = 1; - } + AUDIT_ARG_FD(src_fd); + + /* + * sendfile(2) can start at any offset within a file so we require + * CAP_READ+CAP_SEEK = CAP_PREAD. + */ + if ((error = fget_read(td, uap->fd, + cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { + goto out; } - /* Call sendfile */ - error = _do_sendfile(td, uap->fd, uap->s, uap->flags, compat, - uap->offset, uap->nbytes, &sbytes, hdr_uio, trl_uio, &hdtr_kq); + error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, + uap->nbytes, &sbytes, uap->flags, compat ? SFK_COMPAT : 0, td); + fdrop(fp, td); - if (uap->sbytes != NULL) { + if (uap->sbytes != NULL) copyout(&sbytes, uap->sbytes, sizeof(off_t)); - } + out: free(hdr_uio, M_IOV); free(trl_uio, M_IOV); @@ -2819,7 +2182,7 @@ kern_sendfile_getsock(struct thread *td, int vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct sendfile_sync *sfs, struct thread *td) + int kflags, struct thread *td) { struct file *sock_fp; struct vnode *vp; @@ -2829,6 +2192,7 @@ vn_sendfile(struct file *fp, int sockfd, struct sf_buf *sf; struct vm_page *pg; struct shmfd *shmfd; + struct sendfile_sync *sfs; struct vattr va; off_t off, xfsize, fsbytes, sbytes, rem, obj_size; int error, bsize, nd, hdrlen, mnw; @@ -2837,6 +2201,7 @@ vn_sendfile(struct file *fp, int sockfd, obj = NULL; so = NULL; m = NULL; + sfs = NULL; fsbytes = sbytes = 0; hdrlen = mnw = 0; rem = nbytes; @@ -2860,6 +2225,12 @@ vn_sendfile(struct file *fp, int sockfd, if (flags & SF_MNOWAIT) mnw = 1; + if (flags & SF_SYNC) { + sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); + mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); + cv_init(&sfs->cv, "sendfile"); + } + #ifdef MAC error = mac_socket_check_send(td->td_ucred, so); if (error != 0) @@ -3106,12 +2477,11 @@ retry_space: loopbytes += xfsize; off += xfsize; - /* - * XXX eventually this should be a sfsync - * method call! - */ - if (sfs != NULL) - sf_sync_ref(sfs); + if (sfs != NULL) { + mtx_lock(&sfs->mtx); + sfs->count++; + mtx_unlock(&sfs->mtx); + } } if (vp != NULL) @@ -3193,6 +2563,16 @@ out: if (m) m_freem(m); + if (sfs != NULL) { + mtx_lock(&sfs->mtx); + if (sfs->count != 0) + cv_wait(&sfs->cv, &sfs->mtx); + KASSERT(sfs->count == 0, ("sendfile sync still busy")); + cv_destroy(&sfs->cv); + mtx_destroy(&sfs->mtx); + free(sfs, M_TEMP); + } + if (error == ERESTART) error = EINTR; Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Tue Nov 11 20:05:50 2014 (r274402) +++ head/sys/sys/file.h Tue Nov 11 20:32:46 2014 (r274403) @@ -90,9 +90,6 @@ foffset_get(struct file *fp) return (foffset_lock(fp, FOF_NOLOCK)); } -/* XXX pollution? */ -struct sendfile_sync; - typedef int fo_rdwr_t(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td); @@ -112,8 +109,7 @@ typedef int fo_chown_t(struct file *fp, struct ucred *active_cred, struct thread *td); typedef int fo_sendfile_t(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, - off_t *sent, int flags, int kflags, - struct sendfile_sync *sfs, struct thread *td); + off_t *sent, int flags, int kflags, struct thread *td); typedef int fo_seek_t(struct file *fp, off_t offset, int whence, struct thread *td); typedef int fo_fill_kinfo_t(struct file *fp, struct kinfo_file *kif, @@ -371,11 +367,11 @@ fo_chown(struct file *fp, uid_t uid, gid static __inline int fo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct sendfile_sync *sfs, struct thread *td) + int kflags, struct thread *td) { return ((*fp->f_ops->fo_sendfile)(fp, sockfd, hdr_uio, trl_uio, offset, - nbytes, sent, flags, kflags, sfs, td)); + nbytes, sent, flags, kflags, td)); } static __inline int Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Tue Nov 11 20:05:50 2014 (r274402) +++ head/sys/sys/socket.h Tue Nov 11 20:32:46 2014 (r274403) @@ -584,27 +584,11 @@ struct sf_hdtr { }; /* - * sendfile(2) kqueue information - */ -struct sf_hdtr_kq { - uintptr_t kq_ident; /* ident (from userland?) */ - void *kq_udata; /* user data pointer */ - uint32_t kq_flags; /* extra flags to pass in */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 20:43:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A65ACA93; Tue, 11 Nov 2014 20:43:51 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1C4AAF; Tue, 11 Nov 2014 20:43:51 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id y19so1728139wgg.7 for ; Tue, 11 Nov 2014 12:43:49 -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:message-id:subject :from:to:cc:content-type; bh=L282EHa+/Tb1hrDGLGwz+NJRCixZfDshkbhSoNSzjwQ=; b=jt10Z5XqXglxRH6zQsZx02VifOzbzfdK70xQ1vSlnLCdP6jc/X3fKTR5FDiOVrxewa 1/kzwHTrrwRC74/cPP+OZgXQQlkkqnOn50cwflUwzsPxDHiRYI2oYScG4frTOteEfJqb MjsyMdxJwjpePmWhPfRdsjqGFcizi1GLlqngVqsrl9tcodo8YYP1QHPlaCgonFpT5S3i dN3ms4kE+DdH1lYcd/6TEiaeLh7AIbqmUVI0qf3E6pcccH1UEgKMp8lB/mMptgi3EC0V UlHCOaPnWeqLMj965sQEYDXg2lbk01XpDZczOYakpyl5Kac+4GCl09EDHvyPJrtf5p3G m5kw== MIME-Version: 1.0 X-Received: by 10.180.188.41 with SMTP id fx9mr43066652wic.59.1415738629249; Tue, 11 Nov 2014 12:43:49 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 11 Nov 2014 12:43:49 -0800 (PST) In-Reply-To: <201411112032.sABKWlVl096129@svn.freebsd.org> References: <201411112032.sABKWlVl096129@svn.freebsd.org> Date: Tue, 11 Nov 2014 12:43:49 -0800 X-Google-Sender-Auth: lRYeDZwbLOwwMQtWnC-MJh8pBsQ Message-ID: Subject: Re: svn commit: r274403 - in head/sys: compat/freebsd32 kern sys From: Adrian Chadd To: Gleb Smirnoff 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 20:43:51 -0000 ... wait a sec, you're removing this without even asking first? I've been using this locally to implement / benchmark zero-copy socket writes from userland, which is what it was initially intended for. It's the only sane way of implementing notifications for shared memory based sendfile. I was going to release it as part of the RSS development suite so people could write applications without us having to implement actual zero-copy versions of write/writev for sockets. Please put it back into -HEAD. Thanks, -adrian On 11 November 2014 12:32, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Nov 11 20:32:46 2014 > New Revision: 274403 > URL: https://svnweb.freebsd.org/changeset/base/274403 > > Log: > Remove SF_KQUEUE code. This code was developed at Netflix, but was not > ever used. It didn't go into stable/10, neither was documented. > It might be useful, but we collectively decided to remove it, rather > leave it abandoned and unmaintained. It is removed in one single > commit, so restoring it should be easy, if anyone wants to reopen > this idea. > > Sponsored by: Netflix > > Deleted: > head/sys/sys/sf_base.h > head/sys/sys/sf_sync.h > Modified: > head/sys/compat/freebsd32/freebsd32_misc.c > head/sys/kern/kern_descrip.c > head/sys/kern/uipc_syscalls.c > head/sys/sys/file.h > head/sys/sys/socket.h > > Modified: head/sys/compat/freebsd32/freebsd32_misc.c > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 11 20:05:50 2014 (r274402) > +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 11 20:32:46 2014 (r274403) > @@ -83,10 +83,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > -#include > -#include > -#include > > #ifdef INET > #include > @@ -1567,26 +1563,16 @@ struct sf_hdtr32 { > int trl_cnt; > }; > > -struct sf_hdtr_kq32 { > - int kq_fd; > - uint32_t kq_flags; > - uint32_t kq_udata; /* 32-bit void ptr */ > - uint32_t kq_ident; /* 32-bit uintptr_t */ > -}; > - > static int > freebsd32_do_sendfile(struct thread *td, > struct freebsd32_sendfile_args *uap, int compat) > { > struct sf_hdtr32 hdtr32; > struct sf_hdtr hdtr; > - struct sf_hdtr_kq32 hdtr_kq32; > - struct sf_hdtr_kq hdtr_kq; > struct uio *hdr_uio, *trl_uio; > struct iovec32 *iov32; > - off_t offset; > + off_t offset, sbytes; > int error; > - off_t sbytes; > > offset = PAIR32TO64(off_t, uap->offset); > if (offset < 0) > @@ -1617,31 +1603,17 @@ freebsd32_do_sendfile(struct thread *td, > if (error) > goto out; > } > - > - /* > - * If SF_KQUEUE is set, then we need to also copy in > - * the kqueue data after the normal hdtr set and set do_kqueue=1. > - */ > - if (uap->flags & SF_KQUEUE) { > - error = copyin(((char *) uap->hdtr) + sizeof(hdtr32), > - &hdtr_kq32, > - sizeof(hdtr_kq32)); > - if (error != 0) > - goto out; > - > - /* 32->64 bit fields */ > - CP(hdtr_kq32, hdtr_kq, kq_fd); > - CP(hdtr_kq32, hdtr_kq, kq_flags); > - PTRIN_CP(hdtr_kq32, hdtr_kq, kq_udata); > - CP(hdtr_kq32, hdtr_kq, kq_ident); > - } > } > > + AUDIT_ARG_FD(uap->fd); > > - /* Call sendfile */ > - /* XXX stack depth! */ > - error = _do_sendfile(td, uap->fd, uap->s, uap->flags, compat, > - offset, uap->nbytes, &sbytes, hdr_uio, trl_uio, &hdtr_kq); > + if ((error = fget_read(td, uap->fd, > + cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) > + goto out; > + > + error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, offset, > + uap->nbytes, &sbytes, uap->flags, compat ? SFK_COMPAT : 0, td); > + fdrop(fp, td); > > if (uap->sbytes != NULL) > copyout(&sbytes, uap->sbytes, sizeof(off_t)); > > Modified: head/sys/kern/kern_descrip.c > ============================================================================== > --- head/sys/kern/kern_descrip.c Tue Nov 11 20:05:50 2014 (r274402) > +++ head/sys/kern/kern_descrip.c Tue Nov 11 20:32:46 2014 (r274403) > @@ -3684,7 +3684,7 @@ badfo_chown(struct file *fp, uid_t uid, > static int > badfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, > struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, > - int kflags, struct sendfile_sync *sfs, struct thread *td) > + int kflags, struct thread *td) > { > > return (EBADF); > @@ -3770,7 +3770,7 @@ invfo_chown(struct file *fp, uid_t uid, > int > invfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, > struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, > - int kflags, struct sendfile_sync *sfs, struct thread *td) > + int kflags, struct thread *td) > { > > return (EINVAL); > > Modified: head/sys/kern/uipc_syscalls.c > ============================================================================== > --- head/sys/kern/uipc_syscalls.c Tue Nov 11 20:05:50 2014 (r274402) > +++ head/sys/kern/uipc_syscalls.c Tue Nov 11 20:32:46 2014 (r274403) > @@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > -#include > #include > #include > #include > @@ -115,10 +113,6 @@ static int getpeername1(struct thread *t > > counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; > > -static int filt_sfsync_attach(struct knote *kn); > -static void filt_sfsync_detach(struct knote *kn); > -static int filt_sfsync(struct knote *kn, long hint); > - > /* > * sendfile(2)-related variables and associated sysctls > */ > @@ -128,28 +122,6 @@ static int sfreadahead = 1; > SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, > &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); > > -#ifdef SFSYNC_DEBUG > -static int sf_sync_debug = 0; > -SYSCTL_INT(_debug, OID_AUTO, sf_sync_debug, CTLFLAG_RW, > - &sf_sync_debug, 0, "Output debugging during sf_sync lifecycle"); > -#define SFSYNC_DPRINTF(s, ...) \ > - do { \ > - if (sf_sync_debug) \ > - printf((s), ##__VA_ARGS__); \ > - } while (0) > -#else > -#define SFSYNC_DPRINTF(c, ...) > -#endif > - > -static uma_zone_t zone_sfsync; > - > -static struct filterops sendfile_filtops = { > - .f_isfd = 0, > - .f_attach = filt_sfsync_attach, > - .f_detach = filt_sfsync_detach, > - .f_event = filt_sfsync, > -}; > - > static void > sfstat_init(const void *unused) > { > @@ -159,19 +131,6 @@ sfstat_init(const void *unused) > } > SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); > > -static void > -sf_sync_init(const void *unused) > -{ > - > - zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), > - NULL, NULL, > - NULL, NULL, > - UMA_ALIGN_CACHE, > - 0); > - kqueue_add_filteropts(EVFILT_SENDFILE, &sendfile_filtops); > -} > -SYSINIT(sf_sync, SI_SUB_MBUF, SI_ORDER_FIRST, sf_sync_init, NULL); > - > static int > sfstat_sysctl(SYSCTL_HANDLER_ARGS) > { > @@ -1864,116 +1823,11 @@ getsockaddr(namp, uaddr, len) > return (error); > } > > -static int > -filt_sfsync_attach(struct knote *kn) > -{ > - struct sendfile_sync *sfs = (struct sendfile_sync *) kn->kn_sdata; > - struct knlist *knl = &sfs->klist; > - > - SFSYNC_DPRINTF("%s: kn=%p, sfs=%p\n", __func__, kn, sfs); > - > - /* > - * Validate that we actually received this via the kernel API. > - */ > - if ((kn->kn_flags & EV_FLAG1) == 0) > - return (EPERM); > - > - kn->kn_ptr.p_v = sfs; > - kn->kn_flags &= ~EV_FLAG1; > - > - knl->kl_lock(knl->kl_lockarg); > - /* > - * If we're in the "freeing" state, > - * don't allow the add. That way we don't > - * end up racing with some other thread that > - * is trying to finish some setup. > - */ > - if (sfs->state == SF_STATE_FREEING) { > - knl->kl_unlock(knl->kl_lockarg); > - return (EINVAL); > - } > - knlist_add(&sfs->klist, kn, 1); > - knl->kl_unlock(knl->kl_lockarg); > - > - return (0); > -} > - > -/* > - * Called when a knote is being detached. > - */ > -static void > -filt_sfsync_detach(struct knote *kn) > -{ > - struct knlist *knl; > - struct sendfile_sync *sfs; > - int do_free = 0; > - > - sfs = kn->kn_ptr.p_v; > - knl = &sfs->klist; > - > - SFSYNC_DPRINTF("%s: kn=%p, sfs=%p\n", __func__, kn, sfs); > - > - knl->kl_lock(knl->kl_lockarg); > - if (!knlist_empty(knl)) > - knlist_remove(knl, kn, 1); > - > - /* > - * If the list is empty _AND_ the refcount is 0 > - * _AND_ we've finished the setup phase and now > - * we're in the running phase, we can free the > - * underlying sendfile_sync. > - * > - * But we shouldn't do it before finishing the > - * underlying divorce from the knote. > - * > - * So, we have the sfsync lock held; transition > - * it to "freeing", then unlock, then free > - * normally. > - */ > - if (knlist_empty(knl)) { > - if (sfs->state == SF_STATE_COMPLETED && sfs->count == 0) { > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; completed, " > - "count==0, empty list: time to free!\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); > - do_free = 1; > - } > - } > - knl->kl_unlock(knl->kl_lockarg); > - > - /* > - * Only call free if we're the one who has transitioned things > - * to free. Otherwise we could race with another thread that > - * is currently tearing things down. > - */ > - if (do_free == 1) { > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p, %s:%d\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs, > - __FILE__, > - __LINE__); > - sf_sync_free(sfs); > - } > -} > - > -static int > -filt_sfsync(struct knote *kn, long hint) > -{ > - struct sendfile_sync *sfs = (struct sendfile_sync *) kn->kn_ptr.p_v; > - int ret; > - > - SFSYNC_DPRINTF("%s: kn=%p, sfs=%p\n", __func__, kn, sfs); > - > - /* > - * XXX add a lock assertion here! > - */ > - ret = (sfs->count == 0 && sfs->state == SF_STATE_COMPLETED); > - > - return (ret); > -} > +struct sendfile_sync { > + struct mtx mtx; > + struct cv cv; > + unsigned count; > +}; > > /* > * Add more references to a vm_page + sf_buf + sendfile_sync. > @@ -2022,344 +1876,13 @@ sf_ext_free(void *arg1, void *arg2) > vm_page_free(pg); > vm_page_unlock(pg); > > - if (sfs != NULL) > - sf_sync_deref(sfs); > -} > - > -/* > - * Called to remove a reference to a sf_sync object. > - * > - * This is generally done during the mbuf free path to signify > - * that one of the mbufs in the transaction has been completed. > - * > - * If we're doing SF_SYNC and the refcount is zero then we'll wake > - * up any waiters. > - * > - * IF we're doing SF_KQUEUE and the refcount is zero then we'll > - * fire off the knote. > - */ > -void > -sf_sync_deref(struct sendfile_sync *sfs) > -{ > - int do_free = 0; > - > - if (sfs == NULL) > - return; > - > - mtx_lock(&sfs->mtx); > - KASSERT(sfs->count> 0, ("Sendfile sync botchup count == 0")); > - sfs->count --; > - > - /* > - * Only fire off the wakeup / kqueue notification if > - * we are in the running state. > - */ > - if (sfs->count == 0 && sfs->state == SF_STATE_COMPLETED) { > - if (sfs->flags & SF_SYNC) > + if (sfs != NULL) { > + mtx_lock(&sfs->mtx); > + KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); > + if (--sfs->count == 0) > cv_signal(&sfs->cv); > - > - if (sfs->flags & SF_KQUEUE) { > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p: knote!\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - KNOTE_LOCKED(&sfs->klist, 1); > - } > - > - /* > - * If we're not waiting around for a sync, > - * check if the knote list is empty. > - * If it is, we transition to free. > - * > - * XXX I think it's about time I added some state > - * or flag that says whether we're supposed to be > - * waiting around until we've done a signal. > - * > - * XXX Ie, the reason that I don't free it here > - * is because the caller will free the last reference, > - * not us. That should be codified in some flag > - * that indicates "self-free" rather than checking > - * for SF_SYNC all the time. > - */ > - if ((sfs->flags & SF_SYNC) == 0 && knlist_empty(&sfs->klist)) { > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; completed, " > - "count==0, empty list: time to free!\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); > - do_free = 1; > - } > - > - } > - mtx_unlock(&sfs->mtx); > - > - /* > - * Attempt to do a free here. > - * > - * We do this outside of the lock because it may destroy the > - * lock in question as it frees things. We can optimise this > - * later. > - * > - * XXX yes, we should make it a requirement to hold the > - * lock across sf_sync_free(). > - */ > - if (do_free == 1) { > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - sf_sync_free(sfs); > - } > -} > - > -/* > - * Allocate a sendfile_sync state structure. > - * > - * For now this only knows about the "sleep" sync, but later it will > - * grow various other personalities. > - */ > -struct sendfile_sync * > -sf_sync_alloc(uint32_t flags) > -{ > - struct sendfile_sync *sfs; > - > - sfs = uma_zalloc(zone_sfsync, M_WAITOK | M_ZERO); > - mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); > - cv_init(&sfs->cv, "sendfile"); > - sfs->flags = flags; > - sfs->state = SF_STATE_SETUP; > - knlist_init_mtx(&sfs->klist, &sfs->mtx); > - > - SFSYNC_DPRINTF("%s: sfs=%p, flags=0x%08x\n", __func__, sfs, sfs->flags); > - > - return (sfs); > -} > - > -/* > - * Take a reference to a sfsync instance. > - * > - * This has to map 1:1 to free calls coming in via sf_ext_free(), > - * so typically this will be referenced once for each mbuf allocated. > - */ > -void > -sf_sync_ref(struct sendfile_sync *sfs) > -{ > - > - if (sfs == NULL) > - return; > - > - mtx_lock(&sfs->mtx); > - sfs->count++; > - mtx_unlock(&sfs->mtx); > -} > - > -void > -sf_sync_syscall_wait(struct sendfile_sync *sfs) > -{ > - > - if (sfs == NULL) > - return; > - > - KASSERT(mtx_owned(&sfs->mtx), ("%s: sfs=%p: not locked but should be!", > - __func__, > - sfs)); > - > - /* > - * If we're not requested to wait during the syscall, > - * don't bother waiting. > - */ > - if ((sfs->flags & SF_SYNC) == 0) > - goto out; > - > - /* > - * This is a bit suboptimal and confusing, so bear with me. > - * > - * Ideally sf_sync_syscall_wait() will wait until > - * all pending mbuf transmit operations are done. > - * This means that when sendfile becomes async, it'll > - * run in the background and will transition from > - * RUNNING to COMPLETED when it's finished acquiring > - * new things to send. Then, when the mbufs finish > - * sending, COMPLETED + sfs->count == 0 is enough to > - * know that no further work is being done. > - * > - * So, we will sleep on both RUNNING and COMPLETED. > - * It's up to the (in progress) async sendfile loop > - * to transition the sf_sync from RUNNING to > - * COMPLETED so the wakeup above will actually > - * do the cv_signal() call. > - */ > - if (sfs->state != SF_STATE_COMPLETED && sfs->state != SF_STATE_RUNNING) > - goto out; > - > - if (sfs->count != 0) > - cv_wait(&sfs->cv, &sfs->mtx); > - KASSERT(sfs->count == 0, ("sendfile sync still busy")); > - > -out: > - return; > -} > - > -/* > - * Free an sf_sync if it's appropriate to. > - */ > -void > -sf_sync_free(struct sendfile_sync *sfs) > -{ > - > - if (sfs == NULL) > - return; > - > - SFSYNC_DPRINTF("%s: (%lld) sfs=%p; called; state=%d, flags=0x%08x " > - "count=%d\n", > - __func__, > - (long long) curthread->td_tid, > - sfs, > - sfs->state, > - sfs->flags, > - sfs->count); > - > - mtx_lock(&sfs->mtx); > - > - /* > - * We keep the sf_sync around if the state is active, > - * we are doing kqueue notification and we have active > - * knotes. > - * > - * If the caller wants to free us right this second it > - * should transition this to the freeing state. > - * > - * So, complain loudly if they break this rule. > - */ > - if (sfs->state != SF_STATE_FREEING) { > - printf("%s: (%llu) sfs=%p; not freeing; let's wait!\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > mtx_unlock(&sfs->mtx); > - return; > } > - > - KASSERT(sfs->count == 0, ("sendfile sync still busy")); > - cv_destroy(&sfs->cv); > - /* > - * This doesn't call knlist_detach() on each knote; it just frees > - * the entire list. > - */ > - knlist_delete(&sfs->klist, curthread, 1); > - mtx_destroy(&sfs->mtx); > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; freeing\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - uma_zfree(zone_sfsync, sfs); > -} > - > -/* > - * Setup a sf_sync to post a kqueue notification when things are complete. > - */ > -int > -sf_sync_kqueue_setup(struct sendfile_sync *sfs, struct sf_hdtr_kq *sfkq) > -{ > - struct kevent kev; > - int error; > - > - sfs->flags |= SF_KQUEUE; > - > - /* Check the flags are valid */ > - if ((sfkq->kq_flags & ~(EV_CLEAR | EV_DISPATCH | EV_ONESHOT)) != 0) > - return (EINVAL); > - > - SFSYNC_DPRINTF("%s: sfs=%p: kqfd=%d, flags=0x%08x, ident=%p, udata=%p\n", > - __func__, > - sfs, > - sfkq->kq_fd, > - sfkq->kq_flags, > - (void *) sfkq->kq_ident, > - (void *) sfkq->kq_udata); > - > - /* Setup and register a knote on the given kqfd. */ > - kev.ident = (uintptr_t) sfkq->kq_ident; > - kev.filter = EVFILT_SENDFILE; > - kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | sfkq->kq_flags; > - kev.data = (intptr_t) sfs; > - kev.udata = sfkq->kq_udata; > - > - error = kqfd_register(sfkq->kq_fd, &kev, curthread, 1); > - if (error != 0) { > - SFSYNC_DPRINTF("%s: returned %d\n", __func__, error); > - } > - return (error); > -} > - > -void > -sf_sync_set_state(struct sendfile_sync *sfs, sendfile_sync_state_t state, > - int islocked) > -{ > - sendfile_sync_state_t old_state; > - > - if (! islocked) > - mtx_lock(&sfs->mtx); > - > - /* > - * Update our current state. > - */ > - old_state = sfs->state; > - sfs->state = state; > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p; going from %d to %d\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs, > - old_state, > - state); > - > - /* > - * If we're transitioning from RUNNING to COMPLETED and the count is > - * zero, then post the knote. The caller may have completed the > - * send before we updated the state to COMPLETED and we need to make > - * sure this is communicated. > - */ > - if (old_state == SF_STATE_RUNNING > - && state == SF_STATE_COMPLETED > - && sfs->count == 0 > - && sfs->flags & SF_KQUEUE) { > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p: triggering knote!\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - KNOTE_LOCKED(&sfs->klist, 1); > - } > - > - if (! islocked) > - mtx_unlock(&sfs->mtx); > -} > - > -/* > - * Set the retval/errno for the given transaction. > - * > - * This will eventually/ideally be used when the KNOTE is fired off > - * to signify the completion of this transaction. > - * > - * The sfsync lock should be held before entering this function. > - */ > -void > -sf_sync_set_retval(struct sendfile_sync *sfs, off_t retval, int xerrno) > -{ > - > - KASSERT(mtx_owned(&sfs->mtx), ("%s: sfs=%p: not locked but should be!", > - __func__, > - sfs)); > - > - SFSYNC_DPRINTF("%s: (%llu) sfs=%p: errno=%d, retval=%jd\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs, > - xerrno, > - (intmax_t) retval); > - > - sfs->retval = retval; > - sfs->xerrno = xerrno; > } > > /* > @@ -2380,174 +1903,15 @@ sys_sendfile(struct thread *td, struct s > return (do_sendfile(td, uap, 0)); > } > > -int > -_do_sendfile(struct thread *td, int src_fd, int sock_fd, int flags, > - int compat, off_t offset, size_t nbytes, off_t *sbytes, > - struct uio *hdr_uio, > - struct uio *trl_uio, struct sf_hdtr_kq *hdtr_kq) > -{ > - cap_rights_t rights; > - struct sendfile_sync *sfs = NULL; > - struct file *fp; > - int error; > - int do_kqueue = 0; > - int do_free = 0; > - > - AUDIT_ARG_FD(src_fd); > - > - if (hdtr_kq != NULL) > - do_kqueue = 1; > - > - /* > - * sendfile(2) can start at any offset within a file so we require > - * CAP_READ+CAP_SEEK = CAP_PREAD. > - */ > - if ((error = fget_read(td, src_fd, > - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { > - goto out; > - } > - > - /* > - * IF SF_KQUEUE is set but we haven't copied in anything for > - * kqueue data, error out. > - */ > - if (flags & SF_KQUEUE && do_kqueue == 0) { > - SFSYNC_DPRINTF("%s: SF_KQUEUE but no KQUEUE data!\n", __func__); > - goto out; > - } > - > - /* > - * If we need to wait for completion, initialise the sfsync > - * state here. > - */ > - if (flags & (SF_SYNC | SF_KQUEUE)) > - sfs = sf_sync_alloc(flags & (SF_SYNC | SF_KQUEUE)); > - > - if (flags & SF_KQUEUE) { > - error = sf_sync_kqueue_setup(sfs, hdtr_kq); > - if (error) { > - SFSYNC_DPRINTF("%s: (%llu) error; sfs=%p\n", > - __func__, > - (unsigned long long) curthread->td_tid, > - sfs); > - sf_sync_set_state(sfs, SF_STATE_FREEING, 0); > - sf_sync_free(sfs); > - goto out; > - } > - } > - > - /* > - * Do the sendfile call. > - * > - * If this fails, it'll free the mbuf chain which will free up the > - * sendfile_sync references. > - */ > - error = fo_sendfile(fp, sock_fd, hdr_uio, trl_uio, offset, > - nbytes, sbytes, flags, compat ? SFK_COMPAT : 0, sfs, td); > - > - /* > - * If the sendfile call succeeded, transition the sf_sync state > - * to RUNNING, then COMPLETED. > - * > - * If the sendfile call failed, then the sendfile call may have > - * actually sent some data first - so we check to see whether > - * any data was sent. If some data was queued (ie, count > 0) > - * then we can't call free; we have to wait until the partial > - * transaction completes before we continue along. > - * > - * This has the side effect of firing off the knote > - * if the refcount has hit zero by the time we get here. > - */ > - if (sfs != NULL) { > - mtx_lock(&sfs->mtx); > - if (error == 0 || sfs->count > 0) { > - /* > - * When it's time to do async sendfile, the transition > - * to RUNNING signifies that we're actually actively > - * adding and completing mbufs. When the last disk > - * buffer is read (ie, when we're not doing any > - * further read IO and all subsequent stuff is mbuf > - * transmissions) we'll transition to COMPLETED > - * and when the final mbuf is freed, the completion > - * will be signaled. > - */ > - sf_sync_set_state(sfs, SF_STATE_RUNNING, 1); > - > - /* > - * Set the retval before we signal completed. > - * If we do it the other way around then transitioning to > - * COMPLETED may post the knote before you set the return > - * status! > - * > - * XXX for now, errno is always 0, as we don't post > - * knotes if sendfile failed. Maybe that'll change later. > - */ > - sf_sync_set_retval(sfs, *sbytes, error); > - > - /* > - * And now transition to completed, which will kick off > - * the knote if required. > - */ > - sf_sync_set_state(sfs, SF_STATE_COMPLETED, 1); > - } else { > - /* > - * Error isn't zero, sfs_count is zero, so we > - * won't have some other thing to wake things up. > - * Thus free. > - */ > - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); > - do_free = 1; > - } > - > - /* > - * Next - wait if appropriate. > - */ > - sf_sync_syscall_wait(sfs); > - > - /* > - * If we're not doing kqueue notifications, we can > - * transition this immediately to the freeing state. > - */ > - if ((sfs->flags & SF_KQUEUE) == 0) { > - sf_sync_set_state(sfs, SF_STATE_FREEING, 1); > - do_free = 1; > - } > - > - mtx_unlock(&sfs->mtx); > - } > - > - /* > - * If do_free is set, free here. > - * > - * If we're doing no-kqueue notification and it's just sleep notification, > - * we also do free; it's the only chance we have. > - */ > - if (sfs != NULL && do_free == 1) { > - sf_sync_free(sfs); > - } > - > - /* > - * XXX Should we wait until the send has completed before freeing the source > - * file handle? It's the previous behaviour, sure, but is it required? > - * We've wired down the page references after all. > - */ > - fdrop(fp, td); > - > -out: > - /* Return error */ > - return (error); > -} > - > - > static int > do_sendfile(struct thread *td, struct sendfile_args *uap, int compat) > { > struct sf_hdtr hdtr; > - struct sf_hdtr_kq hdtr_kq; > struct uio *hdr_uio, *trl_uio; > - int error; > + struct file *fp; > + cap_rights_t rights; > off_t sbytes; > - int do_kqueue = 0; > + int error; > > /* > * File offset must be positive. If it goes beyond EOF > @@ -2563,38 +1927,37 @@ do_sendfile(struct thread *td, struct se > if (error != 0) > goto out; > if (hdtr.headers != NULL) { > - error = copyinuio(hdtr.headers, hdtr.hdr_cnt, &hdr_uio); > + error = copyinuio(hdtr.headers, hdtr.hdr_cnt, > + &hdr_uio); > if (error != 0) > goto out; > } > if (hdtr.trailers != NULL) { > - error = copyinuio(hdtr.trailers, hdtr.trl_cnt, &trl_uio); > + error = copyinuio(hdtr.trailers, hdtr.trl_cnt, > + &trl_uio); > if (error != 0) > goto out; > } > + } > > - /* > - * If SF_KQUEUE is set, then we need to also copy in > - * the kqueue data after the normal hdtr set and set > - * do_kqueue=1. > - */ > - if (uap->flags & SF_KQUEUE) { > - error = copyin(((char *) uap->hdtr) + sizeof(hdtr), > - &hdtr_kq, > - sizeof(hdtr_kq)); > - if (error != 0) > - goto out; > - do_kqueue = 1; > - } > + AUDIT_ARG_FD(src_fd); > + > + /* > + * sendfile(2) can start at any offset within a file so we require > + * CAP_READ+CAP_SEEK = CAP_PREAD. > + */ > + if ((error = fget_read(td, uap->fd, > + cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { > + goto out; > } > > - /* Call sendfile */ > - error = _do_sendfile(td, uap->fd, uap->s, uap->flags, compat, > - uap->offset, uap->nbytes, &sbytes, hdr_uio, trl_uio, &hdtr_kq); > + error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, > + uap->nbytes, &sbytes, uap->flags, compat ? SFK_COMPAT : 0, td); > + fdrop(fp, td); > > - if (uap->sbytes != NULL) { > + if (uap->sbytes != NULL) > copyout(&sbytes, uap->sbytes, sizeof(off_t)); > - } > + > out: > free(hdr_uio, M_IOV); > free(trl_uio, M_IOV); > @@ -2819,7 +2182,7 @@ kern_sendfile_getsock(struct thread *td, > int > vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, > struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, > - int kflags, struct sendfile_sync *sfs, struct thread *td) > + int kflags, struct thread *td) > { > struct file *sock_fp; > struct vnode *vp; > @@ -2829,6 +2192,7 @@ vn_sendfile(struct file *fp, int sockfd, > struct sf_buf *sf; > struct vm_page *pg; > struct shmfd *shmfd; > + struct sendfile_sync *sfs; > struct vattr va; > off_t off, xfsize, fsbytes, sbytes, rem, obj_size; > int error, bsize, nd, hdrlen, mnw; > @@ -2837,6 +2201,7 @@ vn_sendfile(struct file *fp, int sockfd, > obj = NULL; > so = NULL; > m = NULL; > + sfs = NULL; > fsbytes = sbytes = 0; > hdrlen = mnw = 0; > rem = nbytes; > @@ -2860,6 +2225,12 @@ vn_sendfile(struct file *fp, int sockfd, > if (flags & SF_MNOWAIT) > mnw = 1; > > + if (flags & SF_SYNC) { > + sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); > + mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); > + cv_init(&sfs->cv, "sendfile"); > + } > + > #ifdef MAC > error = mac_socket_check_send(td->td_ucred, so); > if (error != 0) > @@ -3106,12 +2477,11 @@ retry_space: > loopbytes += xfsize; > off += xfsize; > > - /* > - * XXX eventually this should be a sfsync > - * method call! > - */ > - if (sfs != NULL) > - sf_sync_ref(sfs); > + if (sfs != NULL) { > + mtx_lock(&sfs->mtx); > + sfs->count++; > + mtx_unlock(&sfs->mtx); > + } > } > > if (vp != NULL) > @@ -3193,6 +2563,16 @@ out: > if (m) > m_freem(m); > > + if (sfs != NULL) { > + mtx_lock(&sfs->mtx); > + if (sfs->count != 0) > + cv_wait(&sfs->cv, &sfs->mtx); > + KASSERT(sfs->count == 0, ("sendfile sync still busy")); > + cv_destroy(&sfs->cv); > + mtx_destroy(&sfs->mtx); > + free(sfs, M_TEMP); > + } > + > if (error == ERESTART) > error = EINTR; > > > Modified: head/sys/sys/file.h > ============================================================================== > --- head/sys/sys/file.h Tue Nov 11 20:05:50 2014 (r274402) > +++ head/sys/sys/file.h Tue Nov 11 20:32:46 2014 (r274403) > @@ -90,9 +90,6 @@ foffset_get(struct file *fp) > return (foffset_lock(fp, FOF_NOLOCK)); > } > > -/* XXX pollution? */ > -struct sendfile_sync; > - > typedef int fo_rdwr_t(struct file *fp, struct uio *uio, > struct ucred *active_cred, int flags, > struct thread *td); > @@ -112,8 +109,7 @@ typedef int fo_chown_t(struct file *fp, > struct ucred *active_cred, struct thread *td); > typedef int fo_sendfile_t(struct file *fp, int sockfd, struct uio *hdr_uio, > struct uio *trl_uio, off_t offset, size_t nbytes, > - off_t *sent, int flags, int kflags, > - struct sendfile_sync *sfs, struct thread *td); > + off_t *sent, int flags, int kflags, struct thread *td); > typedef int fo_seek_t(struct file *fp, off_t offset, int whence, > struct thread *td); > typedef int fo_fill_kinfo_t(struct file *fp, struct kinfo_file *kif, > @@ -371,11 +367,11 @@ fo_chown(struct file *fp, uid_t uid, gid > static __inline int > fo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, > struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, > - int kflags, struct sendfile_sync *sfs, struct thread *td) > + int kflags, struct thread *td) > { > > return ((*fp->f_ops->fo_sendfile)(fp, sockfd, hdr_uio, trl_uio, offset, > - nbytes, sent, flags, kflags, sfs, td)); > + nbytes, sent, flags, kflags, td)); > } > > static __inline int > > Modified: head/sys/sys/socket.h > ============================================================================== > --- head/sys/sys/socket.h Tue Nov 11 20:05:50 2014 (r274402) > +++ head/sys/sys/socket.h Tue Nov 11 20:32:46 2014 (r274403) > @@ -584,27 +584,11 @@ struct sf_hdtr { > }; > > /* > - * sendfile(2) kqueue information > - */ > -struct sf_hdtr_kq { > - uintptr_t kq_ident; /* ident (from userland?) */ > - void *kq_udata; /* user data pointer */ > - uint32_t kq_flags; /* extra flags to pass in */ > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 20:49:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C98BAC43; Tue, 11 Nov 2014 20:49:22 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A417AAE5; Tue, 11 Nov 2014 20:49:22 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A1ADEB939; Tue, 11 Nov 2014 15:49:20 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r274398 - head/sys/boot/i386/loader Date: Tue, 11 Nov 2014 14:59:05 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201411111945.sABJj0xY072461@svn.freebsd.org> In-Reply-To: <201411111945.sABJj0xY072461@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201411111459.05253.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 11 Nov 2014 15:49:20 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 20:49:22 -0000 On Tuesday, November 11, 2014 2:45:00 pm John Baldwin wrote: > Author: jhb > Date: Tue Nov 11 19:44:59 2014 > New Revision: 274398 > URL: https://svnweb.freebsd.org/changeset/base/274398 > > Log: > Move NFS and TFTP filesystems before the synthetic filesystems (bzip, > gzip, and split). "Real" filesystems should always be listed first so > that the "bare" filename is tried before alternate filenames. For PXE > booting in particular this can remove a lot of spurious pathname lookups. > > While here, move splitfs to the bottom after the bzip and gzip filesystems > as it is the least often used. In particular, prior to this, a PXE boot would try the paths "loader.conf.split", "loader.conf.gz", "loader.conf.gz.split", "loader.conf.bz2", and "loader.conf.bz2.split" before "loader.conf". Now it tries "loader.conf" first. (Arguably we could remove splitfs entirely since we no longer support boot floppies. Not sure if it would still be useful in an embedded scenarios as it implicitly assumes you are replacing removable media.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 21:37:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70232F8D; Tue, 11 Nov 2014 21:37:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AB47FF8; Tue, 11 Nov 2014 21:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABLbLSk025055; Tue, 11 Nov 2014 21:37:21 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABLbIkk025036; Tue, 11 Nov 2014 21:37:18 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411112137.sABLbIkk025036@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 11 Nov 2014 21:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274405 - in head/contrib/libxo: . libxo tests/core tests/core/saved 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 21:37:21 -0000 Author: marcel Date: Tue Nov 11 21:37:17 2014 New Revision: 274405 URL: https://svnweb.freebsd.org/changeset/base/274405 Log: Upgrade libxo to 0.1.5 Obtained from: https://github.com/Juniper/libxo Modified: head/contrib/libxo/README.md head/contrib/libxo/configure.ac head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xoconfig.h head/contrib/libxo/libxo/xoversion.h head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_07.J.out head/contrib/libxo/tests/core/saved/test_07.JP.out head/contrib/libxo/tests/core/saved/test_07.X.out head/contrib/libxo/tests/core/saved/test_07.XP.out head/contrib/libxo/tests/core/test_07.c Modified: head/contrib/libxo/README.md ============================================================================== --- head/contrib/libxo/README.md Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/README.md Tue Nov 11 21:37:17 2014 (r274405) @@ -60,3 +60,5 @@ option: View the beautiful documentation at: http://juniper.github.io/libxo/libxo-manual.html + +[![Analytics](https://ga-beacon.appspot.com/UA-56056421-1/Juniper/libxo/Readme)](https://github.com/Juniper/libxo) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/configure.ac Tue Nov 11 21:37:17 2014 (r274405) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.1.4], [phil@juniper.net]) +AC_INIT([libxo], [0.1.5], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/libxo/libxo.c Tue Nov 11 21:37:17 2014 (r274405) @@ -79,7 +79,7 @@ struct xo_handle_s { unsigned short xo_indent; /* Indent level (if pretty) */ unsigned short xo_indent_by; /* Indent amount (tab stop) */ xo_write_func_t xo_write; /* Write callback */ - xo_close_func_t xo_close; /* Clo;se callback */ + xo_close_func_t xo_close; /* Close callback */ xo_formatter_t xo_formatter; /* Custom formating function */ xo_checkpointer_t xo_checkpointer; /* Custom formating support function */ void *xo_opaque; /* Opaque data for write function */ @@ -1912,6 +1912,7 @@ xo_format_string (xo_handle_t *xop, xo_b xo_format_t *xfp) { static char null[] = "(null)"; + char *cp = NULL; wchar_t *wcp = NULL; int len, cols = 0, rc = 0; @@ -1922,16 +1923,33 @@ xo_format_string (xo_handle_t *xop, xo_b if (xo_check_conversion(xop, xfp->xf_enc, need_enc)) return 0; + len = xfp->xf_width[XF_WIDTH_SIZE]; + if (xfp->xf_enc == XF_ENC_WIDE) { wcp = va_arg(xop->xo_vap, wchar_t *); if (xfp->xf_skip) return 0; + /* + * Dont' deref NULL; use the traditional "(null)" instead + * of the more accurate "who's been a naughty boy, then?". + */ + if (wcp == NULL) { + cp = null; + len = sizeof(null) - 1; + } + } else { cp = va_arg(xop->xo_vap, char *); /* UTF-8 or native */ if (xfp->xf_skip) return 0; + /* Echo "Dont' deref NULL" logic */ + if (cp == NULL) { + cp = null; + len = sizeof(null) - 1; + } + /* * Optimize the most common case, which is "%s". We just * need to copy the complete string to the output buffer. @@ -1957,17 +1975,6 @@ xo_format_string (xo_handle_t *xop, xo_b } } - len = xfp->xf_width[XF_WIDTH_SIZE]; - - /* - * Dont' deref NULL; use the traditional "(null)" instead - * of the more accurate "who's been a naughty boy, then?". - */ - if (cp == NULL && wcp == NULL) { - cp = null; - len = sizeof(null) - 1; - } - cols = xo_format_string_direct(xop, xbp, flags, wcp, cp, len, xfp->xf_width[XF_WIDTH_MAX], need_enc, xfp->xf_enc); @@ -3859,7 +3866,7 @@ xo_close_list_h (xo_handle_t *xop, const rc = xo_printf(xop, "%s%*s]", pre_nl, xo_indent(xop), ""); xop->xo_stack[xop->xo_depth].xs_flags |= XSF_NOT_FIRST; - return 0; + return rc; } int Modified: head/contrib/libxo/libxo/xoconfig.h ============================================================================== --- head/contrib/libxo/libxo/xoconfig.h Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/libxo/xoconfig.h Tue Nov 11 21:37:17 2014 (r274405) @@ -158,7 +158,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 0.1.4" +#define PACKAGE_STRING "libxo 0.1.5" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -167,7 +167,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1.4" +#define PACKAGE_VERSION "0.1.5" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -181,7 +181,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.1.4" +#define VERSION "0.1.5" /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ Modified: head/contrib/libxo/libxo/xoversion.h ============================================================================== --- head/contrib/libxo/libxo/xoversion.h Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/libxo/xoversion.h Tue Nov 11 21:37:17 2014 (r274405) @@ -18,7 +18,7 @@ /** * The version string */ -#define LIBXO_VERSION "0.1.4" +#define LIBXO_VERSION "0.1.5" /** * The version number Modified: head/contrib/libxo/tests/core/Makefile.am ============================================================================== --- head/contrib/libxo/tests/core/Makefile.am Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/Makefile.am Tue Nov 11 21:37:17 2014 (r274405) @@ -30,7 +30,7 @@ test_07_test_SOURCES = test_07.c # TEST_CASES := $(shell cd ${srcdir} ; echo *.c ) -bin_PROGRAMS = ${TEST_CASES:.c=.test} +noinst_PROGRAMS = ${TEST_CASES:.c=.test} LDADD = \ ${top_builddir}/libxo/libxo.la @@ -66,7 +66,7 @@ valgrind: TEST_ONE = \ LIBXO_OPTIONS=:W$$fmt \ - ${CHECKER} $$base.test ${TEST_OPTS} \ + ${CHECKER} ./$$base.test ${TEST_OPTS} \ > out/$$base.$$fmt.out 2> out/$$base.$$fmt.err ; \ ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.out out/$$base.$$fmt.out ${S2O} ; \ ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.err out/$$base.$$fmt.err ${S2O} Modified: head/contrib/libxo/tests/core/saved/test_07.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_07.J.out Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/saved/test_07.J.out Tue Nov 11 21:37:17 2014 (r274405) @@ -1,2 +1,2 @@ -{"employees": {"v1":"γιγνώσκειν","v2":"ὦ ἄνδρες ᾿Αθηναῖοι","columns":28,"columns":2,"v1":"ახლავე გაიაროთ რეგისტრაცია","v2":"Unicode-ის მეათე საერთაშორისო","columns":55, "employee": ["columns":0, {"first-name":"Jim","nic-name":"\"რეგტ\"","last-name":"გთხოვთ ახ","department":431,"percent-time":90,"columns":23,"benefits":"full"}, {"first-name":"Terry","nic-name":"\"γιγνώσκεινὦ ἄνδρες ᾿Αθηναῖοι282ახლავე გაიაროთ რეგისტრაციაUnicode-ის მეათე საერთაშორისო550Jim"რეგტ"გთხოვთ ახ4319023fullTerry"<one"Οὐχὶ ταὐτὰ παρίσταταί μοι Jones6609047fullLeslie"Les"Patterson3416025fullAshley"Ash"Meter & Smith144040300123456789"0123456789"01234567890123456789014404049ახლა"გაიარო"საერთაშორისო1239029full \ No newline at end of file +(null)γιγνώσκεινὦ ἄνδρες ᾿Αθηναῖοι282ახლავე გაიაროთ რეგისტრაციაUnicode-ის მეათე საერთაშორისო550Jim"რეგტ"გთხოვთ ახ4319023fullTerry"<one"Οὐχὶ ταὐτὰ παρίσταταί μοι Jones6609047fullLeslie"Les "Patterson3416025fullAshley"Ash"Meter & Smith144040300123456789"0123456789"01234567890123456789014404049ახლა"გაიარო"საერთაშორისო1239029full \ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_07.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_07.XP.out Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/saved/test_07.XP.out Tue Nov 11 21:37:17 2014 (r274405) @@ -1,4 +1,7 @@ + + (null) + γιγνώσκειν ὦ ἄνδρες ᾿Αθηναῖοι 28 Modified: head/contrib/libxo/tests/core/test_07.c ============================================================================== --- head/contrib/libxo/tests/core/test_07.c Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/test_07.c Tue Nov 11 21:37:17 2014 (r274405) @@ -52,6 +52,12 @@ main (int argc, char **argv) xo_open_container("employees"); + xo_open_list("test"); + xo_open_instance("test"); + xo_emit("{ek:filename/%s}", NULL); + xo_close_instance("test"); + xo_close_list("test"); + rc = xo_emit("Οὐχὶ ταὐτὰ παρίσταταί μοι {:v1/%s}, {:v2/%s}\n", "γιγνώσκειν", "ὦ ἄνδρες ᾿Αθηναῖοι"); rc = xo_emit("{:columns/%d}\n", rc); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 21:52:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A4C666C; Tue, 11 Nov 2014 21:52:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66B7F252; Tue, 11 Nov 2014 21:52:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABLqBvk033646; Tue, 11 Nov 2014 21:52:11 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABLqBlm033645; Tue, 11 Nov 2014 21:52:11 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411112152.sABLqBlm033645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 11 Nov 2014 21:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274406 - head/usr.bin/w 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 21:52:11 -0000 Author: marcel Date: Tue Nov 11 21:52:10 2014 New Revision: 274406 URL: https://svnweb.freebsd.org/changeset/base/274406 Log: Fix text output for the uptime command. Reported by: "Max N. Boyarov" , ae@ Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Tue Nov 11 21:37:17 2014 (r274405) +++ head/usr.bin/w/w.c Tue Nov 11 21:52:10 2014 (r274406) @@ -509,7 +509,7 @@ pr_header(time_t *nowp, int nusers) } /* Print number of users logged in to system */ - xo_emit(" {:users/%d} user%s", nusers, nusers == 1 ? "" : "s"); + xo_emit(" {:users/%d} {N:user%s}", nusers, nusers == 1 ? "" : "s"); /* * Print 1, 5, and 15 minute load averages. From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 22:03:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C75BCFF4; Tue, 11 Nov 2014 22:03:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A38C3C9; Tue, 11 Nov 2014 22:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABM3CfN038855; Tue, 11 Nov 2014 22:03:12 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABM3ClB038854; Tue, 11 Nov 2014 22:03:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201411112203.sABM3ClB038854@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 11 Nov 2014 22:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274407 - head/sys/boot/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 22:03:12 -0000 Author: grehan Date: Tue Nov 11 22:03:11 2014 New Revision: 274407 URL: https://svnweb.freebsd.org/changeset/base/274407 Log: Fix incorrect reading of 32-bit modinfo by 64-bit loaders. The various structures in the mod_metadata set of a FreeBSD kernel and modules contain pointers. The FreeBSD loader correctly deals with a mismatch in loader and kernel pointer size (e.g. 32-bit i386/ppc loader, loading 64-bit amd64/ppc64 kernels), but wasn't dealing with the inverse case where a 64-bit loader was loading a 32-bit kernel. Reported by: ktcallbox@gmail.com with a bhyve/i386 and ZFS root install Differential Revision: https://reviews.freebsd.org/D1129 Reviewed by: neel, jhb MFC after: 1 week Modified: head/sys/boot/common/load_elf.c Modified: head/sys/boot/common/load_elf.c ============================================================================== --- head/sys/boot/common/load_elf.c Tue Nov 11 21:52:10 2014 (r274406) +++ head/sys/boot/common/load_elf.c Tue Nov 11 22:03:11 2014 (r274407) @@ -640,6 +640,14 @@ struct mod_metadata64 { u_int64_t md_cval; /* common string label */ }; #endif +#if defined(__amd64__) && __ELF_WORD_SIZE == 32 +struct mod_metadata32 { + int md_version; /* structure version MDTV_* */ + int md_type; /* type of entry MDT_* */ + u_int32_t md_data; /* specific data */ + u_int32_t md_cval; /* common string label */ +}; +#endif int __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef) @@ -647,6 +655,8 @@ __elfN(parse_modmetadata)(struct preload struct mod_metadata md; #if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64 struct mod_metadata64 md64; +#elif defined(__amd64__) && __ELF_WORD_SIZE == 32 + struct mod_metadata32 md32; #endif struct mod_depend *mdepend; struct mod_version mver; @@ -682,6 +692,18 @@ __elfN(parse_modmetadata)(struct preload md.md_type = md64.md_type; md.md_cval = (const char *)(uintptr_t)md64.md_cval; md.md_data = (void *)(uintptr_t)md64.md_data; +#elif defined(__amd64__) && __ELF_WORD_SIZE == 32 + COPYOUT(v, &md32, sizeof(md32)); + error = __elfN(reloc_ptr)(fp, ef, v, &md32, sizeof(md32)); + if (error == EOPNOTSUPP) { + md32.md_cval += ef->off; + md32.md_data += ef->off; + } else if (error != 0) + return (error); + md.md_version = md32.md_version; + md.md_type = md32.md_type; + md.md_cval = (const char *)(uintptr_t)md32.md_cval; + md.md_data = (void *)(uintptr_t)md32.md_data; #else COPYOUT(v, &md, sizeof(md)); error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 22:08:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A365412; Tue, 11 Nov 2014 22:08:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA5663F8; Tue, 11 Nov 2014 22:08:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABM8Jpa039515; Tue, 11 Nov 2014 22:08:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABM8Jdx039513; Tue, 11 Nov 2014 22:08:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411112208.sABM8Jdx039513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 11 Nov 2014 22:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274408 - in head/sys: compat/freebsd32 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 22:08:20 -0000 Author: glebius Date: Tue Nov 11 22:08:18 2014 New Revision: 274408 URL: https://svnweb.freebsd.org/changeset/base/274408 Log: Fix build. Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/uipc_syscalls.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 11 22:03:11 2014 (r274407) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 11 22:08:18 2014 (r274408) @@ -1570,6 +1570,8 @@ freebsd32_do_sendfile(struct thread *td, struct sf_hdtr32 hdtr32; struct sf_hdtr hdtr; struct uio *hdr_uio, *trl_uio; + struct file *fp; + cap_rights_t rights; struct iovec32 *iov32; off_t offset, sbytes; int error; Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Nov 11 22:03:11 2014 (r274407) +++ head/sys/kern/uipc_syscalls.c Tue Nov 11 22:08:18 2014 (r274408) @@ -1940,7 +1940,7 @@ do_sendfile(struct thread *td, struct se } } - AUDIT_ARG_FD(src_fd); + AUDIT_ARG_FD(uap->fd); /* * sendfile(2) can start at any offset within a file so we require From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 22:47:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75F11181; Tue, 11 Nov 2014 22:47:05 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05D59A1A; Tue, 11 Nov 2014 22:47:05 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id h11so3153621wiw.3 for ; Tue, 11 Nov 2014 14:47:03 -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:message-id:subject :from:to:cc:content-type; bh=ZSLg7mN56B49piH9SsNJmAVKogTfBSdD+TtEPCixQa4=; b=a7zTGcSdubxbqW7qPx7XZaMc1hhYb1QO4jsjZI1vgkgWa8UAdDr3mTPb0R8ooUsrem u1DuzlQwJQDKVNG5NbuHzdEJSPDio9277G+D/lBYdsR08gRo1E3jt68BeQ1GhObEQO/a lcqV5Vw5dB2dsqVjo3C+Op2XyzAQJnJVFzbACm3C0xbJwCLQuX2CI3zS8EElUFAtq6KX CPUjAHYaFJ2TdvLQm4VcwhfOwXnX1I/vbfhf1e4I50zUhLh8awLi43MmmDR6FxDzUT1u gkrdu6mhErjwfuc/ejQq/ykE0y6GX3aKhEaaWTxZ0674z9HEQPsfmH6rDEp5U34Ae2mR 3A3A== MIME-Version: 1.0 X-Received: by 10.180.99.105 with SMTP id ep9mr51966wib.26.1415746023551; Tue, 11 Nov 2014 14:47:03 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 11 Nov 2014 14:47:03 -0800 (PST) In-Reply-To: References: <201411112032.sABKWlVl096129@svn.freebsd.org> Date: Tue, 11 Nov 2014 14:47:03 -0800 X-Google-Sender-Auth: tQQWfXAMWYqWf_HqvsRs-i3RMfg Message-ID: Subject: Re: svn commit: r274403 - in head/sys: compat/freebsd32 kern sys From: Adrian Chadd To: Gleb Smirnoff 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 22:47:05 -0000 Gleb and I talked about this privately. We agreed to keep this out of the tree for the time being, even though I have code that uses this and does do quite a bit of traffic with it. I'm going to use this as an excuse to finally write up a proper "wire pages into mbufs and write them out" api for socket writes and use a kqueue notification mechanism to complete the transactions. -adrian From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 23:52:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92D40B56; Tue, 11 Nov 2014 23:52:02 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 44599A9; Tue, 11 Nov 2014 23:52:00 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id C71E1780A2A; Wed, 12 Nov 2014 10:51:51 +1100 (AEDT) Date: Wed, 12 Nov 2014 10:51:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde In-Reply-To: <86oasd6dad.fsf@nine.des.no> Message-ID: <20141112100207.Q1068@besplex.bde.org> References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> <86oasd6dad.fsf@nine.des.no> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=sZzK7gw1hgqkUVxrSp8A:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 23:52:02 -0000 On Tue, 11 Nov 2014, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: >> -Wcast-qual is not a very good warning option since the official way >> to remove qualifiers in C is to cast them away. Casting them away is >> better than using the __DECONST() abomination. The option exists >> because it is too easy for sloppy code to cast away const without >> really intending to or when casting away const is done intentionally >> but is an error. > > I agree that __DECONST() is ugly (not least because it strips all > qualifiers, not just const, so it should be DEQUAL()), It is not quite that broken. __DEQUALIFIER() strips all qualifiers, but __DECONST() starts by casting to const void *; thus if the initial type has a volatile qualifier, and -Wcast-qual is configured, and -Wcast-qual is not broken, then you get a cast-qual warning for attempting to strip volatile. > but the > alternative is worse. In my experience, the majority of cases where a > cast discards a qualifier are bugs, with struct iov being one of very > few legitimate use cases. That is a (design) bug too. The pointer type is 'const void *' for write() and plain 'void *' for read(), but struct iov is older than const so there aren't separate pointers to keep the types separate in it. read() and write() are even older, but changing the API of write() to add the const didn't risk breaking so much so it was done. It was a much larger API/ABI change and breakage to change read() and write() to use [s]size_t instead of int. Interestingly, struct iov was changed signfificantly without fixing this bug -- in Net/2, it contained 'caddr_t iov_base' instead of void *iobase, and 'int iov_len' instead of 'size_t iov_len'. The next level of design errors that require the cast is for the str*() family. E.g., strchr() takes a 'const char *' and returns a plain 'char *'. This is like the error for readv(), except strchr() is lower level than readv(). The level below that is design errors errors in the C type system. 'const' doesn't work right after the first level of indirection, so it is impossible to declare functions like strtol() and excecv() with the correct number of const's, and callers of these functions need hacks to be comitbly broken. > In the same vein, you could also argue that it is wrong of gcc and clang > to warn about underparanthesized boolean expressions or about using an > assignment as a truth value. Yet these warnings are extremely useful, > because code that triggers them is often either incorrect or easily > misinterpreted by a casual reader. I certainly complain about their warning about "missing" parentheses for && vs || and & vs |. This is like complaining about "missing" parentheses for * vs +. All of these have a standard conventional precdedence and no design errors for this in C (the C design errors for precedence are only nearby, with & and | having much lower precedence than * and +, so much lower that they are below comparison operators; OTOH, it is correct for && and || to have lower precedence than comparison operators). When I maintained local patches for gcc-2.4.5 and gcc-2.7.2 ending when the ports tree started about 19 years ago, I used to delete check for && vs ||. This bug is larger in clang, since clang enables the && vs || warnings at a lower level than gcc, so some of my code where I intentionally leave out the parentheses exposes the brokenness of the compiler. > Apple's "goto fail" certificate verification bug was caused by code that > was perfectly legal and looked fine at first glance but would have been > caught by -Wunreachable-code. Unfortunately, turning it on in our tree > breaks the build in non-trivially-fixable ways because it is triggered > by const propagation into inline functions. Turning on warnings finds too many problems in dusty decks. Compilers shouldn't put new warnings under only warning flags since this mainly finds non-bugs in code that is not dusty enough to need compiling with no warning flags. -Wunreachable code is fine here since it is new. I don't know of any solution for killing warnings selectively except for ugly lint-like markup. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 23:55:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F42BDC6; Tue, 11 Nov 2014 23:55:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF28CB; Tue, 11 Nov 2014 23:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABNtcFl092580; Tue, 11 Nov 2014 23:55:38 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABNtcRJ092579; Tue, 11 Nov 2014 23:55:38 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411112355.sABNtcRJ092579@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 11 Nov 2014 23:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274409 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 11 Nov 2014 23:55:38 -0000 Author: loos Date: Tue Nov 11 23:55:37 2014 New Revision: 274409 URL: https://svnweb.freebsd.org/changeset/base/274409 Log: Since r273264 the SD card detection on Raspberry Pi is reliably working and that expose new bugs with HS mode. When the old code could not do the proper card detection it would boot with lower defaults (and no HS mode) and this makes some HS cards boots. Now, with the card always identified as HS capable, the sdhci controller tries to run the card at HS speeds and makes the boot always fail. Disable the HS mode for now (which still can be enabled with the tunable) until it is properly fixed. MFC with: r273264 Requested by: many 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 Tue Nov 11 22:08:18 2014 (r274408) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 11 23:55:37 2014 (r274409) @@ -84,10 +84,13 @@ __FBSDID("$FreeBSD$"); /* * Arasan HC seems to have problem with Data CRC on lower frequencies. * Use this tunable to cap initialization sequence frequency at higher - * value. Default is standard 400kHz + * value. Default is standard 400kHz. + * HS mode brings too many problems for most of cards, so disable HS mode + * until a better fix comes up. + * HS mode still can be enabled with the tunable. */ static int bcm2835_sdhci_min_freq = 400000; -static int bcm2835_sdhci_hs = 1; +static int bcm2835_sdhci_hs = 0; static int bcm2835_sdhci_pio_mode = 0; TUNABLE_INT("hw.bcm2835.sdhci.min_freq", &bcm2835_sdhci_min_freq); From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 00:10:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9D2B204; Wed, 12 Nov 2014 00:10:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5E141E0; Wed, 12 Nov 2014 00:10:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC0ARt6099301; Wed, 12 Nov 2014 00:10:27 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC0ARwD099300; Wed, 12 Nov 2014 00:10:27 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411120010.sAC0ARwD099300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 12 Nov 2014 00:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274410 - head/usr.bin/mkimg 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 00:10:28 -0000 Author: marcel Date: Wed Nov 12 00:10:27 2014 New Revision: 274410 URL: https://svnweb.freebsd.org/changeset/base/274410 Log: SEEK_DATA has interesting behaviour for sparse files on ZFS. A sparse file with 128K of random data and truncated to 800K can have SEEK_DATA return -1 when given an offset of 128K. On UFS, the SEEK_DATA returns 800K (the size of the file). SEEK_HOLE on ZFS seems to behave the same as UFS. To handle this, map -1 to the size of the file (`end') when lseek returns this for either SEEK_HOLE or SEEK_DATA. When sparse files are not supported by the file system both `hole' and `data' will now be equal to `end' and we will treat the entire file as data. This way, the -1 return for SEEK_DATA on ZFS will end up doing the right thing. Reported by: gjb@ MFC after: 3 days Modified: head/usr.bin/mkimg/image.c Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Tue Nov 11 23:55:37 2014 (r274409) +++ head/usr.bin/mkimg/image.c Wed Nov 12 00:10:27 2014 (r274410) @@ -405,16 +405,18 @@ image_copyin_mapped(lba_t blk, int fd, u error = 0; while (!error && cur < end) { hole = lseek(fd, cur, SEEK_HOLE); + if (hole == -1) + hole = end; data = lseek(fd, cur, SEEK_DATA); + if (data == -1) + data = end; /* * Treat the entire file as data if sparse files * are not supported by the underlying file system. */ - if (hole == -1 && data == -1) { + if (hole == end && data == end) data = cur; - hole = end; - } if (cur == hole && data > hole) { hole = pos; From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 00:21:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 702B65C4; Wed, 12 Nov 2014 00:21:21 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 019CA308; Wed, 12 Nov 2014 00:21:20 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 23ADF1048377; Wed, 12 Nov 2014 11:21:00 +1100 (AEDT) Date: Wed, 12 Nov 2014 11:20:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brooks Davis Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde In-Reply-To: <20141111163105.GA69731@spindle.one-eyed-alien.net> Message-ID: <20141112105202.F1068@besplex.bde.org> References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> <86oasd6dad.fsf@nine.des.no> <20141111163105.GA69731@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=yozaxMhE47ygoDQ7uigA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org, Dag-Erling Sm?rgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 00:21:21 -0000 On Tue, 11 Nov 2014, Brooks Davis wrote: > On Tue, Nov 11, 2014 at 03:07:54PM +0100, Dag-Erling Sm?rgrav wrote: >> I agree that __DECONST() is ugly (not least because it strips all >> qualifiers, not just const, so it should be DEQUAL()), but the >> alternative is worse. In my experience, the majority of cases where a >> cast discards a qualifier are bugs, with struct iov being one of very >> few legitimate use cases. > > On the processor we (SRI and Cambridge) are working on, pointers > are not integers (we support some integer behaviors, but not > pointer->int->pointer casts except in limited cases) and the current > __DECONST implementation will need to die[0]. If uintptr_t doesn't work, then __DECONST() is the least of your problems. Kernel code, especially, has lots of assumptions that uintptr_t can represent pointers. Also that vm_offset_t can represent addresses, and probably that vm_offset_t is exactly the same as uintptr_t. Once you have integer that can represent pointers (which is always possible by implementing integers with enough bits), it is easily for the compiler to arrange that casting through it works to give the semantics of [u]intptr_t. Since I rmrf'ed __DECONST() locally, I didn't fix bugs in it like casting back to (type) without going through (void *). uintptr_t is only specified to work for void *. Once the result is void *, there is no need for the 'type' arg in the API. A void * result can be implicitly in C or explicitly in C++ be converted to any other pointer type. Another bug in __DECONST() is that its implementation depends on the bug that -Wcast-qual is broken for casting to uintptr_t. Casting to uintptr_t certainly removes the type qualify. The only correct implementation to break the compiler warning seems to be to memcpy() the pointer to an array of bits, then memcpy() the bits back to a pointer. On most arches, 'const' is virtual and not encoded in the bits, so this gives the correct result in an honestly unportable way. > For existing C versions > some sort of compiler support for __DECONST is probably the right thing > to do. In general, we need to fix the C/C++ standard to us express the > things we actually mean when we use const (for example see strchr()'s > use of const). I believe the last issue now being tracked on Google's > internal list of deficiencies in the C++ standard. As I said, the compiler support is the C cast operator. We just break the cast operator since we know that casts are often wrong and we want warnings about some cases. The nicest syntax for getting back the cast operator is repeating casts 3 times to say that you really mean them :-). > [0] The recently discussed _ALIGN also needs to die and be replaced with > something that increments the pointer (or returns how much to increment) > rather than jamming it though a long. _ALIGN() needs honest unportability since it changes the bits. I don't see how the compiler can help significantly. The pointer that you start with is usually obtained by illegitimate means. Typically from an offset in an array of bytes, where the array isn't even a C array but is a hardware memory region. It is likely to be just as easy to hack on this offset to align it than to construct a C pointer to the start of the memory region. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 01:28:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A860BFE; Wed, 12 Nov 2014 01:28:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37622BC1; Wed, 12 Nov 2014 01:28:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC1STeV036287; Wed, 12 Nov 2014 01:28:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC1STCC036286; Wed, 12 Nov 2014 01:28:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411120128.sAC1STCC036286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 12 Nov 2014 01:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274411 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 01:28:29 -0000 Author: mav Date: Wed Nov 12 01:28:28 2014 New Revision: 274411 URL: https://svnweb.freebsd.org/changeset/base/274411 Log: Improve CAM's reaction on asymmetric access errors. MFC after: 1 month Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Nov 12 00:10:27 2014 (r274410) +++ head/sys/cam/scsi/scsi_all.c Wed Nov 12 01:28:28 2014 (r274411) @@ -1106,13 +1106,13 @@ static struct asc_table_entry asc_table[ { SST(0x04, 0x09, SS_RDEF, /* XXX TBD */ "Logical unit not ready, self-test in progress") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x0A, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x0A, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | ENXIO, "Logical unit not accessible, asymmetric access state transition")}, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x0B, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x0B, SS_FATAL | ENXIO, "Logical unit not accessible, target port in standby state") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x0C, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x0C, SS_FATAL | ENXIO, "Logical unit not accessible, target port in unavailable state") }, /* F */ { SST(0x04, 0x0D, SS_RDEF, /* XXX TBD */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 02:37:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD528A56; Wed, 12 Nov 2014 02:37:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A06663BB; Wed, 12 Nov 2014 02:37:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC2bSue069409; Wed, 12 Nov 2014 02:37:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC2bSLr069408; Wed, 12 Nov 2014 02:37:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411120237.sAC2bSLr069408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 12 Nov 2014 02:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274412 - head/sys/arm/freescale/imx 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 02:37:28 -0000 Author: ian Date: Wed Nov 12 02:37:27 2014 New Revision: 274412 URL: https://svnweb.freebsd.org/changeset/base/274412 Log: Bugfixes for the imx5/imx6 iomux fdt_pinctrl driver. I originally overlooked a couple flag bits defined in the fdt binding docs. One flag suppresses the pad configuration (pullup/pulldown/etc). The other one requires that the SION (set input on) flag be set in the mux register. Also, it appears from the data involved that if the input register address in the config tuple is zero, there is no input configuration. The old code was writing to register zero, which contains a collection of misc control bits (having nothing to do with input configuration) that probably shouldn't get overwritten arbitrarily. The bindings doc doesn't explictly mention this. Modified: head/sys/arm/freescale/imx/imx_iomux.c Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Wed Nov 12 01:28:28 2014 (r274411) +++ head/sys/arm/freescale/imx/imx_iomux.c Wed Nov 12 02:37:27 2014 (r274412) @@ -99,6 +99,10 @@ struct pincfg { uint32_t padconf_val; }; +#define PADCONF_NONE (1U << 31) /* Do not configure pad. */ +#define PADCONF_SION (1U << 30) /* Force SION bit in mux register. */ +#define PADMUX_SION (1U << 4) /* The SION bit in the mux register. */ + static inline uint32_t RD4(struct iomux_softc *sc, bus_size_t off) { @@ -120,6 +124,7 @@ iomux_configure_pins(device_t dev, phand struct pincfg *cfgtuples, *cfg; phandle_t cfgnode; int i, ntuples; + uint32_t sion; sc = device_get_softc(dev); cfgnode = OF_node_from_xref(cfgxref); @@ -130,9 +135,22 @@ iomux_configure_pins(device_t dev, phand if (ntuples == 0) return (0); /* Empty property is not an error. */ for (i = 0, cfg = cfgtuples; i < ntuples; i++, cfg++) { - WR4(sc, cfg->mux_reg, cfg->mux_val); - WR4(sc, cfg->input_reg, cfg->input_val); - WR4(sc, cfg->padconf_reg, cfg->padconf_val); + sion = (cfg->padconf_val & PADCONF_SION) ? PADMUX_SION : 0; + WR4(sc, cfg->mux_reg, cfg->mux_val | sion); + if (cfg->input_reg != 0) + WR4(sc, cfg->input_reg, cfg->input_val); + if ((cfg->padconf_val & PADCONF_NONE) != 0) + WR4(sc, cfg->padconf_reg, cfg->padconf_val); + if (bootverbose) { + char name[32]; + OF_getprop(cfgnode, "name", &name, sizeof(name)); + printf("%16s: muxreg 0x%04x muxval 0x%02x " + "inpreg 0x%04x inpval 0x%02x " + "padreg 0x%04x padval 0x%08x\n", + name, cfg->mux_reg, cfg->mux_val | sion, + cfg->input_reg, cfg->input_val, + cfg->padconf_reg, cfg->padconf_val); + } } free(cfgtuples, M_OFWPROP); return (0); From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 02:38:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A96CB9A; Wed, 12 Nov 2014 02:38:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47F773CA; Wed, 12 Nov 2014 02:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC2cQWj069572; Wed, 12 Nov 2014 02:38:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC2cQxR069571; Wed, 12 Nov 2014 02:38:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411120238.sAC2cQxR069571@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 12 Nov 2014 02:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274413 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 02:38:26 -0000 Author: ian Date: Wed Nov 12 02:38:25 2014 New Revision: 274413 URL: https://svnweb.freebsd.org/changeset/base/274413 Log: Remove an #ifdef DEBUG wrapper, and instead use if (bootverbose). Modified: head/sys/dev/fdt/fdt_pinctrl.c Modified: head/sys/dev/fdt/fdt_pinctrl.c ============================================================================== --- head/sys/dev/fdt/fdt_pinctrl.c Wed Nov 12 02:37:27 2014 (r274412) +++ head/sys/dev/fdt/fdt_pinctrl.c Wed Nov 12 02:38:25 2014 (r274413) @@ -124,15 +124,14 @@ pinctrl_configure_children(device_t pinc pinctrl_configure_children(pinctrl, node); nconfigs = OF_getencprop_alloc(node, "pinctrl-0", sizeof(*configs), (void **)&configs); -#ifdef DEBUG - { + if (nconfigs <= 0) + continue; + if (bootverbose) { char name[32]; OF_getprop(node, "name", &name, sizeof(name)); - printf("%d items in pinctrl-0 for %s\n", nconfigs, name); + printf("Processing %d pin-config node(s) in pinctrl-0 for %s\n", + nconfigs, name); } -#endif - if (nconfigs <= 0) - continue; for (i = 0; i < nconfigs; i++) { if (OF_device_from_xref(configs[i]) == pinctrl) FDT_PINCTRL_CONFIGURE(pinctrl, configs[i]); From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 02:44:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C278EE14; Wed, 12 Nov 2014 02:44:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFBB0671; Wed, 12 Nov 2014 02:44:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC2iSTK073837; Wed, 12 Nov 2014 02:44:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC2iSeV073836; Wed, 12 Nov 2014 02:44:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411120244.sAC2iSeV073836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 12 Nov 2014 02:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274414 - head/sys/arm/freescale/imx 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 02:44:28 -0000 Author: ian Date: Wed Nov 12 02:44:27 2014 New Revision: 274414 URL: https://svnweb.freebsd.org/changeset/base/274414 Log: Fix the reversed sense of the PADCONF_NONE test. Modified: head/sys/arm/freescale/imx/imx_iomux.c Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Wed Nov 12 02:38:25 2014 (r274413) +++ head/sys/arm/freescale/imx/imx_iomux.c Wed Nov 12 02:44:27 2014 (r274414) @@ -139,7 +139,7 @@ iomux_configure_pins(device_t dev, phand WR4(sc, cfg->mux_reg, cfg->mux_val | sion); if (cfg->input_reg != 0) WR4(sc, cfg->input_reg, cfg->input_val); - if ((cfg->padconf_val & PADCONF_NONE) != 0) + if ((cfg->padconf_val & PADCONF_NONE) == 0) WR4(sc, cfg->padconf_reg, cfg->padconf_val); if (bootverbose) { char name[32]; From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 03:07:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5062454E; Wed, 12 Nov 2014 03:07:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB5E9D3; Wed, 12 Nov 2014 03:07:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC37l1S084847; Wed, 12 Nov 2014 03:07:47 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC37lgI084846; Wed, 12 Nov 2014 03:07:47 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411120307.sAC37lgI084846@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 12 Nov 2014 03:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274415 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 03:07:47 -0000 Author: loos Date: Wed Nov 12 03:07:46 2014 New Revision: 274415 URL: https://svnweb.freebsd.org/changeset/base/274415 Log: Fix the error checking, broken on r273337, to _not_ ignore controller errors. Without this fix you can't even scan the bus (all operations will always succeed). MFC with: r273337 Pointy hat to: loos Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Wed Nov 12 02:44:27 2014 (r274414) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Wed Nov 12 03:07:46 2014 (r274415) @@ -441,7 +441,7 @@ bcm_bsc_transfer(device_t dev, struct ii err = mtx_sleep(dev, &sc->sc_mtx, 0, "bsciow", hz); /* Check for errors. */ - if (err != 0 && (sc->sc_flags & BCM_I2C_ERROR)) + if (err == 0 && (sc->sc_flags & BCM_I2C_ERROR)) err = EIO; if (err != 0) break; From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 03:59:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAC11E45; Wed, 12 Nov 2014 03:59:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B86AAEAA; Wed, 12 Nov 2014 03:59:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC3xR1n008452; Wed, 12 Nov 2014 03:59:27 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC3xRXt008451; Wed, 12 Nov 2014 03:59:27 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411120359.sAC3xRXt008451@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 12 Nov 2014 03:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274416 - head/usr.sbin/i2c 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 03:59:27 -0000 Author: loos Date: Wed Nov 12 03:59:26 2014 New Revision: 274416 URL: https://svnweb.freebsd.org/changeset/base/274416 Log: Fix a few cases of use of uninitialized variables. Found with -Wall. MFC after: 1 week Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Wed Nov 12 03:07:46 2014 (r274415) +++ head/usr.sbin/i2c/i2c.c Wed Nov 12 03:59:26 2014 (r274416) @@ -142,6 +142,7 @@ scan_bus(struct iiccmd cmd, char *dev, i if (tokens == NULL) { fprintf(stderr, "Error allocating tokens " "buffer\n"); + error = -1; goto out; } index = skip_get_tokens(skip_addr, tokens, @@ -150,6 +151,7 @@ scan_bus(struct iiccmd cmd, char *dev, i if (!no_range && (addr_range.start > addr_range.end)) { fprintf(stderr, "Skip address out of range\n"); + error = -1; goto out; } } @@ -409,8 +411,10 @@ i2c_read(char *dev, struct options i2c_o if (i2c_opt.mode == I2C_MODE_STOP_START) { cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); - if (error == -1) + if (error == -1) { + err_msg = "error sending stop condtion\n"; goto err2; + } } } cmd.slave = i2c_opt.addr; @@ -432,8 +436,10 @@ i2c_read(char *dev, struct options i2c_o } } error = ioctl(fd, I2CSTOP, &cmd); - if (error == -1) + if (error == -1) { + err_msg = "error sending stop condtion\n"; goto err2; + } for (i = 0; i < i2c_opt.count; i++) { error = read(fd, &i2c_buf[i], 1); From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 08:20:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00A6A3CC; Wed, 12 Nov 2014 08:20:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C78DAC20; Wed, 12 Nov 2014 08:20:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC8KP3W028393; Wed, 12 Nov 2014 08:20:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC8KPNZ028392; Wed, 12 Nov 2014 08:20:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411120820.sAC8KPNZ028392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 12 Nov 2014 08:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-release@freebsd.org Subject: svn commit: r274417 - release/10.1.0 X-SVN-Group: release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 08:20:26 -0000 Author: gjb Date: Wed Nov 12 08:20:25 2014 New Revision: 274417 URL: https://svnweb.freebsd.org/changeset/base/274417 Log: Tag releng/10.1@274401 as release/10.1.0 now that the 10.1-RELEASE builds have completed. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Added: release/10.1.0/ - copied from r274401, releng/10.1/ From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 08:32:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E37A6F1; Wed, 12 Nov 2014 08:32:23 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FFA6DAF; Wed, 12 Nov 2014 08:32:22 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sAC8WHfJ044009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Nov 2014 10:32:17 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sAC8WHfJ044009 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sAC8WHuL044008; Wed, 12 Nov 2014 10:32:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Nov 2014 10:32:16 +0200 From: Konstantin Belousov To: Marcel Moolenaar Subject: Re: svn commit: r274410 - head/usr.bin/mkimg Message-ID: <20141112083216.GK17068@kib.kiev.ua> References: <201411120010.sAC0ARwD099300@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411120010.sAC0ARwD099300@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 08:32:23 -0000 On Wed, Nov 12, 2014 at 12:10:27AM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Wed Nov 12 00:10:27 2014 > New Revision: 274410 > URL: https://svnweb.freebsd.org/changeset/base/274410 > > Log: > SEEK_DATA has interesting behaviour for sparse files on ZFS. A sparse file > with 128K of random data and truncated to 800K can have SEEK_DATA return -1 > when given an offset of 128K. On UFS, the SEEK_DATA returns 800K (the size > of the file). SEEK_HOLE on ZFS seems to behave the same as UFS. BTW, this is because UFS cannot have hole at the end of file. The file you describe has the last block allocated on UFS. From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 08:36:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFE27882; Wed, 12 Nov 2014 08:36:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC1DEDE0; Wed, 12 Nov 2014 08:36:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC8agpU036696; Wed, 12 Nov 2014 08:36:42 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC8agwc036694; Wed, 12 Nov 2014 08:36:42 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411120836.sAC8agwc036694@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 12 Nov 2014 08:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274418 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 08:36:43 -0000 Author: gjb Date: Wed Nov 12 08:36:42 2014 New Revision: 274418 URL: https://svnweb.freebsd.org/changeset/base/274418 Log: Fix an mdoc(7) macro that is not an option in the provided description. Bump Dd. As CDDL License dictates, update the Copyright accordingly. Sponsored by: The FreeBSD Foundation 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 Wed Nov 12 08:20:25 2014 (r274417) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Nov 12 08:36:42 2014 (r274418) @@ -27,10 +27,11 @@ .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2013, Steven Hartland .\" Copyright (c) 2014, Xin LI +.\" Copyright (c) 2014, The FreeBSD Foundation, All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd November 10, 2014 +.Dd November 12, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1791,7 +1792,7 @@ descendent file systems. Recursively destroy all clones of these snapshots, including the clones, snapshots, and children. If this flag is specified, the -.Op fl d +.Fl d flag will have no effect. .It Fl n Do a dry-run ("No-op") deletion. No data will be deleted. This is useful in From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 08:38:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74698A0E; Wed, 12 Nov 2014 08:38:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60456E0A; Wed, 12 Nov 2014 08:38:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC8cdvI036968; Wed, 12 Nov 2014 08:38:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC8cdWj036967; Wed, 12 Nov 2014 08:38:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411120838.sAC8cdWj036967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 12 Nov 2014 08:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r274419 - svnadmin/hooks/scripts 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 08:38:39 -0000 Author: gjb Date: Wed Nov 12 08:38:38 2014 New Revision: 274419 URL: https://svnweb.freebsd.org/changeset/base/274419 Log: Fix a wording nit in detect-mergeinfo-bloat.pl Sponsored by: The FreeBSD Foundation Modified: svnadmin/hooks/scripts/detect-mergeinfo-bloat.pl Modified: svnadmin/hooks/scripts/detect-mergeinfo-bloat.pl ============================================================================== --- svnadmin/hooks/scripts/detect-mergeinfo-bloat.pl Wed Nov 12 08:36:42 2014 (r274418) +++ svnadmin/hooks/scripts/detect-mergeinfo-bloat.pl Wed Nov 12 08:38:38 2014 (r274419) @@ -110,7 +110,7 @@ foreach my $line (&read_from_process('sv # and will not see this verbose message more than once. if (@errors) { warn "$0:\n\n", join("\n", @errors), "\n\n", < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A0D0BC6; Wed, 12 Nov 2014 09:57:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E70B68BD; Wed, 12 Nov 2014 09:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAC9vLZ2074645; Wed, 12 Nov 2014 09:57:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAC9vFNc074618; Wed, 12 Nov 2014 09:57:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411120957.sAC9vFNc074618@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 12 Nov 2014 09:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274421 - in head/sys: dev/cxgb/ulp/iw_cxgb dev/cxgb/ulp/tom dev/cxgbe/iw_cxgbe dev/cxgbe/tom dev/iscsi kern netgraph/bluetooth/socket netinet ofed/drivers/infiniband/ulp/sdp rpc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 09:57:22 -0000 Author: glebius Date: Wed Nov 12 09:57:15 2014 New Revision: 274421 URL: https://svnweb.freebsd.org/changeset/base/274421 Log: In preparation of merging projects/sendfile, transform bare access to sb_cc member of struct sockbuf to a couple of inline functions: sbavail() and sbused() Right now they are equal, but once notion of "not ready socket buffer data", will be checked in, they are going to be different. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/iscsi/icl.c head/sys/kern/sys_socket.c head/sys/kern/uipc_socket.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c head/sys/netinet/accf_dns.c head/sys/netinet/accf_http.c head/sys/netinet/siftr.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c head/sys/rpc/clnt_vc.c head/sys/rpc/svc_vc.c head/sys/sys/sockbuf.h head/sys/sys/socketvar.h Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Wed Nov 12 09:57:15 2014 (r274421) @@ -1507,11 +1507,11 @@ process_data(struct iwch_ep *ep) process_mpa_request(ep); break; default: - if (ep->com.so->so_rcv.sb_cc) + if (sbavail(&ep->com.so->so_rcv)) printf("%s Unexpected streaming data." " ep %p state %d so %p so_state %x so_rcv.sb_cc %u so_rcv.sb_mb %p\n", __FUNCTION__, ep, state_read(&ep->com), ep->com.so, ep->com.so->so_state, - ep->com.so->so_rcv.sb_cc, ep->com.so->so_rcv.sb_mb); + sbavail(&ep->com.so->so_rcv), ep->com.so->so_rcv.sb_mb); break; } return; Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 12 09:57:15 2014 (r274421) @@ -445,8 +445,8 @@ t3_push_frames(struct socket *so, int re * Autosize the send buffer. */ if (snd->sb_flags & SB_AUTOSIZE && VNET(tcp_do_autosndbuf)) { - if (snd->sb_cc >= (snd->sb_hiwat / 8 * 7) && - snd->sb_cc < VNET(tcp_autosndbuf_max)) { + if (sbused(snd) >= (snd->sb_hiwat / 8 * 7) && + sbused(snd) < VNET(tcp_autosndbuf_max)) { if (!sbreserve_locked(snd, min(snd->sb_hiwat + VNET(tcp_autosndbuf_inc), VNET(tcp_autosndbuf_max)), so, curthread)) @@ -597,10 +597,10 @@ t3_rcvd(struct toedev *tod, struct tcpcb INP_WLOCK_ASSERT(inp); SOCKBUF_LOCK(so_rcv); - KASSERT(toep->tp_enqueued >= so_rcv->sb_cc, - ("%s: so_rcv->sb_cc > enqueued", __func__)); - toep->tp_rx_credits += toep->tp_enqueued - so_rcv->sb_cc; - toep->tp_enqueued = so_rcv->sb_cc; + KASSERT(toep->tp_enqueued >= sbused(so_rcv), + ("%s: sbused(so_rcv) > enqueued", __func__)); + toep->tp_rx_credits += toep->tp_enqueued - sbused(so_rcv); + toep->tp_enqueued = sbused(so_rcv); SOCKBUF_UNLOCK(so_rcv); must_send = toep->tp_rx_credits + 16384 >= tp->rcv_wnd; @@ -1768,7 +1768,7 @@ wr_ack(struct toepcb *toep, struct mbuf so_sowwakeup_locked(so); } - if (snd->sb_sndptroff < snd->sb_cc) + if (snd->sb_sndptroff < sbused(snd)) t3_push_frames(so, 0); out_free: Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Nov 12 09:57:15 2014 (r274421) @@ -584,8 +584,8 @@ process_data(struct c4iw_ep *ep) { struct sockaddr_in *local, *remote; - CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sb_cc %d", __func__, - ep->com.so, ep, states[ep->com.state], ep->com.so->so_rcv.sb_cc); + CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sbused %d", __func__, + ep->com.so, ep, states[ep->com.state], sbused(&ep->com.so->so_rcv)); switch (state_read(&ep->com)) { case MPA_REQ_SENT: @@ -601,11 +601,11 @@ process_data(struct c4iw_ep *ep) process_mpa_request(ep); break; default: - if (ep->com.so->so_rcv.sb_cc) - log(LOG_ERR, "%s: Unexpected streaming data. " - "ep %p, state %d, so %p, so_state 0x%x, sb_cc %u\n", + if (sbused(&ep->com.so->so_rcv)) + log(LOG_ERR, "%s: Unexpected streaming data. ep %p, " + "state %d, so %p, so_state 0x%x, sbused %u\n", __func__, ep, state_read(&ep->com), ep->com.so, - ep->com.so->so_state, ep->com.so->so_rcv.sb_cc); + ep->com.so->so_state, sbused(&ep->com.so->so_rcv)); break; } } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Nov 12 09:57:15 2014 (r274421) @@ -365,15 +365,15 @@ t4_rcvd(struct toedev *tod, struct tcpcb INP_WLOCK_ASSERT(inp); SOCKBUF_LOCK(sb); - KASSERT(toep->sb_cc >= sb->sb_cc, + KASSERT(toep->sb_cc >= sbused(sb), ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sb->sb_cc, toep->sb_cc)); + __func__, sb, sbused(sb), toep->sb_cc)); if (toep->ulp_mode == ULP_MODE_ISCSI) { toep->rx_credits += toep->sb_cc; toep->sb_cc = 0; } else { - toep->rx_credits += toep->sb_cc - sb->sb_cc; - toep->sb_cc = sb->sb_cc; + toep->rx_credits += toep->sb_cc - sbused(sb); + toep->sb_cc = sbused(sb); } credits = toep->rx_credits; SOCKBUF_UNLOCK(sb); @@ -1079,15 +1079,15 @@ do_peer_close(struct sge_iq *iq, const s tp->rcv_nxt = be32toh(cpl->rcv_nxt); toep->ddp_flags &= ~(DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE); - KASSERT(toep->sb_cc >= sb->sb_cc, + KASSERT(toep->sb_cc >= sbused(sb), ("%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; + __func__, sb, sbused(sb), toep->sb_cc)); + toep->rx_credits += toep->sb_cc - sbused(sb); #ifdef USE_DDP_RX_FLOW_CONTROL toep->rx_credits -= m->m_len; /* adjust for F_RX_FC_DDP */ #endif sbappendstream_locked(sb, m); - toep->sb_cc = sb->sb_cc; + toep->sb_cc = sbused(sb); } socantrcvmore_locked(so); /* unlocks the sockbuf */ @@ -1582,12 +1582,12 @@ do_rx_data(struct sge_iq *iq, const stru } } - KASSERT(toep->sb_cc >= sb->sb_cc, + KASSERT(toep->sb_cc >= sbused(sb), ("%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; + __func__, sb, sbused(sb), toep->sb_cc)); + toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m); - toep->sb_cc = sb->sb_cc; + toep->sb_cc = sbused(sb); sorwakeup_locked(so); SOCKBUF_UNLOCK_ASSERT(sb); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Wed Nov 12 09:57:15 2014 (r274421) @@ -224,15 +224,15 @@ insert_ddp_data(struct toepcb *toep, uin tp->rcv_wnd -= n; #endif - KASSERT(toep->sb_cc >= sb->sb_cc, + KASSERT(toep->sb_cc >= sbused(sb), ("%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; + __func__, sb, sbused(sb), toep->sb_cc)); + toep->rx_credits += toep->sb_cc - sbused(sb); #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; + toep->sb_cc = sbused(sb); } /* SET_TCB_FIELD sent as a ULP command looks like this */ @@ -459,15 +459,15 @@ handle_ddp_data(struct toepcb *toep, __b else discourage_ddp(toep); - KASSERT(toep->sb_cc >= sb->sb_cc, + KASSERT(toep->sb_cc >= sbused(sb), ("%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; + __func__, sb, sbused(sb), toep->sb_cc)); + toep->rx_credits += toep->sb_cc - sbused(sb); #ifdef USE_DDP_RX_FLOW_CONTROL toep->rx_credits -= len; /* adjust for F_RX_FC_DDP */ #endif sbappendstream_locked(sb, m); - toep->sb_cc = sb->sb_cc; + toep->sb_cc = sbused(sb); wakeup: KASSERT(toep->ddp_flags & db_flag, ("%s: DDP buffer not active. toep %p, ddp_flags 0x%x, report 0x%x", @@ -908,7 +908,7 @@ handle_ddp(struct socket *so, struct uio #endif /* XXX: too eager to disable DDP, could handle NBIO better than this. */ - if (sb->sb_cc >= uio->uio_resid || uio->uio_resid < sc->tt.ddp_thres || + if (sbused(sb) >= uio->uio_resid || uio->uio_resid < sc->tt.ddp_thres || uio->uio_resid > MAX_DDP_BUFFER_SIZE || uio->uio_iovcnt > 1 || so->so_state & SS_NBIO || flags & (MSG_DONTWAIT | MSG_NBIO) || error || so->so_error || sb->sb_state & SBS_CANTRCVMORE) @@ -946,7 +946,7 @@ handle_ddp(struct socket *so, struct uio * payload. */ ddp_flags = select_ddp_flags(so, flags, db_idx); - wr = mk_update_tcb_for_ddp(sc, toep, db_idx, sb->sb_cc, ddp_flags); + wr = mk_update_tcb_for_ddp(sc, toep, db_idx, sbused(sb), ddp_flags); if (wr == NULL) { /* * Just unhold the pages. The DDP buffer's software state is @@ -1134,8 +1134,8 @@ restart: /* uio should be just as it was at entry */ KASSERT(oresid == uio->uio_resid, - ("%s: oresid = %d, uio_resid = %zd, sb_cc = %d", - __func__, oresid, uio->uio_resid, sb->sb_cc)); + ("%s: oresid = %d, uio_resid = %zd, sbused = %d", + __func__, oresid, uio->uio_resid, sbused(sb))); error = handle_ddp(so, uio, flags, 0); ddp_handled = 1; @@ -1145,7 +1145,7 @@ restart: /* Abort if socket has reported problems. */ if (so->so_error) { - if (sb->sb_cc > 0) + if (sbused(sb)) goto deliver; if (oresid > uio->uio_resid) goto out; @@ -1157,32 +1157,32 @@ restart: /* Door is closed. Deliver what is left, if any. */ if (sb->sb_state & SBS_CANTRCVMORE) { - if (sb->sb_cc > 0) + if (sbused(sb)) goto deliver; else goto out; } /* Socket buffer is empty and we shall not block. */ - if (sb->sb_cc == 0 && + if (sbused(sb) == 0 && ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) { error = EAGAIN; goto out; } /* Socket buffer got some data that we shall deliver now. */ - if (sb->sb_cc > 0 && !(flags & MSG_WAITALL) && + if (sbused(sb) && !(flags & MSG_WAITALL) && ((sb->sb_flags & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || - sb->sb_cc >= sb->sb_lowat || - sb->sb_cc >= uio->uio_resid || - sb->sb_cc >= sb->sb_hiwat) ) { + sbused(sb) >= sb->sb_lowat || + sbused(sb) >= uio->uio_resid || + sbused(sb) >= sb->sb_hiwat) ) { goto deliver; } /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_lowat)) + (sbused(sb) >= uio->uio_resid || sbused(sb) >= sb->sb_lowat)) goto deliver; /* @@ -1201,7 +1201,7 @@ restart: deliver: SOCKBUF_LOCK_ASSERT(&so->so_rcv); - KASSERT(sb->sb_cc > 0, ("%s: sockbuf empty", __func__)); + KASSERT(sbused(sb) > 0, ("%s: sockbuf empty", __func__)); KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__)); if (sb->sb_flags & SB_DDP_INDICATE && !ddp_handled) @@ -1212,7 +1212,7 @@ deliver: uio->uio_td->td_ru.ru_msgrcv++; /* Fill uio until full or current end of socket buffer is reached. */ - len = min(uio->uio_resid, sb->sb_cc); + len = min(uio->uio_resid, sbused(sb)); if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/dev/iscsi/icl.c Wed Nov 12 09:57:15 2014 (r274421) @@ -758,7 +758,7 @@ icl_receive_thread(void *arg) * is enough data received to read the PDU. */ SOCKBUF_LOCK(&so->so_rcv); - available = so->so_rcv.sb_cc; + available = sbavail(&so->so_rcv); if (available < ic->ic_receive_len) { so->so_rcv.sb_lowat = ic->ic_receive_len; cv_wait(&ic->ic_receive_cv, &so->so_rcv.sb_mtx); Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/kern/sys_socket.c Wed Nov 12 09:57:15 2014 (r274421) @@ -175,16 +175,17 @@ soo_ioctl(struct file *fp, u_long cmd, v case FIONREAD: /* Unlocked read. */ - *(int *)data = so->so_rcv.sb_cc; + *(int *)data = sbavail(&so->so_rcv); break; case FIONWRITE: /* Unlocked read. */ - *(int *)data = so->so_snd.sb_cc; + *(int *)data = sbavail(&so->so_snd); break; case FIONSPACE: - if ((so->so_snd.sb_hiwat < so->so_snd.sb_cc) || + /* Unlocked read. */ + if ((so->so_snd.sb_hiwat < sbused(&so->so_snd)) || (so->so_snd.sb_mbmax < so->so_snd.sb_mbcnt)) *(int *)data = 0; else @@ -254,6 +255,7 @@ soo_stat(struct file *fp, struct stat *u struct thread *td) { struct socket *so = fp->f_data; + struct sockbuf *sb; #ifdef MAC int error; #endif @@ -269,15 +271,18 @@ soo_stat(struct file *fp, struct stat *u * If SBS_CANTRCVMORE is set, but there's still data left in the * receive buffer, the socket is still readable. */ - SOCKBUF_LOCK(&so->so_rcv); - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) == 0 || - so->so_rcv.sb_cc != 0) + sb = &so->so_rcv; + SOCKBUF_LOCK(sb); + if ((sb->sb_state & SBS_CANTRCVMORE) == 0 || sbavail(sb)) ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH; - ub->st_size = so->so_rcv.sb_cc - so->so_rcv.sb_ctl; - SOCKBUF_UNLOCK(&so->so_rcv); - /* Unlocked read. */ - if ((so->so_snd.sb_state & SBS_CANTSENDMORE) == 0) + ub->st_size = sbavail(sb) - sb->sb_ctl; + SOCKBUF_UNLOCK(sb); + + sb = &so->so_snd; + SOCKBUF_LOCK(sb); + if ((sb->sb_state & SBS_CANTSENDMORE) == 0) ub->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; + SOCKBUF_UNLOCK(sb); ub->st_uid = so->so_cred->cr_uid; ub->st_gid = so->so_cred->cr_gid; return (*so->so_proto->pr_usrreqs->pru_sense)(so, ub); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/kern/uipc_socket.c Wed Nov 12 09:57:15 2014 (r274421) @@ -1522,12 +1522,12 @@ restart: * 2. MSG_DONTWAIT is not set */ if (m == NULL || (((flags & MSG_DONTWAIT) == 0 && - so->so_rcv.sb_cc < uio->uio_resid) && - so->so_rcv.sb_cc < so->so_rcv.sb_lowat && + sbavail(&so->so_rcv) < uio->uio_resid) && + sbavail(&so->so_rcv) < so->so_rcv.sb_lowat && m->m_nextpkt == NULL && (pr->pr_flags & PR_ATOMIC) == 0)) { - KASSERT(m != NULL || !so->so_rcv.sb_cc, - ("receive: m == %p so->so_rcv.sb_cc == %u", - m, so->so_rcv.sb_cc)); + KASSERT(m != NULL || !sbavail(&so->so_rcv), + ("receive: m == %p sbavail == %u", + m, sbavail(&so->so_rcv))); if (so->so_error) { if (m != NULL) goto dontblock; @@ -1976,7 +1976,7 @@ restart: /* Abort if socket has reported problems. */ if (so->so_error) { - if (sb->sb_cc > 0) + if (sbavail(sb) > 0) goto deliver; if (oresid > uio->uio_resid) goto out; @@ -1988,32 +1988,32 @@ restart: /* Door is closed. Deliver what is left, if any. */ if (sb->sb_state & SBS_CANTRCVMORE) { - if (sb->sb_cc > 0) + if (sbavail(sb) > 0) goto deliver; else goto out; } /* Socket buffer is empty and we shall not block. */ - if (sb->sb_cc == 0 && + if (sbavail(sb) == 0 && ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) { error = EAGAIN; goto out; } /* Socket buffer got some data that we shall deliver now. */ - if (sb->sb_cc > 0 && !(flags & MSG_WAITALL) && + if (sbavail(sb) > 0 && !(flags & MSG_WAITALL) && ((sb->sb_flags & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || - sb->sb_cc >= sb->sb_lowat || - sb->sb_cc >= uio->uio_resid || - sb->sb_cc >= sb->sb_hiwat) ) { + sbavail(sb) >= sb->sb_lowat || + sbavail(sb) >= uio->uio_resid || + sbavail(sb) >= sb->sb_hiwat) ) { goto deliver; } /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_hiwat)) + (sbavail(sb) >= uio->uio_resid || sbavail(sb) >= sb->sb_hiwat)) goto deliver; /* @@ -2027,7 +2027,7 @@ restart: deliver: SOCKBUF_LOCK_ASSERT(&so->so_rcv); - KASSERT(sb->sb_cc > 0, ("%s: sockbuf empty", __func__)); + KASSERT(sbavail(sb) > 0, ("%s: sockbuf empty", __func__)); KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__)); /* Statistics. */ @@ -2035,7 +2035,7 @@ deliver: uio->uio_td->td_ru.ru_msgrcv++; /* Fill uio until full or current end of socket buffer is reached. */ - len = min(uio->uio_resid, sb->sb_cc); + len = min(uio->uio_resid, sbavail(sb)); if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { @@ -2170,9 +2170,9 @@ soreceive_dgram(struct socket *so, struc */ SOCKBUF_LOCK(&so->so_rcv); while ((m = so->so_rcv.sb_mb) == NULL) { - KASSERT(so->so_rcv.sb_cc == 0, - ("soreceive_dgram: sb_mb NULL but sb_cc %u", - so->so_rcv.sb_cc)); + KASSERT(sbavail(&so->so_rcv) == 0, + ("soreceive_dgram: sb_mb NULL but sbavail %u", + sbavail(&so->so_rcv))); if (so->so_error) { error = so->so_error; so->so_error = 0; @@ -3248,7 +3248,7 @@ filt_soread(struct knote *kn, long hint) so = kn->kn_fp->f_data; SOCKBUF_LOCK_ASSERT(&so->so_rcv); - kn->kn_data = so->so_rcv.sb_cc - so->so_rcv.sb_ctl; + kn->kn_data = sbavail(&so->so_rcv) - so->so_rcv.sb_ctl; if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { kn->kn_flags |= EV_EOF; kn->kn_fflags = so->so_error; @@ -3260,7 +3260,7 @@ filt_soread(struct knote *kn, long hint) if (kn->kn_data >= kn->kn_sdata) return 1; } else { - if (so->so_rcv.sb_cc >= so->so_rcv.sb_lowat) + if (sbavail(&so->so_rcv) >= so->so_rcv.sb_lowat) return 1; } @@ -3451,7 +3451,7 @@ soisdisconnected(struct socket *so) sorwakeup_locked(so); SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_state |= SBS_CANTSENDMORE; - sbdrop_locked(&so->so_snd, so->so_snd.sb_cc); + sbdrop_locked(&so->so_snd, sbused(&so->so_snd)); sowwakeup_locked(so); wakeup(&so->so_timeo); } Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Wed Nov 12 09:57:15 2014 (r274421) @@ -1127,9 +1127,8 @@ ng_btsocket_l2cap_process_l2ca_write_rsp /* * Check if we have more data to send */ - sbdroprecord(&pcb->so->so_snd); - if (pcb->so->so_snd.sb_cc > 0) { + if (sbavail(&pcb->so->so_snd) > 0) { if (ng_btsocket_l2cap_send2(pcb) == 0) ng_btsocket_l2cap_timeout(pcb); else @@ -2513,7 +2512,7 @@ ng_btsocket_l2cap_send2(ng_btsocket_l2ca mtx_assert(&pcb->pcb_mtx, MA_OWNED); - if (pcb->so->so_snd.sb_cc == 0) + if (sbavail(&pcb->so->so_snd) == 0) return (EINVAL); /* XXX */ m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Wed Nov 12 09:57:15 2014 (r274421) @@ -3279,7 +3279,7 @@ ng_btsocket_rfcomm_pcb_send(ng_btsocket_ } for (error = 0, sent = 0; sent < limit; sent ++) { - length = min(pcb->mtu, pcb->so->so_snd.sb_cc); + length = min(pcb->mtu, sbavail(&pcb->so->so_snd)); if (length == 0) break; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Wed Nov 12 09:57:15 2014 (r274421) @@ -906,7 +906,7 @@ ng_btsocket_sco_default_msg_input(struct sbdroprecord(&pcb->so->so_snd); /* Send more if we have any */ - if (pcb->so->so_snd.sb_cc > 0) + if (sbavail(&pcb->so->so_snd) > 0) if (ng_btsocket_sco_send2(pcb) == 0) ng_btsocket_sco_timeout(pcb); @@ -1748,7 +1748,7 @@ ng_btsocket_sco_send2(ng_btsocket_sco_pc mtx_assert(&pcb->pcb_mtx, MA_OWNED); while (pcb->rt->pending < pcb->rt->num_pkts && - pcb->so->so_snd.sb_cc > 0) { + sbavail(&pcb->so->so_snd) > 0) { /* Get a copy of the first packet on send queue */ m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); if (m == NULL) { Modified: head/sys/netinet/accf_dns.c ============================================================================== --- head/sys/netinet/accf_dns.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netinet/accf_dns.c Wed Nov 12 09:57:15 2014 (r274421) @@ -75,7 +75,7 @@ sohasdns(struct socket *so, void *arg, i struct sockbuf *sb = &so->so_rcv; /* If the socket is full, we're ready. */ - if (sb->sb_cc >= sb->sb_hiwat || sb->sb_mbcnt >= sb->sb_mbmax) + if (sbused(sb) >= sb->sb_hiwat || sb->sb_mbcnt >= sb->sb_mbmax) goto ready; /* Check to see if we have a request. */ @@ -115,14 +115,14 @@ skippacket(struct sockbuf *sb) { unsigned long packlen; struct packet q, *p = &q; - if (sb->sb_cc < 2) + if (sbavail(sb) < 2) return DNS_WAIT; q.m = sb->sb_mb; q.n = q.m->m_nextpkt; q.moff = 0; q.offset = 0; - q.len = sb->sb_cc; + q.len = sbavail(sb); GET16(p, packlen); if (packlen + 2 > q.len) Modified: head/sys/netinet/accf_http.c ============================================================================== --- head/sys/netinet/accf_http.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netinet/accf_http.c Wed Nov 12 09:57:15 2014 (r274421) @@ -92,7 +92,7 @@ sbfull(struct sockbuf *sb) "mbcnt(%ld) >= mbmax(%ld): %d", sb->sb_cc, sb->sb_hiwat, sb->sb_cc >= sb->sb_hiwat, sb->sb_mbcnt, sb->sb_mbmax, sb->sb_mbcnt >= sb->sb_mbmax); - return (sb->sb_cc >= sb->sb_hiwat || sb->sb_mbcnt >= sb->sb_mbmax); + return (sbused(sb) >= sb->sb_hiwat || sb->sb_mbcnt >= sb->sb_mbmax); } /* @@ -162,13 +162,14 @@ static int sohashttpget(struct socket *so, void *arg, int waitflag) { - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) == 0 && !sbfull(&so->so_rcv)) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) == 0 && + !sbfull(&so->so_rcv)) { struct mbuf *m; char *cmp; int cmplen, cc; m = so->so_rcv.sb_mb; - cc = so->so_rcv.sb_cc - 1; + cc = sbavail(&so->so_rcv) - 1; if (cc < 1) return (SU_OK); switch (*mtod(m, char *)) { @@ -215,7 +216,7 @@ soparsehttpvers(struct socket *so, void goto fallout; m = so->so_rcv.sb_mb; - cc = so->so_rcv.sb_cc; + cc = sbavail(&so->so_rcv); inspaces = spaces = 0; for (m = so->so_rcv.sb_mb; m; m = n) { n = m->m_nextpkt; @@ -304,7 +305,7 @@ soishttpconnected(struct socket *so, voi * have NCHRS left */ copied = 0; - ccleft = so->so_rcv.sb_cc; + ccleft = sbavail(&so->so_rcv); if (ccleft < NCHRS) goto readmore; a = b = c = '\0'; Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netinet/siftr.c Wed Nov 12 09:57:15 2014 (r274421) @@ -782,9 +782,9 @@ siftr_siftdata(struct pkt_node *pn, stru pn->flags = tp->t_flags; pn->rxt_length = tp->t_rxtcur; pn->snd_buf_hiwater = inp->inp_socket->so_snd.sb_hiwat; - pn->snd_buf_cc = inp->inp_socket->so_snd.sb_cc; + pn->snd_buf_cc = sbused(&inp->inp_socket->so_snd); pn->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat; - pn->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc; + pn->rcv_buf_cc = sbused(&inp->inp_socket->so_rcv); pn->sent_inflight_bytes = tp->snd_max - tp->snd_una; pn->t_segqlen = tp->t_segqlen; Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netinet/tcp_input.c Wed Nov 12 09:57:15 2014 (r274421) @@ -1745,7 +1745,7 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); sowwakeup(so); - if (so->so_snd.sb_cc) + if (sbavail(&so->so_snd)) (void) tcp_output(tp); goto check_delack; } @@ -2526,7 +2526,7 @@ tcp_do_segment(struct mbuf *m, struct tc * Otherwise we would send pure ACKs. */ SOCKBUF_LOCK(&so->so_snd); - avail = so->so_snd.sb_cc - + avail = sbavail(&so->so_snd) - (tp->snd_nxt - tp->snd_una); SOCKBUF_UNLOCK(&so->so_snd); if (avail > 0) @@ -2661,10 +2661,10 @@ process_ACK: cc_ack_received(tp, th, CC_ACK); SOCKBUF_LOCK(&so->so_snd); - if (acked > so->so_snd.sb_cc) { - tp->snd_wnd -= so->so_snd.sb_cc; + if (acked > sbavail(&so->so_snd)) { + tp->snd_wnd -= sbavail(&so->so_snd); mfree = sbcut_locked(&so->so_snd, - (int)so->so_snd.sb_cc); + (int)sbavail(&so->so_snd)); ourfinisacked = 1; } else { mfree = sbcut_locked(&so->so_snd, acked); @@ -2790,7 +2790,7 @@ step6: * actually wanting to send this much urgent data. */ SOCKBUF_LOCK(&so->so_rcv); - if (th->th_urp + so->so_rcv.sb_cc > sb_max) { + if (th->th_urp + sbavail(&so->so_rcv) > sb_max) { th->th_urp = 0; /* XXX */ thflags &= ~TH_URG; /* XXX */ SOCKBUF_UNLOCK(&so->so_rcv); /* XXX */ @@ -2812,7 +2812,7 @@ step6: */ if (SEQ_GT(th->th_seq+th->th_urp, tp->rcv_up)) { tp->rcv_up = th->th_seq + th->th_urp; - so->so_oobmark = so->so_rcv.sb_cc + + so->so_oobmark = sbavail(&so->so_rcv) + (tp->rcv_up - tp->rcv_nxt) - 1; if (so->so_oobmark == 0) so->so_rcv.sb_state |= SBS_RCVATMARK; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/netinet/tcp_output.c Wed Nov 12 09:57:15 2014 (r274421) @@ -322,7 +322,7 @@ after_sack_rexmit: * to send then the probe will be the FIN * itself. */ - if (off < so->so_snd.sb_cc) + if (off < sbused(&so->so_snd)) flags &= ~TH_FIN; sendwin = 1; } else { @@ -348,7 +348,8 @@ after_sack_rexmit: */ if (sack_rxmit == 0) { if (sack_bytes_rxmt == 0) - len = ((long)ulmin(so->so_snd.sb_cc, sendwin) - off); + len = ((long)ulmin(sbavail(&so->so_snd), sendwin) - + off); else { long cwin; @@ -357,8 +358,8 @@ after_sack_rexmit: * sending new data, having retransmitted all the * data possible in the scoreboard. */ - len = ((long)ulmin(so->so_snd.sb_cc, tp->snd_wnd) - - off); + len = ((long)ulmin(sbavail(&so->so_snd), tp->snd_wnd) - + off); /* * Don't remove this (len > 0) check ! * We explicitly check for len > 0 here (although it @@ -457,12 +458,15 @@ after_sack_rexmit: * TODO: Shrink send buffer during idle periods together * with congestion window. Requires another timer. Has to * wait for upcoming tcp timer rewrite. + * + * XXXGL: should there be used sbused() or sbavail()? */ if (V_tcp_do_autosndbuf && so->so_snd.sb_flags & SB_AUTOSIZE) { if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat && - so->so_snd.sb_cc >= (so->so_snd.sb_hiwat / 8 * 7) && - so->so_snd.sb_cc < V_tcp_autosndbuf_max && - sendwin >= (so->so_snd.sb_cc - (tp->snd_nxt - tp->snd_una))) { + sbused(&so->so_snd) >= (so->so_snd.sb_hiwat / 8 * 7) && + sbused(&so->so_snd) < V_tcp_autosndbuf_max && + sendwin >= (sbused(&so->so_snd) - + (tp->snd_nxt - tp->snd_una))) { if (!sbreserve_locked(&so->so_snd, min(so->so_snd.sb_hiwat + V_tcp_autosndbuf_inc, V_tcp_autosndbuf_max), so, curthread)) @@ -499,10 +503,11 @@ after_sack_rexmit: tso = 1; if (sack_rxmit) { - if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc)) + if (SEQ_LT(p->rxmit + len, tp->snd_una + sbused(&so->so_snd))) flags &= ~TH_FIN; } else { - if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc)) + if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + + sbused(&so->so_snd))) flags &= ~TH_FIN; } @@ -532,7 +537,7 @@ after_sack_rexmit: */ if (!(tp->t_flags & TF_MORETOCOME) && /* normal case */ (idle || (tp->t_flags & TF_NODELAY)) && - len + off >= so->so_snd.sb_cc && + len + off >= sbavail(&so->so_snd) && (tp->t_flags & TF_NOPUSH) == 0) { goto send; } @@ -660,7 +665,7 @@ dontupdate: * if window is nonzero, transmit what we can, * otherwise force out a byte. */ - if (so->so_snd.sb_cc && !tcp_timer_active(tp, TT_REXMT) && + if (sbavail(&so->so_snd) && !tcp_timer_active(tp, TT_REXMT) && !tcp_timer_active(tp, TT_PERSIST)) { tp->t_rxtshift = 0; tcp_setpersist(tp); @@ -863,7 +868,7 @@ send: * emptied: */ max_len = (tp->t_maxopd - optlen); - if ((off + len) < so->so_snd.sb_cc) { + if ((off + len) < sbavail(&so->so_snd)) { moff = len % max_len; if (moff != 0) { len -= moff; @@ -979,7 +984,7 @@ send: * give data to the user when a buffer fills or * a PUSH comes in.) */ - if (off + len == so->so_snd.sb_cc) + if (off + len == sbused(&so->so_snd)) flags |= TH_PUSH; SOCKBUF_UNLOCK(&so->so_snd); } else { Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Wed Nov 12 09:57:15 2014 (r274421) @@ -747,7 +747,7 @@ sdp_start_disconnect(struct sdp_sock *ss ("sdp_start_disconnect: sdp_drop() returned NULL")); } else { soisdisconnecting(so); - unread = so->so_rcv.sb_cc; + unread = sbused(&so->so_rcv); sbflush(&so->so_rcv); sdp_usrclosed(ssk); if (!(ssk->flags & SDP_DROPPED)) { @@ -1259,7 +1259,7 @@ sdp_sorecv(struct socket *so, struct soc /* We will never ever get anything unless we are connected. */ if (!(so->so_state & (SS_ISCONNECTED|SS_ISDISCONNECTED))) { /* When disconnecting there may be still some data left. */ - if (sb->sb_cc > 0) + if (sbavail(sb)) goto deliver; if (!(so->so_state & SS_ISDISCONNECTED)) error = ENOTCONN; @@ -1267,7 +1267,7 @@ sdp_sorecv(struct socket *so, struct soc } /* Socket buffer is empty and we shall not block. */ - if (sb->sb_cc == 0 && + if (sbavail(sb) == 0 && ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) { error = EAGAIN; goto out; @@ -1278,7 +1278,7 @@ restart: /* Abort if socket has reported problems. */ if (so->so_error) { - if (sb->sb_cc > 0) + if (sbavail(sb)) goto deliver; if (oresid > uio->uio_resid) goto out; @@ -1290,25 +1290,25 @@ restart: /* Door is closed. Deliver what is left, if any. */ if (sb->sb_state & SBS_CANTRCVMORE) { - if (sb->sb_cc > 0) + if (sbavail(sb)) goto deliver; else goto out; } /* Socket buffer got some data that we shall deliver now. */ - if (sb->sb_cc > 0 && !(flags & MSG_WAITALL) && + if (sbavail(sb) && !(flags & MSG_WAITALL) && ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || - sb->sb_cc >= sb->sb_lowat || - sb->sb_cc >= uio->uio_resid || - sb->sb_cc >= sb->sb_hiwat) ) { + sbavail(sb) >= sb->sb_lowat || + sbavail(sb) >= uio->uio_resid || + sbavail(sb) >= sb->sb_hiwat) ) { goto deliver; } /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_lowat)) + (sbavail(sb) >= uio->uio_resid || sbavail(sb) >= sb->sb_lowat)) goto deliver; /* @@ -1322,7 +1322,7 @@ restart: deliver: SOCKBUF_LOCK_ASSERT(&so->so_rcv); - KASSERT(sb->sb_cc > 0, ("%s: sockbuf empty", __func__)); + KASSERT(sbavail(sb), ("%s: sockbuf empty", __func__)); KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__)); /* Statistics. */ @@ -1330,7 +1330,7 @@ deliver: uio->uio_td->td_ru.ru_msgrcv++; /* Fill uio until full or current end of socket buffer is reached. */ - len = min(uio->uio_resid, sb->sb_cc); + len = min(uio->uio_resid, sbavail(sb)); if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { @@ -1510,7 +1510,7 @@ sdp_urg(struct sdp_sock *ssk, struct mbu if (so == NULL) return; - so->so_oobmark = so->so_rcv.sb_cc + mb->m_pkthdr.len - 1; + so->so_oobmark = sbused(&so->so_rcv) + mb->m_pkthdr.len - 1; sohasoutofband(so); ssk->oobflags &= ~(SDP_HAVEOOB | SDP_HADOOB); if (!(so->so_options & SO_OOBINLINE)) { Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Wed Nov 12 09:57:15 2014 (r274421) @@ -183,7 +183,7 @@ sdp_post_recvs_needed(struct sdp_sock *s * Compute bytes in the receive queue and socket buffer. */ bytes_in_process = (posted - SDP_MIN_TX_CREDITS) * buffer_size; - bytes_in_process += ssk->socket->so_rcv.sb_cc; + bytes_in_process += sbused(&ssk->socket->so_rcv); return bytes_in_process < max_bytes; } Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/rpc/clnt_vc.c Wed Nov 12 09:57:15 2014 (r274421) @@ -860,7 +860,7 @@ clnt_vc_soupcall(struct socket *so, void * error condition */ do_read = FALSE; - if (so->so_rcv.sb_cc >= sizeof(uint32_t) + if (sbavail(&so->so_rcv) >= sizeof(uint32_t) || (so->so_rcv.sb_state & SBS_CANTRCVMORE) || so->so_error) do_read = TRUE; @@ -913,7 +913,7 @@ clnt_vc_soupcall(struct socket *so, void * buffered. */ do_read = FALSE; - if (so->so_rcv.sb_cc >= ct->ct_record_resid + if (sbavail(&so->so_rcv) >= ct->ct_record_resid || (so->so_rcv.sb_state & SBS_CANTRCVMORE) || so->so_error) do_read = TRUE; Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/rpc/svc_vc.c Wed Nov 12 09:57:15 2014 (r274421) @@ -546,7 +546,7 @@ svc_vc_ack(SVCXPRT *xprt, uint32_t *ack) { *ack = atomic_load_acq_32(&xprt->xp_snt_cnt); - *ack -= xprt->xp_socket->so_snd.sb_cc; + *ack -= sbused(&xprt->xp_socket->so_snd); return (TRUE); } Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/sys/sockbuf.h Wed Nov 12 09:57:15 2014 (r274421) @@ -166,6 +166,34 @@ int sblock(struct sockbuf *sb, int flags void sbunlock(struct sockbuf *sb); /* + * Return how much data is available to be taken out of socket + * bufffer right now. + */ +static inline u_int +sbavail(struct sockbuf *sb) +{ + +#if 0 + SOCKBUF_LOCK_ASSERT(sb); +#endif + return (sb->sb_cc); +} + +/* + * Return how much data sits there in the socket buffer + * It might be that some data is not yet ready to be read. + */ +static inline u_int +sbused(struct sockbuf *sb) +{ + +#if 0 + SOCKBUF_LOCK_ASSERT(sb); +#endif + return (sb->sb_cc); +} + +/* * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? * This is problematical if the fields are unsigned, as the space might * still be negative (cc > hiwat or mbcnt > mbmax). Should detect Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Wed Nov 12 09:24:32 2014 (r274420) +++ head/sys/sys/socketvar.h Wed Nov 12 09:57:15 2014 (r274421) @@ -208,7 +208,7 @@ struct xsocket { /* can we read something from so? */ #define soreadabledata(so) \ - ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \ + (sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || \ !TAILQ_EMPTY(&(so)->so_comp) || (so)->so_error) #define soreadable(so) \ (soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE)) From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 10:17:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B19532F8; Wed, 12 Nov 2014 10:17:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 843B4AAF; Wed, 12 Nov 2014 10:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sACAHlPP084379; Wed, 12 Nov 2014 10:17:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sACAHlHq084378; Wed, 12 Nov 2014 10:17:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411121017.sACAHlHq084378@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 12 Nov 2014 10:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274423 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 10:17:47 -0000 Author: glebius Date: Wed Nov 12 10:17:46 2014 New Revision: 274423 URL: https://svnweb.freebsd.org/changeset/base/274423 Log: Merge from projects/sendfile: - Use KASSERT()s instead of panic(). - Use sbavail() instead of sb_cc. Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Nov 12 10:03:10 2014 (r274422) +++ head/sys/kern/uipc_usrreq.c Wed Nov 12 10:17:46 2014 (r274423) @@ -793,10 +793,9 @@ uipc_rcvd(struct socket *so, int flags) u_int mbcnt, sbcc; unp = sotounpcb(so); - KASSERT(unp != NULL, ("uipc_rcvd: unp == NULL")); - - if (so->so_type != SOCK_STREAM && so->so_type != SOCK_SEQPACKET) - panic("uipc_rcvd socktype %d", so->so_type); + KASSERT(unp != NULL, ("%s: unp == NULL", __func__)); + KASSERT(so->so_type == SOCK_STREAM || so->so_type == SOCK_SEQPACKET, + ("%s: socktype %d", __func__, so->so_type)); /* * Adjust backpressure on sender and wakeup any waiting to write. @@ -810,7 +809,7 @@ uipc_rcvd(struct socket *so, int flags) */ SOCKBUF_LOCK(&so->so_rcv); mbcnt = so->so_rcv.sb_mbcnt; - sbcc = so->so_rcv.sb_cc; + sbcc = sbavail(&so->so_rcv); SOCKBUF_UNLOCK(&so->so_rcv); /* * There is a benign race condition at this point. If we're planning to @@ -846,7 +845,10 @@ uipc_send(struct socket *so, int flags, int error = 0; unp = sotounpcb(so); - KASSERT(unp != NULL, ("uipc_send: unp == NULL")); + KASSERT(unp != NULL, ("%s: unp == NULL", __func__)); + KASSERT(so->so_type == SOCK_STREAM || so->so_type == SOCK_DGRAM || + so->so_type == SOCK_SEQPACKET, + ("%s: socktype %d", __func__, so->so_type)); if (flags & PRUS_OOB) { error = EOPNOTSUPP; @@ -997,8 +999,11 @@ uipc_send(struct socket *so, int flags, } mbcnt = so2->so_rcv.sb_mbcnt; - sbcc = so2->so_rcv.sb_cc; - sorwakeup_locked(so2); + sbcc = sbavail(&so2->so_rcv); + if (sbcc) + sorwakeup_locked(so2); + else + SOCKBUF_UNLOCK(&so2->so_rcv); /* * The PCB lock on unp2 protects the SB_STOP flag. Without it, @@ -1014,9 +1019,6 @@ uipc_send(struct socket *so, int flags, UNP_PCB_UNLOCK(unp2); m = NULL; break; - - default: - panic("uipc_send unknown socktype"); } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 14:00:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EC40BF6; Wed, 12 Nov 2014 14:00:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3EA3D9; Wed, 12 Nov 2014 14:00:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sACE0oGY092409; Wed, 12 Nov 2014 14:00:50 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sACE0oCr092408; Wed, 12 Nov 2014 14:00:50 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411121400.sACE0oCr092408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 12 Nov 2014 14:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274434 - head/sys/netipsec 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 14:00:50 -0000 Author: ae Date: Wed Nov 12 14:00:49 2014 New Revision: 274434 URL: https://svnweb.freebsd.org/changeset/base/274434 Log: Fix ips_out_nosa errors accounting. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Wed Nov 12 13:19:40 2014 (r274433) +++ head/sys/netipsec/ipsec_output.c Wed Nov 12 14:00:49 2014 (r274434) @@ -358,7 +358,16 @@ again: * this packet because it is responsibility for * upper layer to retransmit the packet. */ - IPSECSTAT_INC(ips_out_nosa); + switch(af) { + case AF_INET: + IPSECSTAT_INC(ips_out_nosa); + break; +#ifdef INET6 + case AF_INET6: + IPSEC6STAT_INC(ips_out_nosa); + break; +#endif + } goto bad; } sav = isr->sav; From owner-svn-src-all@FreeBSD.ORG Wed Nov 12 14:52:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 179DE7A2; Wed, 12 Nov 2014 14:52:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC3E7BBA; Wed, 12 Nov 2014 14:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sACEqi45019443; Wed, 12 Nov 2014 14:52:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sACEqiDE019442; Wed, 12 Nov 2014 14:52:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411121452.sACEqiDE019442@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 12 Nov 2014 14:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274435 - head/usr.sbin/usbconfig 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Nov 2014 14:52:45 -0000 Author: hselasky Date: Wed Nov 12 14:52:44 2014 New Revision: 274435 URL: https://svnweb.freebsd.org/changeset/base/274435 Log: Decode more fields when dumping USB descriptors. - Some minor style changes while at it. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/usr.sbin/usbconfig/dump.c Modified: head/usr.sbin/usbconfig/dump.c ============================================================================== --- head/usr.sbin/usbconfig/dump.c Wed Nov 12 14:00:49 2014 (r274434) +++ head/usr.sbin/usbconfig/dump.c Wed Nov 12 14:52:44 2014 (r274435) @@ -110,7 +110,6 @@ dump_field(struct libusb20_device *pdev, printf(" \n"); return; } - if (strcmp(field, "bmAttributes") == 0) { switch (value & 0x03) { case 0: @@ -142,7 +141,6 @@ dump_field(struct libusb20_device *pdev, return; } } - if ((field[0] == 'i') && (field[1] != 'd')) { /* Indirect String Descriptor */ if (value == 0) { @@ -157,7 +155,84 @@ dump_field(struct libusb20_device *pdev, printf(" <%s>\n", temp_string); return; } + if (strlen(plevel) == 2 || strlen(plevel) == 6) { + + /* Device and Interface Descriptor class codes */ + + if (strcmp(field, "bInterfaceClass") == 0 || + strcmp(field, "bDeviceClass") == 0) { + switch (value) { + case 0x00: + printf(" \n"); + break; + case 0x01: + printf("