From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 27 08:02:24 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97A03F53; Sun, 27 Jul 2014 08:02: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 848EA2150; Sun, 27 Jul 2014 08:02:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6R82OTP055048; Sun, 27 Jul 2014 08:02:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6R82Olf055047; Sun, 27 Jul 2014 08:02:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407270802.s6R82Olf055047@svn.freebsd.org> From: Alexander Motin Date: Sun, 27 Jul 2014 08:02: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: r269151 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 08:02:24 -0000 Author: mav Date: Sun Jul 27 08:02:24 2014 New Revision: 269151 URL: http://svnweb.freebsd.org/changeset/base/269151 Log: MFC r269058: Fix build with QUEUE_MACRO_DEBUG. Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Sun Jul 27 07:07:12 2014 (r269150) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Sun Jul 27 08:02:24 2014 (r269151) @@ -815,7 +815,7 @@ ctl_backend_ramdisk_lun_shutdown(void *b if (lun->flags & CTL_BE_RAMDISK_LUN_WAITING) { wakeup(lun); } else { - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_ramdisk_lun, + STAILQ_REMOVE(&softc->lun_list, lun, ctl_be_ramdisk_lun, links); softc->num_luns--; do_free = 1; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 27 18:08:48 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B33E0A98; Sun, 27 Jul 2014 18:08: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 9F8F82386; Sun, 27 Jul 2014 18:08: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 s6RI8mIZ046917; Sun, 27 Jul 2014 18:08:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6RI8mSI046916; Sun, 27 Jul 2014 18:08:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407271808.s6RI8mSI046916@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Jul 2014 18:08:48 +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: r269156 - stable/10/sys/fs/nullfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 18:08:48 -0000 Author: kib Date: Sun Jul 27 18:08:47 2014 New Revision: 269156 URL: http://svnweb.freebsd.org/changeset/base/269156 Log: MFC r269081: Fix typo. Modified: stable/10/sys/fs/nullfs/null_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/10/sys/fs/nullfs/null_vnops.c Sun Jul 27 17:34:49 2014 (r269155) +++ stable/10/sys/fs/nullfs/null_vnops.c Sun Jul 27 18:08:47 2014 (r269156) @@ -738,7 +738,7 @@ null_reclaim(struct vop_reclaim_args *ap lowervp = xp->null_lowervp; KASSERT(lowervp != NULL && vp->v_vnlock != &vp->v_lock, - ("Reclaiming inclomplete null vnode %p", vp)); + ("Reclaiming incomplete null vnode %p", vp)); null_hashrem(xp); /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 00:43:44 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46689BA2; Mon, 28 Jul 2014 00:43: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 33A4B2A65; Mon, 28 Jul 2014 00:43: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 s6S0hhti000416; Mon, 28 Jul 2014 00:43:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S0hgVf000406; Mon, 28 Jul 2014 00:43:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280043.s6S0hgVf000406@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 00:43:42 +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: r269164 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 00:43:44 -0000 Author: kib Date: Mon Jul 28 00:43:42 2014 New Revision: 269164 URL: http://svnweb.freebsd.org/changeset/base/269164 Log: MFC r268605: Remove code separator lines which do not conform to style(9). Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_fifoops.c stable/10/sys/fs/tmpfs/tmpfs_fifoops.h stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vfsops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs.h Mon Jul 28 00:43:42 2014 (r269164) @@ -35,9 +35,6 @@ #ifndef _FS_TMPFS_TMPFS_H_ #define _FS_TMPFS_TMPFS_H_ -/* --------------------------------------------------------------------- - * KERNEL-SPECIFIC DEFINITIONS - * --------------------------------------------------------------------- */ #include #include #include @@ -46,7 +43,6 @@ #include #include -/* --------------------------------------------------------------------- */ #include #include #include @@ -56,8 +52,6 @@ MALLOC_DECLARE(M_TMPFSMNT); MALLOC_DECLARE(M_TMPFSNAME); -/* --------------------------------------------------------------------- */ - /* * Internal representation of a tmpfs directory entry. */ @@ -137,8 +131,6 @@ RB_HEAD(tmpfs_dir, tmpfs_dirent); #define TMPFS_DIRCOOKIE_DUP_MAX \ (TMPFS_DIRCOOKIE_DUP | TMPFS_DIRCOOKIE_MASK) -/* --------------------------------------------------------------------- */ - /* * Internal representation of a tmpfs file system node. * @@ -308,7 +300,6 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_VNODE_WANT 2 #define TMPFS_VNODE_DOOMED 4 #define TMPFS_VNODE_WRECLAIM 8 -/* --------------------------------------------------------------------- */ /* * Internal representation of a tmpfs mount point. @@ -375,8 +366,6 @@ struct tmpfs_mount { #define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) -/* --------------------------------------------------------------------- */ - /* * This structure maps a file identifier to a tmpfs node. Used by the * NFS code. @@ -388,8 +377,6 @@ struct tmpfs_fid { unsigned long tf_gen; }; -/* --------------------------------------------------------------------- */ - #ifdef _KERNEL /* * Prototypes for tmpfs_subr.c. @@ -433,16 +420,12 @@ void tmpfs_itimes(struct vnode *, const void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); -/* --------------------------------------------------------------------- */ - /* * Convenience macros to simplify some logical expressions. */ #define IMPLIES(a, b) (!(a) || (b)) #define IFF(a, b) (IMPLIES(a, b) && IMPLIES(b, a)) -/* --------------------------------------------------------------------- */ - /* * Checks that the directory entry pointed by 'de' matches the name 'name' * with a length of 'len'. @@ -451,8 +434,6 @@ int tmpfs_truncate(struct vnode *, off_t (de->td_namelen == len && \ bcmp((de)->ud.td_name, (name), (de)->td_namelen) == 0) -/* --------------------------------------------------------------------- */ - /* * Ensures that the node pointed by 'node' is a directory and that its * contents are consistent with respect to directories. @@ -462,8 +443,6 @@ int tmpfs_truncate(struct vnode *, off_t MPASS((node)->tn_size % sizeof(struct tmpfs_dirent) == 0); \ } while (0) -/* --------------------------------------------------------------------- */ - /* * Memory management stuff. */ @@ -480,8 +459,6 @@ size_t tmpfs_pages_used(struct tmpfs_mou #endif -/* --------------------------------------------------------------------- */ - /* * Macros/functions to convert from generic data structures to tmpfs * specific ones. Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Mon Jul 28 00:43:42 2014 (r269164) @@ -48,8 +48,6 @@ #include #include -/* --------------------------------------------------------------------- */ - static int tmpfs_fifo_kqfilter(struct vop_kqfilter_args *ap) { @@ -71,8 +69,6 @@ tmpfs_fifo_kqfilter(struct vop_kqfilter_ return fifo_specops.vop_kqfilter(ap); } -/* --------------------------------------------------------------------- */ - static int tmpfs_fifo_close(struct vop_close_args *v) { Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_fifoops.h Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs_fifoops.h Mon Jul 28 00:43:42 2014 (r269164) @@ -41,13 +41,10 @@ #include -/* --------------------------------------------------------------------- */ - /* * Declarations for tmpfs_fifoops.c. */ extern struct vop_vector tmpfs_fifoop_entries; -/* --------------------------------------------------------------------- */ #endif /* _FS_TMPFS_TMPFS_FIFOOPS_H_ */ Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 00:43:42 2014 (r269164) @@ -136,8 +136,6 @@ tmpfs_pages_check_avail(struct tmpfs_mou return (1); } -/* --------------------------------------------------------------------- */ - /* * Allocates a new node of type 'type' inside the 'tmp' mount point, with * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', @@ -251,8 +249,6 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp return 0; } -/* --------------------------------------------------------------------- */ - /* * Destroys the node pointed to by node from the file system 'tmp'. * If the node does not belong to the given mount point, the results are @@ -328,8 +324,6 @@ tmpfs_free_node(struct tmpfs_mount *tmp, uma_zfree(tmp->tm_node_pool, node); } -/* --------------------------------------------------------------------- */ - static __inline uint32_t tmpfs_dirent_hash(const char *name, u_int len) { @@ -406,8 +400,6 @@ tmpfs_alloc_dirent(struct tmpfs_mount *t return 0; } -/* --------------------------------------------------------------------- */ - /* * Frees a directory entry. It is the caller's responsibility to destroy * the node referenced by it if needed. @@ -432,8 +424,6 @@ tmpfs_free_dirent(struct tmpfs_mount *tm uma_zfree(tmp->tm_dirent_pool, de); } -/* --------------------------------------------------------------------- */ - void tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) { @@ -631,8 +621,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - /* * Destroys the association between the vnode vp and the node it * references. @@ -652,8 +640,6 @@ tmpfs_free_vp(struct vnode *vp) vp->v_data = NULL; } -/* --------------------------------------------------------------------- */ - /* * Allocates a new file of type 'type' and adds it to the parent directory * 'dvp'; this addition is done using the component name given in 'cnp'. @@ -733,8 +719,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - static struct tmpfs_dirent * tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc) { @@ -990,8 +974,6 @@ tmpfs_dir_attach(struct vnode *vp, struc TMPFS_NODE_MODIFIED; } -/* --------------------------------------------------------------------- */ - /* * Detaches the directory entry de from the directory represented by vp. * Note that this does not change the link count of the node pointed by @@ -1057,8 +1039,6 @@ tmpfs_dir_destroy(struct tmpfs_mount *tm } } -/* --------------------------------------------------------------------- */ - /* * Helper function for tmpfs_readdir. Creates a '.' entry for the given * directory and returns it in the uio space. The function returns 0 @@ -1092,8 +1072,6 @@ tmpfs_dir_getdotdent(struct tmpfs_node * return error; } -/* --------------------------------------------------------------------- */ - /* * Helper function for tmpfs_readdir. Creates a '..' entry for the given * directory and returns it in the uio space. The function returns 0 @@ -1139,8 +1117,6 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod return error; } -/* --------------------------------------------------------------------- */ - /* * Helper function for tmpfs_readdir. Returns as much directory entries * as can fit in the uio space. The read starts at uio->uio_offset. @@ -1310,8 +1286,6 @@ tmpfs_dir_whiteout_remove(struct vnode * tmpfs_free_dirent(VFS_TO_TMPFS(dvp->v_mount), de); } -/* --------------------------------------------------------------------- */ - /* * Resizes the aobj associated with the regular file pointed to by 'vp' to the * size 'newsize'. 'vp' must point to a vnode that represents a regular file. @@ -1422,8 +1396,6 @@ retry: return (0); } -/* --------------------------------------------------------------------- */ - /* * Change flags of the given vnode. * Caller should execute tmpfs_update on vp after a successful execution. @@ -1481,8 +1453,6 @@ tmpfs_chflags(struct vnode *vp, u_long f return 0; } -/* --------------------------------------------------------------------- */ - /* * Change access mode on the given vnode. * Caller should execute tmpfs_update on vp after a successful execution. @@ -1539,8 +1509,6 @@ tmpfs_chmod(struct vnode *vp, mode_t mod return 0; } -/* --------------------------------------------------------------------- */ - /* * Change ownership of the given vnode. At least one of uid or gid must * be different than VNOVAL. If one is set to that value, the attribute @@ -1612,8 +1580,6 @@ tmpfs_chown(struct vnode *vp, uid_t uid, return 0; } -/* --------------------------------------------------------------------- */ - /* * Change size of the given vnode. * Caller should execute tmpfs_update on vp after a successful execution. @@ -1669,8 +1635,6 @@ tmpfs_chsize(struct vnode *vp, u_quad_t return error; } -/* --------------------------------------------------------------------- */ - /* * Change access and modification times of the given vnode. * Caller should execute tmpfs_update on vp after a successful execution. @@ -1719,7 +1683,6 @@ tmpfs_chtimes(struct vnode *vp, struct v return 0; } -/* --------------------------------------------------------------------- */ /* Sync timestamps */ void tmpfs_itimes(struct vnode *vp, const struct timespec *acc, @@ -1752,8 +1715,6 @@ tmpfs_itimes(struct vnode *vp, const str ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED); } -/* --------------------------------------------------------------------- */ - void tmpfs_update(struct vnode *vp) { @@ -1761,8 +1722,6 @@ tmpfs_update(struct vnode *vp) tmpfs_itimes(vp, NULL, NULL); } -/* --------------------------------------------------------------------- */ - int tmpfs_truncate(struct vnode *vp, off_t length) { Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jul 28 00:43:42 2014 (r269164) @@ -68,8 +68,6 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_TMPFSMNT, "tmpfs mount", "tmpfs mount structures"); MALLOC_DEFINE(M_TMPFSNAME, "tmpfs name", "tmpfs file names"); -/* --------------------------------------------------------------------- */ - static int tmpfs_mount(struct mount *); static int tmpfs_unmount(struct mount *, int); static int tmpfs_root(struct mount *, int flags, struct vnode **); @@ -77,8 +75,6 @@ static int tmpfs_fhtovp(struct mount *, struct vnode **); static int tmpfs_statfs(struct mount *, struct statfs *); -/* --------------------------------------------------------------------- */ - static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", "union", NULL @@ -88,8 +84,6 @@ static const char *tmpfs_updateopts[] = "from", "export", NULL }; -/* --------------------------------------------------------------------- */ - static int tmpfs_node_ctor(void *mem, int size, void *arg, int flags) { @@ -271,8 +265,6 @@ tmpfs_mount(struct mount *mp) return 0; } -/* --------------------------------------------------------------------- */ - /* ARGSUSED2 */ static int tmpfs_unmount(struct mount *mp, int mntflags) @@ -328,8 +320,6 @@ tmpfs_unmount(struct mount *mp, int mntf return 0; } -/* --------------------------------------------------------------------- */ - static int tmpfs_root(struct mount *mp, int flags, struct vnode **vpp) { @@ -342,8 +332,6 @@ tmpfs_root(struct mount *mp, int flags, return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) @@ -380,8 +368,6 @@ tmpfs_fhtovp(struct mount *mp, struct fi return (EINVAL); } -/* --------------------------------------------------------------------- */ - /* ARGSUSED2 */ static int tmpfs_statfs(struct mount *mp, struct statfs *sbp) @@ -415,8 +401,6 @@ tmpfs_statfs(struct mount *mp, struct st return 0; } -/* --------------------------------------------------------------------- */ - /* * tmpfs vfs operations. */ Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 00:43:42 2014 (r269164) @@ -68,8 +68,6 @@ SYSCTL_INT(_vfs_tmpfs, OID_AUTO, rename_ __DEVOLATILE(int *, &tmpfs_rename_restarts), 0, "Times rename had to restart due to lock contention"); -/* --------------------------------------------------------------------- */ - static int tmpfs_lookup(struct vop_cachedlookup_args *v) { @@ -207,8 +205,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_create(struct vop_create_args *v) { @@ -221,7 +217,6 @@ tmpfs_create(struct vop_create_args *v) return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); } -/* --------------------------------------------------------------------- */ static int tmpfs_mknod(struct vop_mknod_args *v) @@ -238,8 +233,6 @@ tmpfs_mknod(struct vop_mknod_args *v) return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); } -/* --------------------------------------------------------------------- */ - static int tmpfs_open(struct vop_open_args *v) { @@ -272,8 +265,6 @@ tmpfs_open(struct vop_open_args *v) return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_close(struct vop_close_args *v) { @@ -285,8 +276,6 @@ tmpfs_close(struct vop_close_args *v) return (0); } -/* --------------------------------------------------------------------- */ - int tmpfs_access(struct vop_access_args *v) { @@ -341,8 +330,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - int tmpfs_getattr(struct vop_getattr_args *v) { @@ -504,8 +491,6 @@ out: return (error); } -/* --------------------------------------------------------------------- */ - static int tmpfs_fsync(struct vop_fsync_args *v) { @@ -518,8 +503,6 @@ tmpfs_fsync(struct vop_fsync_args *v) return 0; } -/* --------------------------------------------------------------------- */ - static int tmpfs_remove(struct vop_remove_args *v) { @@ -572,8 +555,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_link(struct vop_link_args *v) { @@ -640,8 +621,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - /* * We acquire all but fdvp locks using non-blocking acquisitions. If we * fail to acquire any lock in the path we will drop all held locks, @@ -1051,8 +1030,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_mkdir(struct vop_mkdir_args *v) { @@ -1066,8 +1043,6 @@ tmpfs_mkdir(struct vop_mkdir_args *v) return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); } -/* --------------------------------------------------------------------- */ - static int tmpfs_rmdir(struct vop_rmdir_args *v) { @@ -1161,8 +1136,6 @@ out: return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_symlink(struct vop_symlink_args *v) { @@ -1181,8 +1154,6 @@ tmpfs_symlink(struct vop_symlink_args *v return tmpfs_alloc_file(dvp, vpp, vap, cnp, target); } -/* --------------------------------------------------------------------- */ - static int tmpfs_readdir(struct vop_readdir_args *v) { @@ -1235,8 +1206,6 @@ tmpfs_readdir(struct vop_readdir_args *v return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_readlink(struct vop_readlink_args *v) { @@ -1258,8 +1227,6 @@ tmpfs_readlink(struct vop_readlink_args return error; } -/* --------------------------------------------------------------------- */ - static int tmpfs_inactive(struct vop_inactive_args *v) { @@ -1275,8 +1242,6 @@ tmpfs_inactive(struct vop_inactive_args return 0; } -/* --------------------------------------------------------------------- */ - int tmpfs_reclaim(struct vop_reclaim_args *v) { @@ -1314,8 +1279,6 @@ tmpfs_reclaim(struct vop_reclaim_args *v return 0; } -/* --------------------------------------------------------------------- */ - static int tmpfs_print(struct vop_print_args *v) { @@ -1339,8 +1302,6 @@ tmpfs_print(struct vop_print_args *v) return 0; } -/* --------------------------------------------------------------------- */ - static int tmpfs_pathconf(struct vop_pathconf_args *v) { @@ -1430,8 +1391,6 @@ tmpfs_whiteout(struct vop_whiteout_args } } -/* --------------------------------------------------------------------- */ - /* * vnode operations vector used for files stored in a tmpfs file system. */ Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.h Sun Jul 27 22:56:46 2014 (r269163) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.h Mon Jul 28 00:43:42 2014 (r269164) @@ -39,8 +39,6 @@ #error not supposed to be exposed to userland. #endif -/* --------------------------------------------------------------------- */ - /* * Declarations for tmpfs_vnops.c. */ @@ -52,6 +50,4 @@ vop_getattr_t tmpfs_getattr; vop_setattr_t tmpfs_setattr; vop_reclaim_t tmpfs_reclaim; -/* --------------------------------------------------------------------- */ - #endif /* _FS_TMPFS_TMPFS_VNOPS_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 00:53:28 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 282E9DC2; Mon, 28 Jul 2014 00:53: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 0A6C82B3E; Mon, 28 Jul 2014 00:53: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 s6S0rReN004929; Mon, 28 Jul 2014 00:53:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S0rRPX004922; Mon, 28 Jul 2014 00:53:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280053.s6S0rRPX004922@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 00:53:27 +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: r269165 - in stable/10/sys: fs/cd9660 fs/msdosfs kern 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 00:53:28 -0000 Author: kib Date: Mon Jul 28 00:53:26 2014 New Revision: 269165 URL: http://svnweb.freebsd.org/changeset/base/269165 Log: MFC r268606: Generalize vn_get_ino() to allow filesystems to use custom vnode producer. Convert inline copies of vn_get_ino() in msdosfs and cd9660 into the uses of vn_get_ino_gen(). Modified: stable/10/sys/fs/cd9660/cd9660_lookup.c stable/10/sys/fs/msdosfs/msdosfs_lookup.c stable/10/sys/kern/vfs_vnops.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/cd9660/cd9660_lookup.c ============================================================================== --- stable/10/sys/fs/cd9660/cd9660_lookup.c Mon Jul 28 00:43:42 2014 (r269164) +++ stable/10/sys/fs/cd9660/cd9660_lookup.c Mon Jul 28 00:53:26 2014 (r269165) @@ -50,6 +50,23 @@ __FBSDID("$FreeBSD$"); #include #include +struct cd9660_ino_alloc_arg { + ino_t ino; + ino_t i_ino; + struct iso_directory_record *ep; +}; + +static int +cd9660_ino_alloc(struct mount *mp, void *arg, int lkflags, + struct vnode **vpp) +{ + struct cd9660_ino_alloc_arg *dd_arg; + + dd_arg = arg; + return (cd9660_vget_internal(mp, dd_arg->i_ino, lkflags, vpp, + dd_arg->i_ino != dd_arg->ino, dd_arg->ep)); +} + /* * Convert a component of a pathname into a pointer to a locked inode. * This is a very central and rather complicated routine. @@ -104,6 +121,7 @@ cd9660_lookup(ap) doff_t endsearch; /* offset to end directory search */ struct vnode *pdp; /* saved dp during symlink work */ struct vnode *tdp; /* returned by cd9660_vget_internal */ + struct cd9660_ino_alloc_arg dd_arg; u_long bmask; /* block offset mask */ int error; ino_t ino, i_ino; @@ -114,7 +132,6 @@ cd9660_lookup(ap) int res; int assoc, len; char *name; - struct mount *mp; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; int flags = cnp->cn_flags; @@ -368,39 +385,13 @@ found: * it's a relocated directory. */ if (flags & ISDOTDOT) { - /* - * Expanded copy of vn_vget_ino() so that we can use - * cd9660_vget_internal(). - */ - mp = pdp->v_mount; - ltype = VOP_ISLOCKED(pdp); - error = vfs_busy(mp, MBF_NOWAIT); - if (error != 0) { - vfs_ref(mp); - VOP_UNLOCK(pdp, 0); - error = vfs_busy(mp, 0); - vn_lock(pdp, ltype | LK_RETRY); - vfs_rel(mp); - if (error) - return (ENOENT); - if (pdp->v_iflag & VI_DOOMED) { - vfs_unbusy(mp); - return (ENOENT); - } - } - VOP_UNLOCK(pdp, 0); - error = cd9660_vget_internal(vdp->v_mount, i_ino, - cnp->cn_lkflags, &tdp, - i_ino != ino, ep); + dd_arg.ino = ino; + dd_arg.i_ino = i_ino; + dd_arg.ep = ep; + error = vn_vget_ino_gen(pdp, cd9660_ino_alloc, &dd_arg, + cnp->cn_lkflags, &tdp); free(ep2, M_TEMP); - vfs_unbusy(mp); - vn_lock(pdp, ltype | LK_RETRY); - if (pdp->v_iflag & VI_DOOMED) { - if (error == 0) - vput(tdp); - error = ENOENT; - } - if (error) + if (error != 0) return (error); *vpp = tdp; } else if (dp->i_number == i_ino) { Modified: stable/10/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_lookup.c Mon Jul 28 00:43:42 2014 (r269164) +++ stable/10/sys/fs/msdosfs/msdosfs_lookup.c Mon Jul 28 00:53:26 2014 (r269165) @@ -63,8 +63,6 @@ static int msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, u_int64_t *inum); -static int msdosfs_deget_dotdot(struct vnode *vp, u_long cluster, int blkoff, - struct vnode **rvp); int msdosfs_lookup(struct vop_cachedlookup_args *ap) @@ -73,6 +71,28 @@ msdosfs_lookup(struct vop_cachedlookup_a return (msdosfs_lookup_(ap->a_dvp, ap->a_vpp, ap->a_cnp, NULL)); } +struct deget_dotdot { + u_long cluster; + int blkoff; +}; + +static int +msdosfs_deget_dotdot(struct mount *mp, void *arg, int lkflags, + struct vnode **rvp) +{ + struct deget_dotdot *dd_arg; + struct denode *rdp; + struct msdosfsmount *pmp; + int error; + + pmp = VFSTOMSDOSFS(mp); + dd_arg = arg; + error = deget(pmp, dd_arg->cluster, dd_arg->blkoff, &rdp); + if (error == 0) + *rvp = DETOV(rdp); + return (error); +} + /* * When we search a directory the blocks containing directory entries are * read and examined. The directory entries contain information that would @@ -110,6 +130,7 @@ msdosfs_lookup_(struct vnode *vdp, struc struct msdosfsmount *pmp; struct buf *bp = NULL; struct direntry *dep = NULL; + struct deget_dotdot dd_arg; u_char dosfilename[12]; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; @@ -524,8 +545,11 @@ foundroot: */ pdp = vdp; if (flags & ISDOTDOT) { - error = msdosfs_deget_dotdot(pdp, cluster, blkoff, vpp); - if (error) { + dd_arg.cluster = cluster; + dd_arg.blkoff = blkoff; + error = vn_vget_ino_gen(vdp, msdosfs_deget_dotdot, + &dd_arg, cnp->cn_lkflags, vpp); + if (error != 0) { *vpp = NULL; return (error); } @@ -560,54 +584,6 @@ foundroot: return (0); } -static int -msdosfs_deget_dotdot(struct vnode *vp, u_long cluster, int blkoff, - struct vnode **rvp) -{ - struct mount *mp; - struct msdosfsmount *pmp; - struct denode *rdp; - int ltype, error; - - mp = vp->v_mount; - pmp = VFSTOMSDOSFS(mp); - ltype = VOP_ISLOCKED(vp); - KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED, - ("msdosfs_deget_dotdot: vp not locked")); - - error = vfs_busy(mp, MBF_NOWAIT); - if (error != 0) { - vfs_ref(mp); - VOP_UNLOCK(vp, 0); - error = vfs_busy(mp, 0); - vn_lock(vp, ltype | LK_RETRY); - vfs_rel(mp); - if (error != 0) - return (ENOENT); - if (vp->v_iflag & VI_DOOMED) { - vfs_unbusy(mp); - return (ENOENT); - } - } - VOP_UNLOCK(vp, 0); - error = deget(pmp, cluster, blkoff, &rdp); - vfs_unbusy(mp); - if (error == 0) - *rvp = DETOV(rdp); - if (*rvp != vp) - vn_lock(vp, ltype | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { - if (error == 0) { - if (*rvp == vp) - vunref(*rvp); - else - vput(*rvp); - } - error = ENOENT; - } - return (error); -} - /* * dep - directory entry to copy into the directory * ddep - directory to add to Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Mon Jul 28 00:43:42 2014 (r269164) +++ stable/10/sys/kern/vfs_vnops.c Mon Jul 28 00:53:26 2014 (r269165) @@ -1953,12 +1953,30 @@ vn_extattr_rm(struct vnode *vp, int iofl return (error); } +static int +vn_get_ino_alloc_vget(struct mount *mp, void *arg, int lkflags, + struct vnode **rvp) +{ + + return (VFS_VGET(mp, *(ino_t *)arg, lkflags, rvp)); +} + int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp) { + + return (vn_vget_ino_gen(vp, vn_get_ino_alloc_vget, &ino, + lkflags, rvp)); +} + +int +vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, void *alloc_arg, + int lkflags, struct vnode **rvp) +{ struct mount *mp; int ltype, error; + ASSERT_VOP_LOCKED(vp, "vn_vget_ino_get"); mp = vp->v_mount; ltype = VOP_ISLOCKED(vp); KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED, @@ -1978,12 +1996,17 @@ vn_vget_ino(struct vnode *vp, ino_t ino, } } VOP_UNLOCK(vp, 0); - error = VFS_VGET(mp, ino, lkflags, rvp); + error = alloc(mp, alloc_arg, lkflags, rvp); vfs_unbusy(mp); - vn_lock(vp, ltype | LK_RETRY); + if (*rvp != vp) + vn_lock(vp, ltype | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { - if (error == 0) - vput(*rvp); + if (error == 0) { + if (*rvp == vp) + vunref(vp); + else + vput(*rvp); + } error = ENOENT; } return (error); Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Mon Jul 28 00:43:42 2014 (r269164) +++ stable/10/sys/sys/vnode.h Mon Jul 28 00:53:26 2014 (r269165) @@ -593,6 +593,8 @@ struct uio; struct vattr; struct vnode; +typedef int (*vn_get_ino_t)(struct mount *, void *, int, struct vnode **); + /* cache_* may belong in namei.h. */ #define cache_enter(dvp, vp, cnp) \ cache_enter_time(dvp, vp, cnp, NULL, NULL) @@ -696,6 +698,8 @@ int vn_extattr_rm(struct vnode *vp, int const char *attrname, struct thread *td); int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp); +int vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, + void *alloc_arg, int lkflags, struct vnode **rvp); int vn_utimes_perm(struct vnode *vp, struct vattr *vap, struct ucred *cred, struct thread *td); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 00:57:28 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCB5AF66; Mon, 28 Jul 2014 00:57: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 BB1BF2B5C; Mon, 28 Jul 2014 00:57: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 s6S0vSbE005524; Mon, 28 Jul 2014 00:57:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S0vSiM005523; Mon, 28 Jul 2014 00:57:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280057.s6S0vSiM005523@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 00:57:28 +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: r269166 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 00:57:28 -0000 Author: kib Date: Mon Jul 28 00:57:28 2014 New Revision: 269166 URL: http://svnweb.freebsd.org/changeset/base/269166 Log: MFC r268607: In kern_linkat(), avoid passing doomed vnode to the VOP. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jul 28 00:53:26 2014 (r269165) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jul 28 00:57:28 2014 (r269166) @@ -1555,6 +1555,7 @@ kern_linkat(struct thread *td, int fd1, bwillwrite(); NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, fd1, td); +again: if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1577,8 +1578,7 @@ kern_linkat(struct thread *td, int fd1, vput(nd.ni_dvp); vrele(nd.ni_vp); error = EEXIST; - } else if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) - == 0) { + } else if ((error = vn_lock(vp, LK_EXCLUSIVE)) == 0) { error = can_hardlink(vp, td->td_ucred); if (error == 0) #ifdef MAC @@ -1589,6 +1589,12 @@ kern_linkat(struct thread *td, int fd1, error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); VOP_UNLOCK(vp, 0); vput(nd.ni_dvp); + } else { + vput(nd.ni_dvp); + NDFREE(&nd, NDF_ONLY_PNBUF); + vrele(vp); + vn_finished_write(mp); + goto again; } NDFREE(&nd, NDF_ONLY_PNBUF); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:01:21 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B5A5146; Mon, 28 Jul 2014 01:01: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 09FBF2B77; Mon, 28 Jul 2014 01:01: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 s6S11K0X008848; Mon, 28 Jul 2014 01:01:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S11KPV008847; Mon, 28 Jul 2014 01:01:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280101.s6S11KPV008847@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:01:20 +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: r269167 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:01:21 -0000 Author: kib Date: Mon Jul 28 01:01:20 2014 New Revision: 269167 URL: http://svnweb.freebsd.org/changeset/base/269167 Log: MFC r268608: The tmpfs_link() must not dereference the filesystem-specific data for a vnode until it is verified that the vnode indeed belongs to tmpfs mount. Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 00:57:28 2014 (r269166) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:01:20 2014 (r269167) @@ -570,8 +570,6 @@ tmpfs_link(struct vop_link_args *v) MPASS(cnp->cn_flags & HASBUF); MPASS(dvp != vp); /* XXX When can this be false? */ - node = VP_TO_TMPFS_NODE(vp); - /* XXX: Why aren't the following two tests done by the caller? */ /* Hard links of directories are forbidden. */ @@ -586,6 +584,8 @@ tmpfs_link(struct vop_link_args *v) goto out; } + node = VP_TO_TMPFS_NODE(vp); + /* Ensure that we do not overflow the maximum number of links imposed * by the system. */ MPASS(node->tn_links <= LINK_MAX); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:04:34 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C2322C0; Mon, 28 Jul 2014 01:04: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 3A2642C90; Mon, 28 Jul 2014 01:04: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 s6S14YjT009977; Mon, 28 Jul 2014 01:04:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S14XkL009975; Mon, 28 Jul 2014 01:04:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280104.s6S14XkL009975@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:04:33 +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: r269168 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:04:34 -0000 Author: kib Date: Mon Jul 28 01:04:33 2014 New Revision: 269168 URL: http://svnweb.freebsd.org/changeset/base/269168 Log: MFC r268609: Add some assertions for the code handling vm_object for tmpfs vnode. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:01:20 2014 (r269167) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:04:33 2014 (r269168) @@ -428,6 +428,7 @@ void tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) { + ASSERT_VOP_ELOCKED(vp, "tmpfs_destroy_vobject"); if (vp->v_type != VREG || obj == NULL) return; Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:01:20 2014 (r269167) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:04:33 2014 (r269168) @@ -258,6 +258,8 @@ tmpfs_open(struct vop_open_args *v) else { error = 0; /* For regular files, the call below is nop. */ + KASSERT(vp->v_type != VREG || (node->tn_reg.tn_aobj->flags & + OBJ_DEAD) == 0, ("dead object")); vnode_create_vobject(vp, node->tn_size, v->a_td); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:06:37 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BE7441E; Mon, 28 Jul 2014 01:06: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 6A7D22CA9; Mon, 28 Jul 2014 01:06: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 s6S16b10010404; Mon, 28 Jul 2014 01:06:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S16b8e010402; Mon, 28 Jul 2014 01:06:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280106.s6S16b8e010402@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:06: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: r269169 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:06:37 -0000 Author: kib Date: Mon Jul 28 01:06:36 2014 New Revision: 269169 URL: http://svnweb.freebsd.org/changeset/base/269169 Log: MFC r268610: Add convenience macro to assert tmpfs node lock. Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Mon Jul 28 01:04:33 2014 (r269168) +++ stable/10/sys/fs/tmpfs/tmpfs.h Mon Jul 28 01:06:36 2014 (r269169) @@ -276,6 +276,8 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_NODE_LOCK(node) mtx_lock(&(node)->tn_interlock) #define TMPFS_NODE_UNLOCK(node) mtx_unlock(&(node)->tn_interlock) #define TMPFS_NODE_MTX(node) (&(node)->tn_interlock) +#define TMPFS_NODE_ASSERT_LOCKED(node) mtx_assert(TMPFS_NODE_MTX(node), \ + MA_OWNED) #ifdef INVARIANTS #define TMPFS_ASSERT_LOCKED(node) do { \ Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:04:33 2014 (r269168) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:06:36 2014 (r269169) @@ -633,7 +633,7 @@ tmpfs_free_vp(struct vnode *vp) node = VP_TO_TMPFS_NODE(vp); - mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); + TMPFS_NODE_ASSERT_LOCKED(node); node->tn_vnode = NULL; if ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) wakeup(&node->tn_vnode); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:08:43 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C75A658E; Mon, 28 Jul 2014 01:08:43 +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 B57562CC9; Mon, 28 Jul 2014 01:08:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6S18hGQ010825; Mon, 28 Jul 2014 01:08:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S18hTp010824; Mon, 28 Jul 2014 01:08:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280108.s6S18hTp010824@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:08:43 +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: r269170 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:08:43 -0000 Author: kib Date: Mon Jul 28 01:08:43 2014 New Revision: 269170 URL: http://svnweb.freebsd.org/changeset/base/269170 Log: MFC r268611: Replace goto's with the return. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:06:36 2014 (r269169) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:08:43 2014 (r269170) @@ -677,8 +677,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru * imposed by the system. */ MPASS(dnode->tn_links <= LINK_MAX); if (dnode->tn_links == LINK_MAX) { - error = EMLINK; - goto out; + return (EMLINK); } parent = dnode; @@ -690,14 +689,14 @@ tmpfs_alloc_file(struct vnode *dvp, stru error = tmpfs_alloc_node(tmp, vap->va_type, cnp->cn_cred->cr_uid, dnode->tn_gid, vap->va_mode, parent, target, vap->va_rdev, &node); if (error != 0) - goto out; + return (error); /* Allocate a directory entry that points to the new file. */ error = tmpfs_alloc_dirent(tmp, node, cnp->cn_nameptr, cnp->cn_namelen, &de); if (error != 0) { tmpfs_free_node(tmp, node); - goto out; + return (error); } /* Allocate a vnode for the new file. */ @@ -705,7 +704,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru if (error != 0) { tmpfs_free_dirent(tmp, de); tmpfs_free_node(tmp, node); - goto out; + return (error); } /* Now that all required items are allocated, we can proceed to @@ -714,10 +713,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru if (cnp->cn_flags & ISWHITEOUT) tmpfs_dir_whiteout_remove(dvp, cnp); tmpfs_dir_attach(dvp, de); - -out: - - return error; + return (0); } static struct tmpfs_dirent * From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:11:30 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63FF76EB; Mon, 28 Jul 2014 01:11: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 517022D5A; Mon, 28 Jul 2014 01:11: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 s6S1BUT2014537; Mon, 28 Jul 2014 01:11:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S1BTg4014534; Mon, 28 Jul 2014 01:11:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280111.s6S1BTg4014534@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:11: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: r269171 - in stable/10/sys: kern 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:11:30 -0000 Author: kib Date: Mon Jul 28 01:11:29 2014 New Revision: 269171 URL: http://svnweb.freebsd.org/changeset/base/269171 Log: MFC r268612: Add helper helper vfs_write_suspend_umnt(). Fix the bug in the FFS unmount, when suspension failed, the ufs extattrs were not reinitialized. Modified: stable/10/sys/kern/vfs_vnops.c stable/10/sys/sys/vnode.h stable/10/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Mon Jul 28 01:08:43 2014 (r269170) +++ stable/10/sys/kern/vfs_vnops.c Mon Jul 28 01:11:29 2014 (r269171) @@ -1830,6 +1830,37 @@ vfs_write_resume(struct mount *mp, int f } /* + * Helper loop around vfs_write_suspend() for filesystem unmount VFS + * methods. + */ +int +vfs_write_suspend_umnt(struct mount *mp) +{ + int error; + + KASSERT((curthread->td_pflags & TDP_IGNSUSP) == 0, + ("vfs_write_suspend_umnt: recursed")); + + /* dounmount() already called vn_start_write(). */ + for (;;) { + vn_finished_write(mp); + error = vfs_write_suspend(mp, 0); + if (error != 0) + return (error); + MNT_ILOCK(mp); + if ((mp->mnt_kern_flag & MNTK_SUSPENDED) != 0) + break; + MNT_IUNLOCK(mp); + vn_start_write(NULL, &mp, V_WAIT); + } + mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); + wakeup(&mp->mnt_flag); + MNT_IUNLOCK(mp); + curthread->td_pflags |= TDP_IGNSUSP; + return (0); +} + +/* * Implement kqueues for files by translating it to vnode operation. */ static int Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Mon Jul 28 01:08:43 2014 (r269170) +++ stable/10/sys/sys/vnode.h Mon Jul 28 01:11:29 2014 (r269171) @@ -721,6 +721,7 @@ int vfs_cache_lookup(struct vop_lookup_a void vfs_timestamp(struct timespec *); void vfs_write_resume(struct mount *mp, int flags); int vfs_write_suspend(struct mount *mp, int flags); +int vfs_write_suspend_umnt(struct mount *mp); int vop_stdbmap(struct vop_bmap_args *); int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); Modified: stable/10/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vfsops.c Mon Jul 28 01:08:43 2014 (r269170) +++ stable/10/sys/ufs/ffs/ffs_vfsops.c Mon Jul 28 01:11:29 2014 (r269171) @@ -255,31 +255,9 @@ ffs_mount(struct mount *mp) */ if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0) return (error); - for (;;) { - vn_finished_write(mp); - if ((error = vfs_write_suspend(mp, 0)) != 0) - return (error); - MNT_ILOCK(mp); - if (mp->mnt_kern_flag & MNTK_SUSPENDED) { - /* - * Allow the secondary writes - * to proceed. - */ - mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | - MNTK_SUSPEND2); - wakeup(&mp->mnt_flag); - MNT_IUNLOCK(mp); - /* - * Allow the curthread to - * ignore the suspension to - * synchronize on-disk state. - */ - td->td_pflags |= TDP_IGNSUSP; - break; - } - MNT_IUNLOCK(mp); - vn_start_write(NULL, &mp, V_WAIT); - } + error = vfs_write_suspend_umnt(mp); + if (error != 0) + return (error); /* * Check for and optionally get rid of files open * for writing. @@ -1250,25 +1228,9 @@ ffs_unmount(mp, mntflags) } #endif if (susp) { - /* - * dounmount already called vn_start_write(). - */ - for (;;) { - vn_finished_write(mp); - if ((error = vfs_write_suspend(mp, 0)) != 0) - return (error); - MNT_ILOCK(mp); - if (mp->mnt_kern_flag & MNTK_SUSPENDED) { - mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | - MNTK_SUSPEND2); - wakeup(&mp->mnt_flag); - MNT_IUNLOCK(mp); - td->td_pflags |= TDP_IGNSUSP; - break; - } - MNT_IUNLOCK(mp); - vn_start_write(NULL, &mp, V_WAIT); - } + error = vfs_write_suspend_umnt(mp); + if (error != 0) + goto fail1; } if (MOUNTEDSOFTDEP(mp)) error = softdep_flushfiles(mp, flags, td); @@ -1331,6 +1293,7 @@ ffs_unmount(mp, mntflags) fail: if (susp) vfs_write_resume(mp, VR_START_WRITE); +fail1: #ifdef UFS_EXTATTR if (e_restart) { ufs_extattr_uepm_init(&ump->um_extattr); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:14:25 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA053850; Mon, 28 Jul 2014 01:14: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 B870A2D6A; Mon, 28 Jul 2014 01:14: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 s6S1EPmR014973; Mon, 28 Jul 2014 01:14:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S1EPlh014971; Mon, 28 Jul 2014 01:14:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280114.s6S1EPlh014971@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:14:25 +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: r269172 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:14:25 -0000 Author: kib Date: Mon Jul 28 01:14:25 2014 New Revision: 269172 URL: http://svnweb.freebsd.org/changeset/base/269172 Log: MFC r268613: Style. Add comment about lock mode. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:11:29 2014 (r269171) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:14:25 2014 (r269172) @@ -548,6 +548,7 @@ loop1: goto unlock; MPASS(vp != NULL); + /* lkflag is ignored, the lock is exclusive */ (void) vn_lock(vp, lkflag | LK_RETRY); vp->v_data = node; Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:11:29 2014 (r269171) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:14:25 2014 (r269172) @@ -171,7 +171,7 @@ tmpfs_lookup(struct vop_cachedlookup_arg /* Allocate a new vnode on the matching entry. */ error = tmpfs_alloc_vp(dvp->v_mount, tnode, - cnp->cn_lkflags, vpp); + cnp->cn_lkflags, vpp); if (error != 0) goto out; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:16:08 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0169D999; Mon, 28 Jul 2014 01:16:08 +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 E3D6A2D74; Mon, 28 Jul 2014 01:16: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 s6S1G75I015287; Mon, 28 Jul 2014 01:16:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S1G7Vx015286; Mon, 28 Jul 2014 01:16:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280116.s6S1G7Vx015286@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:16:07 +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: r269173 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:16:08 -0000 Author: kib Date: Mon Jul 28 01:16:07 2014 New Revision: 269173 URL: http://svnweb.freebsd.org/changeset/base/269173 Log: MFC r268614: Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs dotdot lookup. Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:14:25 2014 (r269172) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:16:07 2014 (r269173) @@ -69,15 +69,22 @@ SYSCTL_INT(_vfs_tmpfs, OID_AUTO, rename_ "Times rename had to restart due to lock contention"); static int +tmpfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags, + struct vnode **rvp) +{ + + return (tmpfs_alloc_vp(mp, arg, lkflags, rvp)); +} + +static int tmpfs_lookup(struct vop_cachedlookup_args *v) { struct vnode *dvp = v->a_dvp; struct vnode **vpp = v->a_vpp; struct componentname *cnp = v->a_cnp; - - int error; struct tmpfs_dirent *de; struct tmpfs_node *dnode; + int error; dnode = VP_TO_TMPFS_DIR(dvp); *vpp = NULLVP; @@ -98,17 +105,10 @@ tmpfs_lookup(struct vop_cachedlookup_arg goto out; } if (cnp->cn_flags & ISDOTDOT) { - int ltype = 0; - - ltype = VOP_ISLOCKED(dvp); - vhold(dvp); - VOP_UNLOCK(dvp, 0); - /* Allocate a new vnode on the matching entry. */ - error = tmpfs_alloc_vp(dvp->v_mount, dnode->tn_dir.tn_parent, - cnp->cn_lkflags, vpp); - - vn_lock(dvp, ltype | LK_RETRY); - vdrop(dvp); + error = vn_vget_ino_gen(dvp, tmpfs_vn_get_ino_alloc, + dnode->tn_dir.tn_parent, cnp->cn_lkflags, vpp); + if (error != 0) + goto out; } else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { VREF(dvp); *vpp = dvp; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:21:04 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDE44BDF; Mon, 28 Jul 2014 01:21: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 CBACC2E06; Mon, 28 Jul 2014 01:21: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 s6S1L3Pd017044; Mon, 28 Jul 2014 01:21:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S1L3ve017041; Mon, 28 Jul 2014 01:21:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280121.s6S1L3ve017041@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:21:03 +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: r269174 - in stable/10/sys: fs/tmpfs 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:21:04 -0000 Author: kib Date: Mon Jul 28 01:21:02 2014 New Revision: 269174 URL: http://svnweb.freebsd.org/changeset/base/269174 Log: MFC r268615: Add OBJ_TMPFS_NODE flag. MFC r268616: Set the OBJ_TMPFS_NODE flag for vm_object of VREG tmpfs node. MFC r269053: Correct assertion. tmpfs vm object is always at the bottom of the shadow chain. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/vm/vm_object.c stable/10/sys/vm/vm_object.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:16:07 2014 (r269173) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:21:02 2014 (r269174) @@ -231,7 +231,7 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp NULL /* XXXKIB - tmpfs needs swap reservation */); VM_OBJECT_WLOCK(obj); /* OBJ_TMPFS is set together with the setting of vp->v_object */ - vm_object_set_flag(obj, OBJ_NOSPLIT); + vm_object_set_flag(obj, OBJ_NOSPLIT | OBJ_TMPFS_NODE); vm_object_clear_flag(obj, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(obj); break; Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Mon Jul 28 01:16:07 2014 (r269173) +++ stable/10/sys/vm/vm_object.c Mon Jul 28 01:21:02 2014 (r269174) @@ -553,14 +553,12 @@ vm_object_deallocate(vm_object_t object) object->handle == NULL && (object->type == OBJT_DEFAULT || (object->type == OBJT_SWAP && - (object->flags & OBJ_TMPFS) == 0))) { + (object->flags & OBJ_TMPFS_NODE) == 0))) { vm_object_set_flag(object, OBJ_ONEMAPPING); } else if ((object->shadow_count == 1) && (object->handle == NULL) && (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { - KASSERT((object->flags & OBJ_TMPFS) == 0, - ("shadowed tmpfs v_object %p", object)); vm_object_t robject; robject = LIST_FIRST(&object->shadow_head); @@ -568,6 +566,8 @@ vm_object_deallocate(vm_object_t object) ("vm_object_deallocate: ref_count: %d, shadow_count: %d", object->ref_count, object->shadow_count)); + KASSERT((robject->flags & OBJ_TMPFS_NODE) == 0, + ("shadowed tmpfs v_object %p", object)); if (!VM_OBJECT_TRYWLOCK(robject)) { /* * Avoid a potential deadlock. @@ -637,6 +637,8 @@ retry: doterm: temp = object->backing_object; if (temp != NULL) { + KASSERT((object->flags & OBJ_TMPFS_NODE) == 0, + ("shadowed tmpfs v_object 2 %p", object)); VM_OBJECT_WLOCK(temp); LIST_REMOVE(object, shadow_list); temp->shadow_count--; @@ -2104,7 +2106,7 @@ vm_object_coalesce(vm_object_t prev_obje VM_OBJECT_WLOCK(prev_object); if ((prev_object->type != OBJT_DEFAULT && prev_object->type != OBJT_SWAP) || - (prev_object->flags & OBJ_TMPFS) != 0) { + (prev_object->flags & OBJ_TMPFS_NODE) != 0) { VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } Modified: stable/10/sys/vm/vm_object.h ============================================================================== --- stable/10/sys/vm/vm_object.h Mon Jul 28 01:16:07 2014 (r269173) +++ stable/10/sys/vm/vm_object.h Mon Jul 28 01:21:02 2014 (r269174) @@ -186,10 +186,11 @@ struct vm_object { #define OBJ_NOSPLIT 0x0010 /* dont split this object */ #define OBJ_PIPWNT 0x0040 /* paging in progress wanted */ #define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty, only for vnode */ +#define OBJ_TMPFS_NODE 0x0200 /* object belongs to tmpfs VREG node */ #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ -#define OBJ_TMPFS 0x8000 +#define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ #define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) #define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:24:00 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6EE5D78; Mon, 28 Jul 2014 01:24: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 B41522E29; Mon, 28 Jul 2014 01:24: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 s6S1O0CJ019650; Mon, 28 Jul 2014 01:24:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S1O043019640; Mon, 28 Jul 2014 01:24:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280124.s6S1O043019640@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:24:00 +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: r269175 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:24:01 -0000 Author: kib Date: Mon Jul 28 01:23:59 2014 New Revision: 269175 URL: http://svnweb.freebsd.org/changeset/base/269175 Log: MFC r268617: Rework the tmpfs unmount. Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Mon Jul 28 01:21:02 2014 (r269174) +++ stable/10/sys/fs/tmpfs/tmpfs.h Mon Jul 28 01:23:59 2014 (r269175) @@ -384,7 +384,7 @@ struct tmpfs_fid { * Prototypes for tmpfs_subr.c. */ -int tmpfs_alloc_node(struct tmpfs_mount *, enum vtype, +int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, char *, dev_t, struct tmpfs_node **); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:21:02 2014 (r269174) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 28 01:23:59 2014 (r269175) @@ -159,7 +159,7 @@ tmpfs_pages_check_avail(struct tmpfs_mou * Returns zero on success or an appropriate error code on failure. */ int -tmpfs_alloc_node(struct tmpfs_mount *tmp, enum vtype type, +tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *parent, char *target, dev_t rdev, struct tmpfs_node **node) { @@ -169,6 +169,8 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp /* If the root directory of the 'tmp' file system is not yet * allocated, this must be the request to do it. */ MPASS(IMPLIES(tmp->tm_root == NULL, parent == NULL && type == VDIR)); + KASSERT(tmp->tm_root == NULL || mp->mnt_writeopcount > 0, + ("creating node not under vn_start_write")); MPASS(IFF(type == VLNK, target != NULL)); MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL)); @@ -178,6 +180,24 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp if (tmpfs_pages_check_avail(tmp, 1) == 0) return (ENOSPC); + if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + /* + * When a new tmpfs node is created for fully + * constructed mount point, there must be a parent + * node, which vnode is locked exclusively. As + * consequence, if the unmount is executing in + * parallel, vflush() cannot reclaim the parent vnode. + * Due to this, the check for MNTK_UNMOUNT flag is not + * racy: if we did not see MNTK_UNMOUNT flag, then tmp + * cannot be destroyed until node construction is + * finished and the parent vnode unlocked. + * + * Tmpfs does not need to instantiate new nodes during + * unmount. + */ + return (EBUSY); + } + nnode = (struct tmpfs_node *)uma_zalloc_arg( tmp->tm_node_pool, tmp, M_WAITOK); @@ -687,7 +707,8 @@ tmpfs_alloc_file(struct vnode *dvp, stru parent = NULL; /* Allocate a node that represents the new file. */ - error = tmpfs_alloc_node(tmp, vap->va_type, cnp->cn_cred->cr_uid, + error = tmpfs_alloc_node(dvp->v_mount, tmp, vap->va_type, + cnp->cn_cred->cr_uid, dnode->tn_gid, vap->va_mode, parent, target, vap->va_rdev, &node); if (error != 0) return (error); Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jul 28 01:21:02 2014 (r269174) +++ stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jul 28 01:23:59 2014 (r269175) @@ -238,7 +238,7 @@ tmpfs_mount(struct mount *mp) tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; /* Allocate the root node. */ - error = tmpfs_alloc_node(tmp, VDIR, root_uid, + error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, root_mode & ALLPERMS, NULL, NULL, VNOVAL, &root); @@ -269,38 +269,49 @@ tmpfs_mount(struct mount *mp) static int tmpfs_unmount(struct mount *mp, int mntflags) { - int error; - int flags = 0; struct tmpfs_mount *tmp; struct tmpfs_node *node; + int error, flags; - /* Handle forced unmounts. */ - if (mntflags & MNT_FORCE) - flags |= FORCECLOSE; - - /* Finalize all pending I/O. */ - error = vflush(mp, 0, flags, curthread); - if (error != 0) - return error; - + flags = (mntflags & MNT_FORCE) != 0 ? FORCECLOSE : 0; tmp = VFS_TO_TMPFS(mp); - /* Free all associated data. The loop iterates over the linked list - * we have containing all used nodes. For each of them that is - * a directory, we free all its directory entries. Note that after - * freeing a node, it will automatically go to the available list, - * so we will later have to iterate over it to release its items. */ - node = LIST_FIRST(&tmp->tm_nodes_used); - while (node != NULL) { - struct tmpfs_node *next; + /* Stop writers */ + error = vfs_write_suspend_umnt(mp); + if (error != 0) + return (error); + /* + * At this point, nodes cannot be destroyed by any other + * thread because write suspension is started. + */ + + for (;;) { + error = vflush(mp, 0, flags, curthread); + if (error != 0) { + vfs_write_resume(mp, VR_START_WRITE); + return (error); + } + MNT_ILOCK(mp); + if (mp->mnt_nvnodelistsize == 0) { + MNT_IUNLOCK(mp); + break; + } + MNT_IUNLOCK(mp); + if ((mntflags & MNT_FORCE) == 0) { + vfs_write_resume(mp, VR_START_WRITE); + return (EBUSY); + } + } + TMPFS_LOCK(tmp); + while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) { + TMPFS_UNLOCK(tmp); if (node->tn_type == VDIR) tmpfs_dir_destroy(tmp, node); - - next = LIST_NEXT(node, tn_entries); tmpfs_free_node(tmp, node); - node = next; + TMPFS_LOCK(tmp); } + TMPFS_UNLOCK(tmp); uma_zdestroy(tmp->tm_dirent_pool); uma_zdestroy(tmp->tm_node_pool); @@ -313,11 +324,13 @@ tmpfs_unmount(struct mount *mp, int mntf /* Throw away the tmpfs_mount structure. */ free(mp->mnt_data, M_TMPFSMNT); mp->mnt_data = NULL; + vfs_write_resume(mp, VR_START_WRITE); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; MNT_IUNLOCK(mp); - return 0; + + return (0); } static int @@ -401,6 +414,18 @@ tmpfs_statfs(struct mount *mp, struct st return 0; } +static int +tmpfs_sync(struct mount *mp, int waitfor) +{ + + if (waitfor == MNT_SUSPEND) { + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED; + MNT_IUNLOCK(mp); + } + return (0); +} + /* * tmpfs vfs operations. */ @@ -411,5 +436,6 @@ struct vfsops tmpfs_vfsops = { .vfs_root = tmpfs_root, .vfs_statfs = tmpfs_statfs, .vfs_fhtovp = tmpfs_fhtovp, + .vfs_sync = tmpfs_sync, }; VFS_SET(tmpfs_vfsops, tmpfs, VFCF_JAIL); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 01:25:49 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEEB3EB2; Mon, 28 Jul 2014 01:25:49 +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 BCC842E31; Mon, 28 Jul 2014 01:25:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6S1Pngi019956; Mon, 28 Jul 2014 01:25:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S1Pnpw019954; Mon, 28 Jul 2014 01:25:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407280125.s6S1Pnpw019954@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Jul 2014 01:25:49 +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: r269176 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 01:25:49 -0000 Author: kib Date: Mon Jul 28 01:25:49 2014 New Revision: 269176 URL: http://svnweb.freebsd.org/changeset/base/269176 Log: MFC r268766: Do not ignore error from tmpfs_alloc_vp(). Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:23:59 2014 (r269175) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 28 01:25:49 2014 (r269176) @@ -186,7 +186,9 @@ tmpfs_lookup(struct vop_cachedlookup_arg cnp->cn_flags |= SAVENAME; } else { error = tmpfs_alloc_vp(dvp->v_mount, tnode, - cnp->cn_lkflags, vpp); + cnp->cn_lkflags, vpp); + if (error != 0) + goto out; } } } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 02:07:19 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BD10793; Mon, 28 Jul 2014 02:07:19 +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 0D47021C4; Mon, 28 Jul 2014 02:07: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 s6S27Ibu038615; Mon, 28 Jul 2014 02:07:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6S27G0T038597; Mon, 28 Jul 2014 02:07:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407280207.s6S27G0T038597@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 28 Jul 2014 02:07:16 +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: r269177 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 02:07:19 -0000 Author: marcel Date: Mon Jul 28 02:07:16 2014 New Revision: 269177 URL: http://svnweb.freebsd.org/changeset/base/269177 Log: MFC r268236,268264,268524,268646,268802,269021: This brings VHD support to mkimg(1); both dynamic and fixed file formats. Dynamic VHD and VMDK file images are now sparsely written, meaning that "free" sectors do not occupy space. Relnotes: yes Added: stable/10/usr.bin/mkimg/vhd.c - copied, changed from r268236, head/usr.bin/mkimg/vhd.c Modified: stable/10/usr.bin/mkimg/Makefile stable/10/usr.bin/mkimg/apm.c stable/10/usr.bin/mkimg/gpt.c stable/10/usr.bin/mkimg/image.c stable/10/usr.bin/mkimg/image.h stable/10/usr.bin/mkimg/mkimg.1 stable/10/usr.bin/mkimg/mkimg.c stable/10/usr.bin/mkimg/mkimg.h stable/10/usr.bin/mkimg/raw.c stable/10/usr.bin/mkimg/vmdk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/Makefile ============================================================================== --- stable/10/usr.bin/mkimg/Makefile Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/Makefile Mon Jul 28 02:07:16 2014 (r269177) @@ -9,6 +9,7 @@ CFLAGS+=-DSPARSE_WRITE # List of formats to support SRCS+= \ raw.c \ + vhd.c \ vmdk.c # List of schemes to support Modified: stable/10/usr.bin/mkimg/apm.c ============================================================================== --- stable/10/usr.bin/mkimg/apm.c Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/apm.c Mon Jul 28 02:07:16 2014 (r269177) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef APM_ENT_TYPE_APPLE_BOOT +#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" +#endif #ifndef APM_ENT_TYPE_FREEBSD_NANDFS #define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" #endif Modified: stable/10/usr.bin/mkimg/gpt.c ============================================================================== --- stable/10/usr.bin/mkimg/gpt.c Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/gpt.c Mon Jul 28 02:07:16 2014 (r269177) @@ -211,7 +211,7 @@ gpt_mktbl(u_int tblsz) STAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); - uuidgen(&uuid, 1); + mkimg_uuid(&uuid); gpt_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); @@ -279,7 +279,7 @@ gpt_write(lba_t imgsz, void *bootcode) le32enc(&hdr->hdr_size, offsetof(struct gpt_hdr, padding)); le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); - uuidgen(&uuid, 1); + mkimg_uuid(&uuid); gpt_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); Modified: stable/10/usr.bin/mkimg/image.c ============================================================================== --- stable/10/usr.bin/mkimg/image.c Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/image.c Mon Jul 28 02:07:16 2014 (r269177) @@ -94,21 +94,49 @@ image_copyin(lba_t blk, int fd, uint64_t int image_copyout(int fd) { + int error; + + error = image_copyout_region(fd, 0, image_size); + if (!error) + error = image_copyout_done(fd); + return (error); +} + +int +image_copyout_done(int fd) +{ + off_t ofs; + int error; + + ofs = lseek(fd, 0L, SEEK_CUR); + if (ofs == -1) + return (0); + error = (ftruncate(fd, ofs) == -1) ? errno : 0; + return (error); +} + +int +image_copyout_region(int fd, lba_t blk, lba_t size) +{ char *buffer; off_t ofs; + size_t sz; ssize_t rdsz, wrsz; int error; ofs = lseek(fd, 0L, SEEK_CUR); - if (lseek(image_fd, 0, SEEK_SET) != 0) + blk *= secsz; + if (lseek(image_fd, blk, SEEK_SET) != blk) return (errno); buffer = malloc(BUFFER_SIZE); if (buffer == NULL) return (errno); error = 0; - while (1) { - rdsz = read(image_fd, buffer, BUFFER_SIZE); + size *= secsz; + while (size > 0) { + sz = (BUFFER_SIZE < size) ? BUFFER_SIZE : size; + rdsz = read(image_fd, buffer, sz); if (rdsz <= 0) { error = (rdsz < 0) ? errno : 0; break; @@ -120,17 +148,40 @@ image_copyout(int fd) error = errno; break; } + assert(wrsz == rdsz); + size -= rdsz; } free(buffer); - if (error) - return (error); - ofs = lseek(fd, 0L, SEEK_CUR); - if (ofs == -1) - return (errno); - error = (ftruncate(fd, ofs) == -1) ? errno : 0; return (error); } +int +image_data(lba_t blk, lba_t size) +{ + char *buffer, *p; + + blk *= secsz; + if (lseek(image_fd, blk, SEEK_SET) != blk) + return (1); + + size *= secsz; + buffer = malloc(size); + if (buffer == NULL) + return (1); + + if (read(image_fd, buffer, size) != (ssize_t)size) { + free(buffer); + return (1); + } + + p = buffer; + while (size > 0 && *p == '\0') + size--, p++; + + free(buffer); + return ((size == 0) ? 0 : 1); +} + lba_t image_get_size(void) { Modified: stable/10/usr.bin/mkimg/image.h ============================================================================== --- stable/10/usr.bin/mkimg/image.h Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/image.h Mon Jul 28 02:07:16 2014 (r269177) @@ -33,6 +33,9 @@ typedef int64_t lba_t; int image_copyin(lba_t blk, int fd, uint64_t *sizep); int image_copyout(int fd); +int image_copyout_done(int fd); +int image_copyout_region(int fd, lba_t blk, lba_t size); +int image_data(lba_t blk, lba_t size); lba_t image_get_size(void); int image_init(void); int image_set_size(lba_t blk); Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.1 Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/mkimg.1 Mon Jul 28 02:07:16 2014 (r269177) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 2, 2014 +.Dd July 4, 2014 .Dt MKIMG 1 .Os .Sh NAME .Nm mkimg -.Nd "utility to make a disk image" +.Nd "utility to make disk images" .Sh SYNOPSIS .Nm .Op Fl H Ar heads @@ -40,6 +40,7 @@ .Op Fl f Ar format .Op Fl o Ar outfile .Op Fl v +.Op Fl y .Fl s Ar scheme .Fl p Ar partition .Op Fl p Ar partition ... @@ -111,6 +112,16 @@ option increases the level of output tha .Nm utility prints. .Pp +The +.Op Fl y +option is used for testing purposes only and is not to be used in production. +When present, the +.Nm +utility will generate predictable values for Universally Unique Identifiers +(UUIDs) and time stamps so that consecutive runs of the +.Nm +utility will create images that are identical. +.Pp For a complete list of supported partitioning schemes or supported output format, or for a detailed description of how to specify partitions, run the .Nm Modified: stable/10/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.c Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/mkimg.c Mon Jul 28 02:07:16 2014 (r269177) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -50,6 +51,7 @@ __FBSDID("$FreeBSD$"); struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; +u_int unit_testing; u_int verbose; u_int ncyls = 0; @@ -73,6 +75,8 @@ usage(const char *why) fprintf(stderr, "\t-o \t- file to write image into\n"); fprintf(stderr, "\t-p \n"); fprintf(stderr, "\t-s \n"); + fprintf(stderr, "\t-v\t\t- increase verbosity\n"); + fprintf(stderr, "\t-y\t\t- [developers] enable unit test\n"); fprintf(stderr, "\t-H \t- number of heads to simulate\n"); fprintf(stderr, "\t-P \t- physical sector size\n"); fprintf(stderr, "\t-S \t- logical sector size\n"); @@ -258,6 +262,22 @@ sparse_write(int fd, const void *ptr, si } #endif /* SPARSE_WRITE */ +void +mkimg_uuid(struct uuid *uuid) +{ + static uint8_t gen[sizeof(struct uuid)]; + u_int i; + + if (!unit_testing) { + uuidgen(uuid, 1); + return; + } + + for (i = 0; i < sizeof(gen); i++) + gen[i]++; + memcpy(uuid, gen, sizeof(uuid_t)); +} + static void mkimg(void) { @@ -337,7 +357,7 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt(argc, argv, "b:f:o:p:s:vH:P:S:T:")) != -1) { + while ((c = getopt(argc, argv, "b:f:o:p:s:vyH:P:S:T:")) != -1) { switch (c) { case 'b': /* BOOT CODE */ if (bcfd != -1) @@ -373,6 +393,9 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "scheme"); break; + case 'y': + unit_testing++; + break; case 'v': verbose++; break; Modified: stable/10/usr.bin/mkimg/mkimg.h ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.h Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/mkimg.h Mon Jul 28 02:07:16 2014 (r269177) @@ -50,6 +50,7 @@ struct part { extern STAILQ_HEAD(partlisthead, part) partlist; extern u_int nparts; +extern u_int unit_testing; extern u_int verbose; extern u_int ncyls; @@ -71,4 +72,7 @@ round_block(lba_t n) ssize_t sparse_write(int, const void *, size_t); #endif +struct uuid; +void mkimg_uuid(struct uuid *); + #endif /* _MKIMG_MKIMG_H_ */ Modified: stable/10/usr.bin/mkimg/raw.c ============================================================================== --- stable/10/usr.bin/mkimg/raw.c Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/raw.c Mon Jul 28 02:07:16 2014 (r269177) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include Copied and modified: stable/10/usr.bin/mkimg/vhd.c (from r268236, head/usr.bin/mkimg/vhd.c) ============================================================================== --- head/usr.bin/mkimg/vhd.c Thu Jul 3 20:31:43 2014 (r268236, copy source) +++ stable/10/usr.bin/mkimg/vhd.c Mon Jul 28 02:07:16 2014 (r269177) @@ -40,16 +40,23 @@ __FBSDID("$FreeBSD$"); #include "format.h" #include "mkimg.h" +#ifndef __has_extension +#define __has_extension(x) 0 +#endif + /* - * Notes: + * General notes: * o File is in network byte order. - * o File layout: - * copy of disk footer - * dynamic disk header - * block allocation table (BAT) - * data blocks - * disk footer * o The timestamp is seconds since 1/1/2000 12:00:00 AM UTC + * + * This file is divided in 3 parts: + * 1. Common definitions + * 2. Dynamic VHD support + * 3. Fixed VHD support + */ + +/* + * PART 1: Common definitions */ #define VHD_SECTOR_SIZE 512 @@ -85,43 +92,10 @@ struct vhd_footer { uint8_t saved_state; uint8_t _reserved[427]; }; +#if __has_extension(c_static_assert) _Static_assert(sizeof(struct vhd_footer) == VHD_SECTOR_SIZE, "Wrong size for footer"); - -struct vhd_dyn_header { - uint64_t cookie; -#define VHD_HEADER_COOKIE 0x6378737061727365 - uint64_t data_offset; - uint64_t table_offset; - uint32_t version; - uint32_t max_entries; - uint32_t block_size; - uint32_t checksum; - uuid_t parent_id; - uint32_t parent_timestamp; - char _reserved1[4]; - uint16_t parent_name[256]; /* UTF-16 */ - struct { - uint32_t code; - uint32_t data_space; - uint32_t data_length; - uint32_t _reserved; - uint64_t data_offset; - } parent_locator[8]; - char _reserved2[256]; -}; -_Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2, - "Wrong size for header"); - -static int -vhd_resize(lba_t imgsz) -{ - uint64_t imagesz; - - imagesz = imgsz * secsz; - imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1); - return (image_set_size(imagesz / secsz)); -} +#endif static uint32_t vhd_checksum(void *buf, size_t sz) @@ -136,36 +110,8 @@ vhd_checksum(void *buf, size_t sz) return (~sum); } -static uint32_t -vhd_timestamp(void) -{ - time_t t; - - if (!unit_testing) { - t = time(NULL); - return (t - 0x386d4380); - } - - return (0x01234567); -} - -static void -vhd_uuid_enc(void *buf, const uuid_t *uuid) -{ - uint8_t *p = buf; - int i; - - be32enc(p, uuid->time_low); - be16enc(p + 4, uuid->time_mid); - be16enc(p + 6, uuid->time_hi_and_version); - p[8] = uuid->clock_seq_hi_and_reserved; - p[9] = uuid->clock_seq_low; - for (i = 0; i < _UUID_NODE_LEN; i++) - p[10 + i] = uuid->node[i]; -} - static void -vhd_geometry(struct vhd_footer *footer) +vhd_geometry(struct vhd_footer *footer, uint64_t image_size) { lba_t imgsz; long cth; @@ -180,7 +126,7 @@ vhd_geometry(struct vhd_footer *footer) return; } - imgsz = (image_get_size() * secsz) / VHD_SECTOR_SIZE; + imgsz = image_size / VHD_SECTOR_SIZE; if (imgsz > 65536 * 16 * 255) imgsz = 65536 * 16 * 255; if (imgsz >= 65535 * 16 * 63) { @@ -207,14 +153,121 @@ vhd_geometry(struct vhd_footer *footer) be16enc(&footer->cylinders, cth / footer->heads); } +static uint32_t +vhd_timestamp(void) +{ + time_t t; + + if (!unit_testing) { + t = time(NULL); + return (t - 0x386d4380); + } + + return (0x01234567); +} + +static void +vhd_uuid_enc(void *buf, const uuid_t *uuid) +{ + uint8_t *p = buf; + int i; + + be32enc(p, uuid->time_low); + be16enc(p + 4, uuid->time_mid); + be16enc(p + 6, uuid->time_hi_and_version); + p[8] = uuid->clock_seq_hi_and_reserved; + p[9] = uuid->clock_seq_low; + for (i = 0; i < _UUID_NODE_LEN; i++) + p[10 + i] = uuid->node[i]; +} + +static void +vhd_make_footer(struct vhd_footer *footer, uint64_t image_size, + uint32_t disk_type, uint64_t data_offset) +{ + uuid_t id; + + memset(footer, 0, sizeof(*footer)); + be64enc(&footer->cookie, VHD_FOOTER_COOKIE); + be32enc(&footer->features, VHD_FEATURES_RESERVED); + be32enc(&footer->version, VHD_VERSION); + be64enc(&footer->data_offset, data_offset); + be32enc(&footer->timestamp, vhd_timestamp()); + be32enc(&footer->creator_tool, VHD_CREATOR_TOOL); + be32enc(&footer->creator_version, VHD_CREATOR_VERSION); + be32enc(&footer->creator_os, VHD_CREATOR_OS); + be64enc(&footer->original_size, image_size); + be64enc(&footer->current_size, image_size); + vhd_geometry(footer, image_size); + be32enc(&footer->disk_type, disk_type); + mkimg_uuid(&id); + vhd_uuid_enc(&footer->id, &id); + be32enc(&footer->checksum, vhd_checksum(footer, sizeof(*footer))); +} + +/* + * We round the image size to 2MB for both the dynamic and + * fixed VHD formats. For dynamic VHD, this is needed to + * have the image size be a multiple of the grain size. For + * fixed VHD this is not really needed, but makes sure that + * it's easy to convert from fixed VHD to dynamic VHD. + */ static int -vhd_write(int fd) +vhd_resize(lba_t imgsz) +{ + uint64_t imagesz; + + imagesz = imgsz * secsz; + imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1); + return (image_set_size(imagesz / secsz)); +} + +/* + * PART 2: Dynamic VHD support + * + * Notes: + * o File layout: + * copy of disk footer + * dynamic disk header + * block allocation table (BAT) + * data blocks + * disk footer + */ + +struct vhd_dyn_header { + uint64_t cookie; +#define VHD_HEADER_COOKIE 0x6378737061727365 + uint64_t data_offset; + uint64_t table_offset; + uint32_t version; + uint32_t max_entries; + uint32_t block_size; + uint32_t checksum; + uuid_t parent_id; + uint32_t parent_timestamp; + char _reserved1[4]; + uint16_t parent_name[256]; /* UTF-16 */ + struct { + uint32_t code; + uint32_t data_space; + uint32_t data_length; + uint32_t _reserved; + uint64_t data_offset; + } parent_locator[8]; + char _reserved2[256]; +}; +#if __has_extension(c_static_assert) +_Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2, + "Wrong size for header"); +#endif + +static int +vhd_dyn_write(int fd) { struct vhd_footer footer; struct vhd_dyn_header header; - uuid_t id; uint64_t imgsz; - lba_t blk, nblks; + lba_t blk, blkcnt, nblks; uint32_t *bat; void *bitmap; size_t batsz; @@ -224,22 +277,7 @@ vhd_write(int fd) imgsz = image_get_size() * secsz; bat_entries = imgsz / VHD_BLOCK_SIZE; - memset(&footer, 0, sizeof(footer)); - be64enc(&footer.cookie, VHD_FOOTER_COOKIE); - be32enc(&footer.features, VHD_FEATURES_RESERVED); - be32enc(&footer.version, VHD_VERSION); - be64enc(&footer.data_offset, sizeof(footer)); - be32enc(&footer.timestamp, vhd_timestamp()); - be32enc(&footer.creator_tool, VHD_CREATOR_TOOL); - be32enc(&footer.creator_version, VHD_CREATOR_VERSION); - be32enc(&footer.creator_os, VHD_CREATOR_OS); - be64enc(&footer.original_size, imgsz); - be64enc(&footer.current_size, imgsz); - vhd_geometry(&footer); - be32enc(&footer.disk_type, VHD_DISK_TYPE_DYNAMIC); - mkimg_uuid(&id); - vhd_uuid_enc(&footer.id, &id); - be32enc(&footer.checksum, vhd_checksum(&footer, sizeof(footer))); + vhd_make_footer(&footer, imgsz, VHD_DISK_TYPE_DYNAMIC, sizeof(footer)); if (sparse_write(fd, &footer, sizeof(footer)) < 0) return (errno); @@ -260,10 +298,14 @@ vhd_write(int fd) if (bat == NULL) return (errno); memset(bat, 0xff, batsz); + blkcnt = VHD_BLOCK_SIZE / secsz; sector = (sizeof(footer) + sizeof(header) + batsz) / VHD_SECTOR_SIZE; for (entry = 0; entry < bat_entries; entry++) { - be32enc(&bat[entry], sector); - sector += (VHD_BLOCK_SIZE / VHD_SECTOR_SIZE) + 1; + blk = entry * blkcnt; + if (image_data(blk, blkcnt)) { + be32enc(&bat[entry], sector); + sector += (VHD_BLOCK_SIZE / VHD_SECTOR_SIZE) + 1; + } } if (sparse_write(fd, bat, batsz) < 0) { free(bat); @@ -277,16 +319,21 @@ vhd_write(int fd) memset(bitmap, 0xff, VHD_SECTOR_SIZE); blk = 0; + blkcnt = VHD_BLOCK_SIZE / secsz; nblks = image_get_size(); while (blk < nblks) { + if (!image_data(blk, blkcnt)) { + blk += blkcnt; + continue; + } if (sparse_write(fd, bitmap, VHD_SECTOR_SIZE) < 0) { error = errno; break; } - error = image_copyout_region(fd, blk, VHD_BLOCK_SIZE / secsz); + error = image_copyout_region(fd, blk, blkcnt); if (error) break; - blk += VHD_BLOCK_SIZE / secsz; + blk += blkcnt; } free(bitmap); if (blk != nblks) @@ -298,11 +345,41 @@ vhd_write(int fd) return (0); } -static struct mkimg_format vhd_format = { +static struct mkimg_format vhd_dyn_format = { .name = "vhd", .description = "Virtual Hard Disk", .resize = vhd_resize, - .write = vhd_write, + .write = vhd_dyn_write, +}; + +FORMAT_DEFINE(vhd_dyn_format); + +/* + * PART 2: Fixed VHD + */ + +static int +vhd_fix_write(int fd) +{ + struct vhd_footer footer; + uint64_t imgsz; + int error; + + error = image_copyout(fd); + if (!error) { + imgsz = image_get_size() * secsz; + vhd_make_footer(&footer, imgsz, VHD_DISK_TYPE_FIXED, ~0ULL); + if (sparse_write(fd, &footer, sizeof(footer)) < 0) + error = errno; + } + return (error); +} + +static struct mkimg_format vhd_fix_format = { + .name = "vhdf", + .description = "Fixed Virtual Hard Disk", + .resize = vhd_resize, + .write = vhd_fix_write, }; -FORMAT_DEFINE(vhd_format); +FORMAT_DEFINE(vhd_fix_format); Modified: stable/10/usr.bin/mkimg/vmdk.c ============================================================================== --- stable/10/usr.bin/mkimg/vmdk.c Mon Jul 28 01:25:49 2014 (r269176) +++ stable/10/usr.bin/mkimg/vmdk.c Mon Jul 28 02:07:16 2014 (r269177) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -115,8 +114,9 @@ vmdk_write(int fd) char *buf, *desc; off_t cur, lim; uint64_t imagesz; + lba_t blkofs, blkcnt; size_t gdsz, gtsz; - uint32_t sec; + uint32_t sec, cursec; int error, desc_len, n, ngrains, ngts; imagesz = (image_get_size() * secsz) / VMDK_SECTOR_SIZE; @@ -179,8 +179,15 @@ vmdk_write(int fd) return (ENOMEM); } - for (n = 0; n < ngrains; n++) - le32enc(gt + n, sec + n * grainsz); + cursec = sec; + blkcnt = (grainsz * VMDK_SECTOR_SIZE) / secsz; + for (n = 0; n < ngrains; n++) { + blkofs = n * blkcnt; + if (image_data(blkofs, blkcnt)) { + le32enc(gt + n, cursec); + cursec += grainsz; + } + } error = 0; if (!error && sparse_write(fd, &hdr, VMDK_SECTOR_SIZE) < 0) @@ -211,9 +218,19 @@ vmdk_write(int fd) if (buf != NULL) free(buf); } - if (!error) - error = image_copyout(fd); - return (error); + if (error) + return (error); + + blkcnt = (grainsz * VMDK_SECTOR_SIZE) / secsz; + for (n = 0; n < ngrains; n++) { + blkofs = n * blkcnt; + if (image_data(blkofs, blkcnt)) { + error = image_copyout_region(fd, blkofs, blkcnt); + if (error) + return (error); + } + } + return (image_copyout_done(fd)); } static struct mkimg_format vmdk_format = { From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 21:11:21 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 635EFC90; Mon, 28 Jul 2014 21:11: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 4F3BA244A; Mon, 28 Jul 2014 21:11: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 s6SLBL93005265; Mon, 28 Jul 2014 21:11:21 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6SLBI7f005244; Mon, 28 Jul 2014 21:11:18 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201407282111.s6SLBI7f005244@svn.freebsd.org> From: Jack F Vogel Date: Mon, 28 Jul 2014 21:11:18 +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: r269196 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 21:11:21 -0000 Author: jfv Date: Mon Jul 28 21:11:18 2014 New Revision: 269196 URL: http://svnweb.freebsd.org/changeset/base/269196 Log: MFC of R267935: Sync the E1000 shared code to Intel internal, and more importantly add new I218 adapter support to em. Modified: stable/10/sys/dev/e1000/e1000_82542.c stable/10/sys/dev/e1000/e1000_82571.c stable/10/sys/dev/e1000/e1000_82571.h stable/10/sys/dev/e1000/e1000_82575.c stable/10/sys/dev/e1000/e1000_82575.h stable/10/sys/dev/e1000/e1000_api.c stable/10/sys/dev/e1000/e1000_api.h stable/10/sys/dev/e1000/e1000_defines.h stable/10/sys/dev/e1000/e1000_hw.h stable/10/sys/dev/e1000/e1000_i210.c stable/10/sys/dev/e1000/e1000_i210.h stable/10/sys/dev/e1000/e1000_ich8lan.c stable/10/sys/dev/e1000/e1000_ich8lan.h stable/10/sys/dev/e1000/e1000_mac.c stable/10/sys/dev/e1000/e1000_mac.h stable/10/sys/dev/e1000/e1000_manage.c stable/10/sys/dev/e1000/e1000_mbx.c stable/10/sys/dev/e1000/e1000_mbx.h stable/10/sys/dev/e1000/e1000_nvm.c stable/10/sys/dev/e1000/e1000_osdep.h stable/10/sys/dev/e1000/e1000_phy.c stable/10/sys/dev/e1000/e1000_phy.h stable/10/sys/dev/e1000/e1000_regs.h stable/10/sys/dev/e1000/e1000_vf.c stable/10/sys/dev/e1000/e1000_vf.h stable/10/sys/dev/e1000/if_em.c Modified: stable/10/sys/dev/e1000/e1000_82542.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82542.c Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_82542.c Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ static s32 e1000_init_hw_82542(struct e static s32 e1000_setup_link_82542(struct e1000_hw *hw); static s32 e1000_led_on_82542(struct e1000_hw *hw); static s32 e1000_led_off_82542(struct e1000_hw *hw); -static void e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index); +static int e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index); static void e1000_clear_hw_cntrs_82542(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82542(struct e1000_hw *hw); @@ -409,7 +409,7 @@ static s32 e1000_led_off_82542(struct e1 * Sets the receive address array register at index to the address passed * in by addr. **/ -static void e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index) +static int e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index) { u32 rar_low, rar_high; @@ -431,6 +431,7 @@ static void e1000_rar_set_82542(struct e E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low); E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high); + return E1000_SUCCESS; } /** Modified: stable/10/sys/dev/e1000/e1000_82571.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82571.c Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_82571.c Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1453,10 +1453,14 @@ static void e1000_clear_vfta_82571(struc static bool e1000_check_mng_mode_82574(struct e1000_hw *hw) { u16 data; + s32 ret_val; DEBUGFUNC("e1000_check_mng_mode_82574"); - hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data); + ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data); + if (ret_val) + return FALSE; + return (data & E1000_NVM_INIT_CTRL2_MNGM) != 0; } Modified: stable/10/sys/dev/e1000/e1000_82571.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_82571.h Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_82571.h Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -35,29 +35,30 @@ #ifndef _E1000_82571_H_ #define _E1000_82571_H_ -#define ID_LED_RESERVED_F746 0xF746 -#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \ - (ID_LED_OFF1_ON2 << 8) | \ - (ID_LED_DEF1_DEF2 << 4) | \ - (ID_LED_DEF1_DEF2)) +#define ID_LED_RESERVED_F746 0xF746 +#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \ + (ID_LED_OFF1_ON2 << 8) | \ + (ID_LED_DEF1_DEF2 << 4) | \ + (ID_LED_DEF1_DEF2)) -#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 -#define AN_RETRY_COUNT 5 /* Autoneg Retry Count value */ +#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 +#define AN_RETRY_COUNT 5 /* Autoneg Retry Count value */ /* Intr Throttling - RW */ -#define E1000_EITR_82574(_n) (0x000E8 + (0x4 * (_n))) +#define E1000_EITR_82574(_n) (0x000E8 + (0x4 * (_n))) -#define E1000_EIAC_82574 0x000DC /* Ext. Interrupt Auto Clear - RW */ -#define E1000_EIAC_MASK_82574 0x01F00000 +#define E1000_EIAC_82574 0x000DC /* Ext. Interrupt Auto Clear - RW */ +#define E1000_EIAC_MASK_82574 0x01F00000 -#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ +#define E1000_IVAR_INT_ALLOC_VALID 0x8 -#define E1000_RXCFGL 0x0B634 /* TimeSync Rx EtherType & Msg Type Reg - RW */ +/* Manageability Operation Mode mask */ +#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 -#define E1000_BASE1000T_STATUS 10 -#define E1000_IDLE_ERROR_COUNT_MASK 0xFF -#define E1000_RECEIVE_ERROR_COUNTER 21 -#define E1000_RECEIVE_ERROR_MAX 0xFFFF +#define E1000_BASE1000T_STATUS 10 +#define E1000_IDLE_ERROR_COUNT_MASK 0xFF +#define E1000_RECEIVE_ERROR_COUNTER 21 +#define E1000_RECEIVE_ERROR_MAX 0xFFFF bool e1000_check_phy_82574(struct e1000_hw *hw); bool e1000_get_laa_state_82571(struct e1000_hw *hw); void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state); Modified: stable/10/sys/dev/e1000/e1000_82575.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82575.c Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_82575.c Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -56,7 +56,6 @@ static s32 e1000_check_for_link_media_s static s32 e1000_get_cfg_done_82575(struct e1000_hw *hw); static s32 e1000_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed, u16 *duplex); -static s32 e1000_init_hw_82575(struct e1000_hw *hw); static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw); static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, u16 *data); @@ -120,7 +119,8 @@ static bool e1000_get_i2c_data(u32 *i2cc static const u16 e1000_82580_rxpbs_table[] = { 36, 72, 144, 1, 2, 4, 8, 16, 35, 70, 140 }; #define E1000_82580_RXPBS_TABLE_SIZE \ - (sizeof(e1000_82580_rxpbs_table)/sizeof(u16)) + (sizeof(e1000_82580_rxpbs_table) / \ + sizeof(e1000_82580_rxpbs_table[0])) /** @@ -273,6 +273,11 @@ static s32 e1000_init_phy_params_82575(s hw->mac.ops.check_for_link = e1000_check_for_link_media_swap; } + if (phy->id == M88E1512_E_PHY_ID) { + ret_val = e1000_initialize_M88E1512_phy(hw); + if (ret_val) + goto out; + } break; case IGP03E1000_E_PHY_ID: case IGP04E1000_E_PHY_ID: @@ -450,6 +455,9 @@ static s32 e1000_init_mac_params_82575(s else mac->ops.reset_hw = e1000_reset_hw_82575; /* hw initialization */ + if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) + mac->ops.init_hw = e1000_init_hw_i210; + else mac->ops.init_hw = e1000_init_hw_82575; /* link setup */ mac->ops.setup_link = e1000_setup_link_generic; @@ -750,6 +758,7 @@ out: static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw) { s32 ret_val = E1000_SUCCESS; + struct e1000_phy_info *phy = &hw->phy; DEBUGFUNC("e1000_phy_hw_reset_sgmii_82575"); @@ -772,7 +781,11 @@ static s32 e1000_phy_hw_reset_sgmii_8257 goto out; ret_val = hw->phy.ops.commit(hw); + if (ret_val) + goto out; + if (phy->id == M88E1512_E_PHY_ID) + ret_val = e1000_initialize_M88E1512_phy(hw); out: return ret_val; } @@ -879,7 +892,6 @@ out: static s32 e1000_set_d0_lplu_state_82580(struct e1000_hw *hw, bool active) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; u32 data; DEBUGFUNC("e1000_set_d0_lplu_state_82580"); @@ -907,7 +919,7 @@ static s32 e1000_set_d0_lplu_state_82580 } E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, data); - return ret_val; + return E1000_SUCCESS; } /** @@ -927,7 +939,6 @@ static s32 e1000_set_d0_lplu_state_82580 s32 e1000_set_d3_lplu_state_82580(struct e1000_hw *hw, bool active) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; u32 data; DEBUGFUNC("e1000_set_d3_lplu_state_82580"); @@ -955,7 +966,7 @@ s32 e1000_set_d3_lplu_state_82580(struct } E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, data); - return ret_val; + return E1000_SUCCESS; } /** @@ -969,7 +980,7 @@ s32 e1000_set_d3_lplu_state_82580(struct **/ static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw) { - s32 ret_val; + s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_acquire_nvm_82575"); @@ -991,6 +1002,7 @@ static s32 e1000_acquire_nvm_82575(struc DEBUGOUT("Nvm bit banging access error detected and cleared.\n"); } } + if (hw->mac.type == e1000_82580) { u32 eecd = E1000_READ_REG(hw, E1000_EECD); if (eecd & E1000_EECD_BLOCKED) { @@ -1001,7 +1013,6 @@ static s32 e1000_acquire_nvm_82575(struc } } - ret_val = e1000_acquire_nvm_generic(hw); if (ret_val) e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); @@ -1115,7 +1126,6 @@ static void e1000_release_swfw_sync_8257 static s32 e1000_get_cfg_done_82575(struct e1000_hw *hw) { s32 timeout = PHY_CFG_TIMEOUT; - s32 ret_val = E1000_SUCCESS; u32 mask = E1000_NVM_CFG_DONE_PORT_0; DEBUGFUNC("e1000_get_cfg_done_82575"); @@ -1140,7 +1150,7 @@ static s32 e1000_get_cfg_done_82575(stru (hw->phy.type == e1000_phy_igp_3)) e1000_phy_init_script_igp3(hw); - return ret_val; + return E1000_SUCCESS; } /** @@ -1466,7 +1476,7 @@ static s32 e1000_reset_hw_82575(struct e * * This inits the hardware readying it for operation. **/ -static s32 e1000_init_hw_82575(struct e1000_hw *hw) +s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; @@ -1985,7 +1995,7 @@ static s32 e1000_reset_init_script_82575 **/ static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_read_mac_addr_82575"); @@ -2478,11 +2488,17 @@ static s32 e1000_reset_hw_82580(struct e ctrl |= E1000_CTRL_RST; E1000_WRITE_REG(hw, E1000_CTRL, ctrl); - E1000_WRITE_FLUSH(hw); - /* Add delay to insure DEV_RST has time to complete */ - if (global_device_reset) - msec_delay(5); + switch (hw->device_id) { + case E1000_DEV_ID_DH89XXCC_SGMII: + break; + default: + E1000_WRITE_FLUSH(hw); + break; + } + + /* Add delay to insure DEV_RST or RST has time to complete */ + msec_delay(5); ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) { @@ -2617,7 +2633,7 @@ out: **/ static s32 e1000_validate_nvm_checksum_82580(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 eeprom_regions_count = 1; u16 j, nvm_data; u16 nvm_offset; @@ -2757,7 +2773,7 @@ out: static s32 __e1000_access_emi_reg(struct e1000_hw *hw, u16 address, u16 *data, bool read) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("__e1000_access_emi_reg"); @@ -2787,6 +2803,95 @@ s32 e1000_read_emi_reg(struct e1000_hw * } /** + * e1000_initialize_M88E1512_phy - Initialize M88E1512 PHY + * @hw: pointer to the HW structure + * + * Initialize Marverl 1512 to work correctly with Avoton. + **/ +s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw) +{ + struct e1000_phy_info *phy = &hw->phy; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_initialize_M88E1512_phy"); + + /* Check if this is correct PHY. */ + if (phy->id != M88E1512_E_PHY_ID) + goto out; + + /* Switch to PHY page 0xFF. */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x00FF); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0x214B); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x2144); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0x0C28); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x2146); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0xB233); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x214D); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0xCC0C); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x2159); + if (ret_val) + goto out; + + /* Switch to PHY page 0xFB. */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x00FB); + if (ret_val) + goto out; + + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_3, 0x000D); + if (ret_val) + goto out; + + /* Switch to PHY page 0x12. */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x12); + if (ret_val) + goto out; + + /* Change mode to SGMII-to-Copper */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1512_MODE, 0x8001); + if (ret_val) + goto out; + + /* Return the PHY to page 0. */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0); + if (ret_val) + goto out; + + ret_val = phy->ops.commit(hw); + if (ret_val) { + DEBUGOUT("Error committing the PHY changes\n"); + return ret_val; + } + + msec_delay(1000); +out: + return ret_val; +} + +/** * e1000_set_eee_i350 - Enable/disable EEE support * @hw: pointer to the HW structure * @@ -2795,7 +2900,6 @@ s32 e1000_read_emi_reg(struct e1000_hw * **/ s32 e1000_set_eee_i350(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; u32 ipcnfg, eeer; DEBUGFUNC("e1000_set_eee_i350"); @@ -2828,7 +2932,7 @@ s32 e1000_set_eee_i350(struct e1000_hw * E1000_READ_REG(hw, E1000_EEER); out: - return ret_val; + return E1000_SUCCESS; } /** Modified: stable/10/sys/dev/e1000/e1000_82575.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_82575.h Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_82575.h Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -384,7 +384,7 @@ struct e1000_adv_tx_context_desc { #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) #define E1000_ETQF_1588 (1 << 30) -#define E1000_ETQF_QUEUE_ENABLE (1U << 31) +#define E1000_ETQF_QUEUE_ENABLE (1 << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -411,7 +411,7 @@ struct e1000_adv_tx_context_desc { #define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enables */ #define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8 #define E1000_DTXSWC_LLE_SHIFT 16 -#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1U << 31) /* global VF LB enable */ +#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */ /* Easy defines for setting default pool, would normally be left a zero */ #define E1000_VT_CTL_DEFAULT_POOL_SHIFT 7 @@ -480,6 +480,7 @@ void e1000_vmdq_set_loopback_pf(struct e void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); +s32 e1000_init_hw_82575(struct e1000_hw *hw); enum e1000_promisc_type { e1000_promisc_disabled = 0, /* all promisc modes disabled */ @@ -497,6 +498,7 @@ s32 e1000_read_emi_reg(struct e1000_hw * s32 e1000_set_eee_i350(struct e1000_hw *); s32 e1000_set_eee_i354(struct e1000_hw *); s32 e1000_get_eee_status_i354(struct e1000_hw *, bool *); +s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw); /* I2C SDA and SCL timing parameters for standard mode */ #define E1000_I2C_T_HD_STA 4 Modified: stable/10/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_api.c Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_api.c Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -293,6 +293,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_LPT_I217_V: case E1000_DEV_ID_PCH_LPTLP_I218_LM: case E1000_DEV_ID_PCH_LPTLP_I218_V: + case E1000_DEV_ID_PCH_I218_LM2: + case E1000_DEV_ID_PCH_I218_V2: + case E1000_DEV_ID_PCH_I218_LM3: + case E1000_DEV_ID_PCH_I218_V3: mac->type = e1000_pch_lpt; break; case E1000_DEV_ID_82575EB_COPPER: @@ -828,10 +832,12 @@ void e1000_config_collision_dist(struct * * Sets a Receive Address Register (RAR) to the specified address. **/ -void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index) +int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index) { if (hw->mac.ops.rar_set) - hw->mac.ops.rar_set(hw, addr, index); + return hw->mac.ops.rar_set(hw, addr, index); + + return E1000_SUCCESS; } /** Modified: stable/10/sys/dev/e1000/e1000_api.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_api.h Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_api.h Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -69,7 +69,7 @@ s32 e1000_setup_link(struct e1000_hw *hw s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex); s32 e1000_disable_pcie_master(struct e1000_hw *hw); void e1000_config_collision_dist(struct e1000_hw *hw); -void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index); +int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index); u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr); void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count); Modified: stable/10/sys/dev/e1000/e1000_defines.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_defines.h Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_defines.h Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ /* Physical Func Reset Done Indication */ #define E1000_CTRL_EXT_PFRSTD 0x00004000 +#define E1000_CTRL_EXT_SDLPE 0X00040000 /* SerDes Low Power Enable */ #define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */ #define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ #define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000 /* DMA Dynamic Clk Gating */ @@ -131,7 +132,7 @@ #define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */ #define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ -#define E1000_RXDEXT_STATERR_TST 0x00010000 /* Time Stamp taken */ +#define E1000_RXDEXT_STATERR_TST 0x00000100 /* Time Stamp taken */ #define E1000_RXDEXT_STATERR_LB 0x00040000 #define E1000_RXDEXT_STATERR_CE 0x01000000 #define E1000_RXDEXT_STATERR_SE 0x02000000 @@ -157,6 +158,7 @@ E1000_RXDEXT_STATERR_CXE | \ E1000_RXDEXT_STATERR_RXE) +#define E1000_MRQC_ENABLE_RSS_2Q 0x00000001 #define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000 #define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000 #define E1000_MRQC_RSS_FIELD_IPV4 0x00020000 @@ -464,6 +466,7 @@ #define ETHERNET_FCS_SIZE 4 #define MAX_JUMBO_FRAME_SIZE 0x3F00 +#define E1000_TX_PTR_GAP 0x1F /* Extended Configuration Control and Size */ #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 @@ -853,6 +856,10 @@ #define E1000_PCS_STATUS_ADDR_I354 1 #define E1000_PCS_STATUS_RX_LPI_RCVD 0x0400 #define E1000_PCS_STATUS_TX_LPI_RCVD 0x0800 +#define E1000_M88E1512_CFG_REG_1 0x0010 +#define E1000_M88E1512_CFG_REG_2 0x0011 +#define E1000_M88E1512_CFG_REG_3 0x0007 +#define E1000_M88E1512_MODE 0x0014 #define E1000_EEE_SU_LPI_CLK_STP 0x00800000 /* EEE LPI Clock Stop */ #define E1000_EEE_LP_ADV_DEV_I210 7 /* EEE LP Adv Device */ #define E1000_EEE_LP_ADV_ADDR_I210 61 /* EEE LP Adv Register */ @@ -1429,6 +1436,9 @@ #define E1000_RXPBS_CFG_TS_EN 0x80000000 /* Timestamp in Rx buffer */ #define E1000_RXPBS_SIZE_I210_MASK 0x0000003F /* Rx packet buffer size */ #define E1000_TXPB0S_SIZE_I210_MASK 0x0000003F /* Tx packet buffer 0 size */ +#define I210_RXPBSIZE_DEFAULT 0x000000A2 /* RXPBSIZE default */ +#define I210_TXPBSIZE_DEFAULT 0x04000014 /* TXPBSIZE default */ + #define E1000_DOBFFCTL_OBFFTHR_MASK 0x000000FF /* OBFF threshold */ #define E1000_DOBFFCTL_EXIT_ACT_MASK 0x01000000 /* Exit active CB */ @@ -1455,5 +1465,7 @@ #define E1000_STATUS_LAN_ID_OFFSET 2 #define E1000_VFTA_ENTRIES 128 #define E1000_UNUSEDARG +#ifndef ERROR_REPORT #define ERROR_REPORT(fmt) do { } while (0) +#endif /* ERROR_REPORT */ #endif /* _E1000_DEFINES_H_ */ Modified: stable/10/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_hw.h Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_hw.h Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -133,6 +133,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_LPT_I217_V 0x153B #define E1000_DEV_ID_PCH_LPTLP_I218_LM 0x155A #define E1000_DEV_ID_PCH_LPTLP_I218_V 0x1559 +#define E1000_DEV_ID_PCH_I218_LM2 0x15A0 +#define E1000_DEV_ID_PCH_I218_V2 0x15A1 +#define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */ +#define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */ #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -696,7 +700,7 @@ struct e1000_mac_operations { s32 (*setup_led)(struct e1000_hw *); void (*write_vfta)(struct e1000_hw *, u32, u32); void (*config_collision_dist)(struct e1000_hw *); - void (*rar_set)(struct e1000_hw *, u8*, u32); + int (*rar_set)(struct e1000_hw *, u8*, u32); s32 (*read_mac_addr)(struct e1000_hw *); s32 (*validate_mdi_setting)(struct e1000_hw *); s32 (*set_obff_timer)(struct e1000_hw *, u32); @@ -934,6 +938,13 @@ struct e1000_shadow_ram { #define E1000_SHADOW_RAM_WORDS 2048 +/* I218 PHY Ultra Low Power (ULP) states */ +enum e1000_ulp_state { + e1000_ulp_state_unknown, + e1000_ulp_state_off, + e1000_ulp_state_on, +}; + struct e1000_dev_spec_ich8lan { bool kmrn_lock_loss_workaround_enabled; struct e1000_shadow_ram shadow_ram[E1000_SHADOW_RAM_WORDS]; @@ -942,6 +953,7 @@ struct e1000_dev_spec_ich8lan { bool nvm_k1_enabled; bool eee_disable; u16 eee_lp_ability; + enum e1000_ulp_state ulp_state; }; struct e1000_dev_spec_82575 { Modified: stable/10/sys/dev/e1000/e1000_i210.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_i210.c Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_i210.c Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -536,7 +536,7 @@ s32 e1000_validate_nvm_checksum_i210(str **/ s32 e1000_update_nvm_checksum_i210(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 checksum = 0; u16 i, nvm_data; @@ -615,7 +615,7 @@ bool e1000_get_flash_presence_i210(struc **/ s32 e1000_update_flash_i210(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u32 flup; DEBUGFUNC("e1000_update_flash_i210"); @@ -671,7 +671,7 @@ s32 e1000_pool_flash_update_done_i210(st **/ static s32 e1000_init_nvm_params_i210(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; struct e1000_nvm_info *nvm = &hw->nvm; DEBUGFUNC("e1000_init_nvm_params_i210"); @@ -756,7 +756,7 @@ out: static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, u8 dev_addr, u16 *data, bool read) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("__e1000_access_xmdio_reg"); @@ -815,3 +815,90 @@ s32 e1000_write_xmdio_reg(struct e1000_h return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, FALSE); } + +/** + * e1000_pll_workaround_i210 + * @hw: pointer to the HW structure + * + * Works around an errata in the PLL circuit where it occasionally + * provides the wrong clock frequency after power up. + **/ +static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) +{ + s32 ret_val; + u32 wuc, mdicnfg, ctrl, ctrl_ext, reg_val; + u16 nvm_word, phy_word, pci_word, tmp_nvm; + int i; + + /* Get and set needed register values */ + wuc = E1000_READ_REG(hw, E1000_WUC); + mdicnfg = E1000_READ_REG(hw, E1000_MDICNFG); + reg_val = mdicnfg & ~E1000_MDICNFG_EXT_MDIO; + E1000_WRITE_REG(hw, E1000_MDICNFG, reg_val); + + /* Get data from NVM, or set default */ + ret_val = e1000_read_invm_word_i210(hw, E1000_INVM_AUTOLOAD, + &nvm_word); + if (ret_val != E1000_SUCCESS) + nvm_word = E1000_INVM_DEFAULT_AL; + tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; + for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { + /* check current state directly from internal PHY */ + e1000_read_phy_reg_gs40g(hw, (E1000_PHY_PLL_FREQ_PAGE | + E1000_PHY_PLL_FREQ_REG), &phy_word); + if ((phy_word & E1000_PHY_PLL_UNCONF) + != E1000_PHY_PLL_UNCONF) { + ret_val = E1000_SUCCESS; + break; + } else { + ret_val = -E1000_ERR_PHY; + } + /* directly reset the internal PHY */ + ctrl = E1000_READ_REG(hw, E1000_CTRL); + E1000_WRITE_REG(hw, E1000_CTRL, ctrl|E1000_CTRL_PHY_RST); + + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); + ctrl_ext |= (E1000_CTRL_EXT_PHYPDEN | E1000_CTRL_EXT_SDLPE); + E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); + + E1000_WRITE_REG(hw, E1000_WUC, 0); + reg_val = (E1000_INVM_AUTOLOAD << 4) | (tmp_nvm << 16); + E1000_WRITE_REG(hw, E1000_EEARBC_I210, reg_val); + + e1000_read_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word); + pci_word |= E1000_PCI_PMCSR_D3; + e1000_write_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word); + msec_delay(1); + pci_word &= ~E1000_PCI_PMCSR_D3; + e1000_write_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word); + reg_val = (E1000_INVM_AUTOLOAD << 4) | (nvm_word << 16); + E1000_WRITE_REG(hw, E1000_EEARBC_I210, reg_val); + + /* restore WUC register */ + E1000_WRITE_REG(hw, E1000_WUC, wuc); + } + /* restore MDICNFG setting */ + E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg); + return ret_val; +} + +/** + * e1000_init_hw_i210 - Init hw for I210/I211 + * @hw: pointer to the HW structure + * + * Called to initialize hw for i210 hw family. + **/ +s32 e1000_init_hw_i210(struct e1000_hw *hw) +{ + s32 ret_val; + + DEBUGFUNC("e1000_init_hw_i210"); + if ((hw->mac.type >= e1000_i210) && + !(e1000_get_flash_presence_i210(hw))) { + ret_val = e1000_pll_workaround_i210(hw); + if (ret_val != E1000_SUCCESS) + return ret_val; + } + ret_val = e1000_init_hw_82575(hw); + return ret_val; +} Modified: stable/10/sys/dev/e1000/e1000_i210.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_i210.h Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_i210.h Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,6 +49,7 @@ s32 e1000_read_xmdio_reg(struct e1000_hw u16 *data); s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data); +s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 #define E1000_EEPROM_FLASH_SIZE_WORD 0x11 @@ -93,4 +94,16 @@ enum E1000_INVM_STRUCTURE_TYPE { #define NVM_INIT_CTRL_4_DEFAULT_I211 0x00C1 #define NVM_LED_1_CFG_DEFAULT_I211 0x0184 #define NVM_LED_0_2_CFG_DEFAULT_I211 0x200C + +/* PLL Defines */ +#define E1000_PCI_PMCSR 0x44 +#define E1000_PCI_PMCSR_D3 0x03 +#define E1000_MAX_PLL_TRIES 5 +#define E1000_PHY_PLL_UNCONF 0xFF +#define E1000_PHY_PLL_FREQ_PAGE 0xFC0000 +#define E1000_PHY_PLL_FREQ_REG 0x000E +#define E1000_INVM_DEFAULT_AL 0x202F +#define E1000_INVM_AUTOLOAD 0x0A +#define E1000_INVM_PLL_WO_VAL 0x0010 + #endif Modified: stable/10/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_ich8lan.c Mon Jul 28 19:01:25 2014 (r269195) +++ stable/10/sys/dev/e1000/e1000_ich8lan.c Mon Jul 28 21:11:18 2014 (r269196) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -63,6 +63,10 @@ * Ethernet Connection I217-V * Ethernet Connection I218-V * Ethernet Connection I218-LM + * Ethernet Connection (2) I218-LM + * Ethernet Connection (2) I218-V + * Ethernet Connection (3) I218-LM + * Ethernet Connection (3) I218-V */ #include "e1000_api.h" @@ -73,8 +77,8 @@ static s32 e1000_acquire_nvm_ich8lan(st static void e1000_release_nvm_ich8lan(struct e1000_hw *hw); static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); -static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index); -static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); +static int e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index); +static int e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw); static void e1000_update_mc_addr_list_pch2lan(struct e1000_hw *hw, u8 *mc_addr_list, @@ -250,7 +254,7 @@ out: * Toggling the LANPHYPC pin value fully power-cycles the PHY and is * used to reset the PHY to a quiescent state when necessary. **/ -void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw) +static void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw) { u32 mac_reg; @@ -306,6 +310,12 @@ static s32 e1000_init_phy_workarounds_pc */ e1000_gate_hw_phy_config_ich8lan(hw, TRUE); + /* It is not possible to be certain of the current state of ULP + * so forcibly disable it. + */ + hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown; + e1000_disable_ulp_lpt_lp(hw, TRUE); + ret_val = hw->phy.ops.acquire(hw); if (ret_val) { DEBUGOUT("Failed to initialize PHY flow\n"); @@ -611,13 +621,12 @@ static s32 e1000_init_nvm_params_ich8lan DEBUGFUNC("e1000_init_nvm_params_ich8lan"); /* Can't read flash registers if the register set isn't mapped. */ + nvm->type = e1000_nvm_flash_sw; if (!hw->flash_address) { DEBUGOUT("ERROR: Flash registers not mapped\n"); return -E1000_ERR_CONFIG; } - nvm->type = e1000_nvm_flash_sw; - gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG); /* sector_X_addr is a "sector"-aligned address (4096 bytes) @@ -915,6 +924,17 @@ s32 e1000_set_eee_pchlan(struct e1000_hw } } + if (hw->phy.type == e1000_phy_82579) { + ret_val = e1000_read_emi_reg_locked(hw, I82579_LPI_PLL_SHUT, + &data); + if (ret_val) + goto release; + + data &= ~I82579_LPI_100_PLL_SHUT; + ret_val = e1000_write_emi_reg_locked(hw, I82579_LPI_PLL_SHUT, + data); + } + /* R/Clr IEEE MMD 3.1 bits 11:10 - Tx/Rx LPI Received */ ret_val = e1000_read_emi_reg_locked(hw, pcs_status, &data); if (ret_val) @@ -1179,6 +1199,256 @@ static s32 e1000_set_obff_timer_pch_lpt( } /** + * e1000_enable_ulp_lpt_lp - configure Ultra Low Power mode for LynxPoint-LP + * @hw: pointer to the HW structure + * @to_sx: boolean indicating a system power state transition to Sx + * + * When link is down, configure ULP mode to significantly reduce the power + * to the PHY. If on a Manageability Engine (ME) enabled system, tell the + * ME firmware to start the ULP configuration. If not on an ME enabled + * system, configure the ULP mode by software. + */ +s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) +{ + u32 mac_reg; + s32 ret_val = E1000_SUCCESS; + u16 phy_reg; + + if ((hw->mac.type < e1000_pch_lpt) || + (hw->device_id == E1000_DEV_ID_PCH_LPT_I217_LM) || + (hw->device_id == E1000_DEV_ID_PCH_LPT_I217_V) || + (hw->device_id == E1000_DEV_ID_PCH_I218_LM2) || + (hw->device_id == E1000_DEV_ID_PCH_I218_V2) || + (hw->dev_spec.ich8lan.ulp_state == e1000_ulp_state_on)) + return 0; + + if (E1000_READ_REG(hw, E1000_FWSM) & E1000_ICH_FWSM_FW_VALID) { + /* Request ME configure ULP mode in the PHY */ + mac_reg = E1000_READ_REG(hw, E1000_H2ME); + mac_reg |= E1000_H2ME_ULP | E1000_H2ME_ENFORCE_SETTINGS; + E1000_WRITE_REG(hw, E1000_H2ME, mac_reg); + + goto out; + } + + if (!to_sx) { + int i = 0; + + /* Poll up to 5 seconds for Cable Disconnected indication */ + while (!(E1000_READ_REG(hw, E1000_FEXT) & + E1000_FEXT_PHY_CABLE_DISCONNECTED)) { + /* Bail if link is re-acquired */ + if (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU) + return -E1000_ERR_PHY; + + if (i++ == 100) + break; + + msec_delay(50); + } + DEBUGOUT2("CABLE_DISCONNECTED %s set after %dmsec\n", + (E1000_READ_REG(hw, E1000_FEXT) & + E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not", + i * 50); + } + + ret_val = hw->phy.ops.acquire(hw); + if (ret_val) + goto out; + + /* Force SMBus mode in PHY */ + ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg); + if (ret_val) + goto release; + phy_reg |= CV_SMB_CTRL_FORCE_SMBUS; + e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg); + + /* Force SMBus mode in MAC */ + mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT); + mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; + E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg); + + /* Set Inband ULP Exit, Reset to SMBus mode and + * Disable SMBus Release on PERST# in PHY + */ + ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg); + if (ret_val) + goto release; + phy_reg |= (I218_ULP_CONFIG1_RESET_TO_SMBUS | + I218_ULP_CONFIG1_DISABLE_SMB_PERST); + if (to_sx) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 28 22:25:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8A5F459; Mon, 28 Jul 2014 22:25: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 B5CD42BAD; Mon, 28 Jul 2014 22:25: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 s6SMPRHs045672; Mon, 28 Jul 2014 22:25:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6SMPRHY045671; Mon, 28 Jul 2014 22:25:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201407282225.s6SMPRHY045671@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Jul 2014 22:25:27 +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: r269202 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 22:25:27 -0000 Author: trasz Date: Mon Jul 28 22:25:27 2014 New Revision: 269202 URL: http://svnweb.freebsd.org/changeset/base/269202 Log: MFC r269088: Fix ctl(4) kldload failure that manifested like this: link_elf_obj: symbol icl_pdu_new_bhs undefined PR: 192031 Submitted by: Nils Beyer (earlier version) Sponsored by: FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Mon Jul 28 22:23:49 2014 (r269201) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Mon Jul 28 22:25:27 2014 (r269202) @@ -183,6 +183,7 @@ static struct ctl_frontend cfiscsi_front .ioctl = cfiscsi_ioctl, }; CTL_FRONTEND_DECLARE(ctlcfiscsi, cfiscsi_frontend); +MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1); static struct icl_pdu * cfiscsi_pdu_new_response(struct icl_pdu *request, int flags) From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 05:41:56 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33F7BB8C; Tue, 29 Jul 2014 05:41:56 +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 14C2027CD; Tue, 29 Jul 2014 05:41:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6T5ftgT061864; Tue, 29 Jul 2014 05:41:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6T5fsOP061859; Tue, 29 Jul 2014 05:41:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407290541.s6T5fsOP061859@svn.freebsd.org> From: Xin LI Date: Tue, 29 Jul 2014 05:41:54 +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: r269218 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 05:41:56 -0000 Author: delphij Date: Tue Jul 29 05:41:54 2014 New Revision: 269218 URL: http://svnweb.freebsd.org/changeset/base/269218 Log: MFC r268713: MFV r268702: Add missing *_destroy() calls in various places with ZFS. Illumos issue: 4975 missing mutex_destroy() calls in zfs Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Jul 29 02:38:02 2014 (r269217) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Jul 29 05:41:54 2014 (r269218) @@ -1353,6 +1353,12 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ if (dr->dt.dl.dr_data != db->db_buf) VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db)); } + + if (db->db_level != 0) { + mutex_destroy(&dr->dt.di.dr_mtx); + list_destroy(&dr->dt.di.dr_children); + } + kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jul 29 02:38:02 2014 (r269217) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jul 29 05:41:54 2014 (r269218) @@ -1083,6 +1083,11 @@ dnode_hold_impl(objset_t *os, uint64_t o } if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL, dnode_buf_pageout)) { + + for (i = 0; i < epb; i++) { + zrl_destroy(&dnh[i].dnh_zrlock); + } + kmem_free(children_dnodes, sizeof (dnode_children_t) + (epb - 1) * sizeof (dnode_handle_t)); children_dnodes = winner; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Jul 29 02:38:02 2014 (r269217) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Jul 29 05:41:54 2014 (r269218) @@ -476,8 +476,8 @@ dnode_undirty_dbufs(list_t *list) dr->dt.dl.dr_data == db->db_buf); dbuf_unoverride(dr); } else { - list_destroy(&dr->dt.di.dr_children); mutex_destroy(&dr->dt.di.dr_mtx); + list_destroy(&dr->dt.di.dr_children); } kmem_free(dr, sizeof (dbuf_dirty_record_t)); dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jul 29 02:38:02 2014 (r269217) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jul 29 05:41:54 2014 (r269218) @@ -270,6 +270,7 @@ dsl_dataset_evict(dmu_buf_t *db, void *d if (mutex_owned(&ds->ds_opening_lock)) mutex_exit(&ds->ds_opening_lock); mutex_destroy(&ds->ds_opening_lock); + mutex_destroy(&ds->ds_sendstream_lock); refcount_destroy(&ds->ds_longholds); kmem_free(ds, sizeof (dsl_dataset_t)); @@ -398,6 +399,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin if (err != 0) { mutex_destroy(&ds->ds_lock); mutex_destroy(&ds->ds_opening_lock); + mutex_destroy(&ds->ds_sendstream_lock); refcount_destroy(&ds->ds_longholds); bplist_destroy(&ds->ds_pending_deadlist); dsl_deadlist_close(&ds->ds_deadlist); @@ -454,6 +456,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin dsl_dir_rele(ds->ds_dir, ds); mutex_destroy(&ds->ds_lock); mutex_destroy(&ds->ds_opening_lock); + mutex_destroy(&ds->ds_sendstream_lock); refcount_destroy(&ds->ds_longholds); kmem_free(ds, sizeof (dsl_dataset_t)); if (err != 0) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Jul 29 02:38:02 2014 (r269217) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Jul 29 05:41:54 2014 (r269218) @@ -1111,6 +1111,9 @@ fail: if (sa->sa_user_table) kmem_free(sa->sa_user_table, sa->sa_user_table_sz); mutex_exit(&sa->sa_lock); + avl_destroy(&sa->sa_layout_hash_tree); + avl_destroy(&sa->sa_layout_num_tree); + mutex_destroy(&sa->sa_lock); kmem_free(sa, sizeof (sa_os_t)); return ((error == ECKSUM) ? EIO : error); } @@ -1146,6 +1149,7 @@ sa_tear_down(objset_t *os) avl_destroy(&sa->sa_layout_hash_tree); avl_destroy(&sa->sa_layout_num_tree); + mutex_destroy(&sa->sa_lock); kmem_free(sa, sizeof (sa_os_t)); os->os_sa = NULL; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 05:49:17 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29767D54; Tue, 29 Jul 2014 05:49: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 14D312803; Tue, 29 Jul 2014 05:49: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 s6T5nGlD062867; Tue, 29 Jul 2014 05:49:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6T5nGjt062864; Tue, 29 Jul 2014 05:49:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407290549.s6T5nGjt062864@svn.freebsd.org> From: Xin LI Date: Tue, 29 Jul 2014 05:49:16 +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: r269219 - in stable/10: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 05:49:17 -0000 Author: delphij Date: Tue Jul 29 05:49:16 2014 New Revision: 269219 URL: http://svnweb.freebsd.org/changeset/base/269219 Log: MFC r268720: MFV r268714: Improve extreme rewind import. When doing an "extreme rewind" import ("zpool import -XF"), we attempt to verify all data in the pool, essentially scrubbing the entire pool. The problem is that spa_load_verify_cb() issues an unbounded number of concurrent scrub i/os. This can lead to all of memory being used for these zio's, wedging the system. Like normal scrub, we need to put a cap on the number of outstanding i/os, and have the traverse thread block when we reach this cap. For this purpose the cap can be very large (10,000) to optimize the elevator algorithm. Three kernel tunables have been added: vfs.zfs.spa_load_verify_maxinflight vfs.zfs.spa_load_verify_metadata vfs.zfs.spa_load_verify_data The latter two tunables controls whether metadata and/or user data when doing extreme rewind. Make 'zpool import -T' imply scrub. Make zpool import -T accept hexadecimal values for the txg when prefixed with 0x. Skip txg's for which there is no uberblock when doing extreme rewind. Skip reading all user data twice by skipping prefetches when doing extreme rewinds as we do not access via the ARC. Illumos issues: 4970 need controls on i/o issued by zpool import -XF 4971 zpool import -T should accept hex values 4972 zpool import -T implies extreme rewind, and thus a scrub 4973 spa_load_retry retries the same txg 4974 spa_load_verify() reads all data twice Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Jul 29 05:41:54 2014 (r269218) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Jul 29 05:49:16 2014 (r269219) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -2033,7 +2033,7 @@ zpool_do_import(int argc, char **argv) break; case 'T': errno = 0; - txg = strtoull(optarg, &endptr, 10); + txg = strtoull(optarg, &endptr, 0); if (errno != 0 || *endptr != '\0') { (void) fprintf(stderr, gettext("invalid txg value\n")); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 29 05:41:54 2014 (r269218) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 29 05:49:16 2014 (r269219) @@ -1874,6 +1874,7 @@ spa_load_verify_done(zio_t *zio) spa_load_error_t *sle = zio->io_private; dmu_object_type_t type = BP_GET_TYPE(bp); int error = zio->io_error; + spa_t *spa = zio->io_spa; if (error) { if ((BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)) && @@ -1883,23 +1884,65 @@ spa_load_verify_done(zio_t *zio) atomic_add_64(&sle->sle_data_count, 1); } zio_data_buf_free(zio->io_data, zio->io_size); + + mutex_enter(&spa->spa_scrub_lock); + spa->spa_scrub_inflight--; + cv_broadcast(&spa->spa_scrub_io_cv); + mutex_exit(&spa->spa_scrub_lock); } +/* + * Maximum number of concurrent scrub i/os to create while verifying + * a pool while importing it. + */ +int spa_load_verify_maxinflight = 10000; +boolean_t spa_load_verify_metadata = B_TRUE; +boolean_t spa_load_verify_data = B_TRUE; + +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_load_verify_maxinflight, CTLFLAG_RWTUN, + &spa_load_verify_maxinflight, 0, + "Maximum number of concurrent scrub I/Os to create while verifying a " + "pool while importing it"); + +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_load_verify_metadata, CTLFLAG_RWTUN, + &spa_load_verify_metadata, 0, + "Check metadata on import?"); + +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_load_verify_data, CTLFLAG_RWTUN, + &spa_load_verify_data, 0, + "Check user data on import?"); + /*ARGSUSED*/ static int spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { - if (!BP_IS_HOLE(bp) && !BP_IS_EMBEDDED(bp)) { - zio_t *rio = arg; - size_t size = BP_GET_PSIZE(bp); - void *data = zio_data_buf_alloc(size); - - zio_nowait(zio_read(rio, spa, bp, data, size, - spa_load_verify_done, rio->io_private, ZIO_PRIORITY_SCRUB, - ZIO_FLAG_SPECULATIVE | ZIO_FLAG_CANFAIL | - ZIO_FLAG_SCRUB | ZIO_FLAG_RAW, zb)); - } + if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp)) + return (0); + /* + * Note: normally this routine will not be called if + * spa_load_verify_metadata is not set. However, it may be useful + * to manually set the flag after the traversal has begun. + */ + if (!spa_load_verify_metadata) + return (0); + if (BP_GET_BUFC_TYPE(bp) == ARC_BUFC_DATA && !spa_load_verify_data) + return (0); + + zio_t *rio = arg; + size_t size = BP_GET_PSIZE(bp); + void *data = zio_data_buf_alloc(size); + + mutex_enter(&spa->spa_scrub_lock); + while (spa->spa_scrub_inflight >= spa_load_verify_maxinflight) + cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); + spa->spa_scrub_inflight++; + mutex_exit(&spa->spa_scrub_lock); + + zio_nowait(zio_read(rio, spa, bp, data, size, + spa_load_verify_done, rio->io_private, ZIO_PRIORITY_SCRUB, + ZIO_FLAG_SPECULATIVE | ZIO_FLAG_CANFAIL | + ZIO_FLAG_SCRUB | ZIO_FLAG_RAW, zb)); return (0); } @@ -1910,7 +1953,7 @@ spa_load_verify(spa_t *spa) spa_load_error_t sle = { 0 }; zpool_rewind_policy_t policy; boolean_t verify_ok = B_FALSE; - int error; + int error = 0; zpool_get_rewind_policy(spa->spa_config, &policy); @@ -1920,8 +1963,11 @@ spa_load_verify(spa_t *spa) rio = zio_root(spa, NULL, &sle, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE); - error = traverse_pool(spa, spa->spa_verify_min_txg, - TRAVERSE_PRE | TRAVERSE_PREFETCH, spa_load_verify_cb, rio); + if (spa_load_verify_metadata) { + error = traverse_pool(spa, spa->spa_verify_min_txg, + TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA, + spa_load_verify_cb, rio); + } (void) zio_wait(rio); @@ -2796,7 +2842,7 @@ spa_load_retry(spa_t *spa, spa_load_stat spa_unload(spa); spa_deactivate(spa); - spa->spa_load_max_txg--; + spa->spa_load_max_txg = spa->spa_uberblock.ub_txg - 1; spa_activate(spa, mode); spa_async_suspend(spa); @@ -2826,6 +2872,8 @@ spa_load_best(spa_t *spa, spa_load_state spa_set_log_state(spa, SPA_LOG_CLEAR); } else { spa->spa_load_max_txg = max_request; + if (max_request != UINT64_MAX) + spa->spa_extreme_rewind = B_TRUE; } load_error = rewind_error = spa_load(spa, state, SPA_IMPORT_EXISTING, From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 06:00:16 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D60331BB; Tue, 29 Jul 2014 06:00: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 C31C028F2; Tue, 29 Jul 2014 06:00:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6T60GLG067594; Tue, 29 Jul 2014 06:00:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6T60GHq067593; Tue, 29 Jul 2014 06:00:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407290600.s6T60GHq067593@svn.freebsd.org> From: Xin LI Date: Tue, 29 Jul 2014 06:00:16 +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: r269220 - stable/10/libexec/save-entropy X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 06:00:16 -0000 Author: delphij Date: Tue Jul 29 06:00:16 2014 New Revision: 269220 URL: http://svnweb.freebsd.org/changeset/base/269220 Log: MFC r268979: Don't save entropy inside jails. As of r126744, we no longer feed the entropy device in jails upon start, and collecting them is no longer useful. PR: conf/126744 Submitted by: Eugene Grosbein (with minor changes) Approved by: so (des) Modified: stable/10/libexec/save-entropy/save-entropy.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/save-entropy/save-entropy.sh ============================================================================== --- stable/10/libexec/save-entropy/save-entropy.sh Tue Jul 29 05:49:16 2014 (r269219) +++ stable/10/libexec/save-entropy/save-entropy.sh Tue Jul 29 06:00:16 2014 (r269220) @@ -42,6 +42,8 @@ elif [ -r /etc/rc.conf ]; then . /etc/rc.conf 2>/dev/null fi +[ $(/sbin/sysctl -n security.jail.jailed) = 0 ] || exit 0 + case ${entropy_dir} in [Nn][Oo]) exit 0 From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 07:36:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED705AFF; Tue, 29 Jul 2014 07:36: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 DA10C22AF; Tue, 29 Jul 2014 07:36: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 s6T7acj3013543; Tue, 29 Jul 2014 07:36:38 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6T7acBf013542; Tue, 29 Jul 2014 07:36:38 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407290736.s6T7acBf013542@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 29 Jul 2014 07:36:38 +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: r269225 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 07:36:39 -0000 Author: pluknet Date: Tue Jul 29 07:36:38 2014 New Revision: 269225 URL: http://svnweb.freebsd.org/changeset/base/269225 Log: MFC r268727 (by delphij): Add a bandaid to fix GCC build (on sparc64 et al). Modified: stable/10/usr.bin/mkimg/vhd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/vhd.c ============================================================================== --- stable/10/usr.bin/mkimg/vhd.c Tue Jul 29 07:13:03 2014 (r269224) +++ stable/10/usr.bin/mkimg/vhd.c Tue Jul 29 07:36:38 2014 (r269225) @@ -320,6 +320,7 @@ vhd_dyn_write(int fd) blk = 0; blkcnt = VHD_BLOCK_SIZE / secsz; + error = 0; nblks = image_get_size(); while (blk < nblks) { if (!image_data(blk, blkcnt)) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 07:40:15 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0035DE73; Tue, 29 Jul 2014 07:40: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 E1460246B; Tue, 29 Jul 2014 07:40: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 s6T7eE4c016806; Tue, 29 Jul 2014 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6T7eE19016804; Tue, 29 Jul 2014 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407290740.s6T7eE19016804@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jul 2014 07:40:14 +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: r269226 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 07:40:15 -0000 Author: mav Date: Tue Jul 29 07:40:14 2014 New Revision: 269226 URL: http://svnweb.freebsd.org/changeset/base/269226 Log: MFC r269122: Fix infinite loop, when doing WRITE SAME on file-backed LUN. 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 Jul 29 07:36:38 2014 (r269225) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Tue Jul 29 07:40:14 2014 (r269226) @@ -725,10 +725,11 @@ ctl_be_block_dispatch_file(struct ctl_be } /* - * If this is a write, we're all done. + * If this is a write or a verify, we're all done. * If this is a read, we can now send the data to the user. */ - if (ARGS(io)->flags & (CTL_LLF_WRITE | CTL_LLF_VERIFY)) { + if ((beio->bio_cmd == BIO_WRITE) || + (ARGS(io)->flags & CTL_LLF_VERIFY)) { ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 13:08:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED296307; Tue, 29 Jul 2014 13:08: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 D9E6B2C8F; Tue, 29 Jul 2014 13:08: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 s6TD8bON066901; Tue, 29 Jul 2014 13:08:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TD8bBp066899; Tue, 29 Jul 2014 13:08:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201407291308.s6TD8bBp066899@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Jul 2014 13:08: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: r269235 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 13:08:38 -0000 Author: marius Date: Tue Jul 29 13:08:37 2014 New Revision: 269235 URL: http://svnweb.freebsd.org/changeset/base/269235 Log: MFC: r269050 - Copying and zeroing pages via temporary mappings involves updating the corresponding page tables followed by accesses to the pages in question. This sequence is subject to the situation exactly described in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore, issuing the INVLPG right after modifying the PTE bits is crucial. For pmap_copy_page(), this has been broken in r124956 and later on carried over to pmap_copy_pages() derived from the former, while all other places in the i386 PMAP code use the correct order of instructions in this regard. Fixing the latter breakage solves the problem of data corruption seen with unmapped I/O enabled when running at least bare metal on AMD R-268D APUs. However, this might also fix similar corruption reported for virtualized environments. - In pmap_copy_pages(), correctly set the cache bits on the source page being copied. This change is thought to be a NOP for the real world, though. [2] 1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf Submitted by: kib [2] Reviewed by: alc, kib Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Tue Jul 29 12:44:19 2014 (r269234) +++ stable/10/sys/i386/i386/pmap.c Tue Jul 29 13:08:37 2014 (r269235) @@ -1286,6 +1286,13 @@ pmap_pte_release(pt_entry_t *pte) mtx_unlock(&PMAP2mutex); } +/* + * NB: The sequence of updating a page table followed by accesses to the + * corresponding pages is subject to the situation described in the "AMD64 + * Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23, + * "7.3.1 Special Coherency Considerations". Therefore, issuing the INVLPG + * right after modifying the PTE bits is crucial. + */ static __inline void invlcaddr(void *caddr) { @@ -4240,12 +4247,12 @@ pmap_copy_page(vm_page_t src, vm_page_t if (*sysmaps->CMAP2) panic("pmap_copy_page: CMAP2 busy"); sched_pin(); - invlpg((u_int)sysmaps->CADDR1); - invlpg((u_int)sysmaps->CADDR2); *sysmaps->CMAP1 = PG_V | VM_PAGE_TO_PHYS(src) | PG_A | pmap_cache_bits(src->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR1); *sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(dst) | PG_A | PG_M | pmap_cache_bits(dst->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR2); bcopy(sysmaps->CADDR1, sysmaps->CADDR2, PAGE_SIZE); *sysmaps->CMAP1 = 0; *sysmaps->CMAP2 = 0; @@ -4273,8 +4280,6 @@ pmap_copy_pages(vm_page_t ma[], vm_offse panic("pmap_copy_pages: CMAP2 busy"); sched_pin(); while (xfersize > 0) { - invlpg((u_int)sysmaps->CADDR1); - invlpg((u_int)sysmaps->CADDR2); a_pg = ma[a_offset >> PAGE_SHIFT]; a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); @@ -4282,9 +4287,11 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); *sysmaps->CMAP1 = PG_V | VM_PAGE_TO_PHYS(a_pg) | PG_A | - pmap_cache_bits(b_pg->md.pat_mode, 0); + pmap_cache_bits(a_pg->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR1); *sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(b_pg) | PG_A | PG_M | pmap_cache_bits(b_pg->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR2); a_cp = sysmaps->CADDR1 + a_pg_offset; b_cp = sysmaps->CADDR2 + b_pg_offset; bcopy(a_cp, b_cp, cnt); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 13:11:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80EEF890; Tue, 29 Jul 2014 13:11: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 6DEBD2D3A; Tue, 29 Jul 2014 13:11: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 s6TDBcLw070685; Tue, 29 Jul 2014 13:11:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TDBcnm070684; Tue, 29 Jul 2014 13:11:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201407291311.s6TDBcnm070684@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Jul 2014 13:11:38 +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: r269238 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 13:11:38 -0000 Author: marius Date: Tue Jul 29 13:11:37 2014 New Revision: 269238 URL: http://svnweb.freebsd.org/changeset/base/269238 Log: MFC: r269051 Copying pages via temporary mappings in the !DMAP case of pmap_copy_pages() involves updating the corresponding page tables followed by accesses to the pages in question. This sequence is subject to the situation exactly described in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore, issuing the INVLPG right after modifying the PTE bits is crucial (see also r269050, MFCed to stable/10 in r269235). For the amd64 PMAP code, the order of instructions was already correct. The above fact still is worth documenting, though. 1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf Reviewed by: alc Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/amd64/amd64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Tue Jul 29 13:08:56 2014 (r269237) +++ stable/10/sys/amd64/amd64/pmap.c Tue Jul 29 13:11:37 2014 (r269238) @@ -4984,6 +4984,14 @@ pmap_copy_pages(vm_page_t ma[], vm_offse int cnt; boolean_t pinned; + /* + * NB: The sequence of updating a page table followed by accesses + * to the corresponding pages used in the !DMAP case is subject to + * the situation described in the "AMD64 Architecture Programmer's + * Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special + * Coherency Considerations". Therefore, issuing the INVLPG right + * after modifying the PTE bits is crucial. + */ pinned = FALSE; while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 18:31:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A72D3528; Tue, 29 Jul 2014 18:31: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 87ABD224E; Tue, 29 Jul 2014 18:31: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 s6TIVRRZ065911; Tue, 29 Jul 2014 18:31:27 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TIVRIe065910; Tue, 29 Jul 2014 18:31:27 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407291831.s6TIVRIe065910@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 18:31:27 +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: r269245 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 18:31:27 -0000 Author: markj Date: Tue Jul 29 18:31:27 2014 New Revision: 269245 URL: http://svnweb.freebsd.org/changeset/base/269245 Log: MFC r262669: When our linker merges .SUNW_dof sections from multiple files, it simply concatenates the DOF tables into one section. Previously, the USDT init code in drti.o would only look at the first table in the DOF section; with this change, it iterates over all the tables, passing each DOF table to the kernel. PR: 186821 Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue Jul 29 16:42:34 2014 (r269244) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue Jul 29 18:31:27 2014 (r269245) @@ -20,6 +20,7 @@ */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2013 Voxer Inc. All rights reserved. * Use is subject to license terms. */ @@ -144,7 +145,8 @@ dtrace_dof_init(void) Lmid_t lmid; #else u_long lmid = 0; - dof_sec_t *sec; + dof_sec_t *sec, *secstart, *dofstrtab, *dofprobes; + dof_provider_t *dofprovider; size_t i; #endif int fd; @@ -152,14 +154,15 @@ dtrace_dof_init(void) #if !defined(sun) Elf *e; Elf_Scn *scn = NULL; - Elf_Data *symtabdata = NULL, *dynsymdata = NULL; + Elf_Data *symtabdata = NULL, *dynsymdata = NULL, *dofdata = NULL; + dof_hdr_t *dof_next = NULL; GElf_Shdr shdr; int efd, nprobes; char *s; + char *dofstrtabraw; size_t shstridx, symtabidx = 0, dynsymidx = 0; - unsigned char *dofstrtab = NULL; unsigned char *buf; - int fixedprobes = 0; + int fixedprobes; #endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) @@ -209,7 +212,8 @@ dtrace_dof_init(void) } else if (shdr.sh_type == SHT_PROGBITS) { s = elf_strptr(e, shstridx, shdr.sh_name); if (s && strcmp(s, ".SUNW_dof") == 0) { - dof = elf_getdata(scn, NULL)->d_buf; + dofdata = elf_getdata(scn, NULL); + dof = dofdata->d_buf; } } } @@ -219,6 +223,10 @@ dtrace_dof_init(void) close(efd); return; } + + while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) { + fixedprobes = 0; + dof_next = (void *) ((char *) dof + dof->dofh_filesz); #endif if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 || @@ -290,34 +298,49 @@ dtrace_dof_init(void) * We are assuming the number of probes is less than the number of * symbols (libc can have 4k symbols, for example). */ - sec = (dof_sec_t *)(dof + 1); + secstart = sec = (dof_sec_t *)(dof + 1); buf = (char *)dof; for (i = 0; i < dof->dofh_secnum; i++, sec++) { - if (sec->dofs_type == DOF_SECT_STRTAB) - dofstrtab = (unsigned char *)(buf + sec->dofs_offset); - else if (sec->dofs_type == DOF_SECT_PROBES && dofstrtab) + if (sec->dofs_type != DOF_SECT_PROVIDER) + continue; + + dofprovider = (void *) (buf + sec->dofs_offset); + dofstrtab = secstart + dofprovider->dofpv_strtab; + dofprobes = secstart + dofprovider->dofpv_probes; + + if (dofstrtab->dofs_type != DOF_SECT_STRTAB) { + fprintf(stderr, "WARNING: expected STRTAB section, but got %d\n", + dofstrtab->dofs_type); break; - - } - nprobes = sec->dofs_size / sec->dofs_entsize; - fixsymbol(e, symtabdata, symtabidx, nprobes, buf, sec, &fixedprobes, - dofstrtab); - if (fixedprobes != nprobes) { - /* - * If we haven't fixed all the probes using the - * symtab section, look inside the dynsym - * section. - */ - fixsymbol(e, dynsymdata, dynsymidx, nprobes, buf, sec, - &fixedprobes, dofstrtab); - } - if (fixedprobes != nprobes) { - fprintf(stderr, "WARNING: number of probes " - "fixed does not match the number of " - "defined probes (%d != %d, " - "respectively)\n", fixedprobes, nprobes); - fprintf(stderr, "WARNING: some probes might " - "not fire or your program might crash\n"); + } + if (dofprobes->dofs_type != DOF_SECT_PROBES) { + fprintf(stderr, "WARNING: expected PROBES section, but got %d\n", + dofprobes->dofs_type); + break; + } + + dprintf(1, "found provider %p\n", dofprovider); + dofstrtabraw = (char *)(buf + dofstrtab->dofs_offset); + nprobes = dofprobes->dofs_size / dofprobes->dofs_entsize; + fixsymbol(e, symtabdata, symtabidx, nprobes, buf, dofprobes, &fixedprobes, + dofstrtabraw); + if (fixedprobes != nprobes) { + /* + * If we haven't fixed all the probes using the + * symtab section, look inside the dynsym + * section. + */ + fixsymbol(e, dynsymdata, dynsymidx, nprobes, buf, dofprobes, + &fixedprobes, dofstrtabraw); + } + if (fixedprobes != nprobes) { + fprintf(stderr, "WARNING: number of probes " + "fixed does not match the number of " + "defined probes (%d != %d, " + "respectively)\n", fixedprobes, nprobes); + fprintf(stderr, "WARNING: some probes might " + "not fire or your program might crash\n"); + } } #endif if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1) @@ -330,7 +353,12 @@ dtrace_dof_init(void) } (void) close(fd); + #if !defined(sun) + /* End of while loop */ + dof = dof_next; + } + elf_end(e); (void) close(efd); #endif From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 20:33:19 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75823C34; Tue, 29 Jul 2014 20:33:19 +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 55A1A2190; Tue, 29 Jul 2014 20:33: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 s6TKXJKF039656; Tue, 29 Jul 2014 20:33:19 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TKXI78039654; Tue, 29 Jul 2014 20:33:18 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407292033.s6TKXI78039654@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 20:33:18 +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: r269253 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 20:33:19 -0000 Author: markj Date: Tue Jul 29 20:33:18 2014 New Revision: 269253 URL: http://svnweb.freebsd.org/changeset/base/269253 Log: MFC r263329: Only invoke fasttrap hooks for traps from user mode, and ensure that they're called with interrupts enabled. Calling fasttrap_pid_probe() with interrupts disabled can lead to deadlock if fasttrap writes to the process' address space. Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Tue Jul 29 19:49:38 2014 (r269252) +++ stable/10/sys/amd64/amd64/trap.c Tue Jul 29 20:33:18 2014 (r269253) @@ -193,6 +193,9 @@ SYSCTL_INT(_machdep, OID_AUTO, uprintf_s void trap(struct trapframe *frame) { +#ifdef KDTRACE_HOOKS + struct reg regs; +#endif struct thread *td = curthread; struct proc *p = td->td_proc; int i = 0, ucode = 0, code; @@ -244,28 +247,10 @@ trap(struct trapframe *frame) /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. - * - * If the DTrace kernel module has registered a trap handler, - * call it and if it returns non-zero, assume that it has - * handled the trap and modified the trap frame so that this - * function can return normally. */ - if (type == T_DTRACE_RET || type == T_BPTFLT) { - struct reg regs; - - fill_frame_regs(frame, ®s); - if (type == T_BPTFLT && - dtrace_pid_probe_ptr != NULL && - dtrace_pid_probe_ptr(®s) == 0) - goto out; - else if (type == T_DTRACE_RET && - dtrace_return_probe_ptr != NULL && - dtrace_return_probe_ptr(®s) == 0) - goto out; - } if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) goto out; #endif @@ -320,6 +305,14 @@ trap(struct trapframe *frame) case T_BPTFLT: /* bpt instruction fault */ case T_TRCTRAP: /* trace trap */ enable_intr(); +#ifdef KDTRACE_HOOKS + if (type == T_BPTFLT) { + fill_frame_regs(frame, ®s); + if (dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + } +#endif frame->tf_rflags &= ~PSL_T; i = SIGTRAP; ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); @@ -449,6 +442,15 @@ trap(struct trapframe *frame) goto userout; i = SIGFPE; break; +#ifdef KDTRACE_HOOKS + case T_DTRACE_RET: + enable_intr(); + fill_frame_regs(frame, ®s); + if (dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + break; +#endif } } else { /* kernel trap */ Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Tue Jul 29 19:49:38 2014 (r269252) +++ stable/10/sys/i386/i386/trap.c Tue Jul 29 20:33:18 2014 (r269253) @@ -207,6 +207,9 @@ SYSCTL_INT(_machdep, OID_AUTO, uprintf_s void trap(struct trapframe *frame) { +#ifdef KDTRACE_HOOKS + struct reg regs; +#endif struct thread *td = curthread; struct proc *p = td->td_proc; int i = 0, ucode = 0, code; @@ -263,28 +266,10 @@ trap(struct trapframe *frame) /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. - * - * If the DTrace kernel module has registered a trap handler, - * call it and if it returns non-zero, assume that it has - * handled the trap and modified the trap frame so that this - * function can return normally. */ - if (type == T_DTRACE_RET || type == T_BPTFLT) { - struct reg regs; - - fill_frame_regs(frame, ®s); - if (type == T_BPTFLT && - dtrace_pid_probe_ptr != NULL && - dtrace_pid_probe_ptr(®s) == 0) - goto out; - if (type == T_DTRACE_RET && - dtrace_return_probe_ptr != NULL && - dtrace_return_probe_ptr(®s) == 0) - goto out; - } if ((type == T_PROTFLT || type == T_PAGEFLT) && dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) goto out; @@ -358,6 +343,14 @@ trap(struct trapframe *frame) case T_BPTFLT: /* bpt instruction fault */ case T_TRCTRAP: /* trace trap */ enable_intr(); +#ifdef KDTRACE_HOOKS + if (type == T_BPTFLT) { + fill_frame_regs(frame, ®s); + if (dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + } +#endif frame->tf_eflags &= ~PSL_T; i = SIGTRAP; ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); @@ -541,6 +534,15 @@ trap(struct trapframe *frame) #endif i = SIGFPE; break; +#ifdef KDTRACE_HOOKS + case T_DTRACE_RET: + enable_intr(); + fill_frame_regs(frame, ®s); + if (dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + break; +#endif } } else { /* kernel trap */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 20:37:22 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB6AC198; Tue, 29 Jul 2014 20:37: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 C8DBF21DC; Tue, 29 Jul 2014 20:37:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6TKbMh0040569; Tue, 29 Jul 2014 20:37:22 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TKbMZn040568; Tue, 29 Jul 2014 20:37:22 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407292037.s6TKbMZn040568@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 20:37:22 +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: r269255 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 20:37:23 -0000 Author: markj Date: Tue Jul 29 20:37:22 2014 New Revision: 269255 URL: http://svnweb.freebsd.org/changeset/base/269255 Log: MFC r264363: Update the SDT(9) example to reflect the removal of the sname parameter in r258622. Modified: stable/10/share/man/man9/SDT.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/SDT.9 ============================================================================== --- stable/10/share/man/man9/SDT.9 Tue Jul 29 20:34:10 2014 (r269254) +++ stable/10/share/man/man9/SDT.9 Tue Jul 29 20:37:22 2014 (r269255) @@ -200,7 +200,7 @@ of type Destination Unreachable: .Bd -literal -offset indent SDT_PROVIDER_DECLARE(icmp); -SDT_PROBE_DEFINE1(icmp, , unreach, pkt_receive, pkt-receive, +SDT_PROBE_DEFINE1(icmp, , unreach, pkt__receive, "struct icmp *"); .Ed @@ -212,7 +212,7 @@ Consider a DTrace probe which fires when packet. Such a probe would be defined by multiple tracepoints: .Bd -literal -offset indent -SDT_PROBE_DEFINE3(ip, , , receive, receive, "struct ifnet *", +SDT_PROBE_DEFINE3(ip, , , receive, "struct ifnet *", "struct ip *", "struct ip6_hdr *"); int @@ -268,7 +268,7 @@ all in the library path. Then the FreeBSD probe above can be defined with: .Bd -literal -offset indent -SDT_PROBE_DEFINE1_XLATE(ip, , , receive, receive, "struct icmp *", +SDT_PROBE_DEFINE1_XLATE(ip, , , receive, "struct icmp *", "struct icmp_hdr_dt *"); .Ed .Sh SEE ALSO From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 20:57:40 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11374B13; Tue, 29 Jul 2014 20:57: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 ED6E724C5; Tue, 29 Jul 2014 20:57: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 s6TKvdpg050752; Tue, 29 Jul 2014 20:57:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TKvcLF050746; Tue, 29 Jul 2014 20:57:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407292057.s6TKvcLF050746@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 29 Jul 2014 20:57:38 +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: r269257 - in stable/10: contrib/ldns contrib/ldns/compat contrib/ldns/drill contrib/ldns/ldns contrib/ldns/m4 contrib/unbound contrib/unbound/compat contrib/unbound/daemon contrib/unbou... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 20:57:40 -0000 Author: des Date: Tue Jul 29 20:57:38 2014 New Revision: 269257 URL: http://svnweb.freebsd.org/changeset/base/269257 Log: MFH (r266114, r266138): upgrade to latest ldns and unbound MFH (r266139-r266143, r266145, r266149, r266150): fix props MFH (r266179, r266180, r266193, r266238, r266777): misc cleanup MFH (r266863): create and use /var/unbound/conf.d MFH (r268839): import unblock-lan-zones patch from upstream MFH (r268840): fix reverse lookups on private networks MFH (r268883): avoid spamming source tree during build PR: 190739 (for r268883) Added: stable/10/contrib/ldns/README.git - copied unchanged from r266114, head/contrib/ldns/README.git - copied unchanged from r266114, head/contrib/ldns/ldns/radix.h stable/10/contrib/ldns/m4/ - copied from r266114, head/contrib/ldns/m4/ - copied unchanged from r266114, head/contrib/ldns/radix.c stable/10/contrib/unbound/ax_pthread.m4 - copied unchanged from r266114, head/contrib/unbound/ax_pthread.m4 - copied unchanged from r266114, head/contrib/unbound/compat/strlcat.c stable/10/contrib/unbound/ldns/ - copied from r266114, head/contrib/unbound/ldns/ - copied unchanged from r266114, head/contrib/unbound/libunbound/unbound-event.h Directory Properties: stable/10/contrib/ldns/ldns/radix.h (props changed) stable/10/contrib/ldns/radix.c (props changed) stable/10/contrib/unbound/compat/strlcat.c (props changed) stable/10/contrib/unbound/libunbound/unbound-event.h (props changed) Deleted: stable/10/contrib/ldns/README.svn stable/10/contrib/ldns/compat/b32_ntop.c stable/10/contrib/ldns/compat/b32_pton.c stable/10/contrib/unbound/acx_pthread.m4 stable/10/contrib/unbound/util/configlexer.c stable/10/contrib/unbound/util/configparser.c stable/10/contrib/unbound/util/configparser.h Modified: stable/10/contrib/ldns/Changelog stable/10/contrib/ldns/Makefile.in stable/10/contrib/ldns/README stable/10/contrib/ldns/acx_nlnetlabs.m4 stable/10/contrib/ldns/ax_python_devel.m4 stable/10/contrib/ldns/compat/b64_ntop.c stable/10/contrib/ldns/compat/b64_pton.c stable/10/contrib/ldns/compat/snprintf.c stable/10/contrib/ldns/configure stable/10/contrib/ldns/configure.ac stable/10/contrib/ldns/dane.c (contents, props changed) stable/10/contrib/ldns/dnssec.c stable/10/contrib/ldns/dnssec_sign.c stable/10/contrib/ldns/dnssec_zone.c stable/10/contrib/ldns/drill/chasetrace.c stable/10/contrib/ldns/drill/configure stable/10/contrib/ldns/drill/configure.ac stable/10/contrib/ldns/drill/drill.1.in stable/10/contrib/ldns/drill/drill.c stable/10/contrib/ldns/drill/drill_util.c stable/10/contrib/ldns/drill/securetrace.c stable/10/contrib/ldns/drill/work.c stable/10/contrib/ldns/error.c stable/10/contrib/ldns/higher.c stable/10/contrib/ldns/host2str.c stable/10/contrib/ldns/host2wire.c stable/10/contrib/ldns/install-sh stable/10/contrib/ldns/keys.c stable/10/contrib/ldns/ldns/common.h stable/10/contrib/ldns/ldns/common.h.in stable/10/contrib/ldns/ldns/config.h stable/10/contrib/ldns/ldns/config.h.in stable/10/contrib/ldns/ldns/dane.h (contents, props changed) stable/10/contrib/ldns/ldns/dnssec.h stable/10/contrib/ldns/ldns/dnssec_sign.h stable/10/contrib/ldns/ldns/dnssec_zone.h stable/10/contrib/ldns/ldns/error.h stable/10/contrib/ldns/ldns/host2str.h stable/10/contrib/ldns/ldns/ldns.h stable/10/contrib/ldns/ldns/net.h stable/10/contrib/ldns/ldns/net.h.in stable/10/contrib/ldns/ldns/packet.h stable/10/contrib/ldns/ldns/rdata.h stable/10/contrib/ldns/ldns/resolver.h stable/10/contrib/ldns/ldns/rr.h stable/10/contrib/ldns/ldns/str2host.h stable/10/contrib/ldns/ldns/util.h stable/10/contrib/ldns/ldns/util.h.in stable/10/contrib/ldns/net.c stable/10/contrib/ldns/packet.c stable/10/contrib/ldns/parse.c stable/10/contrib/ldns/rdata.c stable/10/contrib/ldns/resolver.c stable/10/contrib/ldns/rr.c stable/10/contrib/ldns/sha1.c stable/10/contrib/ldns/sha2.c stable/10/contrib/ldns/str2host.c stable/10/contrib/ldns/tsig.c stable/10/contrib/ldns/util.c stable/10/contrib/ldns/wire2host.c stable/10/contrib/unbound/LICENSE stable/10/contrib/unbound/Makefile.in stable/10/contrib/unbound/acx_nlnetlabs.m4 stable/10/contrib/unbound/compat/snprintf.c stable/10/contrib/unbound/config.h stable/10/contrib/unbound/config.h.in stable/10/contrib/unbound/configure stable/10/contrib/unbound/configure.ac stable/10/contrib/unbound/daemon/acl_list.c stable/10/contrib/unbound/daemon/acl_list.h stable/10/contrib/unbound/daemon/cachedump.c stable/10/contrib/unbound/daemon/cachedump.h stable/10/contrib/unbound/daemon/daemon.c stable/10/contrib/unbound/daemon/daemon.h stable/10/contrib/unbound/daemon/remote.c stable/10/contrib/unbound/daemon/remote.h stable/10/contrib/unbound/daemon/stats.c stable/10/contrib/unbound/daemon/stats.h stable/10/contrib/unbound/daemon/unbound.c stable/10/contrib/unbound/daemon/worker.c stable/10/contrib/unbound/daemon/worker.h stable/10/contrib/unbound/doc/Changelog stable/10/contrib/unbound/doc/FEATURES stable/10/contrib/unbound/doc/LICENSE stable/10/contrib/unbound/doc/README stable/10/contrib/unbound/doc/example.conf.in stable/10/contrib/unbound/doc/libunbound.3 stable/10/contrib/unbound/doc/libunbound.3.in stable/10/contrib/unbound/doc/unbound-anchor.8 stable/10/contrib/unbound/doc/unbound-anchor.8.in stable/10/contrib/unbound/doc/unbound-checkconf.8 stable/10/contrib/unbound/doc/unbound-checkconf.8.in stable/10/contrib/unbound/doc/unbound-control.8 stable/10/contrib/unbound/doc/unbound-control.8.in stable/10/contrib/unbound/doc/unbound-host.1 stable/10/contrib/unbound/doc/unbound.8 stable/10/contrib/unbound/doc/unbound.8.in stable/10/contrib/unbound/doc/unbound.conf.5 stable/10/contrib/unbound/doc/unbound.conf.5.in stable/10/contrib/unbound/freebsd-configure.sh stable/10/contrib/unbound/iterator/iter_delegpt.c stable/10/contrib/unbound/iterator/iter_delegpt.h stable/10/contrib/unbound/iterator/iter_donotq.c stable/10/contrib/unbound/iterator/iter_donotq.h stable/10/contrib/unbound/iterator/iter_fwd.c stable/10/contrib/unbound/iterator/iter_fwd.h stable/10/contrib/unbound/iterator/iter_hints.c stable/10/contrib/unbound/iterator/iter_hints.h stable/10/contrib/unbound/iterator/iter_priv.c stable/10/contrib/unbound/iterator/iter_priv.h stable/10/contrib/unbound/iterator/iter_resptype.c stable/10/contrib/unbound/iterator/iter_resptype.h stable/10/contrib/unbound/iterator/iter_scrub.c stable/10/contrib/unbound/iterator/iter_scrub.h stable/10/contrib/unbound/iterator/iter_utils.c stable/10/contrib/unbound/iterator/iter_utils.h stable/10/contrib/unbound/iterator/iterator.c stable/10/contrib/unbound/iterator/iterator.h stable/10/contrib/unbound/libunbound/context.c stable/10/contrib/unbound/libunbound/context.h stable/10/contrib/unbound/libunbound/libunbound.c stable/10/contrib/unbound/libunbound/libworker.c stable/10/contrib/unbound/libunbound/libworker.h stable/10/contrib/unbound/libunbound/ubsyms.def stable/10/contrib/unbound/libunbound/unbound.h stable/10/contrib/unbound/libunbound/worker.h stable/10/contrib/unbound/services/cache/dns.c stable/10/contrib/unbound/services/cache/dns.h stable/10/contrib/unbound/services/cache/infra.c stable/10/contrib/unbound/services/cache/infra.h stable/10/contrib/unbound/services/cache/rrset.c stable/10/contrib/unbound/services/cache/rrset.h stable/10/contrib/unbound/services/listen_dnsport.c stable/10/contrib/unbound/services/listen_dnsport.h stable/10/contrib/unbound/services/localzone.c stable/10/contrib/unbound/services/localzone.h stable/10/contrib/unbound/services/mesh.c stable/10/contrib/unbound/services/mesh.h stable/10/contrib/unbound/services/modstack.c stable/10/contrib/unbound/services/modstack.h stable/10/contrib/unbound/services/outbound_list.c stable/10/contrib/unbound/services/outbound_list.h stable/10/contrib/unbound/services/outside_network.c stable/10/contrib/unbound/services/outside_network.h stable/10/contrib/unbound/smallapp/unbound-anchor.c stable/10/contrib/unbound/smallapp/unbound-checkconf.c stable/10/contrib/unbound/smallapp/unbound-control-setup.sh stable/10/contrib/unbound/smallapp/unbound-control-setup.sh.in stable/10/contrib/unbound/smallapp/unbound-control.c stable/10/contrib/unbound/smallapp/unbound-host.c stable/10/contrib/unbound/smallapp/worker_cb.c stable/10/contrib/unbound/util/alloc.c stable/10/contrib/unbound/util/alloc.h stable/10/contrib/unbound/util/config_file.c stable/10/contrib/unbound/util/config_file.h stable/10/contrib/unbound/util/configlexer.lex stable/10/contrib/unbound/util/configparser.y stable/10/contrib/unbound/util/data/dname.c stable/10/contrib/unbound/util/data/dname.h stable/10/contrib/unbound/util/data/msgencode.c stable/10/contrib/unbound/util/data/msgencode.h stable/10/contrib/unbound/util/data/msgparse.c stable/10/contrib/unbound/util/data/msgparse.h stable/10/contrib/unbound/util/data/msgreply.c stable/10/contrib/unbound/util/data/msgreply.h stable/10/contrib/unbound/util/data/packed_rrset.c stable/10/contrib/unbound/util/data/packed_rrset.h stable/10/contrib/unbound/util/fptr_wlist.c stable/10/contrib/unbound/util/fptr_wlist.h stable/10/contrib/unbound/util/iana_ports.inc stable/10/contrib/unbound/util/locks.c stable/10/contrib/unbound/util/locks.h stable/10/contrib/unbound/util/log.c stable/10/contrib/unbound/util/log.h stable/10/contrib/unbound/util/mini_event.c stable/10/contrib/unbound/util/mini_event.h stable/10/contrib/unbound/util/module.c stable/10/contrib/unbound/util/module.h stable/10/contrib/unbound/util/net_help.c stable/10/contrib/unbound/util/net_help.h stable/10/contrib/unbound/util/netevent.c stable/10/contrib/unbound/util/netevent.h stable/10/contrib/unbound/util/random.c stable/10/contrib/unbound/util/random.h stable/10/contrib/unbound/util/rbtree.c stable/10/contrib/unbound/util/rbtree.h stable/10/contrib/unbound/util/regional.c stable/10/contrib/unbound/util/regional.h stable/10/contrib/unbound/util/rtt.c stable/10/contrib/unbound/util/rtt.h stable/10/contrib/unbound/util/storage/dnstree.c stable/10/contrib/unbound/util/storage/dnstree.h stable/10/contrib/unbound/util/storage/lookup3.c stable/10/contrib/unbound/util/storage/lookup3.h stable/10/contrib/unbound/util/storage/lruhash.c stable/10/contrib/unbound/util/storage/lruhash.h stable/10/contrib/unbound/util/storage/slabhash.c stable/10/contrib/unbound/util/storage/slabhash.h stable/10/contrib/unbound/util/timehist.c stable/10/contrib/unbound/util/timehist.h stable/10/contrib/unbound/util/tube.c stable/10/contrib/unbound/util/tube.h stable/10/contrib/unbound/util/winsock_event.c stable/10/contrib/unbound/util/winsock_event.h stable/10/contrib/unbound/validator/autotrust.c stable/10/contrib/unbound/validator/autotrust.h stable/10/contrib/unbound/validator/val_anchor.c stable/10/contrib/unbound/validator/val_anchor.h stable/10/contrib/unbound/validator/val_kcache.c stable/10/contrib/unbound/validator/val_kcache.h stable/10/contrib/unbound/validator/val_kentry.c stable/10/contrib/unbound/validator/val_kentry.h stable/10/contrib/unbound/validator/val_neg.c stable/10/contrib/unbound/validator/val_neg.h stable/10/contrib/unbound/validator/val_nsec.c stable/10/contrib/unbound/validator/val_nsec.h stable/10/contrib/unbound/validator/val_nsec3.c stable/10/contrib/unbound/validator/val_nsec3.h stable/10/contrib/unbound/validator/val_secalgo.c stable/10/contrib/unbound/validator/val_secalgo.h stable/10/contrib/unbound/validator/val_sigcrypt.c stable/10/contrib/unbound/validator/val_sigcrypt.h stable/10/contrib/unbound/validator/val_utils.c stable/10/contrib/unbound/validator/val_utils.h stable/10/contrib/unbound/validator/validator.c stable/10/contrib/unbound/validator/validator.h stable/10/etc/mtree/BSD.var.dist stable/10/lib/libldns/Makefile stable/10/lib/libunbound/Makefile stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Directory Properties: stable/10/ (props changed) stable/10/contrib/ldns/drill/drill.1 (props changed) stable/10/contrib/unbound/ldns/keyraw.c (props changed) stable/10/contrib/unbound/ldns/keyraw.h (props changed) stable/10/contrib/unbound/ldns/parse.c (props changed) stable/10/contrib/unbound/ldns/parse.h (props changed) stable/10/contrib/unbound/ldns/parseutil.c (props changed) stable/10/contrib/unbound/ldns/parseutil.h (props changed) stable/10/contrib/unbound/ldns/pkthdr.h (props changed) stable/10/contrib/unbound/ldns/rrdef.c (props changed) stable/10/contrib/unbound/ldns/rrdef.h (props changed) stable/10/contrib/unbound/ldns/sbuffer.c (props changed) stable/10/contrib/unbound/ldns/sbuffer.h (props changed) stable/10/contrib/unbound/ldns/str2wire.c (props changed) stable/10/contrib/unbound/ldns/str2wire.h (props changed) stable/10/contrib/unbound/ldns/wire2str.c (props changed) stable/10/contrib/unbound/ldns/wire2str.h (props changed) Modified: stable/10/contrib/ldns/Changelog ============================================================================== --- stable/10/contrib/ldns/Changelog Tue Jul 29 20:38:08 2014 (r269256) +++ stable/10/contrib/ldns/Changelog Tue Jul 29 20:57:38 2014 (r269257) @@ -1,3 +1,61 @@ +1.6.17 2014-01-10 + * Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a + zone to be an NSEC3 (or its RRSIG) covering an empty non terminal. + * Add --disable-dane option to configure and check availability of the + for dane needed X509_check_ca function in openssl. + * bugfix #490: Get rid of type-punned pointer warnings. + Thanks Adam Tkac. + * Make sure executables are linked against libcrypto with the + LIBSSL_LDFLAGS. Thanks Leo Baltus. + * Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav. + * README now shows preferred way to configure for examples and drill. + * Bind to source address for resolvers. drill binds to source with -I. + Thanks Bryan Duff. + * -T option for ldns-dane that has specific exit status for PKIX + validated connections without (secure) TLSA records. + * Fix b{32,64}_{ntop,pton} detection and handling. + * New RR type TKEY, but without operational practice. + * New RR types HIP, NINFO, RKEY, CDS, EUI48, EUI64, URI, CAA and TA. + * New output format flag (and accompanying functions) to print certain + RR's as unknown type + * -u and -U parameter for ldns-read-zone to mark/unmark a RR type + for printing as unknown type + * bugfix #504: GPOS RR has three rdata fields. Thanks Jelte Jansen. + * bugfix #497: Properly test for EOF when reading key files with drill. + * New functions: ldns_pkt_ixfr_request_new and + ldns_pkt_ixfr_request_new_frm_str. + * Use SNI with ldns-dane + * bugfix #507: ldnsx Fix use of non-existent variables and not + properly referring to instance variable. Patch from shussain. + * bugfix #508: ldnsx Adding NSEC3PARAM to known/allowable RR type + dictionary. Patch from shussain. + * bugfix #517: ldns_resolver_new_frm_fp error when invoked using a NULL + file pointer. + * Fix memory leak in contrib/python: ldns_pkt.new_query. + * Fix buffer overflow in fget_token and bget_token. + * ldns-verify-zone NSEC3 checking from quadratic to linear performance. + Thanks NIC MX (nicmexico.mx) + * ldns-dane setup new ssl session for each new connect to prevent hangs + * bugfix #521: drill trace continue on empty non-terminals with NSEC3 + * bugfix #525: Fix documentation of ldns_resolver_set_retry + * Remove unused LDNS_RDF_TYPE_TSIG and associated functions. + * Fix ldns_nsec_covers_name for zones with an apex only. Thanks Miek. + * Configure option to build perl bindings: --with-p5-dns-ldns + (DNS::LDNS is a contribution from Erik Ostlyngen) + * bugfix #527: Move -lssl before -lcrypto when linking + * Optimize TSIG digest function name comparison (Thanks Marc Buijsman) + * Compare names case insensitive with ldns_pkt_rr_list_by_name and + ldns_pkt_rr_list_by_name_and_type (thanks Johannes Naab) + * A separate --enable for each draft RR type: --enable-rrtype-ninfo, + --enable-rrtype-rkey, --enable-rrtype-cds, --enable-rrtype-uri and + --enable-rrtype-ta + * bugfix #530: Don't sign and verify duplicate RRs (Thanks Jelte Jansen) + * bugfix #505: Manpage and usage output fixes (Thanks Tomas Hozza) + * Adjust ldns_sha1() so that the input data is not modified (Thanks + Marc Buijsman) + * Messages to stderr are now off by default and can be reenabled with + the --enable-stderr-msgs configure option. + 1.6.16 2012-11-13 * Fix Makefile to build pyldns with BSD make * Fix typo in exporting b32_* symbols to make pyldns load again Modified: stable/10/contrib/ldns/Makefile.in ============================================================================== --- stable/10/contrib/ldns/Makefile.in Tue Jul 29 20:38:08 2014 (r269256) +++ stable/10/contrib/ldns/Makefile.in Tue Jul 29 20:57:38 2014 (r269257) @@ -2,7 +2,7 @@ # See the file LICENSE for the license SHELL = @SHELL@ VERSION = @PACKAGE_VERSION@ -version_info = @LIBTOOL_VERSION_INFO@ +version_info = @VERSION_INFO@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -13,8 +13,10 @@ datadir = @datadir@ libdir = @libdir@ includedir = @includedir@ doxygen = @doxygen@ -pywrapdir = ${srcdir}/contrib/python -pyldnsxwrapdir = ${srcdir}/contrib/ldnsx +pywrapdir = $(srcdir)/contrib/python +pyldnsxwrapdir = $(srcdir)/contrib/ldnsx +p5_dns_ldns_dir = $(srcdir)/contrib/DNS-LDNS +PERL = @PERL@ swig = @swig@ swigpy_flags = -python @SWIGPY3@ python_site = @PYTHON_SITE_PKG@ @@ -57,17 +59,19 @@ LINTFLAGS += "-Dsigset_t=long" LINTFLAGS += "-D__uint16_t=uint16_t" -D"__pure2=" -D"__wchar_t=wchar_t" -D"__packed=" -D"__aligned(x)=" # Ubuntu oneiric" LINTFLAGS += -D"__BEGIN_DECLS=" -D"__ssize_t=ssize_t" -D"__intptr_t=intptr_t" -D"__nonnull(x)=" -D"__THROW=" -D"__wur=" -D"__off_t=unsigned" -D"__off64_t=unsigned" -D"__useconds_t=unsigned" -D"__uid_t=unsigned" -D"__gid_t=unsigned" -D"__attribute_deprecated__=" -D"__pid_t=unsigned" -D"__restrict=" -D"__END_DECLS=" -D"__BEGIN_NAMESPACE_STD=" -D"__END_NAMESPACE_STD=" -D"__BEGIN_NAMESPACE_C99=" -D"__END_NAMESPACE_C99=" -D"__socklen_t=unsigned" -D"sa_family_t=unsigned " -D"__mode_t=unsigned" -D"u_int16_t=uint16_t" -D"u_int32_t=uint32_t" -D"u_int8_t=uint8_t" -D"u_short=unsigned short" -D"__u16=uint16_t" -D"__u32=uint32_t" -D"__u64=uint64_t" +# FreeBSD 9 +LINTFLAGS += -D"_RuneLocale=int" DEPFLAG = @DEPFLAG@ INSTALL = $(srcdir)/install-sh LIBLOBJS = $(LIBOBJS:.o=.lo) -LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo +LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo radix.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo LDNS_LOBJS_EX = ^linktest\.c$$ LDNS_ALL_LOBJS = $(LDNS_LOBJS) $(LIBLOBJS) LIB = libldns.la -LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h +LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h radix.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h LDNS_HEADERS_EX = ^config\.h|common\.h|util\.h|net\.h$$ LDNS_HEADERS_GEN= common.h util.h net.h @@ -92,16 +96,14 @@ EX_SSL_LOBJS = examples/ldns-nsec3-hash. COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) COMP_LIB = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \ - $(LIBS) -version-number $(version_info) -no-undefined -LINK_EXE = $(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) \ - $(LIBSSL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) +LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined +LINK_EXE = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIBSSL_LDFLAGS) .PHONY: clean realclean docclean manpages doc lint all lib pyldns test .PHONY: install uninstall install-doc uninstall-doc uninstall-pyldns .PHONY: install-h uninstall-h install-lib uninstall-lib install-pyldns -all: setup-builddir lib linktest manpages @PYLDNS@ @DRILL@ @EXAMPLES@ +all: setup-builddir lib linktest manpages @P5_DNS_LDNS@ @PYLDNS@ @DRILL@ @EXAMPLES@ .SUFFIXES: .c .o .a .lo .h .i @@ -205,7 +207,8 @@ clean-examples: $(LIBTOOL) --mode clean rm -f $(EXAMPLE_LOBJS) linktest: $(srcdir)/linktest.c libldns.la - $(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest + $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $(srcdir)/linktest.c -o linktest.lo + $(LINK_EXE) linktest.lo $(LIBS) $(LIBSSL_LIBS) -lldns -o linktest lib: libldns.la @@ -247,9 +250,29 @@ ldns_wrapper.lo: $(pywrapdir)/ldns_wrapp _ldns.la: ldns_wrapper.lo libldns.la $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ ldns_wrapper.lo -rpath $(python_site) -L. -L.libs -lldns $(LIBS) -install: install-h install-lib @INSTALL_CONFIG@ install-manpages $(pyldns_inst) $(pyldnsx_inst) @INSTALL_DRILL@ @INSTALL_EXAMPLES@ +$(p5_dns_ldns_dir)/Makefile: $(p5_dns_ldns_dir)/Makefile.PL + BUILDDIR=`pwd`; cd $(p5_dns_ldns_dir); $(PERL) Makefile.PL PREFIX="$(prefix)" LIBS="-L$$BUILDDIR/.libs -lldns" INC="-I$$BUILDDIR" -uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@ +$(p5_dns_ldns_dir)/blib/arch/auto/DNS/LDNS/LDNS.so: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) + +p5-dns-ldns: $(p5_dns_ldns_dir)/blib/arch/auto/DNS/LDNS/LDNS.so + +install-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) install + +uninstall-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) uninstall + +clean-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) clean + +test-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) test + +install: install-h install-lib @INSTALL_CONFIG@ install-manpages $(pyldns_inst) $(pyldnsx_inst) @INSTALL_P5_DNS_LDNS@ @INSTALL_DRILL@ @INSTALL_EXAMPLES@ + +uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_P5_DNS_LDNS@ @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@ destclean: uninstall @@ -331,7 +354,7 @@ clean-lib: $(LIBTOOL) --mode clean rm -f $(pywrapdir)/ldns_wrapper.c $(LIBTOOL) --mode clean rm -f $(pywrapdir)/ldns.py -clean: @CLEAN_DRILL@ @CLEAN_EXAMPLES@ clean-manpages clean-lib putdown-builddir +clean: @CLEAN_DRILL@ @CLEAN_EXAMPLES@ @CLEAN_P5_DNS_LDNS@ clean-manpages clean-lib putdown-builddir realclean: clean docclean rm -f config.status @@ -396,7 +419,7 @@ allclean: test-clean clean test-clean: tpkg -b test clean -test: +test: @TEST_P5_DNS_LDNS@ if test -x "`which bash`"; then bash test/test_all.sh; else sh test/test_all.sh; fi @@ -481,56 +504,56 @@ buffer.lo buffer.o: $(srcdir)/buffer.c l $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dane.lo dane.o: $(srcdir)/dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dname.lo dname.o: $(srcdir)/dname.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec.lo dnssec.o: $(srcdir)/dnssec.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_sign.lo dnssec_sign.o: $(srcdir)/dnssec_sign.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_verify.lo dnssec_verify.o: $(srcdir)/dnssec_verify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_zone.lo dnssec_zone.o: $(srcdir)/dnssec_zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ @@ -538,72 +561,74 @@ error.lo error.o: $(srcdir)/error.c ldns $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h higher.lo higher.o: $(srcdir)/higher.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h host2str.lo host2str.o: $(srcdir)/host2str.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h host2wire.lo host2wire.o: $(srcdir)/host2wire.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h keys.lo keys.o: $(srcdir)/keys.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h linktest.lo linktest.o: $(srcdir)/linktest.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h net.lo net.o: $(srcdir)/net.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h packet.lo packet.o: $(srcdir)/packet.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h parse.lo parse.o: $(srcdir)/parse.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +radix.lo radix.o: $(srcdir)/radix.c ldns/config.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/error.h ldns/util.h \ + ldns/common.h rbtree.lo rbtree.o: $(srcdir)/rbtree.c ldns/config.h $(srcdir)/ldns/rbtree.h ldns/util.h ldns/common.h rdata.lo rdata.o: $(srcdir)/rdata.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ @@ -611,40 +636,40 @@ rdata.lo rdata.o: $(srcdir)/rdata.c ldns $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h resolver.lo resolver.o: $(srcdir)/resolver.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h rr.lo rr.o: $(srcdir)/rr.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h rr_functions.lo rr_functions.o: $(srcdir)/rr_functions.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h sha1.lo sha1.o: $(srcdir)/sha1.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h sha2.lo sha2.o: $(srcdir)/sha2.c ldns/config.h $(srcdir)/ldns/sha2.h str2host.lo str2host.o: $(srcdir)/str2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ @@ -652,24 +677,24 @@ str2host.lo str2host.o: $(srcdir)/str2ho $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h tsig.lo tsig.o: $(srcdir)/tsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h update.lo update.o: $(srcdir)/update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h util.lo util.o: $(srcdir)/util.c ldns/config.h $(srcdir)/ldns/rdata.h ldns/common.h $(srcdir)/ldns/error.h \ ldns/util.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/buffer.h wire2host.lo wire2host.o: $(srcdir)/wire2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ @@ -678,18 +703,16 @@ wire2host.lo wire2host.o: $(srcdir)/wire $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h zone.lo zone.o: $(srcdir)/zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h -compat/b32_ntop.lo compat/b32_ntop.o: $(srcdir)/compat/b32_ntop.c ldns/config.h -compat/b32_pton.lo compat/b32_pton.o: $(srcdir)/compat/b32_pton.c ldns/config.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h compat/b64_ntop.lo compat/b64_ntop.o: $(srcdir)/compat/b64_ntop.c ldns/config.h compat/b64_pton.lo compat/b64_pton.o: $(srcdir)/compat/b64_pton.c ldns/config.h compat/calloc.lo compat/calloc.o: $(srcdir)/compat/calloc.c ldns/config.h @@ -715,8 +738,8 @@ examples/ldns-chaos.lo examples/ldns-cha $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-compare-zones.lo examples/ldns-compare-zones.o: $(srcdir)/examples/ldns-compare-zones.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -724,31 +747,31 @@ examples/ldns-compare-zones.lo examples/ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-dane.lo examples/ldns-dane.o: $(srcdir)/examples/ldns-dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldnsd.lo examples/ldnsd.o: $(srcdir)/examples/ldnsd.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-dpa.lo examples/ldns-dpa.o: $(srcdir)/examples/ldns-dpa.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h examples/ldns-gen-zone.lo examples/ldns-gen-zone.o: $(srcdir)/examples/ldns-gen-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -756,15 +779,15 @@ examples/ldns-gen-zone.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-key2ds.lo examples/ldns-key2ds.o: $(srcdir)/examples/ldns-key2ds.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-keyfetcher.lo examples/ldns-keyfetcher.o: $(srcdir)/examples/ldns-keyfetcher.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -772,31 +795,31 @@ examples/ldns-keyfetcher.lo examples/ldn $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-keygen.lo examples/ldns-keygen.o: $(srcdir)/examples/ldns-keygen.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-mx.lo examples/ldns-mx.o: $(srcdir)/examples/ldns-mx.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-notify.lo examples/ldns-notify.o: $(srcdir)/examples/ldns-notify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-nsec3-hash.lo examples/ldns-nsec3-hash.o: $(srcdir)/examples/ldns-nsec3-hash.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -804,7 +827,7 @@ examples/ldns-nsec3-hash.lo examples/ldn $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-read-zone.lo examples/ldns-read-zone.o: $(srcdir)/examples/ldns-read-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -812,7 +835,7 @@ examples/ldns-read-zone.lo examples/ldns $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-resolver.lo examples/ldns-resolver.o: $(srcdir)/examples/ldns-resolver.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -820,23 +843,23 @@ examples/ldns-resolver.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-revoke.lo examples/ldns-revoke.o: $(srcdir)/examples/ldns-revoke.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-rrsig.lo examples/ldns-rrsig.o: $(srcdir)/examples/ldns-rrsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-signzone.lo examples/ldns-signzone.o: $(srcdir)/examples/ldns-signzone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -844,7 +867,7 @@ examples/ldns-signzone.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-test-edns.lo examples/ldns-test-edns.o: $(srcdir)/examples/ldns-test-edns.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -852,15 +875,15 @@ examples/ldns-test-edns.lo examples/ldns $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-testns.lo examples/ldns-testns.o: $(srcdir)/examples/ldns-testns.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h examples/ldns-testpkts.lo examples/ldns-testpkts.o: $(srcdir)/examples/ldns-testpkts.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -868,15 +891,16 @@ examples/ldns-testpkts.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h \ + $(srcdir)/examples/ldns-testpkts.h examples/ldns-update.lo examples/ldns-update.o: $(srcdir)/examples/ldns-update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-verify-zone.lo examples/ldns-verify-zone.o: $(srcdir)/examples/ldns-verify-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -884,39 +908,39 @@ examples/ldns-verify-zone.lo examples/ld $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-version.lo examples/ldns-version.o: $(srcdir)/examples/ldns-version.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-walk.lo examples/ldns-walk.o: $(srcdir)/examples/ldns-walk.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-zcat.lo examples/ldns-zcat.o: $(srcdir)/examples/ldns-zcat.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-zsplit.lo examples/ldns-zsplit.o: $(srcdir)/examples/ldns-zsplit.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/drill/chasetrace.c $(srcdir)/drill/drill.h ldns/config.h \ $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ @@ -924,8 +948,8 @@ drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/dnssec.lo drill/dnssec.o: $(srcdir)/drill/dnssec.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -933,7 +957,7 @@ drill/dnssec.lo drill/dnssec.o: $(srcdir $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/drill.lo drill/drill.o: $(srcdir)/drill/drill.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -941,7 +965,7 @@ drill/drill.lo drill/drill.o: $(srcdir)/ $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/drill_util.lo drill/drill_util.o: $(srcdir)/drill/drill_util.c $(srcdir)/drill/drill.h ldns/config.h \ $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ @@ -949,8 +973,8 @@ drill/drill_util.lo drill/drill_util.o: $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/error.lo drill/error.o: $(srcdir)/drill/error.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -958,7 +982,7 @@ drill/error.lo drill/error.o: $(srcdir)/ $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/root.lo drill/root.o: $(srcdir)/drill/root.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -966,7 +990,7 @@ drill/root.lo drill/root.o: $(srcdir)/dr $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/securetrace.lo drill/securetrace.o: $(srcdir)/drill/securetrace.c $(srcdir)/drill/drill.h ldns/config.h \ $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ @@ -974,8 +998,8 @@ drill/securetrace.lo drill/securetrace.o $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/work.lo drill/work.o: $(srcdir)/drill/work.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -983,7 +1007,7 @@ drill/work.lo drill/work.o: $(srcdir)/dr $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-chaos: examples/ldns-chaos.lo examples/ldns-chaos.o $(LIB) examples/ldns-compare-zones: examples/ldns-compare-zones.lo examples/ldns-compare-zones.o $(LIB) examples/ldnsd: examples/ldnsd.lo examples/ldnsd.o $(LIB) Modified: stable/10/contrib/ldns/README ============================================================================== --- stable/10/contrib/ldns/README Tue Jul 29 20:38:08 2014 (r269256) +++ stable/10/contrib/ldns/README Tue Jul 29 20:57:38 2014 (r269257) @@ -37,11 +37,11 @@ INSTALLATION 5. make install -* Building from subversion repository +* Building from repository If you are building from the repository you will need to have (gnu) autotools like libtool and autoreconf installed. A list of all the commands -needed to build everything can be found in README.svn. Note that the actual +needed to build everything can be found in README.git. Note that the actual commands may be a little bit different on your machine. Most notable, you'll need to run libtoolize (or glibtoolize), if you skip this step, you'll get an error about missing config.sub. * Developers Copied: stable/10/contrib/ldns/README.git (from r266114, head/contrib/ldns/README.git) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/ldns/README.git Tue Jul 29 20:57:38 2014 (r269257, copy of r266114, head/contrib/ldns/README.git) @@ -0,0 +1,22 @@ +# The ldns git repository can found at: +# git.nlnetlabs.nl/ldns/ + +# small list of commands to build all on a linux system +# libtoolize is needed for most other targets + +# on Solaris, and other systems that may not have +# the default 'automake' and 'aclocal' script aliases, +# the correct versions may need to be set. On those +# systems, the 'autoreconf' line should be changed to: +# AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 autoreconf + +# older versions of libtoolize do not support --install +# so you might need to remove that (with newer versions +# it is needed) +libtoolize -c --install +autoreconf --install +./configure --with-examples --with-drill # --with-pyldns --with-p5-dns-ldns +make +make doc # needs doxygen for the html pages +(cd pcat && autoreconf && ./configure && make) +(cd examples/nsd-test && autoreconf && ./configure && make) Modified: stable/10/contrib/ldns/acx_nlnetlabs.m4 ============================================================================== --- stable/10/contrib/ldns/acx_nlnetlabs.m4 Tue Jul 29 20:38:08 2014 (r269256) +++ stable/10/contrib/ldns/acx_nlnetlabs.m4 Tue Jul 29 20:57:38 2014 (r269257) @@ -2,7 +2,12 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 21 +# Version 26 +# 2013-09-19 FLTO help text improved. +# 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes +# 2013-06-25 FLTO has --disable-flto option. +# 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it. +# 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers. # 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h. # 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns. # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc. @@ -17,7 +22,7 @@ # 2010-07-02 Add check for ss_family (for minix). # 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS. # 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end. -# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl +# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl # 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN # 2010-01-20 added AHX_COONFIG_STRLCAT # 2009-07-14 U_CHAR detection improved for windows crosscompile. @@ -101,7 +106,7 @@ dnl Calculate comma separated windows-re dnl Picks the first three(,0) or four numbers out of the name. dnl $1: variable for the result AC_DEFUN([ACX_RSRC_VERSION], -[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*$/\1,\2,\3,0/' `] +[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1,\2,\3,0/' `] ]) dnl Routine to help check for compiler flags. @@ -116,7 +121,7 @@ AC_MSG_CHECKING(whether $CC supports -$1 cache=`echo $1 | sed 'y%.=/+-%___p_%'` AC_CACHE_VAL(cv_prog_cc_flag_$cache, [ -echo 'void f(){}' >conftest.c +echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -$1 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else @@ -405,19 +410,22 @@ int test() { dnl Check if CC supports -flto. dnl in a way that supports clang and suncc (that flag does something else, dnl but fails to link). It sets it in CFLAGS if it works. -AC_DEFUN([ACX_CHECK_FLTO], -[AC_MSG_CHECKING([if $CC supports -flto]) -BAKCFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -flto" -AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ - if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then - CFLAGS="$BAKCFLAGS" - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - fi - rm -f conftest conftest.c conftest.o -], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)]) +AC_DEFUN([ACX_CHECK_FLTO], [ + AC_ARG_ENABLE([flto], AS_HELP_STRING([--disable-flto], [Disable link-time optimization (gcc specific option)])) + AS_IF([test "x$enable_flto" != "xno"], [ + AC_MSG_CHECKING([if $CC supports -flto]) + BAKCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -flto" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ + if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then + CFLAGS="$BAKCFLAGS" + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + fi + rm -f conftest conftest.c conftest.o + ], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)]) + ]) ]) dnl Check the printf-format attribute (if any) @@ -1208,7 +1216,7 @@ struct tm *gmtime_r(const time_t *timep, dnl provide w32 compat definition for sleep AC_DEFUN([AHX_CONFIG_W32_SLEEP], [ -#ifndef HAVE_SLEEP +#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H) #define sleep(x) Sleep((x)*1000) /* on win32 */ #endif /* HAVE_SLEEP */ ]) Modified: stable/10/contrib/ldns/ax_python_devel.m4 ============================================================================== --- stable/10/contrib/ldns/ax_python_devel.m4 Tue Jul 29 20:38:08 2014 (r269256) +++ stable/10/contrib/ldns/ax_python_devel.m4 Tue Jul 29 20:57:38 2014 (r269257) @@ -34,11 +34,12 @@ # LICENSE # # Copyright (c) 2009 Sebastian Huber -# Copyright (c) 2009 Alan W. Irwin +# Copyright (c) 2009 Alan W. Irwin # Copyright (c) 2009 Rafael Laboissiere -# Copyright (c) 2009 Andrew Collier +# Copyright (c) 2009 Andrew Collier # Copyright (c) 2009 Matteo Settenvini # Copyright (c) 2009 Horst Knorr +# Copyright (c) 2013 Daniel Mullner # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -66,7 +67,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 8 +#serial 16 AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) AC_DEFUN([AX_PYTHON_DEVEL],[ @@ -153,8 +154,14 @@ $ac_distutils_result]) if test -z "$PYTHON_CPPFLAGS"; then python_path=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_inc ());"` + plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc (plat_specific=1));"` if test -n "${python_path}"; then - python_path="-I$python_path" + if test "${plat_python_path}" != "${python_path}"; then + python_path="-I$python_path -I$plat_python_path" + else + python_path="-I$python_path" + fi fi PYTHON_CPPFLAGS=$python_path fi @@ -173,13 +180,10 @@ $ac_distutils_result]) # join all versioning strings, on some systems # major/minor numbers could be in different list elements from distutils.sysconfig import * -ret = '' -for e in get_config_vars ('VERSION'): - if (e != None): - ret += e -print (ret) -EOD -` +e = get_config_var('VERSION') +if e is not None: + print(e) +EOD` if test -z "$ac_python_version"; then if test -n "$PYTHON_VERSION"; then @@ -199,34 +203,27 @@ EOD # There should be only one import distutils.sysconfig -for e in distutils.sysconfig.get_config_vars ('LIBDIR'): - if e != None: - print (e) - break -EOD -` - - # Before checking for libpythonX.Y, we need to know - # the extension the OS we're on uses for libraries - # (we take the first one, if there's more than one fix me!): - ac_python_soext=`$PYTHON -c \ - "import distutils.sysconfig; \ - print (distutils.sysconfig.get_config_vars('SO')[[0]])"` +e = distutils.sysconfig.get_config_var('LIBDIR') +if e is not None: + print (e) +EOD` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 21:05:52 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F33E81A9; Tue, 29 Jul 2014 21: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 E047225A4; Tue, 29 Jul 2014 21: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 s6TL5pX2055553; Tue, 29 Jul 2014 21:05:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TL5pT4055552; Tue, 29 Jul 2014 21:05:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201407292105.s6TL5pT4055552@svn.freebsd.org> From: Rick Macklem Date: Tue, 29 Jul 2014 21:05: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: r269258 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 21:05:52 -0000 Author: rmacklem Date: Tue Jul 29 21:05:51 2014 New Revision: 269258 URL: http://svnweb.freebsd.org/changeset/base/269258 Log: MFC: r268726 Move the "retry:" label so that the calls to m_pullup() are not done after the call to m_defrag(). This fixes a problem where m_pullup() would prepend an mbuf to the list created by m_defrag() making the chain greater than 32 again. Modified: stable/10/sys/dev/e1000/if_em.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Tue Jul 29 20:57:38 2014 (r269257) +++ stable/10/sys/dev/e1000/if_em.c Tue Jul 29 21:05:51 2014 (r269258) @@ -1830,7 +1830,6 @@ em_xmit(struct tx_ring *txr, struct mbuf int nsegs, i, j, first, last = 0; int error, do_tso, tso_desc = 0, remap = 1; -retry: m_head = *m_headp; txd_upper = txd_lower = txd_used = txd_saved = 0; do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); @@ -1956,6 +1955,7 @@ retry: tx_buffer_mapped = tx_buffer; map = tx_buffer->map; +retry: error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 21:15:26 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9D87769; Tue, 29 Jul 2014 21:15: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 C51B32687; Tue, 29 Jul 2014 21:15: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 s6TLFQjx063307; Tue, 29 Jul 2014 21:15:26 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TLFQaT063306; Tue, 29 Jul 2014 21:15:26 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407292115.s6TLFQaT063306@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 21:15: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: r269260 - stable/10/lib/libc/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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 21:15:26 -0000 Author: markj Date: Tue Jul 29 21:15:26 2014 New Revision: 269260 URL: http://svnweb.freebsd.org/changeset/base/269260 Log: MFC r268446: Fix a typo. Modified: stable/10/lib/libc/sys/procctl.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/procctl.2 ============================================================================== --- stable/10/lib/libc/sys/procctl.2 Tue Jul 29 21:15:24 2014 (r269259) +++ stable/10/lib/libc/sys/procctl.2 Tue Jul 29 21:15:26 2014 (r269260) @@ -50,7 +50,7 @@ If multiple processes match the identifi .Nm will make a .Dq best effort -to control as many of the selected possibles as possible. +to control as many of the selected processes as possible. An error is only returned if no selected processes successfully complete the request. The following identifier types are supported: From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 21:21:18 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4730EF8; Tue, 29 Jul 2014 21:21: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 0D281274F; Tue, 29 Jul 2014 21:21: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 s6TLLG7u065829; Tue, 29 Jul 2014 21:21:16 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TLLGli065827; Tue, 29 Jul 2014 21:21:16 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407292121.s6TLLGli065827@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 21:21:16 +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: r269263 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 21:21:18 -0000 Author: markj Date: Tue Jul 29 21:21:16 2014 New Revision: 269263 URL: http://svnweb.freebsd.org/changeset/base/269263 Log: MFC r264486: Use the correct format specifiers for wide characters and strings of wide characters. Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue Jul 29 21:21:15 2014 (r269262) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue Jul 29 21:21:16 2014 (r269263) @@ -694,8 +694,13 @@ static const dt_pfconv_t _dtrace_convers { "S", "s", pfproto_cstr, pfcheck_str, pfprint_estr }, { "T", "s", "int64_t", pfcheck_time, pfprint_time822 }, { "u", "u", pfproto_xint, pfcheck_xint, pfprint_uint }, +#if defined(sun) { "wc", "wc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wchar_t */ { "ws", "ws", pfproto_wstr, pfcheck_wstr, pfprint_wstr }, +#else +{ "wc", "lc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wchar_t */ +{ "ws", "ls", pfproto_wstr, pfcheck_wstr, pfprint_wstr }, +#endif { "x", "x", pfproto_xint, pfcheck_xint, pfprint_uint }, { "X", "X", pfproto_xint, pfcheck_xint, pfprint_uint }, { "Y", "s", "int64_t", pfcheck_time, pfprint_time }, From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 21:59:25 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E04CF7D7; Tue, 29 Jul 2014 21:59: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 B35A32AD4; Tue, 29 Jul 2014 21:59: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 s6TLxPOk086971; Tue, 29 Jul 2014 21:59:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TLxO7h086966; Tue, 29 Jul 2014 21:59:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407292159.s6TLxO7h086966@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 29 Jul 2014 21:59: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: r269266 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 21:59:26 -0000 Author: hselasky Date: Tue Jul 29 21:59:24 2014 New Revision: 269266 URL: http://svnweb.freebsd.org/changeset/base/269266 Log: MFC r269127: Fix for division by zero. Modified: stable/10/sys/dev/usb/wlan/if_rum.c stable/10/sys/dev/usb/wlan/if_ural.c stable/10/sys/dev/usb/wlan/if_zyd.c stable/10/sys/dev/usb/wlan/if_zydreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rum.c Tue Jul 29 21:38:06 2014 (r269265) +++ stable/10/sys/dev/usb/wlan/if_rum.c Tue Jul 29 21:59:24 2014 (r269266) @@ -1034,6 +1034,8 @@ rum_setup_tx_desc(struct rum_softc *sc, desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { + if (rate == 0) + rate = 2; /* avoid division by zero */ plcp_length = (16 * len + rate - 1) / rate; if (rate == 22) { remainder = (16 * len) % 22; Modified: stable/10/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_ural.c Tue Jul 29 21:38:06 2014 (r269265) +++ stable/10/sys/dev/usb/wlan/if_ural.c Tue Jul 29 21:59:24 2014 (r269266) @@ -1037,6 +1037,8 @@ ural_setup_tx_desc(struct ural_softc *sc desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { + if (rate == 0) + rate = 2; /* avoid division by zero */ plcp_length = (16 * len + rate - 1) / rate; if (rate == 22) { remainder = (16 * len) % 22; Modified: stable/10/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_zyd.c Tue Jul 29 21:38:06 2014 (r269265) +++ stable/10/sys/dev/usb/wlan/if_zyd.c Tue Jul 29 21:59:24 2014 (r269266) @@ -2479,7 +2479,7 @@ zyd_tx_start(struct zyd_softc *sc, struc const struct ieee80211_txparam *tp; struct ieee80211_key *k; int rate, totlen; - static uint8_t ratediv[] = ZYD_TX_RATEDIV; + static const uint8_t ratediv[] = ZYD_TX_RATEDIV; uint8_t phy; uint16_t pktlen; uint32_t bits; Modified: stable/10/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- stable/10/sys/dev/usb/wlan/if_zydreg.h Tue Jul 29 21:38:06 2014 (r269265) +++ stable/10/sys/dev/usb/wlan/if_zydreg.h Tue Jul 29 21:59:24 2014 (r269266) @@ -970,7 +970,7 @@ #define ZYD_TX_RATEDIV \ { \ - 0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6, \ + 0x1, 0x2, 0xb, 0xb, 0x1, 0x1, 0x1, 0x1, 0x30, 0x18, 0xc, 0x6, \ 0x36, 0x24, 0x12, 0x9 \ } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 22:05:34 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C4B6E25; Tue, 29 Jul 2014 22:05: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 88DF92BA1; Tue, 29 Jul 2014 22:05: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 s6TM5YZ4091511; Tue, 29 Jul 2014 22:05:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TM5YO5091508; Tue, 29 Jul 2014 22:05:34 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407292205.s6TM5YO5091508@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 29 Jul 2014 22:05:34 +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: r269270 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 22:05:34 -0000 Author: hselasky Date: Tue Jul 29 22:05:33 2014 New Revision: 269270 URL: http://svnweb.freebsd.org/changeset/base/269270 Log: MFC r268929: Add new device ID. PR: 191959 Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Tue Jul 29 22:04:06 2014 (r269269) +++ stable/10/sys/dev/usb/serial/u3g.c Tue Jul 29 22:05:33 2014 (r269270) @@ -343,6 +343,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, EU870D, 0), U3G_DEV(NOVATEL, MC760, 0), U3G_DEV(NOVATEL, MC547, 0), + U3G_DEV(NOVATEL, MC679, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Tue Jul 29 22:04:06 2014 (r269269) +++ stable/10/sys/dev/usb/usbdevs Tue Jul 29 22:05:33 2014 (r269270) @@ -3238,6 +3238,7 @@ product NOVATEL U727_2 0x5100 Merlin U7 product NOVATEL U760 0x6000 Novatel U760 product NOVATEL MC760 0x6002 Novatel MC760 product NOVATEL MC547 0x7042 Novatel MC547 +product NOVATEL MC679 0x7031 Novatel MC679 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 22:26:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EF21588; Tue, 29 Jul 2014 22:26: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 1C3162EFB; Tue, 29 Jul 2014 22:26: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 s6TMQfbn001468; Tue, 29 Jul 2014 22:26:41 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TMQfv0001467; Tue, 29 Jul 2014 22:26:41 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407292226.s6TMQfv0001467@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 22:26: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: r269272 - stable/10/sys/cddl/dev/systrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 22:26:42 -0000 Author: markj Date: Tue Jul 29 22:26:41 2014 New Revision: 269272 URL: http://svnweb.freebsd.org/changeset/base/269272 Log: MFC r264435: Ensure that all eight syscall arguments are available to dtrace_probe(), rather than just the first five. Modified: stable/10/sys/cddl/dev/systrace/systrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/systrace/systrace.c ============================================================================== --- stable/10/sys/cddl/dev/systrace/systrace.c Tue Jul 29 22:07:52 2014 (r269271) +++ stable/10/sys/cddl/dev/systrace/systrace.c Tue Jul 29 22:26:41 2014 (r269272) @@ -168,6 +168,9 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; +typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + #if !defined(LINUX_SYSTRACE) /* * Probe callback function. @@ -180,6 +183,7 @@ static void systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, int ret) { + systrace_dtrace_probe_t probe; int n_args = 0; u_int64_t uargs[8]; @@ -211,7 +215,9 @@ systrace_probe(u_int32_t id, int sysnum, } /* Process the probe using the converted argments. */ - dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); + probe = (systrace_dtrace_probe_t)dtrace_probe; + probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], uargs[5], + uargs[6], uargs[7]); } #endif From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 29 22:29:31 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C162A7FC; Tue, 29 Jul 2014 22:29: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 AE87A2F09; Tue, 29 Jul 2014 22:29: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 s6TMTVe5001965; Tue, 29 Jul 2014 22:29:31 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TMTVkY001964; Tue, 29 Jul 2014 22:29:31 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407292229.s6TMTVkY001964@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Jul 2014 22:29:31 +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: r269274 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 22:29:31 -0000 Author: markj Date: Tue Jul 29 22:29:31 2014 New Revision: 269274 URL: http://svnweb.freebsd.org/changeset/base/269274 Log: MFC r265276: Fix a typo. Modified: stable/10/lib/libutil/kinfo_getfile.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/kinfo_getfile.3 ============================================================================== --- stable/10/lib/libutil/kinfo_getfile.3 Tue Jul 29 22:26:42 2014 (r269273) +++ stable/10/lib/libutil/kinfo_getfile.3 Tue Jul 29 22:29:31 2014 (r269274) @@ -48,7 +48,7 @@ field contains the process identifier. This should be the a process that you have privilege to access. The .Ar cntp -field is allows the caller to know how many records are returned. +field allows the caller to know how many records are returned. .Pp This function is a wrapper around .Xr sysctl 3 From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 03:56:19 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6A4FDFE; Wed, 30 Jul 2014 03:56:19 +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 C75AD2048; Wed, 30 Jul 2014 03:56: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 s6U3uJwa059495; Wed, 30 Jul 2014 03:56:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U3uISV059484; Wed, 30 Jul 2014 03:56:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407300356.s6U3uISV059484@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jul 2014 03:56:18 +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: r269283 - in stable/10/sys: fs/ext2fs fs/nandfs fs/nfsclient fs/nullfs fs/tmpfs kern ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 03:56:20 -0000 Author: kib Date: Wed Jul 30 03:56:17 2014 New Revision: 269283 URL: http://svnweb.freebsd.org/changeset/base/269283 Log: MFC r268764: Check for the cross-device cross-link attempt in the VFS, instead of VOP_LINK() implemenations. Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c stable/10/sys/fs/nandfs/nandfs_vnops.c stable/10/sys/fs/nfsclient/nfs_clvnops.c stable/10/sys/fs/nullfs/null_vnops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c stable/10/sys/kern/vfs_syscalls.c stable/10/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Wed Jul 30 03:56:17 2014 (r269283) @@ -666,10 +666,6 @@ ext2_link(struct vop_link_args *ap) if ((cnp->cn_flags & HASBUF) == 0) panic("ext2_link: no name"); #endif - if (tdvp->v_mount != vp->v_mount) { - error = EXDEV; - goto out; - } ip = VTOI(vp); if ((nlink_t)ip->i_nlink >= EXT2_LINK_MAX) { error = EMLINK; Modified: stable/10/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/10/sys/fs/nandfs/nandfs_vnops.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/fs/nandfs/nandfs_vnops.c Wed Jul 30 03:56:17 2014 (r269283) @@ -1355,9 +1355,6 @@ nandfs_link(struct vop_link_args *ap) struct nandfs_inode *inode = &node->nn_inode; int error; - if (tdvp->v_mount != vp->v_mount) - return (EXDEV); - if (inode->i_links_count >= LINK_MAX) return (EMLINK); Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 30 03:56:17 2014 (r269283) @@ -1977,10 +1977,6 @@ nfs_link(struct vop_link_args *ap) struct nfsvattr nfsva, dnfsva; int error = 0, attrflag, dattrflag; - if (vp->v_mount != tdvp->v_mount) { - return (EXDEV); - } - /* * Push all writes to the server, so that the attribute cache * doesn't get "out of sync" with the server. Modified: stable/10/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/10/sys/fs/nullfs/null_vnops.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/fs/nullfs/null_vnops.c Wed Jul 30 03:56:17 2014 (r269283) @@ -858,15 +858,6 @@ null_vptocnp(struct vop_vptocnp_args *ap return (error); } -static int -null_link(struct vop_link_args *ap) -{ - - if (ap->a_tdvp->v_mount != ap->a_vp->v_mount) - return (EXDEV); - return (null_bypass((struct vop_generic_args *)ap)); -} - /* * Global vfs data structures */ @@ -880,7 +871,6 @@ struct vop_vector null_vnodeops = { .vop_getwritemount = null_getwritemount, .vop_inactive = null_inactive, .vop_islocked = vop_stdislocked, - .vop_link = null_link, .vop_lock1 = null_lock, .vop_lookup = null_lookup, .vop_open = null_open, Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Wed Jul 30 03:56:17 2014 (r269283) @@ -573,21 +573,6 @@ tmpfs_link(struct vop_link_args *v) MPASS(VOP_ISLOCKED(dvp)); MPASS(cnp->cn_flags & HASBUF); MPASS(dvp != vp); /* XXX When can this be false? */ - - /* XXX: Why aren't the following two tests done by the caller? */ - - /* Hard links of directories are forbidden. */ - if (vp->v_type == VDIR) { - error = EPERM; - goto out; - } - - /* Cannot create cross-device links. */ - if (dvp->v_mount != vp->v_mount) { - error = EXDEV; - goto out; - } - node = VP_TO_TMPFS_NODE(vp); /* Ensure that we do not overflow the maximum number of links imposed Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/kern/vfs_syscalls.c Wed Jul 30 03:56:17 2014 (r269283) @@ -1579,7 +1579,15 @@ again: vrele(nd.ni_vp); error = EEXIST; } else if ((error = vn_lock(vp, LK_EXCLUSIVE)) == 0) { - error = can_hardlink(vp, td->td_ucred); + /* + * Check for cross-device links. No need to + * recheck vp->v_type, since it cannot change + * for non-doomed vnode. + */ + if (nd.ni_dvp->v_mount != vp->v_mount) + error = EXDEV; + else + error = can_hardlink(vp, td->td_ucred); if (error == 0) #ifdef MAC error = mac_vnode_check_link(td->td_ucred, Modified: stable/10/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_vnops.c Wed Jul 30 00:28:29 2014 (r269282) +++ stable/10/sys/ufs/ufs/ufs_vnops.c Wed Jul 30 03:56:17 2014 (r269283) @@ -968,10 +968,6 @@ ufs_link(ap) if ((cnp->cn_flags & HASBUF) == 0) panic("ufs_link: no name"); #endif - if (tdvp->v_mount != vp->v_mount) { - error = EXDEV; - goto out; - } if (VTOI(tdvp)->i_effnlink < 2) panic("ufs_link: Bad link count %d on parent", VTOI(tdvp)->i_effnlink); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 03:58:30 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43EA5C0; Wed, 30 Jul 2014 03:58: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 30FC42058; Wed, 30 Jul 2014 03:58: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 s6U3wUBe061165; Wed, 30 Jul 2014 03:58:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U3wUAh061164; Wed, 30 Jul 2014 03:58:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407300358.s6U3wUAh061164@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jul 2014 03:58:30 +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: r269284 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 03:58:30 -0000 Author: kib Date: Wed Jul 30 03:58:29 2014 New Revision: 269284 URL: http://svnweb.freebsd.org/changeset/base/269284 Log: MFC r268765: Remove unused header. Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Wed Jul 30 03:56:17 2014 (r269283) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Wed Jul 30 03:58:29 2014 (r269284) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 04:00:24 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09A8A207; Wed, 30 Jul 2014 04:00: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 EAC1D206A; Wed, 30 Jul 2014 04: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 s6U40Nhu061662; Wed, 30 Jul 2014 04:00:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U40NPW061661; Wed, 30 Jul 2014 04:00:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407300400.s6U40NPW061661@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jul 2014 04:00:23 +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: r269285 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 04:00:24 -0000 Author: kib Date: Wed Jul 30 04:00:23 2014 New Revision: 269285 URL: http://svnweb.freebsd.org/changeset/base/269285 Log: MFC r269159: Correct the locking statement. MFC r269161: Explicitely mention that inactivated or reclaimed vnode is locked exclusively. Modified: stable/10/share/man/man9/VOP_INACTIVE.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/VOP_INACTIVE.9 ============================================================================== --- stable/10/share/man/man9/VOP_INACTIVE.9 Wed Jul 30 03:58:29 2014 (r269284) +++ stable/10/share/man/man9/VOP_INACTIVE.9 Wed Jul 30 04:00:23 2014 (r269285) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd July 27, 2014 .Dt VOP_INACTIVE 9 .Os .Sh NAME @@ -63,17 +63,14 @@ is called when a vnode is being reused f Any file system specific resources associated with the vnode should be freed. .Sh LOCKS -For VOP_INACTIVE, the -.Fa vp -will be locked on entry. -Your VOP_INACTIVE code -must unlock the -.Fa vp -prior to returning. -.Pp -For VOP_RECLAIM, the +For both +.Fn VOP_INACTIVE +and +.Fn VOP_RECLAIM , +the .Fa vp -will not be locked on entry and should be left unlocked on return. +will be exclusively locked on entry, and must be left exclusively +locked on return. .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 04:04:00 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55AA0361; Wed, 30 Jul 2014 04:04: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 28A2420F8; Wed, 30 Jul 2014 04:04: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 s6U440Yx065378; Wed, 30 Jul 2014 04:04:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U43xhU065372; Wed, 30 Jul 2014 04:03:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407300403.s6U43xhU065372@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jul 2014 04:03:59 +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: r269286 - in stable/10: . share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 04:04:00 -0000 Author: kib Date: Wed Jul 30 04:03:59 2014 New Revision: 269286 URL: http://svnweb.freebsd.org/changeset/base/269286 Log: MFC r269160: Remove man page for non-existent VOPs. MFC r269240 (by pluknet): Add VOP_GETVOBJECT.9 to obsolete files, un-xref. Deleted: stable/10/share/man/man9/VOP_GETVOBJECT.9 Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man9/Makefile stable/10/share/man/man9/vnode.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Jul 30 04:00:23 2014 (r269285) +++ stable/10/ObsoleteFiles.inc Wed Jul 30 04:03:59 2014 (r269286) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20140728: Remove an obsolete man page +OLD_FILES+=usr/share/man/man9/VOP_GETVOBJECT.9.gz +OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz +OLD_FILES+=usr/share/man/man9/VOP_DESTROYVOBJECT.9.gz # 20140614: send-pr removal OLD_FILES+=usr/share/man/man1/send-pr.1.gz OLD_FILES+=etc/gnats/freefall Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Wed Jul 30 04:00:23 2014 (r269285) +++ stable/10/share/man/man9/Makefile Wed Jul 30 04:03:59 2014 (r269286) @@ -355,7 +355,6 @@ MAN= accept_filter.9 \ VOP_GETACL.9 \ VOP_GETEXTATTR.9 \ VOP_GETPAGES.9 \ - VOP_GETVOBJECT.9 \ VOP_INACTIVE.9 \ VOP_IOCTL.9 \ VOP_LINK.9 \ @@ -1517,8 +1516,6 @@ MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \ VOP_CREATE.9 VOP_MKNOD.9 \ VOP_CREATE.9 VOP_SYMLINK.9 MLINKS+=VOP_GETPAGES.9 VOP_PUTPAGES.9 -MLINKS+=VOP_GETVOBJECT.9 VOP_CREATEVOBJECT.9 \ - VOP_GETVOBJECT.9 VOP_DESTROYVOBJECT.9 MLINKS+=VOP_INACTIVE.9 VOP_RECLAIM.9 MLINKS+=VOP_LOCK.9 vn_lock.9 \ VOP_LOCK.9 VOP_ISLOCKED.9 \ Modified: stable/10/share/man/man9/vnode.9 ============================================================================== --- stable/10/share/man/man9/vnode.9 Wed Jul 30 04:00:23 2014 (r269285) +++ stable/10/share/man/man9/vnode.9 Wed Jul 30 04:03:59 2014 (r269286) @@ -170,7 +170,6 @@ intertwining of VM Objects and Vnodes. .Xr VOP_GETACL 9 , .Xr VOP_GETEXTATTR 9 , .Xr VOP_GETPAGES 9 , -.Xr VOP_GETVOBJECT 9 , .Xr VOP_INACTIVE 9 , .Xr VOP_IOCTL 9 , .Xr VOP_LINK 9 , From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 07:09:00 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA6EC71D; Wed, 30 Jul 2014 07:08: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 BAF192461; Wed, 30 Jul 2014 07:08: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 s6U78xek049032; Wed, 30 Jul 2014 07:08:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U78x65049031; Wed, 30 Jul 2014 07:08:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407300708.s6U78x65049031@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Jul 2014 07:08:59 +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: r269294 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 07:09:00 -0000 Author: mav Date: Wed Jul 30 07:08:59 2014 New Revision: 269294 URL: http://svnweb.freebsd.org/changeset/base/269294 Log: MFC r269149: Fix several cases of NULL dereference when INQUIRY sent to absent LUN. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 30 04:48:56 2014 (r269293) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:08:59 2014 (r269294) @@ -10041,7 +10041,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_map_lun_back(port->targ_port, lun->lun) >= + if (lun != NULL && + ctl_map_lun_back(port->targ_port, lun->lun) >= CTL_MAX_LUNS) continue; num_target_ports++; @@ -10095,7 +10096,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_map_lun_back(port->targ_port, lun->lun) >= + if (lun != NULL && + ctl_map_lun_back(port->targ_port, lun->lun) >= CTL_MAX_LUNS) continue; p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; @@ -10135,7 +10137,6 @@ ctl_inquiry_evpd_block_limits(struct ctl int bs; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - bs = lun->be_lun->blocksize; ctsio->kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | M_ZERO); bl_ptr = (struct scsi_vpd_block_limits *)ctsio->kern_data_ptr; @@ -10169,10 +10170,13 @@ ctl_inquiry_evpd_block_limits(struct ctl scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); bl_ptr->max_cmp_write_len = 0xff; scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len); - scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); - if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { - scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); - scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + if (lun != NULL) { + bs = lun->be_lun->blocksize; + scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); + scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + } } scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); @@ -10189,10 +10193,8 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * { struct scsi_vpd_logical_block_prov *lbp_ptr; struct ctl_lun *lun; - int bs; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - bs = lun->be_lun->blocksize; ctsio->kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | M_ZERO); lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio->kern_data_ptr; @@ -10223,7 +10225,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; lbp_ptr->page_code = SVPD_LBP; - if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) + if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10; ctsio->scsi_status = SCSI_STATUS_OK; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 07:16:09 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8118B4D; Wed, 30 Jul 2014 07:16: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 8834C251C; Wed, 30 Jul 2014 07:16: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 s6U7G9uZ053718; Wed, 30 Jul 2014 07:16:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U7G84k053715; Wed, 30 Jul 2014 07:16:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407300716.s6U7G84k053715@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Jul 2014 07:16:08 +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: r269295 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 07:16:09 -0000 Author: mav Date: Wed Jul 30 07:16:08 2014 New Revision: 269295 URL: http://svnweb.freebsd.org/changeset/base/269295 Log: MFC r268581: Merge several equal serialization indexes. Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_ser_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Wed Jul 30 07:08:59 2014 (r269294) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Wed Jul 30 07:16:08 2014 (r269295) @@ -66,7 +66,7 @@ const struct ctl_cmd_entry ctl_cmd_table_5e[32] = { /* 00 READ KEYS */ -{ctl_persistent_reserve_in, CTL_SERIDX_PRES_IN, CTL_CMD_FLAG_ALLOW_ON_RESV | +{ctl_persistent_reserve_in, 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 | @@ -77,7 +77,7 @@ const struct ctl_cmd_entry ctl_cmd_table 10, { 0x00, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, /* 01 READ RESERVATION */ -{ctl_persistent_reserve_in, CTL_SERIDX_PRES_IN, CTL_CMD_FLAG_ALLOW_ON_RESV | +{ctl_persistent_reserve_in, 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 | @@ -116,57 +116,57 @@ const struct ctl_cmd_entry ctl_cmd_table const struct ctl_cmd_entry ctl_cmd_table_5f[32] = { /* 00 REGISTER */ -{ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, 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_SECONDARY | - CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, +{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_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 01 RESERVE */ -{ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, 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_SECONDARY | - CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, +{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_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 10, { 0x01, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 02 RELEASE */ -{ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, 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_SECONDARY | - CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, +{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_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 10, { 0x02, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 03 CLEAR */ -{ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, 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_SECONDARY | - CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, +{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_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 10, { 0x03, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 04 PREEMPT */ -{ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, 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_SECONDARY | - CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, +{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_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 10, { 0x04, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, @@ -174,13 +174,13 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 06 REGISTER AND IGNORE EXISTING KEY */ -{ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, 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_SECONDARY | - CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, +{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_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 10, { 0x06, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, @@ -288,11 +288,11 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 0A REPORT TARGET PORT GROUPS */ -{ctl_report_tagret_port_groups, CTL_SERIDX_MAIN_IN, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_CMD_FLAG_OK_ON_STOPPED | - CTL_CMD_FLAG_OK_ON_INOPERABLE | - CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, +{ctl_report_tagret_port_groups, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN, CTL_LUN_PAT_NONE, 12, {0x0a, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -300,20 +300,20 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 0C REPORT SUPPORTED_OPCODES */ -{ctl_report_supported_opcodes, CTL_SERIDX_MAIN_IN, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_CMD_FLAG_OK_ON_STOPPED | - CTL_CMD_FLAG_OK_ON_INOPERABLE | - CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, +{ctl_report_supported_opcodes, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN, CTL_LUN_PAT_NONE, 12, {0x0c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 0D REPORT SUPPORTED_TASK MANAGEMENT FUNCTIONS */ -{ctl_report_supported_tmf, CTL_SERIDX_MAIN_IN, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_CMD_FLAG_OK_ON_STOPPED | - CTL_CMD_FLAG_OK_ON_INOPERABLE | - CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, +{ctl_report_supported_tmf, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN, CTL_LUN_PAT_NONE, 12, {0x0d, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -321,11 +321,11 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 0F REPORT TIMESTAMP */ -{ctl_report_timestamp, CTL_SERIDX_MAIN_IN, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_CMD_FLAG_OK_ON_STOPPED | - CTL_CMD_FLAG_OK_ON_INOPERABLE | - CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, +{ctl_report_timestamp, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN, CTL_LUN_PAT_NONE, 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -435,7 +435,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_NONE, 6, {0x11, 0, 0, 0xff, 0x07}}, /* 16 RESERVE(6) */ -{ctl_scsi_reserve, CTL_SERIDX_RESV, CTL_CMD_FLAG_ALLOW_ON_RESV | +{ctl_scsi_reserve, 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 | @@ -444,7 +444,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_NONE, 6, {0, 0, 0, 0, 0x07}}, /* 17 RELEASE(6) */ -{ctl_scsi_release, CTL_SERIDX_REL, CTL_CMD_FLAG_ALLOW_ON_RESV | +{ctl_scsi_release, 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 | @@ -689,7 +689,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_NONE, 10, {0x11, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 56 RESERVE(10) */ -{ctl_scsi_reserve, CTL_SERIDX_RESV, CTL_CMD_FLAG_ALLOW_ON_RESV | +{ctl_scsi_reserve, 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 | @@ -698,7 +698,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_NONE, 10, {0x02, 0, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 57 RELEASE(10) */ -{ctl_scsi_release, CTL_SERIDX_REL, CTL_CMD_FLAG_ALLOW_ON_RESV | +{ctl_scsi_release, 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 | Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:08:59 2014 (r269294) +++ stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:16:08 2014 (r269295) @@ -163,14 +163,10 @@ typedef enum { CTL_SERIDX_RQ_SNS, CTL_SERIDX_INQ, CTL_SERIDX_RD_CAP, - CTL_SERIDX_RESV, - CTL_SERIDX_REL, + CTL_SERIDX_RES, CTL_SERIDX_LOG_SNS, CTL_SERIDX_FORMAT, CTL_SERIDX_START, - CTL_SERIDX_PRES_IN, - CTL_SERIDX_PRES_OUT, - CTL_SERIDX_MAIN_IN, /* TBD: others to be filled in as needed */ CTL_SERIDX_COUNT, /* LAST, not a normal code, provides # codes */ CTL_SERIDX_INVLD = CTL_SERIDX_COUNT Modified: stable/10/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ser_table.c Wed Jul 30 07:08:59 2014 (r269294) +++ stable/10/sys/cam/ctl/ctl_ser_table.c Wed Jul 30 07:16:08 2014 (r269295) @@ -60,23 +60,19 @@ static ctl_serialize_action ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { -/**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES REL LSNS FMT STR PRIN PROT MAININ*/ -/*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*READ */{ pS, pS, xT, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*WRITE */{ pS, xT, xT, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*UNMAP */{ pS, bK, bK, pS, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*RQ_SNS */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*INQ */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*RESV */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*REL */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*LOG_SNS */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*FORMAT */{ pS, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*START */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*PRES_IN */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*PRES_OUT*/{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*MAIN_IN */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK, bK, bK, bK, pS} +/**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ +/*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*READ */{ pS, pS, xT, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*WRITE */{ pS, xT, xT, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*UNMAP */{ pS, bK, bK, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, +/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*RQ_SNS */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, +/*INQ */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, +/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, +/*RES */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, +/*LOG_SNS */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, pS, bK, bK}, +/*FORMAT */{ pS, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK}, +/*START */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 07:18:34 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EBB4D2C; Wed, 30 Jul 2014 07:18: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 7A449253A; Wed, 30 Jul 2014 07:18: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 s6U7IYkK054069; Wed, 30 Jul 2014 07:18:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U7IW26054060; Wed, 30 Jul 2014 07:18:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407300718.s6U7IW26054060@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Jul 2014 07:18:32 +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: r269296 - in stable/10: sys/cam/ctl sys/cam/scsi sys/conf sys/modules/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 07:18:34 -0000 Author: mav Date: Wed Jul 30 07:18:32 2014 New Revision: 269296 URL: http://svnweb.freebsd.org/changeset/base/269296 Log: MFC r268767: Add support for VMWare dialect of EXTENDED COPY command, aka VAAI Clone. This allows to clone VMs and move them between LUNs inside one storage host without generating extra network traffic to the initiator and back, and without being limited by network bandwidth. LUNs participating in copy operation should have UNIQUE NAA or EUI IDs set. For LUNs without these IDs VMWare will use traditional copy operations. Beware: the above LUN IDs explicitly set to values non-unique from the VM cluster point of view may cause data corruption if wrong LUN is addressed! Sponsored by: iXsystems, Inc. Added: stable/10/sys/cam/ctl/ctl_tpc.c - copied unchanged from r268767, head/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/ctl_tpc.h - copied unchanged from r268767, head/sys/cam/ctl/ctl_tpc.h stable/10/sys/cam/ctl/ctl_tpc_local.c - copied unchanged from r268767, head/sys/cam/ctl/ctl_tpc_local.c Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_ser_table.c stable/10/sys/cam/ctl/scsi_ctl.c stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/conf/files stable/10/sys/modules/ctl/Makefile stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:18:32 2014 (r269296) @@ -322,10 +322,10 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), - * SCSI Ports (0x88), Block limits (0xB0) and + * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0) and * Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 6 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 7 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -351,8 +351,6 @@ static int ctl_ioctl_fill_ooa(struct ctl struct ctl_ooa_entry *kern_entries); static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -uint32_t ctl_get_resindex(struct ctl_nexus *nexus); -uint32_t ctl_port_idx(int port_num); static uint32_t ctl_map_lun(int port_num, uint32_t lun); static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); #ifdef unused @@ -4600,6 +4598,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft TAILQ_INIT(&lun->ooa_queue); TAILQ_INIT(&lun->blocked_queue); STAILQ_INIT(&lun->error_list); + ctl_tpc_init(lun); /* * Initialize the mode page index. @@ -4751,6 +4750,7 @@ ctl_free_lun(struct ctl_lun *lun) atomic_subtract_int(&lun->be_lun->be->num_luns, 1); lun->be_lun->lun_shutdown(lun->be_lun->be_lun); + ctl_tpc_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) @@ -9823,10 +9823,12 @@ ctl_inquiry_evpd_supported(struct ctl_sc pages->page_list[2] = SVPD_DEVICE_ID; /* SCSI Ports */ pages->page_list[3] = SVPD_SCSI_PORTS; + /* Third-party Copy */ + pages->page_list[4] = SVPD_SCSI_TPC; /* Block limits */ - pages->page_list[4] = SVPD_BLOCK_LIMITS; + pages->page_list[5] = SVPD_BLOCK_LIMITS; /* Logical Block Provisioning */ - pages->page_list[5] = SVPD_LBP; + pages->page_list[6] = SVPD_LBP; ctsio->scsi_status = SCSI_STATUS_OK; @@ -10025,7 +10027,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s struct scsi_vpd_port_designation_cont *pdc; struct ctl_lun *lun; struct ctl_port *port; - int data_len, num_target_ports, id_len, g, pg, p; + int data_len, num_target_ports, iid_len, id_len, g, pg, p; int num_target_port_groups, single; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10036,6 +10038,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s else num_target_port_groups = NUM_TARGET_PORT_GROUPS; num_target_ports = 0; + iid_len = 0; id_len = 0; mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(port, &softc->port_list, links) { @@ -10046,6 +10049,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s CTL_MAX_LUNS) continue; num_target_ports++; + if (port->init_devid) + iid_len += port->init_devid->len; if (port->port_devid) id_len += port->port_devid->len; } @@ -10053,7 +10058,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s data_len = sizeof(struct scsi_vpd_scsi_ports) + num_target_port_groups * num_target_ports * (sizeof(struct scsi_vpd_port_designation) + - sizeof(struct scsi_vpd_port_designation_cont)) + id_len; + sizeof(struct scsi_vpd_port_designation_cont)) + iid_len + id_len; ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); sp = (struct scsi_vpd_scsi_ports *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -10102,19 +10107,22 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s continue; p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; scsi_ulto2b(p, pd->relative_port_id); - scsi_ulto2b(0, pd->initiator_transportid_length); + if (port->init_devid && g == pg) { + iid_len = port->init_devid->len; + memcpy(pd->initiator_transportid, + port->init_devid->data, port->init_devid->len); + } else + iid_len = 0; + scsi_ulto2b(iid_len, pd->initiator_transportid_length); pdc = (struct scsi_vpd_port_designation_cont *) - &pd->initiator_transportid[0]; + (&pd->initiator_transportid[iid_len]); if (port->port_devid && g == pg) { id_len = port->port_devid->len; - scsi_ulto2b(port->port_devid->len, - pdc->target_port_descriptors_length); memcpy(pdc->target_port_descriptors, port->port_devid->data, port->port_devid->len); - } else { + } else id_len = 0; - scsi_ulto2b(0, pdc->target_port_descriptors_length); - } + scsi_ulto2b(id_len, pdc->target_port_descriptors_length); pd = (struct scsi_vpd_port_designation *) ((uint8_t *)pdc->target_port_descriptors + id_len); } @@ -10263,6 +10271,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi case SVPD_SCSI_PORTS: retval = ctl_inquiry_evpd_scsi_ports(ctsio, alloc_len); break; + case SVPD_SCSI_TPC: + retval = ctl_inquiry_evpd_tpc(ctsio, alloc_len); + break; case SVPD_BLOCK_LIMITS: retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len); break; @@ -10293,7 +10304,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio struct ctl_lun *lun; char *val; uint32_t alloc_len; - int is_fc; + ctl_port_type port_type; ctl_softc = control_softc; @@ -10302,11 +10313,10 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * We treat the ioctl front end, and any SCSI adapters, as packetized * SCSI front ends. */ - if (ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]->port_type != - CTL_PORT_FC) - is_fc = 0; - else - is_fc = 1; + port_type = ctl_softc->ctl_ports[ + ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]->port_type; + if (port_type == CTL_PORT_IOCTL || port_type == CTL_PORT_INTERNAL) + port_type = CTL_PORT_SCSI; lun = ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_inquiry *)ctsio->cdb; @@ -10385,7 +10395,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio inq_ptr->device = (SID_QUAL_BAD_LU << 5) | T_NODEVICE; /* RMB in byte 2 is 0 */ - inq_ptr->version = SCSI_REV_SPC3; + inq_ptr->version = SCSI_REV_SPC4; /* * According to SAM-3, even if a device only supports a single @@ -10410,17 +10420,18 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("additional_length = %d\n", inq_ptr->additional_length)); - inq_ptr->spc3_flags = SPC3_SID_TPGS_IMPLICIT; + inq_ptr->spc3_flags = SPC3_SID_3PC; + if (!ctl_is_single) + inq_ptr->spc3_flags |= SPC3_SID_TPGS_IMPLICIT; /* 16 bit addressing */ - if (is_fc == 0) + if (port_type == CTL_PORT_SCSI) inq_ptr->spc2_flags = SPC2_SID_ADDR16; /* XXX set the SID_MultiP bit here if we're actually going to respond on multiple ports */ inq_ptr->spc2_flags |= SPC2_SID_MultiP; /* 16 bit data bus, synchronous transfers */ - /* XXX these flags don't apply for FC */ - if (is_fc == 0) + if (port_type == CTL_PORT_SCSI) inq_ptr->flags = SID_WBus16 | SID_Sync; /* * XXX KDM do we want to support tagged queueing on the control @@ -10481,33 +10492,36 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * and Selection) and Information Unit transfers on both the * control and array devices. */ - if (is_fc == 0) + if (port_type == CTL_PORT_SCSI) inq_ptr->spi3data = SID_SPI_CLOCK_DT_ST | SID_SPI_QAS | SID_SPI_IUS; - /* SAM-3 */ - scsi_ulto2b(0x0060, inq_ptr->version1); - /* SPC-3 (no version claimed) XXX should we claim a version? */ - scsi_ulto2b(0x0300, inq_ptr->version2); - if (is_fc) { + /* SAM-5 (no version claimed) */ + scsi_ulto2b(0x00A0, inq_ptr->version1); + /* SPC-4 (no version claimed) */ + scsi_ulto2b(0x0460, inq_ptr->version2); + if (port_type == CTL_PORT_FC) { /* FCP-2 ANSI INCITS.350:2003 */ scsi_ulto2b(0x0917, inq_ptr->version3); - } else { + } else if (port_type == CTL_PORT_SCSI) { /* SPI-4 ANSI INCITS.362:200x */ scsi_ulto2b(0x0B56, inq_ptr->version3); + } else if (port_type == CTL_PORT_ISCSI) { + /* iSCSI (no version claimed) */ + scsi_ulto2b(0x0960, inq_ptr->version3); + } else if (port_type == CTL_PORT_SAS) { + /* SAS (no version claimed) */ + scsi_ulto2b(0x0BE0, inq_ptr->version3); } if (lun == NULL) { - /* SBC-2 (no version claimed) XXX should we claim a version? */ - scsi_ulto2b(0x0320, inq_ptr->version4); + /* SBC-3 (no version claimed) */ + scsi_ulto2b(0x04C0, inq_ptr->version4); } else { switch (lun->be_lun->lun_type) { case T_DIRECT: - /* - * SBC-2 (no version claimed) XXX should we claim a - * version? - */ - scsi_ulto2b(0x0320, inq_ptr->version4); + /* SBC-3 (no version claimed) */ + scsi_ulto2b(0x04C0, inq_ptr->version4); break; case T_PROCESSOR: default: Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Wed Jul 30 07:18:32 2014 (r269296) @@ -190,6 +190,156 @@ const struct ctl_cmd_entry ctl_cmd_table /* 08-1f */ }; +/* 83 EXTENDED COPY */ +const struct ctl_cmd_entry ctl_cmd_table_83[32] = +{ +/* 00 EXTENDED COPY (LID1) */ +{ctl_extended_copy_lid1, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_NONE, + 16, { 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 01 EXTENDED COPY (LID4) */ +{ctl_extended_copy_lid4, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_NONE, + 16, { 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 02 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 03 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 04 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 05 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 06 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 07 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 08 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 09 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0A */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0B */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0C */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0D */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0E */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0F */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 10 POPULATE TOKEN */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 11 WRITE USING TOKEN */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 12 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 13 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 14 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 15 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 16 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 17 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 18 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 19 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 1A */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 1B */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 1C COPY OPERATION ABORT */ +{ctl_copy_operation_abort, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_NONE, + CTL_LUN_PAT_NONE, + 16, { 0x1c, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x07}}, +}; + +/* 84 RECEIVE COPY STATUS */ +const struct ctl_cmd_entry ctl_cmd_table_84[32] = +{ +/* 00 RECEIVE COPY STATUS (LID1) */ +{ctl_receive_copy_status_lid1, CTL_SERIDX_RD_CAP, + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 16, {0x00, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 01 RECEIVE COPY DATA (LID1) */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 02 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 03 RECEIVE COPY OPERATING PARAMETERS */ +{ctl_receive_copy_operating_parameters, CTL_SERIDX_RD_CAP, + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 16, {0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 04 RECEIVE COPY FAILURE DETAILS (LID1) */ +{ctl_receive_copy_failure_details, CTL_SERIDX_RD_CAP, + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 16, {0x04, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 05 RECEIVE COPY STATUS (LID4) */ +{ctl_receive_copy_status_lid4, CTL_SERIDX_RD_CAP, + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 16, {0x05, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 06 RECEIVE COPY DATA (LID4)*/ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 07 RECEIVE ROD TOKEN INFORMATION */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 08 REPORT ALL ROD TOKENS */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +}; + /* 9E SERVICE ACTION IN(16) */ const struct ctl_cmd_entry ctl_cmd_table_9e[32] = { @@ -844,10 +994,12 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 83 EXTENDED COPY */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{__DECONST(ctl_opfunc *, ctl_cmd_table_83), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5, + CTL_LUN_PAT_NONE}, /* 84 RECEIVE COPY RESULTS */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{__DECONST(ctl_opfunc *, ctl_cmd_table_84), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5, + CTL_LUN_PAT_NONE}, /* 85 */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl_frontend.c Wed Jul 30 07:18:32 2014 (r269296) @@ -234,6 +234,8 @@ ctl_port_deregister(struct ctl_port *por port->port_devid = NULL; free(port->target_devid, M_CTL); port->target_devid = NULL; + free(port->init_devid, M_CTL); + port->init_devid = NULL; for (i = 0; i < port->max_initiators; i++) free(port->wwpn_iid[i].name, M_CTL); free(port->wwpn_iid, M_CTL); Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl_frontend.h Wed Jul 30 07:18:32 2014 (r269296) @@ -242,6 +242,7 @@ struct ctl_port { ctl_options_t options; /* passed to CTL */ struct ctl_devid *port_devid; /* passed to CTL */ struct ctl_devid *target_devid; /* passed to CTL */ + struct ctl_devid *init_devid; /* passed to CTL */ STAILQ_ENTRY(ctl_port) fe_links; /* used by CTL */ STAILQ_ENTRY(ctl_port) links; /* used by CTL */ }; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 30 07:18:32 2014 (r269296) @@ -2707,7 +2707,7 @@ cfiscsi_scsi_command_done(union ctl_io * * Do not return status for aborted commands. * There are exceptions, but none supported by CTL yet. */ - if (io->io_hdr.status == CTL_CMD_ABORTED && + if ((io->io_hdr.flags & CTL_FLAG_ABORT) && (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { ctl_free_io(io); icl_pdu_free(request); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:18:32 2014 (r269296) @@ -373,6 +373,7 @@ struct ctl_devid { */ #define NUM_TARGET_PORT_GROUPS 2 +struct tpc_list; struct ctl_lun { struct mtx lun_lock; struct ctl_id target; @@ -403,6 +404,7 @@ struct ctl_lun { uint8_t res_type; uint8_t write_buffer[524288]; struct ctl_devid *lun_devid; + TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; }; typedef enum { @@ -467,6 +469,8 @@ struct ctl_softc { extern const struct ctl_cmd_entry ctl_cmd_table[256]; uint32_t ctl_get_initindex(struct ctl_nexus *nexus); +uint32_t ctl_get_resindex(struct ctl_nexus *nexus); +uint32_t ctl_port_idx(int port_num); int ctl_pool_create(struct ctl_softc *ctl_softc, ctl_pool_type pool_type, uint32_t total_ctl_io, struct ctl_io_pool **npool); void ctl_pool_free(struct ctl_io_pool *pool); @@ -498,6 +502,17 @@ int ctl_report_supported_tmf(struct ctl_ int ctl_report_timestamp(struct ctl_scsiio *ctsio); int ctl_isc(struct ctl_scsiio *ctsio); +void ctl_tpc_init(struct ctl_lun *lun); +void ctl_tpc_shutdown(struct ctl_lun *lun); +int ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len); +int ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio); +int ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio); +int ctl_receive_copy_status_lid4(struct ctl_scsiio *ctsio); +int ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio); +int ctl_extended_copy_lid1(struct ctl_scsiio *ctsio); +int ctl_extended_copy_lid4(struct ctl_scsiio *ctsio); +int ctl_copy_operation_abort(struct ctl_scsiio *ctsio); + #endif /* _KERNEL */ #endif /* _CTL_PRIVATE_H_ */ Modified: stable/10/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ser_table.c Wed Jul 30 07:16:08 2014 (r269295) +++ stable/10/sys/cam/ctl/ctl_ser_table.c Wed Jul 30 07:18:32 2014 (r269296) @@ -69,7 +69,7 @@ ctl_serialize_table[CTL_SERIDX_COUNT][CT /*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*RQ_SNS */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, /*INQ */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, -/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, +/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, /*RES */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, /*LOG_SNS */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, pS, bK, bK}, /*FORMAT */{ pS, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK}, Copied: stable/10/sys/cam/ctl/ctl_tpc.c (from r268767, head/sys/cam/ctl/ctl_tpc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cam/ctl/ctl_tpc.c Wed Jul 30 07:18:32 2014 (r269296, copy of r268767, head/sys/cam/ctl/ctl_tpc.c) @@ -0,0 +1,1370 @@ +/*- + * Copyright (c) 2014 Alexander Motin + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TPC_MAX_CSCDS 64 +#define TPC_MAX_SEGS 64 +#define TPC_MAX_SEG 0 +#define TPC_MAX_LIST 8192 +#define TPC_MAX_INLINE 0 +#define TPC_MAX_LISTS 255 +#define TPC_MAX_IO_SIZE (1024 * 1024) + +MALLOC_DEFINE(M_CTL_TPC, "ctltpc", "CTL TPC"); + +typedef enum { + TPC_ERR_RETRY = 0x000, + TPC_ERR_FAIL = 0x001, + TPC_ERR_MASK = 0x0ff, + TPC_ERR_NO_DECREMENT = 0x100 +} tpc_error_action; + +struct tpc_list; +TAILQ_HEAD(runl, tpc_io); +struct tpc_io { + union ctl_io *io; + uint64_t lun; + struct tpc_list *list; + struct runl run; + TAILQ_ENTRY(tpc_io) rlinks; + TAILQ_ENTRY(tpc_io) links; +}; + +struct tpc_list { + uint8_t service_action; + int init_port; + uint16_t init_idx; + uint32_t list_id; + uint8_t flags; + uint8_t *params; + struct scsi_ec_cscd *cscd; + struct scsi_ec_segment *seg[TPC_MAX_SEGS]; + uint8_t *inl; + int ncscd; + int nseg; + int leninl; + int curseg; + off_t curbytes; + int curops; + int stage; + uint8_t *buf; + int segbytes; + int tbdio; + int error; + int abort; + int completed; + TAILQ_HEAD(, tpc_io) allio; + struct scsi_sense_data sense_data; + uint8_t sense_len; + uint8_t scsi_status; + struct ctl_scsiio *ctsio; + struct ctl_lun *lun; + TAILQ_ENTRY(tpc_list) links; +}; + +void +ctl_tpc_init(struct ctl_lun *lun) +{ + + TAILQ_INIT(&lun->tpc_lists); +} + +void +ctl_tpc_shutdown(struct ctl_lun *lun) +{ + struct tpc_list *list; + + while ((list = TAILQ_FIRST(&lun->tpc_lists)) != NULL) { + TAILQ_REMOVE(&lun->tpc_lists, list, links); + KASSERT(list->completed, + ("Not completed TPC (%p) on shutdown", list)); + free(list, M_CTL); + } +} + +int +ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct scsi_vpd_tpc *tpc_ptr; + struct scsi_vpd_tpc_descriptor *d_ptr; + struct scsi_vpd_tpc_descriptor_sc *sc_ptr; + struct scsi_vpd_tpc_descriptor_sc_descr *scd_ptr; + struct scsi_vpd_tpc_descriptor_pd *pd_ptr; + struct scsi_vpd_tpc_descriptor_sd *sd_ptr; + struct scsi_vpd_tpc_descriptor_sdid *sdid_ptr; + struct scsi_vpd_tpc_descriptor_gco *gco_ptr; + struct ctl_lun *lun; + int data_len; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + data_len = sizeof(struct scsi_vpd_tpc) + + roundup2(sizeof(struct scsi_vpd_tpc_descriptor_sc) + + 2 * sizeof(struct scsi_vpd_tpc_descriptor_sc_descr) + 7, 4) + + sizeof(struct scsi_vpd_tpc_descriptor_pd) + + roundup2(sizeof(struct scsi_vpd_tpc_descriptor_sd) + 4, 4) + + roundup2(sizeof(struct scsi_vpd_tpc_descriptor_sdid) + 2, 4) + + sizeof(struct scsi_vpd_tpc_descriptor_gco); + + ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); + tpc_ptr = (struct scsi_vpd_tpc *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (data_len < alloc_len) { + ctsio->residual = alloc_len - data_len; + ctsio->kern_data_len = data_len; + ctsio->kern_total_len = data_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. + */ + if (lun != NULL) + tpc_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + tpc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + tpc_ptr->page_code = SVPD_SCSI_TPC; + scsi_ulto2b(data_len - 4, tpc_ptr->page_length); + + /* Supported commands */ + d_ptr = (struct scsi_vpd_tpc_descriptor *)&tpc_ptr->descr[0]; + sc_ptr = (struct scsi_vpd_tpc_descriptor_sc *)d_ptr; + scsi_ulto2b(SVPD_TPC_SC, sc_ptr->desc_type); + sc_ptr->list_length = 2 * sizeof(*scd_ptr) + 7; + scsi_ulto2b(roundup2(1 + sc_ptr->list_length, 4), sc_ptr->desc_length); + scd_ptr = &sc_ptr->descr[0]; + scd_ptr->opcode = EXTENDED_COPY; + scd_ptr->sa_length = 3; + scd_ptr->supported_service_actions[0] = EC_EC_LID1; + scd_ptr->supported_service_actions[1] = EC_EC_LID4; + scd_ptr->supported_service_actions[2] = EC_COA; + scd_ptr = (struct scsi_vpd_tpc_descriptor_sc_descr *) + &scd_ptr->supported_service_actions[scd_ptr->sa_length]; + scd_ptr->opcode = RECEIVE_COPY_STATUS; + scd_ptr->sa_length = 4; + scd_ptr->supported_service_actions[0] = RCS_RCS_LID1; + scd_ptr->supported_service_actions[1] = RCS_RCFD; + scd_ptr->supported_service_actions[2] = RCS_RCS_LID4; + scd_ptr->supported_service_actions[3] = RCS_RCOP; + + /* Parameter data. */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); + pd_ptr = (struct scsi_vpd_tpc_descriptor_pd *)d_ptr; + scsi_ulto2b(SVPD_TPC_PD, pd_ptr->desc_type); + scsi_ulto2b(sizeof(*pd_ptr) - 4, pd_ptr->desc_length); + scsi_ulto2b(TPC_MAX_CSCDS, pd_ptr->maximum_cscd_descriptor_count); + scsi_ulto2b(TPC_MAX_SEGS, pd_ptr->maximum_segment_descriptor_count); + scsi_ulto4b(TPC_MAX_LIST, pd_ptr->maximum_descriptor_list_length); + scsi_ulto4b(TPC_MAX_INLINE, pd_ptr->maximum_inline_data_length); + + /* Supported Descriptors */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); + sd_ptr = (struct scsi_vpd_tpc_descriptor_sd *)d_ptr; + scsi_ulto2b(SVPD_TPC_SD, sd_ptr->desc_type); + scsi_ulto2b(roundup2(sizeof(*sd_ptr) - 4 + 4, 4), sd_ptr->desc_length); + sd_ptr->list_length = 4; + sd_ptr->supported_descriptor_codes[0] = EC_SEG_B2B; + sd_ptr->supported_descriptor_codes[1] = EC_SEG_VERIFY; + sd_ptr->supported_descriptor_codes[2] = EC_SEG_REGISTER_KEY; + sd_ptr->supported_descriptor_codes[3] = EC_CSCD_ID; + + /* Supported CSCD Descriptor IDs */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); + sdid_ptr = (struct scsi_vpd_tpc_descriptor_sdid *)d_ptr; + scsi_ulto2b(SVPD_TPC_SDID, sdid_ptr->desc_type); + scsi_ulto2b(roundup2(sizeof(*sdid_ptr) - 4 + 2, 4), sdid_ptr->desc_length); + scsi_ulto2b(2, sdid_ptr->list_length); + scsi_ulto2b(0xffff, &sdid_ptr->supported_descriptor_ids[0]); + + /* General Copy Operations */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); + gco_ptr = (struct scsi_vpd_tpc_descriptor_gco *)d_ptr; + scsi_ulto2b(SVPD_TPC_GCO, gco_ptr->desc_type); + scsi_ulto2b(sizeof(*gco_ptr) - 4, gco_ptr->desc_length); + scsi_ulto4b(TPC_MAX_LISTS, gco_ptr->total_concurrent_copies); + scsi_ulto4b(TPC_MAX_LISTS, gco_ptr->maximum_identified_concurrent_copies); + scsi_ulto4b(TPC_MAX_SEG, gco_ptr->maximum_segment_length); + gco_ptr->data_segment_granularity = 0; + gco_ptr->inline_data_granularity = 0; + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +int +ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_receive_copy_operating_parameters *cdb; + struct scsi_receive_copy_operating_parameters_data *data; + int retval; + int alloc_len, total_len; + + CTL_DEBUG_PRINT(("ctl_report_supported_tmf\n")); + + cdb = (struct scsi_receive_copy_operating_parameters *)ctsio->cdb; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + retval = CTL_RETVAL_COMPLETE; + + total_len = sizeof(*data) + 4; + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + + ctsio->kern_sg_entries = 0; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + + data = (struct scsi_receive_copy_operating_parameters_data *)ctsio->kern_data_ptr; + scsi_ulto4b(sizeof(*data) - 4 + 4, data->length); + data->snlid = RCOP_SNLID; + scsi_ulto2b(TPC_MAX_CSCDS, data->maximum_cscd_descriptor_count); + scsi_ulto2b(TPC_MAX_SEGS, data->maximum_segment_descriptor_count); + scsi_ulto4b(TPC_MAX_LIST, data->maximum_descriptor_list_length); + scsi_ulto4b(TPC_MAX_SEG, data->maximum_segment_length); + scsi_ulto4b(TPC_MAX_INLINE, data->maximum_inline_data_length); + scsi_ulto4b(0, data->held_data_limit); + scsi_ulto4b(0, data->maximum_stream_device_transfer_size); + scsi_ulto2b(TPC_MAX_LISTS, data->total_concurrent_copies); + data->maximum_concurrent_copies = TPC_MAX_LISTS; + data->data_segment_granularity = 0; + data->inline_data_granularity = 0; + data->held_data_granularity = 0; + data->implemented_descriptor_list_length = 4; + data->list_of_implemented_descriptor_type_codes[0] = EC_SEG_B2B; + data->list_of_implemented_descriptor_type_codes[1] = EC_SEG_VERIFY; + data->list_of_implemented_descriptor_type_codes[2] = EC_SEG_REGISTER_KEY; + data->list_of_implemented_descriptor_type_codes[3] = EC_CSCD_ID; + + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + ctl_datamove((union ctl_io *)ctsio); + return (retval); +} + +int +ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_receive_copy_status_lid1 *cdb; + struct scsi_receive_copy_status_lid1_data *data; + struct tpc_list *list; + struct tpc_list list_copy; + int retval; + int alloc_len, total_len; + uint32_t list_id; + + CTL_DEBUG_PRINT(("ctl_receive_copy_status_lid1\n")); + + cdb = (struct scsi_receive_copy_status_lid1 *)ctsio->cdb; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + retval = CTL_RETVAL_COMPLETE; + + list_id = cdb->list_identifier; + mtx_lock(&lun->lun_lock); + TAILQ_FOREACH(list, &lun->tpc_lists, links) { + if ((list->flags & EC_LIST_ID_USAGE_MASK) != + EC_LIST_ID_USAGE_NONE && list->list_id == list_id) + break; + } + if (list == NULL) { + mtx_unlock(&lun->lun_lock); + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 1, /*field*/ 2, /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (retval); + } + list_copy = *list; + if (list->completed) { + TAILQ_REMOVE(&lun->tpc_lists, list, links); + free(list, M_CTL); + } + mtx_unlock(&lun->lun_lock); + + total_len = sizeof(*data); + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + + ctsio->kern_sg_entries = 0; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + + data = (struct scsi_receive_copy_status_lid1_data *)ctsio->kern_data_ptr; + scsi_ulto4b(sizeof(*data) - 4, data->available_data); + if (list_copy.completed) { + if (list_copy.error || list_copy.abort) + data->copy_command_status = RCS_CCS_ERROR; + else + data->copy_command_status = RCS_CCS_COMPLETED; + } else + data->copy_command_status = RCS_CCS_INPROG; + scsi_ulto2b(list_copy.curseg, data->segments_processed); + if (list_copy.curbytes <= UINT32_MAX) { + data->transfer_count_units = RCS_TC_BYTES; + scsi_ulto4b(list_copy.curbytes, data->transfer_count); + } else { + data->transfer_count_units = RCS_TC_MBYTES; + scsi_ulto4b(list_copy.curbytes >> 20, data->transfer_count); + } + + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + ctl_datamove((union ctl_io *)ctsio); + return (retval); +} + +int +ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_receive_copy_failure_details *cdb; + struct scsi_receive_copy_failure_details_data *data; + struct tpc_list *list; + struct tpc_list list_copy; + int retval; + int alloc_len, total_len; + uint32_t list_id; + + CTL_DEBUG_PRINT(("ctl_receive_copy_failure_details\n")); + + cdb = (struct scsi_receive_copy_failure_details *)ctsio->cdb; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + retval = CTL_RETVAL_COMPLETE; + + list_id = cdb->list_identifier; + mtx_lock(&lun->lun_lock); + TAILQ_FOREACH(list, &lun->tpc_lists, links) { + if (list->completed && (list->flags & EC_LIST_ID_USAGE_MASK) != + EC_LIST_ID_USAGE_NONE && list->list_id == list_id) + break; + } + if (list == NULL) { + mtx_unlock(&lun->lun_lock); + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 1, /*field*/ 2, /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (retval); + } + list_copy = *list; + TAILQ_REMOVE(&lun->tpc_lists, list, links); + free(list, M_CTL); + mtx_unlock(&lun->lun_lock); + + total_len = sizeof(*data) + list_copy.sense_len; + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + + ctsio->kern_sg_entries = 0; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + + data = (struct scsi_receive_copy_failure_details_data *)ctsio->kern_data_ptr; + if (list_copy.completed && (list_copy.error || list_copy.abort)) { + scsi_ulto4b(sizeof(*data) - 4, data->available_data); + data->copy_command_status = RCS_CCS_ERROR; + } else + scsi_ulto4b(0, data->available_data); + scsi_ulto2b(list_copy.sense_len, data->sense_data_length); + memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len); + + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + ctl_datamove((union ctl_io *)ctsio); + return (retval); +} + +int +ctl_receive_copy_status_lid4(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_receive_copy_status_lid4 *cdb; + struct scsi_receive_copy_status_lid4_data *data; + struct tpc_list *list; + struct tpc_list list_copy; + int retval; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 07:20:36 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B418FB6; Wed, 30 Jul 2014 07:20: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 A03B62554; Wed, 30 Jul 2014 07:20: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 s6U7Kajn054843; Wed, 30 Jul 2014 07:20:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U7Ka80054841; Wed, 30 Jul 2014 07:20:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407300720.s6U7Ka80054841@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Jul 2014 07:20: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: r269297 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 07:20:36 -0000 Author: mav Date: Wed Jul 30 07:20:36 2014 New Revision: 269297 URL: http://svnweb.freebsd.org/changeset/base/269297 Log: MFC r268807: Reduce per-LUN memory usage from 18MB to 1.8MB. CTL never had use for CA support code since SPI has gone, and there is no even frontends supporting that. But it still was reserving 256 bytes of memory per LUN per every possible initiator on every possible port. Wrap unused code with ifdef's in case somebody ever need it. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:18:32 2014 (r269296) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:20:36 2014 (r269297) @@ -4609,7 +4609,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft * Set the poweron UA for all initiators on this LUN only. */ for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_sense[i].ua_pending = CTL_UA_POWERON; + lun->pending_ua[i] = CTL_UA_POWERON; /* * Now, before we insert this lun on the lun list, set the lun @@ -4617,7 +4617,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft */ STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_sense[i].ua_pending |= CTL_UA_LUN_CHANGE; + nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; } } @@ -4758,7 +4758,7 @@ ctl_free_lun(struct ctl_lun *lun) STAILQ_FOREACH(nlun, &softc->lun_list, links) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_sense[i].ua_pending |= CTL_UA_LUN_CHANGE; + nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; } } @@ -5137,7 +5137,7 @@ ctl_lun_capacity_changed(struct ctl_be_l mtx_lock(&lun->lun_lock); for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED; + lun->pending_ua[i] |= CTL_UA_CAPACITY_CHANGED; mtx_unlock(&lun->lun_lock); } @@ -6239,8 +6239,7 @@ ctl_control_page_handler(struct ctl_scsi if (i == initidx) continue; - lun->pending_sense[i].ua_pending |= - CTL_UA_MODE_CHANGE; + lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; } } mtx_unlock(&lun->lun_lock); @@ -8005,12 +8004,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (!persis_offset && i pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i-persis_offset - ].ua_pending |= + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; lun->per_res[i].registered = 0; memset(&lun->per_res[i].res_key, 0, @@ -8092,13 +8090,10 @@ ctl_pro_preempt(struct ctl_softc *softc, sizeof(struct scsi_per_res_key)); lun->pr_key_count--; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_sense[i-persis_offset].ua_pending|= + if (!persis_offset && i < CTL_MAX_INITIATORS) + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; + else if (persis_offset && i >= persis_offset) + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; } if (!found) { @@ -8189,27 +8184,23 @@ ctl_pro_preempt(struct ctl_softc *softc, if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[ - i-persis_offset].ua_pending |= + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; else if (persis_offset && i >= persis_offset) - lun->pending_sense[ - i-persis_offset - ].ua_pending |= + lun->pending_ua[ + i-persis_offset] |= CTL_UA_RES_RELEASE; } } @@ -8258,12 +8249,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[ - i-persis_offset].ua_pending |= + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; } @@ -8325,11 +8315,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_REG_PREEMPT; lun->per_res[i].registered = 0; memset(&lun->per_res[i].res_key, 0, @@ -8356,12 +8345,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (!persis_offset && i < persis_offset) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_REG_PREEMPT; } } @@ -8384,25 +8372,22 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_key_count--; if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_REG_PREEMPT; } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { if (!persis_offset && i < persis_offset) - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_RES_RELEASE; } } @@ -8619,8 +8604,7 @@ ctl_persistent_reserve_out(struct ctl_sc i+persis_offset].registered == 0) continue; - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } } @@ -8778,7 +8762,7 @@ ctl_persistent_reserve_out(struct ctl_sc if (lun->per_res[i+persis_offset].registered == 0) continue; - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8813,11 +8797,11 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (lun->per_res[i].registered) { if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i-persis_offset - ].ua_pending |= CTL_UA_RES_PREEMPT; + lun->pending_ua[i-persis_offset] |= + CTL_UA_RES_PREEMPT; memset(&lun->per_res[i].res_key, 0, sizeof(struct scsi_per_res_key)); @@ -8915,8 +8899,7 @@ ctl_hndl_per_res_out_on_other_sc(union c persis_offset].registered == 0) continue; - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } } @@ -8947,7 +8930,7 @@ ctl_hndl_per_res_out_on_other_sc(union c && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) if (lun->per_res[i+persis_offset].registered) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8970,11 +8953,10 @@ ctl_hndl_per_res_out_on_other_sc(union c continue; if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= - CTL_UA_RES_PREEMPT; + lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i-persis_offset].ua_pending|= + lun->pending_ua[i-persis_offset] |= CTL_UA_RES_PREEMPT; memset(&lun->per_res[i].res_key, 0, sizeof(struct scsi_per_res_key)); @@ -9542,8 +9524,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); - lun->pending_sense[initidx].ua_pending &= - ~CTL_UA_LUN_CHANGE; + lun->pending_ua[initidx] &= ~CTL_UA_LUN_CHANGE; mtx_unlock(&lun->lun_lock); } } @@ -9645,6 +9626,7 @@ ctl_request_sense(struct ctl_scsiio *cts * Pending sense gets returned first, then pending unit attentions. */ mtx_lock(&lun->lun_lock); +#ifdef CTL_WITH_CA if (ctl_is_set(lun->have_ca, initidx)) { scsi_sense_data_type stored_format; @@ -9652,8 +9634,7 @@ ctl_request_sense(struct ctl_scsiio *cts * Check to see which sense format was used for the stored * sense data. */ - stored_format = scsi_sense_type( - &lun->pending_sense[initidx].sense); + stored_format = scsi_sense_type(&lun->pending_sense[initidx]); /* * If the user requested a different sense format than the @@ -9668,29 +9649,31 @@ ctl_request_sense(struct ctl_scsiio *cts if ((stored_format == SSD_TYPE_FIXED) && (sense_format == SSD_TYPE_DESC)) ctl_sense_to_desc((struct scsi_sense_data_fixed *) - &lun->pending_sense[initidx].sense, + &lun->pending_sense[initidx], (struct scsi_sense_data_desc *)sense_ptr); else if ((stored_format == SSD_TYPE_DESC) && (sense_format == SSD_TYPE_FIXED)) ctl_sense_to_fixed((struct scsi_sense_data_desc *) - &lun->pending_sense[initidx].sense, + &lun->pending_sense[initidx], (struct scsi_sense_data_fixed *)sense_ptr); else - memcpy(sense_ptr, &lun->pending_sense[initidx].sense, + memcpy(sense_ptr, &lun->pending_sense[initidx], ctl_min(sizeof(*sense_ptr), - sizeof(lun->pending_sense[initidx].sense))); + sizeof(lun->pending_sense[initidx]))); ctl_clear_mask(lun->have_ca, initidx); have_error = 1; - } else if (lun->pending_sense[initidx].ua_pending != CTL_UA_NONE) { + } else +#endif + if (lun->pending_ua[initidx] != CTL_UA_NONE) { ctl_ua_type ua_type; - ua_type = ctl_build_ua(lun->pending_sense[initidx].ua_pending, + ua_type = ctl_build_ua(lun->pending_ua[initidx], sense_ptr, sense_format); if (ua_type != CTL_UA_NONE) { have_error = 1; /* We're reporting this UA, so clear it */ - lun->pending_sense[initidx].ua_pending &= ~ua_type; + lun->pending_ua[initidx] &= ~ua_type; } } mtx_unlock(&lun->lun_lock); @@ -11308,7 +11291,7 @@ ctl_failover(void) * Build Unit Attention */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; } } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) @@ -11403,7 +11386,7 @@ ctl_failover(void) * Build Unit Attention */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; } } else { @@ -11503,6 +11486,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); +#ifdef CTL_WITH_CA /* * If we've got a request sense, it'll clear the contingent * allegiance condition. Otherwise, if we have a CA condition for @@ -11512,6 +11496,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct if ((ctsio->cdb[0] != REQUEST_SENSE) && (ctl_is_set(lun->have_ca, initidx))) ctl_clear_mask(lun->have_ca, initidx); +#endif /* * If the command has this flag set, it handles its own unit @@ -11538,7 +11523,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; - ua_type = lun->pending_sense[initidx].ua_pending; + ua_type = lun->pending_ua[initidx]; if (ua_type != CTL_UA_NONE) { scsi_sense_data_type sense_format; @@ -11556,8 +11541,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; ctsio->sense_len = SSD_FULL_SIZE; - lun->pending_sense[initidx].ua_pending &= - ~ua_type; + lun->pending_ua[initidx] &= ~ua_type; mtx_unlock(&lun->lun_lock); ctl_done((union ctl_io *)ctsio); return (retval); @@ -11852,7 +11836,7 @@ ctl_lun_reset(struct ctl_lun *lun, union for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (initindex == i) continue; - lun->pending_sense[i].ua_pending |= ua_type; + lun->pending_ua[i] |= ua_type; } #endif @@ -11867,8 +11851,10 @@ ctl_lun_reset(struct ctl_lun *lun, union lun->flags &= ~CTL_LUN_RESERVED; for (i = 0; i < CTL_MAX_INITIATORS; i++) { +#ifdef CTL_WITH_CA ctl_clear_mask(lun->have_ca, i); - lun->pending_sense[i].ua_pending |= ua_type; +#endif + lun->pending_ua[i] |= ua_type; } mtx_unlock(&lun->lun_lock); @@ -11968,8 +11954,10 @@ ctl_i_t_nexus_reset(union ctl_io *io) ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port, io->io_hdr.nexus.initid.id, (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); +#ifdef CTL_WITH_CA ctl_clear_mask(lun->have_ca, initindex); - lun->pending_sense[initindex].ua_pending |= CTL_UA_I_T_NEXUS_LOSS; +#endif + lun->pending_ua[initindex] |= CTL_UA_I_T_NEXUS_LOSS; mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -13651,6 +13639,7 @@ bailout: return (CTL_RETVAL_COMPLETE); } +#ifdef CTL_WITH_CA /* * Front end should call this if it doesn't do autosense. When the request * sense comes back in from the initiator, we'll dequeue this and send it. @@ -13698,8 +13687,8 @@ ctl_queue_sense(union ctl_io *io) goto bailout; } - memcpy(&lun->pending_sense[initidx].sense, &io->scsiio.sense_data, - ctl_min(sizeof(lun->pending_sense[initidx].sense), + memcpy(&lun->pending_sense[initidx], &io->scsiio.sense_data, + ctl_min(sizeof(lun->pending_sense[initidx]), sizeof(io->scsiio.sense_data))); ctl_set_mask(lun->have_ca, initidx); mtx_unlock(&lun->lun_lock); @@ -13711,6 +13700,7 @@ bailout: return (CTL_RETVAL_COMPLETE); } +#endif /* * Primary command inlet from frontend ports. All SCSI and task I/O Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:18:32 2014 (r269296) +++ stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:20:36 2014 (r269297) @@ -332,11 +332,6 @@ struct ctl_mode_pages { struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; -struct ctl_pending_sense { - ctl_ua_type ua_pending; - struct scsi_sense_data sense; -}; - struct ctl_lun_delay_info { ctl_delay_type datamove_type; uint32_t datamove_delay; @@ -393,8 +388,11 @@ struct ctl_lun { STAILQ_ENTRY(ctl_lun) links; STAILQ_ENTRY(ctl_lun) run_links; struct ctl_nexus rsv_nexus; +#ifdef CTL_WITH_CA uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; - struct ctl_pending_sense pending_sense[CTL_MAX_INITIATORS]; + struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; +#endif + ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; struct ctl_mode_pages mode_pages; struct ctl_lun_io_stats stats; struct ctl_per_res_info per_res[2*CTL_MAX_INITIATORS]; @@ -402,7 +400,7 @@ struct ctl_lun { int pr_key_count; uint16_t pr_res_idx; uint8_t res_type; - uint8_t write_buffer[524288]; + uint8_t write_buffer[262144]; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 30 07:21:32 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F07E1EF; Wed, 30 Jul 2014 07:21: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 3B87025D7; Wed, 30 Jul 2014 07:21: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 s6U7LWtX055033; Wed, 30 Jul 2014 07:21:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6U7LVK4055023; Wed, 30 Jul 2014 07:21:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407300721.s6U7LVK4055023@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Jul 2014 07:21:31 +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: r269298 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 07:21:32 -0000 Author: mav Date: Wed Jul 30 07:21:30 2014 New Revision: 269298 URL: http://svnweb.freebsd.org/changeset/base/269298 Log: MFC r268808: Increase maximal number of SCSI ports in CTL from 32 to 128. After I gave each iSCSI target its own port, the old limit appeared to be not so big. This change almost proportionally increases per-LUN memory use, but it is still three times better then it was before r268807. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_tpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:20:36 2014 (r269297) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 30 07:21:30 2014 (r269298) @@ -8210,8 +8210,7 @@ ctl_pro_preempt(struct ctl_softc *softc, && lun->res_type != SPR_TYPE_EX_AC_AR) lun->pr_res_idx = residx; else - lun->pr_res_idx = - CTL_PR_ALL_REGISTRANTS; + lun->pr_res_idx = CTL_PR_ALL_REGISTRANTS; persis_io.hdr.nexus = ctsio->io_hdr.nexus; persis_io.hdr.msg_type = CTL_MSG_PERS_ACTION; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Wed Jul 30 07:20:36 2014 (r269297) +++ stable/10/sys/cam/ctl/ctl_io.h Wed Jul 30 07:21:30 2014 (r269298) @@ -407,7 +407,7 @@ struct ctl_pr_info { ctl_pr_action action; uint8_t sa_res_key[8]; uint8_t res_type; - uint16_t residx; + uint32_t residx; }; struct ctl_ha_msg_hdr { Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Wed Jul 30 07:20:36 2014 (r269297) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Wed Jul 30 07:21:30 2014 (r269298) @@ -70,7 +70,7 @@ /* * Maximum number of ports registered at one time. */ -#define CTL_MAX_PORTS 32 +#define CTL_MAX_PORTS 128 /* * Maximum number of initiators we support. Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:20:36 2014 (r269297) +++ stable/10/sys/cam/ctl/ctl_private.h Wed Jul 30 07:21:30 2014 (r269298) @@ -355,8 +355,8 @@ struct ctl_per_res_info { uint8_t registered; }; -#define CTL_PR_ALL_REGISTRANTS 0xFFFF -#define CTL_PR_NO_RESERVATION 0xFFF0 +#define CTL_PR_ALL_REGISTRANTS 0xFFFFFFFF +#define CTL_PR_NO_RESERVATION 0xFFFFFFF0 struct ctl_devid { int len; @@ -398,7 +398,7 @@ struct ctl_lun { struct ctl_per_res_info per_res[2*CTL_MAX_INITIATORS]; unsigned int PRGeneration; int pr_key_count; - uint16_t pr_res_idx; + uint32_t pr_res_idx; uint8_t res_type; uint8_t write_buffer[262144]; struct ctl_devid *lun_devid; Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Wed Jul 30 07:20:36 2014 (r269297) +++ stable/10/sys/cam/ctl/ctl_tpc.c Wed Jul 30 07:21:30 2014 (r269298) @@ -89,7 +89,7 @@ struct tpc_io { struct tpc_list { uint8_t service_action; int init_port; - uint16_t init_idx; + uint32_t init_idx; uint32_t list_id; uint8_t flags; uint8_t *params; From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 31 07:28:00 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B222AF84; Thu, 31 Jul 2014 07:28: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 9F4FD2436; Thu, 31 Jul 2014 07:28: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 s6V7S0ol022026; Thu, 31 Jul 2014 07:28:00 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6V7S0Q2022025; Thu, 31 Jul 2014 07:28:00 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201407310728.s6V7S0Q2022025@svn.freebsd.org> From: Rui Paulo Date: Thu, 31 Jul 2014 07:28:00 +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: r269324 - stable/10/share/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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 07:28:00 -0000 Author: rpaulo Date: Thu Jul 31 07:27:59 2014 New Revision: 269324 URL: http://svnweb.freebsd.org/changeset/base/269324 Log: MFC r268300: bsd.dep.mk: add support for generating DTrace header files from .d files. Modified: stable/10/share/mk/bsd.dep.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.dep.mk ============================================================================== --- stable/10/share/mk/bsd.dep.mk Thu Jul 31 05:56:15 2014 (r269323) +++ stable/10/share/mk/bsd.dep.mk Thu Jul 31 07:27:59 2014 (r269324) @@ -78,6 +78,7 @@ ${_S:R}.o: ${_S} .endfor .endif +# Lexical analyzers .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} @@ -90,6 +91,7 @@ CLEANFILES+= ${_LC} .endfor .endfor +# Yacc grammars .for _YSRC in ${SRCS:M*.y:N*/*} .for _YC in ${_YSRC:R}.c SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} @@ -117,6 +119,16 @@ ${_YC:R}.o: ${_YC} .endif .endfor .endfor + +# DTrace probe definitions +.for _DSRC in ${SRCS:M*.d:N*/*} +.for _DH in ${_DSRC:R}.h +${_DH}: ${_DSRC} + ${DTRACE} -xnolibs -h -s ${.ALLSRC} +SRCS:= ${SRCS:S/${_DSRC}/${_DH}/} +CLEANFILES+= ${_DH} +.endfor +.endfor .endif .if !target(depend) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 31 14:53:07 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D360A95C; Thu, 31 Jul 2014 14:53: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 BE491296E; Thu, 31 Jul 2014 14:53: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 s6VEr7f4031076; Thu, 31 Jul 2014 14:53:07 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6VEr7Js031072; Thu, 31 Jul 2014 14:53:07 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407311453.s6VEr7Js031072@svn.freebsd.org> From: Warren Block Date: Thu, 31 Jul 2014 14:53:07 +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: r269334 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 14:53:07 -0000 Author: wblock (doc committer) Date: Thu Jul 31 14:53:07 2014 New Revision: 269334 URL: http://svnweb.freebsd.org/changeset/base/269334 Log: MFC 268931: Correct spelling errors in ctld.8. While here, correct similar errors in ctl.conf.5 and fix a couple of contractions. Modified: stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/ctld/ctld.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Thu Jul 31 14:48:35 2014 (r269333) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Thu Jul 31 14:53:07 2014 (r269334) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2014 +.Dd July 20, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -104,14 +104,14 @@ The following statements are available a .It Ic auth-type Ao Ar type Ac Specifies authentication type. Type can be either "none", "deny", "chap", or "chap-mutual". -In most cases it is not neccessary to set the type using this clause; +In most cases it is not necessary to set the type using this clause; it is usually used to disable authentication for a given auth-group. .It Ic chap Ao Ar user Ac Aq Ar secret Specifies CHAP authentication credentials. .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret Specifies mutual CHAP authentication credentials. Note that for any auth-group, configuration may contain either chap, -or chap-mutual entries; it's an error to mix them. +or chap-mutual entries; it is an error to mix them. .It Ic initiator-name Ao Ar initiator-name Ac Specifies iSCSI initiator name. If not defined, there will be no restrictions based on initiator @@ -158,18 +158,18 @@ without authentication. .It Ic auth-type Ao Ar type Ac Specifies authentication type. Type can be either "none", "deny", "chap", or "chap-mutual". -In most cases it is not neccessary to set the type using this clause; +In most cases it is not necessary to set the type using this clause; it is usually used to disable authentication for a given target. This clause is mutually exclusive with auth-group; one cannot use both in a single target. .It Ic chap Ao Ar user Ac Aq Ar secret Specifies CHAP authentication credentials. Note that targets must use either auth-group, or chap, -or chap-mutual clauses; it's a configuration error to mix them in one target. +or chap-mutual clauses; it is a configuration error to mix them in one target. .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret Specifies mutual CHAP authentication credentials. Note that targets must use either auth-group, chap, or -chap-mutual clauses; it's a configuration error to mix them in one target. +chap-mutual clauses; it is a configuration error to mix them in one target. .It Ic initiator-name Ao Ar initiator-name Ac Specifies iSCSI initiator name. If not defined, there will be no restrictions based on initiator Modified: stable/10/usr.sbin/ctld/ctld.8 ============================================================================== --- stable/10/usr.sbin/ctld/ctld.8 Thu Jul 31 14:48:35 2014 (r269333) +++ stable/10/usr.sbin/ctld/ctld.8 Thu Jul 31 14:53:07 2014 (r269334) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd July 20, 2014 .Dt CTLD 8 .Os .Sh NAME @@ -51,7 +51,7 @@ Then it compares the configuration with by previously running .Nm instances, removes LUNs no longer existing in the configuration file, -and creates new LUNs as neccessary. +and creates new LUNs as necessary. After that it listens for the incoming iSCSI connections, performs authentication, and, if successful, passes the connections to the kernel part of CTL iSCSI target, which handles it from that point. @@ -59,13 +59,13 @@ of CTL iSCSI target, which handles it fr When it receives a SIGHUP signal, the .Nm reloads its configuration and applies the changes to the kernel. -Changes are applied in a way that avoids unneccessary disruptions; +Changes are applied in a way that avoids unnecessary disruptions; for example removing one LUN does not affect other LUNs. .Pp When exiting gracefully, the .Nm daemon removes LUNs it managed and forcibly disconnects all the clients. -Otherwise - e.g. when killed with SIGKILL - LUNs stay configured +Otherwise - for example, when killed with SIGKILL - LUNs stay configured and clients remain connected. .Pp To perform administrative actions that apply to already connected From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 31 17:10:04 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49629483; Thu, 31 Jul 2014 17:10: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 3385B2B1E; Thu, 31 Jul 2014 17:10: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 s6VHA41p097076; Thu, 31 Jul 2014 17:10:04 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6VHA3Oj097059; Thu, 31 Jul 2014 17:10:03 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407311710.s6VHA3Oj097059@svn.freebsd.org> From: Mark Johnston Date: Thu, 31 Jul 2014 17:10:03 +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: r269342 - in stable/10/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/common/sys contrib/opensolaris/uts/intel/dtrace dev/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 17:10:04 -0000 Author: markj Date: Thu Jul 31 17:10:03 2014 New Revision: 269342 URL: http://svnweb.freebsd.org/changeset/base/269342 Log: MFC r264434: DTrace's pid provider works by inserting breakpoint instructions at probe sites and installing a hook at the kernel's trap handler. The fasttrap code will emulate the overwritten instruction in some common cases, but otherwise copies it out into some scratch space in the traced process' address space and ensures that it's executed after returning from the trap. In Solaris and illumos, this (per-thread) scratch space comes from some reserved space in TLS, accessible via the fs segment register. This approach is somewhat unappealing on FreeBSD since it would require some modifications to rtld and jemalloc (for static TLS) to ensure that TLS is executable, and would thus introduce dependencies on their implementation details. I think it would also be impossible to safely trace static binaries compiled without these modifications. This change implements the functionality in a different way, by having fasttrap map pages into the target process' address space on demand. Each page is divided into 64-byte chunks for use by individual threads, and fasttrap's process descriptor struct has been extended to keep track of any scratch space allocated for the corresponding process. With this change it's possible to trace all libc functions in a program, e.g. with pid$target:libc.so.*::entry {@[probefunc] = count();} Previously this would generally cause the victim process to crash, as tracing memcpy on amd64 requires the functionality described above. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/10/sys/cddl/dev/dtrace/dtrace_cddl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Jul 31 16:54:54 2014 (r269341) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Jul 31 17:10:03 2014 (r269342) @@ -61,8 +61,13 @@ #include #include #if !defined(sun) -#include #include +#include +#include +#include +#include +#include +#include #include #include #endif @@ -207,6 +212,10 @@ static void fasttrap_provider_free(fastt static fasttrap_proc_t *fasttrap_proc_lookup(pid_t); static void fasttrap_proc_release(fasttrap_proc_t *); +#if !defined(sun) +static void fasttrap_thread_dtor(void *, struct thread *); +#endif + #define FASTTRAP_PROVS_INDEX(pid, name) \ ((fasttrap_hash_str(name) + (pid)) & fasttrap_provs.fth_mask) @@ -214,6 +223,7 @@ static void fasttrap_proc_release(fasttr #if !defined(sun) static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +static eventhandler_tag fasttrap_thread_dtor_tag; #endif static int @@ -290,6 +300,118 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t #endif } +#if !defined(sun) +/* + * Obtain a chunk of scratch space in the address space of the target process. + */ +fasttrap_scrspace_t * +fasttrap_scraddr(struct thread *td, fasttrap_proc_t *fprc) +{ + fasttrap_scrblock_t *scrblk; + fasttrap_scrspace_t *scrspc; + struct proc *p; + vm_offset_t addr; + int error, i; + + scrspc = NULL; + if (td->t_dtrace_sscr != NULL) { + /* If the thread already has scratch space, we're done. */ + scrspc = (fasttrap_scrspace_t *)td->t_dtrace_sscr; + return (scrspc); + } + + p = td->td_proc; + + mutex_enter(&fprc->ftpc_mtx); + if (LIST_EMPTY(&fprc->ftpc_fscr)) { + /* + * No scratch space is available, so we'll map a new scratch + * space block into the traced process' address space. + */ + addr = 0; + error = vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, + FASTTRAP_SCRBLOCK_SIZE, 0, VMFS_ANY_SPACE, VM_PROT_ALL, + VM_PROT_ALL, 0); + if (error != KERN_SUCCESS) + goto done; + + scrblk = malloc(sizeof(*scrblk), M_SOLARIS, M_WAITOK); + scrblk->ftsb_addr = addr; + LIST_INSERT_HEAD(&fprc->ftpc_scrblks, scrblk, ftsb_next); + + /* + * Carve the block up into chunks and put them on the free list. + */ + for (i = 0; + i < FASTTRAP_SCRBLOCK_SIZE / FASTTRAP_SCRSPACE_SIZE; i++) { + scrspc = malloc(sizeof(*scrspc), M_SOLARIS, M_WAITOK); + scrspc->ftss_addr = addr + + i * FASTTRAP_SCRSPACE_SIZE; + LIST_INSERT_HEAD(&fprc->ftpc_fscr, scrspc, + ftss_next); + } + } + + /* + * Take the first scratch chunk off the free list, put it on the + * allocated list, and return its address. + */ + scrspc = LIST_FIRST(&fprc->ftpc_fscr); + LIST_REMOVE(scrspc, ftss_next); + LIST_INSERT_HEAD(&fprc->ftpc_ascr, scrspc, ftss_next); + + /* + * This scratch space is reserved for use by td until the thread exits. + */ + td->t_dtrace_sscr = scrspc; + +done: + mutex_exit(&fprc->ftpc_mtx); + + return (scrspc); +} + +/* + * Return any allocated per-thread scratch space chunks back to the process' + * free list. + */ +static void +fasttrap_thread_dtor(void *arg __unused, struct thread *td) +{ + fasttrap_bucket_t *bucket; + fasttrap_proc_t *fprc; + fasttrap_scrspace_t *scrspc; + pid_t pid; + + if (td->t_dtrace_sscr == NULL) + return; + + pid = td->td_proc->p_pid; + bucket = &fasttrap_procs.fth_table[FASTTRAP_PROCS_INDEX(pid)]; + fprc = NULL; + + /* Look up the fasttrap process handle for this process. */ + mutex_enter(&bucket->ftb_mtx); + for (fprc = bucket->ftb_data; fprc != NULL; fprc = fprc->ftpc_next) { + if (fprc->ftpc_pid == pid) { + mutex_enter(&fprc->ftpc_mtx); + mutex_exit(&bucket->ftb_mtx); + break; + } + } + if (fprc == NULL) { + mutex_exit(&bucket->ftb_mtx); + return; + } + + scrspc = (fasttrap_scrspace_t *)td->t_dtrace_sscr; + LIST_REMOVE(scrspc, ftss_next); + LIST_INSERT_HEAD(&fprc->ftpc_fscr, scrspc, ftss_next); + + mutex_exit(&fprc->ftpc_mtx); +} +#endif + /* * This function ensures that no threads are actively using the memory * associated with probes that were formerly live. @@ -450,6 +572,10 @@ fasttrap_pid_cleanup(void) static void fasttrap_fork(proc_t *p, proc_t *cp) { +#if !defined(sun) + fasttrap_scrblock_t *scrblk; + fasttrap_proc_t *fprc = NULL; +#endif pid_t ppid = p->p_pid; int i; @@ -535,9 +661,28 @@ fasttrap_fork(proc_t *p, proc_t *cp) * mid-fork. */ ASSERT(tp->ftt_proc->ftpc_acount != 0); +#if !defined(sun) + fprc = tp->ftt_proc; +#endif } } mutex_exit(&bucket->ftb_mtx); + +#if !defined(sun) + /* + * Unmap any scratch space inherited from the parent's address + * space. + */ + if (fprc != NULL) { + mutex_enter(&fprc->ftpc_mtx); + LIST_FOREACH(scrblk, &fprc->ftpc_scrblks, ftsb_next) { + vm_map_remove(&cp->p_vmspace->vm_map, + scrblk->ftsb_addr, + scrblk->ftsb_addr + FASTTRAP_SCRBLOCK_SIZE); + } + mutex_exit(&fprc->ftpc_mtx); + } +#endif } #if defined(sun) @@ -558,12 +703,24 @@ fasttrap_fork(proc_t *p, proc_t *cp) static void fasttrap_exec_exit(proc_t *p) { +#if !defined(sun) + struct thread *td; +#endif + #if defined(sun) ASSERT(p == curproc); -#endif +#else PROC_LOCK_ASSERT(p, MA_OWNED); _PHOLD(p); + /* + * Since struct threads may be recycled, we cannot rely on t_dtrace_sscr + * fields to be zeroed by kdtrace_thread_ctor. Thus we must zero it + * ourselves when a process exits. + */ + FOREACH_THREAD_IN_PROC(p, td) + td->t_dtrace_sscr = NULL; PROC_UNLOCK(p); +#endif /* * We clean up the pid provider for this process here; user-land @@ -573,9 +730,9 @@ fasttrap_exec_exit(proc_t *p) #if !defined(sun) if (p->p_dtrace_helpers) dtrace_helpers_destroy(p); -#endif PROC_LOCK(p); _PRELE(p); +#endif } @@ -1368,6 +1525,12 @@ fasttrap_proc_release(fasttrap_proc_t *p fasttrap_bucket_t *bucket; fasttrap_proc_t *fprc, **fprcp; pid_t pid = proc->ftpc_pid; +#if !defined(sun) + fasttrap_scrblock_t *scrblk, *scrblktmp; + fasttrap_scrspace_t *scrspc, *scrspctmp; + struct proc *p; + struct thread *td; +#endif mutex_enter(&proc->ftpc_mtx); @@ -1379,6 +1542,31 @@ fasttrap_proc_release(fasttrap_proc_t *p return; } +#if !defined(sun) + /* + * Free all structures used to manage per-thread scratch space. + */ + LIST_FOREACH_SAFE(scrblk, &proc->ftpc_scrblks, ftsb_next, + scrblktmp) { + LIST_REMOVE(scrblk, ftsb_next); + free(scrblk, M_SOLARIS); + } + LIST_FOREACH_SAFE(scrspc, &proc->ftpc_fscr, ftss_next, scrspctmp) { + LIST_REMOVE(scrspc, ftss_next); + free(scrspc, M_SOLARIS); + } + LIST_FOREACH_SAFE(scrspc, &proc->ftpc_ascr, ftss_next, scrspctmp) { + LIST_REMOVE(scrspc, ftss_next); + free(scrspc, M_SOLARIS); + } + + if ((p = pfind(pid)) != NULL) { + FOREACH_THREAD_IN_PROC(p, td) + td->t_dtrace_sscr = NULL; + PROC_UNLOCK(p); + } +#endif + mutex_exit(&proc->ftpc_mtx); /* @@ -2362,6 +2550,13 @@ fasttrap_load(void) mutex_init(&fasttrap_cpuc_pid_lock[i], "fasttrap barrier", MUTEX_DEFAULT, NULL); } + + /* + * This event handler must run before kdtrace_thread_dtor() since it + * accesses the thread's struct kdtrace_thread. + */ + fasttrap_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, + fasttrap_thread_dtor, NULL, EVENTHANDLER_PRI_FIRST); #endif /* @@ -2463,6 +2658,8 @@ fasttrap_unload(void) #endif #if !defined(sun) + EVENTHANDLER_DEREGISTER(thread_dtor, fasttrap_thread_dtor_tag); + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); for (i = 0; i < fasttrap_provs.fth_nent; i++) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Thu Jul 31 16:54:54 2014 (r269341) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Thu Jul 31 17:10:03 2014 (r269342) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -68,14 +69,41 @@ extern "C" { * then disabled, ownership of that tracepoint may be exchanged for an * unused tracepoint belonging to another probe that was attached to the * enabled tracepoint. + * + * On FreeBSD, fasttrap providers also maintain per-thread scratch space for use + * by the ISA-specific fasttrap code. The fasttrap_scrblock_t type stores the + * virtual address of a page-sized memory block that is mapped into a process' + * address space. Each block is carved up into chunks (fasttrap_scrspace_t) for + * use by individual threads, which keep the address of their scratch space + * chunk in their struct kdtrace_thread. A thread's scratch space isn't released + * until it exits. */ +#if !defined(sun) +typedef struct fasttrap_scrblock { + vm_offset_t ftsb_addr; /* address of a scratch block */ + LIST_ENTRY(fasttrap_scrblock) ftsb_next;/* next block in list */ +} fasttrap_scrblock_t; +#define FASTTRAP_SCRBLOCK_SIZE PAGE_SIZE + +typedef struct fasttrap_scrspace { + uintptr_t ftss_addr; /* scratch space address */ + LIST_ENTRY(fasttrap_scrspace) ftss_next;/* next in list */ +} fasttrap_scrspace_t; +#define FASTTRAP_SCRSPACE_SIZE 64 +#endif + typedef struct fasttrap_proc { pid_t ftpc_pid; /* process ID for this proc */ uint64_t ftpc_acount; /* count of active providers */ uint64_t ftpc_rcount; /* count of extant providers */ kmutex_t ftpc_mtx; /* lock on all but acount */ struct fasttrap_proc *ftpc_next; /* next proc in hash chain */ +#if !defined(sun) + LIST_HEAD(, fasttrap_scrblock) ftpc_scrblks; /* mapped scratch blocks */ + LIST_HEAD(, fasttrap_scrspace) ftpc_fscr; /* free scratch space */ + LIST_HEAD(, fasttrap_scrspace) ftpc_ascr; /* used scratch space */ +#endif } fasttrap_proc_t; typedef struct fasttrap_provider { @@ -170,6 +198,10 @@ typedef struct fasttrap_hash { #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); +#if !defined(sun) +extern fasttrap_scrspace_t *fasttrap_scraddr(struct thread *, + fasttrap_proc_t *); +#endif extern dtrace_id_t fasttrap_probe_id; extern fasttrap_hash_t fasttrap_tpoints; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Jul 31 16:54:54 2014 (r269341) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Jul 31 17:10:03 2014 (r269342) @@ -1526,7 +1526,6 @@ fasttrap_pid_probe(struct reg *rp) uint_t i = 0; #if defined(sun) klwp_t *lwp = ttolwp(curthread); -#endif /* * Compute the address of the ulwp_t and step over the @@ -1534,7 +1533,6 @@ fasttrap_pid_probe(struct reg *rp) * thread pointer is very different on 32- and 64-bit * kernels. */ -#if defined(sun) #if defined(__amd64) if (p->p_model == DATAMODEL_LP64) { addr = lwp->lwp_pcb.pcb_fsbase; @@ -1547,13 +1545,23 @@ fasttrap_pid_probe(struct reg *rp) addr = USD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); addr += sizeof (void *); #endif -#endif /* sun */ -#ifdef __i386__ - addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd); #else - addr = curthread->td_pcb->pcb_gsbase; -#endif - addr += sizeof (void *); + fasttrap_scrspace_t *scrspace; + scrspace = fasttrap_scraddr(curthread, tp->ftt_proc); + if (scrspace == NULL) { + /* + * We failed to allocate scratch space for this thread. + * Try to write the original instruction back out and + * reset the pc. + */ + if (fasttrap_copyout(tp->ftt_instr, (void *)pc, + tp->ftt_size)) + fasttrap_sigtrap(p, curthread, pc); + new_pc = pc; + break; + } + addr = scrspace->ftss_addr; +#endif /* sun */ /* * Generic Instruction Tracing Modified: stable/10/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Jul 31 16:54:54 2014 (r269341) +++ stable/10/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Jul 31 17:10:03 2014 (r269342) @@ -84,6 +84,7 @@ typedef struct kdtrace_thread { #endif u_int64_t td_hrtime; /* Last time on cpu. */ int td_errno; /* Syscall return value. */ + void *td_dtrace_sscr; /* Saved scratch space location. */ } kdtrace_thread_t; /* @@ -108,10 +109,12 @@ typedef struct kdtrace_thread { #define t_dtrace_scrpc td_dtrace->td_dtrace_scrpc #define t_dtrace_astpc td_dtrace->td_dtrace_astpc #define t_dtrace_regv td_dtrace->td_dtrace_regv +#define t_dtrace_sscr td_dtrace->td_dtrace_sscr #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes #define p_model p_dtrace->p_dtrace_model + #define DATAMODEL_NATIVE 0 #ifdef __amd64__ #define DATAMODEL_LP64 0 From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 31 23:04:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BEC8B66; Thu, 31 Jul 2014 23:04: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 0C9A826E7; Thu, 31 Jul 2014 23:04: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 s6VN4fYR066724; Thu, 31 Jul 2014 23:04:41 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6VN4fer066720; Thu, 31 Jul 2014 23:04:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407312304.s6VN4fer066720@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 31 Jul 2014 23:04: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: r269356 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 23:04:42 -0000 Author: np Date: Thu Jul 31 23:04:41 2014 New Revision: 269356 URL: http://svnweb.freebsd.org/changeset/base/269356 Log: MFC r268971 and r269032. r268971: Simplify r267600, there's no need to distinguish between allocated and inlined mbufs. r269032: cxgbe(4): Keep track of the clusters that have to be freed by the custom free routine (rxb_free) in the driver. Fail MOD_UNLOAD with EBUSY if any such cluster has been handed up to the kernel but hasn't been freed yet. This prevents a panic later when the cluster finally needs to be freed but rxb_free is gone from the kernel. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Thu Jul 31 22:32:39 2014 (r269355) +++ stable/10/sys/dev/cxgbe/adapter.h Thu Jul 31 23:04:41 2014 (r269356) @@ -254,8 +254,7 @@ struct cluster_metadata { struct fl_sdesc { caddr_t cl; - uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */ - uint8_t nembuf; /* # of allocated mbufs with ref */ + uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */ struct cluster_layout cll; }; @@ -852,6 +851,8 @@ void end_synchronized_op(struct adapter /* t4_sge.c */ void t4_sge_modload(void); +void t4_sge_modunload(void); +uint64_t t4_sge_extfree_refs(void); void t4_init_sge_cpl_handlers(struct adapter *); void t4_tweak_chip_settings(struct adapter *); int t4_read_chip_settings(struct adapter *); Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Thu Jul 31 22:32:39 2014 (r269355) +++ stable/10/sys/dev/cxgbe/t4_main.c Thu Jul 31 23:04:41 2014 (r269356) @@ -8090,6 +8090,9 @@ tweak_tunables(void) t4_intr_types &= INTR_MSIX | INTR_MSI | INTR_INTX; } +static struct sx mlu; /* mod load unload */ +SX_SYSINIT(cxgbe_mlu, &mlu, "cxgbe mod load/unload"); + static int mod_event(module_t mod, int cmd, void *arg) { @@ -8098,41 +8101,67 @@ mod_event(module_t mod, int cmd, void *a switch (cmd) { case MOD_LOAD: - if (atomic_fetchadd_int(&loaded, 1)) - break; - t4_sge_modload(); - sx_init(&t4_list_lock, "T4/T5 adapters"); - SLIST_INIT(&t4_list); + sx_xlock(&mlu); + if (loaded++ == 0) { + t4_sge_modload(); + sx_init(&t4_list_lock, "T4/T5 adapters"); + SLIST_INIT(&t4_list); #ifdef TCP_OFFLOAD - sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); - SLIST_INIT(&t4_uld_list); + sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); + SLIST_INIT(&t4_uld_list); #endif - t4_tracer_modload(); - tweak_tunables(); + t4_tracer_modload(); + tweak_tunables(); + } + sx_xunlock(&mlu); break; case MOD_UNLOAD: - if (atomic_fetchadd_int(&loaded, -1) > 1) - break; - t4_tracer_modunload(); + sx_xlock(&mlu); + if (--loaded == 0) { + int tries; + + sx_slock(&t4_list_lock); + if (!SLIST_EMPTY(&t4_list)) { + rc = EBUSY; + sx_sunlock(&t4_list_lock); + goto done_unload; + } +#ifdef TCP_OFFLOAD + sx_slock(&t4_uld_list_lock); + if (!SLIST_EMPTY(&t4_uld_list)) { + rc = EBUSY; + sx_sunlock(&t4_uld_list_lock); + sx_sunlock(&t4_list_lock); + goto done_unload; + } +#endif + tries = 0; + while (tries++ < 5 && t4_sge_extfree_refs() != 0) { + uprintf("%ju clusters with custom free routine " + "still is use.\n", t4_sge_extfree_refs()); + pause("t4unload", 2 * hz); + } #ifdef TCP_OFFLOAD - sx_slock(&t4_uld_list_lock); - if (!SLIST_EMPTY(&t4_uld_list)) { - rc = EBUSY; sx_sunlock(&t4_uld_list_lock); - break; - } - sx_sunlock(&t4_uld_list_lock); - sx_destroy(&t4_uld_list_lock); #endif - sx_slock(&t4_list_lock); - if (!SLIST_EMPTY(&t4_list)) { - rc = EBUSY; sx_sunlock(&t4_list_lock); - break; + + if (t4_sge_extfree_refs() == 0) { + t4_tracer_modunload(); +#ifdef TCP_OFFLOAD + sx_destroy(&t4_uld_list_lock); +#endif + sx_destroy(&t4_list_lock); + t4_sge_modunload(); + loaded = 0; + } else { + rc = EBUSY; + loaded++; /* undo earlier decrement */ + } } - sx_sunlock(&t4_list_lock); - sx_destroy(&t4_list_lock); +done_unload: + sx_xunlock(&mlu); break; } Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Thu Jul 31 22:32:39 2014 (r269355) +++ stable/10/sys/dev/cxgbe/t4_sge.c Thu Jul 31 23:04:41 2014 (r269356) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -242,6 +243,9 @@ static int handle_fw_msg(struct sge_iq * static int sysctl_uint16(SYSCTL_HANDLER_ARGS); static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); +static counter_u64_t extfree_refs; +static counter_u64_t extfree_rels; + /* * Called on MOD_LOAD. Validates and calculates the SGE tunables. */ @@ -313,6 +317,30 @@ t4_sge_modload(void) " using 0 instead.\n", cong_drop); cong_drop = 0; } + + extfree_refs = counter_u64_alloc(M_WAITOK); + extfree_rels = counter_u64_alloc(M_WAITOK); + counter_u64_zero(extfree_refs); + counter_u64_zero(extfree_rels); +} + +void +t4_sge_modunload(void) +{ + + counter_u64_free(extfree_refs); + counter_u64_free(extfree_rels); +} + +uint64_t +t4_sge_extfree_refs(void) +{ + uint64_t refs, rels; + + rels = counter_u64_fetch(extfree_rels); + refs = counter_u64_fetch(extfree_refs); + + return (refs - rels); } void @@ -1450,6 +1478,7 @@ rxb_free(struct mbuf *m, void *arg1, voi caddr_t cl = arg2; uma_zfree(zone, cl); + counter_u64_add(extfree_rels, 1); return (EXT_FREE_OK); } @@ -1498,7 +1527,7 @@ get_scatter_segment(struct adapter *sc, /* copy data to mbuf */ bcopy(payload, mtod(m, caddr_t), len); - } else if (sd->nimbuf * MSIZE < cll->region1) { + } else if (sd->nmbuf * MSIZE < cll->region1) { /* * There's spare room in the cluster for an mbuf. Create one @@ -1506,14 +1535,15 @@ get_scatter_segment(struct adapter *sc, */ MPASS(clm != NULL); - m = (struct mbuf *)(sd->cl + sd->nimbuf * MSIZE); + m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); /* No bzero required */ if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE)) return (NULL); fl->mbuf_inlined++; m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nimbuf++; + if (sd->nmbuf++ == 0) + counter_u64_add(extfree_refs, 1); } else { @@ -1530,7 +1560,8 @@ get_scatter_segment(struct adapter *sc, if (clm != NULL) { m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nembuf++; + if (sd->nmbuf++ == 0) + counter_u64_add(extfree_refs, 1); } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ @@ -3055,7 +3086,7 @@ refill_fl(struct adapter *sc, struct sge if (sd->cl != NULL) { - if (sd->nimbuf + sd->nembuf == 0) { + if (sd->nmbuf == 0) { /* * Fast recycle without involving any atomics on * the cluster's metadata (if the cluster has @@ -3082,6 +3113,7 @@ refill_fl(struct adapter *sc, struct sge if (atomic_fetchadd_int(&clm->refcount, -1) == 1) { fl->cl_recycled++; + counter_u64_add(extfree_rels, 1); goto recycled; } sd->cl = NULL; /* gave up my reference */ @@ -3114,8 +3146,7 @@ recycled: #endif clm->refcount = 1; } - sd->nimbuf = 0; - sd->nembuf = 0; + sd->nmbuf = 0; recycled_fast: fl->pending++; fl->needed--; @@ -3184,9 +3215,11 @@ free_fl_sdesc(struct adapter *sc, struct cll = &sd->cll; clm = cl_metadata(sc, fl, cll, sd->cl); - if (sd->nimbuf + sd->nembuf == 0 || - (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) { + if (sd->nmbuf == 0) + uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); + else if (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1) { uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); + counter_u64_add(extfree_rels, 1); } sd->cl = NULL; } From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 31 23:09:23 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F1A3D5E; Thu, 31 Jul 2014 23:09: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 0BF4B2743; Thu, 31 Jul 2014 23:09: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 s6VN9MMJ067586; Thu, 31 Jul 2014 23:09:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6VN9M4v067585; Thu, 31 Jul 2014 23:09:22 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407312309.s6VN9M4v067585@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 31 Jul 2014 23:09:22 +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: r269357 - stable/10/tools/tools/cxgbetool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 23:09:23 -0000 Author: np Date: Thu Jul 31 23:09:22 2014 New Revision: 269357 URL: http://svnweb.freebsd.org/changeset/base/269357 Log: MFC r269106: Add a 'raw' parameter to the 'modinfo' subcommand. This is handy when trying to figure out why a QSFP+/SFP+ connector or cable wasn't identified correctly by cxgbe(4). Its output looks like this: # cxgbetool t5nex0 modinfo 0 raw 00: 03 04 21 00 00 00 00 00 ..!. .... 08: 04 00 00 00 67 00 00 00 .... g... 10: 00 00 05 00 41 6d 70 68 .... Amph 18: 65 6e 6f 6c 20 20 20 20 enol 20: 20 20 20 20 00 41 50 48 .APH 28: 35 37 31 35 34 30 30 30 5715 4000 30: 33 20 20 20 20 20 20 20 3 38: 4b 20 20 20 01 00 00 fa K .... 40: 00 00 00 00 41 50 46 31 .... APF1 48: 30 30 34 30 30 33 30 30 0040 0300 50: 30 33 20 20 31 30 30 31 03 1001 58: 33 30 20 20 00 00 00 97 30 .... Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/10/tools/tools/cxgbetool/cxgbetool.c Thu Jul 31 23:04:41 2014 (r269356) +++ stable/10/tools/tools/cxgbetool/cxgbetool.c Thu Jul 31 23:09:22 2014 (r269357) @@ -95,7 +95,7 @@ usage(FILE *fp) "\ti2c [] read from i2c device\n" "\tloadfw install firmware\n" "\tmemdump dump a memory range\n" - "\tmodinfo optics/cable information\n" + "\tmodinfo [raw] optics/cable information\n" "\treg
[=] read/write register\n" "\treg64
[=] read/write 64 bit register\n" "\tregdump [] ... dump registers\n" @@ -1873,6 +1873,41 @@ tracer_cmd(int argc, const char *argv[]) } static int +modinfo_raw(int port_id) +{ + uint8_t offset; + struct t4_i2c_data i2cd; + int rc; + + for (offset = 0; offset < 96; offset += sizeof(i2cd.data)) { + bzero(&i2cd, sizeof(i2cd)); + i2cd.port_id = port_id; + i2cd.dev_addr = 0xa0; + i2cd.offset = offset; + i2cd.len = sizeof(i2cd.data); + rc = doit(CHELSIO_T4_GET_I2C, &i2cd); + if (rc != 0) + return (rc); + printf("%02x: %02x %02x %02x %02x %02x %02x %02x %02x", + offset, i2cd.data[0], i2cd.data[1], i2cd.data[2], + i2cd.data[3], i2cd.data[4], i2cd.data[5], i2cd.data[6], + i2cd.data[7]); + + printf(" %c%c%c%c %c%c%c%c\n", + isprint(i2cd.data[0]) ? i2cd.data[0] : '.', + isprint(i2cd.data[1]) ? i2cd.data[1] : '.', + isprint(i2cd.data[2]) ? i2cd.data[2] : '.', + isprint(i2cd.data[3]) ? i2cd.data[3] : '.', + isprint(i2cd.data[4]) ? i2cd.data[4] : '.', + isprint(i2cd.data[5]) ? i2cd.data[5] : '.', + isprint(i2cd.data[6]) ? i2cd.data[6] : '.', + isprint(i2cd.data[7]) ? i2cd.data[7] : '.'); + } + + return (0); +} + +static int modinfo(int argc, const char *argv[]) { long port; @@ -1881,17 +1916,31 @@ modinfo(int argc, const char *argv[]) int rc, i; uint16_t temp, vcc, tx_bias, tx_power, rx_power; - if (argc != 1) { + if (argc < 1) { warnx("must supply a port"); return (EINVAL); } + if (argc > 2) { + warnx("too many arguments"); + return (EINVAL); + } + p = str_to_number(argv[0], &port, NULL); if (*p || port > UCHAR_MAX) { warnx("invalid port id \"%s\"", argv[0]); return (EINVAL); } + if (argc == 2) { + if (!strcmp(argv[1], "raw")) + return (modinfo_raw(port)); + else { + warnx("second argument can only be \"raw\""); + return (EINVAL); + } + } + bzero(&i2cd, sizeof(i2cd)); i2cd.len = 1; i2cd.port_id = port; From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 04:05:14 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1153E61E; Fri, 1 Aug 2014 04:05: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 F2A562620; Fri, 1 Aug 2014 04:05: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 s7145D0T032885; Fri, 1 Aug 2014 04:05:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7145DHx032884; Fri, 1 Aug 2014 04:05:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201408010405.s7145DHx032884@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Aug 2014 04:05:13 +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: r269367 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 04:05:14 -0000 Author: kib Date: Fri Aug 1 04:05:13 2014 New Revision: 269367 URL: http://svnweb.freebsd.org/changeset/base/269367 Log: MFC r269205: Simplify the expression. Modified: stable/10/sys/kern/kern_proc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Fri Aug 1 01:53:39 2014 (r269366) +++ stable/10/sys/kern/kern_proc.c Fri Aug 1 04:05:13 2014 (r269367) @@ -2148,7 +2148,7 @@ kern_proc_vmmap_resident(vm_map_t map, v obj = entry->object.vm_object; addr = entry->start; m_adv = NULL; - pi = OFF_TO_IDX(entry->offset + addr - entry->start); + pi = OFF_TO_IDX(entry->offset); for (; addr < entry->end; addr += IDX_TO_OFF(pi_adv), pi += pi_adv) { if (m_adv != NULL) { m = m_adv; From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 15:04:47 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0964C69; Fri, 1 Aug 2014 15:04: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 912852B66; Fri, 1 Aug 2014 15:04: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 s71F4l5r038580; Fri, 1 Aug 2014 15:04:47 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71F4k7u038574; Fri, 1 Aug 2014 15:04:46 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201408011504.s71F4k7u038574@svn.freebsd.org> From: Don Lewis Date: Fri, 1 Aug 2014 15:04:46 +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: r269383 - in stable/10: share/man/man9 sys/kern sys/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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 15:04:47 -0000 Author: truckman Date: Fri Aug 1 15:04:46 2014 New Revision: 269383 URL: http://svnweb.freebsd.org/changeset/base/269383 Log: MFC r268780 Nuke the never-used RF_TIMESHARE feature, reducing the complexity of the code. The consensus on arch@ is that this feature might have been useful in the distant past, but is now just unnecessary bloat. The int_rman_activate_resource() and int_rman_deactivate_resource() functions become trivial, so manually inline them. The special deferred handling of RF_ACTIVE is no longer needed in reserve_resource_bound(), so eliminate the associated code at the end of the function. These changes reduce the object file size by more than 500 bytes on i386. Update the rman.9 man page to reflect the removal of the RF_TIMESHARE feature. Modified: stable/10/share/man/man9/rman.9 stable/10/sys/kern/subr_rman.c stable/10/sys/sys/rman.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/rman.9 ============================================================================== --- stable/10/share/man/man9/rman.9 Fri Aug 1 14:10:10 2014 (r269382) +++ stable/10/share/man/man9/rman.9 Fri Aug 1 15:04:46 2014 (r269383) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2011 +.Dd July 15, 2014 .Dt RMAN 9 .Os .Sh NAME @@ -141,13 +141,11 @@ represented by a 16-bit flag register, a #define RF_ALLOCATED 0x0001 /* resource has been reserved */ #define RF_ACTIVE 0x0002 /* resource allocation has been activated */ #define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */ -#define RF_TIMESHARE 0x0008 /* resource permits time-division sharing */ -#define RF_WANTED 0x0010 /* somebody is waiting for this resource */ #define RF_FIRSTSHARE 0x0020 /* first in sharing list */ #define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */ .Ed .Pp -The remainder of the flag bits are used to represent the desired alignment +Bits 15:10 of the flag register are used to represent the desired alignment of the resource within the region. .Pp The @@ -299,12 +297,9 @@ The .Fa bound argument must be a power of two. It may be set to zero to specify no boundary restriction. -The default behavior is to allocate an exclusive segment, unless the +A shared segment will be allocated if the .Dv RF_SHAREABLE -or -.Dv RF_TIMESHARE -flags are set, in which case a shared -segment will be allocated. +flag is set, otherwise an exclusive segment will be allocated. If this shared segment already exists, the caller has its device added to the list of consumers. .Pp Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Fri Aug 1 14:10:10 2014 (r269382) +++ stable/10/sys/kern/subr_rman.c Fri Aug 1 15:04:46 2014 (r269383) @@ -110,9 +110,6 @@ static MALLOC_DEFINE(M_RMAN, "rman", "Re struct rman_head rman_head; static struct mtx rman_mtx; /* mutex to protect rman_head */ -static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, - struct resource_i **whohas); -static int int_rman_deactivate_resource(struct resource_i *r); static int int_rman_release_resource(struct rman *rm, struct resource_i *r); static __inline struct resource_i * @@ -322,7 +319,7 @@ rman_adjust_resource(struct resource *rr /* Not supported for shared resources. */ r = rr->__r_i; - if (r->r_flags & (RF_TIMESHARE | RF_SHAREABLE)) + if (r->r_flags & RF_SHAREABLE) return (EINVAL); /* @@ -435,7 +432,7 @@ rman_adjust_resource(struct resource *rr return (0); } -#define SHARE_TYPE(f) (f & (RF_SHAREABLE | RF_TIMESHARE | RF_PREFETCHABLE)) +#define SHARE_TYPE(f) (f & (RF_SHAREABLE | RF_PREFETCHABLE)) struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, @@ -452,10 +449,9 @@ rman_reserve_resource_bound(struct rman "length %#lx, flags %u, device %s\n", rm->rm_descr, start, end, count, flags, dev == NULL ? "" : device_get_nameunit(dev))); - KASSERT((flags & (RF_WANTED | RF_FIRSTSHARE)) == 0, + KASSERT((flags & RF_FIRSTSHARE) == 0, ("invalid flags %#x", flags)); - new_rflags = (flags & ~(RF_ACTIVE | RF_WANTED | RF_FIRSTSHARE)) | - RF_ALLOCATED; + new_rflags = (flags & ~RF_FIRSTSHARE) | RF_ALLOCATED; mtx_lock(rm->rm_mtx); @@ -601,7 +597,7 @@ rman_reserve_resource_bound(struct rman * additional work, but this does not seem warranted.) */ DPRINTF(("no unshared regions found\n")); - if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0) + if ((flags & RF_SHAREABLE) == 0) goto out; for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) { @@ -636,25 +632,11 @@ rman_reserve_resource_bound(struct rman goto out; } } - /* * We couldn't find anything. */ -out: - /* - * If the user specified RF_ACTIVE in flags, we attempt to atomically - * activate the resource. If this fails, we release the resource - * and indicate overall failure. (This behavior probably doesn't - * make sense for RF_TIMESHARE-type resources.) - */ - if (rv && (flags & RF_ACTIVE) != 0) { - struct resource_i *whohas; - if (int_rman_activate_resource(rm, rv, &whohas)) { - int_rman_release_resource(rm, rv); - rv = NULL; - } - } +out: mtx_unlock(rm->rm_mtx); return (rv == NULL ? NULL : &rv->r_r); } @@ -668,91 +650,17 @@ rman_reserve_resource(struct rman *rm, u dev)); } -static int -int_rman_activate_resource(struct rman *rm, struct resource_i *r, - struct resource_i **whohas) -{ - struct resource_i *s; - int ok; - - /* - * If we are not timesharing, then there is nothing much to do. - * If we already have the resource, then there is nothing at all to do. - * If we are not on a sharing list with anybody else, then there is - * little to do. - */ - if ((r->r_flags & RF_TIMESHARE) == 0 - || (r->r_flags & RF_ACTIVE) != 0 - || r->r_sharehead == NULL) { - r->r_flags |= RF_ACTIVE; - return 0; - } - - ok = 1; - for (s = LIST_FIRST(r->r_sharehead); s && ok; - s = LIST_NEXT(s, r_sharelink)) { - if ((s->r_flags & RF_ACTIVE) != 0) { - ok = 0; - *whohas = s; - } - } - if (ok) { - r->r_flags |= RF_ACTIVE; - return 0; - } - return EBUSY; -} - int rman_activate_resource(struct resource *re) { - int rv; - struct resource_i *r, *whohas; + struct resource_i *r; struct rman *rm; r = re->__r_i; rm = r->r_rm; mtx_lock(rm->rm_mtx); - rv = int_rman_activate_resource(rm, r, &whohas); + r->r_flags |= RF_ACTIVE; mtx_unlock(rm->rm_mtx); - return rv; -} - -int -rman_await_resource(struct resource *re, int pri, int timo) -{ - int rv; - struct resource_i *r, *whohas; - struct rman *rm; - - r = re->__r_i; - rm = r->r_rm; - mtx_lock(rm->rm_mtx); - for (;;) { - rv = int_rman_activate_resource(rm, r, &whohas); - if (rv != EBUSY) - return (rv); /* returns with mutex held */ - - if (r->r_sharehead == NULL) - panic("rman_await_resource"); - whohas->r_flags |= RF_WANTED; - rv = msleep(r->r_sharehead, rm->rm_mtx, pri, "rmwait", timo); - if (rv) { - mtx_unlock(rm->rm_mtx); - return (rv); - } - } -} - -static int -int_rman_deactivate_resource(struct resource_i *r) -{ - - r->r_flags &= ~RF_ACTIVE; - if (r->r_flags & RF_WANTED) { - r->r_flags &= ~RF_WANTED; - wakeup(r->r_sharehead); - } return 0; } @@ -763,7 +671,7 @@ rman_deactivate_resource(struct resource rm = r->__r_i->r_rm; mtx_lock(rm->rm_mtx); - int_rman_deactivate_resource(r->__r_i); + r->__r_i->r_flags &= ~RF_ACTIVE; mtx_unlock(rm->rm_mtx); return 0; } @@ -774,7 +682,7 @@ int_rman_release_resource(struct rman *r struct resource_i *s, *t; if (r->r_flags & RF_ACTIVE) - int_rman_deactivate_resource(r); + r->r_flags &= ~RF_ACTIVE; /* * Check for a sharing list first. If there is one, then we don't Modified: stable/10/sys/sys/rman.h ============================================================================== --- stable/10/sys/sys/rman.h Fri Aug 1 14:10:10 2014 (r269382) +++ stable/10/sys/sys/rman.h Fri Aug 1 15:04:46 2014 (r269383) @@ -42,8 +42,8 @@ #define RF_ALLOCATED 0x0001 /* resource has been reserved */ #define RF_ACTIVE 0x0002 /* resource allocation has been activated */ #define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */ -#define RF_TIMESHARE 0x0008 /* resource permits time-division sharing */ -#define RF_WANTED 0x0010 /* somebody is waiting for this resource */ +#define RF_SPARE1 0x0008 +#define RF_SPARE2 0x0010 #define RF_FIRSTSHARE 0x0020 /* first in sharing list */ #define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */ #define RF_OPTIONAL 0x0080 /* for bus_alloc_resources() */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 21:00:18 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94C43847; Fri, 1 Aug 2014 21:00: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 80DEF2679; Fri, 1 Aug 2014 21:00: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 s71L0Ixs006525; Fri, 1 Aug 2014 21:00:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71L0I2D006524; Fri, 1 Aug 2014 21:00:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201408012100.s71L0I2D006524@svn.freebsd.org> From: John Baldwin Date: Fri, 1 Aug 2014 21:00:18 +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: r269397 - stable/10/share/examples/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 21:00:18 -0000 Author: jhb Date: Fri Aug 1 21:00:18 2014 New Revision: 269397 URL: http://svnweb.freebsd.org/changeset/base/269397 Log: MFC 256657,257423,264837,267559: Sync vmrun.sh with HEAD: - Add -e option to vmrun.sh passed to bhyveload(8) to set loader environment variables. - Stop passing unused -I option to bhyve(8). - Reformat the usage to fit in 80 colums and other cleanups. - Add -C option to specify the console device. - Add -H option to pass a host path to bhyveload(8). - Support for multiple disk and tap devices. Modified: stable/10/share/examples/bhyve/vmrun.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/10/share/examples/bhyve/vmrun.sh Fri Aug 1 20:49:27 2014 (r269396) +++ stable/10/share/examples/bhyve/vmrun.sh Fri Aug 1 21:00:18 2014 (r269397) @@ -34,17 +34,25 @@ FBSDRUN=/usr/sbin/bhyve DEFAULT_MEMSIZE=512M DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 +DEFAULT_CONSOLE=stdio DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" usage() { - echo "Usage: vmrun.sh [-hai][-g ][-m ][-d ][-I ][-t ] " + echo "Usage: vmrun.sh [-ahi] [-c ] [-C ] [-d ]" + echo " [-e ] [-g ] [-H ]" + echo " [-I ] [-m ]" + echo " [-t ] " + echo "" echo " -h: display this help message" - echo " -a: force memory mapped local apic access" + echo " -a: force memory mapped local APIC access" echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" + echo " -C: console device (default is ${DEFAULT_CONSOLE})" echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" + echo " -e: set FreeBSD loader environment variable" echo " -g: listen for connection from kgdb at " + echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" @@ -68,24 +76,37 @@ fi force_install=0 isofile=${DEFAULT_ISOFILE} memsize=${DEFAULT_MEMSIZE} +console=${DEFAULT_CONSOLE} cpus=${DEFAULT_CPUS} -virtio_diskdev=${DEFAULT_VIRTIO_DISK} -tapdev=${DEFAULT_TAPDEV} +tap_total=0 +disk_total=0 apic_opt="" gdbport=0 +loader_opt="" -while getopts haic:g:I:m:d:t: c ; do +while getopts ac:C:d:e:g:hH:iI:m:t: c ; do case $c in - h) - usage - ;; a) apic_opt="-a" ;; + c) + cpus=${OPTARG} + ;; + C) + console=${OPTARG} + ;; d) - virtio_diskdev=${OPTARG} + eval "disk_dev${disk_total}=\"${OPTARG}\"" + disk_total=$(($disk_total + 1)) ;; - g) gdbport=${OPTARG} + e) + loader_opt="${loader_opt} -e ${OPTARG}" + ;; + g) + gdbport=${OPTARG} + ;; + H) + host_base=`realpath ${OPTARG}` ;; i) force_install=1 @@ -93,21 +114,29 @@ while getopts haic:g:I:m:d:t: c ; do I) isofile=${OPTARG} ;; - c) - cpus=${OPTARG} - ;; m) memsize=${OPTARG} ;; t) - tapdev=${OPTARG} + eval "tap_dev${tap_total}=\"${OPTARG}\"" + tap_total=$(($tap_total + 1)) ;; - \?) + *) usage ;; esac done +if [ $tap_total -eq 0 ] ; then + tap_total=1 + tap_dev0="${DEFAULT_TAPDEV}" +fi +if [ $disk_total -eq 0 ] ; then + disk_total=1 + disk_dev0="${DEFAULT_VIRTIO_DISK}" + +fi + shift $((${OPTIND} - 1)) if [ $# -ne 1 ]; then @@ -115,26 +144,35 @@ if [ $# -ne 1 ]; then fi vmname="$1" - -# Create the virtio diskdev file if needed -if [ ! -f ${virtio_diskdev} ]; then - echo "virtio disk device file \"${virtio_diskdev}\" does not exist." - echo "Creating it ..." - truncate -s 8G ${virtio_diskdev} > /dev/null -fi - -if [ ! -r ${virtio_diskdev} ]; then - echo "virtio disk device file \"${virtio_diskdev}\" is not readable" - exit 1 +if [ -n "${host_base}" ]; then + loader_opt="${loader_opt} -h ${host_base}" fi -if [ ! -w ${virtio_diskdev} ]; then - echo "virtio disk device file \"${virtio_diskdev}\" is not writable" - exit 1 -fi +make_and_check_diskdev() +{ + local virtio_diskdev="$1" + # Create the virtio diskdev file if needed + if [ ! -f ${virtio_diskdev} ]; then + echo "virtio disk device file \"${virtio_diskdev}\" does not exist." + echo "Creating it ..." + truncate -s 8G ${virtio_diskdev} > /dev/null + fi + + if [ ! -r ${virtio_diskdev} ]; then + echo "virtio disk device file \"${virtio_diskdev}\" is not readable" + exit 1 + fi + + if [ ! -w ${virtio_diskdev} ]; then + echo "virtio disk device file \"${virtio_diskdev}\" is not writable" + exit 1 + fi +} echo "Launching virtual machine \"$vmname\" ..." +virtio_diskdev="$disk_dev0" + while [ 1 ]; do ${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 @@ -163,18 +201,40 @@ while [ 1 ]; do installer_opt="" fi - ${LOADER} -m ${memsize} -d ${BOOTDISK} ${vmname} + ${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \ + ${vmname} if [ $? -ne 0 ]; then break fi - ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P \ + # + # Build up args for additional tap and disk devices now. + # + nextslot=2 # slot 0 is hostbridge, slot 1 is lpc + devargs="" # accumulate disk/tap args here + i=0 + while [ $i -lt $tap_total ] ; do + eval "tapname=\$tap_dev${i}" + devargs="$devargs -s $nextslot:0,virtio-net,${tapname} " + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) + done + + i=0 + while [ $i -lt $disk_total ] ; do + eval "disk=\$disk_dev${i}" + make_and_check_diskdev "${disk}" + devargs="$devargs -s $nextslot:0,virtio-blk,${disk} " + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) + done + + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P \ -g ${gdbport} \ -s 0:0,hostbridge \ -s 1:0,lpc \ - -s 2:0,virtio-net,${tapdev} \ - -s 3:0,virtio-blk,${virtio_diskdev} \ - -l com1,stdio \ + ${devargs} \ + -l com1,${console} \ ${installer_opt} \ ${vmname} if [ $? -ne 0 ]; then From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 21:10:44 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AC81DBC; Fri, 1 Aug 2014 21:10: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 657D52812; Fri, 1 Aug 2014 21:10: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 s71LAi5r013761; Fri, 1 Aug 2014 21:10:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71LAf4c013741; Fri, 1 Aug 2014 21:10:41 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201408012110.s71LAf4c013741@svn.freebsd.org> From: Rick Macklem Date: Fri, 1 Aug 2014 21:10: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: r269398 - in stable/10/sys: conf fs/nfs fs/nfsclient fs/nfsserver modules/krpc rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 21:10:44 -0000 Author: rmacklem Date: Fri Aug 1 21:10:41 2014 New Revision: 269398 URL: http://svnweb.freebsd.org/changeset/base/269398 Log: MFC: r268115 Merge the NFSv4.1 server code in projects/nfsv4.1-server over into head. The code is not believed to have any effect on the semantics of non-NFSv4.1 server behaviour. It is a rather large merge, but I am hoping that there will not be any regressions for the NFS server. Added: stable/10/sys/rpc/clnt_bck.c - copied unchanged from r268115, head/sys/rpc/clnt_bck.c Modified: stable/10/sys/conf/files stable/10/sys/fs/nfs/nfs.h stable/10/sys/fs/nfs/nfs_commonkrpc.c stable/10/sys/fs/nfs/nfs_commonport.c stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfs/nfsclstate.h stable/10/sys/fs/nfs/nfsdport.h stable/10/sys/fs/nfs/nfsport.h stable/10/sys/fs/nfs/nfsproto.h stable/10/sys/fs/nfs/nfsrvstate.h stable/10/sys/fs/nfsclient/nfs_clstate.c stable/10/sys/fs/nfsserver/nfs_nfsdcache.c stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/10/sys/fs/nfsserver/nfs_nfsdport.c stable/10/sys/fs/nfsserver/nfs_nfsdserv.c stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c stable/10/sys/fs/nfsserver/nfs_nfsdstate.c stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c stable/10/sys/modules/krpc/Makefile stable/10/sys/rpc/krpc.h stable/10/sys/rpc/svc.h stable/10/sys/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/conf/files Fri Aug 1 21:10:41 2014 (r269398) @@ -3838,6 +3838,7 @@ pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/auth_unix.c optional krpc | nfslockd | nfsclient | nfscl | nfsd rpc/authunix_prot.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd +rpc/clnt_bck.c optional krpc | nfslockd | nfsserver | nfscl | nfsd rpc/clnt_dg.c optional krpc | nfslockd | nfsclient | nfscl | nfsd rpc/clnt_rc.c optional krpc | nfslockd | nfsclient | nfscl | nfsd rpc/clnt_vc.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd Modified: stable/10/sys/fs/nfs/nfs.h ============================================================================== --- stable/10/sys/fs/nfs/nfs.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfs.h Fri Aug 1 21:10:41 2014 (r269398) @@ -50,7 +50,8 @@ #define NFS_MAXREXMIT 100 /* Stop counting after this many */ #define NFSV4_CALLBACKTIMEO (2 * NFS_HZ) /* Timeout in ticks */ #define NFSV4_CALLBACKRETRY 5 /* Number of retries before failure */ -#define NFSV4_CBSLOTS 8 /* Number of slots for session */ +#define NFSV4_SLOTS 64 /* Number of slots, fore channel */ +#define NFSV4_CBSLOTS 8 /* Number of slots, back channel */ #define NFSV4_CBRETRYCNT 4 /* # of CBRecall retries upon err */ #define NFSV4_UPCALLTIMEO (15 * NFS_HZ) /* Timeout in ticks for upcalls */ /* to gssd or nfsuserd */ @@ -91,6 +92,9 @@ #ifndef NFSLOCKHASHSIZE #define NFSLOCKHASHSIZE 20 /* Size of server nfslock hash table */ #endif +#ifndef NFSSESSIONHASHSIZE +#define NFSSESSIONHASHSIZE 20 /* Size of server session hash table */ +#endif #define NFSSTATEHASHSIZE 10 /* Size of server stateid hash table */ #ifndef NFSUSERHASHSIZE #define NFSUSERHASHSIZE 30 /* Size of user id hash table */ @@ -276,6 +280,8 @@ struct nfsreferral { #define LCL_GSSINTEGRITY 0x00002000 #define LCL_GSSPRIVACY 0x00004000 #define LCL_ADMINREVOKED 0x00008000 +#define LCL_RECLAIMCOMPLETE 0x00010000 +#define LCL_NFSV41 0x00020000 #define LCL_GSS LCL_KERBV /* Or of all mechs */ @@ -318,6 +324,11 @@ struct nfsreferral { #define NFSLCK_SETATTR 0x02000000 #define NFSLCK_DELEGPURGE 0x04000000 #define NFSLCK_DELEGRETURN 0x08000000 +#define NFSLCK_WANTWDELEG 0x10000000 +#define NFSLCK_WANTRDELEG 0x20000000 +#define NFSLCK_WANTNODELEG 0x40000000 +#define NFSLCK_WANTBITS \ + (NFSLCK_WANTWDELEG | NFSLCK_WANTRDELEG | NFSLCK_WANTNODELEG) /* And bits for nid_flag */ #define NFSID_INITIALIZE 0x0001 @@ -341,68 +352,120 @@ struct nfsreferral { * THE MACROS MUST BE MANUALLY MODIFIED IF NFSATTRBIT_MAXWORDS CHANGES!! * It is (NFSATTRBIT_MAX + 31) / 32. */ -#define NFSATTRBIT_MAXWORDS 2 +#define NFSATTRBIT_MAXWORDS 3 typedef struct { u_int32_t bits[NFSATTRBIT_MAXWORDS]; } nfsattrbit_t; -#define NFSZERO_ATTRBIT(b) do { (b)->bits[0] = 0; (b)->bits[1] = 0; } while (0) -#define NFSSET_ATTRBIT(t, f) do { (t)->bits[0] = (f)->bits[0]; \ - (t)->bits[1] = (f)->bits[1]; } while (0) +#define NFSZERO_ATTRBIT(b) do { \ + (b)->bits[0] = 0; \ + (b)->bits[1] = 0; \ + (b)->bits[2] = 0; \ +} while (0) + +#define NFSSET_ATTRBIT(t, f) do { \ + (t)->bits[0] = (f)->bits[0]; \ + (t)->bits[1] = (f)->bits[1]; \ + (t)->bits[2] = (f)->bits[2]; \ +} while (0) + #define NFSSETSUPP_ATTRBIT(b) do { \ (b)->bits[0] = NFSATTRBIT_SUPP0; \ - (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); } while (0) + (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); \ + (b)->bits[2] = NFSATTRBIT_SUPP2; \ +} while (0) + #define NFSISSET_ATTRBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32))) #define NFSSETBIT_ATTRBIT(b, p) ((b)->bits[(p) / 32] |= (1 << ((p) % 32))) #define NFSCLRBIT_ATTRBIT(b, p) ((b)->bits[(p) / 32] &= ~(1 << ((p) % 32))) + #define NFSCLRALL_ATTRBIT(b, a) do { \ - (b)->bits[0] &= ~((a)->bits[0]); \ - (b)->bits[1] &= ~((a)->bits[1]); \ - } while (0) + (b)->bits[0] &= ~((a)->bits[0]); \ + (b)->bits[1] &= ~((a)->bits[1]); \ + (b)->bits[2] &= ~((a)->bits[2]); \ +} while (0) + #define NFSCLRNOT_ATTRBIT(b, a) do { \ - (b)->bits[0] &= ((a)->bits[0]); \ - (b)->bits[1] &= ((a)->bits[1]); \ - } while (0) + (b)->bits[0] &= ((a)->bits[0]); \ + (b)->bits[1] &= ((a)->bits[1]); \ + (b)->bits[2] &= ((a)->bits[2]); \ +} while (0) + #define NFSCLRNOTFILLABLE_ATTRBIT(b) do { \ - (b)->bits[0] &= NFSATTRBIT_SUPP0; \ - (b)->bits[1] &= NFSATTRBIT_SUPP1; } while (0) + (b)->bits[0] &= NFSATTRBIT_SUPP0; \ + (b)->bits[1] &= NFSATTRBIT_SUPP1; \ + (b)->bits[2] &= NFSATTRBIT_SUPP2; \ +} while (0) + #define NFSCLRNOTSETABLE_ATTRBIT(b) do { \ - (b)->bits[0] &= NFSATTRBIT_SETABLE0; \ - (b)->bits[1] &= NFSATTRBIT_SETABLE1; } while (0) -#define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1]) -#define NFSEQUAL_ATTRBIT(b, p) \ - ((b)->bits[0] == (p)->bits[0] && (b)->bits[1] == (p)->bits[1]) + (b)->bits[0] &= NFSATTRBIT_SETABLE0; \ + (b)->bits[1] &= NFSATTRBIT_SETABLE1; \ + (b)->bits[2] &= NFSATTRBIT_SETABLE2; \ +} while (0) + +#define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1] || (b)->bits[2]) +#define NFSEQUAL_ATTRBIT(b, p) ((b)->bits[0] == (p)->bits[0] && \ + (b)->bits[1] == (p)->bits[1] && (b)->bits[2] == (p)->bits[2]) + #define NFSGETATTR_ATTRBIT(b) do { \ - (b)->bits[0] = NFSATTRBIT_GETATTR0; \ - (b)->bits[1] = NFSATTRBIT_GETATTR1; } while (0) + (b)->bits[0] = NFSATTRBIT_GETATTR0; \ + (b)->bits[1] = NFSATTRBIT_GETATTR1; \ + (b)->bits[2] = NFSATTRBIT_GETATTR2; \ +} while (0) + #define NFSWCCATTR_ATTRBIT(b) do { \ - (b)->bits[0] = NFSATTRBIT_WCCATTR0; \ - (b)->bits[1] = NFSATTRBIT_WCCATTR1; } while (0) + (b)->bits[0] = NFSATTRBIT_WCCATTR0; \ + (b)->bits[1] = NFSATTRBIT_WCCATTR1; \ + (b)->bits[2] = NFSATTRBIT_WCCATTR2; \ +} while (0) + #define NFSWRITEGETATTR_ATTRBIT(b) do { \ - (b)->bits[0] = NFSATTRBIT_WRITEGETATTR0; \ - (b)->bits[1] = NFSATTRBIT_WRITEGETATTR1; } while (0) + (b)->bits[0] = NFSATTRBIT_WRITEGETATTR0; \ + (b)->bits[1] = NFSATTRBIT_WRITEGETATTR1; \ + (b)->bits[2] = NFSATTRBIT_WRITEGETATTR2; \ +} while (0) + #define NFSCBGETATTR_ATTRBIT(b, c) do { \ - (c)->bits[0] = ((b)->bits[0] & NFSATTRBIT_CBGETATTR0); \ - (c)->bits[1] = ((b)->bits[1] & NFSATTRBIT_CBGETATTR1); } while (0) + (c)->bits[0] = ((b)->bits[0] & NFSATTRBIT_CBGETATTR0); \ + (c)->bits[1] = ((b)->bits[1] & NFSATTRBIT_CBGETATTR1); \ + (c)->bits[2] = ((b)->bits[2] & NFSATTRBIT_CBGETATTR2); \ +} while (0) + #define NFSPATHCONF_GETATTRBIT(b) do { \ - (b)->bits[0] = NFSGETATTRBIT_PATHCONF0; \ - (b)->bits[1] = NFSGETATTRBIT_PATHCONF1; } while (0) + (b)->bits[0] = NFSGETATTRBIT_PATHCONF0; \ + (b)->bits[1] = NFSGETATTRBIT_PATHCONF1; \ + (b)->bits[2] = NFSGETATTRBIT_PATHCONF2; \ +} while (0) + #define NFSSTATFS_GETATTRBIT(b) do { \ - (b)->bits[0] = NFSGETATTRBIT_STATFS0; \ - (b)->bits[1] = NFSGETATTRBIT_STATFS1; } while (0) + (b)->bits[0] = NFSGETATTRBIT_STATFS0; \ + (b)->bits[1] = NFSGETATTRBIT_STATFS1; \ + (b)->bits[2] = NFSGETATTRBIT_STATFS2; \ +} while (0) + #define NFSISSETSTATFS_ATTRBIT(b) \ (((b)->bits[0] & NFSATTRBIT_STATFS0) || \ - ((b)->bits[1] & NFSATTRBIT_STATFS1)) + ((b)->bits[1] & NFSATTRBIT_STATFS1) || \ + ((b)->bits[2] & NFSATTRBIT_STATFS2)) + #define NFSCLRSTATFS_ATTRBIT(b) do { \ - (b)->bits[0] &= ~NFSATTRBIT_STATFS0; \ - (b)->bits[1] &= ~NFSATTRBIT_STATFS1; } while (0) + (b)->bits[0] &= ~NFSATTRBIT_STATFS0; \ + (b)->bits[1] &= ~NFSATTRBIT_STATFS1; \ + (b)->bits[2] &= ~NFSATTRBIT_STATFS2; \ +} while (0) + #define NFSREADDIRPLUS_ATTRBIT(b) do { \ - (b)->bits[0] = NFSATTRBIT_READDIRPLUS0; \ - (b)->bits[1] = NFSATTRBIT_READDIRPLUS1; } while (0) + (b)->bits[0] = NFSATTRBIT_READDIRPLUS0; \ + (b)->bits[1] = NFSATTRBIT_READDIRPLUS1; \ + (b)->bits[2] = NFSATTRBIT_READDIRPLUS2; \ +} while (0) + #define NFSREFERRAL_ATTRBIT(b) do { \ - (b)->bits[0] = NFSATTRBIT_REFERRAL0; \ - (b)->bits[1] = NFSATTRBIT_REFERRAL1; } while (0) + (b)->bits[0] = NFSATTRBIT_REFERRAL0; \ + (b)->bits[1] = NFSATTRBIT_REFERRAL1; \ + (b)->bits[2] = NFSATTRBIT_REFERRAL2; \ +} while (0) /* * Store uid, gid creds that were used when the stateid was acquired. @@ -529,6 +592,9 @@ struct nfsrv_descript { int nd_gssnamelen; /* principal name length */ char *nd_gssname; /* principal name */ uint32_t *nd_slotseq; /* ptr to slot seq# in req */ + uint8_t nd_sessionid[NFSX_V4SESSIONID]; /* Session id */ + uint32_t nd_slotid; /* Slotid for this RPC */ + SVCXPRT *nd_xprt; /* Server RPC handle */ }; #define nd_princlen nd_gssnamelen @@ -562,6 +628,8 @@ struct nfsrv_descript { #define ND_NFSCL 0x01000000 #define ND_NFSV41 0x02000000 #define ND_HASSEQUENCE 0x04000000 +#define ND_CACHETHIS 0x08000000 +#define ND_LASTOP 0x10000000 /* * ND_GSS should be the "or" of all GSS type authentications. Modified: stable/10/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonkrpc.c Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfs_commonkrpc.c Fri Aug 1 21:10:41 2014 (r269398) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -739,8 +740,12 @@ tryagain: } nd->nd_mrep = NULL; - stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum, nd->nd_mreq, - &nd->nd_mrep, timo); + if (clp != NULL && sep != NULL) + stat = clnt_bck_call(nrp->nr_client, &ext, procnum, + nd->nd_mreq, &nd->nd_mrep, timo, sep->nfsess_xprt); + else + stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum, + nd->nd_mreq, &nd->nd_mrep, timo); if (rep != NULL) { /* @@ -795,7 +800,8 @@ tryagain: nd->nd_md = nd->nd_mrep; nd->nd_dpos = NFSMTOD(nd->nd_md, caddr_t); nd->nd_repstat = 0; - if (nd->nd_procnum != NFSPROC_NULL) { + if (nd->nd_procnum != NFSPROC_NULL && + nd->nd_procnum != NFSV4PROC_CBNULL) { /* If sep == NULL, set it to the default in nmp. */ if (sep == NULL && nmp != NULL) sep = NFSMNT_MDSSESSION(nmp); @@ -827,11 +833,20 @@ tryagain: /* * If the first op is Sequence, free up the slot. */ - if (nmp != NULL && i == NFSV4OP_SEQUENCE && j != 0) + if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j != 0) || + (clp != NULL && i == NFSV4OP_CBSEQUENCE && j != 0)) NFSCL_DEBUG(1, "failed seq=%d\n", j); - if (nmp != NULL && i == NFSV4OP_SEQUENCE && j == 0) { - NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + - 5 * NFSX_UNSIGNED); + if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j == 0) || + (clp != NULL && i == NFSV4OP_CBSEQUENCE && j == 0) + ) { + if (i == NFSV4OP_SEQUENCE) + NFSM_DISSECT(tl, uint32_t *, + NFSX_V4SESSIONID + + 5 * NFSX_UNSIGNED); + else + NFSM_DISSECT(tl, uint32_t *, + NFSX_V4SESSIONID + + 4 * NFSX_UNSIGNED); mtx_lock(&sep->nfsess_mtx); tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; retseq = fxdr_unsigned(uint32_t, *tl++); Modified: stable/10/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonport.c Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfs_commonport.c Fri Aug 1 21:10:41 2014 (r269398) @@ -112,6 +112,7 @@ MALLOC_DEFINE(M_NEWNFSDEVINFO, "NFSCL de MALLOC_DEFINE(M_NEWNFSSOCKREQ, "NFSCL sockreq", "NFS Sock Req"); MALLOC_DEFINE(M_NEWNFSCLDS, "NFSCL session", "NFSv4.1 Session"); MALLOC_DEFINE(M_NEWNFSLAYRECALL, "NFSCL layrecall", "NFSv4.1 Layout Recall"); +MALLOC_DEFINE(M_NEWNFSDSESSION, "NFSD session", "NFSD Session for a client"); /* * Definition of mutex locks. Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Fri Aug 1 21:10:41 2014 (r269398) @@ -1733,6 +1733,23 @@ nfsv4_loadattr(struct nfsrv_descript *nd } attrsum += NFSX_HYPER; break; + case NFSATTRBIT_SUPPATTREXCLCREAT: + retnotsup = 0; + error = nfsrv_getattrbits(nd, &retattrbits, + &cnt, &retnotsup); + if (error) + goto nfsmout; + if (compare && !(*retcmpp)) { + NFSSETSUPP_ATTRBIT(&checkattrbits); + NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits); + NFSCLRBIT_ATTRBIT(&checkattrbits, + NFSATTRBIT_TIMEACCESSSET); + if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) + || retnotsup) + *retcmpp = NFSERR_NOTSAME; + } + attrsum += cnt; + break; default: printf("EEK! nfsv4_loadattr unknown attr=%d\n", bitpos); @@ -2469,6 +2486,12 @@ nfsv4_fillattr(struct nfsrv_descript *nd txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; + case NFSATTRBIT_SUPPATTREXCLCREAT: + NFSSETSUPP_ATTRBIT(&attrbits); + NFSCLRNOTSETABLE_ATTRBIT(&attrbits); + NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); + retnum += nfsrv_putattrbit(nd, &attrbits); + break; default: printf("EEK! Bad V4 attribute bitpos=%d\n", bitpos); }; @@ -3663,6 +3686,9 @@ nfsmout: /* * Handle an NFSv4.1 Sequence request for the session. + * If reply != NULL, use it to return the cached reply, as required. + * The client gets a cached reply via this call for callbacks, however the + * server gets a cached reply via the nfsv4_seqsess_cachereply() call. */ int nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, @@ -3671,7 +3697,8 @@ nfsv4_seqsession(uint32_t seqid, uint32_ int error; error = 0; - *reply = NULL; + if (reply != NULL) + *reply = NULL; if (slotid > maxslot) return (NFSERR_BADSLOT); if (seqid == slots[slotid].nfssl_seq) { @@ -3679,13 +3706,18 @@ nfsv4_seqsession(uint32_t seqid, uint32_ if (slots[slotid].nfssl_inprog != 0) error = NFSERR_DELAY; else if (slots[slotid].nfssl_reply != NULL) { - *reply = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + if (reply != NULL) { + *reply = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } slots[slotid].nfssl_inprog = 1; + error = NFSERR_REPLYFROMCACHE; } else - error = NFSERR_SEQMISORDERED; + /* No reply cached, so just do it. */ + slots[slotid].nfssl_inprog = 1; } else if ((slots[slotid].nfssl_seq + 1) == seqid) { - m_freem(slots[slotid].nfssl_reply); + if (slots[slotid].nfssl_reply != NULL) + m_freem(slots[slotid].nfssl_reply); slots[slotid].nfssl_reply = NULL; slots[slotid].nfssl_inprog = 1; slots[slotid].nfssl_seq++; @@ -3696,12 +3728,22 @@ nfsv4_seqsession(uint32_t seqid, uint32_ /* * Cache this reply for the slot. + * Use the "rep" argument to return the cached reply if repstat is set to + * NFSERR_REPLYFROMCACHE. The client never sets repstat to this value. */ void -nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, struct mbuf *rep) +nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, int repstat, + struct mbuf **rep) { - slots[slotid].nfssl_reply = rep; + if (repstat == NFSERR_REPLYFROMCACHE) { + *rep = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } else { + if (slots[slotid].nfssl_reply != NULL) + m_freem(slots[slotid].nfssl_reply); + slots[slotid].nfssl_reply = *rep; + } slots[slotid].nfssl_inprog = 0; } @@ -3713,9 +3755,36 @@ nfsv4_setsequence(struct nfsmount *nmp, struct nfsclsession *sep, int dont_replycache) { uint32_t *tl, slotseq = 0; + int error, maxslot, slotpos; + uint8_t sessionid[NFSX_V4SESSIONID]; + + error = nfsv4_sequencelookup(nmp, sep, &slotpos, &maxslot, &slotseq, + sessionid); + if (error != 0) + return; + KASSERT(maxslot >= 0, ("nfscl_setsequence neg maxslot")); + + /* Build the Sequence arguments. */ + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 4 * NFSX_UNSIGNED); + bcopy(sessionid, tl, NFSX_V4SESSIONID); + tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; + nd->nd_slotseq = tl; + *tl++ = txdr_unsigned(slotseq); + *tl++ = txdr_unsigned(slotpos); + *tl++ = txdr_unsigned(maxslot); + if (dont_replycache == 0) + *tl = newnfs_true; + else + *tl = newnfs_false; + nd->nd_flag |= ND_HASSEQUENCE; +} + +int +nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsclsession *sep, + int *slotposp, int *maxslotp, uint32_t *slotseqp, uint8_t *sessionid) +{ int i, maxslot, slotpos; uint64_t bitval; - uint8_t sessionid[NFSX_V4SESSIONID]; /* Find an unused slot. */ slotpos = -1; @@ -3728,7 +3797,7 @@ nfsv4_setsequence(struct nfsmount *nmp, slotpos = i; sep->nfsess_slots |= bitval; sep->nfsess_slotseq[i]++; - slotseq = sep->nfsess_slotseq[i]; + *slotseqp = sep->nfsess_slotseq[i]; break; } bitval <<= 1; @@ -3739,10 +3808,11 @@ nfsv4_setsequence(struct nfsmount *nmp, * This RPC attempt will fail when it calls * newnfs_request(). */ - if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) + if (nmp != NULL && + (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { mtx_unlock(&sep->nfsess_mtx); - return; + return (ESTALE); } /* Wake up once/sec, to check for a forced dismount. */ (void)mtx_sleep(&sep->nfsess_slots, &sep->nfsess_mtx, @@ -3758,21 +3828,9 @@ nfsv4_setsequence(struct nfsmount *nmp, } bcopy(sep->nfsess_sessionid, sessionid, NFSX_V4SESSIONID); mtx_unlock(&sep->nfsess_mtx); - KASSERT(maxslot >= 0, ("nfscl_setsequence neg maxslot")); - - /* Build the Sequence arguments. */ - NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 4 * NFSX_UNSIGNED); - bcopy(sessionid, tl, NFSX_V4SESSIONID); - tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; - nd->nd_slotseq = tl; - *tl++ = txdr_unsigned(slotseq); - *tl++ = txdr_unsigned(slotpos); - *tl++ = txdr_unsigned(maxslot); - if (dont_replycache == 0) - *tl = newnfs_true; - else - *tl = newnfs_false; - nd->nd_flag |= ND_HASSEQUENCE; + *slotposp = slotpos; + *maxslotp = maxslot; + return (0); } /* Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfs_var.h Fri Aug 1 21:10:41 2014 (r269398) @@ -61,6 +61,7 @@ union nethostaddr; struct nfsstate; struct nfslock; struct nfsclient; +struct nfsdsession; struct nfslockconflict; struct nfsd_idargs; struct nfsd_clid; @@ -90,8 +91,11 @@ NFS_READDIR_ARGS; /* nfs_nfsdstate.c */ int nfsrv_setclient(struct nfsrv_descript *, struct nfsclient **, nfsquad_t *, nfsquad_t *, NFSPROC_T *); -int nfsrv_getclient(nfsquad_t, int, struct nfsclient **, nfsquad_t, - struct nfsrv_descript *, NFSPROC_T *); +int nfsrv_getclient(nfsquad_t, int, struct nfsclient **, struct nfsdsession *, + nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *); +int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *); +int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *); +int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *); void nfsrv_dumpclients(struct nfsd_dumpclients *, int); void nfsrv_dumplocks(vnode_t, struct nfsd_dumplocks *, int, NFSPROC_T *); @@ -105,8 +109,8 @@ int nfsrv_opencheck(nfsquad_t, nfsv4stat vnode_t, struct nfsrv_descript *, NFSPROC_T *, int); int nfsrv_openupdate(vnode_t, struct nfsstate *, nfsquad_t, nfsv4stateid_t *, struct nfsrv_descript *, NFSPROC_T *); -int nfsrv_delegupdate(nfsquad_t, nfsv4stateid_t *, vnode_t, int, - struct ucred *, NFSPROC_T *); +int nfsrv_delegupdate(struct nfsrv_descript *, nfsquad_t, nfsv4stateid_t *, + vnode_t, int, struct ucred *, NFSPROC_T *); int nfsrv_releaselckown(struct nfsstate *, nfsquad_t, NFSPROC_T *); void nfsrv_zapclient(struct nfsclient *, NFSPROC_T *); int nfssvc_idname(struct nfsd_idargs *); @@ -127,6 +131,10 @@ int nfsrv_checkgetattr(struct nfsrv_desc int nfsrv_nfsuserdport(u_short, NFSPROC_T *); void nfsrv_nfsuserddelport(void); void nfsrv_throwawayallstate(NFSPROC_T *); +int nfsrv_checksequence(struct nfsrv_descript *, uint32_t, uint32_t *, + uint32_t *, int, uint32_t *, NFSPROC_T *); +int nfsrv_checkreclaimcomplete(struct nfsrv_descript *); +void nfsrv_cache_session(uint8_t *, uint32_t, int, struct mbuf **); /* nfs_nfsdserv.c */ int nfsrvd_access(struct nfsrv_descript *, int, @@ -211,10 +219,27 @@ int nfsrvd_releaselckown(struct nfsrv_de vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_pathconf(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_exchangeid(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_createsession(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_sequence(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_destroyclientid(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_destroysession(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_freestateid(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_notsupp(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); /* nfs_nfsdsocket.c */ void nfsrvd_rephead(struct nfsrv_descript *); -void nfsrvd_dorpc(struct nfsrv_descript *, int, NFSPROC_T *); +void nfsrvd_dorpc(struct nfsrv_descript *, int, u_char *, int, u_int32_t, + NFSPROC_T *); /* nfs_nfsdcache.c */ void nfsrvd_initcache(void); @@ -264,9 +289,11 @@ int nfsv4_getipaddr(struct nfsrv_descrip int *); int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *, struct mbuf **, uint16_t); -void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, struct mbuf *); +void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, int, struct mbuf **); void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *, struct nfsclsession *, int); +int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *, + int *, uint32_t *, uint8_t *); void nfsv4_freeslot(struct nfsclsession *, int); /* nfs_clcomsubs.c */ @@ -322,6 +349,8 @@ int nfsrv_parsename(struct nfsrv_descrip NFSPATHLEN_T *); void nfsd_init(void); int nfsd_checkrootexp(struct nfsrv_descript *); +void nfsd_getminorvers(struct nfsrv_descript *, u_char *, u_char **, int *, + u_int32_t *); /* nfs_clvfsops.c */ void nfscl_retopts(struct nfsmount *, char *, size_t); @@ -628,6 +657,7 @@ int nfsvno_advlock(vnode_t, int, u_int64 int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); uint32_t nfsrv_hashfh(fhandle_t *); +uint32_t nfsrv_hashsessionid(uint8_t *); void nfsrv_backupstable(void); /* nfs_commonkrpc.c */ Modified: stable/10/sys/fs/nfs/nfsclstate.h ============================================================================== --- stable/10/sys/fs/nfs/nfsclstate.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfsclstate.h Fri Aug 1 21:10:41 2014 (r269398) @@ -57,6 +57,7 @@ struct nfsclsession { struct mtx nfsess_mtx; struct nfsslot nfsess_cbslots[NFSV4_CBSLOTS]; nfsquad_t nfsess_clientid; + SVCXPRT *nfsess_xprt; /* For backchannel callback */ uint32_t nfsess_slotseq[64]; /* Max for 64bit nm_slots */ uint64_t nfsess_slots; uint32_t nfsess_sequenceid; Modified: stable/10/sys/fs/nfs/nfsdport.h ============================================================================== --- stable/10/sys/fs/nfs/nfsdport.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfsdport.h Fri Aug 1 21:10:41 2014 (r269398) @@ -115,3 +115,9 @@ struct nfsexstuff { #define NFSRV_MINFH (sizeof (fhandle_t)) #define NFSRV_MAXFH (sizeof (fhandle_t)) +/* Use this macro for debug printfs. */ +#define NFSD_DEBUG(level, ...) do { \ + if (nfsd_debuglevel >= (level)) \ + printf(__VA_ARGS__); \ + } while (0) + Modified: stable/10/sys/fs/nfs/nfsport.h ============================================================================== --- stable/10/sys/fs/nfs/nfsport.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfsport.h Fri Aug 1 21:10:41 2014 (r269398) @@ -637,6 +637,9 @@ void nfsrvd_rcv(struct socket *, void *, #define NFSUNLOCKSOCKREQ(r) mtx_unlock(&((r)->nr_mtx)) #define NFSLOCKDS(d) mtx_lock(&((d)->nfsclds_mtx)) #define NFSUNLOCKDS(d) mtx_unlock(&((d)->nfsclds_mtx)) +#define NFSSESSIONMUTEXPTR(s) (&((s)->mtx)) +#define NFSLOCKSESSION(s) mtx_lock(&((s)->mtx)) +#define NFSUNLOCKSESSION(s) mtx_unlock(&((s)->mtx)) /* * Use these macros to initialize/free a mutex. @@ -732,6 +735,7 @@ MALLOC_DECLARE(M_NEWNFSDEVINFO); MALLOC_DECLARE(M_NEWNFSSOCKREQ); MALLOC_DECLARE(M_NEWNFSCLDS); MALLOC_DECLARE(M_NEWNFSLAYRECALL); +MALLOC_DECLARE(M_NEWNFSDSESSION); #define M_NFSRVCACHE M_NEWNFSRVCACHE #define M_NFSDCLIENT M_NEWNFSDCLIENT #define M_NFSDSTATE M_NEWNFSDSTATE @@ -757,6 +761,7 @@ MALLOC_DECLARE(M_NEWNFSLAYRECALL); #define M_NFSSOCKREQ M_NEWNFSSOCKREQ #define M_NFSCLDS M_NEWNFSCLDS #define M_NFSLAYRECALL M_NEWNFSLAYRECALL +#define M_NFSDSESSION M_NEWNFSDSESSION #define NFSINT_SIGMASK(set) \ (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \ Modified: stable/10/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/10/sys/fs/nfs/nfsproto.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfsproto.h Fri Aug 1 21:10:41 2014 (r269398) @@ -389,9 +389,13 @@ #define NFSV4OPEN_CLAIMPREVIOUS 1 #define NFSV4OPEN_CLAIMDELEGATECUR 2 #define NFSV4OPEN_CLAIMDELEGATEPREV 3 +#define NFSV4OPEN_CLAIMFH 4 +#define NFSV4OPEN_CLAIMDELEGATECURFH 5 +#define NFSV4OPEN_CLAIMDELEGATEPREVFH 6 #define NFSV4OPEN_DELEGATENONE 0 #define NFSV4OPEN_DELEGATEREAD 1 #define NFSV4OPEN_DELEGATEWRITE 2 +#define NFSV4OPEN_DELEGATENONEEXT 3 #define NFSV4OPEN_LIMITSIZE 1 #define NFSV4OPEN_LIMITBLOCKS 2 @@ -479,6 +483,14 @@ #define NFSV4OPEN_ACCESSREAD 0x00000001 #define NFSV4OPEN_ACCESSWRITE 0x00000002 #define NFSV4OPEN_ACCESSBOTH 0x00000003 +#define NFSV4OPEN_WANTDELEGMASK 0x0000ff00 +#define NFSV4OPEN_WANTREADDELEG 0x00000100 +#define NFSV4OPEN_WANTWRITEDELEG 0x00000200 +#define NFSV4OPEN_WANTANYDELEG 0x00000300 +#define NFSV4OPEN_WANTNODELEG 0x00000400 +#define NFSV4OPEN_WANTCANCEL 0x00000500 +#define NFSV4OPEN_WANTSIGNALDELEG 0x00010000 +#define NFSV4OPEN_WANTPUSHDELEG 0x00020000 #define NFSV4OPEN_DENYNONE 0x00000000 #define NFSV4OPEN_DENYREAD 0x00000001 @@ -486,16 +498,35 @@ #define NFSV4OPEN_DENYBOTH 0x00000003 /* + * Delegate_none_ext reply values. + */ +#define NFSV4OPEN_NOTWANTED 0 +#define NFSV4OPEN_CONTENTION 1 +#define NFSV4OPEN_RESOURCE 2 +#define NFSV4OPEN_NOTSUPPFTYPE 3 +#define NFSV4OPEN_NOTSUPPWRITEFTYPE 4 +#define NFSV4OPEN_NOTSUPPUPGRADE 5 +#define NFSV4OPEN_NOTSUPPDOWNGRADE 6 +#define NFSV4OPEN_CANCELLED 7 +#define NFSV4OPEN_ISDIR 8 + +/* * Open result flags - * (The first two are in the spec. The rest are used internally.) + * (The first four are in the spec. The rest are used internally.) */ #define NFSV4OPEN_RESULTCONFIRM 0x00000002 #define NFSV4OPEN_LOCKTYPEPOSIX 0x00000004 +#define NFSV4OPEN_PRESERVEUNLINKED 0x00000008 +#define NFSV4OPEN_MAYNOTIFYLOCK 0x00000020 #define NFSV4OPEN_RFLAGS \ - (NFSV4OPEN_RESULTCONFIRM | NFSV4OPEN_LOCKTYPEPOSIX) + (NFSV4OPEN_RESULTCONFIRM | NFSV4OPEN_LOCKTYPEPOSIX | \ + NFSV4OPEN_PRESERVEUNLINKED | NFSV4OPEN_MAYNOTIFYLOCK) #define NFSV4OPEN_RECALL 0x00010000 #define NFSV4OPEN_READDELEGATE 0x00020000 #define NFSV4OPEN_WRITEDELEGATE 0x00040000 +#define NFSV4OPEN_WDRESOURCE 0x00080000 +#define NFSV4OPEN_WDCONTENTION 0x00100000 +#define NFSV4OPEN_WDNOTWANTED 0x00200000 /* * NFS V4 File Handle types @@ -805,6 +836,27 @@ struct nfsv3_sattr { #define NFSATTRBIT_TIMEMODIFY 53 #define NFSATTRBIT_TIMEMODIFYSET 54 #define NFSATTRBIT_MOUNTEDONFILEID 55 +#define NFSATTRBIT_DIRNOTIFDELAY 56 +#define NFSATTRBIT_DIRENTNOTIFDELAY 57 +#define NFSATTRBIT_DACL 58 +#define NFSATTRBIT_SACL 59 +#define NFSATTRBIT_CHANGEPOLICY 60 +#define NFSATTRBIT_FSSTATUS 61 +#define NFSATTRBIT_FSLAYOUTTYPE 62 +#define NFSATTRBIT_LAYOUTHINT 63 +#define NFSATTRBIT_LAYOUTTYPE 64 +#define NFSATTRBIT_LAYOUTBLKSIZE 65 +#define NFSATTRBIT_LAYOUTALIGNMENT 66 +#define NFSATTRBIT_FSLOCATIONSINFO 67 +#define NFSATTRBIT_MDSTHRESHOLD 68 +#define NFSATTRBIT_RETENTIONGET 69 +#define NFSATTRBIT_RETENTIONSET 70 +#define NFSATTRBIT_RETENTEVTGET 71 +#define NFSATTRBIT_RETENTEVTSET 72 +#define NFSATTRBIT_RETENTIONHOLD 73 +#define NFSATTRBIT_MODESETMASKED 74 +#define NFSATTRBIT_SUPPATTREXCLCREAT 75 +#define NFSATTRBIT_FSCHARSETCAP 76 #define NFSATTRBM_SUPPORTEDATTRS 0x00000001 #define NFSATTRBM_TYPE 0x00000002 @@ -862,8 +914,29 @@ struct nfsv3_sattr { #define NFSATTRBM_TIMEMODIFY 0x00200000 #define NFSATTRBM_TIMEMODIFYSET 0x00400000 #define NFSATTRBM_MOUNTEDONFILEID 0x00800000 +#define NFSATTRBM_DIRNOTIFDELAY 0x01000000 +#define NFSATTRBM_DIRENTNOTIFDELAY 0x02000000 +#define NFSATTRBM_DACL 0x04000000 +#define NFSATTRBM_SACL 0x08000000 +#define NFSATTRBM_CHANGEPOLICY 0x10000000 +#define NFSATTRBM_FSSTATUS 0x20000000 +#define NFSATTRBM_FSLAYOUTTYPE 0x40000000 +#define NFSATTRBM_LAYOUTHINT 0x80000000 +#define NFSATTRBM_LAYOUTTYPE 0x00000001 +#define NFSATTRBM_LAYOUTBLKSIZE 0x00000002 +#define NFSATTRBM_LAYOUTALIGNMENT 0x00000004 +#define NFSATTRBM_FSLOCATIONSINFO 0x00000008 +#define NFSATTRBM_MDSTHRESHOLD 0x00000010 +#define NFSATTRBM_RETENTIONGET 0x00000020 +#define NFSATTRBM_RETENTIONSET 0x00000040 +#define NFSATTRBM_RETENTEVTGET 0x00000080 +#define NFSATTRBM_RETENTEVTSET 0x00000100 +#define NFSATTRBM_RETENTIONHOLD 0x00000200 +#define NFSATTRBM_MODESETMASKED 0x00000400 +#define NFSATTRBM_SUPPATTREXCLCREAT 0x00000800 +#define NFSATTRBM_FSCHARSETCAP 0x00001000 -#define NFSATTRBIT_MAX 56 +#define NFSATTRBIT_MAX 77 /* * Sets of attributes that are supported, by words in the bitmap. @@ -871,6 +944,7 @@ struct nfsv3_sattr { /* * NFSATTRBIT_SUPPORTED - SUPP0 - bits 0<->31 * SUPP1 - bits 32<->63 + * SUPP2 - bits 64<->95 */ #define NFSATTRBIT_SUPP0 \ (NFSATTRBM_SUPPORTEDATTRS | \ @@ -937,6 +1011,8 @@ struct nfsv3_sattr { #define NFSATTRBIT_SUPP1 NFSATTRBIT_S1 #endif +#define NFSATTRBIT_SUPP2 NFSATTRBM_SUPPATTREXCLCREAT + /* * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and * NFSATTRBIT_TIMEMODIFYSET. @@ -947,6 +1023,7 @@ struct nfsv3_sattr { /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 * SETABLE1 - bits 32<->63 + * SETABLE2 - bits 64<->95 */ #define NFSATTRBIT_SETABLE0 \ (NFSATTRBM_SIZE | \ @@ -957,6 +1034,7 @@ struct nfsv3_sattr { NFSATTRBM_OWNERGROUP | \ NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) +#define NFSATTRBIT_SETABLE2 0 /* * Set of attributes that the getattr vnode op needs. @@ -987,6 +1065,11 @@ struct nfsv3_sattr { NFSATTRBM_TIMEMODIFY) /* + * NFSATTRBIT_GETATTR2 - bits 64<->95 + */ +#define NFSATTRBIT_GETATTR2 0 + +/* * Subset of the above that the Write RPC gets. * OR of the following bits. * NFSATTRBIT_WRITEGETATTR0 - bits 0<->31 @@ -1013,6 +1096,11 @@ struct nfsv3_sattr { NFSATTRBM_TIMEMODIFY) /* + * NFSATTRBIT_WRITEGETATTR2 - bits 64<->95 + */ +#define NFSATTRBIT_WRITEGETATTR2 0 + +/* * Set of attributes that the wccattr operation op needs. * OR of the following bits. * NFSATTRBIT_WCCATTR0 - bits 0<->31 @@ -1026,6 +1114,11 @@ struct nfsv3_sattr { (NFSATTRBM_TIMEMODIFY) /* + * NFSATTRBIT_WCCATTR2 - bits 64<->95 + */ +#define NFSATTRBIT_WCCATTR2 0 + +/* * NFSATTRBIT_CBGETATTR0 - bits 0<->31 */ #define NFSATTRBIT_CBGETATTR0 (NFSATTRBM_CHANGE | NFSATTRBM_SIZE) @@ -1036,6 +1129,11 @@ struct nfsv3_sattr { #define NFSATTRBIT_CBGETATTR1 0x0 /* + * NFSATTRBIT_CBGETATTR2 - bits 64<->95 + */ +#define NFSATTRBIT_CBGETATTR2 0x0 + +/* * Sets of attributes that require a VFS_STATFS() call to get the * values of. * NFSATTRBIT_STATFS0 - bits 0<->31 @@ -1067,6 +1165,11 @@ struct nfsv3_sattr { NFSATTRBM_TIMEDELTA) /* + * NFSATTRBIT_STATFS2 - bits 64<->95 + */ +#define NFSATTRBIT_STATFS2 0 + +/* * These are the bits that are needed by the nfs_statfs() call. * (The regular getattr bits are or'd in so the vnode gets the correct * type, etc.) @@ -1094,6 +1197,11 @@ struct nfsv3_sattr { NFSATTRBM_TIMEDELTA) /* + * NFSGETATTRBIT_STATFS2 - bits 64<->95 + */ +#define NFSGETATTRBIT_STATFS2 0 + +/* * Set of attributes for the equivalent of an nfsv3 pathconf rpc. * NFSGETATTRBIT_PATHCONF0 - bits 0<->31 */ @@ -1111,6 +1219,11 @@ struct nfsv3_sattr { NFSATTRBM_NOTRUNC) /* + * NFSGETATTRBIT_PATHCONF2 - bits 64<->95 + */ +#define NFSGETATTRBIT_PATHCONF2 0 + +/* * Sets of attributes required by readdir and readdirplus. * NFSATTRBIT_READDIRPLUS0 (NFSATTRBIT_GETATTR0 | NFSATTRBIT_FILEHANDLE | * NFSATTRBIT_RDATTRERROR) @@ -1118,6 +1231,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_READDIRPLUS0 (NFSATTRBIT_GETATTR0 | NFSATTRBM_FILEHANDLE | \ NFSATTRBM_RDATTRERROR) #define NFSATTRBIT_READDIRPLUS1 NFSATTRBIT_GETATTR1 +#define NFSATTRBIT_READDIRPLUS2 0 /* * Set of attributes supported by Referral vnodes. @@ -1125,6 +1239,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_REFERRAL0 (NFSATTRBM_TYPE | NFSATTRBM_FSID | \ NFSATTRBM_RDATTRERROR | NFSATTRBM_FSLOCATIONS) #define NFSATTRBIT_REFERRAL1 NFSATTRBM_MOUNTEDONFILEID +#define NFSATTRBIT_REFERRAL2 0 /* * Structure for data handled by the statfs rpc. Since some fields are Modified: stable/10/sys/fs/nfs/nfsrvstate.h ============================================================================== --- stable/10/sys/fs/nfs/nfsrvstate.h Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfs/nfsrvstate.h Fri Aug 1 21:10:41 2014 (r269398) @@ -42,6 +42,8 @@ LIST_HEAD(nfsclienthashhead, nfsclient); LIST_HEAD(nfsstatehead, nfsstate); LIST_HEAD(nfslockhead, nfslock); LIST_HEAD(nfslockhashhead, nfslockfile); +LIST_HEAD(nfssessionhead, nfsdsession); +LIST_HEAD(nfssessionhashhead, nfsdsession); /* * List head for nfsusrgrp. @@ -64,6 +66,13 @@ TAILQ_HEAD(nfsuserlruhead, nfsusrgrp); (&nfsgroupnamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ % NFSGROUPHASHSIZE]) +struct nfssessionhash { + struct mtx mtx; + struct nfssessionhashhead list; +}; +#define NFSSESSIONHASH(f) \ + (&nfssessionhash[nfsrv_hashsessionid(f) % NFSSESSIONHASHSIZE]) + /* * Client server structure for V4. It is doubly linked into two lists. * The first is a hash table based on the clientid and the second is a @@ -76,6 +85,7 @@ struct nfsclient { struct nfsstatehead lc_open; /* Open owner list */ struct nfsstatehead lc_deleg; /* Delegations */ struct nfsstatehead lc_olddeleg; /* and old delegations */ + struct nfssessionhead lc_session; /* List of NFSv4.1 sessions */ time_t lc_expiry; /* Expiry time (sec) */ time_t lc_delegtime; /* Old deleg expiry (sec) */ nfsquad_t lc_clientid; /* 64 bit clientid */ @@ -101,6 +111,43 @@ struct nfsclient { #define CLOPS_RENEWOP 0x0004 /* + * Structure for an NFSv4.1 session. + * Locking rules for this structure. + * To add/delete one of these structures from the lists, you must lock + * both: NFSLOCKSESSION(session hashhead) and NFSLOCKSTATE() in that order. + * To traverse the lists looking for one of these, you must hold one + * of these two locks. + * The exception is if the thread holds the exclusive root sleep lock. + * In this case, all other nfsd threads are blocked, so locking the + * mutexes isn't required. + * When manipulating sess_refcnt, NFSLOCKSTATE() must be locked. + * When manipulating the fields withinsess_cbsess except nfsess_xprt, + * sess_cbsess.nfsess_mtx must be locked. + * When manipulating sess_slots and sess_cbsess.nfsess_xprt, + * NFSLOCKSESSION(session hashhead) must be locked. + */ +struct nfsdsession { + uint64_t sess_refcnt; /* Reference count. */ + LIST_ENTRY(nfsdsession) sess_hash; /* Hash list of sessions. */ + LIST_ENTRY(nfsdsession) sess_list; /* List of client sessions. */ + struct nfsslot sess_slots[NFSV4_SLOTS]; + struct nfsclient *sess_clp; /* Associated clientid. */ + uint32_t sess_crflags; + uint32_t sess_cbprogram; + uint32_t sess_maxreq; + uint32_t sess_maxresp; + uint32_t sess_maxrespcached; + uint32_t sess_maxops; + uint32_t sess_maxslots; + uint32_t sess_cbmaxreq; + uint32_t sess_cbmaxresp; + uint32_t sess_cbmaxrespcached; + uint32_t sess_cbmaxops; + uint8_t sess_sessionid[NFSX_V4SESSIONID]; + struct nfsclsession sess_cbsess; /* Callback session. */ +}; + +/* * Nfs state structure. I couldn't resist overloading this one, since * it makes cleanup, etc. simpler. These structures are used in four ways: * - open_owner structures chained off of nfsclient Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clstate.c Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfsclient/nfs_clstate.c Fri Aug 1 21:10:41 2014 (r269398) @@ -3548,7 +3548,7 @@ out: if (clp != NULL) { nfsv4_seqsess_cacherep(slotid, NFSMNT_MDSSESSION(clp->nfsc_nmp)->nfsess_cbslots, - rep); + NFSERR_OK, &rep); NFSUNLOCKCLSTATE(); } else { NFSUNLOCKCLSTATE(); Modified: stable/10/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdcache.c Fri Aug 1 21:00:18 2014 (r269397) +++ stable/10/sys/fs/nfsserver/nfs_nfsdcache.c Fri Aug 1 21:10:41 2014 (r269398) @@ -977,6 +977,9 @@ nfsrvd_refcache(struct nfsrvcache *rp) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 21:14:02 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A80C2F42; Fri, 1 Aug 2014 21:14:02 +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 94A0E2835; Fri, 1 Aug 2014 21:14:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s71LE2uA015352; Fri, 1 Aug 2014 21:14:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71LE2oV015350; Fri, 1 Aug 2014 21:14:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201408012114.s71LE2oV015350@svn.freebsd.org> From: Ed Maste Date: Fri, 1 Aug 2014 21:14:02 +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: r269399 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 21:14:02 -0000 Author: emaste Date: Fri Aug 1 21:14:02 2014 New Revision: 269399 URL: http://svnweb.freebsd.org/changeset/base/269399 Log: MFC r266902: Add missing libexec/bsdconfig subdirectories Modified: stable/10/etc/mtree/BSD.usr.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Fri Aug 1 21:10:41 2014 (r269398) +++ stable/10/etc/mtree/BSD.usr.dist Fri Aug 1 21:14:02 2014 (r269399) @@ -101,6 +101,10 @@ .. include .. + includes + include + .. + .. .. bsdinstall .. From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 21:24:20 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28755306; Fri, 1 Aug 2014 21:24: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 15484292B; Fri, 1 Aug 2014 21:24:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s71LOJJj019847; Fri, 1 Aug 2014 21:24:19 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71LOJqB019846; Fri, 1 Aug 2014 21:24:19 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201408012124.s71LOJqB019846@svn.freebsd.org> From: Rick Macklem Date: Fri, 1 Aug 2014 21:24:19 +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: r269400 - stable/10/sys/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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 21:24:20 -0000 Author: rmacklem Date: Fri Aug 1 21:24:19 2014 New Revision: 269400 URL: http://svnweb.freebsd.org/changeset/base/269400 Log: Bump __FreeBSD_version for r269398, since it changes the internal interfaces between the NFS related modules. This is a direct commit to stable/10. Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Fri Aug 1 21:14:02 2014 (r269399) +++ stable/10/sys/sys/param.h Fri Aug 1 21:24:19 2014 (r269400) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000711 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000712 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 21:28:58 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDB894B7; Fri, 1 Aug 2014 21:28: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 DA22D2953; Fri, 1 Aug 2014 21:28: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 s71LSwrv020454; Fri, 1 Aug 2014 21:28:58 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71LSwcc020453; Fri, 1 Aug 2014 21:28:58 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201408012128.s71LSwcc020453@svn.freebsd.org> From: Rick Macklem Date: Fri, 1 Aug 2014 21:28:58 +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: r269401 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 21:28:59 -0000 Author: rmacklem Date: Fri Aug 1 21:28:58 2014 New Revision: 269401 URL: http://svnweb.freebsd.org/changeset/base/269401 Log: Add an UPDATING entry for the __FreeBSD_version bump related to r269398. Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Fri Aug 1 21:24:19 2014 (r269400) +++ stable/10/UPDATING Fri Aug 1 21:28:58 2014 (r269401) @@ -16,6 +16,11 @@ 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. +20140801: + The NFSv4.1 server committed by r269398 changes the internal + function call interfaces used between the NFS and krpc modules. + As such, __FreeBSD_version was bumped. + 20140717: It is no longer necessary to include the dwarf version in your DEBUG options in your kernel config file. The bug that required it to be From owner-svn-src-stable-10@FreeBSD.ORG Fri Aug 1 21:40:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7D76904; Fri, 1 Aug 2014 21:40: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 C3D402AF7; Fri, 1 Aug 2014 21:40: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 s71LegFU027016; Fri, 1 Aug 2014 21:40:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s71LegeQ027014; Fri, 1 Aug 2014 21:40:42 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201408012140.s71LegeQ027014@svn.freebsd.org> From: Ed Maste Date: Fri, 1 Aug 2014 21:40:42 +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: r269402 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 21:40:42 -0000 Author: emaste Date: Fri Aug 1 21:40:42 2014 New Revision: 269402 URL: http://svnweb.freebsd.org/changeset/base/269402 Log: MFC r258436: Refactor amd64 startup SMAP parsing Extracted from the projects/uefi branch, this change is a reasonable cleanup and will reduce the diffs to review when bringing in the UEFI work. Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Fri Aug 1 21:28:58 2014 (r269401) +++ stable/10/sys/amd64/amd64/machdep.c Fri Aug 1 21:40:42 2014 (r269402) @@ -1330,20 +1330,14 @@ isa_irq_pending(void) u_int basemem; static int -add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, + int *physmap_idxp) { int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; - if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016lx len=%016lx\n", - smap->type, smap->base, smap->length); - - if (smap->type != SMAP_TYPE_MEMORY) - return (1); - - if (smap->length == 0) + if (length == 0) return (1); /* @@ -1352,8 +1346,8 @@ add_smap_entry(struct bios_smap *smap, v */ insert_idx = physmap_idx + 2; for (i = 0; i <= physmap_idx; i += 2) { - if (smap->base < physmap[i + 1]) { - if (smap->base + smap->length <= physmap[i]) { + if (base < physmap[i + 1]) { + if (base + length <= physmap[i]) { insert_idx = i; break; } @@ -1365,15 +1359,14 @@ add_smap_entry(struct bios_smap *smap, v } /* See if we can prepend to the next entry. */ - if (insert_idx <= physmap_idx && - smap->base + smap->length == physmap[insert_idx]) { - physmap[insert_idx] = smap->base; + if (insert_idx <= physmap_idx && base + length == physmap[insert_idx]) { + physmap[insert_idx] = base; return (1); } /* See if we can append to the previous entry. */ - if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { - physmap[insert_idx - 1] += smap->length; + if (insert_idx > 0 && base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += length; return (1); } @@ -1395,11 +1388,42 @@ add_smap_entry(struct bios_smap *smap, v } /* Insert the new entry. */ - physmap[insert_idx] = smap->base; - physmap[insert_idx + 1] = smap->base + smap->length; + physmap[insert_idx] = base; + physmap[insert_idx + 1] = base + length; return (1); } +static void +add_smap_entries(struct bios_smap *smapbase, vm_paddr_t *physmap, + int *physmap_idx) +{ + struct bios_smap *smap, *smapend; + u_int32_t smapsize; + + /* + * Memory map from INT 15:E820. + * + * subr_module.c says: + * "Consumer may safely assume that size value precedes data." + * ie: an int32_t immediately precedes smap. + */ + smapsize = *((u_int32_t *)smapbase - 1); + smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); + + for (smap = smapbase; smap < smapend; smap++) { + if (boothowto & RB_VERBOSE) + printf("SMAP type=%02x base=%016lx len=%016lx\n", + smap->type, smap->base, smap->length); + + if (smap->type != SMAP_TYPE_MEMORY) + continue; + + if (!add_physmap_entry(smap->base, smap->length, physmap, + physmap_idx)) + break; + } +} + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -1417,32 +1441,19 @@ getmemsize(caddr_t kmdp, u_int64_t first vm_paddr_t pa, physmap[PHYSMAP_SIZE]; u_long physmem_start, physmem_tunable, memtest; pt_entry_t *pte; - struct bios_smap *smapbase, *smap, *smapend; - u_int32_t smapsize; + struct bios_smap *smapbase; quad_t dcons_addr, dcons_size; bzero(physmap, sizeof(physmap)); basemem = 0; physmap_idx = 0; - /* - * get memory map from INT 15:E820, kindly supplied by the loader. - * - * subr_module.c says: - * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. - */ smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) panic("No BIOS smap info from loader!"); - smapsize = *((u_int32_t *)smapbase - 1); - smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); - - for (smap = smapbase; smap < smapend; smap++) - if (!add_smap_entry(smap, physmap, &physmap_idx)) - break; + add_smap_entries(smapbase, physmap, &physmap_idx); /* * Find the 'base memory' segment for SMP From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 03:56:08 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6B64EA; Sat, 2 Aug 2014 03:56:08 +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 C10D12215; Sat, 2 Aug 2014 03:56:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s723u80G001579; Sat, 2 Aug 2014 03:56:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s723u7ZL001571; Sat, 2 Aug 2014 03:56:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201408020356.s723u7ZL001571@svn.freebsd.org> From: Xin LI Date: Sat, 2 Aug 2014 03:56:07 +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: r269416 - in stable/10: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 03:56:09 -0000 Author: delphij Date: Sat Aug 2 03:56:06 2014 New Revision: 269416 URL: http://svnweb.freebsd.org/changeset/base/269416 Log: MFC r268855: MFV r268848: Instead of asserting all zio's be properly aligned, only assert on the logical ones. Cap uberblocks at 8k, otherwise with ashift=17, there would be only one uberblock. This fixes a problem that zdb would trip assert on pools with ashift >= 0xe (8k). While there, also change the code so it only attempt to condense space map unless the uncondensed size consumes greater than zfs_metaslab_condense_block_threshold blocks. Illumos issue: 4958 zdb trips assert on pools with ashift >= 0xe Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Aug 2 03:56:06 2014 (r269416) @@ -810,7 +810,7 @@ static uint64_t ztest_get_ashift(void) { if (ztest_opts.zo_ashift == 0) - return (SPA_MINBLOCKSHIFT + ztest_random(3)); + return (SPA_MINBLOCKSHIFT + ztest_random(5)); return (ztest_opts.zo_ashift); } @@ -969,11 +969,28 @@ ztest_random_spa_version(uint64_t initia return (version); } +/* + * Find the largest ashift used + */ +static uint64_t +ztest_spa_get_ashift() { + uint64_t i; + uint64_t ashift = SPA_MINBLOCKSHIFT; + vdev_t *rvd = ztest_spa->spa_root_vdev; + + for (i = 0; i < rvd->vdev_children; i++) { + ashift = MAX(ashift, rvd->vdev_child[i]->vdev_ashift); + } + return (ashift); +} + static int ztest_random_blocksize(void) { - return (1 << (SPA_MINBLOCKSHIFT + - ztest_random(SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1))); + // Choose a block size >= the ashift. + uint64_t block_shift = + ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1); + return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } static int @@ -5768,16 +5785,30 @@ ztest_freeze(void) spa_freeze(spa); /* + * Because it is hard to predict how much space a write will actually + * require beforehand, we leave ourselves some fudge space to write over + * capacity. + */ + uint64_t capacity = metaslab_class_get_space(spa_normal_class(spa)) / 2; + + /* * Run tests that generate log records but don't alter the pool config * or depend on DSL sync tasks (snapshots, objset create/destroy, etc). * We do a txg_wait_synced() after each iteration to force the txg * to increase well beyond the last synced value in the uberblock. * The ZIL should be OK with that. + * + * Run a random number of times less than zo_maxloops and ensure we do + * not run out of space on the pool. */ while (ztest_random(10) != 0 && - numloops++ < ztest_opts.zo_maxloops) { - ztest_dmu_write_parallel(zd, 0); - ztest_dmu_object_alloc_free(zd, 0); + numloops++ < ztest_opts.zo_maxloops && + metaslab_class_get_alloc(spa_normal_class(spa)) < capacity) { + ztest_od_t od; + ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + VERIFY0(ztest_object_init(zd, &od, sizeof (od), B_FALSE)); + ztest_io(zd, od.od_object, + ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT); txg_wait_synced(spa_get_dsl(spa), 0); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Aug 2 03:56:06 2014 (r269416) @@ -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. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Aug 2 03:56:06 2014 (r269416) @@ -74,6 +74,21 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_ " of in-memory counterpart"); /* + * Condensing a metaslab is not guaranteed to actually reduce the amount of + * space used on disk. In particular, a space map uses data in increments of + * MAX(1 << ashift, SPACE_MAP_INITIAL_BLOCKSIZE), so a metaslab might use the + * same number of blocks after condensing. Since the goal of condensing is to + * reduce the number of IOPs required to read the space map, we only want to + * condense when we can be sure we will reduce the number of blocks used by the + * space map. Unfortunately, we cannot precisely compute whether or not this is + * the case in metaslab_should_condense since we are holding ms_lock. Instead, + * we apply the following heuristic: do not condense a spacemap unless the + * uncondensed size consumes greater than zfs_metaslab_condense_block_threshold + * blocks. + */ +int zfs_metaslab_condense_block_threshold = 4; + +/* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of * a free space. Metaslab groups that have more free space than @@ -1371,6 +1386,8 @@ metaslab_group_preload(metaslab_group_t * times the size than the free space range tree representation * (i.e. zfs_condense_pct = 110 and in-core = 1MB, minimal = 1.1.MB). * + * 3. The on-disk size of the space map should actually decrease. + * * Checking the first condition is tricky since we don't want to walk * the entire AVL tree calculating the estimated on-disk size. Instead we * use the size-ordered range tree in the metaslab and calculate the @@ -1381,13 +1398,21 @@ metaslab_group_preload(metaslab_group_t * To determine the second criterion we use a best-case estimate and assume * each segment can be represented on-disk as a single 64-bit entry. We refer * to this best-case estimate as the space map's minimal form. + * + * Unfortunately, we cannot compute the on-disk size of the space map in this + * context because we cannot accurately compute the effects of compression, etc. + * Instead, we apply the heuristic described in the block comment for + * zfs_metaslab_condense_block_threshold - we only condense if the space used + * is greater than a threshold number of blocks. */ static boolean_t metaslab_should_condense(metaslab_t *msp) { space_map_t *sm = msp->ms_sm; range_seg_t *rs; - uint64_t size, entries, segsz; + uint64_t size, entries, segsz, object_size, optimal_size, record_size; + dmu_object_info_t doi; + uint64_t vdev_blocksize = 1 << msp->ms_group->mg_vd->vdev_ashift; ASSERT(MUTEX_HELD(&msp->ms_lock)); ASSERT(msp->ms_loaded); @@ -1411,9 +1436,15 @@ metaslab_should_condense(metaslab_t *msp entries = size / (MIN(size, SM_RUN_MAX)); segsz = entries * sizeof (uint64_t); - return (segsz <= space_map_length(msp->ms_sm) && - space_map_length(msp->ms_sm) >= (zfs_condense_pct * - sizeof (uint64_t) * avl_numnodes(&msp->ms_tree->rt_root)) / 100); + optimal_size = sizeof (uint64_t) * avl_numnodes(&msp->ms_tree->rt_root); + object_size = space_map_length(msp->ms_sm); + + dmu_object_info_from_db(sm->sm_dbuf, &doi); + record_size = MAX(doi.doi_data_block_size, vdev_blocksize); + + return (segsz <= object_size && + object_size >= (optimal_size * zfs_condense_pct / 100) && + object_size > zfs_metaslab_condense_block_threshold * record_size); } /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Aug 2 03:56:06 2014 (r269416) @@ -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. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sat Aug 2 03:56:06 2014 (r269416) @@ -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) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_IMPL_H @@ -249,8 +249,11 @@ struct vdev { #define VDEV_PHYS_SIZE (112 << 10) #define VDEV_UBERBLOCK_RING (128 << 10) +/* The largest uberblock we support is 8k. */ +#define MAX_UBERBLOCK_SHIFT (13) #define VDEV_UBERBLOCK_SHIFT(vd) \ - MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT) + MIN(MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT), \ + MAX_UBERBLOCK_SHIFT) #define VDEV_UBERBLOCK_COUNT(vd) \ (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd)) #define VDEV_UBERBLOCK_OFFSET(vd, n) \ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Aug 2 03:56:06 2014 (r269416) @@ -165,19 +165,20 @@ enum zio_flag { ZIO_FLAG_RESILVER = 1 << 3, ZIO_FLAG_SCRUB = 1 << 4, ZIO_FLAG_SCAN_THREAD = 1 << 5, + ZIO_FLAG_PHYSICAL = 1 << 6, #define ZIO_FLAG_AGG_INHERIT (ZIO_FLAG_CANFAIL - 1) /* * Flags inherited by ddt, gang, and vdev children. */ - ZIO_FLAG_CANFAIL = 1 << 6, /* must be first for INHERIT */ - ZIO_FLAG_SPECULATIVE = 1 << 7, - ZIO_FLAG_CONFIG_WRITER = 1 << 8, - ZIO_FLAG_DONT_RETRY = 1 << 9, - ZIO_FLAG_DONT_CACHE = 1 << 10, - ZIO_FLAG_NODATA = 1 << 11, - ZIO_FLAG_INDUCE_DAMAGE = 1 << 12, + ZIO_FLAG_CANFAIL = 1 << 7, /* must be first for INHERIT */ + ZIO_FLAG_SPECULATIVE = 1 << 8, + ZIO_FLAG_CONFIG_WRITER = 1 << 9, + ZIO_FLAG_DONT_RETRY = 1 << 10, + ZIO_FLAG_DONT_CACHE = 1 << 11, + ZIO_FLAG_NODATA = 1 << 12, + ZIO_FLAG_INDUCE_DAMAGE = 1 << 13, #define ZIO_FLAG_DDT_INHERIT (ZIO_FLAG_IO_RETRY - 1) #define ZIO_FLAG_GANG_INHERIT (ZIO_FLAG_IO_RETRY - 1) @@ -185,27 +186,27 @@ enum zio_flag { /* * Flags inherited by vdev children. */ - ZIO_FLAG_IO_RETRY = 1 << 13, /* must be first for INHERIT */ - ZIO_FLAG_PROBE = 1 << 14, - ZIO_FLAG_TRYHARD = 1 << 15, - ZIO_FLAG_OPTIONAL = 1 << 16, + ZIO_FLAG_IO_RETRY = 1 << 14, /* must be first for INHERIT */ + ZIO_FLAG_PROBE = 1 << 15, + ZIO_FLAG_TRYHARD = 1 << 16, + ZIO_FLAG_OPTIONAL = 1 << 17, #define ZIO_FLAG_VDEV_INHERIT (ZIO_FLAG_DONT_QUEUE - 1) /* * Flags not inherited by any children. */ - ZIO_FLAG_DONT_QUEUE = 1 << 17, /* must be first for INHERIT */ - ZIO_FLAG_DONT_PROPAGATE = 1 << 18, - ZIO_FLAG_IO_BYPASS = 1 << 19, - ZIO_FLAG_IO_REWRITE = 1 << 20, - ZIO_FLAG_RAW = 1 << 21, - ZIO_FLAG_GANG_CHILD = 1 << 22, - ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24, - ZIO_FLAG_NOPWRITE = 1 << 25, - ZIO_FLAG_REEXECUTED = 1 << 26, - ZIO_FLAG_DELEGATED = 1 << 27, + ZIO_FLAG_DONT_QUEUE = 1 << 18, /* must be first for INHERIT */ + ZIO_FLAG_DONT_PROPAGATE = 1 << 19, + ZIO_FLAG_IO_BYPASS = 1 << 20, + ZIO_FLAG_IO_REWRITE = 1 << 21, + ZIO_FLAG_RAW = 1 << 22, + ZIO_FLAG_GANG_CHILD = 1 << 23, + ZIO_FLAG_DDT_CHILD = 1 << 24, + ZIO_FLAG_GODFATHER = 1 << 25, + ZIO_FLAG_NOPWRITE = 1 << 26, + ZIO_FLAG_REEXECUTED = 1 << 27, + ZIO_FLAG_DELEGATED = 1 << 28, }; #define ZIO_FLAG_MUSTSUCCEED 0 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Sat Aug 2 03:56:06 2014 (r269416) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 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. */ #include @@ -57,7 +57,10 @@ zfs_dbgmsg_fini(void) * echo ::zfs_dbgmsg | mdb -k * * Monitor these messages by running: - * dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' + * dtrace -qn 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' + * + * When used with libzpool, monitor with: + * dtrace -qn 'zfs$pid::zfs_dbgmsg:probe1{printf("%s\n", copyinstr(arg1))}' */ void zfs_dbgmsg(const char *fmt, ...) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Aug 2 03:48:16 2014 (r269415) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Aug 2 03:56:06 2014 (r269416) @@ -886,8 +886,8 @@ zio_read_phys(zio_t *pio, vdev_t *vd, ui ASSERT3U(offset + size, <=, vd->vdev_psize); zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private, - ZIO_TYPE_READ, priority, flags, vd, offset, NULL, - ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE); + ZIO_TYPE_READ, priority, flags | ZIO_FLAG_PHYSICAL, vd, offset, + NULL, ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE); zio->io_prop.zp_checksum = checksum; @@ -907,8 +907,8 @@ zio_write_phys(zio_t *pio, vdev_t *vd, u ASSERT3U(offset + size, <=, vd->vdev_psize); zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private, - ZIO_TYPE_WRITE, priority, flags, vd, offset, NULL, - ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE); + ZIO_TYPE_WRITE, priority, flags | ZIO_FLAG_PHYSICAL, vd, offset, + NULL, ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE); zio->io_prop.zp_checksum = checksum; @@ -2621,7 +2621,9 @@ zio_vdev_io_start(zio_t **ziop) align = 1ULL << vd->vdev_top->vdev_ashift; - if (P2PHASE(zio->io_size, align) != 0) { + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && + P2PHASE(zio->io_size, align) != 0) { + /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); char *abuf = NULL; if (zio->io_type == ZIO_TYPE_READ || @@ -2636,8 +2638,22 @@ zio_vdev_io_start(zio_t **ziop) zio_subblock); } - ASSERT(P2PHASE(zio->io_offset, align) == 0); - ASSERT(P2PHASE(zio->io_size, align) == 0); + /* + * If this is not a physical io, make sure that it is properly aligned + * before proceeding. + */ + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL)) { + ASSERT0(P2PHASE(zio->io_offset, align)); + ASSERT0(P2PHASE(zio->io_size, align)); + } else { + /* + * For physical writes, we allow 512b aligned writes and assume + * the device will perform a read-modify-write as necessary. + */ + ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); + ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); + } + VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); /* From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 03:59:36 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D23FA377; Sat, 2 Aug 2014 03:59: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 B34EC222C; Sat, 2 Aug 2014 03:59: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 s723xaqq002070; Sat, 2 Aug 2014 03:59:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s723xa82002064; Sat, 2 Aug 2014 03:59:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201408020359.s723xa82002064@svn.freebsd.org> From: Xin LI Date: Sat, 2 Aug 2014 03:59: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: r269417 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 03:59:37 -0000 Author: delphij Date: Sat Aug 2 03:59:35 2014 New Revision: 269417 URL: http://svnweb.freebsd.org/changeset/base/269417 Log: MFC r268858: MFV r268850: Change the interaction between the DMU and ARC so that when the DMU is shutting down an objset, we do not evict the data from the ARC. Instead we simply coordinate the destruction of the DMU's data with the ARC. The only case where we actually need to explicitly evict from the ARC is when dbuf_rele_and_unlock() determines that the administrator has requested that it not be kept in memory, via the primarycache/secondarycache properties. In this case, we evict the data from the ARC by its blkptr_t, the same way as when a block is freed we explicitly evict it from the ARC. Illumos issue: 4631 zvol_get_stats triggering too many reads Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 2 03:56:06 2014 (r269416) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 2 03:59:35 2014 (r269417) @@ -104,7 +104,7 @@ * with the buffer may be evicted prior to the callback. The callback * must be made with *no locks held* (to prevent deadlock). Additionally, * the users of callbacks must ensure that their private data is - * protected from simultaneous callbacks from arc_buf_evict() + * protected from simultaneous callbacks from arc_clear_callback() * and arc_do_user_evicts(). * * Note that the majority of the performance stats are manipulated @@ -1647,8 +1647,12 @@ arc_buf_data_free(arc_buf_t *buf, void ( } } +/* + * Free up buf->b_data and if 'remove' is set, then pull the + * arc_buf_t off of the the arc_buf_hdr_t's list and free it. + */ static void -arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t all) +arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) { arc_buf_t **bufp; @@ -1701,7 +1705,7 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ } /* only remove the buf if requested */ - if (!all) + if (!remove) return; /* remove the buf from the hdr list */ @@ -2355,7 +2359,7 @@ restart: mutex_exit(&buf->b_evict_lock); if (buf->b_efunc != NULL) - VERIFY(buf->b_efunc(buf) == 0); + VERIFY0(buf->b_efunc(buf->b_private)); buf->b_efunc = NULL; buf->b_private = NULL; @@ -3490,16 +3494,25 @@ arc_freed(spa_t *spa, const blkptr_t *bp } /* - * This is used by the DMU to let the ARC know that a buffer is - * being evicted, so the ARC should clean up. If this arc buf - * is not yet in the evicted state, it will be put there. + * Clear the user eviction callback set by arc_set_callback(), first calling + * it if it exists. Because the presence of a callback keeps an arc_buf cached + * clearing the callback may result in the arc_buf being destroyed. However, + * it will not result in the *last* arc_buf being destroyed, hence the data + * will remain cached in the ARC. We make a copy of the arc buffer here so + * that we can process the callback without holding any locks. + * + * It's possible that the callback is already in the process of being cleared + * by another thread. In this case we can not clear the callback. + * + * Returns B_TRUE if the callback was successfully called and cleared. */ -int -arc_buf_evict(arc_buf_t *buf) +boolean_t +arc_clear_callback(arc_buf_t *buf) { arc_buf_hdr_t *hdr; kmutex_t *hash_lock; - arc_buf_t **bufp; + arc_evict_func_t *efunc = buf->b_efunc; + void *private = buf->b_private; list_t *list, *evicted_list; kmutex_t *lock, *evicted_lock; @@ -3511,17 +3524,16 @@ arc_buf_evict(arc_buf_t *buf) */ ASSERT(buf->b_data == NULL); mutex_exit(&buf->b_evict_lock); - return (0); + return (B_FALSE); } else if (buf->b_data == NULL) { - arc_buf_t copy = *buf; /* structure assignment */ /* * We are on the eviction list; process this buffer now * but let arc_do_user_evicts() do the reaping. */ buf->b_efunc = NULL; mutex_exit(&buf->b_evict_lock); - VERIFY(copy.b_efunc(©) == 0); - return (1); + VERIFY0(efunc(private)); + return (B_TRUE); } hash_lock = HDR_LOCK(hdr); mutex_enter(hash_lock); @@ -3531,50 +3543,21 @@ arc_buf_evict(arc_buf_t *buf) ASSERT3U(refcount_count(&hdr->b_refcnt), <, hdr->b_datacnt); ASSERT(hdr->b_state == arc_mru || hdr->b_state == arc_mfu); - /* - * Pull this buffer off of the hdr - */ - bufp = &hdr->b_buf; - while (*bufp != buf) - bufp = &(*bufp)->b_next; - *bufp = buf->b_next; - - ASSERT(buf->b_data != NULL); - arc_buf_destroy(buf, FALSE, FALSE); - - if (hdr->b_datacnt == 0) { - arc_state_t *old_state = hdr->b_state; - arc_state_t *evicted_state; - - ASSERT(hdr->b_buf == NULL); - ASSERT(refcount_is_zero(&hdr->b_refcnt)); - - evicted_state = - (old_state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - - get_buf_info(hdr, old_state, &list, &lock); - get_buf_info(hdr, evicted_state, &evicted_list, &evicted_lock); - mutex_enter(lock); - mutex_enter(evicted_lock); - - arc_change_state(evicted_state, hdr, hash_lock); - ASSERT(HDR_IN_HASH_TABLE(hdr)); - hdr->b_flags |= ARC_IN_HASH_TABLE; - hdr->b_flags &= ~ARC_BUF_AVAILABLE; + buf->b_efunc = NULL; + buf->b_private = NULL; - mutex_exit(evicted_lock); - mutex_exit(lock); + if (hdr->b_datacnt > 1) { + mutex_exit(&buf->b_evict_lock); + arc_buf_destroy(buf, FALSE, TRUE); + } else { + ASSERT(buf == hdr->b_buf); + hdr->b_flags |= ARC_BUF_AVAILABLE; + mutex_exit(&buf->b_evict_lock); } - mutex_exit(hash_lock); - mutex_exit(&buf->b_evict_lock); - VERIFY(buf->b_efunc(buf) == 0); - buf->b_efunc = NULL; - buf->b_private = NULL; - buf->b_hdr = NULL; - buf->b_next = NULL; - kmem_cache_free(buf_cache, buf); - return (1); + mutex_exit(hash_lock); + VERIFY0(efunc(private)); + return (B_TRUE); } /* @@ -3724,17 +3707,6 @@ arc_released(arc_buf_t *buf) return (released); } -int -arc_has_callback(arc_buf_t *buf) -{ - int callback; - - mutex_enter(&buf->b_evict_lock); - callback = (buf->b_efunc != NULL); - mutex_exit(&buf->b_evict_lock); - return (callback); -} - #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Aug 2 03:56:06 2014 (r269416) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Aug 2 03:59:35 2014 (r269417) @@ -181,8 +181,7 @@ dbuf_hash_insert(dmu_buf_impl_t *db) } /* - * Remove an entry from the hash table. This operation will - * fail if there are any existing holds on the db. + * Remove an entry from the hash table. It must be in the EVICTING state. */ static void dbuf_hash_remove(dmu_buf_impl_t *db) @@ -194,7 +193,7 @@ dbuf_hash_remove(dmu_buf_impl_t *db) dmu_buf_impl_t *dbf, **dbp; /* - * We musn't hold db_mtx to maintin lock ordering: + * We musn't hold db_mtx to maintain lock ordering: * DBUF_HASH_MUTEX > db_mtx. */ ASSERT(refcount_is_zero(&db->db_holds)); @@ -431,7 +430,6 @@ static void dbuf_set_data(dmu_buf_impl_t *db, arc_buf_t *buf) { ASSERT(MUTEX_HELD(&db->db_mtx)); - ASSERT(db->db_buf == NULL || !arc_has_callback(db->db_buf)); db->db_buf = buf; if (buf != NULL) { ASSERT(buf->b_data != NULL); @@ -1544,12 +1542,15 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a * when we are not holding the dn_dbufs_mtx, we can't clear the * entry in the dn_dbufs list. We have to wait until dbuf_destroy() * in this case. For callers from the DMU we will usually see: - * dbuf_clear()->arc_buf_evict()->dbuf_do_evict()->dbuf_destroy() + * dbuf_clear()->arc_clear_callback()->dbuf_do_evict()->dbuf_destroy() * For the arc callback, we will usually see: * dbuf_do_evict()->dbuf_clear();dbuf_destroy() * Sometimes, though, we will get a mix of these two: - * DMU: dbuf_clear()->arc_buf_evict() + * DMU: dbuf_clear()->arc_clear_callback() * ARC: dbuf_do_evict()->dbuf_destroy() + * + * This routine will dissociate the dbuf from the arc, by calling + * arc_clear_callback(), but will not evict the data from the ARC. */ void dbuf_clear(dmu_buf_impl_t *db) @@ -1557,7 +1558,7 @@ dbuf_clear(dmu_buf_impl_t *db) dnode_t *dn; dmu_buf_impl_t *parent = db->db_parent; dmu_buf_impl_t *dndb; - int dbuf_gone = FALSE; + boolean_t dbuf_gone = B_FALSE; ASSERT(MUTEX_HELD(&db->db_mtx)); ASSERT(refcount_is_zero(&db->db_holds)); @@ -1603,7 +1604,7 @@ dbuf_clear(dmu_buf_impl_t *db) } if (db->db_buf) - dbuf_gone = arc_buf_evict(db->db_buf); + dbuf_gone = arc_clear_callback(db->db_buf); if (!dbuf_gone) mutex_exit(&db->db_mtx); @@ -1771,8 +1772,7 @@ dbuf_create(dnode_t *dn, uint8_t level, static int dbuf_do_evict(void *private) { - arc_buf_t *buf = private; - dmu_buf_impl_t *db = buf->b_private; + dmu_buf_impl_t *db = private; if (!MUTEX_HELD(&db->db_mtx)) mutex_enter(&db->db_mtx); @@ -2135,11 +2135,23 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, * block on-disk. If so, then we simply evict * ourselves. */ - if (!DBUF_IS_CACHEABLE(db) || - arc_buf_eviction_needed(db->db_buf)) + if (!DBUF_IS_CACHEABLE(db)) { + if (db->db_blkptr != NULL && + !BP_IS_HOLE(db->db_blkptr) && + !BP_IS_EMBEDDED(db->db_blkptr)) { + spa_t *spa = + dmu_objset_spa(db->db_objset); + blkptr_t bp = *db->db_blkptr; + dbuf_clear(db); + arc_freed(spa, &bp); + } else { + dbuf_clear(db); + } + } else if (arc_buf_eviction_needed(db->db_buf)) { dbuf_clear(db); - else + } else { mutex_exit(&db->db_mtx); + } } } else { mutex_exit(&db->db_mtx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Aug 2 03:56:06 2014 (r269416) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Aug 2 03:59:35 2014 (r269417) @@ -95,7 +95,6 @@ boolean_t arc_buf_remove_ref(arc_buf_t * int arc_buf_size(arc_buf_t *buf); void arc_release(arc_buf_t *buf, void *tag); int arc_released(arc_buf_t *buf); -int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); boolean_t arc_buf_eviction_needed(arc_buf_t *buf); @@ -114,7 +113,7 @@ zio_t *arc_write(zio_t *pio, spa_t *spa, void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); -int arc_buf_evict(arc_buf_t *buf); +boolean_t arc_clear_callback(arc_buf_t *buf); void arc_flush(spa_t *spa); void arc_tempreserve_clear(uint64_t reserve); From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 04:01:46 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 111A74B2; Sat, 2 Aug 2014 04:01: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 DDAFC22BD; Sat, 2 Aug 2014 04:01: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 s7241jVw005787; Sat, 2 Aug 2014 04:01:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7241iKK005781; Sat, 2 Aug 2014 04:01:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201408020401.s7241iKK005781@svn.freebsd.org> From: Xin LI Date: Sat, 2 Aug 2014 04:01: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: r269418 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 04:01:46 -0000 Author: delphij Date: Sat Aug 2 04:01:44 2014 New Revision: 269418 URL: http://svnweb.freebsd.org/changeset/base/269418 Log: MFC r268859: MFV r268851: When a sync task is waiting for a txg to complete, we should hurry it along by increasing the number of outstanding async writes (i.e. make vdev_queue_max_async_writes() return a larger number). Illumos issue: 4753 increase number of outstanding async writes when sync task is waiting Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Aug 2 03:59:35 2014 (r269417) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Aug 2 04:01:44 2014 (r269418) @@ -1938,6 +1938,16 @@ spa_writeable(spa_t *spa) return (!!(spa->spa_mode & FWRITE)); } +/* + * Returns true if there is a pending sync task in any of the current + * syncing txg, the current quiescing txg, or the current open txg. + */ +boolean_t +spa_has_pending_synctask(spa_t *spa) +{ + return (!txg_all_lists_empty(&spa->spa_dsl_pool->dp_sync_tasks)); +} + int spa_mode(spa_t *spa) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Aug 2 03:59:35 2014 (r269417) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Aug 2 04:01:44 2014 (r269418) @@ -800,6 +800,7 @@ extern uint64_t bp_get_dsize(spa_t *spa, extern boolean_t spa_has_slogs(spa_t *spa); extern boolean_t spa_is_root(spa_t *spa); extern boolean_t spa_writeable(spa_t *spa); +extern boolean_t spa_has_pending_synctask(spa_t *spa); extern int spa_mode(spa_t *spa); extern uint64_t zfs_strtonum(const char *str, char **nptr); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Sat Aug 2 03:59:35 2014 (r269417) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Sat Aug 2 04:01:44 2014 (r269418) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_TXG_H @@ -112,6 +112,7 @@ extern boolean_t txg_sync_waiting(struct extern void txg_list_create(txg_list_t *tl, size_t offset); extern void txg_list_destroy(txg_list_t *tl); extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg); +extern boolean_t txg_all_lists_empty(txg_list_t *tl); extern boolean_t txg_list_add(txg_list_t *tl, void *p, uint64_t txg); extern boolean_t txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg); extern void *txg_list_remove(txg_list_t *tl, uint64_t txg); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat Aug 2 03:59:35 2014 (r269417) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat Aug 2 04:01:44 2014 (r269418) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -727,6 +727,24 @@ txg_list_empty(txg_list_t *tl, uint64_t } /* + * Returns true if all txg lists are empty. + * + * Warning: this is inherently racy (an item could be added immediately after this + * function returns). We don't bother with the lock because it wouldn't change the + * semantics. + */ +boolean_t +txg_all_lists_empty(txg_list_t *tl) +{ + for (int i = 0; i < TXG_SIZE; i++) { + if (!txg_list_empty(tl, i)) { + return (B_FALSE); + } + } + return (B_TRUE); +} + +/* * Add an entry to the list (unless it's already on the list). * Returns B_TRUE if it was actually added. */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sat Aug 2 03:59:35 2014 (r269417) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sat Aug 2 04:01:44 2014 (r269418) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -408,14 +408,23 @@ vdev_queue_class_min_active(zio_priority } static int -vdev_queue_max_async_writes(uint64_t dirty) +vdev_queue_max_async_writes(spa_t *spa) { int writes; + uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total; uint64_t min_bytes = zfs_dirty_data_max * zfs_vdev_async_write_active_min_dirty_percent / 100; uint64_t max_bytes = zfs_dirty_data_max * zfs_vdev_async_write_active_max_dirty_percent / 100; + /* + * Sync tasks correspond to interactive user actions. To reduce the + * execution time of those actions we push data out as fast as possible. + */ + if (spa_has_pending_synctask(spa)) { + return (zfs_vdev_async_write_max_active); + } + if (dirty < min_bytes) return (zfs_vdev_async_write_min_active); if (dirty > max_bytes) @@ -448,8 +457,7 @@ vdev_queue_class_max_active(spa_t *spa, case ZIO_PRIORITY_ASYNC_READ: return (zfs_vdev_async_read_max_active); case ZIO_PRIORITY_ASYNC_WRITE: - return (vdev_queue_max_async_writes( - spa->spa_dsl_pool->dp_dirty_total)); + return (vdev_queue_max_async_writes(spa)); case ZIO_PRIORITY_SCRUB: return (zfs_vdev_scrub_max_active); default: From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 04:06:37 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1ACDE6F5; Sat, 2 Aug 2014 04:06: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 06B3623D7; Sat, 2 Aug 2014 04:06: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 s7246aXO006884; Sat, 2 Aug 2014 04:06:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7246ZsC006874; Sat, 2 Aug 2014 04:06:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201408020406.s7246ZsC006874@svn.freebsd.org> From: Xin LI Date: Sat, 2 Aug 2014 04:06: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: r269419 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 04:06:37 -0000 Author: delphij Date: Sat Aug 2 04:06:35 2014 New Revision: 269419 URL: http://svnweb.freebsd.org/changeset/base/269419 Log: MFC r268865: MFV r268852: Reduce lock contention on the z_teardown_lock under heavily cached read workload by splitting the single teardown rrw lock into RRM_NUM_LOCKS (17) of them. Read acquisitions are randomly distributed among these locks based on curthread pointer. Write acquisitions are going to all the locks, which for the usage of this type of lock should be rare. Illumos issue: 5008 lock contention (rrw_exit) while running a read only load Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug 2 04:06:35 2014 (r269419) @@ -286,3 +286,91 @@ rrw_tsd_destroy(void *arg) (void *)curthread, (void *)rn->rn_rrl); } } + +/* + * A reader-mostly lock implementation, tuning above reader-writer locks + * for hightly parallel read acquisitions, while pessimizing writes. + * + * The idea is to split single busy lock into array of locks, so that + * each reader can lock only one of them for read, depending on result + * of simple hash function. That proportionally reduces lock congestion. + * Writer same time has to sequentially aquire write on all the locks. + * That makes write aquisition proportionally slower, but in places where + * it is used (filesystem unmount) performance is not critical. + * + * All the functions below are direct wrappers around functions above. + */ +void +rrm_init(rrmlock_t *rrl, boolean_t track_all) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_init(&rrl->locks[i], track_all); +} + +void +rrm_destroy(rrmlock_t *rrl) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_destroy(&rrl->locks[i]); +} + +void +rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag) +{ + if (rw == RW_READER) + rrm_enter_read(rrl, tag); + else + rrm_enter_write(rrl); +} + +/* + * This maps the current thread to a specific lock. Note that the lock + * must be released by the same thread that acquired it. We do this + * mapping by taking the thread pointer mod a prime number. We examine + * only the low 32 bits of the thread pointer, because 32-bit division + * is faster than 64-bit division, and the high 32 bits have little + * entropy anyway. + */ +#define RRM_TD_LOCK() (((uint32_t)(uintptr_t)(curthread)) % RRM_NUM_LOCKS) + +void +rrm_enter_read(rrmlock_t *rrl, void *tag) +{ + rrw_enter_read(&rrl->locks[RRM_TD_LOCK()], tag); +} + +void +rrm_enter_write(rrmlock_t *rrl) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_enter_write(&rrl->locks[i]); +} + +void +rrm_exit(rrmlock_t *rrl, void *tag) +{ + int i; + + if (rrl->locks[0].rr_writer == curthread) { + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_exit(&rrl->locks[i], tag); + } else { + rrw_exit(&rrl->locks[RRM_TD_LOCK()], tag); + } +} + +boolean_t +rrm_held(rrmlock_t *rrl, krw_t rw) +{ + if (rw == RW_WRITER) { + return (rrw_held(&rrl->locks[0], rw)); + } else { + return (rrw_held(&rrl->locks[RRM_TD_LOCK()], rw)); + } +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h Sat Aug 2 04:06:35 2014 (r269419) @@ -79,6 +79,31 @@ void rrw_tsd_destroy(void *arg); #define RRW_LOCK_HELD(x) \ (rrw_held(x, RW_WRITER) || rrw_held(x, RW_READER)) +/* + * A reader-mostly lock implementation, tuning above reader-writer locks + * for hightly parallel read acquisitions, pessimizing write acquisitions. + * + * This should be a prime number. See comment in rrwlock.c near + * RRM_TD_LOCK() for details. + */ +#define RRM_NUM_LOCKS 17 +typedef struct rrmlock { + rrwlock_t locks[RRM_NUM_LOCKS]; +} rrmlock_t; + +void rrm_init(rrmlock_t *rrl, boolean_t track_all); +void rrm_destroy(rrmlock_t *rrl); +void rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag); +void rrm_enter_read(rrmlock_t *rrl, void *tag); +void rrm_enter_write(rrmlock_t *rrl); +void rrm_exit(rrmlock_t *rrl, void *tag); +boolean_t rrm_held(rrmlock_t *rrl, krw_t rw); + +#define RRM_READ_HELD(x) rrm_held(x, RW_READER) +#define RRM_WRITE_HELD(x) rrm_held(x, RW_WRITER) +#define RRM_LOCK_HELD(x) \ + (rrm_held(x, RW_WRITER) || rrm_held(x, RW_READER)) + #ifdef __cplusplus } #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Aug 2 04:06:35 2014 (r269419) @@ -64,7 +64,7 @@ struct zfsvfs { int z_norm; /* normalization flags */ boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ - rrwlock_t z_teardown_lock; + rrmlock_t z_teardown_lock; krwlock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Aug 2 04:06:35 2014 (r269419) @@ -256,7 +256,7 @@ VTOZ(vnode_t *vp) /* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ - rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ + rrm_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ if ((zfsvfs)->z_unmounted) { \ ZFS_EXIT(zfsvfs); \ return (EIO); \ @@ -265,10 +265,10 @@ VTOZ(vnode_t *vp) /* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ #define ZFS_ENTER_NOERROR(zfsvfs) \ - rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) + rrm_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) /* Must be called before exiting the vop */ -#define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +#define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) /* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Aug 2 04:06:35 2014 (r269419) @@ -1466,7 +1466,7 @@ zfsvfs_hold(const char *name, void *tag, if (getzfsvfs(name, zfvp) != 0) error = zfsvfs_create(name, zfvp); if (error == 0) { - rrw_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : + rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : RW_READER, tag); if ((*zfvp)->z_unmounted) { /* @@ -1474,7 +1474,7 @@ zfsvfs_hold(const char *name, void *tag, * thread should be just about to disassociate the * objset from the zfsvfs. */ - rrw_exit(&(*zfvp)->z_teardown_lock, tag); + rrm_exit(&(*zfvp)->z_teardown_lock, tag); return (SET_ERROR(EBUSY)); } } @@ -1484,7 +1484,7 @@ zfsvfs_hold(const char *name, void *tag, static void zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag) { - rrw_exit(&zfsvfs->z_teardown_lock, tag); + rrm_exit(&zfsvfs->z_teardown_lock, tag); if (zfsvfs->z_vfs) { VFS_RELE(zfsvfs->z_vfs); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Aug 2 04:06:35 2014 (r269419) @@ -988,7 +988,7 @@ zfsvfs_create(const char *osname, zfsvfs mutex_init(&zfsvfs->z_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&zfsvfs->z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); - rrw_init(&zfsvfs->z_teardown_lock, B_FALSE); + rrm_init(&zfsvfs->z_teardown_lock, B_FALSE); rw_init(&zfsvfs->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL); rw_init(&zfsvfs->z_fuid_lock, NULL, RW_DEFAULT, NULL); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) @@ -1104,7 +1104,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) mutex_destroy(&zfsvfs->z_znodes_lock); mutex_destroy(&zfsvfs->z_lock); list_destroy(&zfsvfs->z_all_znodes); - rrw_destroy(&zfsvfs->z_teardown_lock); + rrm_destroy(&zfsvfs->z_teardown_lock); rw_destroy(&zfsvfs->z_teardown_inactive_lock); rw_destroy(&zfsvfs->z_fuid_lock); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) @@ -1833,7 +1833,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea { znode_t *zp; - rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); if (!unmounting) { /* @@ -1866,7 +1866,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ if (!unmounting && (zfsvfs->z_unmounted || zfsvfs->z_os == NULL)) { rw_exit(&zfsvfs->z_teardown_inactive_lock); - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); return (SET_ERROR(EIO)); } @@ -1893,7 +1893,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ if (unmounting) { zfsvfs->z_unmounted = B_TRUE; - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); } @@ -1970,9 +1970,9 @@ zfs_umount(vfs_t *vfsp, int fflag) * vflush(FORCECLOSE). This way we ensure no future vnops * will be called and risk operating on DOOMED vnodes. */ - rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); zfsvfs->z_unmounted = B_TRUE; - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); } /* @@ -2240,7 +2240,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch znode_t *zp; uint64_t sa_obj = 0; - ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); + ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); /* @@ -2296,7 +2296,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch bail: /* release the VOPs */ rw_exit(&zfsvfs->z_teardown_inactive_lock); - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); if (err) { /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Aug 2 04:01:44 2014 (r269418) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Aug 2 04:06:35 2014 (r269419) @@ -276,7 +276,7 @@ zfs_znode_move(void *buf, void *newbuf, * can safely ensure that the filesystem is not and will not be * unmounted. The next statement is equivalent to ZFS_ENTER(). */ - rrw_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); if (zfsvfs->z_unmounted) { ZFS_EXIT(zfsvfs); rw_exit(&zfsvfs_lock); From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 06:56:00 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D882C6; Sat, 2 Aug 2014 06:56: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 7B14824A0; Sat, 2 Aug 2014 06:56: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 s726u0TN086466; Sat, 2 Aug 2014 06:56:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s726u0Ll086464; Sat, 2 Aug 2014 06:56:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201408020656.s726u0Ll086464@svn.freebsd.org> From: Alexander Motin Date: Sat, 2 Aug 2014 06:56:00 +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: r269429 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 06:56:00 -0000 Author: mav Date: Sat Aug 2 06:56:00 2014 New Revision: 269429 URL: http://svnweb.freebsd.org/changeset/base/269429 Log: MFC r269123: Implement separate I/O dispatch method for ZVOLs in "dev" mode. Unlike disk devices ZVOLs process all requests synchronously. That makes impossible sending multiple requests to them from single thread. From the other side ZVOLs have real d_read/d_write methods, which unlike d_strategy can handle uio scatter/gather and have no strict I/O size limitations. So, if ZVOL in "dev" mode is detected, use of d_read/d_write methods instead of d_strategy allows to avoid pointless splitting of large requests into MAXPHYS (128K) sized chunks. 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 Sat Aug 2 06:55:36 2014 (r269428) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Sat Aug 2 06:56:00 2014 (r269429) @@ -741,6 +741,88 @@ ctl_be_block_dispatch_file(struct ctl_be } static void +ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + struct ctl_be_block_devdata *dev_data; + union ctl_io *io; + struct uio xuio; + struct iovec *xiovec; + int flags; + int error, i; + + DPRINTF("entered\n"); + + dev_data = &be_lun->backend.dev; + io = beio->io; + flags = beio->bio_flags; + + bzero(&xuio, sizeof(xuio)); + if (beio->bio_cmd == BIO_READ) { + SDT_PROBE(cbb, kernel, read, file_start, 0, 0, 0, 0, 0); + xuio.uio_rw = UIO_READ; + } else { + SDT_PROBE(cbb, kernel, write, file_start, 0, 0, 0, 0, 0); + xuio.uio_rw = UIO_WRITE; + } + xuio.uio_offset = beio->io_offset; + xuio.uio_resid = beio->io_len; + xuio.uio_segflg = UIO_SYSSPACE; + xuio.uio_iov = beio->xiovecs; + xuio.uio_iovcnt = beio->num_segs; + xuio.uio_td = curthread; + + for (i = 0, xiovec = xuio.uio_iov; i < xuio.uio_iovcnt; i++, xiovec++) { + xiovec->iov_base = beio->sg_segs[i].addr; + xiovec->iov_len = beio->sg_segs[i].len; + } + + binuptime(&beio->ds_t0); + mtx_lock(&be_lun->io_lock); + devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0); + mtx_unlock(&be_lun->io_lock); + + if (beio->bio_cmd == BIO_READ) { + error = (*dev_data->csw->d_read)(dev_data->cdev, &xuio, 0); + SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); + } else { + error = (*dev_data->csw->d_write)(dev_data->cdev, &xuio, 0); + SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0); + } + + mtx_lock(&be_lun->io_lock); + devstat_end_transaction(beio->lun->disk_stats, beio->io_len, + beio->ds_tag_type, beio->ds_trans_type, + /*now*/ NULL, /*then*/&beio->ds_t0); + mtx_unlock(&be_lun->io_lock); + + /* + * If we got an error, set the sense data to "MEDIUM ERROR" and + * return the I/O to the user. + */ + if (error != 0) { + ctl_set_medium_error(&io->scsiio); + ctl_complete_beio(beio); + return; + } + + /* + * If this is a write or a verify, we're all done. + * If this is a read, we can now send the data to the user. + */ + if ((beio->bio_cmd == BIO_WRITE) || + (ARGS(io)->flags & CTL_LLF_VERIFY)) { + ctl_set_success(&io->scsiio); + ctl_complete_beio(beio); + } else { +#ifdef CTL_TIME_IO + getbintime(&io->io_hdr.dma_start_bt); +#endif + ctl_datamove(io); + } +} + +static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -1581,14 +1663,17 @@ ctl_be_block_open_dev(struct ctl_be_bloc params = &req->reqdata.create; be_lun->dev_type = CTL_BE_BLOCK_DEV; - be_lun->dispatch = ctl_be_block_dispatch_dev; - be_lun->lun_flush = ctl_be_block_flush_dev; - be_lun->unmap = ctl_be_block_unmap_dev; be_lun->backend.dev.cdev = be_lun->vn->v_rdev; be_lun->backend.dev.csw = dev_refthread(be_lun->backend.dev.cdev, &be_lun->backend.dev.dev_ref); if (be_lun->backend.dev.csw == NULL) panic("Unable to retrieve device switch"); + if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) + be_lun->dispatch = ctl_be_block_dispatch_zvol; + else + be_lun->dispatch = ctl_be_block_dispatch_dev; + be_lun->lun_flush = ctl_be_block_flush_dev; + be_lun->unmap = ctl_be_block_unmap_dev; error = VOP_GETATTR(be_lun->vn, &vattr, NOCRED); if (error) { From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 15:05:24 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0252AD6; Sat, 2 Aug 2014 15:05: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 D0A6528AB; Sat, 2 Aug 2014 15:05: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 s72F5NnY012302; Sat, 2 Aug 2014 15:05:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s72F5NIH012301; Sat, 2 Aug 2014 15:05:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201408021505.s72F5NIH012301@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 2 Aug 2014 15:05:23 +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: r269432 - stable/10/etc/etc.ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 15:05:24 -0000 Author: marcel Date: Sat Aug 2 15:05:23 2014 New Revision: 269432 URL: http://svnweb.freebsd.org/changeset/base/269432 Log: Define both ttyu0 and ttyu1 as onifconsole. This is ideal for ia64 where the console can be on either, depending on the platform. Modified: stable/10/etc/etc.ia64/ttys Modified: stable/10/etc/etc.ia64/ttys ============================================================================== --- stable/10/etc/etc.ia64/ttys Sat Aug 2 08:34:22 2014 (r269431) +++ stable/10/etc/etc.ia64/ttys Sat Aug 2 15:05:23 2014 (r269432) @@ -41,8 +41,8 @@ ttyv7 "/usr/libexec/getty Pc" xterm off ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals. The 'dialup' keyword identifies dialin lines to login, # fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure -ttyu1 "/usr/libexec/getty std.9600" dialup off secure +ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty std.9600" vt100 onifconsole secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure # Dumb console From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 20:06:37 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 560CAA3E; Sat, 2 Aug 2014 20:06: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 2F86727D9; Sat, 2 Aug 2014 20:06: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 s72K6bVR051892; Sat, 2 Aug 2014 20:06:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s72K6baa051891; Sat, 2 Aug 2014 20:06:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201408022006.s72K6baa051891@svn.freebsd.org> From: Rick Macklem Date: Sat, 2 Aug 2014 20:06: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: r269443 - stable/10/usr.sbin/nfsd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 20:06:37 -0000 Author: rmacklem Date: Sat Aug 2 20:06:36 2014 New Revision: 269443 URL: http://svnweb.freebsd.org/changeset/base/269443 Log: MFC: r268866 r243637 changed the default number of nfsd threads created, but the man page did not reflect this. This is a content change. Modified: stable/10/usr.sbin/nfsd/nfsd.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsd/nfsd.8 ============================================================================== --- stable/10/usr.sbin/nfsd/nfsd.8 Sat Aug 2 19:59:19 2014 (r269442) +++ stable/10/usr.sbin/nfsd/nfsd.8 Sat Aug 2 20:06:36 2014 (r269443) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd April 23, 2011 +.Dd July 18, 2014 .Dt NFSD 8 .Os .Sh NAME @@ -53,7 +53,7 @@ At least one .Nm must be running for a machine to operate as a server. .Pp -Unless otherwise specified, four servers for +Unless otherwise specified, eight servers per CPU for .Tn UDP transport are started. .Pp From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 20:58:47 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DDE335C; Sat, 2 Aug 2014 20:58: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 89A462CE7; Sat, 2 Aug 2014 20:58: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 s72KwlKA075179; Sat, 2 Aug 2014 20:58:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s72KwlUf075175; Sat, 2 Aug 2014 20:58:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201408022058.s72KwlUf075175@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 2 Aug 2014 20:58:47 +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: r269446 - in stable/10/sys: kern 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-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 20:58:47 -0000 Author: hselasky Date: Sat Aug 2 20:58:46 2014 New Revision: 269446 URL: http://svnweb.freebsd.org/changeset/base/269446 Log: Partial MFC of r267961, r267973, r267985, r267992, r267993 and r268005: Backport some macro definitions to make backporting code from FreeBSD current easier. Modified: stable/10/sys/kern/kern_mib.c stable/10/sys/sys/sysctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_mib.c ============================================================================== --- stable/10/sys/kern/kern_mib.c Sat Aug 2 20:37:02 2014 (r269445) +++ stable/10/sys/kern/kern_mib.c Sat Aug 2 20:58:46 2014 (r269446) @@ -55,35 +55,35 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(, 0, sysctl, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(0, sysctl, CTLFLAG_RW, 0, "Sysctl internal magic"); -SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW|CTLFLAG_CAPRD, 0, +SYSCTL_ROOT_NODE(CTL_KERN, kern, CTLFLAG_RW|CTLFLAG_CAPRD, 0, "High kernel, proc, limits &c"); -SYSCTL_NODE(, CTL_VM, vm, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_VM, vm, CTLFLAG_RW, 0, "Virtual memory"); -SYSCTL_NODE(, CTL_VFS, vfs, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_VFS, vfs, CTLFLAG_RW, 0, "File system"); -SYSCTL_NODE(, CTL_NET, net, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_NET, net, CTLFLAG_RW, 0, "Network, (see socket.h)"); -SYSCTL_NODE(, CTL_DEBUG, debug, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_DEBUG, debug, CTLFLAG_RW, 0, "Debugging"); SYSCTL_NODE(_debug, OID_AUTO, sizeof, CTLFLAG_RW, 0, "Sizeof various things"); -SYSCTL_NODE(, CTL_HW, hw, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_HW, hw, CTLFLAG_RW, 0, "hardware"); -SYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_MACHDEP, machdep, CTLFLAG_RW, 0, "machine dependent"); -SYSCTL_NODE(, CTL_USER, user, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_USER, user, CTLFLAG_RW, 0, "user-level"); -SYSCTL_NODE(, CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0, "p1003_1b, (see p1003_1b.h)"); -SYSCTL_NODE(, OID_AUTO, compat, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(OID_AUTO, compat, CTLFLAG_RW, 0, "Compatibility code"); -SYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(OID_AUTO, security, CTLFLAG_RW, 0, "Security"); #ifdef REGRESSION -SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0, +SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW, 0, "Regression test MIB"); #endif Modified: stable/10/sys/sys/sysctl.h ============================================================================== --- stable/10/sys/sys/sysctl.h Sat Aug 2 20:37:02 2014 (r269445) +++ stable/10/sys/sys/sysctl.h Sat Aug 2 20:58:46 2014 (r269446) @@ -92,6 +92,7 @@ struct ctlname { #define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ #define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ #define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */ +#define CTLFLAG_NOFETCH 0x00001000 /* Don't fetch tunable from getenv() */ #define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) /* @@ -206,6 +207,7 @@ void sysctl_unregister_oid(struct sysctl /* Hide these in macros. */ #define SYSCTL_CHILDREN(oid_ptr) \ (struct sysctl_oid_list *)(oid_ptr)->oid_arg1 +#define SYSCTL_PARENT(oid_ptr) NULL /* not supported */ #define SYSCTL_CHILDREN_SET(oid_ptr, val) (oid_ptr)->oid_arg1 = (val) #define SYSCTL_STATIC_CHILDREN(oid_name) (&sysctl_##oid_name##_children) @@ -296,12 +298,19 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr)) +/* This constructs a root node from which other nodes can hang. */ +#define SYSCTL_ROOT_NODE(nbr, name, access, handler, descr) \ + SYSCTL_NODE(, nbr, name, access, handler, descr) + /* This constructs a node from which other oids can hang. */ #define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \ struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \ SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \ (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr) +#define SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr) \ + SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(), nbr, name, access, handler, descr) + #define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \ NULL, 0, handler, "N", __DESCR(descr)) From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 21:01:59 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32A3F58C; Sat, 2 Aug 2014 21:01: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 1F7F92E84; Sat, 2 Aug 2014 21:01: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 s72L1whI079009; Sat, 2 Aug 2014 21:01:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s72L1wUI079006; Sat, 2 Aug 2014 21:01:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201408022101.s72L1wUI079006@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 2 Aug 2014 21:01:58 +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: r269447 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 21:01:59 -0000 Author: hselasky Date: Sat Aug 2 21:01:58 2014 New Revision: 269447 URL: http://svnweb.freebsd.org/changeset/base/269447 Log: MFC r269139: Split the XHCI TRB allocations into smaller parts, so that we don't end up allocating contiguous busdma buffers above PAGE_SIZE bytes. Modified: stable/10/sys/dev/usb/controller/xhci.c stable/10/sys/dev/usb/controller/xhci.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Sat Aug 2 20:58:46 2014 (r269446) +++ stable/10/sys/dev/usb/controller/xhci.c Sat Aug 2 21:01:58 2014 (r269447) @@ -2682,24 +2682,23 @@ xhci_alloc_device_ext(struct usb_device goto error; } - pc = &sc->sc_hw.devs[index].endpoint_pc; - pg = &sc->sc_hw.devs[index].endpoint_pg; + /* initialise all endpoint LINK TRBs */ - /* need to initialize the page cache */ - pc->tag_parent = sc->sc_bus.dma_parent_tag; + for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) { - if (usb_pc_alloc_mem(pc, pg, - sizeof(struct xhci_dev_endpoint_trbs), XHCI_PAGE_SIZE)) { - goto error; - } + pc = &sc->sc_hw.devs[index].endpoint_pc[i]; + pg = &sc->sc_hw.devs[index].endpoint_pg[i]; - /* initialise all endpoint LINK TRBs */ + /* need to initialize the page cache */ + pc->tag_parent = sc->sc_bus.dma_parent_tag; - for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) { + if (usb_pc_alloc_mem(pc, pg, + sizeof(struct xhci_dev_endpoint_trbs), XHCI_TRB_ALIGN)) { + goto error; + } /* lookup endpoint TRB ring */ - usbd_get_page(pc, (uintptr_t)& - ((struct xhci_dev_endpoint_trbs *)0)->trb[i][0], &buf_ep); + usbd_get_page(pc, 0, &buf_ep); /* get TRB pointer */ trb = buf_ep.buffer; @@ -2713,9 +2712,9 @@ xhci_alloc_device_ext(struct usb_device trb->dwTrb2 = htole32(XHCI_TRB_2_IRQ_SET(0)); trb->dwTrb3 = htole32(XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK)); - } - usb_pc_cpu_flush(pc); + usb_pc_cpu_flush(pc); + } xhci_set_slot_pointer(sc, index, buf_dev.physaddr); @@ -2732,13 +2731,15 @@ xhci_free_device_ext(struct usb_device * { struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); uint8_t index; + uint8_t i; index = udev->controller_slot_id; xhci_set_slot_pointer(sc, index, 0); usb_pc_free_mem(&sc->sc_hw.devs[index].device_pc); usb_pc_free_mem(&sc->sc_hw.devs[index].input_pc); - usb_pc_free_mem(&sc->sc_hw.devs[index].endpoint_pc); + for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) + usb_pc_free_mem(&sc->sc_hw.devs[index].endpoint_pc[i]); } static struct xhci_endpoint_ext * @@ -2759,10 +2760,9 @@ xhci_get_endpoint_ext(struct usb_device index = udev->controller_slot_id; - pc = &sc->sc_hw.devs[index].endpoint_pc; + pc = &sc->sc_hw.devs[index].endpoint_pc[epno]; - usbd_get_page(pc, (uintptr_t)&((struct xhci_dev_endpoint_trbs *)0)-> - trb[epno][0], &buf_ep); + usbd_get_page(pc, 0, &buf_ep); pepext = &sc->sc_hw.devs[index].endp[epno]; pepext->page_cache = pc; Modified: stable/10/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.h Sat Aug 2 20:58:46 2014 (r269446) +++ stable/10/sys/dev/usb/controller/xhci.h Sat Aug 2 21:01:58 2014 (r269447) @@ -316,8 +316,8 @@ struct xhci_trb { } __aligned(4); struct xhci_dev_endpoint_trbs { - struct xhci_trb trb[XHCI_MAX_ENDPOINTS] - [(XHCI_MAX_STREAMS * XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS]; + struct xhci_trb trb[(XHCI_MAX_STREAMS * + XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS]; }; #define XHCI_TD_PAGE_NBUF 17 /* units, room enough for 64Kbytes */ @@ -385,11 +385,11 @@ enum { struct xhci_hw_dev { struct usb_page_cache device_pc; struct usb_page_cache input_pc; - struct usb_page_cache endpoint_pc; + struct usb_page_cache endpoint_pc[XHCI_MAX_ENDPOINTS]; struct usb_page device_pg; struct usb_page input_pg; - struct usb_page endpoint_pg; + struct usb_page endpoint_pg[XHCI_MAX_ENDPOINTS]; struct xhci_endpoint_ext endp[XHCI_MAX_ENDPOINTS]; From owner-svn-src-stable-10@FreeBSD.ORG Sat Aug 2 22:25:25 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0080D81C; Sat, 2 Aug 2014 22:25: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 E0E4A25DE; Sat, 2 Aug 2014 22:25: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 s72MPOFU016651; Sat, 2 Aug 2014 22:25:24 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s72MPOsB016650; Sat, 2 Aug 2014 22:25:24 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201408022225.s72MPOsB016650@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 2 Aug 2014 22:25: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: r269449 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 22:25:25 -0000 Author: marcel Date: Sat Aug 2 22:25:24 2014 New Revision: 269449 URL: http://svnweb.freebsd.org/changeset/base/269449 Log: MFC 259910, 260023, 260028, 260600 & 260701: o Fix "kptdir is itself virtual" error, caused by having the kptdir in PBVM. o Allow building a cross libkvm for ia64. o Add support for virtual cores (aka minidumps). o We don't have to worry about page sizes when working on virtual cores. o Handle truncation of the size returned by _kvm_kvatop(). Modified: stable/10/lib/libkvm/kvm_ia64.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm_ia64.c ============================================================================== --- stable/10/lib/libkvm/kvm_ia64.c Sat Aug 2 21:36:40 2014 (r269448) +++ stable/10/lib/libkvm/kvm_ia64.c Sat Aug 2 22:25:24 2014 (r269449) @@ -32,12 +32,21 @@ #include #include +#ifndef CROSS_LIBKVM #include #include +#include #include +#else +#include "../../sys/ia64/include/atomic.h" +#include "../../sys/ia64/include/bootinfo.h" +#include "../../sys/ia64/include/elf.h" +#include "../../sys/ia64/include/pte.h" +#endif #include #include +#include #include #include @@ -55,6 +64,8 @@ #define PBVM_BASE 0x9ffc000000000000UL #define PBVM_PGSZ (64 * 1024) +typedef size_t (a2p_f)(kvm_t *, uint64_t, off_t *); + struct vmstate { void *mmapbase; size_t mmapsize; @@ -62,6 +73,7 @@ struct vmstate { u_long kptdir; u_long *pbvm_pgtbl; u_int pbvm_pgtblsz; + a2p_f *kvatop; }; /* @@ -70,7 +82,7 @@ struct vmstate { * set of headers. */ static int -_kvm_maphdrs(kvm_t *kd, size_t sz) +ia64_maphdrs(kvm_t *kd, size_t sz) { struct vmstate *vm = kd->vmst; @@ -91,38 +103,103 @@ _kvm_maphdrs(kvm_t *kd, size_t sz) } /* - * Translate a physical memory address to a file-offset in the crash-dump. + * Physical core support. */ + static size_t -_kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs, size_t pgsz) +phys_addr2off(kvm_t *kd, uint64_t pa, off_t *ofs, size_t pgsz) { - Elf64_Ehdr *e = kd->vmst->mmapbase; - Elf64_Phdr *p = (Elf64_Phdr*)((char*)e + e->e_phoff); - int n = e->e_phnum; - - if (pa != REGION_ADDR(pa)) { - _kvm_err(kd, kd->program, "internal error"); - return (0); - } - + Elf64_Ehdr *e; + Elf64_Phdr *p; + int n; + + if (pa != REGION_ADDR(pa)) + goto fail; + + e = (Elf64_Ehdr *)(kd->vmst->mmapbase); + n = e->e_phnum; + p = (Elf64_Phdr *)(void *)((uintptr_t)(void *)e + e->e_phoff); while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz)) p++, n--; if (n == 0) - return (0); + goto fail; *ofs = (pa - p->p_paddr) + p->p_offset; if (pgsz == 0) return (p->p_memsz - (pa - p->p_paddr)); return (pgsz - ((size_t)pa & (pgsz - 1))); + + fail: + _kvm_err(kd, kd->program, "invalid physical address %#jx", + (uintmax_t)pa); + return (0); +} + +static size_t +phys_kvatop(kvm_t *kd, uint64_t va, off_t *ofs) +{ + struct ia64_lpte pte; + uint64_t pa, pgaddr, pt0addr, pt1addr; + size_t pgno, pgsz, pt0no, pt1no; + + if (va >= REGION_BASE(6)) { + /* Regions 6 and 7: direct mapped. */ + pa = REGION_ADDR(va); + return (phys_addr2off(kd, pa, ofs, 0)); + } else if (va >= REGION_BASE(5)) { + /* Region 5: Kernel Virtual Memory. */ + va = REGION_ADDR(va); + pgsz = kd->vmst->pagesize; + pt0no = KPTE_DIR0_INDEX(va, pgsz); + pt1no = KPTE_DIR1_INDEX(va, pgsz); + pgno = KPTE_PTE_INDEX(va, pgsz); + if (pt0no >= NKPTEDIR(pgsz)) + goto fail; + pt0addr = kd->vmst->kptdir + (pt0no << 3); + if (kvm_read(kd, pt0addr, &pt1addr, 8) != 8) + goto fail; + if (pt1addr == 0) + goto fail; + pt1addr += pt1no << 3; + if (kvm_read(kd, pt1addr, &pgaddr, 8) != 8) + goto fail; + if (pgaddr == 0) + goto fail; + pgaddr += pgno * sizeof(pte); + if (kvm_read(kd, pgaddr, &pte, sizeof(pte)) != sizeof(pte)) + goto fail; + if (!(pte.pte & PTE_PRESENT)) + goto fail; + pa = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1)); + return (phys_addr2off(kd, pa, ofs, pgsz)); + } else if (va >= PBVM_BASE) { + /* Region 4: Pre-Boot Virtual Memory (PBVM). */ + va -= PBVM_BASE; + pgsz = PBVM_PGSZ; + pt0no = va / pgsz; + if (pt0no >= (kd->vmst->pbvm_pgtblsz >> 3)) + goto fail; + pt0addr = kd->vmst->pbvm_pgtbl[pt0no]; + if (!(pt0addr & PTE_PRESENT)) + goto fail; + pa = (pt0addr & PTE_PPN_MASK) + va % pgsz; + return (phys_addr2off(kd, pa, ofs, pgsz)); + } + + fail: + _kvm_err(kd, kd->program, "invalid kernel virtual address %#jx", + (uintmax_t)va); + *ofs = -1; + return (0); } static ssize_t -_kvm_read_phys(kvm_t *kd, uint64_t pa, void *buf, size_t bufsz) +phys_read(kvm_t *kd, uint64_t pa, void *buf, size_t bufsz) { off_t ofs; size_t sz; - sz = _kvm_pa2off(kd, pa, &ofs, 0); + sz = phys_addr2off(kd, pa, &ofs, 0); if (sz < bufsz) return ((ssize_t)sz); @@ -131,6 +208,50 @@ _kvm_read_phys(kvm_t *kd, uint64_t pa, v return (read(kd->pmfd, buf, bufsz)); } +/* + * Virtual core support (aka minidump). + */ + +static size_t +virt_addr2off(kvm_t *kd, uint64_t va, off_t *ofs, size_t pgsz) +{ + Elf64_Ehdr *e; + Elf64_Phdr *p; + int n; + + if (va < REGION_BASE(4)) + goto fail; + + e = (Elf64_Ehdr *)(kd->vmst->mmapbase); + n = e->e_phnum; + p = (Elf64_Phdr *)(void *)((uintptr_t)(void *)e + e->e_phoff); + while (n && (va < p->p_vaddr || va >= p->p_vaddr + p->p_memsz)) + p++, n--; + if (n == 0) + goto fail; + + *ofs = (va - p->p_vaddr) + p->p_offset; + if (pgsz == 0) + return (p->p_memsz - (va - p->p_vaddr)); + return (pgsz - ((size_t)va & (pgsz - 1))); + + fail: + _kvm_err(kd, kd->program, "invalid virtual address %#jx", + (uintmax_t)va); + return (0); +} + +static size_t +virt_kvatop(kvm_t *kd, uint64_t va, off_t *ofs) +{ + + return (virt_addr2off(kd, va, ofs, 0)); +} + +/* + * KVM architecture support functions. + */ + void _kvm_freevtop(kvm_t *kd) { @@ -160,27 +281,37 @@ _kvm_initvtop(kvm_t *kd) return (-1); } +#ifndef CROSS_LIBKVM kd->vmst->pagesize = getpagesize(); +#else + kd->vmst->pagesize = 8192; +#endif - if (_kvm_maphdrs(kd, sizeof(Elf64_Ehdr)) == -1) + if (ia64_maphdrs(kd, sizeof(Elf64_Ehdr)) == -1) return (-1); ehdr = kd->vmst->mmapbase; hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; - if (_kvm_maphdrs(kd, hdrsz) == -1) + if (ia64_maphdrs(kd, hdrsz) == -1) return (-1); + kd->vmst->kvatop = (ehdr->e_flags & EF_IA_64_ABSOLUTE) ? + phys_kvatop : virt_kvatop; + /* * Load the PBVM page table. We need this to resolve PBVM addresses. * The PBVM page table is obtained from the bootinfo structure, of - * which the physical address is given to us in e_entry. If e_entry - * is 0, then this is assumed to be a pre-PBVM kernel. + * which the address is given to us in e_entry. If e_entry is 0, then + * this is assumed to be a pre-PBVM kernel. + * Note that the address of the bootinfo structure is either physical + * or virtual, depending on whether the core is physical or virtual. */ - if (ehdr->e_entry != 0) { - sz = _kvm_read_phys(kd, ehdr->e_entry, &bi, sizeof(bi)); + if (ehdr->e_entry != 0 && (ehdr->e_flags & EF_IA_64_ABSOLUTE) != 0) { + sz = phys_read(kd, ehdr->e_entry, &bi, sizeof(bi)); if (sz != sizeof(bi)) { _kvm_err(kd, kd->program, - "cannot read bootinfo from PA %#lx", ehdr->e_entry); + "cannot read bootinfo at physical address %#jx", + (uintmax_t)ehdr->e_entry); return (-1); } if (bi.bi_magic != BOOTINFO_MAGIC) { @@ -193,12 +324,12 @@ _kvm_initvtop(kvm_t *kd) return (-1); } kd->vmst->pbvm_pgtblsz = bi.bi_pbvm_pgtblsz; - sz = _kvm_read_phys(kd, bi.bi_pbvm_pgtbl, kd->vmst->pbvm_pgtbl, + sz = phys_read(kd, bi.bi_pbvm_pgtbl, kd->vmst->pbvm_pgtbl, bi.bi_pbvm_pgtblsz); if (sz != bi.bi_pbvm_pgtblsz) { _kvm_err(kd, kd->program, - "cannot read page table from PA %#lx", - bi.bi_pbvm_pgtbl); + "cannot read page table at physical address %#jx", + (uintmax_t)bi.bi_pbvm_pgtbl); return (-1); } } else { @@ -225,7 +356,7 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - if (va < REGION_BASE(6)) { + if (va == REGION_BASE(5)) { _kvm_err(kd, kd->program, "kptdir is itself virtual"); return (-1); } @@ -237,56 +368,8 @@ _kvm_initvtop(kvm_t *kd) int _kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs) { - struct ia64_lpte pte; - uint64_t pa, pgaddr, pt0addr, pt1addr; - size_t pgno, pgsz, pt0no, pt1no; - - if (va >= REGION_BASE(6)) { - /* Regions 6 and 7: direct mapped. */ - pa = REGION_ADDR(va); - return (_kvm_pa2off(kd, pa, ofs, 0)); - } else if (va >= REGION_BASE(5)) { - /* Region 5: Kernel Virtual Memory. */ - va = REGION_ADDR(va); - pgsz = kd->vmst->pagesize; - pt0no = KPTE_DIR0_INDEX(va, pgsz); - pt1no = KPTE_DIR1_INDEX(va, pgsz); - pgno = KPTE_PTE_INDEX(va, pgsz); - if (pt0no >= NKPTEDIR(pgsz)) - goto fail; - pt0addr = kd->vmst->kptdir + (pt0no << 3); - if (kvm_read(kd, pt0addr, &pt1addr, 8) != 8) - goto fail; - if (pt1addr == 0) - goto fail; - pt1addr += pt1no << 3; - if (kvm_read(kd, pt1addr, &pgaddr, 8) != 8) - goto fail; - if (pgaddr == 0) - goto fail; - pgaddr += pgno * sizeof(pte); - if (kvm_read(kd, pgaddr, &pte, sizeof(pte)) != sizeof(pte)) - goto fail; - if (!(pte.pte & PTE_PRESENT)) - goto fail; - pa = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1)); - return (_kvm_pa2off(kd, pa, ofs, pgsz)); - } else if (va >= PBVM_BASE) { - /* Region 4: Pre-Boot Virtual Memory (PBVM). */ - va -= PBVM_BASE; - pgsz = PBVM_PGSZ; - pt0no = va / pgsz; - if (pt0no >= (kd->vmst->pbvm_pgtblsz >> 3)) - goto fail; - pt0addr = kd->vmst->pbvm_pgtbl[pt0no]; - if (!(pt0addr & PTE_PRESENT)) - goto fail; - pa = (pt0addr & PTE_PPN_MASK) + va % pgsz; - return (_kvm_pa2off(kd, pa, ofs, pgsz)); - } + size_t sz; - fail: - _kvm_err(kd, kd->program, "invalid kernel virtual address"); - *ofs = ~0UL; - return (0); + sz = kd->vmst->kvatop(kd, va, ofs); + return ((sz > INT_MAX) ? INT_MAX : sz); }