From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 01:00:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE961065692; Sun, 13 Sep 2009 01:00:25 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99AFA8FC23; Sun, 13 Sep 2009 01:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8D10Pet002460; Sun, 13 Sep 2009 01:00:25 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8D10PAu002459; Sun, 13 Sep 2009 01:00:25 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200909130100.n8D10PAu002459@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 13 Sep 2009 01:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197148 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 01:00:25 -0000 Author: bms Date: Sun Sep 13 01:00:24 2009 New Revision: 197148 URL: http://svn.freebsd.org/changeset/base/197148 Log: In expire_mfc(), add an assert on the multicast forwarding cache mutex. PR: 138666 Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sat Sep 12 23:01:36 2009 (r197147) +++ head/sys/netinet/ip_mroute.c Sun Sep 13 01:00:24 2009 (r197148) @@ -1025,6 +1025,8 @@ expire_mfc(struct mfc *rt) { struct rtdetq *rte, *nrte; + MFC_LOCK_ASSERT(); + free_bw_list(rt->mfc_bw_meter); TAILQ_FOREACH_SAFE(rte, &rt->mfc_stall, rte_link, nrte) { From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 10:04:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8A7F1065695; Sun, 13 Sep 2009 10:04:08 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6EB48FC13; Sun, 13 Sep 2009 10:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DA48pO013162; Sun, 13 Sep 2009 10:04:08 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DA48wf013160; Sun, 13 Sep 2009 10:04:08 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <200909131004.n8DA48wf013160@svn.freebsd.org> From: Norikatsu Shigemura Date: Sun, 13 Sep 2009 10:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197149 - stable/8/sys/dev/coretemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 10:04:09 -0000 Author: nork Date: Sun Sep 13 10:04:08 2009 New Revision: 197149 URL: http://svn.freebsd.org/changeset/base/197149 Log: MFC r196889: Change 'dev.cpu.N.temperature', sysctl I (degC) to IK (Kelvin), to match acpi_thermal(4) and amdtemp(4). Approved by: re (rwatson) Reviewed by: rpaulo Suggested by: ume Modified: stable/8/sys/dev/coretemp/coretemp.c (contents, props changed) Modified: stable/8/sys/dev/coretemp/coretemp.c ============================================================================== --- stable/8/sys/dev/coretemp/coretemp.c Sun Sep 13 01:00:24 2009 (r197148) +++ stable/8/sys/dev/coretemp/coretemp.c Sun Sep 13 10:04:08 2009 (r197149) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define TZ_ZEROC 2732 + struct coretemp_softc { device_t sc_dev; int sc_tjmax; @@ -193,8 +195,8 @@ coretemp_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, - dev, 0, coretemp_get_temp_sysctl, "I", - "Current temperature in degC"); + dev, 0, coretemp_get_temp_sysctl, "IK", + "Current temperature"); return (0); } @@ -283,7 +285,7 @@ coretemp_get_temp_sysctl(SYSCTL_HANDLER_ device_t dev = (device_t) arg1; int temp; - temp = coretemp_get_temp(dev); + temp = coretemp_get_temp(dev) * 10 + TZ_ZEROC; return (sysctl_handle_int(oidp, &temp, 0, req)); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 10:12:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54250106566B; Sun, 13 Sep 2009 10:12:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292E48FC08; Sun, 13 Sep 2009 10:12:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DACUfB013430; Sun, 13 Sep 2009 10:12:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DACUm5013428; Sun, 13 Sep 2009 10:12:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909131012.n8DACUm5013428@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 10:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197150 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 10:12:30 -0000 Author: pjd Date: Sun Sep 13 10:12:29 2009 New Revision: 197150 URL: http://svn.freebsd.org/changeset/base/197150 Log: There is a bug where mze_insert() can trigger an assert() of inserting the same entry twice. This bug is not fixed yet, but leads to situation where when try to access corrupted directory the kernel will panic. Until the bug is properly fixed, try to recover from it and log that it happened. Reported by: marck OpenSolaris bug: 6709336 MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sun Sep 13 10:04:08 2009 (r197149) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sun Sep 13 10:12:29 2009 (r197150) @@ -181,10 +181,11 @@ mze_compare(const void *arg1, const void return (0); } -static void +static int mze_insert(zap_t *zap, int chunkid, uint64_t hash, mzap_ent_phys_t *mzep) { mzap_ent_t *mze; + avl_index_t idx; ASSERT(zap->zap_ismicro); ASSERT(RW_WRITE_HELD(&zap->zap_rwlock)); @@ -194,7 +195,12 @@ mze_insert(zap_t *zap, int chunkid, uint mze->mze_chunkid = chunkid; mze->mze_hash = hash; mze->mze_phys = *mzep; - avl_add(&zap->zap_m.zap_avl, mze); + if (avl_find(&zap->zap_m.zap_avl, mze, &idx) != NULL) { + kmem_free(mze, sizeof (mzap_ent_t)); + return (EEXIST); + } + avl_insert(&zap->zap_m.zap_avl, mze, idx); + return (0); } static mzap_ent_t * @@ -329,10 +335,15 @@ mzap_open(objset_t *os, uint64_t obj, dm if (mze->mze_name[0]) { zap_name_t *zn; - zap->zap_m.zap_num_entries++; zn = zap_name_alloc(zap, mze->mze_name, MT_EXACT); - mze_insert(zap, i, zn->zn_hash, mze); + if (mze_insert(zap, i, zn->zn_hash, mze) == 0) + zap->zap_m.zap_num_entries++; + else { + printf("ZFS WARNING: Duplicated ZAP " + "entry detected (%s).", + mze->mze_name); + } zap_name_free(zn); } } @@ -771,7 +782,7 @@ again: if (zap->zap_m.zap_alloc_next == zap->zap_m.zap_num_chunks) zap->zap_m.zap_alloc_next = 0; - mze_insert(zap, i, zn->zn_hash, mze); + VERIFY(0 == mze_insert(zap, i, zn->zn_hash, mze)); return; } } From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 10:25:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D761065672; Sun, 13 Sep 2009 10:25:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B27228FC0C; Sun, 13 Sep 2009 10:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DAPXsK013696; Sun, 13 Sep 2009 10:25:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DAPXBA013694; Sun, 13 Sep 2009 10:25:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909131025.n8DAPXBA013694@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 10:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197151 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 10:25:33 -0000 Author: pjd Date: Sun Sep 13 10:25:33 2009 New Revision: 197151 URL: http://svn.freebsd.org/changeset/base/197151 Log: Be sure not to overflow struct fid. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 10:12:29 2009 (r197150) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 10:25:33 2009 (r197151) @@ -1149,6 +1149,8 @@ zfs_checkexp(vfs_t *vfsp, struct sockadd credanonp, numsecflavors, secflavors)); } +CTASSERT(SHORT_FID_LEN <= sizeof(struct fid)); +CTASSERT(LONG_FID_LEN <= sizeof(struct fid)); static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp) From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 10:29:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452891065670; Sun, 13 Sep 2009 10:29:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33B118FC16; Sun, 13 Sep 2009 10:29:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DATqCi013799; Sun, 13 Sep 2009 10:29:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DATqCB013797; Sun, 13 Sep 2009 10:29:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909131029.n8DATqCB013797@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 10:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197152 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 10:29:52 -0000 Author: pjd Date: Sun Sep 13 10:29:51 2009 New Revision: 197152 URL: http://svn.freebsd.org/changeset/base/197152 Log: Extend scope of the z_teardown_lock lock for consistency and "just in case". MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Sep 13 10:25:33 2009 (r197151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Sep 13 10:29:51 2009 (r197152) @@ -1185,8 +1185,6 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode } } - ZFS_EXIT(zfsvfs); - /* Translate errors and add SAVENAME when needed. */ if (cnp->cn_flags & ISLASTCN) { switch (nameiop) { @@ -1217,6 +1215,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode if (error != 0) { VN_RELE(*vpp); *vpp = NULL; + ZFS_EXIT(zfsvfs); return (error); } } @@ -1238,6 +1237,8 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode } #endif + ZFS_EXIT(zfsvfs); + return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 10:33:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C38D1065695; Sun, 13 Sep 2009 10:33:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7129E8FC19; Sun, 13 Sep 2009 10:33:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DAXqTe013922; Sun, 13 Sep 2009 10:33:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DAXqaj013918; Sun, 13 Sep 2009 10:33:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909131033.n8DAXqaj013918@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 10:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197153 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 10:33:52 -0000 Author: pjd Date: Sun Sep 13 10:33:51 2009 New Revision: 197153 URL: http://svn.freebsd.org/changeset/base/197153 Log: When zfs.ko is compiled with debug, make sure that znode and vnode point at each other. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sun Sep 13 10:29:51 2009 (r197152) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sun Sep 13 10:33:51 2009 (r197153) @@ -231,8 +231,27 @@ typedef struct znode { /* * Convert between znode pointers and vnode pointers */ +#ifdef DEBUG +static __inline vnode_t * +ZTOV(znode_t *zp) +{ + vnode_t *vp = zp->z_vnode; + + ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp); + return (vp); +} +static __inline znode_t * +VTOZ(vnode_t *vp) +{ + znode_t *zp = (znode_t *)vp->v_data; + + ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp); + return (zp); +} +#else #define ZTOV(ZP) ((ZP)->z_vnode) #define VTOZ(VP) ((znode_t *)(VP)->v_data) +#endif /* * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Sep 13 10:29:51 2009 (r197152) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Sep 13 10:33:51 2009 (r197153) @@ -4382,7 +4382,7 @@ zfs_freebsd_reclaim(ap) mutex_enter(&zp->z_lock); ASSERT(zp->z_phys != NULL); - ZTOV(zp) = NULL; + zp->z_vnode = NULL; mutex_exit(&zp->z_lock); if (zp->z_unlinked) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Sep 13 10:29:51 2009 (r197152) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Sep 13 10:33:51 2009 (r197153) @@ -110,7 +110,7 @@ znode_evict_error(dmu_buf_t *dbuf, void mutex_exit(&zp->z_lock); zfs_znode_free(zp); } else if (vp->v_count == 0) { - ZTOV(zp) = NULL; + zp->z_vnode = NULL; vhold(vp); mutex_exit(&zp->z_lock); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); @@ -1533,7 +1533,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, ZTOV(rootzp)->v_data = NULL; ZTOV(rootzp)->v_count = 0; ZTOV(rootzp)->v_holdcnt = 0; - ZTOV(rootzp) = NULL; + rootzp->z_vnode = NULL; VOP_UNLOCK(vp, 0); vdestroy(vp); dmu_buf_rele(rootzp->z_dbuf, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 10:52:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BF35106566B; Sun, 13 Sep 2009 10:52:52 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 845858FC16; Sun, 13 Sep 2009 10:52:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n8DAqoW2045309; Sun, 13 Sep 2009 14:52:50 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Sun, 13 Sep 2009 14:52:50 +0400 (MSD) From: Dmitry Morozovsky To: Pawel Jakub Dawidek In-Reply-To: <200909131012.n8DACUm5013428@svn.freebsd.org> Message-ID: References: <200909131012.n8DACUm5013428@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (woozle.rinet.ru [0.0.0.0]); Sun, 13 Sep 2009 14:52:50 +0400 (MSD) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197150 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 10:52:52 -0000 On Sun, 13 Sep 2009, Pawel Jakub Dawidek wrote: PJD> Author: pjd PJD> Date: Sun Sep 13 10:12:29 2009 PJD> New Revision: 197150 PJD> URL: http://svn.freebsd.org/changeset/base/197150 PJD> PJD> Log: PJD> There is a bug where mze_insert() can trigger an assert() of inserting PJD> the same entry twice. This bug is not fixed yet, but leads to situation PJD> where when try to access corrupted directory the kernel will panic. PJD> Until the bug is properly fixed, try to recover from it and log that it PJD> happened. PJD> PJD> Reported by: marck PJD> OpenSolaris bug: 6709336 PJD> MFC after: 3 days Hoorray! Thanks a lot. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:08:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE368106566B; Sun, 13 Sep 2009 11:08:06 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D3EF8FC13; Sun, 13 Sep 2009 11:08:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DB86Sk019134; Sun, 13 Sep 2009 11:08:06 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DB86wM019132; Sun, 13 Sep 2009 11:08:06 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200909131108.n8DB86wM019132@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Sep 2009 11:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197154 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:08:06 -0000 Author: rnoland Date: Sun Sep 13 11:08:06 2009 New Revision: 197154 URL: http://svn.freebsd.org/changeset/base/197154 Log: Add missing pci id for Radeon 4850 X2 MFC after: 3 days Modified: head/sys/dev/drm/drm_pciids.h Modified: head/sys/dev/drm/drm_pciids.h ============================================================================== --- head/sys/dev/drm/drm_pciids.h Sun Sep 13 10:33:51 2009 (r197153) +++ head/sys/dev/drm/drm_pciids.h Sun Sep 13 11:08:06 2009 (r197154) @@ -338,6 +338,7 @@ {0x1002, 0x9440, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ {0x1002, 0x9441, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4870 X2"}, \ {0x1002, 0x9442, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ + {0x1002, 0x9443, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4850 X2"}, \ {0x1002, 0x944C, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ {0x1002, 0x9450, CHIP_RV770|RADEON_NEW_MEMMAP, "AMD FireStream 9270"}, \ {0x1002, 0x9452, CHIP_RV770|RADEON_NEW_MEMMAP, "AMD FireStream 9250"}, \ From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:10:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500171065670; Sun, 13 Sep 2009 11:10:39 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1A58FC13; Sun, 13 Sep 2009 11:10:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DBAdfU019217; Sun, 13 Sep 2009 11:10:39 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBAds3019215; Sun, 13 Sep 2009 11:10:39 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200909131110.n8DBAds3019215@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Sep 2009 11:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197155 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:10:39 -0000 Author: rnoland Date: Sun Sep 13 11:10:38 2009 New Revision: 197155 URL: http://svn.freebsd.org/changeset/base/197155 Log: Add a couple of small fixes from the AMD folks. - max tex height is 8192 - increment src/dst by the full transfer amount MFC after: 3 days Modified: head/sys/dev/drm/r600_blit.c Modified: head/sys/dev/drm/r600_blit.c ============================================================================== --- head/sys/dev/drm/r600_blit.c Sun Sep 13 11:08:06 2009 (r197154) +++ head/sys/dev/drm/r600_blit.c Sun Sep 13 11:10:38 2009 (r197155) @@ -1734,6 +1734,8 @@ r600_blit_copy(struct drm_device *dev, if (!src_x && !dst_x) { h = (cur_size / max_bytes); + if (h > 8192) + h = 8192; if (h == 0) h = 1; else @@ -1805,8 +1807,8 @@ r600_blit_copy(struct drm_device *dev, vb += 12; dev_priv->blit_vb->used += 12 * 4; - src_gpu_addr += cur_size; - dst_gpu_addr += cur_size; + src_gpu_addr += cur_size * h; + dst_gpu_addr += cur_size * h; size_bytes -= cur_size * h; } } else { @@ -1822,6 +1824,8 @@ r600_blit_copy(struct drm_device *dev, if (!src_x && !dst_x) { h = (cur_size / max_bytes); + if (h > 8192) + h = 8192; if (h == 0) h = 1; else @@ -1894,8 +1898,8 @@ r600_blit_copy(struct drm_device *dev, vb += 12; dev_priv->blit_vb->used += 12 * 4; - src_gpu_addr += cur_size; - dst_gpu_addr += cur_size; + src_gpu_addr += cur_size * h; + dst_gpu_addr += cur_size * h; size_bytes -= cur_size * h; } } From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:20:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CF4B1065672; Sun, 13 Sep 2009 11:20:17 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BD6F8FC0C; Sun, 13 Sep 2009 11:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DBKHVO019488; Sun, 13 Sep 2009 11:20:17 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBKHPb019486; Sun, 13 Sep 2009 11:20:17 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909131120.n8DBKHPb019486@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 13 Sep 2009 11:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197156 - head/sys/boot/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:20:17 -0000 Author: nyan Date: Sun Sep 13 11:20:17 2009 New Revision: 197156 URL: http://svn.freebsd.org/changeset/base/197156 Log: MFi386: Move the loader's entry point to 0x200000. This change is also needed for pc98. MFC after: 3 days Modified: head/sys/boot/pc98/Makefile.inc Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Sun Sep 13 11:10:38 2009 (r197155) +++ head/sys/boot/pc98/Makefile.inc Sun Sep 13 11:20:17 2009 (r197156) @@ -4,7 +4,7 @@ BINDIR?= /boot -LOADER_ADDRESS?=0x100000 +LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -Os From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:31:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D41C106566C; Sun, 13 Sep 2009 11:31:26 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFDE28FC17; Sun, 13 Sep 2009 11:31:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DBVPY0019742; Sun, 13 Sep 2009 11:31:25 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBVPuh019740; Sun, 13 Sep 2009 11:31:25 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131131.n8DBVPuh019740@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 11:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197157 - stable/8/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:31:26 -0000 Author: ume Date: Sun Sep 13 11:31:25 2009 New Revision: 197157 URL: http://svn.freebsd.org/changeset/base/197157 Log: MFC r196929: Suppress an options line when no bit is on. Approved by: re (kib) Modified: stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ifconfig/ifgif.c Modified: stable/8/sbin/ifconfig/ifgif.c ============================================================================== --- stable/8/sbin/ifconfig/ifgif.c Sun Sep 13 11:20:17 2009 (r197156) +++ stable/8/sbin/ifconfig/ifgif.c Sun Sep 13 11:31:25 2009 (r197157) @@ -71,6 +71,8 @@ gif_status(int s) ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GIFGOPTS, &ifr) == -1) return; + if (opts == 0) + return; printf("\toptions=%d<", opts); for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) { From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:34:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3064106578A; Sun, 13 Sep 2009 11:34:33 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FCBC8FC14; Sun, 13 Sep 2009 11:34:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DBYXlV019845; Sun, 13 Sep 2009 11:34:33 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBYX92019838; Sun, 13 Sep 2009 11:34:33 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131134.n8DBYX92019838@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 11:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197158 - in stable/8: contrib/traceroute usr.sbin/traceroute6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:34:33 -0000 Author: ume Date: Sun Sep 13 11:34:33 2009 New Revision: 197158 URL: http://svn.freebsd.org/changeset/base/197158 Log: MFC r196475: - Add AS lookup functionality to traceroute6(8) as well. - Support for IPv6 transport for AS lookup. - Introduce $RA_SERVER to set whois server. - Support for 4 byte ASN. - ANSIfy function declaration in as.c. Approved by: re (kib) Modified: stable/8/contrib/traceroute/ (props changed) stable/8/contrib/traceroute/as.c stable/8/contrib/traceroute/as.h stable/8/contrib/traceroute/traceroute.c stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/traceroute6/Makefile stable/8/usr.sbin/traceroute6/traceroute6.8 stable/8/usr.sbin/traceroute6/traceroute6.c Modified: stable/8/contrib/traceroute/as.c ============================================================================== --- stable/8/contrib/traceroute/as.c Sun Sep 13 11:31:25 2009 (r197157) +++ stable/8/contrib/traceroute/as.c Sun Sep 13 11:34:33 2009 (r197158) @@ -63,55 +63,42 @@ struct aslookup { }; void * -as_setup(server) - char *server; +as_setup(char *server) { struct aslookup *asn; - struct hostent *he = NULL; - struct servent *se; - struct sockaddr_in in; + struct addrinfo hints, *res0, *res; FILE *f; - int s; + int s, error; if (server == NULL) + server = getenv("RA_SERVER"); + if (server == NULL) server = DEFAULT_AS_SERVER; - (void)memset(&in, 0, sizeof(in)); - in.sin_family = AF_INET; - in.sin_len = sizeof(in); - if ((se = getservbyname("whois", "tcp")) == NULL) { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(server, "whois", &hints, &res0); + if (error == EAI_SERVICE) { warnx("warning: whois/tcp service not found"); - in.sin_port = ntohs(43); - } else - in.sin_port = se->s_port; - - if (inet_aton(server, &in.sin_addr) == 0 && - ((he = gethostbyname(server)) == NULL || - he->h_addr == NULL)) { - warnx("%s: %s", server, hstrerror(h_errno)); - return (NULL); + error = getaddrinfo(server, "43", &hints, &res0); } - - if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) { - warn("socket"); + if (error != 0) { + warnx("%s: %s", server, gai_strerror(error)); return (NULL); } - do { - if (he != NULL) { - memcpy(&in.sin_addr, he->h_addr, he->h_length); - he->h_addr_list++; - } - if (connect(s, (struct sockaddr *)&in, sizeof(in)) == 0) + for (res = res0; res; res = res->ai_next) { + s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (s < 0) + continue; + if (connect(s, res->ai_addr, res->ai_addrlen) >= 0) break; - if (he == NULL || he->h_addr == NULL) { - close(s); - s = -1; - break; - } - } while (1); - - if (s == -1) { + close(s); + s = -1; + } + freeaddrinfo(res0); + if (s < 0) { warn("connect"); return (NULL); } @@ -137,23 +124,23 @@ as_setup(server) return (asn); } -int -as_lookup(_asn, addr) - void *_asn; - struct in_addr *addr; +unsigned int +as_lookup(void *_asn, char *addr, sa_family_t family) { struct aslookup *asn = _asn; char buf[1024]; - int as, rc, dlen; + unsigned int as; + int rc, dlen, plen; - as = rc = dlen = 0; - (void)fprintf(asn->as_f, "!r%s/32,l\n", inet_ntoa(*addr)); + as = 0; + rc = dlen = 0; + plen = (family == AF_INET6) ? 128 : 32; + (void)fprintf(asn->as_f, "!r%s/%d,l\n", addr, plen); (void)fflush(asn->as_f); #ifdef AS_DEBUG_FILE if (asn->as_debug) { - (void)fprintf(asn->as_debug, ">> !r%s/32,l\n", - inet_ntoa(*addr)); + (void)fprintf(asn->as_debug, ">> !r%s/%d,l\n", addr, plen); (void)fflush(asn->as_debug); } #endif /* AS_DEBUG_FILE */ @@ -182,7 +169,7 @@ as_lookup(_asn, addr) } #endif /* AS_DEBUG_FILE */ break; - case 'C': + case 'C': case 'D': case 'E': case 'F': @@ -209,7 +196,7 @@ as_lookup(_asn, addr) /* origin line is the interesting bit */ if (as == 0 && strncasecmp(buf, "origin:", 7) == 0) { - sscanf(buf + 7, " AS%d", &as); + sscanf(buf + 7, " AS%u", &as); #ifdef AS_DEBUG_FILE if (asn->as_debug) { (void)fprintf(asn->as_debug, "as: %d\n", as); @@ -223,8 +210,7 @@ as_lookup(_asn, addr) } void -as_shutdown(_asn) - void *_asn; +as_shutdown(void *_asn) { struct aslookup *asn = _asn; Modified: stable/8/contrib/traceroute/as.h ============================================================================== --- stable/8/contrib/traceroute/as.h Sun Sep 13 11:31:25 2009 (r197157) +++ stable/8/contrib/traceroute/as.h Sun Sep 13 11:34:33 2009 (r197158) @@ -37,6 +37,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -void *as_setup __P((char *)); -int as_lookup __P((void *, struct in_addr *)); -void as_shutdown __P((void *)); +void *as_setup(char *); +unsigned int as_lookup(void *, char *, sa_family_t); +void as_shutdown(void *); Modified: stable/8/contrib/traceroute/traceroute.c ============================================================================== --- stable/8/contrib/traceroute/traceroute.c Sun Sep 13 11:31:25 2009 (r197157) +++ stable/8/contrib/traceroute/traceroute.c Sun Sep 13 11:34:33 2009 (r197158) @@ -1477,19 +1477,21 @@ print(register u_char *buf, register int { register struct ip *ip; register int hlen; + char addr[INET_ADDRSTRLEN]; ip = (struct ip *) buf; hlen = ip->ip_hl << 2; cc -= hlen; + strlcpy(addr, inet_ntoa(from->sin_addr), sizeof(addr)); + if (as_path) - Printf(" [AS%d]", as_lookup(asn, &from->sin_addr)); + Printf(" [AS%u]", as_lookup(asn, addr, AF_INET)); if (nflag) - Printf(" %s", inet_ntoa(from->sin_addr)); + Printf(" %s", addr); else - Printf(" %s (%s)", inetname(from->sin_addr), - inet_ntoa(from->sin_addr)); + Printf(" %s (%s)", inetname(from->sin_addr), addr); if (verbose) Printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); Modified: stable/8/usr.sbin/traceroute6/Makefile ============================================================================== --- stable/8/usr.sbin/traceroute6/Makefile Sun Sep 13 11:31:25 2009 (r197157) +++ stable/8/usr.sbin/traceroute6/Makefile Sun Sep 13 11:34:33 2009 (r197158) @@ -13,12 +13,17 @@ # A PARTICULAR PURPOSE. # $FreeBSD$ +TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute +.PATH: ${TRACEROUTE_DISTDIR} + PROG= traceroute6 MAN= traceroute6.8 +SRCS= as.c traceroute6.c BINOWN= root BINMODE= 4555 CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL +CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. DPADD= ${LIBIPSEC} LDADD= -lipsec Modified: stable/8/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/8/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 11:31:25 2009 (r197157) +++ stable/8/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 11:34:33 2009 (r197158) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 1998 +.Dd August 24, 2009 .Dt TRACEROUTE6 8 .Os .\" @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl dIlnNrvU +.Op Fl adIlnNrvU .Ek .Bk -words .Op Fl f Ar firsthop @@ -64,6 +64,9 @@ .Op Fl w Ar waittime .Ek .Bk -words +.Op Fl A Ar as_server +.Ek +.Bk -words .Ar target .Op Ar datalen .Ek @@ -84,6 +87,10 @@ after the destination host name. .Pp Other options are: .Bl -tag -width Ds +.It Fl a +Turn on AS# lookups for each hop encountered. +.It Fl A Ar as_server +Turn on AS# lookups and use the given server instead of the default. .It Fl d Debug mode. .It Fl f Ar firsthop Modified: stable/8/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/8/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 11:31:25 2009 (r197157) +++ stable/8/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 11:34:33 2009 (r197158) @@ -282,6 +282,8 @@ static const char rcsid[] = #include #endif +#include "as.h" + #define DUMMY_PORT 10010 #define MAXPACKET 65535 /* max ip packet size */ @@ -359,6 +361,9 @@ int waittime = 5; /* time to wait for r int nflag; /* print addresses numerically */ int useproto = IPPROTO_UDP; /* protocol to use to send packet */ int lflag; /* print both numerical address & hostname */ +int as_path; /* print as numbers for each hop */ +char *as_server = NULL; +void *asn; int main(argc, argv) @@ -411,8 +416,15 @@ main(argc, argv) seq = 0; - while ((ch = getopt(argc, argv, "df:g:Ilm:nNp:q:rs:Uvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:Uvw:")) != -1) switch (ch) { + case 'a': + as_path = 1; + break; + case 'A': + as_path = 1; + as_server = optarg; + break; case 'd': options |= SO_DEBUG; break; @@ -867,6 +879,17 @@ main(argc, argv) srcport = ntohs(Src.sin6_port); } + if (as_path) { + asn = as_setup(as_server); + if (asn == NULL) { + fprintf(stderr, + "traceroute6: as_setup failed, AS# lookups" + " disabled\n"); + (void)fflush(stderr); + as_path = 0; + } + } + /* * Message to users */ @@ -948,6 +971,8 @@ main(argc, argv) exit(0); } } + if (as_path) + as_shutdown(asn); exit(0); } @@ -1361,6 +1386,8 @@ print(mhdr, cc) if (getnameinfo((struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); + if (as_path) + printf(" [AS%u]", as_lookup(asn, hbuf, AF_INET6)); if (nflag) printf(" %s", hbuf); else if (lflag) From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:45:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFFD7106566C; Sun, 13 Sep 2009 11:45:31 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC8A8FC14; Sun, 13 Sep 2009 11:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DBjVXC020150; Sun, 13 Sep 2009 11:45:31 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBjVkw020148; Sun, 13 Sep 2009 11:45:31 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131145.n8DBjVkw020148@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 11:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197159 - stable/7/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:45:32 -0000 Author: ume Date: Sun Sep 13 11:45:31 2009 New Revision: 197159 URL: http://svn.freebsd.org/changeset/base/197159 Log: MFC r196929: Suppress an options line when no bit is on. Modified: stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/ifconfig/ifgif.c Modified: stable/7/sbin/ifconfig/ifgif.c ============================================================================== --- stable/7/sbin/ifconfig/ifgif.c Sun Sep 13 11:34:33 2009 (r197158) +++ stable/7/sbin/ifconfig/ifgif.c Sun Sep 13 11:45:31 2009 (r197159) @@ -71,6 +71,8 @@ gif_status(int s) ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GIFGOPTS, &ifr) == -1) return; + if (opts == 0) + return; printf("\toptions=%d<", opts); for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) { From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 11:52:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A22A106566B; Sun, 13 Sep 2009 11:52:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172588FC19; Sun, 13 Sep 2009 11:52:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DBqHoo020428; Sun, 13 Sep 2009 11:52:17 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBqHAk020421; Sun, 13 Sep 2009 11:52:17 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131152.n8DBqHAk020421@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 11:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197162 - in stable/7: contrib/traceroute usr.sbin/traceroute6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:52:18 -0000 Author: ume Date: Sun Sep 13 11:52:17 2009 New Revision: 197162 URL: http://svn.freebsd.org/changeset/base/197162 Log: MFC r196475: - Add AS lookup functionality to traceroute6(8) as well. - Support for IPv6 transport for AS lookup. - Introduce $RA_SERVER to set whois server. - Support for 4 byte ASN. - ANSIfy function declaration in as.c. Modified: stable/7/contrib/traceroute/ (props changed) stable/7/contrib/traceroute/as.c stable/7/contrib/traceroute/as.h stable/7/contrib/traceroute/traceroute.c stable/7/usr.sbin/traceroute6/ (props changed) stable/7/usr.sbin/traceroute6/Makefile stable/7/usr.sbin/traceroute6/traceroute6.8 stable/7/usr.sbin/traceroute6/traceroute6.c Modified: stable/7/contrib/traceroute/as.c ============================================================================== --- stable/7/contrib/traceroute/as.c Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/contrib/traceroute/as.c Sun Sep 13 11:52:17 2009 (r197162) @@ -63,55 +63,42 @@ struct aslookup { }; void * -as_setup(server) - char *server; +as_setup(char *server) { struct aslookup *asn; - struct hostent *he = NULL; - struct servent *se; - struct sockaddr_in in; + struct addrinfo hints, *res0, *res; FILE *f; - int s; + int s, error; if (server == NULL) + server = getenv("RA_SERVER"); + if (server == NULL) server = DEFAULT_AS_SERVER; - (void)memset(&in, 0, sizeof(in)); - in.sin_family = AF_INET; - in.sin_len = sizeof(in); - if ((se = getservbyname("whois", "tcp")) == NULL) { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(server, "whois", &hints, &res0); + if (error == EAI_SERVICE) { warnx("warning: whois/tcp service not found"); - in.sin_port = ntohs(43); - } else - in.sin_port = se->s_port; - - if (inet_aton(server, &in.sin_addr) == 0 && - ((he = gethostbyname(server)) == NULL || - he->h_addr == NULL)) { - warnx("%s: %s", server, hstrerror(h_errno)); - return (NULL); + error = getaddrinfo(server, "43", &hints, &res0); } - - if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) { - warn("socket"); + if (error != 0) { + warnx("%s: %s", server, gai_strerror(error)); return (NULL); } - do { - if (he != NULL) { - memcpy(&in.sin_addr, he->h_addr, he->h_length); - he->h_addr_list++; - } - if (connect(s, (struct sockaddr *)&in, sizeof(in)) == 0) + for (res = res0; res; res = res->ai_next) { + s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (s < 0) + continue; + if (connect(s, res->ai_addr, res->ai_addrlen) >= 0) break; - if (he == NULL || he->h_addr == NULL) { - close(s); - s = -1; - break; - } - } while (1); - - if (s == -1) { + close(s); + s = -1; + } + freeaddrinfo(res0); + if (s < 0) { warn("connect"); return (NULL); } @@ -137,23 +124,23 @@ as_setup(server) return (asn); } -int -as_lookup(_asn, addr) - void *_asn; - struct in_addr *addr; +unsigned int +as_lookup(void *_asn, char *addr, sa_family_t family) { struct aslookup *asn = _asn; char buf[1024]; - int as, rc, dlen; + unsigned int as; + int rc, dlen, plen; - as = rc = dlen = 0; - (void)fprintf(asn->as_f, "!r%s/32,l\n", inet_ntoa(*addr)); + as = 0; + rc = dlen = 0; + plen = (family == AF_INET6) ? 128 : 32; + (void)fprintf(asn->as_f, "!r%s/%d,l\n", addr, plen); (void)fflush(asn->as_f); #ifdef AS_DEBUG_FILE if (asn->as_debug) { - (void)fprintf(asn->as_debug, ">> !r%s/32,l\n", - inet_ntoa(*addr)); + (void)fprintf(asn->as_debug, ">> !r%s/%d,l\n", addr, plen); (void)fflush(asn->as_debug); } #endif /* AS_DEBUG_FILE */ @@ -182,7 +169,7 @@ as_lookup(_asn, addr) } #endif /* AS_DEBUG_FILE */ break; - case 'C': + case 'C': case 'D': case 'E': case 'F': @@ -209,7 +196,7 @@ as_lookup(_asn, addr) /* origin line is the interesting bit */ if (as == 0 && strncasecmp(buf, "origin:", 7) == 0) { - sscanf(buf + 7, " AS%d", &as); + sscanf(buf + 7, " AS%u", &as); #ifdef AS_DEBUG_FILE if (asn->as_debug) { (void)fprintf(asn->as_debug, "as: %d\n", as); @@ -223,8 +210,7 @@ as_lookup(_asn, addr) } void -as_shutdown(_asn) - void *_asn; +as_shutdown(void *_asn) { struct aslookup *asn = _asn; Modified: stable/7/contrib/traceroute/as.h ============================================================================== --- stable/7/contrib/traceroute/as.h Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/contrib/traceroute/as.h Sun Sep 13 11:52:17 2009 (r197162) @@ -37,6 +37,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -void *as_setup __P((char *)); -int as_lookup __P((void *, struct in_addr *)); -void as_shutdown __P((void *)); +void *as_setup(char *); +unsigned int as_lookup(void *, char *, sa_family_t); +void as_shutdown(void *); Modified: stable/7/contrib/traceroute/traceroute.c ============================================================================== --- stable/7/contrib/traceroute/traceroute.c Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/contrib/traceroute/traceroute.c Sun Sep 13 11:52:17 2009 (r197162) @@ -1477,19 +1477,21 @@ print(register u_char *buf, register int { register struct ip *ip; register int hlen; + char addr[INET_ADDRSTRLEN]; ip = (struct ip *) buf; hlen = ip->ip_hl << 2; cc -= hlen; + strlcpy(addr, inet_ntoa(from->sin_addr), sizeof(addr)); + if (as_path) - Printf(" [AS%d]", as_lookup(asn, &from->sin_addr)); + Printf(" [AS%u]", as_lookup(asn, addr, AF_INET)); if (nflag) - Printf(" %s", inet_ntoa(from->sin_addr)); + Printf(" %s", addr); else - Printf(" %s (%s)", inetname(from->sin_addr), - inet_ntoa(from->sin_addr)); + Printf(" %s (%s)", inetname(from->sin_addr), addr); if (verbose) Printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); Modified: stable/7/usr.sbin/traceroute6/Makefile ============================================================================== --- stable/7/usr.sbin/traceroute6/Makefile Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/usr.sbin/traceroute6/Makefile Sun Sep 13 11:52:17 2009 (r197162) @@ -13,12 +13,17 @@ # A PARTICULAR PURPOSE. # $FreeBSD$ +TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute +.PATH: ${TRACEROUTE_DISTDIR} + PROG= traceroute6 MAN= traceroute6.8 +SRCS= as.c traceroute6.c BINOWN= root BINMODE= 4555 CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL +CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. DPADD= ${LIBIPSEC} LDADD= -lipsec Modified: stable/7/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/7/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 11:52:17 2009 (r197162) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 1998 +.Dd August 24, 2009 .Dt TRACEROUTE6 8 .Os .\" @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl dIlnNrvU +.Op Fl adIlnNrvU .Ek .Bk -words .Op Fl f Ar firsthop @@ -64,6 +64,9 @@ .Op Fl w Ar waittime .Ek .Bk -words +.Op Fl A Ar as_server +.Ek +.Bk -words .Ar target .Op Ar datalen .Ek @@ -84,6 +87,10 @@ after the destination host name. .Pp Other options are: .Bl -tag -width Ds +.It Fl a +Turn on AS# lookups for each hop encountered. +.It Fl A Ar as_server +Turn on AS# lookups and use the given server instead of the default. .It Fl d Debug mode. .It Fl f Ar firsthop Modified: stable/7/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/7/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 11:52:17 2009 (r197162) @@ -282,6 +282,8 @@ static const char rcsid[] = #include #endif +#include "as.h" + #define DUMMY_PORT 10010 #define MAXPACKET 65535 /* max ip packet size */ @@ -359,6 +361,9 @@ int waittime = 5; /* time to wait for r int nflag; /* print addresses numerically */ int useproto = IPPROTO_UDP; /* protocol to use to send packet */ int lflag; /* print both numerical address & hostname */ +int as_path; /* print as numbers for each hop */ +char *as_server = NULL; +void *asn; int main(argc, argv) @@ -411,8 +416,15 @@ main(argc, argv) seq = 0; - while ((ch = getopt(argc, argv, "df:g:Ilm:nNp:q:rs:Uvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:Uvw:")) != -1) switch (ch) { + case 'a': + as_path = 1; + break; + case 'A': + as_path = 1; + as_server = optarg; + break; case 'd': options |= SO_DEBUG; break; @@ -867,6 +879,17 @@ main(argc, argv) srcport = ntohs(Src.sin6_port); } + if (as_path) { + asn = as_setup(as_server); + if (asn == NULL) { + fprintf(stderr, + "traceroute6: as_setup failed, AS# lookups" + " disabled\n"); + (void)fflush(stderr); + as_path = 0; + } + } + /* * Message to users */ @@ -948,6 +971,8 @@ main(argc, argv) exit(0); } } + if (as_path) + as_shutdown(asn); exit(0); } @@ -1361,6 +1386,8 @@ print(mhdr, cc) if (getnameinfo((struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); + if (as_path) + printf(" [AS%u]", as_lookup(asn, hbuf, AF_INET6)); if (nflag) printf(" %s", hbuf); else if (lflag) From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 13:15:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D41E1065670; Sun, 13 Sep 2009 13:15:36 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB898FC15; Sun, 13 Sep 2009 13:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DDFauK022025; Sun, 13 Sep 2009 13:15:36 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DDFaK2022023; Sun, 13 Sep 2009 13:15:36 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <200909131315.n8DDFaK2022023@svn.freebsd.org> From: Daniel Eischen Date: Sun, 13 Sep 2009 13:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197163 - head/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 13:15:36 -0000 Author: deischen Date: Sun Sep 13 13:15:36 2009 New Revision: 197163 URL: http://svn.freebsd.org/changeset/base/197163 Log: Bump our namespace version for 9.0. Add a comment about keeping the private namespace at the end of the dependency chain. Modified: head/lib/libc/Versions.def Modified: head/lib/libc/Versions.def ============================================================================== --- head/lib/libc/Versions.def Sun Sep 13 11:52:17 2009 (r197162) +++ head/lib/libc/Versions.def Sun Sep 13 13:15:36 2009 (r197163) @@ -1,5 +1,11 @@ # $FreeBSD$ +# +# Note: Whenever bumping the FBSD version, always make +# FBSDprivate_1.0 depend on the new FBSD version. +# This will keep it at the end of the dependency chain. +# + # This is our first version; it depends on no other. # This version was first added to 7.0-current. FBSD_1.0 { @@ -9,6 +15,10 @@ FBSD_1.0 { FBSD_1.1 { } FBSD_1.0; +# This version was first added to 9.0-current. +FBSD_1.2 { +} FBSD_1.1; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write @@ -16,4 +26,4 @@ FBSD_1.1 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.1; +} FBSD_1.2; From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 14:47:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A53106566B; Sun, 13 Sep 2009 14:47:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40E028FC08; Sun, 13 Sep 2009 14:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DElWvn023734; Sun, 13 Sep 2009 14:47:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DElWAo023729; Sun, 13 Sep 2009 14:47:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909131447.n8DElWAo023729@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Sep 2009 14:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197164 - in head/sys/sparc64: pci sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 14:47:32 -0000 Author: marius Date: Sun Sep 13 14:47:31 2009 New Revision: 197164 URL: http://svn.freebsd.org/changeset/base/197164 Log: Factor out the duplicated macro for the device type used in the OFW device tree for PCI bridges and add a new one for PCI Express. While at it, take advantage of the former for the rman(9) work- around in jbusppm(4). Modified: head/sys/sparc64/pci/ofw_pci.h head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sparc64/jbusppm.c Modified: head/sys/sparc64/pci/ofw_pci.h ============================================================================== --- head/sys/sparc64/pci/ofw_pci.h Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/pci/ofw_pci.h Sun Sep 13 14:47:31 2009 (r197164) @@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_PCI_CS_MEM32 0x02 #define OFW_PCI_CS_MEM64 0x03 +/* OFW device types */ +#define OFW_TYPE_PCI "pci" +#define OFW_TYPE_PCIE "pciex" + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/pci/psycho.c Sun Sep 13 14:47:31 2009 (r197164) @@ -224,8 +224,6 @@ struct psycho_dma_sync { * providing two PCI buses. */ -#define OFW_PCI_TYPE "pci" - struct psycho_desc { const char *pd_string; int pd_mode; @@ -275,7 +273,7 @@ psycho_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && psycho_get_desc(dev) != NULL) { device_set_desc(dev, "U2P UPA-PCI bridge"); return (0); Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/pci/schizo.c Sun Sep 13 14:47:31 2009 (r197164) @@ -209,8 +209,6 @@ struct schizo_dma_sync { #define SCHIZO_ICON_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v)) -#define OFW_PCI_TYPE "pci" - struct schizo_desc { const char *sd_string; int sd_mode; @@ -244,7 +242,7 @@ schizo_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && schizo_get_desc(dev) != NULL) { device_set_desc(dev, "Sun Host-PCI bridge"); return (0); Modified: head/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- head/sys/sparc64/sparc64/jbusppm.c Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/sparc64/jbusppm.c Sun Sep 13 14:47:31 2009 (r197164) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if 1 +#include +#endif + #define JBUSPPM_NREG 2 #define JBUSPPM_DEVID 0 @@ -150,7 +154,7 @@ jbusppm_attach(device_t dev) for (j = 0; j < nchildren; j++) { if (ofw_bus_get_type(children[j]) != NULL && strcmp(ofw_bus_get_type(children[j]), - "pci") == 0 && + OFW_TYPE_PCI) == 0 && ofw_bus_get_compat(children[j]) != NULL && strcmp(ofw_bus_get_compat(children[j]), "pci108e,a801") == 0 && From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 15:08:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B64106566B; Sun, 13 Sep 2009 15:08:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCCA78FC0C; Sun, 13 Sep 2009 15:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DF8JdN024192; Sun, 13 Sep 2009 15:08:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DF8JwI024189; Sun, 13 Sep 2009 15:08:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909131508.n8DF8JwI024189@svn.freebsd.org> From: Attilio Rao Date: Sun, 13 Sep 2009 15:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197165 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 15:08:20 -0000 Author: attilio Date: Sun Sep 13 15:08:19 2009 New Revision: 197165 URL: http://svn.freebsd.org/changeset/base/197165 Log: Revert r196779 in order to implement a different scheme for newbus locking methodology. Requested by: imp Modified: head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Sep 13 14:47:31 2009 (r197164) +++ head/sys/kern/subr_bus.c Sun Sep 13 15:08:19 2009 (r197165) @@ -2625,16 +2625,10 @@ device_attach(device_t dev) { int error; - if (dev->state >= DS_ATTACHING) - return (0); device_sysctl_init(dev); if (!device_is_quiet(dev)) device_print_child(dev->parent, dev); - dev->state = DS_ATTACHING; if ((error = DEVICE_ATTACH(dev)) != 0) { - KASSERT(dev->state == DS_ATTACHING, - ("%s: %p device state must not been changing", __func__, - dev)); printf("device_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); /* Unset the class; set in device_probe_child */ @@ -2645,8 +2639,6 @@ device_attach(device_t dev) dev->state = DS_NOTPRESENT; return (error); } - KASSERT(dev->state == DS_ATTACHING, - ("%s: %p device state must not been changing", __func__, dev)); device_sysctl_update(dev); dev->state = DS_ATTACHED; devadded(dev); @@ -2682,16 +2674,8 @@ device_detach(device_t dev) if (dev->state != DS_ATTACHED) return (0); - dev->state = DS_DETACHING; - if ((error = DEVICE_DETACH(dev)) != 0) { - KASSERT(dev->state == DS_DETACHING, - ("%s: %p device state must not been changing", __func__, - dev)); - dev->state = DS_ATTACHED; + if ((error = DEVICE_DETACH(dev)) != 0) return (error); - } - KASSERT(dev->state == DS_DETACHING, - ("%s: %p device state must not been changing", __func__, dev)); devremoved(dev); if (!device_is_quiet(dev)) device_printf(dev, "detached\n"); @@ -2746,7 +2730,7 @@ device_quiesce(device_t dev) int device_shutdown(device_t dev) { - if (dev->state < DS_ATTACHED || dev->state == DS_DETACHING) + if (dev->state < DS_ATTACHED) return (0); return (DEVICE_SHUTDOWN(dev)); } Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sun Sep 13 14:47:31 2009 (r197164) +++ head/sys/sys/bus.h Sun Sep 13 15:08:19 2009 (r197165) @@ -52,11 +52,8 @@ struct u_businfo { typedef enum device_state { DS_NOTPRESENT, /**< @brief not probed or probe failed */ DS_ALIVE, /**< @brief probe succeeded */ - DS_ATTACHING, /**< @brief attaching is in progress */ DS_ATTACHED, /**< @brief attach method called */ - DS_BUSY, /**< @brief device is open */ - DS_DETACHING /**< @brief detaching is in progress */ - + DS_BUSY /**< @brief device is open */ } device_state_t; /** From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 15:42:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E09431065698; Sun, 13 Sep 2009 15:42:21 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B661D8FC08; Sun, 13 Sep 2009 15:42:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DFgLO4024866; Sun, 13 Sep 2009 15:42:21 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DFgLsn024865; Sun, 13 Sep 2009 15:42:21 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200909131542.n8DFgLsn024865@svn.freebsd.org> From: Philip Paeps Date: Sun, 13 Sep 2009 15:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197166 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 15:42:22 -0000 Author: philip Date: Sun Sep 13 15:42:19 2009 New Revision: 197166 URL: http://svn.freebsd.org/changeset/base/197166 Log: Take bmah's commit bit into safekeeping per his request. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Sep 13 15:08:19 2009 (r197165) +++ svnadmin/conf/access Sun Sep 13 15:42:19 2009 (r197166) @@ -31,7 +31,6 @@ avg bde benjsc benno -bmah bms brian freebsd-committers@Awfulhak.org brooks From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 15:48:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826B01065696; Sun, 13 Sep 2009 15:48:40 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 4A41A8FC12; Sun, 13 Sep 2009 15:48:40 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=UTF-8; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7.0-5.01 32bit (built Feb 19 2009)) id <0KPX004002L36B00@smtpauth3.wiscmail.wisc.edu>; Sun, 13 Sep 2009 10:48:39 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.73.164]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7.0-5.01 32bit (built Feb 19 2009)) with ESMTPSA id <0KPX0016T2L22K30@smtpauth3.wiscmail.wisc.edu>; Sun, 13 Sep 2009 10:48:39 -0500 (CDT) Date: Sun, 13 Sep 2009 10:48:37 -0500 From: Nathan Whitehorn In-reply-to: <200909122222.n8CMMV3d099311@svn.freebsd.org> To: Hiroki Sato Message-id: <4AAD1455.80108@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.73.164 X-Spam-PmxInfo: Server=avs-12, Version=5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2009.9.13.153620, SenderIP=76.210.73.164 References: <200909122222.n8CMMV3d099311@svn.freebsd.org> User-Agent: Thunderbird 2.0.0.23 (X11/20090905) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197145 - in head: etc/defaults share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 15:48:41 -0000 Hiroki Sato wrote: > Author: hrs > Date: Sat Sep 12 22:22:31 2009 > New Revision: 197145 > URL: http://svn.freebsd.org/changeset/base/197145 > > Log: > The following changes are added because of > network_ipv6->rc.d/netif integration: > > - $ipv6_enable is now obsolete. Instead, IPv6 is enabled by > default if the kernel supports it, and $ipv6_network_interfaces > is "none" by default. If you want to use IPv6, define > $ipv6_network_interfaces and $ifconfig_xxx_ipv6. > > An interface which is in $network_interfaces and not in > $ipv6_network_interfaces will be marked as "inet6 > -auto_linklocal ifdisabled" (see ifconfig(8)). > [etc] Could you please add a note to /usr/src/UPDATING about all this? -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 16:05:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA73106566C; Sun, 13 Sep 2009 16:05:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B20DD8FC0C; Sun, 13 Sep 2009 16:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DG5Kc1025404; Sun, 13 Sep 2009 16:05:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DG5K5Y025402; Sun, 13 Sep 2009 16:05:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909131605.n8DG5K5Y025402@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 16:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197167 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 16:05:21 -0000 Author: pjd Date: Sun Sep 13 16:05:20 2009 New Revision: 197167 URL: http://svn.freebsd.org/changeset/base/197167 Log: Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories by just returning EOPNOTSUPP. This will allow NFS server to fall back to regular READDIR. Note that converting inode number to snapshot's vnode is expensive operation. Snapshots are stored in AVL tree, but based on their names, not inode numbers, so to convert inode to snapshot vnode we have to interate over all snalshots. This is not a problem in OpenSolaris, because in their READDIRPLUS implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on d_fileno as we do. PR: kern/125149 Reported by: Weldon Godfrey Analysis by: Jaakko Heinonen MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 15:42:19 2009 (r197166) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 16:05:20 2009 (r197167) @@ -1114,6 +1114,20 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla znode_t *zp; int err; + /* + * XXXPJD: zfs_zget() can't operate on virtual entires like .zfs/ or + * .zfs/snapshot/ directories, so for now just return EOPNOTSUPP. + * This will make NFS to fall back to using READDIR instead of + * READDIRPLUS. + * Also snapshots are stored in AVL tree, but based on their names, + * not inode numbers, so it will be very inefficient to iterate + * over all snapshots to find the right one. + * Note that OpenSolaris READDIRPLUS implementation does LOOKUP on + * d_name, and not VGET on d_fileno as we do. + */ + if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) + return (EOPNOTSUPP); + ZFS_ENTER(zfsvfs); err = zfs_zget(zfsvfs, ino, &zp); if (err == 0 && zp->z_unlinked) { From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 16:12:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51B90106566C; Sun, 13 Sep 2009 16:12:34 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from kennaway-macbookpro.config (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5C73C8FC14; Sun, 13 Sep 2009 16:12:33 +0000 (UTC) Message-ID: <4AAD19F2.10005@FreeBSD.org> Date: Sun, 13 Sep 2009 17:12:34 +0100 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Jung-uk Kim References: <200909112147.n8BLlind064388@svn.freebsd.org> In-Reply-To: <200909112147.n8BLlind064388@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197102 - head/sys/dev/amdtemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 16:12:34 -0000 Jung-uk Kim wrote: > Author: jkim > Date: Fri Sep 11 21:47:44 2009 > New Revision: 197102 > URL: http://svn.freebsd.org/changeset/base/197102 > > Log: > Improve amdtemp(4) significantly: > > - Improve newer AMD processor support (Family 0Fh Revision F and later). > - Adjust offset if DiodeOffet is set and valid. Note it is experimental > but it seems to give us more realistic temperatures. Newer Linux driver > blindly adds 21C for Family 0Fh desktop processors, however. > - Always populate dev.cpu and dev.amdtemp sysctl trees regardless of probe > order for consistency. Previously, dev.cpu.N.temperature was not populated > if amdtemp was loaded later than ACPI CPU driver and temperatures were not > accessible from dev.amdtemp.N.sensor0 tree for Family 10h/11h processors. > - Read the CPUID from PCI register instead of CPUID instruction to prevent > possible revision mismatches on multi-socket system. > - Change macros and variables to make them closer to AMD documents. > - Fix style(9) nits and improve comments. It no longer appears to work for me. The old version reported: dev.amdtemp.0.%desc: AMD K8 Thermal Sensors dev.amdtemp.0.%driver: amdtemp dev.amdtemp.0.%parent: hostb9 dev.amdtemp.0.sensor0.core0: 38.0C dev.amdtemp.0.sensor0.core1: 45.0C dev.amdtemp.0.sensor1.core0: 38.0C dev.amdtemp.0.sensor1.core1: 45.0C dev.cpu.0.temperature: 38.0C dev.cpu.1.temperature: 38.0C but none of those sysctl nodes are now present. CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ (2400.10-MHz K8-class CPU) Origin = "AuthenticAMD" Id = 0x20f32 Stepping = 2 Features=0x178bfbff Features2=0x1 AMD Features=0xe2500800 AMD Features2=0x3 ACPI APIC Table: From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 17:00:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A581B106566B; Sun, 13 Sep 2009 17:00:21 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93FEA8FC1C; Sun, 13 Sep 2009 17:00:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DH0L5X026536; Sun, 13 Sep 2009 17:00:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DH0L2m026535; Sun, 13 Sep 2009 17:00:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131700.n8DH0L2m026535@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 17:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197168 - stable/8/share/timedef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:00:21 -0000 Author: ume Date: Sun Sep 13 17:00:21 2009 New Revision: 197168 URL: http://svn.freebsd.org/changeset/base/197168 Log: MFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were localized by r193869. However, ja_JP.UTF-8 wasn't. So, reflect it to ja_JP.UTF-8 as well. Approved by: re (kib) Modified: stable/8/share/timedef/ (props changed) stable/8/share/timedef/ja_JP.UTF-8.src Modified: stable/8/share/timedef/ja_JP.UTF-8.src ============================================================================== --- stable/8/share/timedef/ja_JP.UTF-8.src Sun Sep 13 16:05:20 2009 (r197167) +++ stable/8/share/timedef/ja_JP.UTF-8.src Sun Sep 13 17:00:21 2009 (r197168) @@ -68,13 +68,11 @@ # # am # -#åˆå‰ -AM +åˆå‰ # # pm # -#åˆå¾Œ -PM +åˆå¾Œ # # date_fmt # From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 17:01:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A05E106566C; Sun, 13 Sep 2009 17:01:35 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 385948FC0A; Sun, 13 Sep 2009 17:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DH1ZPE026599; Sun, 13 Sep 2009 17:01:35 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DH1ZSR026595; Sun, 13 Sep 2009 17:01:35 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131701.n8DH1ZSR026595@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 17:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197169 - stable/8/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:01:35 -0000 Author: ume Date: Sun Sep 13 17:01:34 2009 New Revision: 197169 URL: http://svn.freebsd.org/changeset/base/197169 Log: MFC r196652: Fix the problem that the entry broke into two lines with multi-byte AM/PM date format. Approved by: re (kib) Modified: stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/w/extern.h stable/8/usr.bin/w/pr_time.c stable/8/usr.bin/w/w.c Modified: stable/8/usr.bin/w/extern.h ============================================================================== --- stable/8/usr.bin/w/extern.h Sun Sep 13 17:00:21 2009 (r197168) +++ stable/8/usr.bin/w/extern.h Sun Sep 13 17:01:34 2009 (r197169) @@ -38,6 +38,6 @@ extern int use_ampm; struct kinfo_proc; -void pr_attime(time_t *, time_t *); +int pr_attime(time_t *, time_t *); int pr_idle(time_t); int proc_compare(struct kinfo_proc *, struct kinfo_proc *); Modified: stable/8/usr.bin/w/pr_time.c ============================================================================== --- stable/8/usr.bin/w/pr_time.c Sun Sep 13 17:00:21 2009 (r197168) +++ stable/8/usr.bin/w/pr_time.c Sun Sep 13 17:01:34 2009 (r197169) @@ -52,13 +52,14 @@ static const char sccsid[] = "@(#)pr_tim * pr_attime -- * Print the time since the user logged in. */ -void +int pr_attime(time_t *started, time_t *now) { - static char buf[256]; + static wchar_t buf[256]; struct tm tp, tm; time_t diff; - char fmt[20]; + wchar_t *fmt; + int len, width, offset = 0; tp = *localtime(started); tm = *localtime(now); @@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now) /* If more than a week, use day-month-year. */ if (diff > 86400 * 7) - (void)strcpy(fmt, "%d%b%y"); + fmt = L"%d%b%y"; /* If not today, use day-hour-am/pm. */ else if (tm.tm_mday != tp.tm_mday || @@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now) tm.tm_year != tp.tm_year) { /* The line below does not take DST into consideration */ /* else if (*now / 86400 != *started / 86400) { */ - (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H"); + fmt = use_ampm ? L"%a%I%p" : L"%a%H"; } /* Default is hh:mm{am,pm}. */ else { - (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M"); + fmt = use_ampm ? L"%l:%M%p" : L"%k:%M"; } - (void)strftime(buf, sizeof(buf), fmt, &tp); - (void)wprintf(L"%-7.7s", buf); + (void)wcsftime(buf, sizeof(buf), fmt, &tp); + len = wcslen(buf); + width = wcswidth(buf, len); + if (len == width) + (void)wprintf(L"%-7.7ls", buf); + else if (width < 7) + (void)wprintf(L"%ls%.*s", buf, 7 - width, " "); + else { + (void)wprintf(L"%ls", buf); + offset = width - 7; + } + return (offset); } /* Modified: stable/8/usr.bin/w/w.c ============================================================================== --- stable/8/usr.bin/w/w.c Sun Sep 13 17:00:21 2009 (r197168) +++ stable/8/usr.bin/w/w.c Sun Sep 13 17:01:34 2009 (r197169) @@ -137,7 +137,7 @@ main(int argc, char *argv[]) struct stat *stp; FILE *ut; time_t touched; - int ch, i, nentries, nusers, wcmd, longidle, dropgid; + int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid; const char *memf, *nlistf, *p; char *x_suffix; char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX]; @@ -406,9 +406,10 @@ main(int argc, char *argv[]) ep->utmp.ut_line : ep->utmp.ut_line + 3, W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-"); t = _time_to_time32(ep->utmp.ut_time); - pr_attime(&t, &now); + longattime = pr_attime(&t, &now); longidle = pr_idle(ep->idle); - (void)printf("%.*s\n", argwidth - longidle, ep->args); + (void)printf("%.*s\n", argwidth - longidle - longattime, + ep->args); } (void)kvm_close(kd); exit(0); From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 17:05:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDDAF1065672; Sun, 13 Sep 2009 17:05:56 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC7358FC08; Sun, 13 Sep 2009 17:05:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DH5uUp026724; Sun, 13 Sep 2009 17:05:56 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DH5uLn026723; Sun, 13 Sep 2009 17:05:56 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131705.n8DH5uLn026723@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 17:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197170 - stable/7/share/timedef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:05:56 -0000 Author: ume Date: Sun Sep 13 17:05:56 2009 New Revision: 197170 URL: http://svn.freebsd.org/changeset/base/197170 Log: MFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were localized by r193869. However, ja_JP.UTF-8 wasn't. So, reflect it to ja_JP.UTF-8 as well. Modified: stable/7/share/timedef/ (props changed) stable/7/share/timedef/ja_JP.UTF-8.src Modified: stable/7/share/timedef/ja_JP.UTF-8.src ============================================================================== --- stable/7/share/timedef/ja_JP.UTF-8.src Sun Sep 13 17:01:34 2009 (r197169) +++ stable/7/share/timedef/ja_JP.UTF-8.src Sun Sep 13 17:05:56 2009 (r197170) @@ -68,13 +68,11 @@ # # am # -#åˆå‰ -AM +åˆå‰ # # pm # -#åˆå¾Œ -PM +åˆå¾Œ # # date_fmt # From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 17:08:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF59D106566C; Sun, 13 Sep 2009 17:08:58 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 755608FC0C; Sun, 13 Sep 2009 17:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DH8w5Z026822; Sun, 13 Sep 2009 17:08:58 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DH8wlY026818; Sun, 13 Sep 2009 17:08:58 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131708.n8DH8wlY026818@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 17:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197171 - stable/7/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:08:59 -0000 Author: ume Date: Sun Sep 13 17:08:58 2009 New Revision: 197171 URL: http://svn.freebsd.org/changeset/base/197171 Log: MFC r196652: Fix the problem that the entry broke into two lines with multi-byte AM/PM date format. Modified: stable/7/usr.bin/w/ (props changed) stable/7/usr.bin/w/extern.h stable/7/usr.bin/w/pr_time.c stable/7/usr.bin/w/w.c Modified: stable/7/usr.bin/w/extern.h ============================================================================== --- stable/7/usr.bin/w/extern.h Sun Sep 13 17:05:56 2009 (r197170) +++ stable/7/usr.bin/w/extern.h Sun Sep 13 17:08:58 2009 (r197171) @@ -38,6 +38,6 @@ extern int use_ampm; struct kinfo_proc; -void pr_attime(time_t *, time_t *); +int pr_attime(time_t *, time_t *); int pr_idle(time_t); int proc_compare(struct kinfo_proc *, struct kinfo_proc *); Modified: stable/7/usr.bin/w/pr_time.c ============================================================================== --- stable/7/usr.bin/w/pr_time.c Sun Sep 13 17:05:56 2009 (r197170) +++ stable/7/usr.bin/w/pr_time.c Sun Sep 13 17:08:58 2009 (r197171) @@ -52,13 +52,14 @@ static const char sccsid[] = "@(#)pr_tim * pr_attime -- * Print the time since the user logged in. */ -void +int pr_attime(time_t *started, time_t *now) { - static char buf[256]; + static wchar_t buf[256]; struct tm tp, tm; time_t diff; - char fmt[20]; + wchar_t *fmt; + int len, width, offset = 0; tp = *localtime(started); tm = *localtime(now); @@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now) /* If more than a week, use day-month-year. */ if (diff > 86400 * 7) - (void)strcpy(fmt, "%d%b%y"); + fmt = L"%d%b%y"; /* If not today, use day-hour-am/pm. */ else if (tm.tm_mday != tp.tm_mday || @@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now) tm.tm_year != tp.tm_year) { /* The line below does not take DST into consideration */ /* else if (*now / 86400 != *started / 86400) { */ - (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H"); + fmt = use_ampm ? L"%a%I%p" : L"%a%H"; } /* Default is hh:mm{am,pm}. */ else { - (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M"); + fmt = use_ampm ? L"%l:%M%p" : L"%k:%M"; } - (void)strftime(buf, sizeof(buf), fmt, &tp); - (void)wprintf(L"%-7.7s", buf); + (void)wcsftime(buf, sizeof(buf), fmt, &tp); + len = wcslen(buf); + width = wcswidth(buf, len); + if (len == width) + (void)wprintf(L"%-7.7ls", buf); + else if (width < 7) + (void)wprintf(L"%ls%.*s", buf, 7 - width, " "); + else { + (void)wprintf(L"%ls", buf); + offset = width - 7; + } + return (offset); } /* Modified: stable/7/usr.bin/w/w.c ============================================================================== --- stable/7/usr.bin/w/w.c Sun Sep 13 17:05:56 2009 (r197170) +++ stable/7/usr.bin/w/w.c Sun Sep 13 17:08:58 2009 (r197171) @@ -137,7 +137,7 @@ main(int argc, char *argv[]) struct stat *stp; FILE *ut; time_t touched; - int ch, i, nentries, nusers, wcmd, longidle, dropgid; + int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid; const char *memf, *nlistf, *p; char *x_suffix; char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX]; @@ -406,9 +406,10 @@ main(int argc, char *argv[]) ep->utmp.ut_line : ep->utmp.ut_line + 3, W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-"); t = _time_to_time32(ep->utmp.ut_time); - pr_attime(&t, &now); + longattime = pr_attime(&t, &now); longidle = pr_idle(ep->idle); - (void)printf("%.*s\n", argwidth - longidle, ep->args); + (void)printf("%.*s\n", argwidth - longidle - longattime, + ep->args); } (void)kvm_close(kd); exit(0); From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 17:30:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A045106566B; Sun, 13 Sep 2009 17:30:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 688438FC18; Sun, 13 Sep 2009 17:30:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DHUvfH027294; Sun, 13 Sep 2009 17:30:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DHUvOT027292; Sun, 13 Sep 2009 17:30:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909131730.n8DHUvOT027292@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 17:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197172 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:30:57 -0000 Author: pjd Date: Sun Sep 13 17:30:56 2009 New Revision: 197172 URL: http://svn.freebsd.org/changeset/base/197172 Log: Add missing \n. Reported by: marck Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sun Sep 13 17:08:58 2009 (r197171) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sun Sep 13 17:30:56 2009 (r197172) @@ -341,7 +341,7 @@ mzap_open(objset_t *os, uint64_t obj, dm zap->zap_m.zap_num_entries++; else { printf("ZFS WARNING: Duplicated ZAP " - "entry detected (%s).", + "entry detected (%s).\n", mze->mze_name); } zap_name_free(zn); From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 17:45:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08B71106566B; Sun, 13 Sep 2009 17:45:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC0FA8FC08; Sun, 13 Sep 2009 17:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DHjVM2027656; Sun, 13 Sep 2009 17:45:31 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DHjV6p027654; Sun, 13 Sep 2009 17:45:31 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200909131745.n8DHjV6p027654@svn.freebsd.org> From: Randall Stewart Date: Sun, 13 Sep 2009 17:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197173 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:45:32 -0000 Author: rrs Date: Sun Sep 13 17:45:31 2009 New Revision: 197173 URL: http://svn.freebsd.org/changeset/base/197173 Log: Fixes two bugs: 1) A lock issue, if we ever had to try again we would double lock the INP lock. 2) We were allowing (at wrap) associd 0... which really we cannot allow since 0 normally means in most socket API calls that we are wishing to effect something on the INP not TCB. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Sep 13 17:30:56 2009 (r197172) +++ head/sys/netinet/sctp_pcb.c Sun Sep 13 17:45:31 2009 (r197173) @@ -3926,12 +3926,20 @@ sctp_aloc_a_assoc_id(struct sctp_inpcb * struct sctpasochead *head; struct sctp_tcb *lstcb; + SCTP_INP_WLOCK(inp); try_again: if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* TSNH */ + SCTP_INP_WUNLOCK(inp); return (0); } - SCTP_INP_WLOCK(inp); + /* + * We don't allow assoc id to be 0, this is needed otherwise if the + * id were to wrap we would have issues with some socket options. + */ + if (inp->sctp_associd_counter == 0) { + inp->sctp_associd_counter++; + } id = inp->sctp_associd_counter; inp->sctp_associd_counter++; lstcb = sctp_findasoc_ep_asocid_locked(inp, (sctp_assoc_t) id, 0); From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 18:45:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60CBC106568F; Sun, 13 Sep 2009 18:45:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FF758FC18; Sun, 13 Sep 2009 18:45:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DIjx0M028949; Sun, 13 Sep 2009 18:45:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DIjxVV028947; Sun, 13 Sep 2009 18:45:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909131845.n8DIjxVV028947@svn.freebsd.org> From: Ed Schouten Date: Sun, 13 Sep 2009 18:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197174 - head/sys/dev/syscons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 18:45:59 -0000 Author: ed Date: Sun Sep 13 18:45:59 2009 New Revision: 197174 URL: http://svn.freebsd.org/changeset/base/197174 Log: Make sure we never place the cursor outside the screen. For some vague reason, it may be possible that scp->cursor_pos exceeds scp->ysize * scp->xsize. This means that teken_set_cursor() may get called with an invalid position. Just ignore the old cursor position in this case. Reported by: Paul B. Mahol MFC after: 1 month Modified: head/sys/dev/syscons/scterm-teken.c Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sun Sep 13 17:45:31 2009 (r197173) +++ head/sys/dev/syscons/scterm-teken.c Sun Sep 13 18:45:59 2009 (r197174) @@ -137,9 +137,12 @@ scteken_init(scr_stat *scp, void **softc tp.tp_col = scp->xsize; teken_set_winsize(&ts->ts_teken, &tp); - tp.tp_row = scp->cursor_pos / scp->xsize; - tp.tp_col = scp->cursor_pos % scp->xsize; - teken_set_cursor(&ts->ts_teken, &tp); + if (scp->cursor_pos < scp->ysize * scp->xsize) { + /* Valid old cursor position. */ + tp.tp_row = scp->cursor_pos / scp->xsize; + tp.tp_col = scp->cursor_pos % scp->xsize; + teken_set_cursor(&ts->ts_teken, &tp); + } break; } From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 20:19:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58B48106568F; Sun, 13 Sep 2009 20:19:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47FCB8FC0C; Sun, 13 Sep 2009 20:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DKJ2uj030706; Sun, 13 Sep 2009 20:19:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DKJ2Yi030704; Sun, 13 Sep 2009 20:19:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200909132019.n8DKJ2Yi030704@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Sep 2009 20:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197175 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 20:19:02 -0000 Author: bz Date: Sun Sep 13 20:19:02 2009 New Revision: 197175 URL: http://svn.freebsd.org/changeset/base/197175 Log: Correct a copy and paste error using the variable name from the legacy IP handling rather than the IPv6 version. Reported by: Pegasus Mc Cleaft (ken mthelicon.com) Tested by: Pegasus Mc Cleaft (ken mthelicon.com) MFC after: 2 days X-MFX with: r197139 Modified: head/etc/rc.d/routing Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sun Sep 13 18:45:59 2009 (r197174) +++ head/etc/rc.d/routing Sun Sep 13 20:19:02 2009 (r197175) @@ -132,7 +132,7 @@ inet6_static() if [ -n "${ipv6_static_routes}" ]; then for i in ${ipv6_static_routes}; do ipv6_route_args=`get_if_var $i ipv6_route_IF` - route ${_action} -inet6 ${route_args} + route ${_action} -inet6 ${ipv6_route_args} done fi From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 21:30:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 242991065672; Sun, 13 Sep 2009 21:30:19 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1320A8FC13; Sun, 13 Sep 2009 21:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DLUI2v032216; Sun, 13 Sep 2009 21:30:18 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DLUIjG032215; Sun, 13 Sep 2009 21:30:18 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200909132130.n8DLUIjG032215@svn.freebsd.org> From: Marko Zec Date: Sun, 13 Sep 2009 21:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197176 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 21:30:19 -0000 Author: zec Date: Sun Sep 13 21:30:18 2009 New Revision: 197176 URL: http://svn.freebsd.org/changeset/base/197176 Log: Lock the ifnet list while iterating over it. Submitted by: julian MFC after: 3 days Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sun Sep 13 20:19:02 2009 (r197175) +++ head/sys/compat/linux/linux_ioctl.c Sun Sep 13 21:30:18 2009 (r197176) @@ -2152,6 +2152,7 @@ linux_ifconf(struct thread *td, struct i /* handle the 'request buffer size' case */ if (ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; + IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2159,6 +2160,7 @@ linux_ifconf(struct thread *td, struct i ifc.ifc_len += sizeof(ifr); } } + IFNET_RUNLOCK(); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); return (error); From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 21:40:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD092106566B; Sun, 13 Sep 2009 21:40:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5908FC16; Sun, 13 Sep 2009 21:40:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DLeagr032459; Sun, 13 Sep 2009 21:40:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DLea7x032457; Sun, 13 Sep 2009 21:40:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909132140.n8DLea7x032457@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 21:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197177 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 21:40:36 -0000 Author: pjd Date: Sun Sep 13 21:40:36 2009 New Revision: 197177 URL: http://svn.freebsd.org/changeset/base/197177 Log: Support both case: when snapshot is already mounted and when it is not yet mounted. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 21:30:18 2009 (r197176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 21:40:36 2009 (r197177) @@ -1182,11 +1182,10 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno ZFS_ENTER(zfsvfs); /* - * On FreeBSD we are already called with snapshot's mount point - * and not the mount point of its parent. + * On FreeBSD we can get snapshot's mount point or its parent file + * system mount point depending if snapshot is already mounted or not. */ -#ifndef __FreeBSD__ - if (fidp->fid_len == LONG_FID_LEN) { + if (zfsvfs->z_parent == zfsvfs && fidp->fid_len == LONG_FID_LEN) { zfid_long_t *zlfid = (zfid_long_t *)fidp; uint64_t objsetid = 0; uint64_t setgen = 0; @@ -1204,7 +1203,6 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno return (EINVAL); ZFS_ENTER(zfsvfs); } -#endif if (fidp->fid_len == SHORT_FID_LEN || fidp->fid_len == LONG_FID_LEN) { zfid_short_t *zfid = (zfid_short_t *)fidp; From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 21:51:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B93151065692; Sun, 13 Sep 2009 21:51:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6D268FC18; Sun, 13 Sep 2009 21:51:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DLp1o7032699; Sun, 13 Sep 2009 21:51:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DLp1nW032695; Sun, 13 Sep 2009 21:51:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909132151.n8DLp1nW032695@svn.freebsd.org> From: Ed Maste Date: Sun, 13 Sep 2009 21:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197178 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 21:51:01 -0000 Author: emaste Date: Sun Sep 13 21:51:01 2009 New Revision: 197178 URL: http://svn.freebsd.org/changeset/base/197178 Log: ANSIfy, whitespace and comment adjustments, to simplify comparing these files with NetBSD / OpenBSD versions. Modified: head/lib/libstand/net.c head/lib/libstand/nfs.c head/lib/libstand/rpc.c Modified: head/lib/libstand/net.c ============================================================================== --- head/lib/libstand/net.c Sun Sep 13 21:40:36 2009 (r197177) +++ head/lib/libstand/net.c Sun Sep 13 21:51:01 2009 (r197178) @@ -68,14 +68,11 @@ __FBSDID("$FreeBSD$"); * zero errno to indicate it isn't done yet. */ ssize_t -sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize) - struct iodesc *d; - ssize_t (*sproc)(struct iodesc *, void *, size_t); - void *sbuf; - size_t ssize; - ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t); - void *rbuf; - size_t rsize; +sendrecv(struct iodesc *d, + ssize_t (*sproc)(struct iodesc *, void *, size_t), + void *sbuf, size_t ssize, + ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t), + void *rbuf, size_t rsize) { ssize_t cc; time_t t, tmo, tlast; @@ -87,7 +84,8 @@ sendrecv(d, sproc, sbuf, ssize, rproc, r #endif tmo = MINTMO; - tlast = tleft = 0; + tlast = 0; + tleft = 0; t = getsecs(); for (;;) { if (tleft <= 0) { @@ -107,7 +105,8 @@ sendrecv(d, sproc, sbuf, ssize, rproc, r if (cc == -1) { /* Error on transmit; wait before retrying */ - while ((getsecs() - t) < tmo); + while ((getsecs() - t) < tmo) + ; tleft = 0; continue; } @@ -133,8 +132,7 @@ sendrecv(d, sproc, sbuf, ssize, rproc, r * Return values are in network order. */ n_long -inet_addr(cp) - char *cp; +inet_addr(char *cp) { u_long val; int n; @@ -211,16 +209,14 @@ inet_addr(cp) } char * -inet_ntoa(ia) - struct in_addr ia; +inet_ntoa(struct in_addr ia) { return (intoa(ia.s_addr)); } /* Similar to inet_ntoa() */ char * -intoa(addr) - n_long addr; +intoa(n_long addr) { char *cp; u_int byte; @@ -250,9 +246,7 @@ intoa(addr) } static char * -number(s, n) - char *s; - int *n; +number(char *s, int *n) { for (*n = 0; isdigit(*s); s++) *n = (*n * 10) + *s - '0'; @@ -260,8 +254,7 @@ number(s, n) } n_long -ip_convertaddr(p) - char *p; +ip_convertaddr(char *p) { #define IP_ANYADDR 0 n_long addr = 0, n; Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Sun Sep 13 21:40:36 2009 (r197177) +++ head/lib/libstand/nfs.c Sun Sep 13 21:51:01 2009 (r197178) @@ -3,7 +3,7 @@ /*- * Copyright (c) 1993 John Brezak * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,7 +14,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * 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 @@ -147,10 +147,7 @@ struct fs_ops nfs_fsops = { * Return zero or error number. */ int -nfs_getrootfh(d, path, fhp) - struct iodesc *d; - char *path; - u_char *fhp; +nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp) { int len; struct args { @@ -170,7 +167,7 @@ nfs_getrootfh(d, path, fhp) struct repl d; } rdata; size_t cc; - + #ifdef NFS_DEBUG if (debug) printf("nfs_getrootfh: %s\n", path); @@ -206,10 +203,7 @@ nfs_getrootfh(d, path, fhp) * Return zero or error number. */ int -nfs_lookupfh(d, name, newfd) - struct nfs_iodesc *d; - const char *name; - struct nfs_iodesc *newfd; +nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd) { int len, rlen; struct args { @@ -231,7 +225,7 @@ nfs_lookupfh(d, name, newfd) struct repl d; } rdata; ssize_t cc; - + #ifdef NFS_DEBUG if (debug) printf("lookupfh: called\n"); @@ -272,9 +266,7 @@ nfs_lookupfh(d, name, newfd) * Get the destination of a symbolic link. */ int -nfs_readlink(d, buf) - struct nfs_iodesc *d; - char *buf; +nfs_readlink(struct nfs_iodesc *d, char *buf) { struct { n_long h[RPC_HEADER_WORDS]; @@ -300,7 +292,7 @@ nfs_readlink(d, buf) if (cc < 4) return (EIO); - + if (rdata.d.errno) return (ntohl(rdata.d.errno)); @@ -319,11 +311,7 @@ nfs_readlink(d, buf) * Return transfer count or -1 (and set errno) */ ssize_t -nfs_readdata(d, off, addr, len) - struct nfs_iodesc *d; - off_t off; - void *addr; - size_t len; +nfs_readdata(struct nfs_iodesc *d, off_t off, void *addr, size_t len) { struct nfs_read_args *args; struct nfs_read_repl *repl; @@ -381,9 +369,7 @@ nfs_readdata(d, off, addr, len) * return zero or error number */ int -nfs_open(upath, f) - const char *upath; - struct open_file *f; +nfs_open(const char *upath, struct open_file *f) { struct iodesc *desc; struct nfs_iodesc *currfd; @@ -475,18 +461,18 @@ nfs_open(upath, f) error = ENOTDIR; goto out; } - + /* allocate file system specific data structure */ newfd = malloc(sizeof(*newfd)); newfd->iodesc = currfd->iodesc; newfd->off = 0; - + /* * Get next component of path name. */ { int len = 0; - + ncp = cp; while ((c = *cp) != '\0' && c != '/') { if (++len > NFS_MAXNAMLEN) { @@ -497,19 +483,19 @@ nfs_open(upath, f) } *cp = '\0'; } - + /* lookup a file handle */ error = nfs_lookupfh(currfd, ncp, newfd); *cp = c; if (error) goto out; - + /* * Check for symbolic link */ if (newfd->fa.fa_type == htonl(NFLNK)) { int link_len, len; - + error = nfs_readlink(newfd, linkbuf); if (error) goto out; @@ -525,7 +511,7 @@ nfs_open(upath, f) bcopy(cp, &namebuf[link_len], len + 1); bcopy(linkbuf, namebuf, link_len); - + /* * If absolute pathname, restart at root. * If relative pathname, restart at parent directory. @@ -539,10 +525,10 @@ nfs_open(upath, f) free(newfd); newfd = 0; - + continue; } - + if (currfd != &nfs_root_node) free(currfd); currfd = newfd; @@ -568,7 +554,7 @@ out: f->f_fsdata = (void *)currfd; return (0); } - + #ifdef NFS_DEBUG if (debug) printf("nfs_open: %s lookupfh failed: %s\n", @@ -583,8 +569,7 @@ out: } int -nfs_close(f) - struct open_file *f; +nfs_close(struct open_file *f) { struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; @@ -596,7 +581,7 @@ nfs_close(f) if (fp != &nfs_root_node && fp) free(fp); f->f_fsdata = (void *)0; - + return (0); } @@ -604,16 +589,12 @@ nfs_close(f) * read a portion of a file */ int -nfs_read(f, buf, size, resid) - struct open_file *f; - void *buf; - size_t size; - size_t *resid; /* out */ +nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) { struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; ssize_t cc; char *addr = buf; - + #ifdef NFS_DEBUG if (debug) printf("nfs_read: size=%lu off=%d\n", (u_long)size, @@ -652,20 +633,13 @@ ret: * Not implemented. */ int -nfs_write(f, buf, size, resid) - struct open_file *f; - void *buf; - size_t size; - size_t *resid; /* out */ +nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid) { return (EROFS); } off_t -nfs_seek(f, offset, where) - struct open_file *f; - off_t offset; - int where; +nfs_seek(struct open_file *f, off_t offset, int where) { struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata; n_long size = ntohl(d->fa.fa_size); @@ -693,9 +667,7 @@ int nfs_stat_types[8] = { 0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, 0 }; int -nfs_stat(f, sb) - struct open_file *f; - struct stat *sb; +nfs_stat(struct open_file *f, struct stat *sb) { struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; n_long ftype, mode; @@ -724,7 +696,7 @@ nfs_readdir(struct open_file *f, struct static n_long cookie = 0; size_t cc; n_long eof; - + struct { n_long h[RPC_HEADER_WORDS]; struct nfs_readdir_args d; @@ -742,7 +714,7 @@ nfs_readdir(struct open_file *f, struct bcopy(fp->fh, args->fh, NFS_FHSIZE); args->cookie = htonl(cookie); args->count = htonl(NFS_READDIRSIZE); - + cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, args, sizeof(*args), rdata.d, sizeof(rdata.d)); Modified: head/lib/libstand/rpc.c ============================================================================== --- head/lib/libstand/rpc.c Sun Sep 13 21:40:36 2009 (r197177) +++ head/lib/libstand/rpc.c Sun Sep 13 21:51:01 2009 (r197178) @@ -108,13 +108,8 @@ int rpc_port = 0x400; /* predecrement */ * Note: Caller must leave room for headers. */ ssize_t -rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen) - struct iodesc *d; - n_long prog, vers, proc; - void *sdata; - size_t slen; - void *rdata; - size_t rlen; +rpc_call(struct iodesc *d, n_long prog, n_long vers, n_long proc, + void *sdata, size_t slen, void *rdata, size_t rlen) { ssize_t cc; struct auth_info *auth; @@ -232,11 +227,7 @@ rpc_call(d, prog, vers, proc, sdata, sle * Remaining checks are done by callrpc */ static ssize_t -recvrpc(d, pkt, len, tleft) - struct iodesc *d; - void *pkt; - size_t len; - time_t tleft; +recvrpc(struct iodesc *d, void *pkt, size_t len, time_t tleft) { struct rpc_reply *reply; ssize_t n; @@ -288,10 +279,7 @@ recvrpc(d, pkt, len, tleft) * dig out the IP address/port from the headers. */ void -rpc_fromaddr(pkt, addr, port) - void *pkt; - struct in_addr *addr; - u_short *port; +rpc_fromaddr(void *pkt, struct in_addr *addr, u_short *port) { struct hackhdr { /* Tail of IP header: just IP addresses */ @@ -324,12 +312,15 @@ struct pmap_list { int port; /* host order */ } rpc_pmap_list[PMAP_NUM]; -/* return port number in host order, or -1 */ +/* + * return port number in host order, or -1. + * arguments are: + * addr .. server, net order. + * prog .. host order. + * vers .. host order. + */ int -rpc_pmap_getcache(addr, prog, vers) - struct in_addr addr; /* server, net order */ - u_int prog; /* host order */ - u_int vers; /* host order */ +rpc_pmap_getcache(struct in_addr addr, u_int prog, u_int vers) { struct pmap_list *pl; @@ -343,12 +334,15 @@ rpc_pmap_getcache(addr, prog, vers) return (-1); } +/* + * arguments are: + * addr .. server, net order. + * prog .. host order. + * vers .. host order. + * port .. host order. + */ void -rpc_pmap_putcache(addr, prog, vers, port) - struct in_addr addr; /* server, net order */ - u_int prog; /* host order */ - u_int vers; /* host order */ - int port; /* host order */ +rpc_pmap_putcache(struct in_addr addr, u_int prog, u_int vers, int port) { struct pmap_list *pl; @@ -375,12 +369,10 @@ rpc_pmap_putcache(addr, prog, vers, port /* * Request a port number from the port mapper. * Returns the port in host order. + * prog and vers are host order. */ int -rpc_getport(d, prog, vers) - struct iodesc *d; - n_long prog; /* host order */ - n_long vers; /* host order */ +rpc_getport(struct iodesc *d, n_long prog, n_long vers) { struct args { n_long prog; /* call program */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 22:17:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54F51065670; Sun, 13 Sep 2009 22:17:23 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48F78FC12; Sun, 13 Sep 2009 22:17:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DMHNqw033354; Sun, 13 Sep 2009 22:17:23 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DMHNR8033351; Sun, 13 Sep 2009 22:17:23 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200909132217.n8DMHNR8033351@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 13 Sep 2009 22:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197182 - head/share/monetdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 22:17:23 -0000 Author: edwin Date: Sun Sep 13 22:17:23 2009 New Revision: 197182 URL: http://svn.freebsd.org/changeset/base/197182 Log: Last character is a space for the international currency symbol. Modified: head/share/monetdef/zh_CN.GB18030.src head/share/monetdef/zh_CN.GB2312.src Modified: head/share/monetdef/zh_CN.GB18030.src ============================================================================== --- head/share/monetdef/zh_CN.GB18030.src Sun Sep 13 21:53:59 2009 (r197181) +++ head/share/monetdef/zh_CN.GB18030.src Sun Sep 13 22:17:23 2009 (r197182) @@ -4,7 +4,7 @@ # WARNING: empty lines are essential too # # int_curr_symbol (last character always SPACE) -CNY +CNY # currency_symbol £¤ # mon_decimal_point Modified: head/share/monetdef/zh_CN.GB2312.src ============================================================================== --- head/share/monetdef/zh_CN.GB2312.src Sun Sep 13 21:53:59 2009 (r197181) +++ head/share/monetdef/zh_CN.GB2312.src Sun Sep 13 22:17:23 2009 (r197182) @@ -4,7 +4,7 @@ # WARNING: empty lines are essential too # # int_curr_symbol (last character always SPACE) -CNY +CNY # currency_symbol £¤ # mon_decimal_point From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 23:52:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 384711065672; Sun, 13 Sep 2009 23:52:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 782638FC13; Sun, 13 Sep 2009 23:52:06 +0000 (UTC) Received: from [IPv6:::1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n8DNq2hU082429; Sun, 13 Sep 2009 17:52:02 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1075.2) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Scott Long In-Reply-To: <200909131508.n8DF8JwI024189@svn.freebsd.org> Date: Sun, 13 Sep 2009 17:52:01 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: <200909131508.n8DF8JwI024189@svn.freebsd.org> To: Attilio Rao X-Mailer: Apple Mail (2.1075.2) X-Spam-Status: No, score=-2.4 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197165 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 23:52:08 -0000 Are we just just giving up on this for now? Also, I would have liked to have known that this was coming. Scott On Sep 13, 2009, at 9:08 AM, Attilio Rao wrote: > Author: attilio > Date: Sun Sep 13 15:08:19 2009 > New Revision: 197165 > URL: http://svn.freebsd.org/changeset/base/197165 > > Log: > Revert r196779 in order to implement a different scheme for newbus > locking > methodology. > > Requested by: imp > > Modified: > head/sys/kern/subr_bus.c > head/sys/sys/bus.h > > Modified: head/sys/kern/subr_bus.c > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/kern/subr_bus.c Sun Sep 13 14:47:31 2009 (r197164) > +++ head/sys/kern/subr_bus.c Sun Sep 13 15:08:19 2009 (r197165) > @@ -2625,16 +2625,10 @@ device_attach(device_t dev) > { > int error; > > - if (dev->state >= DS_ATTACHING) > - return (0); > device_sysctl_init(dev); > if (!device_is_quiet(dev)) > device_print_child(dev->parent, dev); > - dev->state = DS_ATTACHING; > if ((error = DEVICE_ATTACH(dev)) != 0) { > - KASSERT(dev->state == DS_ATTACHING, > - ("%s: %p device state must not been changing", __func__, > - dev)); > printf("device_attach: %s%d attach returned %d\n", > dev->driver->name, dev->unit, error); > /* Unset the class; set in device_probe_child */ > @@ -2645,8 +2639,6 @@ device_attach(device_t dev) > dev->state = DS_NOTPRESENT; > return (error); > } > - KASSERT(dev->state == DS_ATTACHING, > - ("%s: %p device state must not been changing", __func__, dev)); > device_sysctl_update(dev); > dev->state = DS_ATTACHED; > devadded(dev); > @@ -2682,16 +2674,8 @@ device_detach(device_t dev) > if (dev->state != DS_ATTACHED) > return (0); > > - dev->state = DS_DETACHING; > - if ((error = DEVICE_DETACH(dev)) != 0) { > - KASSERT(dev->state == DS_DETACHING, > - ("%s: %p device state must not been changing", __func__, > - dev)); > - dev->state = DS_ATTACHED; > + if ((error = DEVICE_DETACH(dev)) != 0) > return (error); > - } > - KASSERT(dev->state == DS_DETACHING, > - ("%s: %p device state must not been changing", __func__, dev)); > devremoved(dev); > if (!device_is_quiet(dev)) > device_printf(dev, "detached\n"); > @@ -2746,7 +2730,7 @@ device_quiesce(device_t dev) > int > device_shutdown(device_t dev) > { > - if (dev->state < DS_ATTACHED || dev->state == DS_DETACHING) > + if (dev->state < DS_ATTACHED) > return (0); > return (DEVICE_SHUTDOWN(dev)); > } > > Modified: head/sys/sys/bus.h > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/sys/bus.h Sun Sep 13 14:47:31 2009 (r197164) > +++ head/sys/sys/bus.h Sun Sep 13 15:08:19 2009 (r197165) > @@ -52,11 +52,8 @@ struct u_businfo { > typedef enum device_state { > DS_NOTPRESENT, /**< @brief not probed or probe failed */ > DS_ALIVE, /**< @brief probe succeeded */ > - DS_ATTACHING, /**< @brief attaching is in progress */ > DS_ATTACHED, /**< @brief attach method called */ > - DS_BUSY, /**< @brief device is open */ > - DS_DETACHING /**< @brief detaching is in progress */ > - > + DS_BUSY /**< @brief device is open */ > } device_state_t; > > /** From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 00:30:44 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0CC51065676; Mon, 14 Sep 2009 00:30:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 923E18FC13; Mon, 14 Sep 2009 00:30:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8E0SOXZ089175; Sun, 13 Sep 2009 18:28:24 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 13 Sep 2009 18:29:59 -0600 (MDT) Message-Id: <20090913.182959.1038847030.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: References: <200909131508.n8DF8JwI024189@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: attilio@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197165 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 00:30:44 -0000 In message: Scott Long writes: : Are we just just giving up on this for now? Also, I would have liked : to have known that this was coming. There's a thread in arch@ that discusses the plans, more or less... Warner : Scott : : On Sep 13, 2009, at 9:08 AM, Attilio Rao wrote: : : > Author: attilio : > Date: Sun Sep 13 15:08:19 2009 : > New Revision: 197165 : > URL: http://svn.freebsd.org/changeset/base/197165 : > : > Log: : > Revert r196779 in order to implement a different scheme for newbus : > locking : > methodology. : > : > Requested by: imp : > : > Modified: : > head/sys/kern/subr_bus.c : > head/sys/sys/bus.h : > : > Modified: head/sys/kern/subr_bus.c : > = : > = : > = : > = : > = : > = : > = : > = : > ====================================================================== : > --- head/sys/kern/subr_bus.c Sun Sep 13 14:47:31 2009 (r197164) : > +++ head/sys/kern/subr_bus.c Sun Sep 13 15:08:19 2009 (r197165) : > @@ -2625,16 +2625,10 @@ device_attach(device_t dev) : > { : > int error; : > : > - if (dev->state >= DS_ATTACHING) : > - return (0); : > device_sysctl_init(dev); : > if (!device_is_quiet(dev)) : > device_print_child(dev->parent, dev); : > - dev->state = DS_ATTACHING; : > if ((error = DEVICE_ATTACH(dev)) != 0) { : > - KASSERT(dev->state == DS_ATTACHING, : > - ("%s: %p device state must not been changing", __func__, : > - dev)); : > printf("device_attach: %s%d attach returned %d\n", : > dev->driver->name, dev->unit, error); : > /* Unset the class; set in device_probe_child */ : > @@ -2645,8 +2639,6 @@ device_attach(device_t dev) : > dev->state = DS_NOTPRESENT; : > return (error); : > } : > - KASSERT(dev->state == DS_ATTACHING, : > - ("%s: %p device state must not been changing", __func__, dev)); : > device_sysctl_update(dev); : > dev->state = DS_ATTACHED; : > devadded(dev); : > @@ -2682,16 +2674,8 @@ device_detach(device_t dev) : > if (dev->state != DS_ATTACHED) : > return (0); : > : > - dev->state = DS_DETACHING; : > - if ((error = DEVICE_DETACH(dev)) != 0) { : > - KASSERT(dev->state == DS_DETACHING, : > - ("%s: %p device state must not been changing", __func__, : > - dev)); : > - dev->state = DS_ATTACHED; : > + if ((error = DEVICE_DETACH(dev)) != 0) : > return (error); : > - } : > - KASSERT(dev->state == DS_DETACHING, : > - ("%s: %p device state must not been changing", __func__, dev)); : > devremoved(dev); : > if (!device_is_quiet(dev)) : > device_printf(dev, "detached\n"); : > @@ -2746,7 +2730,7 @@ device_quiesce(device_t dev) : > int : > device_shutdown(device_t dev) : > { : > - if (dev->state < DS_ATTACHED || dev->state == DS_DETACHING) : > + if (dev->state < DS_ATTACHED) : > return (0); : > return (DEVICE_SHUTDOWN(dev)); : > } : > : > Modified: head/sys/sys/bus.h : > = : > = : > = : > = : > = : > = : > = : > = : > ====================================================================== : > --- head/sys/sys/bus.h Sun Sep 13 14:47:31 2009 (r197164) : > +++ head/sys/sys/bus.h Sun Sep 13 15:08:19 2009 (r197165) : > @@ -52,11 +52,8 @@ struct u_businfo { : > typedef enum device_state { : > DS_NOTPRESENT, /**< @brief not probed or probe failed */ : > DS_ALIVE, /**< @brief probe succeeded */ : > - DS_ATTACHING, /**< @brief attaching is in progress */ : > DS_ATTACHED, /**< @brief attach method called */ : > - DS_BUSY, /**< @brief device is open */ : > - DS_DETACHING /**< @brief detaching is in progress */ : > - : > + DS_BUSY /**< @brief device is open */ : > } device_state_t; : > : > /** : 1 From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 05:38:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED206106566B; Mon, 14 Sep 2009 05:38:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DACBF8FC0C; Mon, 14 Sep 2009 05:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8E5c3gs041939; Mon, 14 Sep 2009 05:38:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8E5c3HX041937; Mon, 14 Sep 2009 05:38:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909140538.n8E5c3HX041937@svn.freebsd.org> From: Xin LI Date: Mon, 14 Sep 2009 05:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197185 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 05:38:04 -0000 Author: delphij Date: Mon Sep 14 05:38:03 2009 New Revision: 197185 URL: http://svn.freebsd.org/changeset/base/197185 Log: Enable BIOS modes on amd64. Submitted by: paradox Modified: head/sys/dev/fb/vga.c Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Mon Sep 14 03:53:48 2009 (r197184) +++ head/sys/dev/fb/vga.c Mon Sep 14 05:38:03 2009 (r197185) @@ -177,7 +177,7 @@ vga_mmap(struct cdev *dev, vga_softc_t * #endif /* architecture dependent option */ -#ifndef __i386__ +#if !defined(__i386__) && !defined(__amd64__) #define VGA_NO_BIOS 1 #endif From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 11:01:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DE56106566B; Mon, 14 Sep 2009 11:01:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0E68FC16; Mon, 14 Sep 2009 11:01:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EB1FJv049957; Mon, 14 Sep 2009 11:01:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EB1F4K049955; Mon, 14 Sep 2009 11:01:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909141101.n8EB1F4K049955@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Sep 2009 11:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197188 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/coretemp dev/xen/xenpci fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 11:01:15 -0000 Author: kib Date: Mon Sep 14 11:01:15 2009 New Revision: 197188 URL: http://svn.freebsd.org/changeset/base/197188 Log: MFC r196921: Do not decrement pfs_vncache_entries for the vnode that was not in the pfs_vncache list. Approved by: re (bz) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/coretemp/coretemp.c (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/fs/pseudofs/pseudofs_vncache.c Modified: stable/8/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/8/sys/fs/pseudofs/pseudofs_vncache.c Mon Sep 14 08:04:48 2009 (r197187) +++ stable/8/sys/fs/pseudofs/pseudofs_vncache.c Mon Sep 14 11:01:15 2009 (r197188) @@ -246,11 +246,13 @@ pfs_vncache_free(struct vnode *vp) KASSERT(pvd != NULL, ("pfs_vncache_free(): no vnode data\n")); if (pvd->pvd_next) pvd->pvd_next->pvd_prev = pvd->pvd_prev; - if (pvd->pvd_prev) + if (pvd->pvd_prev) { pvd->pvd_prev->pvd_next = pvd->pvd_next; - else if (pfs_vncache == pvd) + --pfs_vncache_entries; + } else if (pfs_vncache == pvd) { pfs_vncache = pvd->pvd_next; - --pfs_vncache_entries; + --pfs_vncache_entries; + } mtx_unlock(&pfs_vncache_mutex); free(pvd, M_PFSVNCACHE); From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 11:20:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 862B4106568B; Mon, 14 Sep 2009 11:20:45 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 757308FC12; Mon, 14 Sep 2009 11:20:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EBKjtj050393; Mon, 14 Sep 2009 11:20:45 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EBKjW9050391; Mon, 14 Sep 2009 11:20:45 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200909141120.n8EBKjW9050391@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 14 Sep 2009 11:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197189 - head/lib/libc/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 11:20:45 -0000 Author: edwin Date: Mon Sep 14 11:20:45 2009 New Revision: 197189 URL: http://svn.freebsd.org/changeset/base/197189 Log: Improve the way failure of pthread_key_create() gets detected. PR: threads/138603 Submitted by: Mikulas Patocka MFC after: 1 week Modified: head/lib/libc/stdtime/localtime.c Modified: head/lib/libc/stdtime/localtime.c ============================================================================== --- head/lib/libc/stdtime/localtime.c Mon Sep 14 11:01:15 2009 (r197188) +++ head/lib/libc/stdtime/localtime.c Mon Sep 14 11:20:45 2009 (r197189) @@ -21,6 +21,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include "private.h" @@ -1413,13 +1414,16 @@ const time_t * const timep; static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t localtime_key = -1; struct tm *p_tm; + int r; if (__isthreaded != 0) { if (localtime_key < 0) { _pthread_mutex_lock(&localtime_mutex); if (localtime_key < 0) { - if (_pthread_key_create(&localtime_key, free) < 0) { + if ((r = _pthread_key_create(&localtime_key, + free)) != 0) { _pthread_mutex_unlock(&localtime_mutex); + errno = r; return(NULL); } } @@ -1512,13 +1516,16 @@ const time_t * const timep; static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t gmtime_key = -1; struct tm *p_tm; + int r; if (__isthreaded != 0) { if (gmtime_key < 0) { _pthread_mutex_lock(&gmtime_mutex); if (gmtime_key < 0) { - if (_pthread_key_create(&gmtime_key, free) < 0) { + if ((r = _pthread_key_create(&gmtime_key, + free)) != 0) { _pthread_mutex_unlock(&gmtime_mutex); + errno = r; return(NULL); } } From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 11:46:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16896106568F; Mon, 14 Sep 2009 11:46:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04C458FC20; Mon, 14 Sep 2009 11:46:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EBkhqn050945; Mon, 14 Sep 2009 11:46:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EBkhIb050942; Mon, 14 Sep 2009 11:46:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909141146.n8EBkhIb050942@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Sep 2009 11:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197190 - head/sys/dev/asmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 11:46:44 -0000 Author: rpaulo Date: Mon Sep 14 11:46:43 2009 New Revision: 197190 URL: http://svn.freebsd.org/changeset/base/197190 Log: Make the sudden motion sensor work on older models and add a bit of debugging. Submitted by: Christoph Langguth MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Sep 14 11:20:45 2009 (r197189) +++ head/sys/dev/asmc/asmc.c Mon Sep 14 11:46:43 2009 (r197190) @@ -86,6 +86,10 @@ static void asmc_sms_handler(void *arg) #endif static void asmc_sms_printintr(device_t dev, uint8_t); static void asmc_sms_task(void *arg, int pending); +#ifdef DEBUG +void asmc_dumpall(device_t); +static int asmc_key_dump(device_t, int); +#endif /* * Model functions. @@ -532,6 +536,17 @@ asmc_detach(device_t dev) return (0); } +#ifdef DEBUG +void asmc_dumpall(device_t dev) +{ + int i; + + /* XXX magic number */ + for (i=0; i < 0x100; i++) + asmc_key_dump(dev, i); +} +#endif + static int asmc_init(device_t dev) { @@ -584,13 +599,17 @@ asmc_init(device_t dev) asmc_key_write(dev, ASMC_KEY_SMS_FLAG, buf, 1); DELAY(100); + sc->sc_sms_intr_works = 0; + /* - * Wait up to 5 seconds for SMS initialization. + * Retry SMS initialization 1000 times + * (takes approx. 2 seconds in worst case) */ - for (i = 0; i < 10000; i++) { + for (i = 0; i < 1000; i++) { if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 && - (buf[0] != 0x00 || buf[1] != 0x00)) { + (buf[0] == ASMC_SMS_INIT1 && buf[1] == ASMC_SMS_INIT2)) { error = 0; + sc->sc_sms_intr_works = 1; goto out; } buf[0] = ASMC_SMS_INIT1; @@ -620,6 +639,10 @@ nosms: device_printf(dev, "number of keys: %d\n", buf[3]); } +#ifdef DEBUG + asmc_dumpall(dev); +#endif + return (error); } @@ -729,6 +752,99 @@ out: return (error); } +#ifdef DEBUG +static int +asmc_key_dump(device_t dev, int number) +{ + struct asmc_softc *sc = device_get_softc(dev); + char key[5] = { 0 }; + char type[7] = { 0 }; + uint8_t index[4]; + uint8_t v[32]; + uint8_t maxlen; + int i, error = 1, try = 0; + + mtx_lock_spin(&sc->sc_mtx); + + index[0] = (number >> 24) & 0xff; + index[1] = (number >> 16) & 0xff; + index[2] = (number >> 8) & 0xff; + index[3] = (number) & 0xff; + +begin: + if (asmc_command(dev, 0x12)) + goto out; + + for (i = 0; i < 4; i++) { + ASMC_DATAPORT_WRITE(sc, index[i]); + if (asmc_wait(dev, 0x04)) + goto out; + } + + ASMC_DATAPORT_WRITE(sc, 4); + + for (i = 0; i < 4; i++) { + if (asmc_wait(dev, 0x05)) + goto out; + key[i] = ASMC_DATAPORT_READ(sc); + } + + /* get type */ + if (asmc_command(dev, 0x13)) + goto out; + + for (i = 0; i < 4; i++) { + ASMC_DATAPORT_WRITE(sc, key[i]); + if (asmc_wait(dev, 0x04)) + goto out; + } + + ASMC_DATAPORT_WRITE(sc, 6); + + for (i = 0; i < 6; i++) { + if (asmc_wait(dev, 0x05)) + goto out; + type[i] = ASMC_DATAPORT_READ(sc); + } + + error = 0; +out: + if (error) { + if (++try < 10) goto begin; + device_printf(dev,"%s for key %s failed %d times, giving up\n", + __func__, key, try); + mtx_unlock_spin(&sc->sc_mtx); + } + else { + char buf[1024]; + char buf2[8]; + mtx_unlock_spin(&sc->sc_mtx); + maxlen = type[0]; + type[0] = ' '; + type[5] = 0; + if (maxlen > sizeof(v)) { + device_printf(dev, "WARNING: cropping maxlen " + "from %d to %lud\n", maxlen, sizeof(v)); + maxlen = sizeof(v); + } + for (i = 0; i < sizeof(v); i++) { + v[i] = 0; + } + asmc_key_read(dev, key, v, maxlen); + snprintf(buf, sizeof(buf), "key %d is: %s, type %s " + "(len %d), data", number, key, type, maxlen); + for (i = 0; i < maxlen; i++) { + snprintf(buf2, sizeof(buf), " %02x", v[i]); + strlcat(buf, buf2, sizeof(buf)); + } + strlcat(buf, " \n", sizeof(buf)); + device_printf(dev, buf); + } + + return (error); +} +#endif + static int asmc_key_write(device_t dev, const char *key, uint8_t *buf, uint8_t len) { @@ -945,6 +1061,8 @@ asmc_sms_intrfast(void *arg) uint8_t type; device_t dev = (device_t) arg; struct asmc_softc *sc = device_get_softc(dev); + if (!sc->sc_sms_intr_works) + return (FILTER_HANDLED); mtx_lock_spin(&sc->sc_mtx); type = ASMC_INTPORT_READ(sc); Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Mon Sep 14 11:20:45 2009 (r197189) +++ head/sys/dev/asmc/asmcvar.h Mon Sep 14 11:46:43 2009 (r197190) @@ -49,6 +49,7 @@ struct asmc_softc { int sc_sms_intrtype; struct taskqueue *sc_sms_tq; struct task sc_sms_task; + uint8_t sc_sms_intr_works; }; /* From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 13:16:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80191106568F; Mon, 14 Sep 2009 13:16:16 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61D578FC20; Mon, 14 Sep 2009 13:16:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EDGG29055572; Mon, 14 Sep 2009 13:16:16 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EDGGao055570; Mon, 14 Sep 2009 13:16:16 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200909141316.n8EDGGao055570@svn.freebsd.org> From: Nick Hibma Date: Mon, 14 Sep 2009 13:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197191 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 13:16:16 -0000 Author: n_hibma Date: Mon Sep 14 13:16:16 2009 New Revision: 197191 URL: http://svn.freebsd.org/changeset/base/197191 Log: John Baldwin suggested that 'stolen memory' only happens in the case of i810 and therefore is useful info there. Aperture size and stolen memory are now printed on one line. Submitted by: jhb Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Mon Sep 14 11:46:43 2009 (r197190) +++ head/sys/dev/agp/agp_i810.c Mon Sep 14 13:16:16 2009 (r197191) @@ -667,14 +667,12 @@ agp_i810_attach(device_t dev) gatt->ag_physical = pgtblctl & ~1; } - if (bootverbose) { - device_printf(dev, "aperture size is %dM", - sc->initial_aperture / 1024 / 1024); - if (sc->stolen > 0) - printf(", detected %dk stolen memory\n", sc->stolen * 4); - else - printf("\n"); - } + device_printf(dev, "aperture size is %dM", + sc->initial_aperture / 1024 / 1024); + if (sc->stolen > 0) + printf(", detected %dk stolen memory\n", sc->stolen * 4); + else + printf("\n"); if (0) agp_i810_dump_regs(dev); From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 13:21:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97D0A106566C; Mon, 14 Sep 2009 13:21:48 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 5D03D8FC1A; Mon, 14 Sep 2009 13:21:48 +0000 (UTC) Received: from [192.168.1.4] (adsl-241-169-177.bna.bellsouth.net [74.241.169.177]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id n8EDLkkq000493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Sep 2009 09:21:46 -0400 (EDT) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: Nick Hibma In-Reply-To: <200909141316.n8EDGGao055570@svn.freebsd.org> References: <200909141316.n8EDGGao055570@svn.freebsd.org> Content-Type: text/plain Organization: FreeBSD Date: Mon, 14 Sep 2009 08:21:40 -0500 Message-Id: <1252934500.1992.1466.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RDNS_DYNAMIC,SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197191 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 13:21:48 -0000 On Mon, 2009-09-14 at 13:16 +0000, Nick Hibma wrote: > Author: n_hibma > Date: Mon Sep 14 13:16:16 2009 > New Revision: 197191 > URL: http://svn.freebsd.org/changeset/base/197191 > > Log: > John Baldwin suggested that 'stolen memory' only happens in the case of > i810 and therefore is useful info there. Aperture size and stolen memory > are now printed on one line. > > Submitted by: jhb This is fine, thanks. robert. > Modified: > head/sys/dev/agp/agp_i810.c > > Modified: head/sys/dev/agp/agp_i810.c > ============================================================================== > --- head/sys/dev/agp/agp_i810.c Mon Sep 14 11:46:43 2009 (r197190) > +++ head/sys/dev/agp/agp_i810.c Mon Sep 14 13:16:16 2009 (r197191) > @@ -667,14 +667,12 @@ agp_i810_attach(device_t dev) > gatt->ag_physical = pgtblctl & ~1; > } > > - if (bootverbose) { > - device_printf(dev, "aperture size is %dM", > - sc->initial_aperture / 1024 / 1024); > - if (sc->stolen > 0) > - printf(", detected %dk stolen memory\n", sc->stolen * 4); > - else > - printf("\n"); > - } > + device_printf(dev, "aperture size is %dM", > + sc->initial_aperture / 1024 / 1024); > + if (sc->stolen > 0) > + printf(", detected %dk stolen memory\n", sc->stolen * 4); > + else > + printf("\n"); > > if (0) > agp_i810_dump_regs(dev); -- Robert Noland FreeBSD From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 15:16:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4BF7106566C; Mon, 14 Sep 2009 15:16:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 854B68FC13; Mon, 14 Sep 2009 15:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EFGHdR058412; Mon, 14 Sep 2009 15:16:17 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EFGHRO058408; Mon, 14 Sep 2009 15:16:17 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200909141516.n8EFGHRO058408@svn.freebsd.org> From: Rick Macklem Date: Mon, 14 Sep 2009 15:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197192 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/coretemp dev/xen/xenpci fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 15:16:17 -0000 Author: rmacklem Date: Mon Sep 14 15:16:17 2009 New Revision: 197192 URL: http://svn.freebsd.org/changeset/base/197192 Log: MFC r197048: Add LK_NOWITNESS to the vn_lock() calls done on newly created nfs vnodes, since these nodes are not linked into the mount queue and, as such, the vn_lock() cannot cause a deadlock so LORs are harmless. Suggested by: kib Approved by: re (kensmith), kib (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/coretemp/coretemp.c (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/fs/nfsclient/nfs_clnode.c stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/nfsclient/nfs_node.c Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnode.c Mon Sep 14 13:16:16 2009 (r197191) +++ stable/8/sys/fs/nfsclient/nfs_clnode.c Mon Sep 14 15:16:17 2009 (r197192) @@ -157,7 +157,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f M_NFSFH, M_WAITOK); bcopy(fhp, np->n_fhp->nfh_fh, fhsize); np->n_fhp->nfh_len = fhsize; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL; Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Mon Sep 14 13:16:16 2009 (r197191) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Mon Sep 14 15:16:17 2009 (r197192) @@ -232,7 +232,7 @@ nfscl_nget(struct mount *mntp, struct vn */ VN_LOCK_AREC(vp); VN_LOCK_ASHARE(vp); - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL; Modified: stable/8/sys/nfsclient/nfs_node.c ============================================================================== --- stable/8/sys/nfsclient/nfs_node.c Mon Sep 14 13:16:16 2009 (r197191) +++ stable/8/sys/nfsclient/nfs_node.c Mon Sep 14 15:16:17 2009 (r197192) @@ -158,7 +158,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh np->n_fhp = &np->n_fh; bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); np->n_fhsize = fhsize; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL; From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 15:53:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9E31106568B; Mon, 14 Sep 2009 15:53:30 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7CAF8FC13; Mon, 14 Sep 2009 15:53:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EFrUI5059138; Mon, 14 Sep 2009 15:53:30 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EFrU1q059137; Mon, 14 Sep 2009 15:53:30 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909141553.n8EFrU1q059137@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Sep 2009 15:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197193 - head/sys/dev/asmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 15:53:30 -0000 Author: rpaulo Date: Mon Sep 14 15:53:30 2009 New Revision: 197193 URL: http://svn.freebsd.org/changeset/base/197193 Log: Fix printf format string in asmc_key_dump(). Spotted by: tinderbox MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Sep 14 15:16:17 2009 (r197192) +++ head/sys/dev/asmc/asmc.c Mon Sep 14 15:53:30 2009 (r197193) @@ -824,7 +824,7 @@ out: type[5] = 0; if (maxlen > sizeof(v)) { device_printf(dev, "WARNING: cropping maxlen " - "from %d to %lud\n", maxlen, sizeof(v)); + "from %u to %u\n", maxlen, sizeof(v)); maxlen = sizeof(v); } for (i = 0; i < sizeof(v); i++) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 16:13:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AC6F1065672; Mon, 14 Sep 2009 16:13:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F10308FC17; Mon, 14 Sep 2009 16:13:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EGDCQD059585; Mon, 14 Sep 2009 16:13:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EGDCEs059584; Mon, 14 Sep 2009 16:13:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909141613.n8EGDCEs059584@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Sep 2009 16:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197194 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/coretemp dev/syscons/daemon dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 16:13:13 -0000 Author: jhb Date: Mon Sep 14 16:13:12 2009 New Revision: 197194 URL: http://svn.freebsd.org/changeset/base/197194 Log: MFC 197062: Don't malloc a buffer while holding the prison0 mutex. Instead, use a loop where we figure out the hostname length under the lock, malloc the buffer with the lock dropped, then recheck the length under the lock and loop again if the buffer is now too small. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/coretemp/coretemp.c (props changed) stable/8/sys/dev/syscons/daemon/daemon_saver.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/syscons/daemon/daemon_saver.c ============================================================================== --- stable/8/sys/dev/syscons/daemon/daemon_saver.c Mon Sep 14 15:53:30 2009 (r197193) +++ stable/8/sys/dev/syscons/daemon/daemon_saver.c Mon Sep 14 16:13:12 2009 (r197194) @@ -351,11 +351,23 @@ daemon_saver(video_adapter_t *adp, int b static int daemon_init(video_adapter_t *adp) { + size_t hostlen; mtx_lock(&prison0.pr_mtx); - messagelen = strlen(prison0.pr_hostname) + 3 + strlen(ostype) + 1 + - strlen(osrelease); - message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK); + for (;;) { + hostlen = strlen(prison0.pr_hostname); + mtx_unlock(&prison0.pr_mtx); + + messagelen = hostlen + 3 + strlen(ostype) + 1 + + strlen(osrelease); + message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK); + mtx_lock(&prison0.pr_mtx); + if (hostlen < strlen(prison0.pr_hostname)) { + free(message, M_DEVBUF); + continue; + } + break; + } sprintf(message, "%s - %s %s", prison0.pr_hostname, ostype, osrelease); mtx_unlock(&prison0.pr_mtx); blanked = 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 16:16:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C051065693; Mon, 14 Sep 2009 16:16:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 406FD8FC1B; Mon, 14 Sep 2009 16:16:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EGG8HS059686; Mon, 14 Sep 2009 16:16:08 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EGG8r3059684; Mon, 14 Sep 2009 16:16:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909141616.n8EGG8r3059684@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Sep 2009 16:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197195 - head/sys/dev/asmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 16:16:08 -0000 Author: rpaulo Date: Mon Sep 14 16:16:07 2009 New Revision: 197195 URL: http://svn.freebsd.org/changeset/base/197195 Log: Fix previous commit. I got it backwards. MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Sep 14 16:13:12 2009 (r197194) +++ head/sys/dev/asmc/asmc.c Mon Sep 14 16:16:07 2009 (r197195) @@ -824,7 +824,7 @@ out: type[5] = 0; if (maxlen > sizeof(v)) { device_printf(dev, "WARNING: cropping maxlen " - "from %u to %u\n", maxlen, sizeof(v)); + "from %u to %lu\n", maxlen, sizeof(v)); maxlen = sizeof(v); } for (i = 0; i < sizeof(v); i++) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 16:29:36 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 938491065676; Mon, 14 Sep 2009 16:29:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kris Kennaway Date: Mon, 14 Sep 2009 12:29:20 -0400 User-Agent: KMail/1.6.2 References: <200909112147.n8BLlind064388@svn.freebsd.org> <4AAD19F2.10005@FreeBSD.org> In-Reply-To: <4AAD19F2.10005@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_i9mrKA/ROv5TzfR" Message-Id: <200909141229.23229.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197102 - head/sys/dev/amdtemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 16:29:36 -0000 --Boundary-00=_i9mrKA/ROv5TzfR Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 13 September 2009 12:12 pm, Kris Kennaway wrote: > Jung-uk Kim wrote: > > Author: jkim > > Date: Fri Sep 11 21:47:44 2009 > > New Revision: 197102 > > URL: http://svn.freebsd.org/changeset/base/197102 > > > > Log: > > Improve amdtemp(4) significantly: > > > > - Improve newer AMD processor support (Family 0Fh Revision F > > and later). - Adjust offset if DiodeOffet is set and valid. Note > > it is experimental but it seems to give us more realistic > > temperatures. Newer Linux driver blindly adds 21C for Family 0Fh > > desktop processors, however. - Always populate dev.cpu and > > dev.amdtemp sysctl trees regardless of probe order for > > consistency. Previously, dev.cpu.N.temperature was not populated > > if amdtemp was loaded later than ACPI CPU driver and temperatures > > were not accessible from dev.amdtemp.N.sensor0 tree for Family > > 10h/11h processors. - Read the CPUID from PCI register instead of > > CPUID instruction to prevent possible revision mismatches on > > multi-socket system. > > - Change macros and variables to make them closer to AMD > > documents. - Fix style(9) nits and improve comments. > > It no longer appears to work for me. The old version reported: > > dev.amdtemp.0.%desc: AMD K8 Thermal Sensors > dev.amdtemp.0.%driver: amdtemp > dev.amdtemp.0.%parent: hostb9 > dev.amdtemp.0.sensor0.core0: 38.0C > dev.amdtemp.0.sensor0.core1: 45.0C > dev.amdtemp.0.sensor1.core0: 38.0C > dev.amdtemp.0.sensor1.core1: 45.0C > dev.cpu.0.temperature: 38.0C > dev.cpu.1.temperature: 38.0C > > but none of those sysctl nodes are now present. > > CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ (2400.10-MHz > K8-class CPU) > Origin = "AuthenticAMD" Id = 0x20f32 Stepping = 2 > > Features=0x178bfbffR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > Features2=0x1 > AMD Features=0xe2500800 > AMD Features2=0x3 > ACPI APIC Table: Arg... This is a Socket 939, Revision E processor and Revision C/D/E seems to have different DiodeOffset encoding. Please try the attached patch until I fix it properly. Sorry for the inconvenience. Jung-uk Kim --Boundary-00=_i9mrKA/ROv5TzfR Content-Type: text/plain; charset="iso-8859-1"; name="amdtemp.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="amdtemp.c.diff" --- sys/dev/amdtemp/amdtemp.c +++ sys/dev/amdtemp/amdtemp.c @@ -185,13 +185,6 @@ amdtemp_probe(device_t dev) break; case 0x10: case 0x11: - /* - * DiodeOffset must be non-zero if thermal diode is supported. - */ - temp = pci_read_config(dev, AMDTEMP_THERMTP_STAT, 4); - temp = (temp >> 8) & 0x7f; - if (temp == 0) - return (ENXIO); break; default: return (ENXIO); --Boundary-00=_i9mrKA/ROv5TzfR-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 16:38:37 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1C6A7106568F; Mon, 14 Sep 2009 16:38:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kris Kennaway Date: Mon, 14 Sep 2009 12:38:17 -0400 User-Agent: KMail/1.6.2 References: <200909112147.n8BLlind064388@svn.freebsd.org> <4AAD19F2.10005@FreeBSD.org> <200909141229.23229.jkim@FreeBSD.org> In-Reply-To: <200909141229.23229.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200909141238.23995.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197102 - head/sys/dev/amdtemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 16:38:37 -0000 On Monday 14 September 2009 12:29 pm, Jung-uk Kim wrote: > On Sunday 13 September 2009 12:12 pm, Kris Kennaway wrote: > > Jung-uk Kim wrote: > > > Author: jkim > > > Date: Fri Sep 11 21:47:44 2009 > > > New Revision: 197102 > > > URL: http://svn.freebsd.org/changeset/base/197102 > > > > > > Log: > > > Improve amdtemp(4) significantly: > > > > > > - Improve newer AMD processor support (Family 0Fh Revision F > > > and later). - Adjust offset if DiodeOffet is set and valid. > > > Note it is experimental but it seems to give us more realistic > > > temperatures. Newer Linux driver blindly adds 21C for Family > > > 0Fh desktop processors, however. - Always populate dev.cpu and > > > dev.amdtemp sysctl trees regardless of probe order for > > > consistency. Previously, dev.cpu.N.temperature was not > > > populated if amdtemp was loaded later than ACPI CPU driver and > > > temperatures were not accessible from dev.amdtemp.N.sensor0 > > > tree for Family 10h/11h processors. - Read the CPUID from PCI > > > register instead of CPUID instruction to prevent possible > > > revision mismatches on multi-socket system. > > > - Change macros and variables to make them closer to AMD > > > documents. - Fix style(9) nits and improve comments. > > > > It no longer appears to work for me. The old version reported: > > > > dev.amdtemp.0.%desc: AMD K8 Thermal Sensors > > dev.amdtemp.0.%driver: amdtemp > > dev.amdtemp.0.%parent: hostb9 > > dev.amdtemp.0.sensor0.core0: 38.0C > > dev.amdtemp.0.sensor0.core1: 45.0C > > dev.amdtemp.0.sensor1.core0: 38.0C > > dev.amdtemp.0.sensor1.core1: 45.0C > > dev.cpu.0.temperature: 38.0C > > dev.cpu.1.temperature: 38.0C > > > > but none of those sysctl nodes are now present. > > > > CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ (2400.10-MHz > > K8-class CPU) > > Origin = "AuthenticAMD" Id = 0x20f32 Stepping = 2 > > > > Features=0x178bfbff >TR R,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > > Features2=0x1 > > AMD > > Features=0xe2500800 AMD > > Features2=0x3 > > ACPI APIC Table: > > Arg... This is a Socket 939, Revision E processor and Revision > C/D/E seems to have different DiodeOffset encoding. Please try the > attached patch until I fix it properly. Please ignore this patch. I need some time to think and fix it properly. There are too many families and revisions. :-( Sorry, Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 16:52:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4749D1065672; Mon, 14 Sep 2009 16:52:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36CD58FC1F; Mon, 14 Sep 2009 16:52:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EGqdNc060472; Mon, 14 Sep 2009 16:52:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EGqdd1060471; Mon, 14 Sep 2009 16:52:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909141652.n8EGqdd1060471@svn.freebsd.org> From: Ed Maste Date: Mon, 14 Sep 2009 16:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197196 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 16:52:39 -0000 Author: emaste Date: Mon Sep 14 16:52:38 2009 New Revision: 197196 URL: http://svn.freebsd.org/changeset/base/197196 Log: Protect cross-script invocation by checking that the target script exists. This allows pruning of rc.d scripts without getting too many ugly boottime error messages. Inspired by phk's r128714 change to netif. Modified: head/etc/rc.d/ppp Modified: head/etc/rc.d/ppp ============================================================================== --- head/etc/rc.d/ppp Mon Sep 14 16:16:07 2009 (r197195) +++ head/etc/rc.d/ppp Mon Sep 14 16:52:38 2009 (r197196) @@ -95,8 +95,12 @@ ppp_poststart() { # Re-Sync ipfilter and pf so they pick up any new network interfaces # - /etc/rc.d/ipfilter quietresync - /etc/rc.d/pf quietresync + if [ -f /etc/rc.d/ipfilter ]; then + /etc/rc.d/ipfilter quietresync + fi + if [ -f /etc/rc.d/pf ]; then + /etc/rc.d/pf quietresync + fi } ppp_stop_profile() { From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 17:34:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6480E106566B; Mon, 14 Sep 2009 17:34:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50AA58FC25; Mon, 14 Sep 2009 17:34:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EHYobK061414; Mon, 14 Sep 2009 17:34:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EHYng3061392; Mon, 14 Sep 2009 17:34:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909141734.n8EHYng3061392@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Sep 2009 17:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197197 - in stable/7: sys sys/amd64/amd64 sys/arm/arm sys/conf sys/contrib/pf sys/fs/procfs sys/i386/i386 sys/ia64/ia64 sys/kern sys/sparc64/sparc64 sys/sys sys/vm usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 17:34:50 -0000 Author: jhb Date: Mon Sep 14 17:34:49 2009 New Revision: 197197 URL: http://svn.freebsd.org/changeset/base/197197 Log: MFC 195840, 195844, and 196637: Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to a device pager (OBJT_DEVICE) object in that it uses fictitious pages to provide aliases to other memory addresses. The primary difference is that it uses an sglist(9) to determine the physical addresses for a given offset into the object instead of invoking the d_mmap() method in a device driver. Added: stable/7/sys/vm/sg_pager.c - copied, changed from r195840, head/sys/vm/sg_pager.c Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/pmap.c stable/7/sys/arm/arm/pmap.c stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/fs/procfs/procfs_map.c stable/7/sys/i386/i386/pmap.c stable/7/sys/ia64/ia64/pmap.c stable/7/sys/kern/kern_proc.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sys/user.h stable/7/sys/vm/vm.h stable/7/sys/vm/vm_fault.c stable/7/sys/vm/vm_map.c stable/7/sys/vm/vm_meter.c stable/7/sys/vm/vm_object.c stable/7/sys/vm/vm_object.h stable/7/sys/vm/vm_page.c stable/7/sys/vm/vm_pageout.c stable/7/sys/vm/vm_pager.c stable/7/sys/vm/vm_pager.h stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/procstat/procstat_vm.c Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/amd64/amd64/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -3350,7 +3350,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { if (!vm_object_populate(object, pindex, pindex + atop(size))) @@ -4592,7 +4592,8 @@ vm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size) { - if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) { + if ((obj == NULL) || (size < NBPDR) || + (obj->type != OBJT_DEVICE && obj->type != OBJT_SG)) { return addr; } Modified: stable/7/sys/arm/arm/pmap.c ============================================================================== --- stable/7/sys/arm/arm/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/arm/arm/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -3071,7 +3071,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/conf/files Mon Sep 14 17:34:49 2009 (r197197) @@ -2210,6 +2210,7 @@ vm/default_pager.c standard vm/device_pager.c standard vm/phys_pager.c standard vm/redzone.c optional DEBUG_REDZONE +vm/sg_pager.c standard vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard Modified: stable/7/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/7/sys/fs/procfs/procfs_map.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/fs/procfs/procfs_map.c Mon Sep 14 17:34:49 2009 (r197197) @@ -177,6 +177,7 @@ procfs_doprocmap(PFS_FILL_ARGS) type = "swap"; vp = NULL; break; + case OBJT_SG: case OBJT_DEVICE: type = "device"; vp = NULL; Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/i386/i386/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -3474,7 +3474,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { @@ -4712,7 +4712,8 @@ vm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size) { - if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) { + if ((obj == NULL) || (size < NBPDR) || + (obj->type != OBJT_DEVICE && obj->type != OBJT_SG)) { return addr; } Modified: stable/7/sys/ia64/ia64/pmap.c ============================================================================== --- stable/7/sys/ia64/ia64/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/ia64/ia64/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1737,7 +1737,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/kern/kern_proc.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1488,6 +1488,9 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; @@ -1659,6 +1662,9 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1495,7 +1495,7 @@ pmap_object_init_pt(pmap_t pm, vm_offset { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: stable/7/sys/sys/user.h ============================================================================== --- stable/7/sys/sys/user.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/sys/user.h Mon Sep 14 17:34:49 2009 (r197197) @@ -334,6 +334,7 @@ struct kinfo_file { #define KVME_TYPE_DEVICE 4 #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 +#define KVME_TYPE_SG 7 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Copied and modified: stable/7/sys/vm/sg_pager.c (from r195840, head/sys/vm/sg_pager.c) ============================================================================== --- head/sys/vm/sg_pager.c Fri Jul 24 13:50:29 2009 (r195840, copy source) +++ stable/7/sys/vm/sg_pager.c Mon Sep 14 17:34:49 2009 (r197197) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ __FBSDID("$FreeBSD$"); static void sg_pager_init(void); static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, - vm_ooffset_t, struct ucred *); + vm_ooffset_t); static void sg_pager_dealloc(vm_object_t); static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int); static void sg_pager_putpages(vm_object_t, vm_page_t *, int, @@ -78,7 +79,7 @@ sg_pager_init(void) static vm_object_t sg_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred) + vm_ooffset_t foff) { struct sglist *sg; vm_object_t object; @@ -193,21 +194,18 @@ sg_pager_getpages(vm_object_t object, vm ("backing page for SG is fake")); /* Construct a new fake page. */ - printf("SG: getting fake page for paddr %lx\n", paddr); page = sg_pager_getfake(paddr, memattr); VM_OBJECT_LOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); /* Free the original pages and insert this fake page into the object. */ vm_page_lock_queues(); - for (i = 0; i < count; i++) { - printf("SG: freeing VM page %p\n", m[i]); + for (i = 0; i < count; i++) vm_page_free(m[i]); - } vm_page_unlock_queues(); - printf("SG: Inserting new fake page\n"); vm_page_insert(page, object, offset); m[reqpage] = page; + page->valid = VM_PAGE_BITS_ALL; return (VM_PAGER_OK); } Modified: stable/7/sys/vm/vm.h ============================================================================== --- stable/7/sys/vm/vm.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm.h Mon Sep 14 17:34:49 2009 (r197197) @@ -89,7 +89,7 @@ typedef u_char vm_prot_t; /* protection #define VM_PROT_DEFAULT VM_PROT_ALL enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS, - OBJT_DEAD }; + OBJT_DEAD, OBJT_SG }; typedef u_char objtype_t; union vm_map_object; Modified: stable/7/sys/vm/vm_fault.c ============================================================================== --- stable/7/sys/vm/vm_fault.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_fault.c Mon Sep 14 17:34:49 2009 (r197197) @@ -485,7 +485,8 @@ readrest: (fs.first_object == fs.object || (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && fs.first_object->type != OBJT_DEVICE && - fs.first_object->type != OBJT_PHYS) { + fs.first_object->type != OBJT_PHYS && + fs.first_object->type != OBJT_SG) { vm_pindex_t firstpindex, tmppindex; if (fs.first_pindex < 2 * VM_FAULT_READ) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_map.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1478,7 +1478,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; VM_OBJECT_LOCK(object); - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { pmap_object_init_pt(map->pmap, addr, object, pindex, size); goto unlock_return; } @@ -1954,7 +1954,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, @@ -2073,7 +2074,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st saved_start = entry->start; saved_end = entry->end; fictitious = entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE; + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG); /* * Release the map lock, relying on the in-transition * mark. @@ -2169,7 +2171,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } next_entry_done: @@ -2294,7 +2297,8 @@ vm_map_entry_unwire(vm_map_t map, vm_map { vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); entry->wired_count = 0; } Modified: stable/7/sys/vm/vm_meter.c ============================================================================== --- stable/7/sys/vm/vm_meter.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_meter.c Mon Sep 14 17:34:49 2009 (r197197) @@ -211,7 +211,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) * synchronization should not impair the accuracy of * the reported statistics. */ - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { /* * Devices, like /dev/mem, will badly skew our totals. */ Modified: stable/7/sys/vm/vm_object.c ============================================================================== --- stable/7/sys/vm/vm_object.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_object.c Mon Sep 14 17:34:49 2009 (r197197) @@ -306,6 +306,7 @@ vm_object_set_memattr(vm_object_t object case OBJT_DEFAULT: case OBJT_DEVICE: case OBJT_PHYS: + case OBJT_SG: case OBJT_SWAP: case OBJT_VNODE: if (!TAILQ_EMPTY(&object->memq)) Modified: stable/7/sys/vm/vm_object.h ============================================================================== --- stable/7/sys/vm/vm_object.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_object.h Mon Sep 14 17:34:49 2009 (r197197) @@ -124,6 +124,15 @@ struct vm_object { } devp; /* + * SG pager + * + * sgp_pglist - list of allocated pages + */ + struct { + TAILQ_HEAD(, vm_page) sgp_pglist; + } sgp; + + /* * Swap pager * * swp_bcount - number of swap 'swblock' metablocks, each Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_page.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1149,7 +1149,7 @@ vm_page_alloc(vm_object_t object, vm_pin if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ if (object->memattr != VM_MEMATTR_DEFAULT && - object->type != OBJT_DEVICE) + object->type != OBJT_DEVICE && object->type != OBJT_SG) pmap_page_set_memattr(m, object->memattr); vm_page_insert(m, object, pindex); } else Modified: stable/7/sys/vm/vm_pageout.c ============================================================================== --- stable/7/sys/vm/vm_pageout.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_pageout.c Mon Sep 14 17:34:49 2009 (r197197) @@ -516,7 +516,9 @@ vm_pageout_object_deactivate_pages(pmap, int actcount, rcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || first_object->type == OBJT_PHYS) + if (first_object->type == OBJT_DEVICE || + first_object->type == OBJT_SG || + first_object->type == OBJT_PHYS) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) Modified: stable/7/sys/vm/vm_pager.c ============================================================================== --- stable/7/sys/vm/vm_pager.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_pager.c Mon Sep 14 17:34:49 2009 (r197197) @@ -160,7 +160,8 @@ struct pagerops *pagertab[] = { &vnodepagerops, /* OBJT_VNODE */ &devicepagerops, /* OBJT_DEVICE */ &physpagerops, /* OBJT_PHYS */ - &deadpagerops /* OBJT_DEAD */ + &deadpagerops, /* OBJT_DEAD */ + &sgpagerops /* OBJT_SG */ }; static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); Modified: stable/7/sys/vm/vm_pager.h ============================================================================== --- stable/7/sys/vm/vm_pager.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_pager.h Mon Sep 14 17:34:49 2009 (r197197) @@ -71,6 +71,7 @@ extern struct pagerops swappagerops; extern struct pagerops vnodepagerops; extern struct pagerops devicepagerops; extern struct pagerops physpagerops; +extern struct pagerops sgpagerops; /* * get/put return values Modified: stable/7/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/7/usr.bin/procstat/procstat_vm.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/usr.bin/procstat/procstat_vm.c Mon Sep 14 17:34:49 2009 (r197197) @@ -93,6 +93,9 @@ procstat_vm(pid_t pid, struct kinfo_proc case KVME_TYPE_DEAD: str = "dd"; break; + case KVME_TYPE_SG: + str = "sg"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 17:45:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A0871065693; Mon, 14 Sep 2009 17:45:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE0548FC0C; Mon, 14 Sep 2009 17:45:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EHjwYB061686; Mon, 14 Sep 2009 17:45:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EHjwOT061684; Mon, 14 Sep 2009 17:45:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909141745.n8EHjwOT061684@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Sep 2009 17:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197198 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 17:45:59 -0000 Author: jhb Date: Mon Sep 14 17:45:58 2009 New Revision: 197198 URL: http://svn.freebsd.org/changeset/base/197198 Log: Bump __FreeBSD_version to 702106 for the recent PAT, d_mmap_single(), and OBJT_SG changes. Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Mon Sep 14 17:34:49 2009 (r197197) +++ stable/7/sys/sys/param.h Mon Sep 14 17:45:58 2009 (r197198) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702105 /* Master, propagated to newvers */ +#define __FreeBSD_version 702106 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 17:49:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D064B1065672; Mon, 14 Sep 2009 17:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEB158FC1F; Mon, 14 Sep 2009 17:49:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EHnxTE061800; Mon, 14 Sep 2009 17:49:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EHnxCG061799; Mon, 14 Sep 2009 17:49:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909141749.n8EHnxCG061799@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Sep 2009 17:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197199 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/coretemp dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 17:49:59 -0000 Author: jhb Date: Mon Sep 14 17:49:59 2009 New Revision: 197199 URL: http://svn.freebsd.org/changeset/base/197199 Log: Fix botched mergeinfo. Approved by: re (kib, bz) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/coretemp/coretemp.c (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 18:30:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFD2D1065672; Mon, 14 Sep 2009 18:30:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 352A18FC0C; Mon, 14 Sep 2009 18:30:20 +0000 (UTC) Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n8EIUHOP025921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Sep 2009 04:30:18 +1000 Date: Tue, 15 Sep 2009 04:30:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Rui Paulo In-Reply-To: <200909141616.n8EGG8r3059684@svn.freebsd.org> Message-ID: <20090915040529.J6194@delplex.bde.org> References: <200909141616.n8EGG8r3059684@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197195 - head/sys/dev/asmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 18:30:21 -0000 On Mon, 14 Sep 2009, Rui Paulo wrote: > Log: > Fix previous commit. I got it backwards. It is still unfixed. > MFC after: 1 week > > Modified: > head/sys/dev/asmc/asmc.c > > Modified: head/sys/dev/asmc/asmc.c > ============================================================================== > --- head/sys/dev/asmc/asmc.c Mon Sep 14 16:13:12 2009 (r197194) > +++ head/sys/dev/asmc/asmc.c Mon Sep 14 16:16:07 2009 (r197195) > @@ -824,7 +824,7 @@ out: > type[5] = 0; > if (maxlen > sizeof(v)) { > device_printf(dev, "WARNING: cropping maxlen " > - "from %u to %u\n", maxlen, sizeof(v)); > + "from %u to %lu\n", maxlen, sizeof(v)); > maxlen = sizeof(v); > } This printf has the following errors: Fatal printf format error: values of type size_t should be printed using %zu, but here sizeof(v) is printed using %lu. Printing it using %u would be fatal on different systems. Non-fatal printf format error: maxlen has type uint8_t, so its default promotion is int, and this should be printed using %d like it was 2 commits ago. %u will work since the value is representable using both int and u_int, but this is not easy to see (in fact, I can't see it in C99 -- I can only see where C99 requires va_arg(ap, u_int) to work on a u_int). Format-printf error (style bug). The message is obfuscated using C90 string concatenation. Fixed version: device_printf(dev, "WARNING: cropping maxlen from %d to %zu\n", maxlen, sizeof(v)); Bruce From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 20:09:08 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8DABD1065672; Mon, 14 Sep 2009 20:09:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kris Kennaway Date: Mon, 14 Sep 2009 16:08:51 -0400 User-Agent: KMail/1.6.2 References: <200909112147.n8BLlind064388@svn.freebsd.org> <200909141229.23229.jkim@FreeBSD.org> <200909141238.23995.jkim@FreeBSD.org> In-Reply-To: <200909141238.23995.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_VLqrKhZyAMGWxDj" Message-Id: <200909141608.53244.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197102 - head/sys/dev/amdtemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 20:09:08 -0000 --Boundary-00=_VLqrKhZyAMGWxDj Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Monday 14 September 2009 12:38 pm, Jung-uk Kim wrote: > On Monday 14 September 2009 12:29 pm, Jung-uk Kim wrote: > > On Sunday 13 September 2009 12:12 pm, Kris Kennaway wrote: > > > Jung-uk Kim wrote: > > > > Author: jkim > > > > Date: Fri Sep 11 21:47:44 2009 > > > > New Revision: 197102 > > > > URL: http://svn.freebsd.org/changeset/base/197102 > > > > > > > > Log: > > > > Improve amdtemp(4) significantly: > > > > > > > > - Improve newer AMD processor support (Family 0Fh Revision > > > > F and later). - Adjust offset if DiodeOffet is set and valid. > > > > Note it is experimental but it seems to give us more > > > > realistic temperatures. Newer Linux driver blindly adds 21C > > > > for Family 0Fh desktop processors, however. - Always populate > > > > dev.cpu and dev.amdtemp sysctl trees regardless of probe > > > > order for consistency. Previously, dev.cpu.N.temperature was > > > > not populated if amdtemp was loaded later than ACPI CPU > > > > driver and temperatures were not accessible from > > > > dev.amdtemp.N.sensor0 tree for Family 10h/11h processors. - > > > > Read the CPUID from PCI register instead of CPUID instruction > > > > to prevent possible revision mismatches on multi-socket > > > > system. > > > > - Change macros and variables to make them closer to AMD > > > > documents. - Fix style(9) nits and improve comments. > > > > > > It no longer appears to work for me. The old version reported: > > > > > > dev.amdtemp.0.%desc: AMD K8 Thermal Sensors > > > dev.amdtemp.0.%driver: amdtemp > > > dev.amdtemp.0.%parent: hostb9 > > > dev.amdtemp.0.sensor0.core0: 38.0C > > > dev.amdtemp.0.sensor0.core1: 45.0C > > > dev.amdtemp.0.sensor1.core0: 38.0C > > > dev.amdtemp.0.sensor1.core1: 45.0C > > > dev.cpu.0.temperature: 38.0C > > > dev.cpu.1.temperature: 38.0C > > > > > > but none of those sysctl nodes are now present. > > > > > > CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ > > > (2400.10-MHz K8-class CPU) > > > Origin = "AuthenticAMD" Id = 0x20f32 Stepping = 2 > > > > > > Features=0x178bfbff > >,M TR R,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > > > Features2=0x1 > > > AMD > > > Features=0xe2500800 > > > AMD Features2=0x3 > > > ACPI APIC Table: > > > > Arg... This is a Socket 939, Revision E processor and Revision > > C/D/E seems to have different DiodeOffset encoding. Please try > > the attached patch until I fix it properly. > > Please ignore this patch. I need some time to think and fix it > properly. There are too many families and revisions. :-( Please try the attached patch. I tried to implement all the quirks in Revision Guide carefully but I must admit that I haven't tried it on anything earlier than Revision F. Thanks, Jung-uk Kim --Boundary-00=_VLqrKhZyAMGWxDj Content-Type: text/plain; charset="iso-8859-1"; name="amdtemp.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="amdtemp.c.diff" --- sys/dev/amdtemp/amdtemp.c +++ sys/dev/amdtemp/amdtemp.c @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -58,10 +59,14 @@ struct amdtemp_softc { device_t sc_dev; - uint32_t sc_mask; + int sc_flags; +#define AMDTEMP_FLAG_DO_QUIRK 0x01 /* DiodeOffset is incorrect. */ +#define AMDTEMP_FLAG_DO_ZERO 0x02 /* DiodeOffset starts from 0C. */ +#define AMDTEMP_FLAG_DO_SIGN 0x04 /* DiodeOffsetSignBit is present. */ +#define AMDTEMP_FLAG_CSWAP 0x08 /* Core0/Core1 selector is swapped. */ +#define AMDTEMP_FLAG_10BIT 0x10 /* CurTmp is 10-bit wide. */ int sc_ncores; int sc_ntemps; - int sc_swap; int32_t (*sc_gettemp)(device_t, amdsensor_t); struct sysctl_oid *sc_sysctl_cpu[MAXCPU]; struct intr_config_hook sc_ich; @@ -168,30 +173,22 @@ static int amdtemp_probe(device_t dev) { - uint32_t cpuid, family, model, temp; + uint32_t family, model; if (resource_disabled("amdtemp", 0)) return (ENXIO); - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); - family = CPUID_TO_FAMILY(cpuid); - model = CPUID_TO_MODEL(cpuid); + family = CPUID_TO_FAMILY(cpu_id); + model = CPUID_TO_MODEL(cpu_id); switch (family) { case 0x0f: - if ((model == 0x04 && (cpuid & CPUID_STEPPING) == 0) || - (model == 0x05 && (cpuid & CPUID_STEPPING) <= 1)) + if ((model == 0x04 && (cpu_id & CPUID_STEPPING) == 0) || + (model == 0x05 && (cpu_id & CPUID_STEPPING) <= 1)) return (ENXIO); break; case 0x10: case 0x11: - /* - * DiodeOffset must be non-zero if thermal diode is supported. - */ - temp = pci_read_config(dev, AMDTEMP_THERMTP_STAT, 4); - temp = (temp >> 8) & 0x7f; - if (temp == 0) - return (ENXIO); break; default: return (ENXIO); @@ -207,34 +204,59 @@ struct amdtemp_softc *sc = device_get_softc(dev); struct sysctl_ctx_list *sysctlctx; struct sysctl_oid *sysctlnode; + uint32_t regs[4]; uint32_t cpuid, family, model; - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); - family = CPUID_TO_FAMILY(cpuid); - model = CPUID_TO_MODEL(cpuid); + /* + * Errata #154: Incorect Diode Offset + */ + if (cpu_id == 0x20f32) { + do_cpuid(0x80000001, regs); + if ((regs[1] && 0xfff) == 0x2c) + sc->sc_flags |= AMDTEMP_FLAG_DO_QUIRK; + } + /* + * CPUID register is available from Revision F. + */ + family = CPUID_TO_FAMILY(cpu_id); + model = CPUID_TO_MODEL(cpu_id); + if (family != 0x0f || model >= 0x40) { + cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); + family = CPUID_TO_FAMILY(cpuid); + model = CPUID_TO_MODEL(cpuid); + } + switch (family) { case 0x0f: /* - * Thermaltrip Status Register - CurTmp + * Thermaltrip Status Register * + * - DiodeOffsetSignBit + * + * Revision D & E: bit 24 + * Other: N/A + * + * - ThermSenseCoreSel + * + * Revision F & G: 0 - Core1, 1 - Core0 + * Other: 0 - Core0, 1 - Core1 + * + * - CurTmp + * * Revision G: bits 23-14 - * Earlier: bits 23-16 + * Other: bits 23-16 */ + if (model < 0x40) + sc->sc_flags |= AMDTEMP_FLAG_DO_ZERO; + if (model >= 0x08 && model < 0x40) + sc->sc_flags |= AMDTEMP_FLAG_DO_SIGN; + if (model >= 0x40) + sc->sc_flags |= AMDTEMP_FLAG_CSWAP; if (model >= 0x60 && model != 0xc1) - sc->sc_mask = 0x3ff << 14; - else - sc->sc_mask = 0xff << 16; + sc->sc_flags |= AMDTEMP_FLAG_10BIT; /* - * Thermaltrip Status Register - ThermSenseCoreSel - * - * Revision F: 0 - Core1, 1 - Core0 - * Earlier: 0 - Core0, 1 - Core1 - */ - sc->sc_swap = (model >= 0x40); - - /* * There are two sensors per core. */ sc->sc_ntemps = 2; @@ -244,11 +266,6 @@ case 0x10: case 0x11: /* - * Reported Temperature Control Register - Curtmp - */ - sc->sc_mask = 0x3ff << 21; - - /* * There is only one sensor per package. */ sc->sc_ntemps = 1; @@ -413,7 +430,7 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) { struct amdtemp_softc *sc = device_get_softc(dev); - uint32_t temp; + uint32_t mask, temp; int32_t diode_offset, offset; uint8_t cfg, sel; @@ -425,7 +442,7 @@ /* FALLTHROUGH */ case SENSOR0_CORE0: case CORE0: - if (sc->sc_swap) + if ((sc->sc_flags & AMDTEMP_FLAG_CSWAP) != 0) sel |= AMDTEMP_TTSR_SELCORE; break; case SENSOR1_CORE1: @@ -433,7 +450,7 @@ /* FALLTHROUGH */ case SENSOR0_CORE1: case CORE1: - if (!sc->sc_swap) + if ((sc->sc_flags & AMDTEMP_FLAG_CSWAP) == 0) sel |= AMDTEMP_TTSR_SELCORE; break; } @@ -447,10 +464,19 @@ /* Adjust offset if DiodeOffset is set and valid. */ temp = pci_read_config(dev, AMDTEMP_THERMTP_STAT, 4); diode_offset = (temp >> 8) & 0x3f; - if (diode_offset != 0) + if ((sc->sc_flags & AMDTEMP_FLAG_DO_ZERO) != 0) { + if ((sc->sc_flags & AMDTEMP_FLAG_DO_SIGN) != 0 && + ((temp >> 24) & 0x1) != 0) + diode_offset *= -1; + if ((sc->sc_flags & AMDTEMP_FLAG_DO_QUIRK) != 0 && + ((temp >> 25) & 0xf) <= 2) + diode_offset += 10; + offset += diode_offset * 10; + } else if (diode_offset != 0) offset += (diode_offset - 11) * 10; - temp = ((temp & sc->sc_mask) >> 14) * 5 / 2 + offset; + mask = (sc->sc_flags & AMDTEMP_FLAG_10BIT) != 0 ? 0x3ff : 0x3fc; + temp = ((temp >> 14) & mask) * 5 / 2 + offset; return (temp); } @@ -458,7 +484,6 @@ static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor) { - struct amdtemp_softc *sc = device_get_softc(dev); uint32_t temp; int32_t diode_offset, offset; @@ -472,7 +497,7 @@ offset += (diode_offset - 11) * 10; temp = pci_read_config(dev, AMDTEMP_REPTMP_CTRL, 4); - temp = ((temp & sc->sc_mask) >> 21) * 5 / 4 + offset; + temp = ((temp >> 21) & 0x7ff) * 5 / 4 + offset; return (temp); } --Boundary-00=_VLqrKhZyAMGWxDj-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 20:13:31 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 647C2106566B; Mon, 14 Sep 2009 20:13:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kris Kennaway Date: Mon, 14 Sep 2009 16:13:09 -0400 User-Agent: KMail/1.6.2 References: <200909112147.n8BLlind064388@svn.freebsd.org> <200909141238.23995.jkim@FreeBSD.org> <200909141608.53244.jkim@FreeBSD.org> In-Reply-To: <200909141608.53244.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200909141613.19957.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197102 - head/sys/dev/amdtemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 20:13:31 -0000 On Monday 14 September 2009 04:08 pm, Jung-uk Kim wrote: > Please try the attached patch. I tried to implement all the quirks > in Revision Guide carefully but I must admit that I haven't tried > it on anything earlier than Revision F. This patch has one typo: + /* + * Errata #154: Incorect Diode Offset + */ + if (cpu_id == 0x20f32) { + do_cpuid(0x80000001, regs); + if ((regs[1] && 0xfff) == 0x2c) ^^ & + sc->sc_flags |= AMDTEMP_FLAG_DO_QUIRK; + } Today is not my day. :-( Sorry again, Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 21:08:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF2F106566B; Mon, 14 Sep 2009 21:08:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913B68FC18; Mon, 14 Sep 2009 21:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EL8MIb066387; Mon, 14 Sep 2009 21:08:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EL8MRW066384; Mon, 14 Sep 2009 21:08:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909142108.n8EL8MRW066384@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Sep 2009 21:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197200 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 21:08:22 -0000 Author: pjd Date: Mon Sep 14 21:08:22 2009 New Revision: 197200 URL: http://svn.freebsd.org/changeset/base/197200 Log: Modify mount(8) to skip MNT_IGNORE file systems by default, just like df(1) does. This is not POLA violation, because there is no single file system in the base that use MNT_IGNORE currently, although ZFS snapshots will be mounted with MNT_IGNORE after next commit. Reviewed by: kib MFC after: 3 days Modified: head/sbin/mount/mount.8 head/sbin/mount/mount.c Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Mon Sep 14 17:49:59 2009 (r197199) +++ head/sbin/mount/mount.8 Mon Sep 14 21:08:22 2009 (r197200) @@ -469,6 +469,12 @@ or option. .It Fl v Verbose mode. +If the +.Fl v +is used alone, show all file systems, including those that were mounted with the +.Dv MNT_IGNORE +flag and show additional information about each file system (including fsid +when run by root). .It Fl w The file system object is to be read and write. .El Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Mon Sep 14 17:49:59 2009 (r197199) +++ head/sbin/mount/mount.c Mon Sep 14 21:08:22 2009 (r197200) @@ -348,6 +348,9 @@ main(int argc, char *argv[]) if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; + if (!verbose && + (mntbuf[i].f_flags & MNT_IGNORE) != 0) + continue; prmount(&mntbuf[i]); } } From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 21:10:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 929881065670; Mon, 14 Sep 2009 21:10:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 815B18FC18; Mon, 14 Sep 2009 21:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ELAeuD066475; Mon, 14 Sep 2009 21:10:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8ELAeqe066470; Mon, 14 Sep 2009 21:10:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909142110.n8ELAeqe066470@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Sep 2009 21:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197201 - in head: . sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 21:10:40 -0000 Author: pjd Date: Mon Sep 14 21:10:40 2009 New Revision: 197201 URL: http://svn.freebsd.org/changeset/base/197201 Log: - Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows ZFS route of not listing snapshots by default with 'zfs list' command. - Add UPDATING entry to note that ZFS snapshots are no longer visible in mount(8) and df(1) output by default. Reviewed by: kib MFC after: 3 days Modified: head/UPDATING head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c head/sys/cddl/compat/opensolaris/sys/vfs.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Sep 14 21:08:22 2009 (r197200) +++ head/UPDATING Mon Sep 14 21:10:40 2009 (r197201) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090910: + ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for + mount(8) and -a option for df(1) to see them. + 20090825: The old tunable hw.bus.devctl_disable has been superseded by hw.bus.devctl_queue. hw.bus.devctl_disable=1 in loader.conf should be Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon Sep 14 21:08:22 2009 (r197200) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon Sep 14 21:10:40 2009 (r197201) @@ -112,12 +112,13 @@ vfs_optionisset(const vfs_t *vfsp, const } int -domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, +mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, char *fspec, int fsflags) { struct mount *mp; struct vfsconf *vfsp; struct ucred *cr; + vnode_t *vp; int error; /* @@ -132,23 +133,28 @@ domount(kthread_t *td, vnode_t *vp, cons if (vfsp == NULL) return (ENODEV); + vp = *vpp; if (vp->v_type != VDIR) return (ENOTDIR); + /* + * We need vnode lock to protect v_mountedhere and vnode interlock + * to protect v_iflag. + */ + vn_lock(vp, LK_SHARED | LK_RETRY); VI_LOCK(vp); - if ((vp->v_iflag & VI_MOUNT) != 0 || - vp->v_mountedhere != NULL) { + if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) { VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0); return (EBUSY); } vp->v_iflag |= VI_MOUNT; VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0); /* * Allocate and initialize the filesystem. */ - vn_lock(vp, LK_SHARED | LK_RETRY); mp = vfs_mount_alloc(vp, vfsp, fspath, td->td_ucred); - VOP_UNLOCK(vp, 0); mp->mnt_optnew = NULL; vfs_setmntopt(mp, "from", fspec, 0); @@ -158,11 +164,18 @@ domount(kthread_t *td, vnode_t *vp, cons /* * Set the mount level flags. */ - if (fsflags & MNT_RDONLY) - mp->mnt_flag |= MNT_RDONLY; - mp->mnt_flag &=~ MNT_UPDATEMASK; + mp->mnt_flag &= ~MNT_UPDATEMASK; mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS); /* + * Snapshots are always read-only. + */ + mp->mnt_flag |= MNT_RDONLY; + /* + * We don't want snapshots to be visible in regular + * mount(8) and df(1) output. + */ + mp->mnt_flag |= MNT_IGNORE; + /* * Unprivileged user can trigger mounting a snapshot, but we don't want * him to unmount it, so we switch to privileged of original mount. */ @@ -170,11 +183,6 @@ domount(kthread_t *td, vnode_t *vp, cons mp->mnt_cred = crdup(vp->v_mount->mnt_cred); mp->mnt_stat.f_owner = mp->mnt_cred->cr_uid; /* - * Mount the filesystem. - * XXX The final recipients of VFS_MOUNT just overwrite the ndp they - * get. No freeing of cn_pnbuf. - */ - /* * XXX: This is evil, but we can't mount a snapshot as a regular user. * XXX: Is is safe when snapshot is mounted from within a jail? */ @@ -183,7 +191,7 @@ domount(kthread_t *td, vnode_t *vp, cons error = VFS_MOUNT(mp); td->td_ucred = cr; - if (!error) { + if (error == 0) { if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; @@ -195,42 +203,33 @@ domount(kthread_t *td, vnode_t *vp, cons */ mp->mnt_optnew = NULL; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - /* - * Put the new filesystem on the mount list after root. - */ #ifdef FREEBSD_NAMECACHE cache_purge(vp); #endif - if (!error) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); + if (error == 0) { vnode_t *mvp; - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); vp->v_mountedhere = mp; + /* + * Put the new filesystem on the mount list. + */ mtx_lock(&mountlist_mtx); TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); mtx_unlock(&mountlist_mtx); vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp)) panic("mount: lost mount"); - mountcheckdirs(vp, mvp); - vput(mvp); - VOP_UNLOCK(vp, 0); - if ((mp->mnt_flag & MNT_RDONLY) == 0) - error = vfs_allocate_syncvnode(mp); + vput(vp); vfs_unbusy(mp); - if (error) - vrele(vp); - else - vfs_mountedfrom(mp, fspec); + *vpp = mvp; } else { - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); - VOP_UNLOCK(vp, 0); + vput(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); + *vpp = NULL; } return (error); } Modified: head/sys/cddl/compat/opensolaris/sys/vfs.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vfs.h Mon Sep 14 21:08:22 2009 (r197200) +++ head/sys/cddl/compat/opensolaris/sys/vfs.h Mon Sep 14 21:10:40 2009 (r197201) @@ -110,8 +110,8 @@ void vfs_setmntopt(vfs_t *vfsp, const ch int flags __unused); void vfs_clearmntopt(vfs_t *vfsp, const char *name); int vfs_optionisset(const vfs_t *vfsp, const char *opt, char **argp); -int domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, - char *fspec, int fsflags); +int mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, + char *fspath, char *fspec, int fsflags); typedef uint64_t vfs_feature_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Sep 14 21:08:22 2009 (r197200) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Sep 14 21:10:40 2009 (r197201) @@ -880,17 +880,9 @@ domount: mountpoint = kmem_alloc(mountpoint_len, KM_SLEEP); (void) snprintf(mountpoint, mountpoint_len, "%s/.zfs/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, nm); - err = domount(curthread, *vpp, "zfs", mountpoint, snapname, 0); + err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); if (err == 0) { - vnode_t *mvp; - - ASSERT((*vpp)->v_mountedhere != NULL); - err = VFS_ROOT((*vpp)->v_mountedhere, LK_EXCLUSIVE, &mvp); - ASSERT(err == 0); - VN_RELE(*vpp); - *vpp = mvp; - /* * Fix up the root vnode mounted on .zfs/snapshot/. * @@ -902,14 +894,6 @@ domount: VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; } mutex_exit(&sdp->sd_lock); - /* - * If we had an error, drop our hold on the vnode and - * zfsctl_snapshot_inactive() will clean up. - */ - if (err) { - VN_RELE(*vpp); - *vpp = NULL; - } ZFS_EXIT(zfsvfs); return (err); } From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 21:33:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D209106568D; Mon, 14 Sep 2009 21:33:00 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC428FC0A; Mon, 14 Sep 2009 21:33:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ELX0FS066919; Mon, 14 Sep 2009 21:33:00 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8ELX0QT066917; Mon, 14 Sep 2009 21:33:00 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909142133.n8ELX0QT066917@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Sep 2009 21:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197202 - head/sys/dev/asmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 21:33:00 -0000 Author: rpaulo Date: Mon Sep 14 21:33:00 2009 New Revision: 197202 URL: http://svn.freebsd.org/changeset/base/197202 Log: Use %zu for size_t. Fix printf format string (again) Pointed out by: bde, ed Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Sep 14 21:10:40 2009 (r197201) +++ head/sys/dev/asmc/asmc.c Mon Sep 14 21:33:00 2009 (r197202) @@ -823,8 +823,9 @@ out: type[0] = ' '; type[5] = 0; if (maxlen > sizeof(v)) { - device_printf(dev, "WARNING: cropping maxlen " - "from %u to %lu\n", maxlen, sizeof(v)); + device_printf(dev, + "WARNING: cropping maxlen from %d to %zu\n", + maxlen, sizeof(v)); maxlen = sizeof(v); } for (i = 0; i < sizeof(v); i++) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 22:19:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78C9F106568D; Mon, 14 Sep 2009 22:19:47 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68BF08FC13; Mon, 14 Sep 2009 22:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EMJl1F067919; Mon, 14 Sep 2009 22:19:47 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EMJl36067917; Mon, 14 Sep 2009 22:19:47 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909142219.n8EMJl36067917@svn.freebsd.org> From: Qing Li Date: Mon, 14 Sep 2009 22:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197203 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 22:19:47 -0000 Author: qingli Date: Mon Sep 14 22:19:47 2009 New Revision: 197203 URL: http://svn.freebsd.org/changeset/base/197203 Log: Previously local end of point-to-point interface is not reachable within the system that owns the interface. Packets destined to the local end point leak to the wire towards the default gateway if one exists. This behavior is changed as part of the L2/L3 rewrite efforts. The local end point is now reachable within the system. The inpcb code needs to consider this fact during the address selection process. Reviewed by: bz MFC after: immediately Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Sep 14 21:33:00 2009 (r197202) +++ head/sys/netinet/in_pcb.c Mon Sep 14 22:19:47 2009 (r197203) @@ -701,6 +701,8 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); if (ia == NULL) ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); + if (ia == NULL) + ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); if (cred == NULL || !prison_flag(cred, PR_IP4)) { if (ia == NULL) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 23:08:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77157106566B; Mon, 14 Sep 2009 23:08:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65CCC8FC19; Mon, 14 Sep 2009 23:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8EN8JiE068868; Mon, 14 Sep 2009 23:08:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EN8JxA068866; Mon, 14 Sep 2009 23:08:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909142308.n8EN8JxA068866@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Sep 2009 23:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197205 - head/sys/dev/amdtemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 23:08:19 -0000 Author: jkim Date: Mon Sep 14 23:08:19 2009 New Revision: 197205 URL: http://svn.freebsd.org/changeset/base/197205 Log: Restore (undocumented) support for early revisions and add more comments. Reported by: kris Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Mon Sep 14 22:49:48 2009 (r197204) +++ head/sys/dev/amdtemp/amdtemp.c Mon Sep 14 23:08:19 2009 (r197205) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -58,10 +59,14 @@ typedef enum { struct amdtemp_softc { device_t sc_dev; - uint32_t sc_mask; int sc_ncores; int sc_ntemps; - int sc_swap; + int sc_flags; +#define AMDTEMP_FLAG_DO_QUIRK 0x01 /* DiodeOffset may be incorrect. */ +#define AMDTEMP_FLAG_DO_ZERO 0x02 /* DiodeOffset starts from 0C. */ +#define AMDTEMP_FLAG_DO_SIGN 0x04 /* DiodeOffsetSignBit is present. */ +#define AMDTEMP_FLAG_CS_SWAP 0x08 /* ThermSenseCoreSel is inverted. */ +#define AMDTEMP_FLAG_CT_10BIT 0x10 /* CurTmp is 10-bit wide. */ int32_t (*sc_gettemp)(device_t, amdsensor_t); struct sysctl_oid *sc_sysctl_cpu[MAXCPU]; struct intr_config_hook sc_ich; @@ -168,30 +173,22 @@ amdtemp_identify(driver_t *driver, devic static int amdtemp_probe(device_t dev) { - uint32_t cpuid, family, model, temp; + uint32_t family, model; if (resource_disabled("amdtemp", 0)) return (ENXIO); - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); - family = CPUID_TO_FAMILY(cpuid); - model = CPUID_TO_MODEL(cpuid); + family = CPUID_TO_FAMILY(cpu_id); + model = CPUID_TO_MODEL(cpu_id); switch (family) { case 0x0f: - if ((model == 0x04 && (cpuid & CPUID_STEPPING) == 0) || - (model == 0x05 && (cpuid & CPUID_STEPPING) <= 1)) + if ((model == 0x04 && (cpu_id & CPUID_STEPPING) == 0) || + (model == 0x05 && (cpu_id & CPUID_STEPPING) <= 1)) return (ENXIO); break; case 0x10: case 0x11: - /* - * DiodeOffset must be non-zero if thermal diode is supported. - */ - temp = pci_read_config(dev, AMDTEMP_THERMTP_STAT, 4); - temp = (temp >> 8) & 0x7f; - if (temp == 0) - return (ENXIO); break; default: return (ENXIO); @@ -207,32 +204,66 @@ amdtemp_attach(device_t dev) struct amdtemp_softc *sc = device_get_softc(dev); struct sysctl_ctx_list *sysctlctx; struct sysctl_oid *sysctlnode; + uint32_t regs[4]; uint32_t cpuid, family, model; - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); - family = CPUID_TO_FAMILY(cpuid); - model = CPUID_TO_MODEL(cpuid); + /* + * Errata #154: Incorect Diode Offset + */ + if (cpu_id == 0x20f32) { + do_cpuid(0x80000001, regs); + if ((regs[1] & 0xfff) == 0x2c) + sc->sc_flags |= AMDTEMP_FLAG_DO_QUIRK; + } + + /* + * CPUID Register is available from Revision F. + */ + family = CPUID_TO_FAMILY(cpu_id); + model = CPUID_TO_MODEL(cpu_id); + if (family != 0x0f || model >= 0x40) { + cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); + family = CPUID_TO_FAMILY(cpuid); + model = CPUID_TO_MODEL(cpuid); + } switch (family) { case 0x0f: /* - * Thermaltrip Status Register - CurTmp + * Thermaltrip Status Register + * + * - DiodeOffsetSignBit + * + * Revision D & E: bit 24 + * Other: N/A + * + * - ThermSenseCoreSel + * + * Revision F & G: 0 - Core1, 1 - Core0 + * Other: 0 - Core0, 1 - Core1 + * + * - CurTmp * * Revision G: bits 23-14 - * Earlier: bits 23-16 - */ - if (model >= 0x60 && model != 0xc1) - sc->sc_mask = 0x3ff << 14; - else - sc->sc_mask = 0xff << 16; - - /* - * Thermaltrip Status Register - ThermSenseCoreSel + * Other: bits 23-16 * - * Revision F: 0 - Core1, 1 - Core0 - * Earlier: 0 - Core0, 1 - Core1 + * XXX According to the BKDG, CurTmp, ThermSenseSel and + * ThermSenseCoreSel bits were introduced in Revision F + * but CurTmp seems working fine as early as Revision C. + * However, it is not clear whether ThermSenseSel and/or + * ThermSenseCoreSel work in undocumented cases as well. + * In fact, the Linux driver suggests it may not work but + * we just assume it does until we find otherwise. */ - sc->sc_swap = (model >= 0x40); + if (model < 0x40) { + sc->sc_flags |= AMDTEMP_FLAG_DO_ZERO; + if (model >= 0x10) + sc->sc_flags |= AMDTEMP_FLAG_DO_SIGN; + } else { + sc->sc_flags |= AMDTEMP_FLAG_CS_SWAP; + if (model >= 0x60 && model != 0xc1) + sc->sc_flags |= AMDTEMP_FLAG_CT_10BIT; + } /* * There are two sensors per core. @@ -244,11 +275,6 @@ amdtemp_attach(device_t dev) case 0x10: case 0x11: /* - * Reported Temperature Control Register - Curtmp - */ - sc->sc_mask = 0x3ff << 21; - - /* * There is only one sensor per package. */ sc->sc_ntemps = 1; @@ -413,7 +439,7 @@ static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) { struct amdtemp_softc *sc = device_get_softc(dev); - uint32_t temp; + uint32_t mask, temp; int32_t diode_offset, offset; uint8_t cfg, sel; @@ -425,7 +451,7 @@ amdtemp_gettemp0f(device_t dev, amdsenso /* FALLTHROUGH */ case SENSOR0_CORE0: case CORE0: - if (sc->sc_swap) + if ((sc->sc_flags & AMDTEMP_FLAG_CS_SWAP) != 0) sel |= AMDTEMP_TTSR_SELCORE; break; case SENSOR1_CORE1: @@ -433,7 +459,7 @@ amdtemp_gettemp0f(device_t dev, amdsenso /* FALLTHROUGH */ case SENSOR0_CORE1: case CORE1: - if (!sc->sc_swap) + if ((sc->sc_flags & AMDTEMP_FLAG_CS_SWAP) == 0) sel |= AMDTEMP_TTSR_SELCORE; break; } @@ -447,10 +473,19 @@ amdtemp_gettemp0f(device_t dev, amdsenso /* Adjust offset if DiodeOffset is set and valid. */ temp = pci_read_config(dev, AMDTEMP_THERMTP_STAT, 4); diode_offset = (temp >> 8) & 0x3f; - if (diode_offset != 0) + if ((sc->sc_flags & AMDTEMP_FLAG_DO_ZERO) != 0) { + if ((sc->sc_flags & AMDTEMP_FLAG_DO_SIGN) != 0 && + ((temp >> 24) & 0x1) != 0) + diode_offset *= -1; + if ((sc->sc_flags & AMDTEMP_FLAG_DO_QUIRK) != 0 && + ((temp >> 25) & 0xf) <= 2) + diode_offset += 10; + offset += diode_offset * 10; + } else if (diode_offset != 0) offset += (diode_offset - 11) * 10; - temp = ((temp & sc->sc_mask) >> 14) * 5 / 2 + offset; + mask = (sc->sc_flags & AMDTEMP_FLAG_CT_10BIT) != 0 ? 0x3ff : 0x3fc; + temp = ((temp >> 14) & mask) * 5 / 2 + offset; return (temp); } @@ -458,7 +493,6 @@ amdtemp_gettemp0f(device_t dev, amdsenso static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor) { - struct amdtemp_softc *sc = device_get_softc(dev); uint32_t temp; int32_t diode_offset, offset; @@ -472,7 +506,7 @@ amdtemp_gettemp(device_t dev, amdsensor_ offset += (diode_offset - 11) * 10; temp = pci_read_config(dev, AMDTEMP_REPTMP_CTRL, 4); - temp = ((temp & sc->sc_mask) >> 21) * 5 / 4 + offset; + temp = ((temp >> 21) & 0x7ff) * 5 / 4 + offset; return (temp); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 00:15:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2B36106566B; Tue, 15 Sep 2009 00:15:24 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12568FC14; Tue, 15 Sep 2009 00:15:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8F0FO8J070319; Tue, 15 Sep 2009 00:15:24 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8F0FO1p070317; Tue, 15 Sep 2009 00:15:24 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <200909150015.n8F0FO1p070317@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 15 Sep 2009 00:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197208 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 00:15:24 -0000 Author: ken Date: Tue Sep 15 00:15:24 2009 New Revision: 197208 URL: http://svn.freebsd.org/changeset/base/197208 Log: Fix some instances where CAM rescans get hung up or take a long time to complete. Also, allow xpt_rescan() to rescan a LUN instead of a full bus. MFC after: 3 days Sponsored by: Copan Systems, Inc. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Sep 14 23:46:40 2009 (r197207) +++ head/sys/cam/cam_xpt.c Tue Sep 15 00:15:24 2009 (r197208) @@ -794,8 +794,9 @@ xpt_scanner_thread(void *dummy) * processed. */ xpt_lock_buses(); - msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, - "ccb_scanq", 0); + if (TAILQ_EMPTY(&xsoftc.ccb_scanq)) + msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, + "ccb_scanq", 0); TAILQ_INIT(&queue); TAILQ_CONCAT(&queue, &xsoftc.ccb_scanq, sim_links.tqe); xpt_unlock_buses(); @@ -806,9 +807,12 @@ xpt_scanner_thread(void *dummy) sim = ccb->ccb_h.path->bus->sim; CAM_SIM_LOCK(sim); - ccb->ccb_h.func_code = XPT_SCAN_BUS; + if( ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD ) + ccb->ccb_h.func_code = XPT_SCAN_BUS; + else + ccb->ccb_h.func_code = XPT_SCAN_LUN; ccb->ccb_h.cbfcnp = xptdone; - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 5); + xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 1); cam_periph_runccb(ccb, NULL, 0, 0, NULL); xpt_free_path(ccb->ccb_h.path); xpt_free_ccb(ccb); @@ -828,6 +832,7 @@ xpt_rescan(union ccb *ccb) xpt_lock_buses(); TAILQ_FOREACH(hdr, &xsoftc.ccb_scanq, sim_links.tqe) { if (xpt_path_comp(hdr->path, ccb->ccb_h.path) == 0) { + wakeup(&xsoftc.ccb_scanq); xpt_unlock_buses(); xpt_print(ccb->ccb_h.path, "rescan already queued\n"); xpt_free_path(ccb->ccb_h.path); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 01:01:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A372B106566B; Tue, 15 Sep 2009 01:01:03 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 779CE8FC1B; Tue, 15 Sep 2009 01:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8F113IF071314; Tue, 15 Sep 2009 01:01:03 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8F113sU071311; Tue, 15 Sep 2009 01:01:03 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909150101.n8F113sU071311@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 01:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197210 - in head/sys: netinet nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 01:01:03 -0000 Author: qingli Date: Tue Sep 15 01:01:03 2009 New Revision: 197210 URL: http://svn.freebsd.org/changeset/base/197210 Log: The bootp code installs an interface address and the nfs client module tries to install the same address again. This extra code is removed, which was discovered by the removal of a call to in_ifscrub() in r196714. This call to in_ifscrub is put back here because the SIOCAIFADDR command can be used to change the prefix length of an existing alias. Reviewed by: kmacy Modified: head/sys/netinet/in.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Sep 15 00:26:23 2009 (r197209) +++ head/sys/netinet/in.c Tue Sep 15 01:01:03 2009 (r197210) @@ -536,6 +536,16 @@ in_control(struct socket *so, u_long cmd hostIsNew = 0; } if (ifra->ifra_mask.sin_len) { + /* + * QL: XXX + * Need to scrub the prefix here in case + * the issued command is SIOCAIFADDR with + * the same address, but with a different + * prefix length. And if the prefix length + * is the same as before, then the call is + * un-necessarily executed here. + */ + in_ifscrub(ifp, ia); ia->ia_sockmask = ifra->ifra_mask; ia->ia_sockmask.sin_family = AF_INET; ia->ia_subnetmask = @@ -544,6 +554,7 @@ in_control(struct socket *so, u_long cmd } if ((ifp->if_flags & IFF_POINTOPOINT) && (ifra->ifra_dstaddr.sin_family == AF_INET)) { + in_ifscrub(ifp, ia); ia->ia_dstaddr = ifra->ifra_dstaddr; maskIsNew = 1; /* We lie; but the effect's the same */ } Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 00:26:23 2009 (r197209) +++ head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 01:01:03 2009 (r197210) @@ -463,9 +463,13 @@ nfs_mountroot(struct mount *mp) break; } #endif + +#if 0 /* QL: XXX */ error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); if (error) panic("nfs_mountroot: SIOCAIFADDR: %d", error); +#endif + if ((cp = getenv("boot.netif.mtu")) != NULL) { ir.ifr_mtu = strtol(cp, NULL, 10); bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 02:22:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C331065672; Tue, 15 Sep 2009 02:22:57 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 681B88FC12; Tue, 15 Sep 2009 02:22:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8F2MvXB073004; Tue, 15 Sep 2009 02:22:57 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8F2Mvo0073002; Tue, 15 Sep 2009 02:22:57 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909150222.n8F2Mvo0073002@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 02:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197212 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 02:22:57 -0000 Author: qingli Date: Tue Sep 15 02:22:57 2009 New Revision: 197212 URL: http://svn.freebsd.org/changeset/base/197212 Log: Simply remove the code instead of using "#if 0". Pointed out by sam Modified: head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 02:04:16 2009 (r197211) +++ head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 02:22:57 2009 (r197212) @@ -464,12 +464,6 @@ nfs_mountroot(struct mount *mp) } #endif -#if 0 /* QL: XXX */ - error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); - if (error) - panic("nfs_mountroot: SIOCAIFADDR: %d", error); -#endif - if ((cp = getenv("boot.netif.mtu")) != NULL) { ir.ifr_mtu = strtol(cp, NULL, 10); bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 02:23:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ADB6106566C; Tue, 15 Sep 2009 02:23:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC97A8FC12; Tue, 15 Sep 2009 02:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8F2NGBi073049; Tue, 15 Sep 2009 02:23:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8F2NGeu073047; Tue, 15 Sep 2009 02:23:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909150223.n8F2NGeu073047@svn.freebsd.org> From: Ed Maste Date: Tue, 15 Sep 2009 02:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197213 - stable/7/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 02:23:17 -0000 Author: emaste Date: Tue Sep 15 02:23:16 2009 New Revision: 197213 URL: http://svn.freebsd.org/changeset/base/197213 Log: MFC r195685: Fix leaks in probestart, probedone, and scsi_scan_bus. Also free page_list using the matching malloc type for the allocation. (In HEAD these functions have moved to scsi_xpt.c) Reviewed by: scottl Modified: stable/7/sys/cam/cam_xpt.c Modified: stable/7/sys/cam/cam_xpt.c ============================================================================== --- stable/7/sys/cam/cam_xpt.c Tue Sep 15 02:22:57 2009 (r197212) +++ stable/7/sys/cam/cam_xpt.c Tue Sep 15 02:23:16 2009 (r197213) @@ -5240,6 +5240,7 @@ xpt_scan_bus(struct cam_periph *periph, } work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { + xpt_free_ccb((union ccb *)scan_info->cpi); free(scan_info, M_CAMXPT); xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -5360,6 +5361,7 @@ xpt_scan_bus(struct cam_periph *periph, } if ((scan_info->cpi->hba_misc & PIM_SEQSCAN) == 0) { + xpt_free_ccb(request_ccb); break; } status = xpt_create_path(&path, xpt_periph, @@ -5828,8 +5830,11 @@ probestart(struct cam_periph *periph, un serial_buf = NULL; device = periph->path->device; - device->serial_num = NULL; - device->serial_num_len = 0; + if (device->serial_num != NULL) { + free(device->serial_num, M_CAMXPT); + device->serial_num = NULL; + device->serial_num_len = 0; + } serial_buf = (struct scsi_vpd_unit_serial_number *) malloc(sizeof(*serial_buf), M_CAMXPT, M_NOWAIT|M_ZERO); @@ -6168,7 +6173,7 @@ probedone(struct cam_periph *periph, uni } if (page_list != NULL) - free(page_list, M_DEVBUF); + free(page_list, M_CAMXPT); if (serialnum_supported) { xpt_release_ccb(done_ccb); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 02:25:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4027D106566B; Tue, 15 Sep 2009 02:25:04 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 236448FC08; Tue, 15 Sep 2009 02:25:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8F2P4su073126; Tue, 15 Sep 2009 02:25:04 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8F2P3HG073123; Tue, 15 Sep 2009 02:25:03 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200909150225.n8F2P3HG073123@svn.freebsd.org> From: Matt Jacob Date: Tue, 15 Sep 2009 02:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197214 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 02:25:04 -0000 Author: mjacob Date: Tue Sep 15 02:25:03 2009 New Revision: 197214 URL: http://svn.freebsd.org/changeset/base/197214 Log: Accomodate old style XPT_IMMED_NOTIFY and XPT_NOTIFY_ACK so that we at least don't panic. We don't really support dual role mode (INITIATOR/TARGET) any more. We should but it's broken and will take a fair amount of effort to fix and correctly manage both initiator and target roles sharing the port database. So, for now, disallow it. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Sep 15 02:23:16 2009 (r197213) +++ head/sys/dev/isp/isp.c Tue Sep 15 02:25:03 2009 (r197214) @@ -2771,21 +2771,15 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) /* * Make sure we're okay for doing this right now. */ - if (fcp->isp_loopstate != LOOP_PDB_RCVD && - fcp->isp_loopstate != LOOP_FSCAN_DONE && - fcp->isp_loopstate != LOOP_LSCAN_DONE) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", - fcp->isp_loopstate); + if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", fcp->isp_loopstate); return (-1); } - if (fcp->isp_topo == TOPO_FL_PORT || - fcp->isp_topo == TOPO_NL_PORT || - fcp->isp_topo == TOPO_N_PORT) { + if (fcp->isp_topo == TOPO_FL_PORT || fcp->isp_topo == TOPO_NL_PORT || fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, - "isp_pdb_sync: isp_scan_loop failed"); + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2794,15 +2788,13 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, - "isp_pdb_sync: isp_scan_fabric failed"); + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2831,11 +2823,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); if (lp->autologin == 0) { - (void) isp_plogx(isp, chan, lp->handle, - lp->portid, - PLOGX_FLG_CMD_LOGO | - PLOGX_FLG_IMPLICIT | - PLOGX_FLG_FREE_NPHDL, 0); + (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 0); } else { lp->autologin = 0; } @@ -3081,8 +3069,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || - lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3600,8 +3587,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || - lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3838,8 +3824,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && - fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { break; } } Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Sep 15 02:23:16 2009 (r197213) +++ head/sys/dev/isp/isp_freebsd.c Tue Sep 15 02:25:03 2009 (r197214) @@ -343,6 +343,17 @@ ispioctl(struct cdev *dev, u_long c, cad break; } if (IS_FC(isp)) { + /* + * We don't really support dual role at present on FC cards. + * + * We should, but a bunch of things are currently broken, + * so don't allow it. + */ + if (nr == ISP_ROLE_BOTH) { + isp_prt(isp, ISP_LOGERR, "cannot support dual role at present"); + retval = EINVAL; + break; + } *(int *)addr = FCPARAM(isp, chan)->role; #ifdef ISP_INTERNAL_TARGET ISP_LOCK(isp); @@ -2943,8 +2954,8 @@ isp_target_mark_aborted_early(ispsoftc_t #ifdef ISP_INTERNAL_TARGET // #define ISP_FORCE_TIMEOUT 1 -#define ISP_TEST_WWNS 1 -#define ISP_TEST_SEPARATE_STATUS 1 +// #define ISP_TEST_WWNS 1 +// #define ISP_TEST_SEPARATE_STATUS 1 #define ccb_data_offset ppriv_field0 #define ccb_atio ppriv_ptr1 @@ -4238,6 +4249,7 @@ isp_action(struct cam_sim *sim, union cc isp_disable_lun(isp, ccb); } break; + case XPT_IMMED_NOTIFY: case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ case XPT_ACCEPT_TARGET_IO: /* Add Accept Target IO Resource */ { @@ -4287,11 +4299,19 @@ isp_action(struct cam_sim *sim, union cc SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); + } else if (ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + tptr->inot_count++; + SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", + ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); } rls_lun_statep(isp, tptr); ccb->ccb_h.status = CAM_REQ_INPROG; break; } + case XPT_NOTIFY_ACK: + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + break; case XPT_NOTIFY_ACKNOWLEDGE: /* notify ack */ { tstate_t *tptr; @@ -4601,10 +4621,21 @@ isp_prt(isp, ISP_LOGALL, "Setting Channe } break; case KNOB_ROLE_BOTH: +#if 0 if (fcp->role != ISP_ROLE_BOTH) { rchange = 1; newrole = ISP_ROLE_BOTH; } +#else + /* + * We don't really support dual role at present on FC cards. + * + * We should, but a bunch of things are currently broken, + * so don't allow it. + */ + isp_prt(isp, ISP_LOGERR, "cannot support dual role at present"); + ccb->ccb_h.status = CAM_REQ_INVALID; +#endif break; } if (rchange) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 06:15:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 752931065670; Tue, 15 Sep 2009 06:15:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 2E10A8FC15; Tue, 15 Sep 2009 06:15:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id C080141C6A1; Tue, 15 Sep 2009 08:15:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id z8uP81bxBJiw; Tue, 15 Sep 2009 08:15:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 01EA641C69F; Tue, 15 Sep 2009 08:15:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 387D94448E6; Tue, 15 Sep 2009 06:11:17 +0000 (UTC) Date: Tue, 15 Sep 2009 06:11:16 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Qing Li In-Reply-To: <200909150222.n8F2Mvo0073002@svn.freebsd.org> Message-ID: <20090915061045.Q68375@maildrop.int.zabbadoz.net> References: <200909150222.n8F2Mvo0073002@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197212 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 06:15:08 -0000 On Tue, 15 Sep 2009, Qing Li wrote: > Author: qingli > Date: Tue Sep 15 02:22:57 2009 > New Revision: 197212 > URL: http://svn.freebsd.org/changeset/base/197212 > > Log: > Simply remove the code instead of using "#if 0". > > Pointed out by sam In this case the block just above that should probably removed as well? > Modified: > head/sys/nfsclient/nfs_vfsops.c > > Modified: head/sys/nfsclient/nfs_vfsops.c > ============================================================================== > --- head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 02:04:16 2009 (r197211) > +++ head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 02:22:57 2009 (r197212) > @@ -464,12 +464,6 @@ nfs_mountroot(struct mount *mp) > } > #endif > > -#if 0 /* QL: XXX */ > - error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); > - if (error) > - panic("nfs_mountroot: SIOCAIFADDR: %d", error); > -#endif > - > if ((cp = getenv("boot.netif.mtu")) != NULL) { > ir.ifr_mtu = strtol(cp, NULL, 10); > bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); > -- Bjoern A. Zeeb What was I talking about and who are you again? From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 11:13:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DC461065694; Tue, 15 Sep 2009 11:13:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379058FC17; Tue, 15 Sep 2009 11:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FBDf3u086196; Tue, 15 Sep 2009 11:13:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FBDeZ1086175; Tue, 15 Sep 2009 11:13:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151113.n8FBDeZ1086175@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 11:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197215 - in stable/8: . cddl/compat/opensolaris cddl/compat/opensolaris/include cddl/contrib/opensolaris cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/head cddl/contrib/ope... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 11:13:41 -0000 Author: pjd Date: Tue Sep 15 11:13:40 2009 New Revision: 197215 URL: http://svn.freebsd.org/changeset/base/197215 Log: MFC r196456,r196457,r196458,r196662,r196702,r196703,r196919,r196927,r196928, r196943,r196944,r196947,r196950,r196953,r196954,r196965,r196978,r196979, r196980,r196982,r196985,r196992,r197131,r197133,r197150,r197151,r197152, r197153,r197167,r197172,r197177,r197200,r197201: r196456: - Give minclsyspri and maxclsyspri real values (consulted with kmacy). - Honour 'pri' argument for thread_create(). r196457: Set priority of vdev_geom threads and zvol threads to PRIBIO. r196458: - Hide ZFS kernel threads under zfskern process. - Use better (shorter) threads names: 'zvol:worker zvol/tank/vol00' -> 'zvol tank/vol00' 'vdev:worker da0' -> 'vdev da0' r196662: Add missing mountpoint vnode locking. This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when regular user tries to mount dataset owned by him. r196702: Remove empty directory. r196703: Backport the 'dirtying dbuf' panic fix from newer ZFS version. Reported by: Thomas Backman r196919: bzero() on-stack argument, so mutex_init() won't misinterpret that the lock is already initialized if we have some garbage on the stack. PR: kern/135480 Reported by: Emil Mikulic r196927: Changing provider size is not really supported by GEOM, but doing so when provider is closed should be ok. When administrator requests to change ZVOL size do it immediately if ZVOL is closed or do it on last ZVOL close. PR: kern/136942 Requested by: Bernard Buri r196928: Teach zdb(8) how to obtain GEOM provider size. PR: kern/133134 Reported by: Philipp Wuensche r196943: - Avoid holding mutex around M_WAITOK allocations. - Add locking for mnt_opt field. r196944: Don't recheck ownership on update mount. This will eliminate LOR between vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway. Noticed by: kib Reviewed by: kib r196947: Defer thread start until we set priority. Reviewed by: kib r196950: Fix detection of file system being shared. Now zfs unshare/destroy/rename command will properly remove exported file systems. r196953: When snapshot mount point is busy (for example we are still in it) we will fail to unmount it, but it won't be removed from the tree, so in that case there is no need to reinsert it. Reported by: trasz r196954: If we have to use avl_find(), optimize a bit and use avl_insert() instead of avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()). Fix similar case in the code that is currently commented out. r196965: Fix reference count leak for a case where snapshot's mount point is updated. r196978: Call ZFS_EXIT() after locking the vnode. r196979: On FreeBSD we don't have to look for snapshot's mount point, because fhtovp method is already called with proper mount point. r196980: When we automatically mount snapshot we want to return vnode of the mount point from the lookup and not covered vnode. This is one of the fixes for using .zfs/ over NFS. r196982: We don't export individual snapshots, so mnt_export field in snapshot's mount point is NULL. That's why when we try to access snapshots over NFS use mnt_export field from the parent file system. r196985: Only log successful commands! Without this fix we log even unsuccessful commands executed by unprivileged users. Action is not really taken, but it is logged to pool history, which might be confusing. Reported by: Denis Ahrens r196992: Implement __assert() for Solaris-specific code. Until now Solaris code was using Solaris prototype for __assert(), but FreeBSD's implementation. Both take different arguments, so we were either core-dumping in assert() or printing garbage. Reported by: avg r197131: Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain NULL, but also can point to dead vnode, take that into account. PR: kern/132068 Reported by: Edward Fisk <7ogcg7g02@sneakemail.com>, kris Fix based on patch from: Jaakko Heinonen r197133: - Protect reclaim with z_teardown_inactive_lock. - Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if z_dbuf field is NULL - this might happen in case of rollback or forced unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete(). - On forced unmount wait for all znodes to be destroyed - destruction can be done asynchronously via zfs_reclaim_complete(). r197150: There is a bug where mze_insert() can trigger an assert() of inserting the same entry twice. This bug is not fixed yet, but leads to situation where when try to access corrupted directory the kernel will panic. Until the bug is properly fixed, try to recover from it and log that it happened. Reported by: marck OpenSolaris bug: 6709336 r197151: Be sure not to overflow struct fid. r197152: Extend scope of the z_teardown_lock lock for consistency and "just in case". r197153: When zfs.ko is compiled with debug, make sure that znode and vnode point at each other. r197167: Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories by just returning EOPNOTSUPP. This will allow NFS server to fall back to regular READDIR. Note that converting inode number to snapshot's vnode is expensive operation. Snapshots are stored in AVL tree, but based on their names, not inode numbers, so to convert inode to snapshot vnode we have to interate over all snalshots. This is not a problem in OpenSolaris, because in their READDIRPLUS implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on d_fileno as we do. PR: kern/125149 Reported by: Weldon Godfrey Analysis by: Jaakko Heinonen r197172: Add missing \n. Reported by: marck r197177: Support both case: when snapshot is already mounted and when it is not yet mounted. r197200: Modify mount(8) to skip MNT_IGNORE file systems by default, just like df(1) does. This is not POLA violation, because there is no single file system in the base that use MNT_IGNORE currently, although ZFS snapshots will be mounted with MNT_IGNORE after next commit. Reviewed by: kib r197201: - Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows ZFS route of not listing snapshots by default with 'zfs list' command. - Add UPDATING entry to note that ZFS snapshots are no longer visible in mount(8) and df(1) output by default. Reviewed by: kib Approved by: re (bz) Added: stable/8/cddl/compat/opensolaris/include/assert.h - copied unchanged from r196992, head/cddl/compat/opensolaris/include/assert.h Deleted: stable/8/cddl/contrib/opensolaris/head/assert.h stable/8/sys/cddl/contrib/opensolaris/uts/common/rpc/ Modified: stable/8/UPDATING stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/8/sbin/mount/ (props changed) stable/8/sbin/mount/mount.8 stable/8/sbin/mount/mount.c stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c stable/8/sys/cddl/compat/opensolaris/sys/mutex.h stable/8/sys/cddl/compat/opensolaris/sys/proc.h stable/8/sys/cddl/compat/opensolaris/sys/vfs.h stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/callb.h stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/UPDATING Tue Sep 15 11:13:40 2009 (r197215) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090915: + ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for + mount(8) and -a option for df(1) to see them. + 20090813: Remove the option STOP_NMI. The default action is now to use NMI only for KDB via the newly introduced function stop_cpus_hard() Copied: stable/8/cddl/compat/opensolaris/include/assert.h (from r196992, head/cddl/compat/opensolaris/include/assert.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/compat/opensolaris/include/assert.h Tue Sep 15 11:13:40 2009 (r197215, copy of r196992, head/cddl/compat/opensolaris/include/assert.h) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2009 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#undef assert +#undef _assert + +#ifdef NDEBUG +#define assert(e) ((void)0) +#define _assert(e) ((void)0) +#else +#define _assert(e) assert(e) + +#define assert(e) ((e) ? (void)0 : __assert(#e, __FILE__, __LINE__)) +#endif /* NDEBUG */ + +#ifndef _ASSERT_H_ +#define _ASSERT_H_ +#include +#include + +static __inline void +__assert(const char *expr, const char *file, int line) +{ + + (void)fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n", + expr, file, line); + abort(); + /* NOTREACHED */ +} +#endif /* !_ASSERT_H_ */ Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Sep 15 11:13:40 2009 (r197215) @@ -1322,6 +1322,14 @@ dump_label(const char *dev) exit(1); } + if (S_ISCHR(statbuf.st_mode)) { + if (ioctl(fd, DIOCGMEDIASIZE, &statbuf.st_size) == -1) { + (void) printf("failed to get size of '%s': %s\n", dev, + strerror(errno)); + exit(1); + } + } + psize = statbuf.st_size; psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t)); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue Sep 15 11:13:40 2009 (r197215) @@ -172,6 +172,7 @@ is_shared(libzfs_handle_t *hdl, const ch *tab = '\0'; if (strcmp(buf, mountpoint) == 0) { +#if defined(sun) /* * the protocol field is the third field * skip over second field @@ -194,6 +195,10 @@ is_shared(libzfs_handle_t *hdl, const ch return (0); } } +#else + if (proto == PROTO_NFS) + return (SHARED_NFS); +#endif } } Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sbin/mount/mount.8 Tue Sep 15 11:13:40 2009 (r197215) @@ -469,6 +469,12 @@ or option. .It Fl v Verbose mode. +If the +.Fl v +is used alone, show all file systems, including those that were mounted with the +.Dv MNT_IGNORE +flag and show additional information about each file system (including fsid +when run by root). .It Fl w The file system object is to be read and write. .El Modified: stable/8/sbin/mount/mount.c ============================================================================== --- stable/8/sbin/mount/mount.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sbin/mount/mount.c Tue Sep 15 11:13:40 2009 (r197215) @@ -348,6 +348,9 @@ main(int argc, char *argv[]) if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; + if (!verbose && + (mntbuf[i].f_flags & MNT_IGNORE) != 0) + continue; prmount(&mntbuf[i]); } } Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Tue Sep 15 11:13:40 2009 (r197215) @@ -45,20 +45,33 @@ vfs_setmntopt(vfs_t *vfsp, const char *n { struct vfsopt *opt; size_t namesize; + int locked; + + if (!(locked = mtx_owned(MNT_MTX(vfsp)))) + MNT_ILOCK(vfsp); if (vfsp->mnt_opt == NULL) { - vfsp->mnt_opt = malloc(sizeof(*vfsp->mnt_opt), M_MOUNT, M_WAITOK); - TAILQ_INIT(vfsp->mnt_opt); + void *opts; + + MNT_IUNLOCK(vfsp); + opts = malloc(sizeof(*vfsp->mnt_opt), M_MOUNT, M_WAITOK); + MNT_ILOCK(vfsp); + if (vfsp->mnt_opt == NULL) { + vfsp->mnt_opt = opts; + TAILQ_INIT(vfsp->mnt_opt); + } else { + free(opts, M_MOUNT); + } } - opt = malloc(sizeof(*opt), M_MOUNT, M_WAITOK); + MNT_IUNLOCK(vfsp); + opt = malloc(sizeof(*opt), M_MOUNT, M_WAITOK); namesize = strlen(name) + 1; opt->name = malloc(namesize, M_MOUNT, M_WAITOK); strlcpy(opt->name, name, namesize); opt->pos = -1; opt->seen = 1; - if (arg == NULL) { opt->value = NULL; opt->len = 0; @@ -67,16 +80,23 @@ vfs_setmntopt(vfs_t *vfsp, const char *n opt->value = malloc(opt->len, M_MOUNT, M_WAITOK); bcopy(arg, opt->value, opt->len); } - /* TODO: Locking. */ + + MNT_ILOCK(vfsp); TAILQ_INSERT_TAIL(vfsp->mnt_opt, opt, link); + if (!locked) + MNT_IUNLOCK(vfsp); } void vfs_clearmntopt(vfs_t *vfsp, const char *name) { + int locked; - /* TODO: Locking. */ + if (!(locked = mtx_owned(MNT_MTX(vfsp)))) + MNT_ILOCK(vfsp); vfs_deleteopt(vfsp->mnt_opt, name); + if (!locked) + MNT_IUNLOCK(vfsp); } int @@ -92,12 +112,13 @@ vfs_optionisset(const vfs_t *vfsp, const } int -domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, +mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, char *fspec, int fsflags) { struct mount *mp; struct vfsconf *vfsp; struct ucred *cr; + vnode_t *vp; int error; /* @@ -112,23 +133,28 @@ domount(kthread_t *td, vnode_t *vp, cons if (vfsp == NULL) return (ENODEV); + vp = *vpp; if (vp->v_type != VDIR) return (ENOTDIR); + /* + * We need vnode lock to protect v_mountedhere and vnode interlock + * to protect v_iflag. + */ + vn_lock(vp, LK_SHARED | LK_RETRY); VI_LOCK(vp); - if ((vp->v_iflag & VI_MOUNT) != 0 || - vp->v_mountedhere != NULL) { + if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) { VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0); return (EBUSY); } vp->v_iflag |= VI_MOUNT; VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0); /* * Allocate and initialize the filesystem. */ - vn_lock(vp, LK_SHARED | LK_RETRY); mp = vfs_mount_alloc(vp, vfsp, fspath, td->td_ucred); - VOP_UNLOCK(vp, 0); mp->mnt_optnew = NULL; vfs_setmntopt(mp, "from", fspec, 0); @@ -138,11 +164,18 @@ domount(kthread_t *td, vnode_t *vp, cons /* * Set the mount level flags. */ - if (fsflags & MNT_RDONLY) - mp->mnt_flag |= MNT_RDONLY; - mp->mnt_flag &=~ MNT_UPDATEMASK; + mp->mnt_flag &= ~MNT_UPDATEMASK; mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS); /* + * Snapshots are always read-only. + */ + mp->mnt_flag |= MNT_RDONLY; + /* + * We don't want snapshots to be visible in regular + * mount(8) and df(1) output. + */ + mp->mnt_flag |= MNT_IGNORE; + /* * Unprivileged user can trigger mounting a snapshot, but we don't want * him to unmount it, so we switch to privileged of original mount. */ @@ -150,11 +183,6 @@ domount(kthread_t *td, vnode_t *vp, cons mp->mnt_cred = crdup(vp->v_mount->mnt_cred); mp->mnt_stat.f_owner = mp->mnt_cred->cr_uid; /* - * Mount the filesystem. - * XXX The final recipients of VFS_MOUNT just overwrite the ndp they - * get. No freeing of cn_pnbuf. - */ - /* * XXX: This is evil, but we can't mount a snapshot as a regular user. * XXX: Is is safe when snapshot is mounted from within a jail? */ @@ -163,7 +191,7 @@ domount(kthread_t *td, vnode_t *vp, cons error = VFS_MOUNT(mp); td->td_ucred = cr; - if (!error) { + if (error == 0) { if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; @@ -175,42 +203,33 @@ domount(kthread_t *td, vnode_t *vp, cons */ mp->mnt_optnew = NULL; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - /* - * Put the new filesystem on the mount list after root. - */ #ifdef FREEBSD_NAMECACHE cache_purge(vp); #endif - if (!error) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); + if (error == 0) { vnode_t *mvp; - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); vp->v_mountedhere = mp; + /* + * Put the new filesystem on the mount list. + */ mtx_lock(&mountlist_mtx); TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); mtx_unlock(&mountlist_mtx); vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp)) panic("mount: lost mount"); - mountcheckdirs(vp, mvp); - vput(mvp); - VOP_UNLOCK(vp, 0); - if ((mp->mnt_flag & MNT_RDONLY) == 0) - error = vfs_allocate_syncvnode(mp); + vput(vp); vfs_unbusy(mp); - if (error) - vrele(vp); - else - vfs_mountedfrom(mp, fspec); + *vpp = mvp; } else { - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); - VOP_UNLOCK(vp, 0); + vput(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); + *vpp = NULL; } return (error); } Modified: stable/8/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/mutex.h Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/compat/opensolaris/sys/mutex.h Tue Sep 15 11:13:40 2009 (r197215) @@ -32,9 +32,9 @@ #ifdef _KERNEL #include -#include #include #include_next +#include #include typedef enum { Modified: stable/8/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/proc.h Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/compat/opensolaris/sys/proc.h Tue Sep 15 11:13:40 2009 (r197215) @@ -34,13 +34,17 @@ #include_next #include #include +#include +#include +#include +#include #include #ifdef _KERNEL #define CPU curcpu -#define minclsyspri 0 -#define maxclsyspri 0 +#define minclsyspri PRIBIO +#define maxclsyspri PVM #define max_ncpus mp_ncpus #define boot_max_ncpus mp_ncpus @@ -54,11 +58,13 @@ typedef struct thread kthread_t; typedef struct thread *kthread_id_t; typedef struct proc proc_t; +extern struct proc *zfsproc; + static __inline kthread_t * thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) { - proc_t *p; + kthread_t *td = NULL; int error; /* @@ -67,13 +73,20 @@ thread_create(caddr_t stk, size_t stksiz ASSERT(stk == NULL); ASSERT(len == 0); ASSERT(state == TS_RUN); + ASSERT(pp == &p0); - error = kproc_create(proc, arg, &p, 0, stksize / PAGE_SIZE, - "solthread %p", proc); - return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL); + error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, + stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); + if (error == 0) { + thread_lock(td); + sched_prio(td, pri); + sched_add(td, SRQ_BORING); + thread_unlock(td); + } + return (td); } -#define thread_exit() kproc_exit(0) +#define thread_exit() kthread_exit() #endif /* _KERNEL */ Modified: stable/8/sys/cddl/compat/opensolaris/sys/vfs.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/vfs.h Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/compat/opensolaris/sys/vfs.h Tue Sep 15 11:13:40 2009 (r197215) @@ -110,8 +110,8 @@ void vfs_setmntopt(vfs_t *vfsp, const ch int flags __unused); void vfs_clearmntopt(vfs_t *vfsp, const char *name); int vfs_optionisset(const vfs_t *vfsp, const char *opt, char **argp); -int domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, - char *fspec, int fsflags); +int mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, + char *fspath, char *fspec, int fsflags); typedef uint64_t vfs_feature_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Sep 15 11:13:40 2009 (r197215) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -864,10 +864,11 @@ restore_object(struct restorearg *ra, ob /* currently allocated, want to be allocated */ dmu_tx_hold_bonus(tx, drro->drr_object); /* - * We may change blocksize, so need to - * hold_write + * We may change blocksize and delete old content, + * so need to hold_write and hold_free. */ dmu_tx_hold_write(tx, drro->drr_object, 0, 1); + dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Sep 15 11:13:40 2009 (r197215) @@ -415,7 +415,7 @@ void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - int i, old_nblkptr; + int i, nblkptr; dmu_buf_impl_t *db = NULL; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); @@ -445,6 +445,8 @@ dnode_reallocate(dnode_t *dn, dmu_object dnode_free_range(dn, 0, -1ULL, tx); } + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + /* change blocksize */ rw_enter(&dn->dn_struct_rwlock, RW_WRITER); if (blocksize != dn->dn_datablksz && @@ -457,6 +459,8 @@ dnode_reallocate(dnode_t *dn, dmu_object dnode_setdirty(dn, tx); dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + if (dn->dn_nblkptr != nblkptr) + dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; rw_exit(&dn->dn_struct_rwlock); if (db) dbuf_rele(db, FTAG); @@ -466,19 +470,15 @@ dnode_reallocate(dnode_t *dn, dmu_object /* change bonus size and type */ mutex_enter(&dn->dn_mtx); - old_nblkptr = dn->dn_nblkptr; dn->dn_bonustype = bonustype; dn->dn_bonuslen = bonuslen; - dn->dn_nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + dn->dn_nblkptr = nblkptr; dn->dn_checksum = ZIO_CHECKSUM_INHERIT; dn->dn_compress = ZIO_COMPRESS_INHERIT; ASSERT3U(dn->dn_nblkptr, <=, DN_MAX_NBLKPTR); - /* XXX - for now, we can't make nblkptr smaller */ - ASSERT3U(dn->dn_nblkptr, >=, old_nblkptr); - - /* fix up the bonus db_size if dn_nblkptr has changed */ - if (dn->dn_bonus && dn->dn_bonuslen != old_nblkptr) { + /* fix up the bonus db_size */ + if (dn->dn_bonus) { dn->dn_bonus->db.db_size = DN_MAX_BONUSLEN - (dn->dn_nblkptr-1) * sizeof (blkptr_t); ASSERT(dn->dn_bonuslen <= dn->dn_bonus->db.db_size); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Sep 15 11:13:40 2009 (r197215) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -534,18 +532,12 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) /* XXX shouldn't the phys already be zeroed? */ bzero(dnp, DNODE_CORE_SIZE); dnp->dn_nlevels = 1; + dnp->dn_nblkptr = dn->dn_nblkptr; } - if (dn->dn_nblkptr > dnp->dn_nblkptr) { - /* zero the new blkptrs we are gaining */ - bzero(dnp->dn_blkptr + dnp->dn_nblkptr, - sizeof (blkptr_t) * - (dn->dn_nblkptr - dnp->dn_nblkptr)); - } dnp->dn_type = dn->dn_type; dnp->dn_bonustype = dn->dn_bonustype; dnp->dn_bonuslen = dn->dn_bonuslen; - dnp->dn_nblkptr = dn->dn_nblkptr; } ASSERT(dnp->dn_nlevels > 1 || @@ -605,6 +597,30 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) return; } + if (dn->dn_next_nblkptr[txgoff]) { + /* this should only happen on a realloc */ + ASSERT(dn->dn_allocated_txg == tx->tx_txg); + if (dn->dn_next_nblkptr[txgoff] > dnp->dn_nblkptr) { + /* zero the new blkptrs we are gaining */ + bzero(dnp->dn_blkptr + dnp->dn_nblkptr, + sizeof (blkptr_t) * + (dn->dn_next_nblkptr[txgoff] - dnp->dn_nblkptr)); +#ifdef ZFS_DEBUG + } else { + int i; + ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr); + /* the blkptrs we are losing better be unallocated */ + for (i = dn->dn_next_nblkptr[txgoff]; + i < dnp->dn_nblkptr; i++) + ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i])); +#endif + } + mutex_enter(&dn->dn_mtx); + dnp->dn_nblkptr = dn->dn_next_nblkptr[txgoff]; + dn->dn_next_nblkptr[txgoff] = 0; + mutex_exit(&dn->dn_mtx); + } + if (dn->dn_next_nlevels[txgoff]) { dnode_increase_indirection(dn, tx); dn->dn_next_nlevels[txgoff] = 0; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Sep 15 11:13:40 2009 (r197215) @@ -1419,6 +1419,7 @@ dsl_dataset_drain_refs(dsl_dataset_t *ds { struct refsarg arg; + bzero(&arg, sizeof(arg)); mutex_init(&arg.lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arg.cv, NULL, CV_DEFAULT, NULL); arg.gone = FALSE; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Tue Sep 15 11:13:40 2009 (r197215) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -160,6 +160,7 @@ typedef struct dnode { uint16_t dn_datablkszsec; /* in 512b sectors */ uint32_t dn_datablksz; /* in bytes */ uint64_t dn_maxblkid; + uint8_t dn_next_nblkptr[TXG_SIZE]; uint8_t dn_next_nlevels[TXG_SIZE]; uint8_t dn_next_indblkshift[TXG_SIZE]; uint16_t dn_next_bonuslen[TXG_SIZE]; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 15 11:13:40 2009 (r197215) @@ -231,8 +231,27 @@ typedef struct znode { /* * Convert between znode pointers and vnode pointers */ +#ifdef DEBUG +static __inline vnode_t * +ZTOV(znode_t *zp) +{ + vnode_t *vp = zp->z_vnode; + + ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp); + return (vp); +} +static __inline znode_t * +VTOZ(vnode_t *vp) +{ + znode_t *zp = (znode_t *)vp->v_data; + + ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp); + return (zp); +} +#else #define ZTOV(ZP) ((ZP)->z_vnode) #define VTOZ(VP) ((znode_t *)(VP)->v_data) +#endif /* * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Sep 15 11:13:40 2009 (r197215) @@ -194,6 +194,10 @@ vdev_geom_worker(void *arg) zio_t *zio; struct bio *bp; + thread_lock(curthread); + sched_prio(curthread, PRIBIO); + thread_unlock(curthread); + ctx = arg; for (;;) { mtx_lock(&ctx->gc_queue_mtx); @@ -203,7 +207,7 @@ vdev_geom_worker(void *arg) ctx->gc_state = 2; wakeup_one(&ctx->gc_state); mtx_unlock(&ctx->gc_queue_mtx); - kproc_exit(0); + kthread_exit(); } msleep(&ctx->gc_queue, &ctx->gc_queue_mtx, PRIBIO | PDROP, "vgeom:io", 0); @@ -530,8 +534,8 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi vd->vdev_tsd = ctx; pp = cp->provider; - kproc_create(vdev_geom_worker, ctx, NULL, 0, 0, "vdev:worker %s", - pp->name); + kproc_kthread_add(vdev_geom_worker, ctx, &zfsproc, NULL, 0, 0, + "zfskern", "vdev %s", pp->name); /* * Determine the actual size of the device. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Tue Sep 15 11:13:40 2009 (r197215) @@ -181,10 +181,11 @@ mze_compare(const void *arg1, const void return (0); } -static void +static int mze_insert(zap_t *zap, int chunkid, uint64_t hash, mzap_ent_phys_t *mzep) { mzap_ent_t *mze; + avl_index_t idx; ASSERT(zap->zap_ismicro); ASSERT(RW_WRITE_HELD(&zap->zap_rwlock)); @@ -194,7 +195,12 @@ mze_insert(zap_t *zap, int chunkid, uint mze->mze_chunkid = chunkid; mze->mze_hash = hash; mze->mze_phys = *mzep; - avl_add(&zap->zap_m.zap_avl, mze); + if (avl_find(&zap->zap_m.zap_avl, mze, &idx) != NULL) { + kmem_free(mze, sizeof (mzap_ent_t)); + return (EEXIST); + } + avl_insert(&zap->zap_m.zap_avl, mze, idx); + return (0); } static mzap_ent_t * @@ -329,10 +335,15 @@ mzap_open(objset_t *os, uint64_t obj, dm if (mze->mze_name[0]) { zap_name_t *zn; - zap->zap_m.zap_num_entries++; zn = zap_name_alloc(zap, mze->mze_name, MT_EXACT); - mze_insert(zap, i, zn->zn_hash, mze); + if (mze_insert(zap, i, zn->zn_hash, mze) == 0) + zap->zap_m.zap_num_entries++; + else { + printf("ZFS WARNING: Duplicated ZAP " + "entry detected (%s).\n", + mze->mze_name); + } zap_name_free(zn); } } @@ -771,7 +782,7 @@ again: if (zap->zap_m.zap_alloc_next == zap->zap_m.zap_num_chunks) zap->zap_m.zap_alloc_next = 0; - mze_insert(zap, i, zn->zn_hash, mze); + VERIFY(0 == mze_insert(zap, i, zn->zn_hash, mze)); return; } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Sep 15 11:13:40 2009 (r197215) @@ -669,9 +669,12 @@ zfsctl_snapdir_remove(vnode_t *dvp, char if (sep) { avl_remove(&sdp->sd_snaps, sep); err = zfsctl_unmount_snap(sep, MS_FORCE, cr); - if (err) - avl_add(&sdp->sd_snaps, sep); - else + if (err) { + avl_index_t where; + + if (avl_find(&sdp->sd_snaps, sep, &where) == NULL) + avl_insert(&sdp->sd_snaps, sep, where); + } else err = dmu_objset_destroy(snapname); } else { err = ENOENT; @@ -877,20 +880,20 @@ domount: mountpoint = kmem_alloc(mountpoint_len, KM_SLEEP); (void) snprintf(mountpoint, mountpoint_len, "%s/.zfs/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, nm); - err = domount(curthread, *vpp, "zfs", mountpoint, snapname, 0); + err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); - /* FreeBSD: This line was moved from below to avoid a lock recursion. */ - if (err == 0) - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); - mutex_exit(&sdp->sd_lock); - /* - * If we had an error, drop our hold on the vnode and - * zfsctl_snapshot_inactive() will clean up. - */ - if (err) { - VN_RELE(*vpp); - *vpp = NULL; + if (err == 0) { + /* + * Fix up the root vnode mounted on .zfs/snapshot/. + * + * This is where we lie about our v_vfsp in order to + * make .zfs/snapshot/ accessible over NFS + * without requiring manual mounts of . + */ + ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs); + VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; } + mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); return (err); } @@ -1344,7 +1347,17 @@ zfsctl_umount_snapshots(vfs_t *vfsp, int if (vn_ismntpt(sep->se_root)) { error = zfsctl_unmount_snap(sep, fflags, cr); if (error) { - avl_add(&sdp->sd_snaps, sep); + avl_index_t where; + + /* + * Before reinserting snapshot to the tree, + * check if it was actually removed. For example + * when snapshot mount point is busy, we will + * have an error here, but there will be no need + * to reinsert snapshot. + */ + if (avl_find(&sdp->sd_snaps, sep, &where) == NULL) + avl_insert(&sdp->sd_snaps, sep, where); break; } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 15 11:13:40 2009 (r197215) @@ -3021,8 +3021,10 @@ zfsdev_ioctl(struct cdev *dev, u_long cm if (error == 0) error = zfs_ioc_vec[vec].zvec_func(zc); - if (zfs_ioc_vec[vec].zvec_his_log == B_TRUE) - zfs_log_history(zc); + if (error == 0) { + if (zfs_ioc_vec[vec].zvec_his_log == B_TRUE) + zfs_log_history(zc); + } return (error); } @@ -3057,6 +3059,7 @@ zfsdev_fini(void) } static struct root_hold_token *zfs_root_token; +struct proc *zfsproc; uint_t zfs_fsyncer_key; extern uint_t rrw_tsd_key; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 15 02:25:03 2009 (r197214) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 15 11:13:40 2009 (r197215) @@ -97,6 +97,8 @@ static int zfs_root(vfs_t *vfsp, int fla static int zfs_statfs(vfs_t *vfsp, struct statfs *statp); static int zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp); static int zfs_sync(vfs_t *vfsp, int waitfor); +static int zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, + struct ucred **credanonp, int *numsecflavors, int **secflavors); static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp); static void zfs_objset_close(zfsvfs_t *zfsvfs); static void zfs_freevfs(vfs_t *vfsp); @@ -108,6 +110,7 @@ static struct vfsops zfs_vfsops = { .vfs_statfs = zfs_statfs, .vfs_vget = zfs_vget, .vfs_sync = zfs_sync, + .vfs_checkexp = zfs_checkexp, .vfs_fhtovp = zfs_fhtovp, }; @@ -337,6 +340,13 @@ zfs_register_callbacks(vfs_t *vfsp) os = zfsvfs->z_os; /* + * This function can be called for a snapshot when we update snapshot's + * mount point, which isn't really supported. + */ + if (dmu_objset_is_snapshot(os)) + return (EOPNOTSUPP); + + /* * The act of registering our callbacks will destroy any mount * options we may have. In order to enable temporary overrides * of mount options, we stash away the current values and @@ -719,7 +729,10 @@ zfs_mount(vfs_t *vfsp) error = secpolicy_fs_mount(cr, mvp, vfsp); if (error) { error = dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr); - if (error == 0) { + if (error != 0) + goto out; + + if (!(vfsp->vfs_flag & MS_REMOUNT)) { vattr_t vattr; /* @@ -729,7 +742,9 @@ zfs_mount(vfs_t *vfsp) vattr.va_mask = AT_UID; + vn_lock(mvp, LK_SHARED | LK_RETRY); if (error = VOP_GETATTR(mvp, &vattr, cr)) { + VOP_UNLOCK(mvp, 0); goto out; } @@ -741,18 +756,19 @@ zfs_mount(vfs_t *vfsp) } #else if (error = secpolicy_vnode_owner(mvp, cr, vattr.va_uid)) { + VOP_UNLOCK(mvp, 0); goto out; } if (error = VOP_ACCESS(mvp, VWRITE, cr, td)) { + VOP_UNLOCK(mvp, 0); goto out; } + VOP_UNLOCK(mvp, 0); #endif - - secpolicy_fs_mount_clearopts(cr, vfsp); - } else { - goto out; } + + secpolicy_fs_mount_clearopts(cr, vfsp); } /* @@ -931,6 +947,18 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea zfsvfs->z_unmounted = B_TRUE; rrw_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); + +#ifdef __FreeBSD__ + /* + * Some znodes might not be fully reclaimed, wait for them. + */ + mutex_enter(&zfsvfs->z_znodes_lock); + while (list_head(&zfsvfs->z_all_znodes) != NULL) { + msleep(zfsvfs, &zfsvfs->z_znodes_lock, 0, + "zteardown", 0); + } + mutex_exit(&zfsvfs->z_znodes_lock); +#endif } /* @@ -1086,6 +1114,20 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla znode_t *zp; int err; + /* + * XXXPJD: zfs_zget() can't operate on virtual entires like .zfs/ or + * .zfs/snapshot/ directories, so for now just return EOPNOTSUPP. + * This will make NFS to fall back to using READDIR instead of + * READDIRPLUS. + * Also snapshots are stored in AVL tree, but based on their names, + * not inode numbers, so it will be very inefficient to iterate + * over all snapshots to find the right one. + * Note that OpenSolaris READDIRPLUS implementation does LOOKUP on + * d_name, and not VGET on d_fileno as we do. + */ + if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) + return (EOPNOTSUPP); + ZFS_ENTER(zfsvfs); err = zfs_zget(zfsvfs, ino, &zp); if (err == 0 && zp->z_unlinked) { @@ -1103,6 +1145,28 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla } static int +zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, + struct ucred **credanonp, int *numsecflavors, int **secflavors) +{ + zfsvfs_t *zfsvfs = vfsp->vfs_data; + + /* + * If this is regular file system vfsp is the same as + * zfsvfs->z_parent->z_vfs, but if it is snapshot, + * zfsvfs->z_parent->z_vfs represents parent file system + * which we have to use here, because only this file system + * has mnt_export configured. + */ + vfsp = zfsvfs->z_parent->z_vfs; + + return (vfs_stdcheckexp(zfsvfs->z_parent->z_vfs, nam, extflagsp, + credanonp, numsecflavors, secflavors)); +} + +CTASSERT(SHORT_FID_LEN <= sizeof(struct fid)); +CTASSERT(LONG_FID_LEN <= sizeof(struct fid)); + +static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp) { zfsvfs_t *zfsvfs = vfsp->vfs_data; @@ -1117,7 +1181,11 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno ZFS_ENTER(zfsvfs); - if (fidp->fid_len == LONG_FID_LEN) { + /* + * On FreeBSD we can get snapshot's mount point or its parent file + * system mount point depending if snapshot is already mounted or not. + */ + if (zfsvfs->z_parent == zfsvfs && fidp->fid_len == LONG_FID_LEN) { zfid_long_t *zlfid = (zfid_long_t *)fidp; uint64_t objsetid = 0; uint64_t setgen = 0; @@ -1160,9 +1228,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno } else { VN_HOLD(*vpp); } - ZFS_EXIT(zfsvfs); - /* XXX: LK_RETRY? */ vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + ZFS_EXIT(zfsvfs); return (0); } @@ -1184,7 +1251,6 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno } *vpp = ZTOV(zp); - /* XXX: LK_RETRY? */ vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); vnode_create_vobject(*vpp, zp->z_phys->zp_size, curthread); ZFS_EXIT(zfsvfs); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 11:20:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0EE71065672; Tue, 15 Sep 2009 11:20:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDA428FC16; Tue, 15 Sep 2009 11:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FBKNxB086423; Tue, 15 Sep 2009 11:20:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FBKNhD086421; Tue, 15 Sep 2009 11:20:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151120.n8FBKNhD086421@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 11:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197216 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 11:20:24 -0000 Author: pjd Date: Tue Sep 15 11:20:23 2009 New Revision: 197216 URL: http://svn.freebsd.org/changeset/base/197216 Log: MFC r197039, r197040: Fix usecount leak in mknod(2) on file system exported over NFS. While I'm here, correct typo in comment. Reviewed by: kan, kib Approved by: re (bz) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/nfsserver/nfs_serv.c Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Tue Sep 15 11:13:40 2009 (r197215) +++ stable/8/sys/nfsserver/nfs_serv.c Tue Sep 15 11:20:23 2009 (r197216) @@ -1686,7 +1686,7 @@ out: if (dirp) { vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); diraft_ret = VOP_GETATTR(dirp, &diraft, cred); - VOP_UNLOCK(dirp, 0); + vput(dirp); } ereply: nfsm_reply(NFSX_SRVFH(1) + NFSX_POSTOPATTR(1) + NFSX_WCCDATA(1)); @@ -3825,7 +3825,7 @@ nfsmout: * what the heck. * * The exception to rule 2 is EPERM. If a file is IMMUTABLE, VOP_ACCESS() - * will return EPERM instead of EACCESS. EPERM is always an error. + * will return EPERM instead of EACCES. EPERM is always an error. */ static int nfsrv_access(struct vnode *vp, accmode_t accmode, struct ucred *cred, From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 11:24:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BF17106566C; Tue, 15 Sep 2009 11:24:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27D6E8FC15; Tue, 15 Sep 2009 11:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FBO0V4086641; Tue, 15 Sep 2009 11:24:00 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FBO0MM086637; Tue, 15 Sep 2009 11:24:00 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151124.n8FBO0MM086637@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 11:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197217 - in stable/8/sys: . amd64/include/xen cam/scsi cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/xen/xenpci geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 11:24:00 -0000 Author: pjd Date: Tue Sep 15 11:23:59 2009 New Revision: 197217 URL: http://svn.freebsd.org/changeset/base/197217 Log: MFC r196822, r196823, r196824: Remove 'ad:' prefix from disk serial number. We don't want serial number to change when we reconnect the disk in a way that it is accessible through CAM for example. Discussed with: trasz Simplify g_disk_ident_adjust() function and allow any printable character in serial number. Discussed with: trasz Obtained from: Wheel Sp. z o.o. (http://www.wheel.pl) Make serial numbers of daX disks visible by GEOM. No objections from: scottl Obtained from: Wheel Sp. z o.o. (http://www.wheel.pl) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ata/ata-disk.c stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/geom_disk.c Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Tue Sep 15 11:20:23 2009 (r197216) +++ stable/8/sys/cam/scsi/scsi_da.c Tue Sep 15 11:23:59 2009 (r197217) @@ -1266,6 +1266,8 @@ daregister(struct cam_periph *periph, vo softc->disk->d_flags = 0; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + strlcpy(softc->disk->d_ident, cgd->serial_num, + MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); disk_create(softc->disk, DISK_VERSION); mtx_lock(periph->sim->mtx); Modified: stable/8/sys/dev/ata/ata-disk.c ============================================================================== --- stable/8/sys/dev/ata/ata-disk.c Tue Sep 15 11:20:23 2009 (r197216) +++ stable/8/sys/dev/ata/ata-disk.c Tue Sep 15 11:23:59 2009 (r197217) @@ -136,8 +136,8 @@ ad_attach(device_t dev) if ((atadev->param.support.command2 & ATA_SUPPORT_CFA) || atadev->param.config == ATA_PROTO_CFA) adp->disk->d_flags = DISKFLAG_CANDELETE; - snprintf(adp->disk->d_ident, sizeof(adp->disk->d_ident), "ad:%s", - atadev->param.serial); + strlcpy(adp->disk->d_ident, atadev->param.serial, + sizeof(adp->disk->d_ident)); disk_create(adp->disk, DISK_VERSION); device_add_child(dev, "subdisk", device_get_unit(dev)); ad_firmware_geom_adjust(dev, adp->disk); Modified: stable/8/sys/geom/geom_disk.c ============================================================================== --- stable/8/sys/geom/geom_disk.c Tue Sep 15 11:20:23 2009 (r197216) +++ stable/8/sys/geom/geom_disk.c Tue Sep 15 11:23:59 2009 (r197217) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -400,39 +401,25 @@ g_disk_destroy(void *ptr, int flag) } /* - * We only allow [a-zA-Z0-9-_@#%.:] characters, the rest is converted to 'x'. + * We only allow printable characters in disk ident, + * the rest is converted to 'x'. */ static void g_disk_ident_adjust(char *ident, size_t size) { - char newid[DISK_IDENT_SIZE], tmp[4]; - size_t len; - char *p; - - bzero(newid, sizeof(newid)); - len = 0; - for (p = ident; *p != '\0' && len < sizeof(newid) - 1; p++) { - switch (*p) { - default: - if ((*p < 'a' || *p > 'z') && - (*p < 'A' || *p > 'Z') && - (*p < '0' || *p > '9')) { - snprintf(tmp, sizeof(tmp), "x%02hhx", *p); - strlcat(newid, tmp, sizeof(newid)); - len += 3; - break; - } - /* FALLTHROUGH */ - case '-': - case '_': - case '@': - case '#': - case '%': - case '.': - case ':': - newid[len++] = *p; - break; + char *p, tmp[4], newid[DISK_IDENT_SIZE]; + + newid[0] = '\0'; + for (p = ident; *p != '\0'; p++) { + if (isprint(*p)) { + tmp[0] = *p; + tmp[1] = '\0'; + } else { + snprintf(tmp, sizeof(tmp), "x%02hhx", + *(unsigned char *)p); } + if (strlcat(newid, tmp, sizeof(newid)) >= sizeof(newid)) + break; } bzero(ident, size); strlcpy(ident, newid, size); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 11:34:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFAF2106568F; Tue, 15 Sep 2009 11:34:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE4228FC1D; Tue, 15 Sep 2009 11:34:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FBYruk086890; Tue, 15 Sep 2009 11:34:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FBYr8F086888; Tue, 15 Sep 2009 11:34:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151134.n8FBYr8F086888@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 11:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 11:34:54 -0000 Author: pjd Date: Tue Sep 15 11:34:53 2009 New Revision: 197218 URL: http://svn.freebsd.org/changeset/base/197218 Log: We believe ZFS is ready for production use. Remove a warning about it being experimental. :) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 15 11:23:59 2009 (r197217) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 15 11:34:53 2009 (r197218) @@ -3072,8 +3072,6 @@ zfs_modevent(module_t mod, int type, voi switch (type) { case MOD_LOAD: zfs_root_token = root_mount_hold("ZFS"); - printf("WARNING: ZFS is considered to be an experimental " - "feature in FreeBSD.\n"); mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 11:42:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C643F1065670; Tue, 15 Sep 2009 11:42:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B46578FC15; Tue, 15 Sep 2009 11:42:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FBg81K087077; Tue, 15 Sep 2009 11:42:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FBg88g087075; Tue, 15 Sep 2009 11:42:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151142.n8FBg88g087075@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 11:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197219 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 11:42:08 -0000 Author: pjd Date: Tue Sep 15 11:42:08 2009 New Revision: 197219 URL: http://svn.freebsd.org/changeset/base/197219 Log: Forced unmounts work just fine in my tests under heavy load. There might still be a problem, but it isn't worth a warning. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 15 11:34:53 2009 (r197218) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 15 11:42:08 2009 (r197219) @@ -994,11 +994,6 @@ zfs_umount(vfs_t *vfsp, int fflag) cred_t *cr = curthread->td_ucred; int ret; - if (fflag & MS_FORCE) { - /* TODO: Force unmount is not well implemented yet, so deny it. */ - ZFS_LOG(0, "Force unmount is experimental - report any problems."); - } - ret = secpolicy_fs_unmount(cr, vfsp); if (ret) { ret = dsl_deleg_access((char *)refstr_value(vfsp->vfs_resource), From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 12:19:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28E151065670; Tue, 15 Sep 2009 12:19:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 153B68FC1C; Tue, 15 Sep 2009 12:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FCJYAV088039; Tue, 15 Sep 2009 12:19:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FCJYMr088037; Tue, 15 Sep 2009 12:19:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151219.n8FCJYMr088037@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 12:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197220 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 12:19:35 -0000 Author: pjd Date: Tue Sep 15 12:19:34 2009 New Revision: 197220 URL: http://svn.freebsd.org/changeset/base/197220 Log: MFC r197219: Forced unmounts work just fine in my tests under heavy load. There might still be a problem, but it isn't worth a warning. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 15 11:42:08 2009 (r197219) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 15 12:19:34 2009 (r197220) @@ -994,11 +994,6 @@ zfs_umount(vfs_t *vfsp, int fflag) cred_t *cr = curthread->td_ucred; int ret; - if (fflag & MS_FORCE) { - /* TODO: Force unmount is not well implemented yet, so deny it. */ - ZFS_LOG(0, "Force unmount is experimental - report any problems."); - } - ret = secpolicy_fs_unmount(cr, vfsp); if (ret) { ret = dsl_deleg_access((char *)refstr_value(vfsp->vfs_resource), From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 12:21:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DAF21065676; Tue, 15 Sep 2009 12:21:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A48A8FC2A; Tue, 15 Sep 2009 12:21:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FCL60h088144; Tue, 15 Sep 2009 12:21:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FCL6TU088142; Tue, 15 Sep 2009 12:21:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909151221.n8FCL6TU088142@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Sep 2009 12:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197221 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 12:21:07 -0000 Author: pjd Date: Tue Sep 15 12:21:06 2009 New Revision: 197221 URL: http://svn.freebsd.org/changeset/base/197221 Log: MFC r197218: We believe ZFS is ready for production use. Remove a warning about it being experimental. :) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 15 12:19:34 2009 (r197220) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 15 12:21:06 2009 (r197221) @@ -3072,8 +3072,6 @@ zfs_modevent(module_t mod, int type, voi switch (type) { case MOD_LOAD: zfs_root_token = root_mount_hold("ZFS"); - printf("WARNING: ZFS is considered to be an experimental " - "feature in FreeBSD.\n"); mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 12:39:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1CA51065694; Tue, 15 Sep 2009 12:39:11 +0000 (UTC) (envelope-from artis.caune@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id E875D8FC1F; Tue, 15 Sep 2009 12:39:10 +0000 (UTC) Received: by fxm6 with SMTP id 6so2626753fxm.43 for ; Tue, 15 Sep 2009 05:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=yf4Uiq7f7LHpxTulLWGxjGBx66es2Uu9ciDNo64ZK98=; b=VNceVzL1H5qTagTfgLPC3yUnCOnxvNnJ6pbaziAHY9UmCFAXMakMOG38utV2BjJ9qw AaWcIGIpHgtI/JJ/h/6NgJtNbIhSGkrEUTKvyyida+LLDKzVGWs7gXLCJ8xVQZL++6t5 GPvPMw2WdhSXrufqr+b0NYFSlhBsr8xzLV5vs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gmQVMZN3uFW8Ct3VqI4jtGgnyuzrV55XF3TkID+IcdzRfsfgYfT8ZUHjI9ydH1L3Ho iXe/NGhWPpqfHnHFE90sT0s+n35GvpztB8D7WJEYnjTvSvy5gPKqfPKrtCtv+VqsVdVn ExCYWCjH0+45UbnAHuYH+MnpjBk8JeO2Nw+9A= MIME-Version: 1.0 Received: by 10.204.162.210 with SMTP id w18mr6237525bkx.174.1253018349579; Tue, 15 Sep 2009 05:39:09 -0700 (PDT) In-Reply-To: <200909151221.n8FCL6TU088142@svn.freebsd.org> References: <200909151221.n8FCL6TU088142@svn.freebsd.org> Date: Tue, 15 Sep 2009 15:39:09 +0300 Message-ID: <9e20d71e0909150539k44ac0b59v93a2d25dbf288e48@mail.gmail.com> From: Artis Caune To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r197221 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 12:39:11 -0000 2009/9/15 Pawel Jakub Dawidek : > Author: pjd > Date: Tue Sep 15 12:21:06 2009 > New Revision: 197221 > URL: http://svn.freebsd.org/changeset/base/197221 > > Log: > =C2=A0MFC r197218: > > =C2=A0We believe ZFS is ready for production use. Remove a warning about = it being > =C2=A0experimental. :) > Some time ago, someone told that "FreeBSD 7 will be the best FreeBSD ever", but I think It's not true anymore. :) Thank you Pawel and all other! --=20 Artis Caune Everything should be made as simple as possible, but not simpler. From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 12:51:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C51410656B4; Tue, 15 Sep 2009 12:51:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4108FC1D; Tue, 15 Sep 2009 12:51:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FCpMDP089000; Tue, 15 Sep 2009 12:51:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FCpM6P088998; Tue, 15 Sep 2009 12:51:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909151251.n8FCpM6P088998@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Sep 2009 12:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197222 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 12:51:22 -0000 Author: kib Date: Tue Sep 15 12:51:22 2009 New Revision: 197222 URL: http://svn.freebsd.org/changeset/base/197222 Log: MFC r196888: The clear_remove() and clear_inodedeps() call vn_start_write(NULL, &mp, V_NOWAIT) on the non-busied mount point. Unmount might free ufs-specific mp data, causing ffs_vgetf() to access freed memory. Busy mountpoint before dropping softdep lk. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/ufs/ffs/ffs_softdep.c Modified: stable/8/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_softdep.c Tue Sep 15 12:21:06 2009 (r197221) +++ stable/8/sys/ufs/ffs/ffs_softdep.c Tue Sep 15 12:51:22 2009 (r197222) @@ -5977,12 +5977,19 @@ clear_remove(td) if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) continue; FREE_LOCK(&lk); - if ((error = ffs_vgetf(mp, ino, LK_EXCLUSIVE, &vp, - FFSV_FORCEINSMQ))) { + + /* + * Let unmount clear deps + */ + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) + goto finish_write; + error = ffs_vgetf(mp, ino, LK_EXCLUSIVE, &vp, + FFSV_FORCEINSMQ); + vfs_unbusy(mp); + if (error != 0) { softdep_error("clear_remove: vget", error); - vn_finished_write(mp); - ACQUIRE_LOCK(&lk); - return; + goto finish_write; } if ((error = ffs_syncvnode(vp, MNT_NOWAIT))) softdep_error("clear_remove: fsync", error); @@ -5991,6 +5998,7 @@ clear_remove(td) drain_output(vp); BO_UNLOCK(bo); vput(vp); + finish_write: vn_finished_write(mp); ACQUIRE_LOCK(&lk); return; @@ -6050,13 +6058,21 @@ clear_inodedeps(td) if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) continue; FREE_LOCK(&lk); + error = vfs_busy(mp, MBF_NOWAIT); /* Let unmount clear deps */ + if (error != 0) { + vn_finished_write(mp); + ACQUIRE_LOCK(&lk); + return; + } if ((error = ffs_vgetf(mp, ino, LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ)) != 0) { softdep_error("clear_inodedeps: vget", error); + vfs_unbusy(mp); vn_finished_write(mp); ACQUIRE_LOCK(&lk); return; } + vfs_unbusy(mp); if (ino == lastino) { if ((error = ffs_syncvnode(vp, MNT_WAIT))) softdep_error("clear_inodedeps: fsync1", error); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 13:04:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C04C106566C; Tue, 15 Sep 2009 13:04:06 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by mx1.freebsd.org (Postfix) with ESMTP id 690378FC22; Tue, 15 Sep 2009 13:04:05 +0000 (UTC) Received: by ewy4 with SMTP id 4so4040581ewy.36 for ; Tue, 15 Sep 2009 06:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=Zb72vo3br2WTfbZFGsny2/3bokYYHqdDV/ai1irY4w0=; b=QxrVWsthP8RZwVohpxcuigqqBgjpoI6Cz7h+zYfLlEoi2d71PO47uPlciYKHK9+quQ S6zprPyu8uNX8Z/ssN9GYkOcMPhqzjYTgG/HJnmhLHBtigNVwz4Ay+W1xD2neEyjyL+S LA0sDU85p5xQkDUVGC2R6BrgQNaDFG2XS8x+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=hRR1dE4rpMLZzwHK9tvQTH9zzerZcAx/EHX9yZo+JoNISQ3hH1CStpnXGc85c29kMA Ht0X2WxFYkphLAKwP9rGxLHP4+vonJVYK6ncMg4U7O6ZsiH/W40hzuqNLAbGBq5aiJR8 daDXWxq2I4aJyr+Xg+HapKiJTmd74wE/S5RiM= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.87.140 with SMTP id y12mr1914567wee.4.1253019843121; Tue, 15 Sep 2009 06:04:03 -0700 (PDT) In-Reply-To: <200909151221.n8FCL6TU088142@svn.freebsd.org> References: <200909151221.n8FCL6TU088142@svn.freebsd.org> From: Ivan Voras Date: Tue, 15 Sep 2009 15:03:43 +0200 X-Google-Sender-Auth: c3a6916be372a5cc Message-ID: <9bbcef730909150603m5d20ca92p20daec1701dab634@mail.gmail.com> To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r197221 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 13:04:06 -0000 2009/9/15 Pawel Jakub Dawidek : > Author: pjd > Date: Tue Sep 15 12:21:06 2009 > New Revision: 197221 > URL: http://svn.freebsd.org/changeset/base/197221 > > Log: > =C2=A0MFC r197218: > > =C2=A0We believe ZFS is ready for production use. Remove a warning about = it being > =C2=A0experimental. :) Wheeee :) From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 13:19:12 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9887B106566B; Tue, 15 Sep 2009 13:19:12 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2168FC15; Tue, 15 Sep 2009 13:19:12 +0000 (UTC) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n8FDJBTt016200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Sep 2009 06:19:11 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4AAF944F.1040209@errno.com> Date: Tue, 15 Sep 2009 06:19:11 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200909151134.n8FBYr8F086888@svn.freebsd.org> In-Reply-To: <200909151134.n8FBYr8F086888@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 13:19:12 -0000 Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Sep 15 11:34:53 2009 > New Revision: 197218 > URL: http://svn.freebsd.org/changeset/base/197218 > > Log: > We believe ZFS is ready for production use. Remove a warning about it being > experimental. :) This is great news! Is this amd64 only (or i386 too)? How about non-x86 architectures (have people tested on sparc64, ppc, etc)? Sam From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 13:50:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAD2E1065672; Tue, 15 Sep 2009 13:50:37 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by mx1.freebsd.org (Postfix) with ESMTP id 4560E8FC15; Tue, 15 Sep 2009 13:50:35 +0000 (UTC) Received: by ewy4 with SMTP id 4so4085129ewy.36 for ; Tue, 15 Sep 2009 06:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=oJLPxXSYjEaJxC/X1Hnmmp8p//UPy4jtnJ6iIOaA6Jc=; b=kFCU/ewzloJC2zuj2e6hVpZBU50P0aM0NqJeb2wTtFWv5uA2D2+eOtehykVd0MgdYs tBwghOppdVWDDDUbNqM94Xq/o0amaVXaTpf3wbMe1gA9sn3IhqJLrxa8Gu674tF8FlOq BfAbokYItc/iY4pYXB1M2j0jvMuU6/aEQAF94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=CFtvKq2XOtYvic1VnnZmGMwMZ1L6o15LB3JwnO1yOZs104wmJ9dIuEK0cB2QADfk8+ GLXeo/L9pUbrK/+JLS/W4VaD6FZnPxhfzbHrQ3dwU9YrBYhrT49GgrbutTtWHXOYykz3 wfOkQjnd4rpbw4hwPLwgrdUwfeTLHIfpasBVI= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.87.134 with SMTP id y6mr1890958wee.20.1253022628192; Tue, 15 Sep 2009 06:50:28 -0700 (PDT) In-Reply-To: <4AAF944F.1040209@errno.com> References: <200909151134.n8FBYr8F086888@svn.freebsd.org> <4AAF944F.1040209@errno.com> From: Ivan Voras Date: Tue, 15 Sep 2009 15:50:08 +0200 X-Google-Sender-Auth: 71108571083e420d Message-ID: <9bbcef730909150650m53e4860fwf4394ae736cb9746@mail.gmail.com> To: Kip Macy , Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Sam Leffler , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 13:50:37 -0000 2009/9/15 Sam Leffler : > Pawel Jakub Dawidek wrote: >> >> Author: pjd >> Date: Tue Sep 15 11:34:53 2009 >> New Revision: 197218 >> URL: http://svn.freebsd.org/changeset/base/197218 >> >> Log: >> =C2=A0We believe ZFS is ready for production use. Remove a warning about= it >> being >> =C2=A0experimental. :) > > This is great news! =C2=A0Is this amd64 only (or i386 too)? =C2=A0How abo= ut non-x86 > architectures (have people tested on sparc64, ppc, etc)? Also, is there some "official" recommendation about tuning? Pawel, Kip and others - can you please review http://wiki.freebsd.org/ZFSTuningGuide and see what information, if any, is still important, or if anything new needs to be added? From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 14:59:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5ED106568D; Tue, 15 Sep 2009 14:59:26 +0000 (UTC) (envelope-from ben@wanderview.com) Received: from mail.wanderview.com (mail.wanderview.com [66.92.166.102]) by mx1.freebsd.org (Postfix) with ESMTP id 886648FC1B; Tue, 15 Sep 2009 14:59:25 +0000 (UTC) Received: from xykon.in.wanderview.com (xykon.in.wanderview.com [10.76.10.152]) (authenticated bits=0) by mail.wanderview.com (8.14.3/8.14.3) with ESMTP id n8FEKIWV011393 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 15 Sep 2009 14:20:19 GMT (envelope-from ben@wanderview.com) Mime-Version: 1.0 (Apple Message framework v1075.2) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Ben Kelly In-Reply-To: <4AAF944F.1040209@errno.com> Date: Tue, 15 Sep 2009 10:20:18 -0400 Content-Transfer-Encoding: 7bit Message-Id: <07CC63B9-2303-4AE6-B285-5532F839E660@wanderview.com> References: <200909151134.n8FBYr8F086888@svn.freebsd.org> <4AAF944F.1040209@errno.com> To: Sam Leffler X-Mailer: Apple Mail (2.1075.2) X-Spam-Score: -1.44 () ALL_TRUSTED X-Scanned-By: MIMEDefang 2.64 on 10.76.20.1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r197218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 14:59:26 -0000 On Sep 15, 2009, at 9:19 AM, Sam Leffler wrote: > Pawel Jakub Dawidek wrote: >> Author: pjd >> Date: Tue Sep 15 11:34:53 2009 >> New Revision: 197218 >> URL: http://svn.freebsd.org/changeset/base/197218 >> Log: >> We believe ZFS is ready for production use. Remove a warning about >> it being >> experimental. :) > > This is great news! Is this amd64 only (or i386 too)? How about > non-x86 architectures (have people tested on sparc64, ppc, etc)? My experience with i386 was that the zfs ARC code caused significant kmem fragmentation. While I have not tested this with recent commits, I haven't seen anything that would lead me to believe its fixed either. I seem to recall Kip said he was working on UMA changes or something like that to address the problem. - Ben From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 15:00:56 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 371E4106566C; Tue, 15 Sep 2009 15:00:56 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7926D8FC13; Tue, 15 Sep 2009 15:00:55 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id A546645CA0; Tue, 15 Sep 2009 17:00:53 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8CD2D45C9C; Tue, 15 Sep 2009 17:00:48 +0200 (CEST) Date: Tue, 15 Sep 2009 17:00:47 +0200 From: Pawel Jakub Dawidek To: Sam Leffler Message-ID: <20090915150047.GA2199@garage.freebsd.pl> References: <200909151134.n8FBYr8F086888@svn.freebsd.org> <4AAF944F.1040209@errno.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3" Content-Disposition: inline In-Reply-To: <4AAF944F.1040209@errno.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 15:00:56 -0000 --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 15, 2009 at 06:19:11AM -0700, Sam Leffler wrote: > Pawel Jakub Dawidek wrote: > >Author: pjd > >Date: Tue Sep 15 11:34:53 2009 > >New Revision: 197218 > >URL: http://svn.freebsd.org/changeset/base/197218 > > > >Log: > > We believe ZFS is ready for production use. Remove a warning about it= =20 > > being > > experimental. :) >=20 > This is great news! Is this amd64 only (or i386 too)? How about=20 > non-x86 architectures (have people tested on sparc64, ppc, etc)? I do most of my tests on i386 with 1GB of RAM. It isn't optimal hardware configuration for ZFS, but it seems to work fine in most cases. For the other archs I think I tried sparc64 in the past and Marcel committed some fixes so it can work on ia64. When it comes to powerpc, arm, mips, etc. I haven't done any testing and I wouldn't recommend ZFS for those archs anyway. We should probably also warn about that. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --r5Pyd7+fXNt84Ff3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKr6wfForvXbEpPzQRAqQ+AJ9SSjAhp0M9RJZkoBGYkYUr2u98zgCgkwgB x04cToAw9sp3ss5hMhPCz14= =EsnJ -----END PGP SIGNATURE----- --r5Pyd7+fXNt84Ff3-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 15:05:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BFE106566B; Tue, 15 Sep 2009 15:05:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 5D5808FC0A; Tue, 15 Sep 2009 15:05:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 969E241C6F2; Tue, 15 Sep 2009 17:05:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id L5Y3+sMQEZml; Tue, 15 Sep 2009 17:05:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 1982A41C6EA; Tue, 15 Sep 2009 17:05:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 141A14448E6; Tue, 15 Sep 2009 15:02:04 +0000 (UTC) Date: Tue, 15 Sep 2009 15:02:03 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Qing Li In-Reply-To: <200909150101.n8F113sU071311@svn.freebsd.org> Message-ID: <20090915150034.U68375@maildrop.int.zabbadoz.net> References: <200909150101.n8F113sU071311@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197210 - in head/sys: netinet nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 15:05:08 -0000 On Tue, 15 Sep 2009, Qing Li wrote: > Author: qingli > Date: Tue Sep 15 01:01:03 2009 > New Revision: 197210 > URL: http://svn.freebsd.org/changeset/base/197210 > > Log: > The bootp code installs an interface address and the nfs client > module tries to install the same address again. This extra code > is removed, which was discovered by the removal of a call to > in_ifscrub() in r196714. This call to in_ifscrub is put back here > because the SIOCAIFADDR command can be used to change the prefix > length of an existing alias. > > Reviewed by: kmacy This broke NFS Root for me in the netperf clsuter setup. The NFS Root mount hang for ages (I reset the box after 1 hour). Backing out r197212 and this and it boots just fine again. > Modified: > head/sys/netinet/in.c > head/sys/nfsclient/nfs_vfsops.c > > Modified: head/sys/netinet/in.c > ============================================================================== > --- head/sys/netinet/in.c Tue Sep 15 00:26:23 2009 (r197209) > +++ head/sys/netinet/in.c Tue Sep 15 01:01:03 2009 (r197210) > @@ -536,6 +536,16 @@ in_control(struct socket *so, u_long cmd > hostIsNew = 0; > } > if (ifra->ifra_mask.sin_len) { > + /* > + * QL: XXX > + * Need to scrub the prefix here in case > + * the issued command is SIOCAIFADDR with > + * the same address, but with a different > + * prefix length. And if the prefix length > + * is the same as before, then the call is > + * un-necessarily executed here. > + */ > + in_ifscrub(ifp, ia); > ia->ia_sockmask = ifra->ifra_mask; > ia->ia_sockmask.sin_family = AF_INET; > ia->ia_subnetmask = > @@ -544,6 +554,7 @@ in_control(struct socket *so, u_long cmd > } > if ((ifp->if_flags & IFF_POINTOPOINT) && > (ifra->ifra_dstaddr.sin_family == AF_INET)) { > + in_ifscrub(ifp, ia); > ia->ia_dstaddr = ifra->ifra_dstaddr; > maskIsNew = 1; /* We lie; but the effect's the same */ > } > > Modified: head/sys/nfsclient/nfs_vfsops.c > ============================================================================== > --- head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 00:26:23 2009 (r197209) > +++ head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 01:01:03 2009 (r197210) > @@ -463,9 +463,13 @@ nfs_mountroot(struct mount *mp) > break; > } > #endif > + > +#if 0 /* QL: XXX */ > error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); > if (error) > panic("nfs_mountroot: SIOCAIFADDR: %d", error); > +#endif > + > if ((cp = getenv("boot.netif.mtu")) != NULL) { > ir.ifr_mtu = strtol(cp, NULL, 10); > bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); > -- Bjoern A. Zeeb What was I talking about and who are you again? From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 16:11:43 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5157F106568D; Tue, 15 Sep 2009 16:11:43 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 2568D8FC0C; Tue, 15 Sep 2009 16:11:42 +0000 (UTC) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n8FGBgjg016995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Sep 2009 09:11:42 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4AAFBCBE.6000002@errno.com> Date: Tue, 15 Sep 2009 09:11:42 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200909151134.n8FBYr8F086888@svn.freebsd.org> <4AAF944F.1040209@errno.com> <20090915150047.GA2199@garage.freebsd.pl> In-Reply-To: <20090915150047.GA2199@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 16:11:43 -0000 Pawel Jakub Dawidek wrote: > On Tue, Sep 15, 2009 at 06:19:11AM -0700, Sam Leffler wrote: >> Pawel Jakub Dawidek wrote: >>> Author: pjd >>> Date: Tue Sep 15 11:34:53 2009 >>> New Revision: 197218 >>> URL: http://svn.freebsd.org/changeset/base/197218 >>> >>> Log: >>> We believe ZFS is ready for production use. Remove a warning about it >>> being >>> experimental. :) >> This is great news! Is this amd64 only (or i386 too)? How about >> non-x86 architectures (have people tested on sparc64, ppc, etc)? > > I do most of my tests on i386 with 1GB of RAM. It isn't optimal hardware > configuration for ZFS, but it seems to work fine in most cases. For the > other archs I think I tried sparc64 in the past and Marcel committed > some fixes so it can work on ia64. When it comes to powerpc, arm, mips, > etc. I haven't done any testing and I wouldn't recommend ZFS for those > archs anyway. We should probably also warn about that. > Thank you for the explanation. ppc has support for Xserve if I recall (or perhaps in process); that should be suitable. I was mostly trying to understand which arch's zfs has been successfully deployed on. Sam From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 16:56:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38E06106566C; Tue, 15 Sep 2009 16:56:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27FE78FC08; Tue, 15 Sep 2009 16:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FGuIDp095141; Tue, 15 Sep 2009 16:56:18 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FGuIW3095139; Tue, 15 Sep 2009 16:56:18 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909151656.n8FGuIW3095139@svn.freebsd.org> From: Attilio Rao Date: Tue, 15 Sep 2009 16:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197223 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 16:56:18 -0000 Author: attilio Date: Tue Sep 15 16:56:17 2009 New Revision: 197223 URL: http://svn.freebsd.org/changeset/base/197223 Log: Fix sched_switch_migrate(): - In 8.x and above the run-queue locks are nomore shared even in the HTT case, so remove the special case. - The deadlock explained in the removed comment here is still possible even with different locks, with the contribution of tdq_lock_pair(). An explanation is here: (hypotesis: a thread needs to migrate on another CPU, thread1 is doing sched_switch_migrate() and thread2 is the one handling the sched_switch() request or in other words, thread1 is the thread that needs to migrate and thread2 is a thread that is going to be preempted, most likely an idle thread. Also, 'old' is referred to the context (in terms of run-queue and CPU) thread1 is leaving and 'new' is referred to the context thread1 is going into. Finally, thread3 is doing tdq_idletd() or sched_balance() and definitively doing tdq_lock_pair()) * thread1 blocks its td_lock. Now td_lock is 'blocked' * thread1 drops its old runqueue lock * thread1 acquires the new runqueue lock * thread1 adds itself to the new runqueue and sends an IPI_PREEMPT through tdq_notify() to the new CPU * thread1 drops the new lock * thread3, scanning the runqueues, locks the old lock * thread2 received the IPI_PREEMPT and does thread_lock() with td_lock pointing to the new runqueue * thread3 wants to acquire the new runqueue lock, but it can't because it is held by thread2 so it spins * thread1 wants to acquire old lock, but as long as it is held by thread3 it can't * thread2 going further, at some point wants to switchin in thread1, but it will wait forever because thread1->td_lock is in blocked state This deadlock has been manifested mostly on 7.x and reported several time on mailing lists under the voice 'spinlock held too long'. Many thanks to des@ for having worked hard on producing suitable textdumps and Jeff for help on the comment wording. Reviewed by: jeff Reported by: des, others Tested by: des, Giovanni Trematerra (STABLE_7 based version) Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Sep 15 12:51:22 2009 (r197222) +++ head/sys/kern/sched_ule.c Tue Sep 15 16:56:17 2009 (r197223) @@ -1749,19 +1749,19 @@ sched_switch_migrate(struct tdq *tdq, st */ spinlock_enter(); thread_block_switch(td); /* This releases the lock on tdq. */ - TDQ_LOCK(tdn); - tdq_add(tdn, td, flags); - tdq_notify(tdn, td); + /* - * After we unlock tdn the new cpu still can't switch into this - * thread until we've unblocked it in cpu_switch(). The lock - * pointers may match in the case of HTT cores. Don't unlock here - * or we can deadlock when the other CPU runs the IPI handler. + * Acquire both run-queue locks before placing the thread on the new + * run-queue to avoid deadlocks created by placing a thread with a + * blocked lock on the run-queue of a remote processor. The deadlock + * occurs when a third processor attempts to lock the two queues in + * question while the target processor is spinning with its own + * run-queue lock held while waiting for the blocked lock to clear. */ - if (TDQ_LOCKPTR(tdn) != TDQ_LOCKPTR(tdq)) { - TDQ_UNLOCK(tdn); - TDQ_LOCK(tdq); - } + tdq_lock_pair(tdn, tdq); + tdq_add(tdn, td, flags); + tdq_notify(tdn, td); + TDQ_UNLOCK(tdn); spinlock_exit(); #endif return (TDQ_LOCKPTR(tdn)); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 16:59:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118291065696; Tue, 15 Sep 2009 16:59:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00A178FC1B; Tue, 15 Sep 2009 16:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FGxqOL095253; Tue, 15 Sep 2009 16:59:52 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FGxqGU095250; Tue, 15 Sep 2009 16:59:52 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909151659.n8FGxqGU095250@svn.freebsd.org> From: Attilio Rao Date: Tue, 15 Sep 2009 16:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197224 - in head: lib/libdevinfo sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 16:59:53 -0000 Author: attilio Date: Tue Sep 15 16:59:52 2009 New Revision: 197224 URL: http://svn.freebsd.org/changeset/base/197224 Log: Use explicit int values for the device states in order to allow, if necessary, in the future, adds of new states without breaking ABI between revisions. Proposed by: kib Approved by: imp Modified: head/lib/libdevinfo/devinfo.h head/sys/sys/bus.h Modified: head/lib/libdevinfo/devinfo.h ============================================================================== --- head/lib/libdevinfo/devinfo.h Tue Sep 15 16:56:17 2009 (r197223) +++ head/lib/libdevinfo/devinfo.h Tue Sep 15 16:59:52 2009 (r197224) @@ -41,10 +41,10 @@ typedef __uintptr_t devinfo_handle_t; */ /* XXX not sure if I want a copy here, or expose sys/bus.h */ typedef enum devinfo_state { - DIS_NOTPRESENT, /* not probed or probe failed */ - DIS_ALIVE, /* probe succeeded */ - DIS_ATTACHED, /* attach method called */ - DIS_BUSY /* device is open */ + DIS_NOTPRESENT = 10, /* not probed or probe failed */ + DIS_ALIVE = 20, /* probe succeeded */ + DIS_ATTACHED = 30, /* attach method called */ + DIS_BUSY = 40 /* device is open */ } devinfo_state_t; struct devinfo_dev { Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue Sep 15 16:56:17 2009 (r197223) +++ head/sys/sys/bus.h Tue Sep 15 16:59:52 2009 (r197224) @@ -50,10 +50,10 @@ struct u_businfo { * @brief State of the device. */ typedef enum device_state { - DS_NOTPRESENT, /**< @brief not probed or probe failed */ - DS_ALIVE, /**< @brief probe succeeded */ - DS_ATTACHED, /**< @brief attach method called */ - DS_BUSY /**< @brief device is open */ + DS_NOTPRESENT = 10, /**< @brief not probed or probe failed */ + DS_ALIVE = 20, /**< @brief probe succeeded */ + DS_ATTACHED = 30, /**< @brief attach method called */ + DS_BUSY = 40 /**< @brief device is open */ } device_state_t; /** From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 17:34:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B92E10656A3; Tue, 15 Sep 2009 17:34:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E20138FC12; Tue, 15 Sep 2009 17:34:29 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 91E3746B23; Tue, 15 Sep 2009 13:34:29 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E2FE08A01B; Tue, 15 Sep 2009 13:34:28 -0400 (EDT) From: John Baldwin To: Attilio Rao Date: Tue, 15 Sep 2009 13:33:08 -0400 User-Agent: KMail/1.9.7 References: <200909151656.n8FGuIW3095139@svn.freebsd.org> In-Reply-To: <200909151656.n8FGuIW3095139@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909151333.08622.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 15 Sep 2009 13:34:28 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197223 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 17:34:30 -0000 On Tuesday 15 September 2009 12:56:18 pm Attilio Rao wrote: > Author: attilio > Date: Tue Sep 15 16:56:17 2009 > New Revision: 197223 > URL: http://svn.freebsd.org/changeset/base/197223 > > Log: > Fix sched_switch_migrate(): Good catch! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 18:39:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9456D1065670; Tue, 15 Sep 2009 18:39:28 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83B648FC0A; Tue, 15 Sep 2009 18:39:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FIdSoj099247; Tue, 15 Sep 2009 18:39:28 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FIdSw6099246; Tue, 15 Sep 2009 18:39:28 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909151839.n8FIdSw6099246@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 18:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197225 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 18:39:28 -0000 Author: qingli Date: Tue Sep 15 18:39:27 2009 New Revision: 197225 URL: http://svn.freebsd.org/changeset/base/197225 Log: This patch enables the node to respond to ARP requests for configured proxy ARP entries. Reviewed by: bz MFC after: immediately Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Sep 15 16:59:52 2009 (r197224) +++ head/sys/netinet/if_ether.c Tue Sep 15 18:39:27 2009 (r197225) @@ -714,62 +714,70 @@ reply: } else { struct llentry *lle = NULL; - if (!V_arp_proxyall) - goto drop; - sin.sin_addr = itaddr; - /* XXX MRT use table 0 for arp reply */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) - goto drop; - - /* - * Don't send proxies for nodes on the same interface - * as this one came out of, or we'll get into a fight - * over who claims what Ether address. - */ - if (!rt->rt_ifp || rt->rt_ifp == ifp) { - RTFREE_LOCKED(rt); - goto drop; - } - IF_AFDATA_LOCK(rt->rt_ifp); - lle = lla_lookup(LLTABLE(rt->rt_ifp), 0, (struct sockaddr *)&sin); - IF_AFDATA_UNLOCK(rt->rt_ifp); - RTFREE_LOCKED(rt); + IF_AFDATA_LOCK(ifp); + lle = lla_lookup(LLTABLE(ifp), 0, (struct sockaddr *)&sin); + IF_AFDATA_UNLOCK(ifp); - if (lle != NULL) { + if ((lle != NULL) && (lle->la_flags & LLE_PUB)) { (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), &lle->ll_addr, ah->ar_hln); LLE_RUNLOCK(lle); - } else - goto drop; + } else { - /* - * Also check that the node which sent the ARP packet - * is on the the interface we expect it to be on. This - * avoids ARP chaos if an interface is connected to the - * wrong network. - */ - sin.sin_addr = isaddr; + if (lle != NULL) + LLE_RUNLOCK(lle); - /* XXX MRT use table 0 for arp checks */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) - goto drop; - if (rt->rt_ifp != ifp) { - log(LOG_INFO, "arp_proxy: ignoring request" - " from %s via %s, expecting %s\n", - inet_ntoa(isaddr), ifp->if_xname, - rt->rt_ifp->if_xname); + if (!V_arp_proxyall) + goto drop; + + sin.sin_addr = itaddr; + /* XXX MRT use table 0 for arp reply */ + rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); + if (!rt) + goto drop; + + /* + * Don't send proxies for nodes on the same interface + * as this one came out of, or we'll get into a fight + * over who claims what Ether address. + */ + if (!rt->rt_ifp || rt->rt_ifp == ifp) { + RTFREE_LOCKED(rt); + goto drop; + } + RTFREE_LOCKED(rt); + + (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); + (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); + + /* + * Also check that the node which sent the ARP packet + * is on the the interface we expect it to be on. This + * avoids ARP chaos if an interface is connected to the + * wrong network. + */ + sin.sin_addr = isaddr; + + /* XXX MRT use table 0 for arp checks */ + rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); + if (!rt) + goto drop; + if (rt->rt_ifp != ifp) { + log(LOG_INFO, "arp_proxy: ignoring request" + " from %s via %s, expecting %s\n", + inet_ntoa(isaddr), ifp->if_xname, + rt->rt_ifp->if_xname); + RTFREE_LOCKED(rt); + goto drop; + } RTFREE_LOCKED(rt); - goto drop; - } - RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY - printf("arp: proxying for %s\n", - inet_ntoa(itaddr)); + printf("arp: proxying for %s\n", + inet_ntoa(itaddr)); #endif + } } if (itaddr.s_addr == myaddr.s_addr && From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 19:14:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9FCB106566C; Tue, 15 Sep 2009 19:14:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F24D8FC1D; Tue, 15 Sep 2009 19:14:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FJEPXs000118; Tue, 15 Sep 2009 19:14:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FJEPGw000116; Tue, 15 Sep 2009 19:14:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909151914.n8FJEPGw000116@svn.freebsd.org> From: Attilio Rao Date: Tue, 15 Sep 2009 19:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197226 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 19:14:25 -0000 Author: attilio Date: Tue Sep 15 19:14:25 2009 New Revision: 197226 URL: http://svn.freebsd.org/changeset/base/197226 Log: MFC r197223: Fix sched_switch_migrate() by assuming locks cannot be shared and a deadlock between 3 different threads by acquiring both runqueue locks when doing the migration. Please note that this is a special condition as we want this fix in before RC1 as we assume it is critical and so it has been handled as an instant-merge. For the STABLE_7 branch, 1 week before the MFC is assumed. Approved by: re (kib) Modified: stable/8/sys/kern/sched_ule.c Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Tue Sep 15 18:39:27 2009 (r197225) +++ stable/8/sys/kern/sched_ule.c Tue Sep 15 19:14:25 2009 (r197226) @@ -1749,19 +1749,19 @@ sched_switch_migrate(struct tdq *tdq, st */ spinlock_enter(); thread_block_switch(td); /* This releases the lock on tdq. */ - TDQ_LOCK(tdn); - tdq_add(tdn, td, flags); - tdq_notify(tdn, td); + /* - * After we unlock tdn the new cpu still can't switch into this - * thread until we've unblocked it in cpu_switch(). The lock - * pointers may match in the case of HTT cores. Don't unlock here - * or we can deadlock when the other CPU runs the IPI handler. + * Acquire both run-queue locks before placing the thread on the new + * run-queue to avoid deadlocks created by placing a thread with a + * blocked lock on the run-queue of a remote processor. The deadlock + * occurs when a third processor attempts to lock the two queues in + * question while the target processor is spinning with its own + * run-queue lock held while waiting for the blocked lock to clear. */ - if (TDQ_LOCKPTR(tdn) != TDQ_LOCKPTR(tdq)) { - TDQ_UNLOCK(tdn); - TDQ_LOCK(tdq); - } + tdq_lock_pair(tdn, tdq); + tdq_add(tdn, td, flags); + tdq_notify(tdn, td); + TDQ_UNLOCK(tdn); spinlock_exit(); #endif return (TDQ_LOCKPTR(tdn)); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 19:18:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02DA1106566B; Tue, 15 Sep 2009 19:18:35 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52678FC15; Tue, 15 Sep 2009 19:18:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FJIYdR000260; Tue, 15 Sep 2009 19:18:34 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FJIYuI000254; Tue, 15 Sep 2009 19:18:34 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909151918.n8FJIYuI000254@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 19:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197227 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 19:18:35 -0000 Author: qingli Date: Tue Sep 15 19:18:34 2009 New Revision: 197227 URL: http://svn.freebsd.org/changeset/base/197227 Log: Self pointing routes are installed for configured interface addresses and address aliases. After an interface is brought down and brought back up again, those self pointing routes disappeared. This patch ensures after an interface is brought back up, the loopback routes are reinstalled properly. Reviewed by: bz MFC after: immediately Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/netinet/in.c head/sys/netinet/raw_ip.c head/sys/netinet6/in6.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Sep 15 19:14:25 2009 (r197226) +++ head/sys/net/if.c Tue Sep 15 19:18:34 2009 (r197227) @@ -1414,6 +1414,59 @@ ifa_free(struct ifaddr *ifa) } } +int +ifa_add_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + int error = 0; + struct rtentry *rt = NULL; + struct rt_addrinfo info; + static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + + bzero(&info, sizeof(info)); + info.rti_ifp = V_loif; + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_info[RTAX_DST] = ia; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; + error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); + + if (error == 0 && rt != NULL) { + RT_LOCK(rt); + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = + rt->rt_ifp->if_type; + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = + rt->rt_ifp->if_index; + RT_REMREF(rt); + RT_UNLOCK(rt); + } else if (error != 0) + log(LOG_INFO, "ifa_add_loopback_route: insertion failed\n"); + + return (error); +} + +int +ifa_del_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + int error = 0; + struct rt_addrinfo info; + struct sockaddr_dl null_sdl; + + bzero(&null_sdl, sizeof(null_sdl)); + null_sdl.sdl_len = sizeof(null_sdl); + null_sdl.sdl_family = AF_LINK; + null_sdl.sdl_type = ifa->ifa_ifp->if_type; + null_sdl.sdl_index = ifa->ifa_ifp->if_index; + bzero(&info, sizeof(info)); + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_info[RTAX_DST] = ia; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; + error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); + + if (error != 0) + log(LOG_INFO, "ifa_del_loopback_route: deletion failed\n"); + + return (error); +} + /* * XXX: Because sockaddr_dl has deeper structure than the sockaddr * structs used to represent other address families, it is necessary Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Sep 15 19:14:25 2009 (r197226) +++ head/sys/net/if_var.h Tue Sep 15 19:18:34 2009 (r197227) @@ -854,6 +854,9 @@ struct ifnet *ifunit_ref(const char *); void ifq_init(struct ifaltq *, struct ifnet *ifp); void ifq_delete(struct ifaltq *); +int ifa_add_loopback_route(struct ifaddr *, struct sockaddr *); +int ifa_del_loopback_route(struct ifaddr *, struct sockaddr *); + struct ifaddr *ifa_ifwithaddr(struct sockaddr *); int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Sep 15 19:14:25 2009 (r197226) +++ head/sys/netinet/in.c Tue Sep 15 19:18:34 2009 (r197227) @@ -827,9 +827,6 @@ in_ifinit(struct ifnet *ifp, struct in_i { register u_long i = ntohl(sin->sin_addr.s_addr); struct sockaddr_in oldaddr; - struct rtentry *rt = NULL; - struct rt_addrinfo info; - static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; int s = splimp(), flags = RTF_UP, error = 0; oldaddr = ia->ia_addr; @@ -927,25 +924,9 @@ in_ifinit(struct ifnet *ifp, struct in_i /* * add a loopback route to self */ - if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { - bzero(&info, sizeof(info)); - info.rti_ifp = V_loif; - info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); - - if (error == 0 && rt != NULL) { - RT_LOCK(rt); - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - rt->rt_ifp->if_index; - RT_REMREF(rt); - RT_UNLOCK(rt); - } else if (error != 0) - log(LOG_INFO, "in_ifinit: insertion failed\n"); - } + if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) + error = ifa_add_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); return (error); } @@ -1064,8 +1045,6 @@ in_scrubprefix(struct in_ifaddr *target) struct in_addr prefix, mask, p; int error; struct sockaddr_in prefix0, mask0; - struct rt_addrinfo info; - struct sockaddr_dl null_sdl; /* * Remove the loopback route to the interface address. @@ -1079,19 +1058,8 @@ in_scrubprefix(struct in_ifaddr *target) */ if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) && !(target->ia_ifp->if_flags & IFF_LOOPBACK)) { - bzero(&null_sdl, sizeof(null_sdl)); - null_sdl.sdl_len = sizeof(null_sdl); - null_sdl.sdl_family = AF_LINK; - null_sdl.sdl_type = V_loif->if_type; - null_sdl.sdl_index = V_loif->if_index; - bzero(&info, sizeof(info)); - info.rti_flags = target->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&target->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); - - if (error != 0) - log(LOG_INFO, "in_scrubprefix: deletion failed\n"); + error = ifa_del_loopback_route((struct ifaddr *)target, + (struct sockaddr *)&target->ia_addr); } if ((target->ia_flags & IFA_ROUTE) == 0) { Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Tue Sep 15 19:14:25 2009 (r197226) +++ head/sys/netinet/raw_ip.c Tue Sep 15 19:18:34 2009 (r197227) @@ -715,6 +715,7 @@ rip_ctlinput(int cmd, struct sockaddr *s err = rtinit(&ia->ia_ifa, RTM_ADD, flags); if (err == 0) ia->ia_flags |= IFA_ROUTE; + err = ifa_add_loopback_route((struct ifaddr *)ia, sa); ifa_free(&ia->ia_ifa); break; } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Sep 15 19:14:25 2009 (r197226) +++ head/sys/netinet6/in6.c Tue Sep 15 19:18:34 2009 (r197227) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1199,24 +1200,8 @@ in6_purgeaddr(struct ifaddr *ifa) * The check for the current setting of "nd6_useloopback" * is not needed. */ - { - struct rt_addrinfo info; - struct sockaddr_dl null_sdl; - - bzero(&null_sdl, sizeof(null_sdl)); - null_sdl.sdl_len = sizeof(null_sdl); - null_sdl.sdl_family = AF_LINK; - null_sdl.sdl_type = ia->ia_ifp->if_type; - null_sdl.sdl_index = ia->ia_ifp->if_index; - bzero(&info, sizeof(info)); - info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); - - if (error != 0) - log(LOG_INFO, "in6_purgeaddr: deletion failed\n"); - } + error = ifa_del_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); /* stop DAD processing */ nd6_dad_stop(ifa); @@ -1775,27 +1760,8 @@ in6_ifinit(struct ifnet *ifp, struct in6 if (!(ia->ia_flags & IFA_ROUTE) && (V_nd6_useloopback || (ifp->if_flags & IFF_LOOPBACK))) { - struct rt_addrinfo info; - struct rtentry *rt = NULL; - static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; - - bzero(&info, sizeof(info)); - info.rti_ifp = V_loif; - info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); - - if (error == 0 && rt != NULL) { - RT_LOCK(rt); - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - ifp->if_type; - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - ifp->if_index; - RT_REMREF(rt); - RT_UNLOCK(rt); - } else if (error != 0) - log(LOG_INFO, "in6_ifinit: error = %d, insertion failed\n", error); + error = ifa_add_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); } /* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 19:24:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F36D10656AE; Tue, 15 Sep 2009 19:24:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 442468FC0A; Tue, 15 Sep 2009 19:24:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FJOJtF000483; Tue, 15 Sep 2009 19:24:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FJOJfL000480; Tue, 15 Sep 2009 19:24:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909151924.n8FJOJfL000480@svn.freebsd.org> From: Attilio Rao Date: Tue, 15 Sep 2009 19:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197228 - in stable/8: lib/libdevinfo sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 19:24:19 -0000 Author: attilio Date: Tue Sep 15 19:24:18 2009 New Revision: 197228 URL: http://svn.freebsd.org/changeset/base/197228 Log: MFC r197224: Use explicit int values for the device states in order to allow, if necessary, in the future, adds of new states without breaking ABI between revisions. Please note that this is a special condition as we want this fix in before RC1 as we assume it is critical and so it has been handled as an instant-merge. Approved by: re (kib) Modified: stable/8/lib/libdevinfo/devinfo.h stable/8/sys/sys/bus.h Modified: stable/8/lib/libdevinfo/devinfo.h ============================================================================== --- stable/8/lib/libdevinfo/devinfo.h Tue Sep 15 19:18:34 2009 (r197227) +++ stable/8/lib/libdevinfo/devinfo.h Tue Sep 15 19:24:18 2009 (r197228) @@ -41,10 +41,10 @@ typedef __uintptr_t devinfo_handle_t; */ /* XXX not sure if I want a copy here, or expose sys/bus.h */ typedef enum devinfo_state { - DIS_NOTPRESENT, /* not probed or probe failed */ - DIS_ALIVE, /* probe succeeded */ - DIS_ATTACHED, /* attach method called */ - DIS_BUSY /* device is open */ + DIS_NOTPRESENT = 10, /* not probed or probe failed */ + DIS_ALIVE = 20, /* probe succeeded */ + DIS_ATTACHED = 30, /* attach method called */ + DIS_BUSY = 40 /* device is open */ } devinfo_state_t; struct devinfo_dev { Modified: stable/8/sys/sys/bus.h ============================================================================== --- stable/8/sys/sys/bus.h Tue Sep 15 19:18:34 2009 (r197227) +++ stable/8/sys/sys/bus.h Tue Sep 15 19:24:18 2009 (r197228) @@ -50,10 +50,10 @@ struct u_businfo { * @brief State of the device. */ typedef enum device_state { - DS_NOTPRESENT, /**< @brief not probed or probe failed */ - DS_ALIVE, /**< @brief probe succeeded */ - DS_ATTACHED, /**< @brief attach method called */ - DS_BUSY /**< @brief device is open */ + DS_NOTPRESENT = 10, /**< @brief not probed or probe failed */ + DS_ALIVE = 20, /**< @brief probe succeeded */ + DS_ATTACHED = 30, /**< @brief attach method called */ + DS_BUSY = 40 /**< @brief device is open */ } device_state_t; /** From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 19:38:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9711106568B; Tue, 15 Sep 2009 19:38:29 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C248FC22; Tue, 15 Sep 2009 19:38:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FJcTU8000833; Tue, 15 Sep 2009 19:38:29 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FJcT93000831; Tue, 15 Sep 2009 19:38:29 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909151938.n8FJcT93000831@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 19:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197229 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 19:38:30 -0000 Author: qingli Date: Tue Sep 15 19:38:29 2009 New Revision: 197229 URL: http://svn.freebsd.org/changeset/base/197229 Log: MFC r197203 Previously local end of point-to-point interface is not reachable within the system that owns the interface. Packets destined to the local end point leak to the wire towards the default gateway if one exists. This behavior is changed as part of the L2/L3 rewrite efforts. The local end point is now reachable within the system. The inpcb code needs to consider this fact during the address selection process. Reviewed by: bz Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/in_pcb.c Modified: stable/8/sys/netinet/in_pcb.c ============================================================================== --- stable/8/sys/netinet/in_pcb.c Tue Sep 15 19:24:18 2009 (r197228) +++ stable/8/sys/netinet/in_pcb.c Tue Sep 15 19:38:29 2009 (r197229) @@ -701,6 +701,8 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); if (ia == NULL) ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); + if (ia == NULL) + ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); if (cred == NULL || !prison_flag(cred, PR_IP4)) { if (ia == NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 19:56:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13072106566B; Tue, 15 Sep 2009 19:56:36 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01B0C8FC08; Tue, 15 Sep 2009 19:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FJuZsu001336; Tue, 15 Sep 2009 19:56:35 GMT (envelope-from blackend@svn.freebsd.org) Received: (from blackend@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FJuZBZ001334; Tue, 15 Sep 2009 19:56:35 GMT (envelope-from blackend@svn.freebsd.org) Message-Id: <200909151956.n8FJuZBZ001334@svn.freebsd.org> From: Marc Fonvieille Date: Tue, 15 Sep 2009 19:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197230 - stable/8/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 19:56:36 -0000 Author: blackend (doc committer) Date: Tue Sep 15 19:56:35 2009 New Revision: 197230 URL: http://svn.freebsd.org/changeset/base/197230 Log: MFC: r196588 Log: Update some comments to match the removal of the docset compilation during the release build. Approved by: re (kib) Modified: stable/8/release/Makefile Modified: stable/8/release/Makefile ============================================================================== --- stable/8/release/Makefile Tue Sep 15 19:38:29 2009 (r197229) +++ stable/8/release/Makefile Tue Sep 15 19:56:35 2009 (r197230) @@ -1163,10 +1163,10 @@ iso.1: .endif # -# --==## Documentation Project files such as the Handbook and FAQ ##==-- +# --==## Documentation Project tools required to build the release notes ##==-- # doc.1: - @echo "Making docs..." + @echo "Making docproj tools..." @for i in ${DOCPORTS}; do \ cd /usr/ports/$$i && \ env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \ From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 19:58:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50075106566C; Tue, 15 Sep 2009 19:58:34 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5A08FC0C; Tue, 15 Sep 2009 19:58:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FJwYgM001416; Tue, 15 Sep 2009 19:58:34 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FJwYH3001414; Tue, 15 Sep 2009 19:58:34 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909151958.n8FJwYH3001414@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 19:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197231 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 19:58:34 -0000 Author: qingli Date: Tue Sep 15 19:58:33 2009 New Revision: 197231 URL: http://svn.freebsd.org/changeset/base/197231 Log: MFC r196714 This patch fixes the following issues: - Routing messages are not generated when adding and removing interface address aliases. - Loopback route installed for an interface address alias is not deleted from the routing table when that address alias is removed from the associated interface. - Function in_ifscrub() is called extraneously. Reviewed by: gnn, kmacy, sam Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/in.c Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Sep 15 19:56:35 2009 (r197230) +++ stable/8/sys/netinet/in.c Tue Sep 15 19:58:33 2009 (r197231) @@ -536,7 +536,6 @@ in_control(struct socket *so, u_long cmd hostIsNew = 0; } if (ifra->ifra_mask.sin_len) { - in_ifscrub(ifp, ia); ia->ia_sockmask = ifra->ifra_mask; ia->ia_sockmask.sin_family = AF_INET; ia->ia_subnetmask = @@ -545,7 +544,6 @@ in_control(struct socket *so, u_long cmd } if ((ifp->if_flags & IFF_POINTOPOINT) && (ifra->ifra_dstaddr.sin_family == AF_INET)) { - in_ifscrub(ifp, ia); ia->ia_dstaddr = ifra->ifra_dstaddr; maskIsNew = 1; /* We lie; but the effect's the same */ } @@ -991,6 +989,40 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { + struct route pfx_ro; + struct sockaddr_in *pfx_addr; + struct rtentry msg_rt; + + /* QL: XXX + * This is a bit questionable because there is no + * additional route entry added for an address alias. + * Therefore this route report is inaccurate. Perhaps + * it's better to supply a empty rtentry as how it + * is done in in_scrubprefix(). + */ + bzero(&pfx_ro, sizeof(pfx_ro)); + pfx_addr = (struct sockaddr_in *)(&pfx_ro.ro_dst); + pfx_addr->sin_len = sizeof(*pfx_addr); + pfx_addr->sin_family = AF_INET; + pfx_addr->sin_addr = prefix; + rtalloc_ign_fib(&pfx_ro, 0, 0); + if (pfx_ro.ro_rt != NULL) { + msg_rt = *pfx_ro.ro_rt; + /* QL: XXX + * Point the gateway to the given interface + * address as if a new prefix route entry has + * been added through the new address alias. + * All other parts of the rtentry is accurate, + * e.g., rt_key, rt_mask, rt_ifp etc. + */ + msg_rt.rt_gateway = + (struct sockaddr *)&ia->ia_addr; + rt_newaddrmsg(RTM_ADD, + (struct ifaddr *)target, + 0, &msg_rt); + RTFREE(pfx_ro.ro_rt); + } + IN_IFADDR_RUNLOCK(); return (0); } @@ -1024,9 +1056,6 @@ in_scrubprefix(struct in_ifaddr *target) struct rt_addrinfo info; struct sockaddr_dl null_sdl; - if ((target->ia_flags & IFA_ROUTE) == 0) - return (0); - /* * Remove the loopback route to the interface address. * The "useloopback" setting is not consulted because if the @@ -1054,6 +1083,20 @@ in_scrubprefix(struct in_ifaddr *target) log(LOG_INFO, "in_scrubprefix: deletion failed\n"); } + if ((target->ia_flags & IFA_ROUTE) == 0) { + struct rtentry rt; + + /* QL: XXX + * Report a blank rtentry when a route has not been + * installed for the given interface address. + */ + bzero(&rt, sizeof(rt)); + rt_newaddrmsg(RTM_DELETE, + (struct ifaddr *)target, + 0, &rt); + return (0); + } + if (rtinitflags(target)) prefix = target->ia_dstaddr.sin_addr; else { From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 20:21:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2A211065676; Tue, 15 Sep 2009 20:21:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFF398FC08; Tue, 15 Sep 2009 20:21:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FKLAFB002071; Tue, 15 Sep 2009 20:21:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FKLA2A002070; Tue, 15 Sep 2009 20:21:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909152021.n8FKLA2A002070@svn.freebsd.org> From: Attilio Rao Date: Tue, 15 Sep 2009 20:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197232 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 20:21:10 -0000 Author: attilio Date: Tue Sep 15 20:21:10 2009 New Revision: 197232 URL: http://svn.freebsd.org/changeset/base/197232 Log: Record merge for MFC of r197223, done in r197226. Requested by: kib Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 20:28:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17D711065676; Tue, 15 Sep 2009 20:28:30 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0508D8FC19; Tue, 15 Sep 2009 20:28:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FKSTdA002259; Tue, 15 Sep 2009 20:28:29 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FKSTZm002258; Tue, 15 Sep 2009 20:28:29 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909152028.n8FKSTZm002258@svn.freebsd.org> From: Attilio Rao Date: Tue, 15 Sep 2009 20:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197233 - in stable/8: lib/libdevinfo sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/contrib/dev/acpica sys/contrib/pf sys/dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 20:28:30 -0000 Author: attilio Date: Tue Sep 15 20:28:29 2009 New Revision: 197233 URL: http://svn.freebsd.org/changeset/base/197233 Log: ecorde merge for MFC of r197224, done in r197228. Requested by: kib Approved by: re (kib) Modified: stable/8/lib/libdevinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 21:15:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD6F0106566C; Tue, 15 Sep 2009 21:15:29 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD338FC14; Tue, 15 Sep 2009 21:15:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FLFTXi003411; Tue, 15 Sep 2009 21:15:29 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FLFTqb003409; Tue, 15 Sep 2009 21:15:29 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909152115.n8FLFTqb003409@svn.freebsd.org> From: Diomidis Spinellis Date: Tue, 15 Sep 2009 21:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197234 - head/lib/libc/regex/grot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 21:15:29 -0000 Author: dds Date: Tue Sep 15 21:15:29 2009 New Revision: 197234 URL: http://svn.freebsd.org/changeset/base/197234 Log: Add two test cases from PR 130504. An additional one coming from http://www.research.att.com/~gsf/testregex/ was not added; at some point the entire AT&T regression test harness should be imported here. But that would also mean commitment to fix the uncovered errors. PR: 130504 Submitted by: Chris Kuklewicz Modified: head/lib/libc/regex/grot/tests Modified: head/lib/libc/regex/grot/tests ============================================================================== --- head/lib/libc/regex/grot/tests Tue Sep 15 20:28:29 2009 (r197233) +++ head/lib/libc/regex/grot/tests Tue Sep 15 21:15:29 2009 (r197234) @@ -472,3 +472,6 @@ abcdefghijklmnop i abcdefghijklmnop abcd abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv (ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11 CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11 +# PR 130504 +(.|())(b) - ab ab +(()|.)(b) - ab ab From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 22:09:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FDC51065676; Tue, 15 Sep 2009 22:09:43 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1AB8FC15; Tue, 15 Sep 2009 22:09:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FM9gQK004482; Tue, 15 Sep 2009 22:09:42 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FM9ghw004481; Tue, 15 Sep 2009 22:09:42 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909152209.n8FM9ghw004481@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 22:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197235 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 22:09:43 -0000 Author: qingli Date: Tue Sep 15 22:09:42 2009 New Revision: 197235 URL: http://svn.freebsd.org/changeset/base/197235 Log: Reverting the previous change for now. Some users reports the patch fixes their issues but one reports a failure in NFS ROOT. Revert the change for now pending further investigation. Reviewed by: bz MFC after: immediately Modified: head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 21:15:29 2009 (r197234) +++ head/sys/nfsclient/nfs_vfsops.c Tue Sep 15 22:09:42 2009 (r197235) @@ -464,6 +464,10 @@ nfs_mountroot(struct mount *mp) } #endif + error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); + if (error) + panic("nfs_mountroot: SIOCAIFADDR: %d", error); + if ((cp = getenv("boot.netif.mtu")) != NULL) { ir.ifr_mtu = strtol(cp, NULL, 10); bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 22:23:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AB3310656E3; Tue, 15 Sep 2009 22:23:45 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 865CD8FC1D; Tue, 15 Sep 2009 22:23:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FMNjXL004831; Tue, 15 Sep 2009 22:23:45 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FMNjBX004826; Tue, 15 Sep 2009 22:23:45 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <200909152223.n8FMNjBX004826@svn.freebsd.org> From: Andre Oppermann Date: Tue, 15 Sep 2009 22:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197236 - in head/sys: conf kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 22:23:45 -0000 Author: andre Date: Tue Sep 15 22:23:45 2009 New Revision: 197236 URL: http://svn.freebsd.org/changeset/base/197236 Log: -Put the optimized soreceive_stream() under a compile time option called TCP_SORECEIVE_STREAM for the time being. Requested by: brooks Once compiled in make it easily switchable for testers by using a tuneable net.inet.tcp.soreceive_stream and a corresponding read-only sysctl to report the current state. Suggested by: rwatson MFC after: 2 days -This line, and those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M sys/conf/options M sys/kern/uipc_socket.c M sys/netinet/tcp_subr.c M sys/netinet/tcp_usrreq.c Modified: head/sys/conf/options head/sys/kern/uipc_socket.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_usrreq.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Sep 15 22:09:42 2009 (r197235) +++ head/sys/conf/options Tue Sep 15 22:23:45 2009 (r197236) @@ -416,6 +416,7 @@ SLIP_IFF_OPTS opt_slip.h TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading TCP_SIGNATURE opt_inet.h +TCP_SORECEIVE_STREAM opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK FLOWTABLE opt_route.h Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Sep 15 22:09:42 2009 (r197235) +++ head/sys/kern/uipc_socket.c Tue Sep 15 22:23:45 2009 (r197236) @@ -1870,6 +1870,7 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. */ +#ifdef TCP_SORECEIVE_STREAM int soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp) @@ -2062,6 +2063,7 @@ out: sbunlock(sb); return (error); } +#endif /* TCP_SORECEIVE_STREAM */ /* * Optimized version of soreceive() for simple datagram cases from userspace. Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Sep 15 22:09:42 2009 (r197235) +++ head/sys/netinet/tcp_subr.c Tue Sep 15 22:23:45 2009 (r197236) @@ -259,6 +259,12 @@ SYSCTL_VNET_INT(_net_inet_tcp_inflight, &VNET_NAME(tcp_inflight_stab), 0, "Inflight Algorithm Stabilization 20 = 2 packets"); +#ifdef TCP_SORECEIVE_STREAM +static int tcp_soreceive_stream = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, + &tcp_soreceive_stream, 0, "Using soreceive_stream for TCP sockets"); +#endif + VNET_DEFINE(uma_zone_t, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) @@ -420,6 +426,14 @@ tcp_init(void) tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; +#ifdef TCP_SORECEIVE_STREAM + TUNABLE_INT_FETCH("net.inet.tcp.soreceive_stream", &tcp_soreceive_stream); + if (tcp_soreceive_stream) { + tcp_usrreqs.pru_soreceive = soreceive_stream; + tcp6_usrreqs.pru_soreceive = soreceive_stream; + } +#endif + #ifdef INET6 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) #else /* INET6 */ Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Sep 15 22:09:42 2009 (r197235) +++ head/sys/netinet/tcp_usrreq.c Tue Sep 15 22:23:45 2009 (r197236) @@ -1015,9 +1015,6 @@ struct pr_usrreqs tcp_usrreqs = { .pru_send = tcp_usr_send, .pru_shutdown = tcp_usr_shutdown, .pru_sockaddr = in_getsockaddr, -#if 0 - .pru_soreceive = soreceive_stream, -#endif .pru_sosetlabel = in_pcbsosetlabel, .pru_close = tcp_usr_close, }; @@ -1039,9 +1036,6 @@ struct pr_usrreqs tcp6_usrreqs = { .pru_send = tcp_usr_send, .pru_shutdown = tcp_usr_shutdown, .pru_sockaddr = in6_mapped_sockaddr, -#if 0 - .pru_soreceive = soreceive_stream, -#endif .pru_sosetlabel = in_pcbsosetlabel, .pru_close = tcp_usr_close, }; From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 22:25:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1A99106566B; Tue, 15 Sep 2009 22:25:19 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C49BC8FC1E; Tue, 15 Sep 2009 22:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FMPJfH004898; Tue, 15 Sep 2009 22:25:19 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FMPJKL004895; Tue, 15 Sep 2009 22:25:19 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909152225.n8FMPJKL004895@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 22:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197237 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 22:25:20 -0000 Author: qingli Date: Tue Sep 15 22:25:19 2009 New Revision: 197237 URL: http://svn.freebsd.org/changeset/base/197237 Log: MFC r197210, 197212, 197235 The bootp code installs an interface address and the nfs client module tries to install the same address again. This extra code is removed, which was discovered by the removal of a call to in_ifscrub() in r196714. This call to in_ifscrub is put back here because the SIOCAIFADDR command can be used to change the prefix length of an existing alias. r197235 reverts file nfs_vfsops.c Reviewed by: kmacy Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/in.c stable/8/sys/nfsclient/nfs_vfsops.c Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Sep 15 22:23:45 2009 (r197236) +++ stable/8/sys/netinet/in.c Tue Sep 15 22:25:19 2009 (r197237) @@ -536,6 +536,16 @@ in_control(struct socket *so, u_long cmd hostIsNew = 0; } if (ifra->ifra_mask.sin_len) { + /* + * QL: XXX + * Need to scrub the prefix here in case + * the issued command is SIOCAIFADDR with + * the same address, but with a different + * prefix length. And if the prefix length + * is the same as before, then the call is + * un-necessarily executed here. + */ + in_ifscrub(ifp, ia); ia->ia_sockmask = ifra->ifra_mask; ia->ia_sockmask.sin_family = AF_INET; ia->ia_subnetmask = @@ -544,6 +554,7 @@ in_control(struct socket *so, u_long cmd } if ((ifp->if_flags & IFF_POINTOPOINT) && (ifra->ifra_dstaddr.sin_family == AF_INET)) { + in_ifscrub(ifp, ia); ia->ia_dstaddr = ifra->ifra_dstaddr; maskIsNew = 1; /* We lie; but the effect's the same */ } Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Tue Sep 15 22:23:45 2009 (r197236) +++ stable/8/sys/nfsclient/nfs_vfsops.c Tue Sep 15 22:25:19 2009 (r197237) @@ -463,9 +463,11 @@ nfs_mountroot(struct mount *mp) break; } #endif + error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); if (error) panic("nfs_mountroot: SIOCAIFADDR: %d", error); + if ((cp = getenv("boot.netif.mtu")) != NULL) { ir.ifr_mtu = strtol(cp, NULL, 10); bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 22:37:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C240106568D; Tue, 15 Sep 2009 22:37:18 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48EA28FC1A; Tue, 15 Sep 2009 22:37:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FMbIiZ005213; Tue, 15 Sep 2009 22:37:18 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FMbISa005212; Tue, 15 Sep 2009 22:37:18 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909152237.n8FMbISa005212@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 22:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197238 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 22:37:18 -0000 Author: qingli Date: Tue Sep 15 22:37:17 2009 New Revision: 197238 URL: http://svn.freebsd.org/changeset/base/197238 Log: MFC r197225 This patch enables the node to respond to ARP requests for configured proxy ARP entries. Reviewed by: bz Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/if_ether.c Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Tue Sep 15 22:25:19 2009 (r197237) +++ stable/8/sys/netinet/if_ether.c Tue Sep 15 22:37:17 2009 (r197238) @@ -694,62 +694,70 @@ reply: } else { struct llentry *lle = NULL; - if (!V_arp_proxyall) - goto drop; - sin.sin_addr = itaddr; - /* XXX MRT use table 0 for arp reply */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) - goto drop; - - /* - * Don't send proxies for nodes on the same interface - * as this one came out of, or we'll get into a fight - * over who claims what Ether address. - */ - if (!rt->rt_ifp || rt->rt_ifp == ifp) { - RTFREE_LOCKED(rt); - goto drop; - } - IF_AFDATA_LOCK(rt->rt_ifp); - lle = lla_lookup(LLTABLE(rt->rt_ifp), 0, (struct sockaddr *)&sin); - IF_AFDATA_UNLOCK(rt->rt_ifp); - RTFREE_LOCKED(rt); + IF_AFDATA_LOCK(ifp); + lle = lla_lookup(LLTABLE(ifp), 0, (struct sockaddr *)&sin); + IF_AFDATA_UNLOCK(ifp); - if (lle != NULL) { + if ((lle != NULL) && (lle->la_flags & LLE_PUB)) { (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), &lle->ll_addr, ah->ar_hln); LLE_RUNLOCK(lle); - } else - goto drop; + } else { - /* - * Also check that the node which sent the ARP packet - * is on the the interface we expect it to be on. This - * avoids ARP chaos if an interface is connected to the - * wrong network. - */ - sin.sin_addr = isaddr; + if (lle != NULL) + LLE_RUNLOCK(lle); - /* XXX MRT use table 0 for arp checks */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) - goto drop; - if (rt->rt_ifp != ifp) { - log(LOG_INFO, "arp_proxy: ignoring request" - " from %s via %s, expecting %s\n", - inet_ntoa(isaddr), ifp->if_xname, - rt->rt_ifp->if_xname); + if (!V_arp_proxyall) + goto drop; + + sin.sin_addr = itaddr; + /* XXX MRT use table 0 for arp reply */ + rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); + if (!rt) + goto drop; + + /* + * Don't send proxies for nodes on the same interface + * as this one came out of, or we'll get into a fight + * over who claims what Ether address. + */ + if (!rt->rt_ifp || rt->rt_ifp == ifp) { + RTFREE_LOCKED(rt); + goto drop; + } + RTFREE_LOCKED(rt); + + (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); + (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); + + /* + * Also check that the node which sent the ARP packet + * is on the the interface we expect it to be on. This + * avoids ARP chaos if an interface is connected to the + * wrong network. + */ + sin.sin_addr = isaddr; + + /* XXX MRT use table 0 for arp checks */ + rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); + if (!rt) + goto drop; + if (rt->rt_ifp != ifp) { + log(LOG_INFO, "arp_proxy: ignoring request" + " from %s via %s, expecting %s\n", + inet_ntoa(isaddr), ifp->if_xname, + rt->rt_ifp->if_xname); + RTFREE_LOCKED(rt); + goto drop; + } RTFREE_LOCKED(rt); - goto drop; - } - RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY - printf("arp: proxying for %s\n", - inet_ntoa(itaddr)); + printf("arp: proxying for %s\n", + inet_ntoa(itaddr)); #endif + } } if (itaddr.s_addr == myaddr.s_addr && From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 22:46:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F20D6106566C; Tue, 15 Sep 2009 22:46:07 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDB0B8FC12; Tue, 15 Sep 2009 22:46:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FMk6LH005420; Tue, 15 Sep 2009 22:46:06 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8FMk6Qm005414; Tue, 15 Sep 2009 22:46:06 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200909152246.n8FMk6Qm005414@svn.freebsd.org> From: Qing Li Date: Tue, 15 Sep 2009 22:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197239 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 22:46:08 -0000 Author: qingli Date: Tue Sep 15 22:46:06 2009 New Revision: 197239 URL: http://svn.freebsd.org/changeset/base/197239 Log: MFC r197227 Self pointing routes are installed for configured interface addresses and address aliases. After an interface is brought down and brought back up again, those self pointing routes disappeared. This patch ensures after an interface is brought back up, the loopback routes are reinstalled properly. Reviewed by: bz Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/if.c stable/8/sys/net/if_var.h stable/8/sys/netinet/in.c stable/8/sys/netinet/raw_ip.c stable/8/sys/netinet6/in6.c Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Tue Sep 15 22:37:17 2009 (r197238) +++ stable/8/sys/net/if.c Tue Sep 15 22:46:06 2009 (r197239) @@ -1414,6 +1414,59 @@ ifa_free(struct ifaddr *ifa) } } +int +ifa_add_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + int error = 0; + struct rtentry *rt = NULL; + struct rt_addrinfo info; + static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + + bzero(&info, sizeof(info)); + info.rti_ifp = V_loif; + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_info[RTAX_DST] = ia; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; + error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); + + if (error == 0 && rt != NULL) { + RT_LOCK(rt); + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = + rt->rt_ifp->if_type; + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = + rt->rt_ifp->if_index; + RT_REMREF(rt); + RT_UNLOCK(rt); + } else if (error != 0) + log(LOG_INFO, "ifa_add_loopback_route: insertion failed\n"); + + return (error); +} + +int +ifa_del_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + int error = 0; + struct rt_addrinfo info; + struct sockaddr_dl null_sdl; + + bzero(&null_sdl, sizeof(null_sdl)); + null_sdl.sdl_len = sizeof(null_sdl); + null_sdl.sdl_family = AF_LINK; + null_sdl.sdl_type = ifa->ifa_ifp->if_type; + null_sdl.sdl_index = ifa->ifa_ifp->if_index; + bzero(&info, sizeof(info)); + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_info[RTAX_DST] = ia; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; + error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); + + if (error != 0) + log(LOG_INFO, "ifa_del_loopback_route: deletion failed\n"); + + return (error); +} + /* * XXX: Because sockaddr_dl has deeper structure than the sockaddr * structs used to represent other address families, it is necessary Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Tue Sep 15 22:37:17 2009 (r197238) +++ stable/8/sys/net/if_var.h Tue Sep 15 22:46:06 2009 (r197239) @@ -854,6 +854,9 @@ struct ifnet *ifunit_ref(const char *); void ifq_init(struct ifaltq *, struct ifnet *ifp); void ifq_delete(struct ifaltq *); +int ifa_add_loopback_route(struct ifaddr *, struct sockaddr *); +int ifa_del_loopback_route(struct ifaddr *, struct sockaddr *); + struct ifaddr *ifa_ifwithaddr(struct sockaddr *); int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Sep 15 22:37:17 2009 (r197238) +++ stable/8/sys/netinet/in.c Tue Sep 15 22:46:06 2009 (r197239) @@ -827,9 +827,6 @@ in_ifinit(struct ifnet *ifp, struct in_i { register u_long i = ntohl(sin->sin_addr.s_addr); struct sockaddr_in oldaddr; - struct rtentry *rt = NULL; - struct rt_addrinfo info; - static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; int s = splimp(), flags = RTF_UP, error = 0; oldaddr = ia->ia_addr; @@ -927,25 +924,9 @@ in_ifinit(struct ifnet *ifp, struct in_i /* * add a loopback route to self */ - if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { - bzero(&info, sizeof(info)); - info.rti_ifp = V_loif; - info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); - - if (error == 0 && rt != NULL) { - RT_LOCK(rt); - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - rt->rt_ifp->if_index; - RT_REMREF(rt); - RT_UNLOCK(rt); - } else if (error != 0) - log(LOG_INFO, "in_ifinit: insertion failed\n"); - } + if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) + error = ifa_add_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); return (error); } @@ -1064,8 +1045,6 @@ in_scrubprefix(struct in_ifaddr *target) struct in_addr prefix, mask, p; int error; struct sockaddr_in prefix0, mask0; - struct rt_addrinfo info; - struct sockaddr_dl null_sdl; /* * Remove the loopback route to the interface address. @@ -1079,19 +1058,8 @@ in_scrubprefix(struct in_ifaddr *target) */ if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) && !(target->ia_ifp->if_flags & IFF_LOOPBACK)) { - bzero(&null_sdl, sizeof(null_sdl)); - null_sdl.sdl_len = sizeof(null_sdl); - null_sdl.sdl_family = AF_LINK; - null_sdl.sdl_type = V_loif->if_type; - null_sdl.sdl_index = V_loif->if_index; - bzero(&info, sizeof(info)); - info.rti_flags = target->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&target->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); - - if (error != 0) - log(LOG_INFO, "in_scrubprefix: deletion failed\n"); + error = ifa_del_loopback_route((struct ifaddr *)target, + (struct sockaddr *)&target->ia_addr); } if ((target->ia_flags & IFA_ROUTE) == 0) { Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Tue Sep 15 22:37:17 2009 (r197238) +++ stable/8/sys/netinet/raw_ip.c Tue Sep 15 22:46:06 2009 (r197239) @@ -715,6 +715,7 @@ rip_ctlinput(int cmd, struct sockaddr *s err = rtinit(&ia->ia_ifa, RTM_ADD, flags); if (err == 0) ia->ia_flags |= IFA_ROUTE; + err = ifa_add_loopback_route((struct ifaddr *)ia, sa); ifa_free(&ia->ia_ifa); break; } Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Tue Sep 15 22:37:17 2009 (r197238) +++ stable/8/sys/netinet6/in6.c Tue Sep 15 22:46:06 2009 (r197239) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1195,24 +1196,8 @@ in6_purgeaddr(struct ifaddr *ifa) * The check for the current setting of "nd6_useloopback" * is not needed. */ - { - struct rt_addrinfo info; - struct sockaddr_dl null_sdl; - - bzero(&null_sdl, sizeof(null_sdl)); - null_sdl.sdl_len = sizeof(null_sdl); - null_sdl.sdl_family = AF_LINK; - null_sdl.sdl_type = ia->ia_ifp->if_type; - null_sdl.sdl_index = ia->ia_ifp->if_index; - bzero(&info, sizeof(info)); - info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); - - if (error != 0) - log(LOG_INFO, "in6_purgeaddr: deletion failed\n"); - } + error = ifa_del_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); /* stop DAD processing */ nd6_dad_stop(ifa); @@ -1771,27 +1756,8 @@ in6_ifinit(struct ifnet *ifp, struct in6 if (!(ia->ia_flags & IFA_ROUTE) && (V_nd6_useloopback || (ifp->if_flags & IFF_LOOPBACK))) { - struct rt_addrinfo info; - struct rtentry *rt = NULL; - static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; - - bzero(&info, sizeof(info)); - info.rti_ifp = V_loif; - info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; - info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); - - if (error == 0 && rt != NULL) { - RT_LOCK(rt); - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - ifp->if_type; - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - ifp->if_index; - RT_REMREF(rt); - RT_UNLOCK(rt); - } else if (error != 0) - log(LOG_INFO, "in6_ifinit: error = %d, insertion failed\n", error); + error = ifa_add_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); } /* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 22:54:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5836A106568F for ; Tue, 15 Sep 2009 22:54:38 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 9BFA58FC17 for ; Tue, 15 Sep 2009 22:54:37 +0000 (UTC) Received: (qmail 7248 invoked from network); 15 Sep 2009 21:59:31 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 15 Sep 2009 21:59:31 -0000 Message-ID: <4AB014ED.3080304@freebsd.org> Date: Wed, 16 Sep 2009 00:27:57 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: Andre Oppermann References: <200909152223.n8FMNjBX004826@svn.freebsd.org> In-Reply-To: <200909152223.n8FMNjBX004826@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197236 - in head/sys: conf kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 22:54:38 -0000 Andre Oppermann wrote: > Author: andre > Date: Tue Sep 15 22:23:45 2009 > New Revision: 197236 > URL: http://svn.freebsd.org/changeset/base/197236 > > Log: > -Put the optimized soreceive_stream() under a compile time option called > TCP_SORECEIVE_STREAM for the time being. > > Requested by: brooks > > Once compiled in make it easily switchable for testers by using a tuneable > net.inet.tcp.soreceive_stream > and a corresponding read-only sysctl to report the current state. > > Suggested by: rwatson > > MFC after: 2 days > -This line, and those below, will be ignored-- This is funny... :-) Missed the dash. > > Description of fields to fill in above: 76 columns --| > > PR: If a GNATS PR is affected by the change. > > Submitted by: If someone else sent in the change. > > Reviewed by: If someone else reviewed your modification. > > Approved by: If you needed approval for this commit. > > Obtained from: If the change is from a third party. > > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > > Security: Vulnerability reference (one per line) or description. > > Empty fields above will be automatically removed. > > M sys/conf/options > M sys/kern/uipc_socket.c > M sys/netinet/tcp_subr.c > M sys/netinet/tcp_usrreq.c > > Modified: > head/sys/conf/options > head/sys/kern/uipc_socket.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/tcp_usrreq.c > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Tue Sep 15 22:09:42 2009 (r197235) > +++ head/sys/conf/options Tue Sep 15 22:23:45 2009 (r197236) > @@ -416,6 +416,7 @@ SLIP_IFF_OPTS opt_slip.h > TCPDEBUG > TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading > TCP_SIGNATURE opt_inet.h > +TCP_SORECEIVE_STREAM opt_inet.h > VLAN_ARRAY opt_vlan.h > XBONEHACK > FLOWTABLE opt_route.h > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Tue Sep 15 22:09:42 2009 (r197235) > +++ head/sys/kern/uipc_socket.c Tue Sep 15 22:23:45 2009 (r197236) > @@ -1870,6 +1870,7 @@ release: > /* > * Optimized version of soreceive() for stream (TCP) sockets. > */ > +#ifdef TCP_SORECEIVE_STREAM > int > soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, > struct mbuf **mp0, struct mbuf **controlp, int *flagsp) > @@ -2062,6 +2063,7 @@ out: > sbunlock(sb); > return (error); > } > +#endif /* TCP_SORECEIVE_STREAM */ > > /* > * Optimized version of soreceive() for simple datagram cases from userspace. > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Tue Sep 15 22:09:42 2009 (r197235) > +++ head/sys/netinet/tcp_subr.c Tue Sep 15 22:23:45 2009 (r197236) > @@ -259,6 +259,12 @@ SYSCTL_VNET_INT(_net_inet_tcp_inflight, > &VNET_NAME(tcp_inflight_stab), 0, > "Inflight Algorithm Stabilization 20 = 2 packets"); > > +#ifdef TCP_SORECEIVE_STREAM > +static int tcp_soreceive_stream = 0; > +SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, > + &tcp_soreceive_stream, 0, "Using soreceive_stream for TCP sockets"); > +#endif > + > VNET_DEFINE(uma_zone_t, sack_hole_zone); > #define V_sack_hole_zone VNET(sack_hole_zone) > > @@ -420,6 +426,14 @@ tcp_init(void) > tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; > tcp_tcbhashsize = hashsize; > > +#ifdef TCP_SORECEIVE_STREAM > + TUNABLE_INT_FETCH("net.inet.tcp.soreceive_stream", &tcp_soreceive_stream); > + if (tcp_soreceive_stream) { > + tcp_usrreqs.pru_soreceive = soreceive_stream; > + tcp6_usrreqs.pru_soreceive = soreceive_stream; > + } > +#endif > + > #ifdef INET6 > #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) > #else /* INET6 */ > > Modified: head/sys/netinet/tcp_usrreq.c > ============================================================================== > --- head/sys/netinet/tcp_usrreq.c Tue Sep 15 22:09:42 2009 (r197235) > +++ head/sys/netinet/tcp_usrreq.c Tue Sep 15 22:23:45 2009 (r197236) > @@ -1015,9 +1015,6 @@ struct pr_usrreqs tcp_usrreqs = { > .pru_send = tcp_usr_send, > .pru_shutdown = tcp_usr_shutdown, > .pru_sockaddr = in_getsockaddr, > -#if 0 > - .pru_soreceive = soreceive_stream, > -#endif > .pru_sosetlabel = in_pcbsosetlabel, > .pru_close = tcp_usr_close, > }; > @@ -1039,9 +1036,6 @@ struct pr_usrreqs tcp6_usrreqs = { > .pru_send = tcp_usr_send, > .pru_shutdown = tcp_usr_shutdown, > .pru_sockaddr = in6_mapped_sockaddr, > -#if 0 > - .pru_soreceive = soreceive_stream, > -#endif > .pru_sosetlabel = in_pcbsosetlabel, > .pru_close = tcp_usr_close, > }; > > From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 23:19:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3946C106566C; Tue, 15 Sep 2009 23:19:08 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id B223E8FC08; Tue, 15 Sep 2009 23:19:07 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAPe2r0qDaFvJ/2dsb2JhbADgAoQXBQ X-IronPort-AV: E=Sophos;i="4.44,392,1249272000"; d="scan'208";a="46434794" Received: from ganges.cs.uoguelph.ca ([131.104.91.201]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 15 Sep 2009 18:49:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ganges.cs.uoguelph.ca (Postfix) with ESMTP id CE2C6FB80B0; Tue, 15 Sep 2009 18:49:57 -0400 (EDT) X-Virus-Scanned: amavisd-new at ganges.cs.uoguelph.ca Received: from ganges.cs.uoguelph.ca ([127.0.0.1]) by localhost (ganges.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LDhdsKnfNoea; Tue, 15 Sep 2009 18:49:56 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by ganges.cs.uoguelph.ca (Postfix) with ESMTP id 8E683FB8064; Tue, 15 Sep 2009 18:49:56 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8FMtLB23601; Tue, 15 Sep 2009 18:55:21 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Tue, 15 Sep 2009 18:55:21 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: "Bjoern A. Zeeb" In-Reply-To: <20090915150034.U68375@maildrop.int.zabbadoz.net> Message-ID: References: <200909150101.n8F113sU071311@svn.freebsd.org> <20090915150034.U68375@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Qing Li , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197210 - in head/sys: netinet nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 23:19:08 -0000 On Tue, 15 Sep 2009, Bjoern A. Zeeb wrote: > On Tue, 15 Sep 2009, Qing Li wrote: > >> Author: qingli >> Date: Tue Sep 15 01:01:03 2009 >> New Revision: 197210 >> URL: http://svn.freebsd.org/changeset/base/197210 >> >> Log: >> The bootp code installs an interface address and the nfs client >> module tries to install the same address again. This extra code >> is removed, which was discovered by the removal of a call to >> in_ifscrub() in r196714. This call to in_ifscrub is put back here >> because the SIOCAIFADDR command can be used to change the prefix >> length of an existing alias. >> >> Reviewed by: kmacy > > This broke NFS Root for me in the netperf clsuter setup. > The NFS Root mount hang for ages (I reset the box after 1 hour). > > Backing out r197212 and this and it boots just fine again. > I don't know diddly about diskless booting and have no setup to test, but if I understood the problem, might something like the following work? rick --- nfsclient/nfs_vfsops.c.sav 2009-09-15 18:39:32.000000000 -0400 +++ nfsclient/nfs_vfsops.c 2009-09-15 18:41:52.000000000 -0400 @@ -416,13 +416,14 @@ struct socket *so; struct vnode *vp; struct ifreq ir; - int error; + int error, doioctl = 1; u_long l; char buf[128]; char *cp; #if defined(BOOTP_NFSROOT) && defined(BOOTP) bootpc_init(); /* use bootp to get nfs_diskless filled in */ + doioctl = 0; #elif defined(NFS_ROOT) nfs_setup_diskless(); #endif @@ -463,9 +464,11 @@ break; } #endif - error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); - if (error) - panic("nfs_mountroot: SIOCAIFADDR: %d", error); + if (doioctl) { + error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); + if (error) + panic("nfs_mountroot: SIOCAIFADDR: %d", error); + } if ((cp = getenv("boot.netif.mtu")) != NULL) { ir.ifr_mtu = strtol(cp, NULL, 10); bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); From owner-svn-src-all@FreeBSD.ORG Tue Sep 15 23:27:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2714F1065679; Tue, 15 Sep 2009 23:27:16 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by mx1.freebsd.org (Postfix) with ESMTP id DECC98FC1B; Tue, 15 Sep 2009 23:27:15 +0000 (UTC) Received: by pzk38 with SMTP id 38so3783767pzk.9 for ; Tue, 15 Sep 2009 16:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=fE0sUQVHEekJFkLH0MkP/MmAj1myeX4Y1IBEaAefwPo=; b=ihQ0JY4fdQYy0xK/EK9hLzDnVBlSeNsae9P/JN7IUUA17kgq52xYBveH+DIqjZ1vVy 1MeBUT2MyPu1Jh8r9cY18qr41cBDB3DPuKVw3lCMzwbKMkAFARr+zkdv55Qq2tADhyme FZW9eQQOIgjGigDoStJg5tggBbR9AdMp6+JPw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=lNDcwMu7h6nYDW5H3CBZo75L7amcPkriLJmaBe+KyyWUUy4MVf13hzkvESvwlhlsef iJjUuqXgrBazR6sMCr/VGxcGSIVny+DIuLqLs74nzTS9eYNf519to/8Zo0nEEWpTW81X kZbUg+9E+/PQBHv+5Si+hHMShKhmTer+m5Z50= MIME-Version: 1.0 Sender: tomelite82@gmail.com Received: by 10.142.195.6 with SMTP id s6mr580332wff.48.1253055838771; Tue, 15 Sep 2009 16:03:58 -0700 (PDT) In-Reply-To: References: <200909150101.n8F113sU071311@svn.freebsd.org> <20090915150034.U68375@maildrop.int.zabbadoz.net> Date: Tue, 15 Sep 2009 16:03:58 -0700 X-Google-Sender-Auth: d936ddb7367f91f5 Message-ID: <9ace436c0909151603m91831fat143f14855f036a1@mail.gmail.com> From: Qing Li To: Rick Macklem Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r197210 - in head/sys: netinet nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 23:27:16 -0000 The users who were reporting the NFS mount problems confirm the patch fixes their issues. At the moment I don't know why the patch would break NFS ROOT= . I just backed out the change so RC1 can be made but I will continue the investigation. --Qing On Tue, Sep 15, 2009 at 3:55 PM, Rick Macklem wrote: > > > On Tue, 15 Sep 2009, Bjoern A. Zeeb wrote: > >> On Tue, 15 Sep 2009, Qing Li wrote: >> >>> Author: qingli >>> Date: Tue Sep 15 01:01:03 2009 >>> New Revision: 197210 >>> URL: http://svn.freebsd.org/changeset/base/197210 >>> >>> Log: >>> =A0The bootp code installs an interface address and the nfs client >>> =A0module tries to install the same address again. This extra code >>> =A0is removed, which was discovered by the removal of a call to >>> =A0in_ifscrub() in r196714. This call to in_ifscrub is put back here >>> =A0because the SIOCAIFADDR command can be used to change the prefix >>> =A0length of an existing alias. >>> >>> =A0Reviewed by: =A0 =A0kmacy >> >> This broke NFS Root for me in the netperf clsuter setup. >> The NFS Root mount hang for ages (I reset the box after 1 hour). >> >> Backing out r197212 and this and it boots just fine again. >> > I don't know diddly about diskless booting and have no setup to test, > but if I understood the problem, might something like the following > work? > > rick > --- nfsclient/nfs_vfsops.c.sav =A02009-09-15 18:39:32.000000000 -0400 > +++ nfsclient/nfs_vfsops.c =A0 =A0 =A02009-09-15 18:41:52.000000000 -0400 > @@ -416,13 +416,14 @@ > =A0 =A0 =A0 =A0struct socket *so; > =A0 =A0 =A0 =A0struct vnode *vp; > =A0 =A0 =A0 =A0struct ifreq ir; > - =A0 =A0 =A0 int error; > + =A0 =A0 =A0 int error, doioctl =3D 1; > =A0 =A0 =A0 =A0u_long l; > =A0 =A0 =A0 =A0char buf[128]; > =A0 =A0 =A0 =A0char *cp; > > =A0#if defined(BOOTP_NFSROOT) && defined(BOOTP) > =A0 =A0 =A0 =A0bootpc_init(); =A0 =A0 =A0 =A0 =A0/* use bootp to get nfs_= diskless filled in */ > + =A0 =A0 =A0 doioctl =3D 0; > =A0#elif defined(NFS_ROOT) > =A0 =A0 =A0 =A0nfs_setup_diskless(); > =A0#endif > @@ -463,9 +464,11 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0} > =A0#endif > - =A0 =A0 =A0 error =3D ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); > - =A0 =A0 =A0 if (error) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 panic("nfs_mountroot: SIOCAIFADDR: %d", err= or); > + =A0 =A0 =A0 if (doioctl) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D ifioctl(so, SIOCAIFADDR, (caddr_t= )&nd->myif, td); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (error) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 panic("nfs_mountroot: SIOCA= IFADDR: %d", error); > + =A0 =A0 =A0 } > =A0 =A0 =A0 =A0if ((cp =3D getenv("boot.netif.mtu")) !=3D NULL) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ir.ifr_mtu =3D strtol(cp, NULL, 10); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bcopy(nd->myif.ifra_name, ir.ifr_name, IFN= AMSIZ); > From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 03:15:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBC64106566C; Wed, 16 Sep 2009 03:15:57 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA2C98FC0A; Wed, 16 Sep 2009 03:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G3Fv25010650; Wed, 16 Sep 2009 03:15:57 GMT (envelope-from sson@svn.freebsd.org) Received: (from sson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G3FvBB010648; Wed, 16 Sep 2009 03:15:57 GMT (envelope-from sson@svn.freebsd.org) Message-Id: <200909160315.n8G3FvBB010648@svn.freebsd.org> From: Stacey Son Date: Wed, 16 Sep 2009 03:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197240 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 03:15:58 -0000 Author: sson Date: Wed Sep 16 03:15:57 2009 New Revision: 197240 URL: http://svn.freebsd.org/changeset/base/197240 Log: Add optional touch event filter hooks to kevents. The touch event filter is called when a kernel event data is possibly updated. There are two hook points. First, during a kevent() system call. Second, when an event has been triggered. Approved by: rwatson (co-mentor) Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Tue Sep 15 22:46:06 2009 (r197239) +++ head/sys/kern/kern_event.c Wed Sep 16 03:15:57 2009 (r197240) @@ -1,6 +1,7 @@ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon * Copyright 2004 John-Mark Gurney + * Copyright (c) 2009 Apple, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -934,17 +935,11 @@ findkn: goto findkn; } - if (kn == NULL && ((kev->flags & EV_ADD) == 0)) { - KQ_UNLOCK(kq); - error = ENOENT; - goto done; - } - /* * kn now contains the matching knote, or NULL if no match */ - if (kev->flags & EV_ADD) { - if (kn == NULL) { + if (kn == NULL) { + if (kev->flags & EV_ADD) { kn = tkn; tkn = NULL; if (kn == NULL) { @@ -983,34 +978,16 @@ findkn: goto done; } KN_LIST_LOCK(kn); + goto done_ev_add; } else { - /* - * The user may change some filter values after the - * initial EV_ADD, but doing so will not reset any - * filter which has already been triggered. - */ - kn->kn_status |= KN_INFLUX; + /* No matching knote and the EV_ADD flag is not set. */ KQ_UNLOCK(kq); - KN_LIST_LOCK(kn); - kn->kn_sfflags = kev->fflags; - kn->kn_sdata = kev->data; - kn->kn_kevent.udata = kev->udata; + error = ENOENT; + goto done; } - - /* - * We can get here with kn->kn_knlist == NULL. - * This can happen when the initial attach event decides that - * the event is "completed" already. i.e. filt_procattach - * is called on a zombie process. It will call filt_proc - * which will remove it from the list, and NULL kn_knlist. - */ - event = kn->kn_fop->f_event(kn, 0); - KQ_LOCK(kq); - if (event) - KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_INFLUX; - KN_LIST_UNLOCK(kn); - } else if (kev->flags & EV_DELETE) { + } + + if (kev->flags & EV_DELETE) { kn->kn_status |= KN_INFLUX; KQ_UNLOCK(kq); if (!(kn->kn_status & KN_DETACHED)) @@ -1019,6 +996,37 @@ findkn: goto done; } + /* + * The user may change some filter values after the initial EV_ADD, + * but doing so will not reset any filter which has already been + * triggered. + */ + kn->kn_status |= KN_INFLUX; + KQ_UNLOCK(kq); + KN_LIST_LOCK(kn); + kn->kn_kevent.udata = kev->udata; + if (!fops->f_isfd && fops->f_touch != NULL) { + fops->f_touch(kn, kev, EVENT_REGISTER); + } else { + kn->kn_sfflags = kev->fflags; + kn->kn_sdata = kev->data; + } + + /* + * We can get here with kn->kn_knlist == NULL. This can happen when + * the initial attach event decides that the event is "completed" + * already. i.e. filt_procattach is called on a zombie process. It + * will call filt_proc which will remove it from the list, and NULL + * kn_knlist. + */ +done_ev_add: + event = kn->kn_fop->f_event(kn, 0); + KQ_LOCK(kq); + if (event) + KNOTE_ACTIVATE(kn, 1); + kn->kn_status &= ~KN_INFLUX; + KN_LIST_UNLOCK(kn); + if ((kev->flags & EV_DISABLE) && ((kn->kn_status & KN_DISABLED) == 0)) { kn->kn_status |= KN_DISABLED; @@ -1198,7 +1206,7 @@ kqueue_scan(struct kqueue *kq, int maxev struct timeval atv, rtv, ttv; struct knote *kn, *marker; int count, timeout, nkev, error, influx; - int haskqglobal; + int haskqglobal, touch; count = maxevents; nkev = 0; @@ -1330,12 +1338,23 @@ start: influx = 1; continue; } - *kevp = kn->kn_kevent; + touch = (!kn->kn_fop->f_isfd && + kn->kn_fop->f_touch != NULL); + if (touch) + kn->kn_fop->f_touch(kn, kevp, EVENT_PROCESS); + else + *kevp = kn->kn_kevent; KQ_LOCK(kq); KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); if (kn->kn_flags & EV_CLEAR) { - kn->kn_data = 0; - kn->kn_fflags = 0; + /* + * Manually clear knotes who weren't + * 'touch'ed. + */ + if (touch == 0) { + kn->kn_data = 0; + kn->kn_fflags = 0; + } kn->kn_status &= ~(KN_QUEUED | KN_ACTIVE); kq->kq_count--; } else Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Tue Sep 15 22:46:06 2009 (r197239) +++ head/sys/sys/event.h Wed Sep 16 03:15:57 2009 (r197240) @@ -154,11 +154,22 @@ MALLOC_DECLARE(M_KQUEUE); */ #define NOTE_SIGNAL 0x08000000 +/* + * Hint values for the optional f_touch event filter. If f_touch is not set + * to NULL and f_isfd is zero the f_touch filter will be called with the type + * argument set to EVENT_REGISTER during a kevent() system call. It is also + * called under the same conditions with the type argument set to EVENT_PROCESS + * when the event has been triggered. + */ +#define EVENT_REGISTER 1 +#define EVENT_PROCESS 2 + struct filterops { int f_isfd; /* true if ident == filedescriptor */ int (*f_attach)(struct knote *kn); void (*f_detach)(struct knote *kn); int (*f_event)(struct knote *kn, long hint); + void (*f_touch)(struct knote *kn, struct kevent *kev, long type); }; /* @@ -193,6 +204,7 @@ struct knote { } kn_ptr; struct filterops *kn_fop; void *kn_hook; + int kn_hookid; #define kn_id kn_kevent.ident #define kn_filter kn_kevent.filter From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 03:30:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE9D81065695; Wed, 16 Sep 2009 03:30:12 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCBC08FC1E; Wed, 16 Sep 2009 03:30:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G3UC2H010924; Wed, 16 Sep 2009 03:30:12 GMT (envelope-from sson@svn.freebsd.org) Received: (from sson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G3UCLR010920; Wed, 16 Sep 2009 03:30:12 GMT (envelope-from sson@svn.freebsd.org) Message-Id: <200909160330.n8G3UCLR010920@svn.freebsd.org> From: Stacey Son Date: Wed, 16 Sep 2009 03:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197241 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 03:30:12 -0000 Author: sson Date: Wed Sep 16 03:30:12 2009 New Revision: 197241 URL: http://svn.freebsd.org/changeset/base/197241 Log: Add EVFILT_USER to kevents. Add user events support to kernel events which are not associated with any kernel mechanism but are triggered by user level code. This is useful for adding user level events to an event handler that may also be monitoring kernel events. Approved by: rwatson (co-mentor) Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Wed Sep 16 03:15:57 2009 (r197240) +++ head/lib/libc/sys/kqueue.2 Wed Sep 16 03:30:12 2009 (r197241) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 6, 2007 +.Dd September 15, 2009 .Dt KQUEUE 2 .Os .Sh NAME @@ -441,6 +441,44 @@ The link state is invalid. On return, .Va fflags contains the events which triggered the filter. +.It Dv EVFILT_USER +Establishes a user event identified by +.Va ident +which is not assosicated with any kernel mechanism but is triggered by +user level code. +The lower 24 bits of the +.Va fflags +may be used for user defined flags and manipulated using the following: +.Bl -tag -width XXNOTE_FFLAGSMASK +.It Dv NOTE_FFNOP +Ignore the input +.Va fflags . +.It Dv NOTE_FFAND +Bitwise AND +.Va fflags . +.It Dv NOTE_FFOR +Bitwise OR +.Va fflags . +.It Dv NOTE_COPY +Copy +.Va fflags . +.It Dv NOTE_FFCTRLMASK +Control mask for +.Va fflags . +.It Dv NOTE_FFLAGSMASK +User defined flag mask for +.Va fflags . +.El +.Pp +A user event is triggered for output with the following: +.Bl -tag -width XXNOTE_FFLAGSMASK +.It Dv NOTE_TRIGGER +Cause the event to be triggered. +.El +.Pp +On return, +.Va fflags +contains the users defined flags in the lower 24 bits. .El .Sh RETURN VALUES The Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Sep 16 03:15:57 2009 (r197240) +++ head/sys/kern/kern_event.c Wed Sep 16 03:30:12 2009 (r197241) @@ -142,6 +142,10 @@ static void filt_timerexpire(void *knx); static int filt_timerattach(struct knote *kn); static void filt_timerdetach(struct knote *kn); static int filt_timer(struct knote *kn, long hint); +static int filt_userattach(struct knote *kn); +static void filt_userdetach(struct knote *kn); +static int filt_user(struct knote *kn, long hint); +static void filt_usertouch(struct knote *kn, struct kevent *kev, long type); static struct filterops file_filtops = { .f_isfd = 1, @@ -165,6 +169,12 @@ static struct filterops timer_filtops = .f_detach = filt_timerdetach, .f_event = filt_timer, }; +static struct filterops user_filtops = { + .f_attach = filt_userattach, + .f_detach = filt_userdetach, + .f_event = filt_user, + .f_touch = filt_usertouch, +}; static uma_zone_t knote_zone; static int kq_ncallouts = 0; @@ -271,6 +281,7 @@ static struct { { &file_filtops }, /* EVFILT_NETDEV */ { &fs_filtops }, /* EVFILT_FS */ { &null_filtops }, /* EVFILT_LIO */ + { &user_filtops }, /* EVFILT_USER */ }; /* @@ -573,6 +584,94 @@ filt_timer(struct knote *kn, long hint) return (kn->kn_data != 0); } +static int +filt_userattach(struct knote *kn) +{ + + /* + * EVFILT_USER knotes are not attached to anything in the kernel. + */ + kn->kn_hook = NULL; + if (kn->kn_fflags & NOTE_TRIGGER) + kn->kn_hookid = 1; + else + kn->kn_hookid = 0; + return (0); +} + +static void +filt_userdetach(__unused struct knote *kn) +{ + + /* + * EVFILT_USER knotes are not attached to anything in the kernel. + */ +} + +static int +filt_user(struct knote *kn, __unused long hint) +{ + + return (kn->kn_hookid); +} + +static void +filt_usertouch(struct knote *kn, struct kevent *kev, long type) +{ + int ffctrl; + + switch (type) { + case EVENT_REGISTER: + if (kev->fflags & NOTE_TRIGGER) + kn->kn_hookid = 1; + + ffctrl = kev->fflags & NOTE_FFCTRLMASK; + kev->fflags &= NOTE_FFLAGSMASK; + switch (ffctrl) { + case NOTE_FFNOP: + break; + + case NOTE_FFAND: + kn->kn_sfflags &= kev->fflags; + break; + + case NOTE_FFOR: + kn->kn_sfflags |= kev->fflags; + break; + + case NOTE_FFCOPY: + kn->kn_sfflags = kev->fflags; + break; + + default: + /* XXX Return error? */ + break; + } + kn->kn_sdata = kev->data; + if (kev->flags & EV_CLEAR) { + kn->kn_hookid = 0; + kn->kn_data = 0; + kn->kn_fflags = 0; + } + break; + + case EVENT_PROCESS: + *kev = kn->kn_kevent; + kev->fflags = kn->kn_sfflags; + kev->data = kn->kn_sdata; + if (kn->kn_flags & EV_CLEAR) { + kn->kn_hookid = 0; + kn->kn_data = 0; + kn->kn_fflags = 0; + } + break; + + default: + panic("filt_usertouch() - invalid type (%ld)", type); + break; + } +} + int kqueue(struct thread *td, struct kqueue_args *uap) { Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Wed Sep 16 03:15:57 2009 (r197240) +++ head/sys/sys/event.h Wed Sep 16 03:30:12 2009 (r197241) @@ -41,7 +41,8 @@ #define EVFILT_NETDEV (-8) /* network devices */ #define EVFILT_FS (-9) /* filesystem events */ #define EVFILT_LIO (-10) /* attached to lio requests */ -#define EVFILT_SYSCOUNT 10 +#define EVFILT_USER (-11) /* User events */ +#define EVFILT_SYSCOUNT 11 #define EV_SET(kevp_, a, b, c, d, e, f) do { \ struct kevent *kevp = (kevp_); \ @@ -79,6 +80,25 @@ struct kevent { #define EV_EOF 0x8000 /* EOF detected */ #define EV_ERROR 0x4000 /* error, data contains errno */ + /* + * data/hint flags/masks for EVFILT_USER, shared with userspace + * + * On input, the top two bits of fflags specifies how the lower twenty four + * bits should be applied to the stored value of fflags. + * + * On output, the top two bits will always be set to NOTE_FFNOP and the + * remaining twenty four bits will contain the stored fflags value. + */ +#define NOTE_FFNOP 0x00000000 /* ignore input fflags */ +#define NOTE_FFAND 0x40000000 /* AND fflags */ +#define NOTE_FFOR 0x80000000 /* OR fflags */ +#define NOTE_FFCOPY 0xc0000000 /* copy fflags */ +#define NOTE_FFCTRLMASK 0xc0000000 /* masks for operations */ +#define NOTE_FFLAGSMASK 0x00ffffff + +#define NOTE_TRIGGER 0x01000000 /* Cause the event to be + triggered for output. */ + /* * data/hint flags for EVFILT_{READ|WRITE}, shared with userspace */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 03:37:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7590B106566C; Wed, 16 Sep 2009 03:37:40 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8918FC20; Wed, 16 Sep 2009 03:37:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G3beZY011100; Wed, 16 Sep 2009 03:37:40 GMT (envelope-from sson@svn.freebsd.org) Received: (from sson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G3beX9011096; Wed, 16 Sep 2009 03:37:40 GMT (envelope-from sson@svn.freebsd.org) Message-Id: <200909160337.n8G3beX9011096@svn.freebsd.org> From: Stacey Son Date: Wed, 16 Sep 2009 03:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197242 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 03:37:40 -0000 Author: sson Date: Wed Sep 16 03:37:39 2009 New Revision: 197242 URL: http://svn.freebsd.org/changeset/base/197242 Log: Add the EV_DISPATCH flag to kevents. When the EV_DISPATCH flag is used the event source will be disabled immediately after the delivery of an event. This is similar to the EV_ONESHOT flag but it doesn't delete the event. Approved by: rwatson (co-mentor) Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Wed Sep 16 03:30:12 2009 (r197241) +++ head/lib/libc/sys/kqueue.2 Wed Sep 16 03:37:39 2009 (r197242) @@ -201,6 +201,11 @@ Disable the event so .Fn kevent will not return it. The filter itself is not disabled. +.It EV_DISPATCH +Disable the event source immediately after delivery of an event. +See +.Dv EV_DISABLE +above. .It EV_DELETE Removes the event from the kqueue. Events which are attached to Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Sep 16 03:30:12 2009 (r197241) +++ head/sys/kern/kern_event.c Wed Sep 16 03:37:39 2009 (r197242) @@ -1445,15 +1445,17 @@ start: *kevp = kn->kn_kevent; KQ_LOCK(kq); KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); - if (kn->kn_flags & EV_CLEAR) { + if (kn->kn_flags & (EV_CLEAR | EV_DISPATCH)) { /* * Manually clear knotes who weren't * 'touch'ed. */ - if (touch == 0) { + if (touch == 0 && kn->kn_flags & EV_CLEAR) { kn->kn_data = 0; kn->kn_fflags = 0; } + if (kn->kn_flags & EV_DISPATCH) + kn->kn_status |= KN_DISABLED; kn->kn_status &= ~(KN_QUEUED | KN_ACTIVE); kq->kq_count--; } else Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Wed Sep 16 03:30:12 2009 (r197241) +++ head/sys/sys/event.h Wed Sep 16 03:37:39 2009 (r197242) @@ -72,6 +72,8 @@ struct kevent { /* flags */ #define EV_ONESHOT 0x0010 /* only report one occurrence */ #define EV_CLEAR 0x0020 /* clear event state after reporting */ + /* 0x0040 reserved for EV_RECEIPT */ +#define EV_DISPATCH 0x0080 /* disable event after reporting */ #define EV_SYSFLAGS 0xF000 /* reserved by system */ #define EV_FLAG1 0x2000 /* filter-specific flag */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 03:49:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADA7A1065679; Wed, 16 Sep 2009 03:49:54 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C538FC0C; Wed, 16 Sep 2009 03:49:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G3nspW011328; Wed, 16 Sep 2009 03:49:54 GMT (envelope-from sson@svn.freebsd.org) Received: (from sson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G3nsZo011324; Wed, 16 Sep 2009 03:49:54 GMT (envelope-from sson@svn.freebsd.org) Message-Id: <200909160349.n8G3nsZo011324@svn.freebsd.org> From: Stacey Son Date: Wed, 16 Sep 2009 03:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197243 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 03:49:54 -0000 Author: sson Date: Wed Sep 16 03:49:54 2009 New Revision: 197243 URL: http://svn.freebsd.org/changeset/base/197243 Log: Add EV_RECEIPT to kevents. EV_RECEIPT is useful to disambiguating error conditions when multiple events structures are passed to kevent(2). The error code is returned in the data field and EV_ERROR is set. Approved by: rwatson (co-mentor) Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Wed Sep 16 03:37:39 2009 (r197242) +++ head/lib/libc/sys/kqueue.2 Wed Sep 16 03:49:54 2009 (r197243) @@ -211,6 +211,15 @@ Removes the event from the kqueue. Events which are attached to file descriptors are automatically deleted on the last close of the descriptor. +.It EV_RECEIPT +This flag is useful for making bulk changes to a kqueue without draining +any pending events. +When passed as input, it forces +.Dv EV_ERROR +to always be returned. +When a filter is successfully added the +.Va data +field will be zero. .It EV_ONESHOT Causes the event to return only the first occurrence of the filter being triggered. Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Sep 16 03:37:39 2009 (r197242) +++ head/sys/kern/kern_event.c Wed Sep 16 03:49:54 2009 (r197243) @@ -832,7 +832,7 @@ kern_kevent(struct thread *td, int fd, i continue; kevp->flags &= ~EV_SYSFLAGS; error = kqueue_register(kq, kevp, td, 1); - if (error) { + if (error || (kevp->flags & EV_RECEIPT)) { if (nevents != 0) { kevp->flags = EV_ERROR; kevp->data = error; Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Wed Sep 16 03:37:39 2009 (r197242) +++ head/sys/sys/event.h Wed Sep 16 03:49:54 2009 (r197243) @@ -72,7 +72,7 @@ struct kevent { /* flags */ #define EV_ONESHOT 0x0010 /* only report one occurrence */ #define EV_CLEAR 0x0020 /* clear event state after reporting */ - /* 0x0040 reserved for EV_RECEIPT */ +#define EV_RECEIPT 0x0040 /* force EV_ERROR on success, data=0 */ #define EV_DISPATCH 0x0080 /* disable event after reporting */ #define EV_SYSFLAGS 0xF000 /* reserved by system */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 05:33:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23AEC106566B; Wed, 16 Sep 2009 05:33:16 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 115A38FC1C; Wed, 16 Sep 2009 05:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G5XFq6013229; Wed, 16 Sep 2009 05:33:15 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G5XFg4013222; Wed, 16 Sep 2009 05:33:15 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200909160533.n8G5XFg4013222@svn.freebsd.org> From: Mike Silbersack Date: Wed, 16 Sep 2009 05:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197244 - in head: sys/netinet usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 05:33:16 -0000 Author: silby Date: Wed Sep 16 05:33:15 2009 New Revision: 197244 URL: http://svn.freebsd.org/changeset/base/197244 Log: Add the ability to see TCP timers via netstat -x. This can be a useful feature when you have a seemingly stuck socket and want to figure out why it has not been closed yet. No plans to MFC this, as it changes the netstat sysctl ABI. Reviewed by: andre, rwatson, Eric Van Gyzen Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h head/usr.bin/netstat/inet.c head/usr.bin/netstat/netstat.1 Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Sep 16 03:49:54 2009 (r197243) +++ head/sys/netinet/tcp_subr.c Wed Sep 16 05:33:15 2009 (r197244) @@ -1151,8 +1151,11 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) else if (inp->inp_flags & INP_TIMEWAIT) { bzero((char *) &xt.xt_tp, sizeof xt.xt_tp); xt.xt_tp.t_state = TCPS_TIME_WAIT; - } else + } else { bcopy(inp_ppcb, &xt.xt_tp, sizeof xt.xt_tp); + if (xt.xt_tp.t_timers) + tcp_timer_to_xtimer(&xt.xt_tp, xt.xt_tp.t_timers, &xt.xt_timer); + } if (inp->inp_socket != NULL) sotoxsocket(inp->inp_socket, &xt.xt_socket); else { Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Sep 16 03:49:54 2009 (r197243) +++ head/sys/netinet/tcp_timer.c Wed Sep 16 05:33:15 2009 (r197244) @@ -659,3 +659,24 @@ tcp_timer_active(struct tcpcb *tp, int t } return callout_active(t_callout); } + +#define ticks_to_msecs(t) (1000*(t) / hz) + +void +tcp_timer_to_xtimer(struct tcpcb *tp, struct tcp_timer *timer, struct xtcp_timer *xtimer) +{ + bzero(xtimer, sizeof(struct xtcp_timer)); + if (timer == NULL) + return; + if (callout_active(&timer->tt_delack)) + xtimer->tt_delack = ticks_to_msecs(timer->tt_delack.c_time - ticks); + if (callout_active(&timer->tt_rexmt)) + xtimer->tt_rexmt = ticks_to_msecs(timer->tt_rexmt.c_time - ticks); + if (callout_active(&timer->tt_persist)) + xtimer->tt_persist = ticks_to_msecs(timer->tt_persist.c_time - ticks); + if (callout_active(&timer->tt_keep)) + xtimer->tt_keep = ticks_to_msecs(timer->tt_keep.c_time - ticks); + if (callout_active(&timer->tt_2msl)) + xtimer->tt_2msl = ticks_to_msecs(timer->tt_2msl.c_time - ticks); + xtimer->t_rcvtime = ticks_to_msecs(ticks - tp->t_rcvtime); +} Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Wed Sep 16 03:49:54 2009 (r197243) +++ head/sys/netinet/tcp_timer.h Wed Sep 16 05:33:15 2009 (r197244) @@ -141,6 +141,8 @@ static const char *tcptimers[] = #ifdef _KERNEL +struct xtcp_timer; + struct tcp_timer { struct callout tt_rexmt; /* retransmit timer */ struct callout tt_persist; /* retransmit persistence */ @@ -177,6 +179,8 @@ void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); void tcp_timer_delack(void *xtp); +void tcp_timer_to_xtimer(struct tcpcb *tp, struct tcp_timer *timer, + struct xtcp_timer *xtimer); #endif /* _KERNEL */ Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Sep 16 03:49:54 2009 (r197243) +++ head/sys/netinet/tcp_var.h Wed Sep 16 05:33:15 2009 (r197244) @@ -495,11 +495,20 @@ void kmod_tcpstat_inc(int statnum); * included. Not all of our clients do. */ #if defined(_NETINET_IN_PCB_H_) && defined(_SYS_SOCKETVAR_H_) +struct xtcp_timer { + int tt_rexmt; /* retransmit timer */ + int tt_persist; /* retransmit persistence */ + int tt_keep; /* keepalive */ + int tt_2msl; /* 2*msl TIME_WAIT timer */ + int tt_delack; /* delayed ACK timer */ + int t_rcvtime; /* Time since last packet received */ +}; struct xtcpcb { size_t xt_len; struct inpcb xt_inp; struct tcpcb xt_tp; struct xsocket xt_socket; + struct xtcp_timer xt_timer; u_quad_t xt_alignment_hack; }; #endif Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Wed Sep 16 03:49:54 2009 (r197243) +++ head/usr.bin/netstat/inet.c Wed Sep 16 05:33:15 2009 (r197244) @@ -313,6 +313,7 @@ protopr(u_long off, const char *name, in struct inpcb *inp; struct xinpgen *xig, *oxig; struct xsocket *so; + struct xtcp_timer *timer; istcp = 0; switch (proto) { @@ -347,6 +348,7 @@ protopr(u_long off, const char *name, in xig->xig_len > sizeof(struct xinpgen); xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { if (istcp) { + timer = &((struct xtcpcb *)xig)->xt_timer; tp = &((struct xtcpcb *)xig)->xt_tp; inp = &((struct xtcpcb *)xig)->xt_inp; so = &((struct xtcpcb *)xig)->xt_socket; @@ -414,14 +416,17 @@ protopr(u_long off, const char *name, in "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", "Proto", "Recv-Q", "Send-Q", "Local Address", "Foreign Address"); - if (xflag) - printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n", + if (xflag) { + printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s ", "R-MBUF", "S-MBUF", "R-CLUS", "S-CLUS", "R-HIWA", "S-HIWA", "R-LOWA", "S-LOWA", "R-BCNT", - "S-BCNT", "R-BMAX", "S-BMAX", - "(state)"); - else + "S-BCNT", "R-BMAX", "S-BMAX"); + printf("%7.7s %7.7s %7.7s %7.7s %7.7s %7.7s %s\n", + "rexmt", "persist", "keep", + "2msl", "delack", "rcvtime", + "(state)"); + } else printf("(state)\n"); } first = 0; @@ -516,7 +521,7 @@ protopr(u_long off, const char *name, in so->so_rcv.sb_lowat, so->so_snd.sb_lowat, so->so_rcv.sb_mbcnt, so->so_snd.sb_mbcnt, so->so_rcv.sb_mbmax, so->so_snd.sb_mbmax); - else + else { printf("%6u %6u %6u %6u %6u %6u %6u %6u %6u %6u %6u %6u ", so->so_rcv.sb_mcnt, so->so_snd.sb_mcnt, so->so_rcv.sb_ccnt, so->so_snd.sb_ccnt, @@ -524,6 +529,14 @@ protopr(u_long off, const char *name, in so->so_rcv.sb_lowat, so->so_snd.sb_lowat, so->so_rcv.sb_mbcnt, so->so_snd.sb_mbcnt, so->so_rcv.sb_mbmax, so->so_snd.sb_mbmax); + printf("%4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d ", + timer->tt_rexmt / 1000, (timer->tt_rexmt % 1000) / 10, + timer->tt_persist / 1000, (timer->tt_persist % 1000) / 10, + timer->tt_keep / 1000, (timer->tt_keep % 1000) / 10, + timer->tt_2msl / 1000, (timer->tt_2msl % 1000) / 10, + timer->tt_delack / 1000, (timer->tt_delack % 1000) / 10, + timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10); + } } if (istcp && !Lflag) { if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES) Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Wed Sep 16 03:49:54 2009 (r197243) +++ head/usr.bin/netstat/netstat.1 Wed Sep 16 05:33:15 2009 (r197244) @@ -87,7 +87,7 @@ show network addresses as numbers (as wi but show ports symbolically. If .Fl x -is present display full socket buffer statistics for each internet socket. +is present, display socket buffer and tcp timer statistics for each internet socket. .It Xo .Bk -words .Nm From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 06:29:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D08A1065676; Wed, 16 Sep 2009 06:29:23 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CBC48FC31; Wed, 16 Sep 2009 06:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G6TNKb014283; Wed, 16 Sep 2009 06:29:23 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G6TN4b014281; Wed, 16 Sep 2009 06:29:23 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909160629.n8G6TN4b014281@svn.freebsd.org> From: Diomidis Spinellis Date: Wed, 16 Sep 2009 06:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197245 - head/lib/libc/regex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 06:29:23 -0000 Author: dds Date: Wed Sep 16 06:29:23 2009 New Revision: 197245 URL: http://svn.freebsd.org/changeset/base/197245 Log: Add a couple of debugging statements. Modified: head/lib/libc/regex/engine.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Wed Sep 16 05:33:15 2009 (r197244) +++ head/lib/libc/regex/engine.c Wed Sep 16 06:29:23 2009 (r197245) @@ -247,6 +247,8 @@ matcher(struct re_guts *g, if (g->moffset > -1) start = ((dp - g->moffset) < start) ? start : dp - g->moffset; + SP("mloop", m->st, *start); + /* this loop does only one repetition except for backrefs */ for (;;) { endp = fast(m, start, stop, gf, gl); @@ -787,6 +789,7 @@ fast( struct match *m, CLEAR(st); SET1(st, startst); + SP("fast", st, *p); st = step(m->g, startst, stopst, st, NOTHING, st); ASSIGN(fresh, st); SP("start", st, *p); From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 06:32:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81768106566C; Wed, 16 Sep 2009 06:32:23 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 712AB8FC15; Wed, 16 Sep 2009 06:32:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G6WNMb014371; Wed, 16 Sep 2009 06:32:23 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G6WNNe014369; Wed, 16 Sep 2009 06:32:23 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200909160632.n8G6WNNe014369@svn.freebsd.org> From: Diomidis Spinellis Date: Wed, 16 Sep 2009 06:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197246 - head/lib/libc/regex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 06:32:23 -0000 Author: dds Date: Wed Sep 16 06:32:23 2009 New Revision: 197246 URL: http://svn.freebsd.org/changeset/base/197246 Log: Fix an off-by-one error in the marking of the O_CH operator following an OOR2 operator. PR: 130504 MFC after: 2 weeks Modified: head/lib/libc/regex/engine.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Wed Sep 16 06:29:23 2009 (r197245) +++ head/lib/libc/regex/engine.c Wed Sep 16 06:32:23 2009 (r197246) @@ -1075,7 +1075,7 @@ step(struct re_guts *g, OP(s = g->strip[pc+look]) != O_CH; look += OPND(s)) assert(OP(s) == OOR2); - FWD(aft, aft, look); + FWD(aft, aft, look + 1); } break; case OOR2: /* propagate OCH_'s marking */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 07:01:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 192911065676; Wed, 16 Sep 2009 07:01:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 090BD8FC1F; Wed, 16 Sep 2009 07:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G71BYi015047; Wed, 16 Sep 2009 07:01:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G71BFs015045; Wed, 16 Sep 2009 07:01:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909160701.n8G71BFs015045@svn.freebsd.org> From: Ed Schouten Date: Wed, 16 Sep 2009 07:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197247 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 07:01:12 -0000 Author: ed Date: Wed Sep 16 07:01:11 2009 New Revision: 197247 URL: http://svn.freebsd.org/changeset/base/197247 Log: Extend the keyboard character size to 24 bits. Because we use an int to store keyboard chacacters and their flags, we can easily store the flags in the top byte instead of the second byte. This means it's a lot easier to make Unicode work. The only change that still needs to be made, is that keyent_t's map is extended to u_int. Obtained from: //depot/projects/newcons/sys/sys/kbio.h Modified: head/sys/sys/kbio.h Modified: head/sys/sys/kbio.h ============================================================================== --- head/sys/sys/kbio.h Wed Sep 16 06:32:23 2009 (r197246) +++ head/sys/sys/kbio.h Wed Sep 16 07:01:11 2009 (r197247) @@ -229,16 +229,22 @@ typedef struct fkeyarg fkeyarg_t; /* flags set to the return value in the KD_XLATE mode */ -#define NOKEY 0x100 /* no key pressed marker */ -#define FKEY 0x200 /* function key marker */ -#define MKEY 0x400 /* meta key marker (prepend ESC)*/ -#define BKEY 0x800 /* backtab (ESC [ Z) */ +#define NOKEY 0x01000000 /* no key pressed marker */ +#define FKEY 0x02000000 /* function key marker */ +#define MKEY 0x04000000 /* meta key marker (prepend ESC)*/ +#define BKEY 0x08000000 /* backtab (ESC [ Z) */ -#define SPCLKEY 0x8000 /* special key */ -#define RELKEY 0x4000 /* key released */ -#define ERRKEY 0x2000 /* error */ +#define SPCLKEY 0x80000000 /* special key */ +#define RELKEY 0x40000000 /* key released */ +#define ERRKEY 0x20000000 /* error */ -#define KEYCHAR(c) ((c) & 0x00ff) -#define KEYFLAGS(c) ((c) & ~0x00ff) +/* + * The top byte is used to store the flags. This means there are 24 + * bits left to store the actual character. Because UTF-8 can encode + * 2^21 different characters, this is good enough to get Unicode + * working. + */ +#define KEYCHAR(c) ((c) & 0x00ffffff) +#define KEYFLAGS(c) ((c) & ~0x00ffffff) #endif /* !_SYS_KBIO_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 07:55:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97BF31065672; Wed, 16 Sep 2009 07:55:02 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A44E8FC0A; Wed, 16 Sep 2009 07:55:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8G7t2Lv016233; Wed, 16 Sep 2009 07:55:02 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8G7t2NB016232; Wed, 16 Sep 2009 07:55:02 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200909160755.n8G7t2NB016232@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 16 Sep 2009 07:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197248 - head/share/timedef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 07:55:02 -0000 Author: edwin Date: Wed Sep 16 07:55:02 2009 New Revision: 197248 URL: http://svn.freebsd.org/changeset/base/197248 Log: Remove trailing spaces. Modified: head/share/timedef/hi_IN.ISCII-DEV.src (contents, props changed) Modified: head/share/timedef/hi_IN.ISCII-DEV.src ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 11:56:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48D0D106566B; Wed, 16 Sep 2009 11:56:45 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BF68FC08; Wed, 16 Sep 2009 11:56:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GBujZM023302; Wed, 16 Sep 2009 11:56:45 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GBujtd023300; Wed, 16 Sep 2009 11:56:45 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <200909161156.n8GBujtd023300@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Wed, 16 Sep 2009 11:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197250 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 11:56:45 -0000 Author: vanhu Date: Wed Sep 16 11:56:44 2009 New Revision: 197250 URL: http://svn.freebsd.org/changeset/base/197250 Log: When checking traffic endpoint's adresses families in key_spdadd(), compare them together instead of comparing each one with respective tunnel endpoint. PR: kern/138439 Submitted by: aurelien.ansel@netasq.com Obtained from: NETASQ MFC after: 1 m Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Wed Sep 16 08:38:47 2009 (r197249) +++ head/sys/netipsec/key.c Wed Sep 16 11:56:44 2009 (r197250) @@ -1925,18 +1925,8 @@ key_spdadd(so, m, mhp) return key_senderror(so, m, EINVAL); } #if 1 - if (newsp->req && newsp->req->saidx.src.sa.sa_family) { - struct sockaddr *sa; - sa = (struct sockaddr *)(src0 + 1); - if (sa->sa_family != newsp->req->saidx.src.sa.sa_family) { - _key_delsp(newsp); - return key_senderror(so, m, EINVAL); - } - } - if (newsp->req && newsp->req->saidx.dst.sa.sa_family) { - struct sockaddr *sa; - sa = (struct sockaddr *)(dst0 + 1); - if (sa->sa_family != newsp->req->saidx.dst.sa.sa_family) { + if (newsp->req && newsp->req->saidx.src.sa.sa_family && newsp->req->saidx.dst.sa.sa_family) { + if (newsp->req->saidx.src.sa.sa_family != newsp->req->saidx.dst.sa.sa_family) { _key_delsp(newsp); return key_senderror(so, m, EINVAL); } From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 12:07:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E4F31065694; Wed, 16 Sep 2009 12:07:58 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D208FC16; Wed, 16 Sep 2009 12:07:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GC7wIi023640; Wed, 16 Sep 2009 12:07:58 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GC7wpR023623; Wed, 16 Sep 2009 12:07:58 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200909161207.n8GC7wpR023623@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 16 Sep 2009 12:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197251 - in stable/8/sys: . amd64/include/xen arm/conf arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion cddl/contrib/opensolaris conf contrib/dev/acpica contrib/pf dev/mge dev/xen/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 12:07:58 -0000 Author: raj Date: Wed Sep 16 12:07:58 2009 New Revision: 197251 URL: http://svn.freebsd.org/changeset/base/197251 Log: MFC r196531-196534,196536 Clean up Marvell platform code. Introduce SheevaPlug support. - The device is based on Marvell 88F6281 system on chip. - More info about the platform at http://www.plugcomputer.org - To build the FreeBSD kernel: make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell Submitted by: Michal Hajduk Approved by: re (kib) Obtained from: Semihalf Added: stable/8/sys/arm/conf/SHEEVAPLUG - copied unchanged from r196536, head/sys/arm/conf/SHEEVAPLUG stable/8/sys/arm/mv/kirkwood/files.kirkwood - copied unchanged from r196533, head/sys/arm/mv/kirkwood/files.kirkwood stable/8/sys/arm/mv/kirkwood/files.sheevaplug - copied unchanged from r196536, head/sys/arm/mv/kirkwood/files.sheevaplug stable/8/sys/arm/mv/kirkwood/sheevaplug.c - copied unchanged from r196536, head/sys/arm/mv/kirkwood/sheevaplug.c stable/8/sys/arm/mv/kirkwood/std.kirkwood - copied unchanged from r196533, head/sys/arm/mv/kirkwood/std.kirkwood stable/8/sys/arm/mv/kirkwood/std.sheevaplug - copied unchanged from r196536, head/sys/arm/mv/kirkwood/std.sheevaplug Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/mv/common.c stable/8/sys/arm/mv/discovery/db78xxx.c stable/8/sys/arm/mv/kirkwood/db88f6xxx.c stable/8/sys/arm/mv/kirkwood/files.db88f6xxx stable/8/sys/arm/mv/kirkwood/std.db88f6xxx stable/8/sys/arm/mv/mv_machdep.c stable/8/sys/arm/mv/mvreg.h stable/8/sys/arm/mv/mvvar.h stable/8/sys/arm/mv/orion/db88f5xxx.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/conf/options.arm stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mge/if_mge.c stable/8/sys/dev/xen/xenpci/ (props changed) Copied: stable/8/sys/arm/conf/SHEEVAPLUG (from r196536, head/sys/arm/conf/SHEEVAPLUG) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/conf/SHEEVAPLUG Wed Sep 16 12:07:58 2009 (r197251, copy of r196536, head/sys/arm/conf/SHEEVAPLUG) @@ -0,0 +1,70 @@ +# +# Custom kernel for Marvell SheevaPlug devices. +# +# $FreeBSD$ +# + +ident SHEEVAPLUG +include "../mv/kirkwood/std.sheevaplug" + +options SOC_MV_KIRKWOOD +makeoptions MODULES_OVERRIDE="" + +#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options NFSCLIENT #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=mge0 + +# Root fs on USB device +#options ROOTDEVNAME=\"ufs:/dev/da0a\" + +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +# Debugging +options ALT_BREAK_TO_DEBUGGER +options DDB +options KDB + +# Pseudo devices +device random +device pty +device loop + +# Serial ports +device uart + +# Networking +device ether +device mge # Marvell Gigabit Ethernet controller +device mii +device e1000phy +device bpf +options HZ=1000 +options DEVICE_POLLING +device vlan + +# USB +device usb +device ehci +device umass +device scbus +device pass +device da + Modified: stable/8/sys/arm/mv/common.c ============================================================================== --- stable/8/sys/arm/mv/common.c Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/common.c Wed Sep 16 12:07:58 2009 (r197251) @@ -32,8 +32,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include @@ -62,6 +64,76 @@ static void decode_win_usb_dump(void); static uint32_t used_cpu_wins; +static __inline int +pm_is_disabled(uint32_t mask) +{ + + return (soc_power_ctrl_get(mask) == mask ? 0 : 1); +} + +static __inline uint32_t +obio_get_pm_mask(uint32_t base) +{ + struct obio_device *od; + + for (od = obio_devices; od->od_name != NULL; od++) + if (od->od_base == base) + return (od->od_pwr_mask); + + return (CPU_PM_CTRL_NONE); +} + +/* + * Disable device using power management register. + * 1 - Device Power On + * 0 - Device Power Off + * Mask can be set in loader. + * EXAMPLE: + * loader> set hw.pm-disable-mask=0x2 + * + * Common mask: + * |-------------------------------| + * | Device | Kirkwood | Discovery | + * |-------------------------------| + * | USB0 | 0x00008 | 0x020000 | + * |-------------------------------| + * | USB1 | - | 0x040000 | + * |-------------------------------| + * | USB2 | - | 0x080000 | + * |-------------------------------| + * | GE0 | 0x00001 | 0x000002 | + * |-------------------------------| + * | GE1 | - | 0x000004 | + * |-------------------------------| + * | IDMA | - | 0x100000 | + * |-------------------------------| + * | XOR | 0x10000 | 0x200000 | + * |-------------------------------| + * | CESA | 0x20000 | 0x400000 | + * |-------------------------------| + * | SATA | 0x04000 | 0x004000 | + * --------------------------------| + * This feature can be used only on Kirkwood and Discovery + * machines. + */ +static __inline void +pm_disable_device(int mask) +{ +#ifdef DIAGNOSTIC + uint32_t reg; + + reg = soc_power_ctrl_get(CPU_PM_CTRL_ALL); + printf("Power Management Register: 0%x\n", reg); + + reg &= ~mask; + soc_power_ctrl_set(reg); + printf("Device %x is disabled\n", mask); + + reg = soc_power_ctrl_get(CPU_PM_CTRL_ALL); + printf("Power Management Register: 0%x\n", reg); +#endif +} + uint32_t read_cpu_ctrl(uint32_t reg) { @@ -103,14 +175,36 @@ cpu_extra_feat(void) return (ef); } +/* + * Get the power status of device. This feature is only supported on + * Kirkwood and Discovery SoCs. + */ uint32_t soc_power_ctrl_get(uint32_t mask) { +#ifndef SOC_MV_ORION if (mask != CPU_PM_CTRL_NONE) mask &= read_cpu_ctrl(CPU_PM_CTRL); return (mask); +#else + return (mask); +#endif +} + +/* + * Set the power status of device. This feature is only supported on + * Kirkwood and Discovery SoCs. + */ +void +soc_power_ctrl_set(uint32_t mask) +{ + +#ifndef SOC_MV_ORION + if (mask != CPU_PM_CTRL_NONE) + write_cpu_ctrl(CPU_PM_CTRL, mask); +#endif } void @@ -191,6 +285,13 @@ int soc_decode_win(void) { uint32_t dev, rev; + int mask; + + mask = 0; + TUNABLE_INT_FETCH("hw.pm-disable-mask", &mask); + + if (mask != 0) + pm_disable_device(mask); /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); @@ -623,8 +724,12 @@ decode_win_usb_setup(void) /* Disable and clear all USB windows for all ports */ m = usb_max_ports(); + for (p = 0; p < m; p++) { + if (pm_is_disabled(CPU_PM_CTRL_USB(p))) + continue; + for (i = 0; i < MV_WIN_USB_MAX; i++) { win_usb_cr_write(i, p, 0); win_usb_br_write(i, p, 0); @@ -710,6 +815,9 @@ decode_win_eth_setup(uint32_t base) uint32_t br, sz; int i, j; + if (pm_is_disabled(obio_get_pm_mask(base))) + return; + /* Disable, clear and revoke protection for all ETH windows */ for (i = 0; i < MV_WIN_ETH_MAX; i++) { @@ -880,6 +988,8 @@ decode_win_idma_setup(void) uint32_t br, sz; int i, j; + if (pm_is_disabled(CPU_PM_CTRL_IDMA)) + return; /* * Disable and clear all IDMA windows, revoke protection for all channels */ @@ -1172,6 +1282,9 @@ decode_win_xor_setup(void) uint32_t br, sz; int i, j, z, e = 1, m, window; + if (pm_is_disabled(CPU_PM_CTRL_XOR)) + return; + /* * Disable and clear all XOR windows, revoke protection for all * channels @@ -1364,6 +1477,9 @@ decode_win_cesa_setup(void) uint32_t br, cr; int i, j; + if (pm_is_disabled(CPU_PM_CTRL_CRYPTO)) + return; + /* Disable and clear all CESA windows */ for (i = 0; i < MV_WIN_CESA_MAX; i++) { win_cesa_cr_write(i, 0); @@ -1432,6 +1548,9 @@ decode_win_sata_setup(void) uint32_t cr, br; int i, j; + if (pm_is_disabled(CPU_PM_CTRL_SATA)) + return; + for (i = 0; i < MV_WIN_SATA_MAX; i++) { win_sata_cr_write(i, 0); win_sata_br_write(i, 0); Modified: stable/8/sys/arm/mv/discovery/db78xxx.c ============================================================================== --- stable/8/sys/arm/mv/discovery/db78xxx.c Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/discovery/db78xxx.c Wed Sep 16 12:07:58 2009 (r197251) @@ -68,11 +68,8 @@ __FBSDID("$FreeBSD$"); * 0xffff_2000 - 0xffff_ffff : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; - /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -105,16 +102,6 @@ const struct gpio_config mv_gpio_config[ { -1, -1, -1 } }; -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { Modified: stable/8/sys/arm/mv/kirkwood/db88f6xxx.c ============================================================================== --- stable/8/sys/arm/mv/kirkwood/db88f6xxx.c Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/kirkwood/db88f6xxx.c Wed Sep 16 12:07:58 2009 (r197251) @@ -68,11 +68,8 @@ __FBSDID("$FreeBSD$"); * 0xffff_2000 - 0xffff_ffff : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; - /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -105,16 +102,6 @@ const struct gpio_config mv_gpio_config[ { -1, -1, -1 } }; -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { Modified: stable/8/sys/arm/mv/kirkwood/files.db88f6xxx ============================================================================== --- stable/8/sys/arm/mv/kirkwood/files.db88f6xxx Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/kirkwood/files.db88f6xxx Wed Sep 16 12:07:58 2009 (r197251) @@ -1,5 +1,4 @@ # $FreeBSD$ -arm/mv/rtc.c standard -arm/mv/kirkwood/kirkwood.c standard +include "arm/mv/kirkwood/files.kirkwood" arm/mv/kirkwood/db88f6xxx.c standard Copied: stable/8/sys/arm/mv/kirkwood/files.kirkwood (from r196533, head/sys/arm/mv/kirkwood/files.kirkwood) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/mv/kirkwood/files.kirkwood Wed Sep 16 12:07:58 2009 (r197251, copy of r196533, head/sys/arm/mv/kirkwood/files.kirkwood) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +arm/mv/rtc.c standard +arm/mv/kirkwood/kirkwood.c standard Copied: stable/8/sys/arm/mv/kirkwood/files.sheevaplug (from r196536, head/sys/arm/mv/kirkwood/files.sheevaplug) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/mv/kirkwood/files.sheevaplug Wed Sep 16 12:07:58 2009 (r197251, copy of r196536, head/sys/arm/mv/kirkwood/files.sheevaplug) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +include "arm/mv/kirkwood/files.kirkwood" +arm/mv/kirkwood/sheevaplug.c standard Copied: stable/8/sys/arm/mv/kirkwood/sheevaplug.c (from r196536, head/sys/arm/mv/kirkwood/sheevaplug.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/mv/kirkwood/sheevaplug.c Wed Sep 16 12:07:58 2009 (r197251, copy of r196536, head/sys/arm/mv/kirkwood/sheevaplug.c) @@ -0,0 +1,152 @@ +/*- + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (C) 2009 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +/* + * Virtual address space layout: + * ----------------------------- + * 0x0000_0000 - 0x7FFF_FFFF : User Process (2 GB) + * 0x8000_0000 - 0xBBFF_FFFF : Unused (960 MB) + * 0xBC00_0000 - 0xBDFF_FFFF : Device Bus: CS1 (32 MB) + * 0xBE00_0000 - 0xBECF_FFFF : Unused (13 MB) + * 0xBED0_0000 - 0xBEDF_FFFF : Device Bus: CS2 (1 MB) + * 0xBEE0_0000 - 0xBEEF_FFFF : Device Bus: CS0 (1 MB) + * 0xBEF0_0000 - 0xBEFF_FFFF : Device Bus: BOOT (1 MB) + * 0xBF00_0000 - 0xBFFF_FFFF : Unused (16 MB) + * 0xC000_0000 - virtual_avail : Kernel Reserved (text, data, page tables, + * : stack etc.) + * virtual-avail - 0xEFFF_FFFF : KVA (virtual_avail is typically < 0xc0a0_0000) + * 0xF000_0000 - 0xF0FF_FFFF : No-Cache allocation area (16 MB) + * 0xF100_0000 - 0xF10F_FFFF : SoC Integrated devices registers range (1 MB) + * 0xF110_0000 - 0xF11F_FFFF : CESA SRAM (1 MB) + * 0xF120_0000 - 0xFFFE_FFFF : Unused (237 MB + 960 kB) + * 0xFFFF_0000 - 0xFFFF_0FFF : 'High' vectors page (4 kB) + * 0xFFFF_1000 - 0xFFFF_1FFF : ARM_TP_ADDRESS/RAS page (4 kB) + * 0xFFFF_2000 - 0xFFFF_FFFF : Unused (56 kB) + */ + +/* Static device mappings. */ +const struct pmap_devmap pmap_devmap[] = { + /* + * Map the on-board devices VA == PA so that we can access them + * with the MMU on or off. + */ + { /* SoC integrated peripherals registers range */ + MV_BASE, + MV_PHYS_BASE, + MV_SIZE, + VM_PROT_READ | VM_PROT_WRITE, + PTE_NOCACHE, + }, + { /* CESA SRAM */ + MV_CESA_SRAM_BASE, + MV_CESA_SRAM_PHYS_BASE, + MV_CESA_SRAM_SIZE, + VM_PROT_READ | VM_PROT_WRITE, + PTE_NOCACHE, + }, + { 0, 0, 0, 0, 0, } +}; + +const struct gpio_config mv_gpio_config[] = { + { -1, -1, -1 } +}; + +void +platform_mpp_init(void) +{ + + /* + * MPP configuration for Sheeva Plug + * + * MPP[0]: NF_IO[2] + * MPP[1]: NF_IO[3] + * MPP[2]: NF_IO[4] + * MPP[3]: NF_IO[5] + * MPP[4]: NF_IO[6] + * MPP[5]: NF_IO[7] + * MPP[6]: SYSRST_OUTn + * MPP[8]: UA0_RTS + * MPP[9]: UA0_CTS + * MPP[10]: UA0_TXD + * MPP[11]: UA0_RXD + * MPP[12]: SD_CLK + * MPP[13]: SD_CMD + * MPP[14]: SD_D[0] + * MPP[15]: SD_D[1] + * MPP[16]: SD_D[2] + * MPP[17]: SD_D[3] + * MPP[18]: NF_IO[0] + * MPP[19]: NF_IO[1] + * MPP[29]: TSMP[9] + * + * Others: GPIO + */ + + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL0, 0x01111111); + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL1, 0x11113322); + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL2, 0x00001111); + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL3, 0x00100000); + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL4, 0x00000000); + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL5, 0x00000000); + bus_space_write_4(obio_tag, MV_MPP_BASE, MPP_CONTROL6, 0x00000000); +} + +static void +platform_identify(void *dummy) +{ + + soc_identify(); + + /* + * XXX Board identification e.g. read out from FPGA or similar should + * go here + */ +} +SYSINIT(platform_identify, SI_SUB_CPU, SI_ORDER_SECOND, platform_identify, NULL); Modified: stable/8/sys/arm/mv/kirkwood/std.db88f6xxx ============================================================================== --- stable/8/sys/arm/mv/kirkwood/std.db88f6xxx Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/kirkwood/std.db88f6xxx Wed Sep 16 12:07:58 2009 (r197251) @@ -1,13 +1,8 @@ # $FreeBSD$ include "../mv/std.mv" +include "../mv/kirkwood/std.kirkwood" files "../mv/kirkwood/files.db88f6xxx" -makeoptions KERNPHYSADDR=0x00900000 -makeoptions KERNVIRTADDR=0xc0900000 -options KERNPHYSADDR=0x00900000 -options KERNVIRTADDR=0xc0900000 -options PHYSADDR=0x00000000 options PHYSMEM_SIZE=0x20000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 Copied: stable/8/sys/arm/mv/kirkwood/std.kirkwood (from r196533, head/sys/arm/mv/kirkwood/std.kirkwood) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/mv/kirkwood/std.kirkwood Wed Sep 16 12:07:58 2009 (r197251, copy of r196533, head/sys/arm/mv/kirkwood/std.kirkwood) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# kernel gets loaded at 0x00900000 by the loader, but runs at virtual address +# 0xc0900000. RAM starts at 0. We put the pagetable at a reasonable place +# in memory, but may need to bounce it higher if there's a problem with this. +# We could paper over this by loading the kernel at 0xc0000000 virtual, but +# that leads to other complications, so we'll just reclaim the lower region of +# ram after we're loaded. Put the page tables for startup at 1MB. +makeoptions KERNPHYSADDR=0x00900000 +makeoptions KERNVIRTADDR=0xc0900000 + +options KERNPHYSADDR=0x00900000 +options KERNVIRTADDR=0xc0900000 +options PHYSADDR=0x00000000 +options STARTUP_PAGETABLE_ADDR=0x00100000 Copied: stable/8/sys/arm/mv/kirkwood/std.sheevaplug (from r196536, head/sys/arm/mv/kirkwood/std.sheevaplug) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/mv/kirkwood/std.sheevaplug Wed Sep 16 12:07:58 2009 (r197251, copy of r196536, head/sys/arm/mv/kirkwood/std.sheevaplug) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +include "../mv/std.mv" +include "../mv/kirkwood/std.kirkwood" +files "../mv/kirkwood/files.sheevaplug" + +options PHYSMEM_SIZE=0x20000000 +options MII_ADDR_BASE=0 Modified: stable/8/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/8/sys/arm/mv/mv_machdep.c Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/mv_machdep.c Wed Sep 16 12:07:58 2009 (r197251) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include /* XXX eventually this should be eliminated */ +#include #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) @@ -133,7 +134,9 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; vm_offset_t physical_pages; +vm_offset_t pmap_bootstrap_lastaddr; +const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -423,8 +426,8 @@ initarm(void *mdp, void *unused __unused while (1); /* Platform-specific initialisation */ - if (platform_pmap_init() != 0) - return (NULL); + pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; + pmap_devmap_bootstrap_table = &pmap_devmap[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); Modified: stable/8/sys/arm/mv/mvreg.h ============================================================================== --- stable/8/sys/arm/mv/mvreg.h Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/mvreg.h Wed Sep 16 12:07:58 2009 (r197251) @@ -218,6 +218,7 @@ */ #define CPU_PM_CTRL 0x1C #define CPU_PM_CTRL_NONE 0 +#define CPU_PM_CTRL_ALL ~0x0 #if defined(SOC_MV_KIRKWOOD) #define CPU_PM_CTRL_GE0 (1 << 0) @@ -234,8 +235,11 @@ #define CPU_PM_CTRL_SATA1 (1 << 15) #define CPU_PM_CTRL_XOR1 (1 << 16) #define CPU_PM_CTRL_CRYPTO (1 << 17) -#define CPU_PM_CTRL_GE1 (1 << 18) -#define CPU_PM_CTRL_TDM (1 << 19) +#define CPU_PM_CTRL_GE1 (1 << 19) +#define CPU_PM_CTRL_TDM (1 << 20) +#define CPU_PM_CTRL_XOR (CPU_PM_CTRL_XOR0 | CPU_PM_CTRL_XOR1) +#define CPU_PM_CTRL_USB(u) (CPU_PM_CTRL_USB0) +#define CPU_PM_CTRL_SATA (CPU_PM_CTRL_SATA0 | CPU_PM_CTRL_SATA1) #elif defined(SOC_MV_DISCOVERY) #define CPU_PM_CTRL_GE0 (1 << 1) #define CPU_PM_CTRL_GE1 (1 << 2) @@ -258,6 +262,14 @@ #define CPU_PM_CTRL_XOR (1 << 21) #define CPU_PM_CTRL_CRYPTO (1 << 22) #define CPU_PM_CTRL_DEVICE (1 << 23) +#define CPU_PM_CTRL_USB(u) (1 << (17 + (u))) +#define CPU_PM_CTRL_SATA (CPU_PM_CTRL_SATA0 | CPU_PM_CTRL_SATA1) +#else +#define CPU_PM_CTRL_CRYPTO (CPU_PM_CTRL_NONE) +#define CPU_PM_CTRL_IDMA (CPU_PM_CTRL_NONE) +#define CPU_PM_CTRL_XOR (CPU_PM_CTRL_NONE) +#define CPU_PM_CTRL_SATA (CPU_PM_CTRL_NONE) +#define CPU_PM_CTRL_USB(u) (CPU_PM_CTRL_NONE) #endif /* Modified: stable/8/sys/arm/mv/mvvar.h ============================================================================== --- stable/8/sys/arm/mv/mvvar.h Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/mvvar.h Wed Sep 16 12:07:58 2009 (r197251) @@ -41,6 +41,10 @@ #define _MVVAR_H_ #include +#include +#include +#include +#include #define MV_TYPE_PCI 0 #define MV_TYPE_PCIE 1 @@ -104,6 +108,7 @@ struct decode_win { int remap; }; +extern const struct pmap_devmap pmap_devmap[]; extern const struct obio_pci mv_pci_info[]; extern const struct gpio_config mv_gpio_config[]; extern bus_space_tag_t obio_tag; @@ -124,13 +129,13 @@ int mv_gpio_configure(uint32_t pin, uint void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); uint8_t mv_gpio_in(uint32_t pin); -int platform_pmap_init(void); void platform_mpp_init(void); int soc_decode_win(void); void soc_id(uint32_t *dev, uint32_t *rev); void soc_identify(void); void soc_dump_decode_win(void); uint32_t soc_power_ctrl_get(uint32_t mask); +void soc_power_ctrl_set(uint32_t mask); int decode_win_cpu_set(int target, int attr, vm_paddr_t base, uint32_t size, int remap); Modified: stable/8/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- stable/8/sys/arm/mv/orion/db88f5xxx.c Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/orion/db88f5xxx.c Wed Sep 16 12:07:58 2009 (r197251) @@ -70,12 +70,10 @@ __FBSDID("$FreeBSD$"); * 0xffff_2000 - 0xffff_ffff : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; int platform_pci_get_irq(u_int bus, u_int slot, u_int func, u_int pin); /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -184,16 +182,6 @@ const struct gpio_config mv_gpio_config[ }; #endif -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { Modified: stable/8/sys/conf/options.arm ============================================================================== --- stable/8/sys/conf/options.arm Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/conf/options.arm Wed Sep 16 12:07:58 2009 (r197251) @@ -24,6 +24,7 @@ KERNVIRTADDR opt_global.h LOADERRAMADDR opt_global.h PHYSADDR opt_global.h PHYSMEM_SIZE opt_global.h +MII_ADDR_BASE opt_global.h SKYEYE_WORKAROUNDS opt_global.h SOC_MV_DISCOVERY opt_global.h SOC_MV_KIRKWOOD opt_global.h Modified: stable/8/sys/dev/mge/if_mge.c ============================================================================== --- stable/8/sys/dev/mge/if_mge.c Wed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/dev/mge/if_mge.c Wed Sep 16 12:07:58 2009 (r197251) @@ -69,7 +69,9 @@ __FBSDID("$FreeBSD$"); #include #include -#define MV_PHY_ADDR_BASE 8 +#ifndef MII_ADDR_BASE +#define MII_ADDR_BASE 8 +#endif #include #include @@ -1264,14 +1266,15 @@ mge_miibus_readreg(device_t dev, int phy /* * We assume static PHY address <=> device unit mapping: - * PHY Address = MV_PHY_ADDR_BASE + devce unit. + * PHY Address = MII_ADDR_BASE + devce unit. * This is true for most Marvell boards. * * Code below grants proper PHY detection on each device * unit. */ - if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) + + if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & @@ -1292,7 +1295,7 @@ mge_miibus_writereg(device_t dev, int ph { uint32_t retries; - if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) + if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 13:24:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A1F106566C; Wed, 16 Sep 2009 13:24:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 010E78FC0A; Wed, 16 Sep 2009 13:24:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GDObdG025618; Wed, 16 Sep 2009 13:24:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GDObjv025613; Wed, 16 Sep 2009 13:24:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909161324.n8GDObjv025613@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Sep 2009 13:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197255 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris compat/freebsd32 compat/linux contrib/dev/acpica contrib/pf dev/xen/xenpci kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 13:24:38 -0000 Author: kib Date: Wed Sep 16 13:24:37 2009 New Revision: 197255 URL: http://svn.freebsd.org/changeset/base/197255 Log: MFC r197049: Calculate the amount of bytes to copy for select filedescriptor masks taking into account size of fd_set for the current process ABI. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/linux/linux_misc.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/sys_generic.c stable/8/sys/sys/syscallsubr.h Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 16 13:11:37 2009 (r197254) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 16 13:24:37 2009 (r197255) @@ -589,7 +589,8 @@ freebsd32_select(struct thread *td, stru * XXX big-endian needs to convert the fd_sets too. * XXX Do pointers need PTRIN()? */ - return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp)); + return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + sizeof(int32_t) * 8)); } /* Modified: stable/8/sys/compat/linux/linux_misc.c ============================================================================== --- stable/8/sys/compat/linux/linux_misc.c Wed Sep 16 13:11:37 2009 (r197254) +++ stable/8/sys/compat/linux/linux_misc.c Wed Sep 16 13:24:37 2009 (r197255) @@ -522,7 +522,7 @@ linux_select(struct thread *td, struct l tvp = NULL; error = kern_select(td, args->nfds, args->readfds, args->writefds, - args->exceptfds, tvp); + args->exceptfds, tvp, sizeof(l_int) * 8); #ifdef DEBUG if (ldebug(select)) Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Wed Sep 16 13:11:37 2009 (r197254) +++ stable/8/sys/kern/sys_generic.c Wed Sep 16 13:24:37 2009 (r197255) @@ -774,12 +774,13 @@ select(td, uap) } else tvp = NULL; - return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp)); + return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + NFDBITS)); } int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, - fd_set *fd_ex, struct timeval *tvp) + fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits) { struct filedesc *fdp; /* @@ -792,7 +793,7 @@ kern_select(struct thread *td, int nd, f fd_mask *ibits[3], *obits[3], *selbits, *sbp; struct timeval atv, rtv, ttv; int error, timo; - u_int nbufbytes, ncpbytes, nfdbits; + u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; if (nd < 0) return (EINVAL); @@ -806,6 +807,7 @@ kern_select(struct thread *td, int nd, f */ nfdbits = roundup(nd, NFDBITS); ncpbytes = nfdbits / NBBY; + ncpubytes = roundup(nd, abi_nfdbits) / NBBY; nbufbytes = 0; if (fd_in != NULL) nbufbytes += 2 * ncpbytes; @@ -832,9 +834,11 @@ kern_select(struct thread *td, int nd, f ibits[x] = sbp + nbufbytes / 2 / sizeof *sbp; \ obits[x] = sbp; \ sbp += ncpbytes / sizeof *sbp; \ - error = copyin(name, ibits[x], ncpbytes); \ + error = copyin(name, ibits[x], ncpubytes); \ if (error != 0) \ goto done; \ + bzero((char *)ibits[x] + ncpubytes, \ + ncpbytes - ncpubytes); \ } \ } while (0) getbits(fd_in, 0); @@ -888,7 +892,7 @@ done: if (error == EWOULDBLOCK) error = 0; #define putbits(name, x) \ - if (name && (error2 = copyout(obits[x], name, ncpbytes))) \ + if (name && (error2 = copyout(obits[x], name, ncpubytes))) \ error = error2; if (error == 0) { int error2; Modified: stable/8/sys/sys/syscallsubr.h ============================================================================== --- stable/8/sys/sys/syscallsubr.h Wed Sep 16 13:11:37 2009 (r197254) +++ stable/8/sys/sys/syscallsubr.h Wed Sep 16 13:24:37 2009 (r197255) @@ -170,7 +170,7 @@ int kern_sched_rr_get_interval(struct th int kern_semctl(struct thread *td, int semid, int semnum, int cmd, union semun *arg, register_t *rval); int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, - fd_set *fd_ex, struct timeval *tvp); + fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits); int kern_sendfile(struct thread *td, struct sendfile_args *uap, struct uio *hdr_uio, struct uio *trl_uio, int compat); int kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 13:44:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F06931065670; Wed, 16 Sep 2009 13:44:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCCC38FC15; Wed, 16 Sep 2009 13:44:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GDiCr7026107; Wed, 16 Sep 2009 13:44:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GDiCAX026105; Wed, 16 Sep 2009 13:44:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909161344.n8GDiCAX026105@svn.freebsd.org> From: Michael Tuexen Date: Wed, 16 Sep 2009 13:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197256 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 13:44:13 -0000 Author: tuexen Date: Wed Sep 16 13:44:12 2009 New Revision: 197256 URL: http://svn.freebsd.org/changeset/base/197256 Log: Fixes two bugs: 1) A lock issue, if we ever had to try again we would double lock the INP lock. 2) We were allowing (at wrap) associd 0... which really we cannot allow since 0 normally means in most socket API calls that we are wishing to effect something on the INP not TCB. Approved by: re, rrs (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/sctp_pcb.c Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Wed Sep 16 13:24:37 2009 (r197255) +++ stable/8/sys/netinet/sctp_pcb.c Wed Sep 16 13:44:12 2009 (r197256) @@ -3926,12 +3926,20 @@ sctp_aloc_a_assoc_id(struct sctp_inpcb * struct sctpasochead *head; struct sctp_tcb *lstcb; + SCTP_INP_WLOCK(inp); try_again: if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* TSNH */ + SCTP_INP_WUNLOCK(inp); return (0); } - SCTP_INP_WLOCK(inp); + /* + * We don't allow assoc id to be 0, this is needed otherwise if the + * id were to wrap we would have issues with some socket options. + */ + if (inp->sctp_associd_counter == 0) { + inp->sctp_associd_counter++; + } id = inp->sctp_associd_counter; inp->sctp_associd_counter++; lstcb = sctp_findasoc_ep_asocid_locked(inp, (sctp_assoc_t) id, 0); From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 14:23:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43CF7106568B; Wed, 16 Sep 2009 14:23:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 325828FC08; Wed, 16 Sep 2009 14:23:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GENW8c027466; Wed, 16 Sep 2009 14:23:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GENWNq027464; Wed, 16 Sep 2009 14:23:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909161423.n8GENWNq027464@svn.freebsd.org> From: Michael Tuexen Date: Wed, 16 Sep 2009 14:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197257 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 14:23:32 -0000 Author: tuexen Date: Wed Sep 16 14:23:31 2009 New Revision: 197257 URL: http://svn.freebsd.org/changeset/base/197257 Log: Fix a bug reported by Daniel Mentz: When authenticating DATA chunks some DATA chunks might get stuck when the MTU gets decreased via an ICMP message. Approved by: rrs (mentor) MFC after: immediately Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Sep 16 13:44:12 2009 (r197256) +++ head/sys/netinet/sctp_usrreq.c Wed Sep 16 14:23:31 2009 (r197257) @@ -106,6 +106,7 @@ sctp_pathmtu_adjustment(struct sctp_inpc uint16_t nxtsz) { struct sctp_tmit_chunk *chk; + uint16_t overhead; /* Adjust that too */ stcb->asoc.smallest_mtu = nxtsz; @@ -114,13 +115,17 @@ sctp_pathmtu_adjustment(struct sctp_inpc SCTP_PRINTF("sctp_pathmtu_adjust called inp:%p stcb:%p net:%p nxtsz:%d\n", inp, stcb, net, nxtsz); #endif + overhead = IP_HDR_SIZE; + if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { + overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); + } TAILQ_FOREACH(chk, &stcb->asoc.send_queue, sctp_next) { - if ((chk->send_size + IP_HDR_SIZE) > nxtsz) { + if ((chk->send_size + overhead) > nxtsz) { chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; } } TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { - if ((chk->send_size + IP_HDR_SIZE) > nxtsz) { + if ((chk->send_size + overhead) > nxtsz) { /* * For this guy we also mark for immediate resend * since we sent to big of chunk From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 14:47:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C461065672; Wed, 16 Sep 2009 14:47:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A377A8FC1E; Wed, 16 Sep 2009 14:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GEloK4028107; Wed, 16 Sep 2009 14:47:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GEloIj028105; Wed, 16 Sep 2009 14:47:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909161447.n8GEloIj028105@svn.freebsd.org> From: Michael Tuexen Date: Wed, 16 Sep 2009 14:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197258 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 14:47:50 -0000 Author: tuexen Date: Wed Sep 16 14:47:50 2009 New Revision: 197258 URL: http://svn.freebsd.org/changeset/base/197258 Log: MFC 197257: Fix a bug reported by Daniel Mentz: When authenticating DATA chunks some DATA chunks might get stuck when the MTU gets decreased via an ICMP message. Approved by: re, rrs (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/sctp_usrreq.c Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Wed Sep 16 14:23:31 2009 (r197257) +++ stable/8/sys/netinet/sctp_usrreq.c Wed Sep 16 14:47:50 2009 (r197258) @@ -106,6 +106,7 @@ sctp_pathmtu_adjustment(struct sctp_inpc uint16_t nxtsz) { struct sctp_tmit_chunk *chk; + uint16_t overhead; /* Adjust that too */ stcb->asoc.smallest_mtu = nxtsz; @@ -114,13 +115,17 @@ sctp_pathmtu_adjustment(struct sctp_inpc SCTP_PRINTF("sctp_pathmtu_adjust called inp:%p stcb:%p net:%p nxtsz:%d\n", inp, stcb, net, nxtsz); #endif + overhead = IP_HDR_SIZE; + if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { + overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); + } TAILQ_FOREACH(chk, &stcb->asoc.send_queue, sctp_next) { - if ((chk->send_size + IP_HDR_SIZE) > nxtsz) { + if ((chk->send_size + overhead) > nxtsz) { chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; } } TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { - if ((chk->send_size + IP_HDR_SIZE) > nxtsz) { + if ((chk->send_size + overhead) > nxtsz) { /* * For this guy we also mark for immediate resend * since we sent to big of chunk From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 19:53:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 700D5106566B; Wed, 16 Sep 2009 19:53:30 +0000 (UTC) (envelope-from sepotvin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F46F8FC12; Wed, 16 Sep 2009 19:53:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GJrUZT034401; Wed, 16 Sep 2009 19:53:30 GMT (envelope-from sepotvin@svn.freebsd.org) Received: (from sepotvin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GJrU5H034400; Wed, 16 Sep 2009 19:53:30 GMT (envelope-from sepotvin@svn.freebsd.org) Message-Id: <200909161953.n8GJrU5H034400@svn.freebsd.org> From: "Stephane E. Potvin" Date: Wed, 16 Sep 2009 19:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197259 - head/gnu/usr.bin/patch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 19:53:30 -0000 Author: sepotvin Date: Wed Sep 16 19:53:29 2009 New Revision: 197259 URL: http://svn.freebsd.org/changeset/base/197259 Log: The buffer returned by fgenln is not a "C" string and might not be NUL terminated. Make sure that it is before using it. Reviewed by: marck@ MFC after: 3 days Modified: head/gnu/usr.bin/patch/common.h head/gnu/usr.bin/patch/pch.c Modified: head/gnu/usr.bin/patch/common.h ============================================================================== --- head/gnu/usr.bin/patch/common.h Wed Sep 16 14:47:50 2009 (r197258) +++ head/gnu/usr.bin/patch/common.h Wed Sep 16 19:53:29 2009 (r197259) @@ -34,6 +34,7 @@ #define Strcpy (void)strcpy #define Strcat (void)strcat #define Strlcpy (void)strlcpy +#define Strncpy (void)strncpy #define Strlcat (void)strlcat /* NeXT declares malloc and realloc incompatibly from us in some of Modified: head/gnu/usr.bin/patch/pch.c ============================================================================== --- head/gnu/usr.bin/patch/pch.c Wed Sep 16 14:47:50 2009 (r197258) +++ head/gnu/usr.bin/patch/pch.c Wed Sep 16 19:53:29 2009 (r197259) @@ -1176,7 +1176,8 @@ pgets(bool do_indent) indent++; } } - Strlcpy(buf, line, len + 1 - skipped); + Strncpy(buf, line, len - skipped); + buf[len - skipped] = '\0'; } return len; } From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 21:28:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 669CC106566B for ; Wed, 16 Sep 2009 21:28:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 03B1F8FC18 for ; Wed, 16 Sep 2009 21:28:14 +0000 (UTC) Received: (qmail 2071 invoked by uid 399); 16 Sep 2009 21:28:12 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 16 Sep 2009 21:28:12 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AB15865.9030406@FreeBSD.org> Date: Wed, 16 Sep 2009 14:28:05 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Ed Maste References: <200909141652.n8EGqdd1060471@svn.freebsd.org> In-Reply-To: <200909141652.n8EGqdd1060471@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-rc@freebsd.org Subject: Re: svn commit: r197196 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 21:28:15 -0000 I personally would much prefer that people making changes in rc.d-land be more careful about what they change and thoroughly test their changes than to add more code like this that will both hide breakage and become stale over time. Doug Ed Maste wrote: > Author: emaste > Date: Mon Sep 14 16:52:38 2009 > New Revision: 197196 > URL: http://svn.freebsd.org/changeset/base/197196 > > Log: > Protect cross-script invocation by checking that the target script exists. > This allows pruning of rc.d scripts without getting too many ugly boottime > error messages. > > Inspired by phk's r128714 change to netif. > > Modified: > head/etc/rc.d/ppp > > Modified: head/etc/rc.d/ppp > ============================================================================== > --- head/etc/rc.d/ppp Mon Sep 14 16:16:07 2009 (r197195) > +++ head/etc/rc.d/ppp Mon Sep 14 16:52:38 2009 (r197196) > @@ -95,8 +95,12 @@ ppp_poststart() > { > # Re-Sync ipfilter and pf so they pick up any new network interfaces > # > - /etc/rc.d/ipfilter quietresync > - /etc/rc.d/pf quietresync > + if [ -f /etc/rc.d/ipfilter ]; then > + /etc/rc.d/ipfilter quietresync > + fi > + if [ -f /etc/rc.d/pf ]; then > + /etc/rc.d/pf quietresync > + fi > } > > ppp_stop_profile() { > -- This .signature sanitized for your protection From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 21:59:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 809391065676 for ; Wed, 16 Sep 2009 21:59:50 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 352E68FC1A for ; Wed, 16 Sep 2009 21:59:50 +0000 (UTC) Received: (qmail 21060 invoked by uid 399); 16 Sep 2009 21:59:49 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 16 Sep 2009 21:59:49 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AB15FCE.70505@FreeBSD.org> Date: Wed, 16 Sep 2009 14:59:42 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Hiroki Sato References: <200909122222.n8CMMV3d099311@svn.freebsd.org> In-Reply-To: <200909122222.n8CMMV3d099311@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-rc@freebsd.org Subject: Re: svn commit: r197145 - in head: etc/defaults share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 21:59:50 -0000 [Please direct follow-ups to freebsd-rc@] Hiroki, I realize that you've posted your patches in the past, and I definitely had it in mind to review them in detail and give you feedback on them. However I got focused on my own projects for the pending release, and then since we were so close to the release I did not think you would be committing these changes until after it was done so I let review of these patches slip down my list of priorities. Therefore I ask you to accept my apologies for this "after the fact" review. Before I forget, you keep putting "mfc after 3 days" in your commit messages. You don't actually plan to MFC these changes to RELENG_8 prior to the 8.0-RELEASE do you? I would not be supportive of this given the sweeping nature of the changes and the (unfortunately) small percentage of our userbase that uses and tests IPv6. I think shaking this code out in HEAD for several weeks at least would be a good thing. That said I very much like the idea of integrating IPv6 support into the overall network code, and I am very supportive of that. I do have some small problems with the direction that you've taken in a few areas, which happen to be neatly summarized in this post. Hiroki Sato wrote: > Author: hrs > Date: Sat Sep 12 22:22:31 2009 > New Revision: 197145 > URL: http://svn.freebsd.org/changeset/base/197145 > > Log: > The following changes are added because of > network_ipv6->rc.d/netif integration: > > - $ipv6_enable is now obsolete. Instead, IPv6 is enabled by > default if the kernel supports it, and $ipv6_network_interfaces > is "none" by default. If you want to use IPv6, define > $ipv6_network_interfaces and $ifconfig_xxx_ipv6. In general I have a problem with the idea of drastically changing the semantics of the current code when I can't see any real value in doing so. I object to this change specifically because on my laptop I really like having the ability to easily disable IPv6 when I am not on my home network. My preferred scenario would be something similar to what we have now, which is that if ipv6_enable is set that it takes the same list of interfaces as ipv4 (defaults to AUTO) and that rtadv is enabled by default for each of those interfaces. My feeling is that this not only significantly reduces POLA it will also more precisely fit the way that the vast majority of our users will actually use IPv6. On a "marketing" note I really think it would be valuable to make it as easy as possible for the average user to get IPv6 working. We have IPv4 down to it more or less "just works," I think IPv6 should be the same way. (On a side note, I'd actually like to see DHCP be the default for IPv4 such that if you have DHCP available on a network you wouldn't have to do any configuration at all to get FreeBSD on line, but that's a whole other topic.) > An interface which is in $network_interfaces and not in > $ipv6_network_interfaces will be marked as "inet6 > -auto_linklocal ifdisabled" (see ifconfig(8)). I think that if a user specifies both lists, and that they differ, that this is a very good way to handle it. > - $ipv6_ifconfig_xxx is renamed to ifconfig_xxx_ipv6 for > consistency with other address families. The old variables > still work but can be removed in the future. Note that > ipv6_ifconfig_xxx="..." should be replaced with > ifconfig_xxx_ipv6="inet6 ...". I see that you are giving a warn'ing when the old format is detected, which is good. > - Receiving ICMPv6 Router Advertisement is not automatically > enabled even if there is no manual configuration of IPv6 in > rc.conf. If you want it, define > ifconfig_xxx_ipv6="inet6 ... accept_rtadv". What is the reason for this change? While I am definitely in favor of making it easier to disable rtadv, I still think it should be the default. > - The rc.d/ip6addrctl now chooses address selection policy based > on $ipv6_prefer, not $ipv6_enable. The default is > ipv6_prefer=NO. Once again, what is the reason for this change? My read of the IPv6-using community is that if they have it available they want to use it as a first choice. I know that is certainly my preference. Once again my apologies for the late review, but hopefully this is useful. Doug -- This .signature sanitized for your protection From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 22:52:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07AF1065670; Wed, 16 Sep 2009 22:52:20 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90A8C8FC1C; Wed, 16 Sep 2009 22:52:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GMqK9f038104; Wed, 16 Sep 2009 22:52:20 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GMqKew038102; Wed, 16 Sep 2009 22:52:20 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200909162252.n8GMqKew038102@svn.freebsd.org> From: Scott Long Date: Wed, 16 Sep 2009 22:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197260 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 22:52:20 -0000 Author: scottl Date: Wed Sep 16 22:52:20 2009 New Revision: 197260 URL: http://svn.freebsd.org/changeset/base/197260 Log: Increase CISS_MAX_PHYSTGT to 256 so that it matches what the controller might give us. Without this, certain data structures get sized incorrectly, leading to a panic on certain cards that want to use high-value target numbers. Modified: head/sys/dev/ciss/cissvar.h Modified: head/sys/dev/ciss/cissvar.h ============================================================================== --- head/sys/dev/ciss/cissvar.h Wed Sep 16 19:53:29 2009 (r197259) +++ head/sys/dev/ciss/cissvar.h Wed Sep 16 22:52:20 2009 (r197260) @@ -176,7 +176,7 @@ struct ciss_pdrive #define CISS_PHYSICAL_SHIFT 5 #define CISS_PHYSICAL_BASE (1 << CISS_PHYSICAL_SHIFT) -#define CISS_MAX_PHYSTGT 15 +#define CISS_MAX_PHYSTGT 256 #define CISS_IS_PHYSICAL(bus) (bus >= CISS_PHYSICAL_BASE) #define CISS_CAM_TO_PBUS(bus) (bus - CISS_PHYSICAL_BASE) From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 23:10:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E3EC106566B; Wed, 16 Sep 2009 23:10:11 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 407148FC13; Wed, 16 Sep 2009 23:10:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GNABj6038528; Wed, 16 Sep 2009 23:10:11 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GNAB5X038525; Wed, 16 Sep 2009 23:10:11 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200909162310.n8GNAB5X038525@svn.freebsd.org> From: Scott Long Date: Wed, 16 Sep 2009 23:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197261 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 23:10:11 -0000 Author: scottl Date: Wed Sep 16 23:10:10 2009 New Revision: 197261 URL: http://svn.freebsd.org/changeset/base/197261 Log: Make MSI and PERFORMANT interrupts work correctly. Only require the minimum number of MSIX interrupts that are needed, and don't strictly check for 4. Enable enough interrupt mask bits so that the controller will generate interrupts in PERFORMANT mode. This fixes the hang-on-boot issues that people were seeing with newer controllers. Modified: head/sys/dev/ciss/ciss.c head/sys/dev/ciss/cissreg.h Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Wed Sep 16 22:52:20 2009 (r197260) +++ head/sys/dev/ciss/ciss.c Wed Sep 16 23:10:10 2009 (r197261) @@ -736,11 +736,16 @@ setup: ciss_printf(sc, "PERFORMANT Transport\n"); if ((ciss_force_interrupt != 1) && (ciss_setup_msix(sc) == 0)) { intr = ciss_perf_msi_intr; - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_MSI; } else { intr = ciss_perf_intr; - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ; } + /* XXX The docs say that the 0x01 bit is only for SAS controllers. + * Unfortunately, there is no good way to know if this is a SAS + * controller. Hopefully enabling this bit universally will work OK. + * It seems to work fine for SA6i controllers. + */ + sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | CISS_TL_PERF_INTR_MSI; + } else { ciss_printf(sc, "SIMPLE Transport\n"); /* MSIX doesn't seem to work in SIMPLE mode, only enable if it forced */ @@ -834,7 +839,10 @@ ciss_setup_msix(struct ciss_softc *sc) return (EINVAL); val = pci_msix_count(sc->ciss_dev); - if ((val != CISS_MSI_COUNT) || (pci_alloc_msix(sc->ciss_dev, &val) != 0)) + if (val < CISS_MSI_COUNT) + return (EINVAL); + val = MIN(val, CISS_MSI_COUNT); + if (pci_alloc_msix(sc->ciss_dev, &val) != 0) return (EINVAL); sc->ciss_msi = val; Modified: head/sys/dev/ciss/cissreg.h ============================================================================== --- head/sys/dev/ciss/cissreg.h Wed Sep 16 22:52:20 2009 (r197260) +++ head/sys/dev/ciss/cissreg.h Wed Sep 16 23:10:10 2009 (r197261) @@ -736,7 +736,8 @@ struct ciss_bmic_flush_cache { #define CISS_TL_PERF_CLEAR_INT(sc) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_ODC, CISS_TL_SIMPLE_ODC_CLEAR) #define CISS_CYCLE_MASK 0x00000001 -#define CISS_MSI_COUNT 4 +/* Only need one MSI/MSI-X vector */ +#define CISS_MSI_COUNT 1 #define CISS_TL_SIMPLE_DISABLE_INTERRUPTS(sc) \ CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IMR, \ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 23:17:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7FDB106566C; Wed, 16 Sep 2009 23:17:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82B58FC19; Wed, 16 Sep 2009 23:17:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GNHMt5038702; Wed, 16 Sep 2009 23:17:22 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GNHMFs038700; Wed, 16 Sep 2009 23:17:22 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200909162317.n8GNHMFs038700@svn.freebsd.org> From: Scott Long Date: Wed, 16 Sep 2009 23:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197262 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 23:17:22 -0000 Author: scottl Date: Wed Sep 16 23:17:22 2009 New Revision: 197262 URL: http://svn.freebsd.org/changeset/base/197262 Log: Fix locking around copyout() operations. Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Wed Sep 16 23:10:10 2009 (r197261) +++ head/sys/dev/ciss/ciss.c Wed Sep 16 23:17:22 2009 (r197262) @@ -2567,15 +2567,16 @@ ciss_user_command(struct ciss_softc *sc, /* * Allocate an in-kernel databuffer if required, copy in user data. */ + mtx_unlock(&sc->ciss_mtx); cr->cr_length = ioc->buf_size; if (ioc->buf_size > 0) { if ((cr->cr_data = malloc(ioc->buf_size, CISS_MALLOC_CLASS, M_NOWAIT)) == NULL) { error = ENOMEM; - goto out; + goto out_unlocked; } if ((error = copyin(ioc->buf, cr->cr_data, ioc->buf_size))) { debug(0, "copyin: bad data buffer %p/%d", ioc->buf, ioc->buf_size); - goto out; + goto out_unlocked; } } @@ -2586,6 +2587,7 @@ ciss_user_command(struct ciss_softc *sc, bcopy(&ioc->Request, &cc->cdb, sizeof(cc->cdb)); /* XXX anything else to populate here? */ + mtx_lock(&sc->ciss_mtx); /* * Run the command. @@ -2606,15 +2608,19 @@ ciss_user_command(struct ciss_softc *sc, * Copy the results back to the user. */ bcopy(ce, &ioc->error_info, sizeof(*ce)); + mtx_unlock(&sc->ciss_mtx); if ((ioc->buf_size > 0) && (error = copyout(cr->cr_data, ioc->buf, ioc->buf_size))) { debug(0, "copyout: bad data buffer %p/%d", ioc->buf, ioc->buf_size); - goto out; + goto out_unlocked; } /* done OK */ error = 0; +out_unlocked: + mtx_lock(&sc->ciss_mtx); + out: if ((cr != NULL) && (cr->cr_data != NULL)) free(cr->cr_data, CISS_MALLOC_CLASS); From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 23:27:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58F5810656B3; Wed, 16 Sep 2009 23:27:15 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47F8F8FC8F; Wed, 16 Sep 2009 23:27:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8GNREa1038900; Wed, 16 Sep 2009 23:27:14 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8GNREaC038896; Wed, 16 Sep 2009 23:27:14 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200909162327.n8GNREaC038896@svn.freebsd.org> From: Scott Long Date: Wed, 16 Sep 2009 23:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197263 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 23:27:15 -0000 Author: scottl Date: Wed Sep 16 23:27:14 2009 New Revision: 197263 URL: http://svn.freebsd.org/changeset/base/197263 Log: Sync driver with Yahoo: - Implement MSI support (MSIX support was already there) - Use a table to drive MSI/MSIX exceptions - Pre-calculate the command address instead of wasting cycles doing the calculation on every i/o. Modified: head/sys/dev/ciss/ciss.c head/sys/dev/ciss/cissreg.h head/sys/dev/ciss/cissvar.h Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Wed Sep 16 23:17:22 2009 (r197262) +++ head/sys/dev/ciss/ciss.c Wed Sep 16 23:27:14 2009 (r197263) @@ -279,8 +279,10 @@ TUNABLE_INT("hw.ciss.force_interrupt", & * stick with matching against subvendor/subdevice, and thus have to * be updated for every new CISS adapter that appears. */ -#define CISS_BOARD_SA5 (1<<0) -#define CISS_BOARD_SA5B (1<<1) +#define CISS_BOARD_UNKNWON 0 +#define CISS_BOARD_SA5 1 +#define CISS_BOARD_SA5B 2 +#define CISS_BOARD_NOMSI (1<<4) static struct { @@ -289,10 +291,10 @@ static struct int flags; char *desc; } ciss_vendor_data[] = { - { 0x0e11, 0x4070, CISS_BOARD_SA5, "Compaq Smart Array 5300" }, - { 0x0e11, 0x4080, CISS_BOARD_SA5B, "Compaq Smart Array 5i" }, - { 0x0e11, 0x4082, CISS_BOARD_SA5B, "Compaq Smart Array 532" }, - { 0x0e11, 0x4083, CISS_BOARD_SA5B, "HP Smart Array 5312" }, + { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI, "Compaq Smart Array 5300" }, + { 0x0e11, 0x4080, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 5i" }, + { 0x0e11, 0x4082, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 532" }, + { 0x0e11, 0x4083, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "HP Smart Array 5312" }, { 0x0e11, 0x4091, CISS_BOARD_SA5, "HP Smart Array 6i" }, { 0x0e11, 0x409A, CISS_BOARD_SA5, "HP Smart Array 641" }, { 0x0e11, 0x409B, CISS_BOARD_SA5, "HP Smart Array 642" }, @@ -661,7 +663,6 @@ ciss_init_pci(struct ciss_softc *sc) (CISS_TRANSPORT_METHOD_SIMPLE | CISS_TRANSPORT_METHOD_PERF))) { ciss_printf(sc, "No supported transport layers: 0x%x\n", sc->ciss_cfg->supported_methods); - return(ENXIO); } switch (ciss_force_transport) { @@ -677,7 +678,7 @@ ciss_init_pci(struct ciss_softc *sc) } setup: - if (supported_methods & CISS_TRANSPORT_METHOD_PERF) { + if ((supported_methods & CISS_TRANSPORT_METHOD_PERF) != 0) { method = CISS_TRANSPORT_METHOD_PERF; sc->ciss_perf = (struct ciss_perf_config *)(cbase + cofs + sc->ciss_cfg->transport_offset); @@ -744,7 +745,7 @@ setup: * controller. Hopefully enabling this bit universally will work OK. * It seems to work fine for SA6i controllers. */ - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | CISS_TL_PERF_INTR_MSI; + sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | CISS_TL_PERF_INTR_MSI; } else { ciss_printf(sc, "SIMPLE Transport\n"); @@ -792,7 +793,7 @@ setup: BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - CISS_COMMAND_SG_LENGTH, /* nsegments */ + CISS_MAX_SG_ELEMENTS, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ @@ -810,7 +811,7 @@ setup: BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, CISS_COMMAND_SG_LENGTH, /* maxsize, nsegments */ + MAXBSIZE, CISS_MAX_SG_ELEMENTS, /* maxsize, nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, &sc->ciss_mtx, /* lockfunc, lockarg */ @@ -823,32 +824,42 @@ setup: /************************************************************************ * Setup MSI/MSIX operation (Performant only) - * Four interrupts are available, but we only use 1 right now. + * Four interrupts are available, but we only use 1 right now. If MSI-X + * isn't avaialble, try using MSI instead. */ static int ciss_setup_msix(struct ciss_softc *sc) { - uint32_t id; int val, i; /* Weed out devices that don't actually support MSI */ - id = (pci_get_subvendor(sc->ciss_dev) << 16) | - pci_get_subdevice(sc->ciss_dev); - if ((id == 0x0e114070) || (id == 0x0e114080) || (id == 0x0e114082) || - (id == 0x0e114083)) + i = ciss_lookup(sc->ciss_dev); + if (ciss_vendor_data[i].flags & CISS_BOARD_NOMSI) return (EINVAL); + /* + * Only need to use the minimum number of MSI vectors, as the driver + * doesn't support directed MSIX interrupts. + */ val = pci_msix_count(sc->ciss_dev); - if (val < CISS_MSI_COUNT) - return (EINVAL); + if (val < CISS_MSI_COUNT) { + val = pci_msi_count(sc->ciss_dev); + device_printf(sc->ciss_dev, "got %d MSI messages]\n", val); + if (val < CISS_MSI_COUNT) + return (EINVAL); + } val = MIN(val, CISS_MSI_COUNT); - if (pci_alloc_msix(sc->ciss_dev, &val) != 0) - return (EINVAL); + if (pci_alloc_msix(sc->ciss_dev, &val) != 0) { + if (pci_alloc_msi(sc->ciss_dev, &val) != 0) + return (EINVAL); + } sc->ciss_msi = val; - ciss_printf(sc, "Using MSIX interrupt\n"); + if (bootverbose) + ciss_printf(sc, "Using %d MSIX interrupt%s\n", val, + (val != 1) ? "s" : ""); - for (i = 0; i < CISS_MSI_COUNT; i++) + for (i = 0; i < val; i++) sc->ciss_irq_rid[i] = i + 1; return (0); @@ -1031,7 +1042,7 @@ ciss_soft_reset(struct ciss_softc *sc) NULL, 0)) != 0) break; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = sc->ciss_controllers[i]; if ((error = ciss_synch_request(cr, 60 * 1000)) != 0) @@ -1104,6 +1115,9 @@ ciss_init_requests(struct ciss_softc *sc cr = &sc->ciss_request[i]; cr->cr_sc = sc; cr->cr_tag = i; + cr->cr_cc = (struct ciss_command *)((uintptr_t)sc->ciss_command + + CISS_COMMAND_ALLOC_SIZE * i); + cr->cr_ccphys = sc->ciss_command_phys + CISS_COMMAND_ALLOC_SIZE * i; bus_dmamap_create(sc->ciss_buffer_dmat, 0, &cr->cr_datamap); ciss_enqueue_free(cr); } @@ -1257,7 +1271,7 @@ ciss_report_luns(struct ciss_softc *sc, /* * Build the Report Logical/Physical LUNs command. */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_data = cll; cr->cr_length = report_size; cr->cr_flags = CISS_REQ_DATAIN; @@ -1582,7 +1596,7 @@ ciss_inquiry_logical(struct ciss_softc * if ((error = ciss_get_request(sc, &cr)) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_data = &ld->cl_geometry; cr->cr_length = sizeof(ld->cl_geometry); cr->cr_flags = CISS_REQ_DATAIN; @@ -1646,7 +1660,7 @@ ciss_identify_logical(struct ciss_softc (void **)&ld->cl_ldrive, sizeof(*ld->cl_ldrive))) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = *ld->cl_controller; /* target controller */ cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); @@ -1742,7 +1756,7 @@ ciss_get_ldrive_status(struct ciss_softc (void **)&ld->cl_lstatus, sizeof(*ld->cl_lstatus))) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = *ld->cl_controller; /* target controller */ cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); @@ -1832,7 +1846,7 @@ ciss_accept_media(struct ciss_softc *sc, if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_ACCEPT_MEDIA, NULL, 0)) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = *ld->cl_controller; /* target controller */ cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); cbc->log_drive = ldrive; @@ -2000,7 +2014,7 @@ ciss_start(struct ciss_request *cr) struct ciss_command *cc; /* XXX debugging only */ int error; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; debug(2, "post command %d tag %d ", cr->cr_tag, cc->header.host_tag); /* @@ -2056,7 +2070,7 @@ ciss_done(struct ciss_softc *sc, cr_qhea continue; } cr = &(sc->ciss_request[index]); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.host_tag = tag; /* not updated by adapter */ ciss_enqueue_complete(cr, qh); } @@ -2085,7 +2099,7 @@ ciss_perf_done(struct ciss_softc *sc, cr (tag & CISS_HDR_HOST_TAG_ERROR) ? " with error" : ""); if (index < sc->ciss_max_requests) { cr = &(sc->ciss_request[index]); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.host_tag = tag; /* not updated by adapter */ ciss_enqueue_complete(cr, qh); } else { @@ -2222,7 +2236,7 @@ _ciss_report_request(struct ciss_request debug_called(2); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ce = (struct ciss_error_info *)&(cc->sg[0]); /* @@ -2369,7 +2383,7 @@ ciss_abort_request(struct ciss_request * return(error); /* build the abort command */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.mode.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; /* addressing? */ cc->header.address.physical.target = 0; cc->header.address.physical.bus = 0; @@ -2438,12 +2452,12 @@ ciss_preen_command(struct ciss_request * * Note that we set up the error_info structure here, since the * length can be overwritten by any command. */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.sg_in_list = 0; /* kinda inefficient this way */ cc->header.sg_total = 0; cc->header.host_tag = cr->cr_tag << 2; cc->header.host_tag_zeroes = 0; - cmdphys = CISS_FIND_COMMANDPHYS(cr); + cmdphys = cr->cr_ccphys; cc->error_info.error_info_address = cmdphys + sizeof(struct ciss_command); cc->error_info.error_info_length = CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command); } @@ -2514,7 +2528,7 @@ ciss_get_bmic_request(struct ciss_softc if (!dataout) cr->cr_flags = CISS_REQ_DATAIN; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.physical.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; cc->header.address.physical.bus = 0; cc->header.address.physical.target = 0; @@ -2562,7 +2576,7 @@ ciss_user_command(struct ciss_softc *sc, */ while (ciss_get_request(sc, &cr) != 0) msleep(sc, &sc->ciss_mtx, PPAUSE, "cissREQ", hz); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; /* * Allocate an in-kernel databuffer if required, copy in user data. @@ -2667,7 +2681,7 @@ ciss_map_request(struct ciss_request *cr if (sc->ciss_perf) CISS_TL_PERF_POST_CMD(sc, cr); else - CISS_TL_SIMPLE_POST_CMD(sc, CISS_FIND_COMMANDPHYS(cr)); + CISS_TL_SIMPLE_POST_CMD(sc, cr->cr_ccphys); } return(0); @@ -2685,7 +2699,7 @@ ciss_request_map_helper(void *arg, bus_d cr = (struct ciss_request *)arg; sc = cr->cr_sc; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; for (i = 0; i < nseg; i++) { cc->sg[i].address = segs[i].ds_addr; @@ -2725,7 +2739,7 @@ ciss_request_map_helper(void *arg, bus_d if (sc->ciss_perf) CISS_TL_PERF_POST_CMD(sc, cr); else - CISS_TL_SIMPLE_POST_CMD(sc, CISS_FIND_COMMANDPHYS(cr)); + CISS_TL_SIMPLE_POST_CMD(sc, cr->cr_ccphys); } /************************************************************************ @@ -3091,7 +3105,7 @@ ciss_cam_action_io(struct cam_sim *sim, /* * Build the command. */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_data = csio->data_ptr; cr->cr_length = csio->dxfer_len; cr->cr_complete = ciss_cam_complete; @@ -3235,7 +3249,7 @@ ciss_cam_complete(struct ciss_request *c debug_called(2); sc = cr->cr_sc; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ce = (struct ciss_error_info *)&(cc->sg[0]); csio = (struct ccb_scsiio *)cr->cr_private; @@ -3414,7 +3428,7 @@ ciss_periodic(void *arg) * Send the NOP message and wait for a response. */ if (ciss_nop_message_heartbeat != 0 && (error = ciss_get_request(sc, &cr)) == 0) { - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_complete = ciss_nop_complete; cc->cdb.cdb_length = 1; cc->cdb.type = CISS_CDB_TYPE_MESSAGE; @@ -3484,7 +3498,7 @@ ciss_disable_adapter(struct ciss_softc * if ((cr->cr_flags & CISS_REQ_BUSY) == 0) continue; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ce = (struct ciss_error_info *)&(cc->sg[0]); ce->command_status = CISS_CMD_STATUS_HARDWARE_ERROR; ciss_enqueue_complete(cr, &qh); @@ -3561,7 +3575,7 @@ ciss_notify_event(struct ciss_softc *sc) ciss_preen_command(cr); /* (re)build the notify event command */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.physical.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; cc->header.address.physical.bus = 0; cc->header.address.physical.target = 0; @@ -3615,7 +3629,7 @@ ciss_notify_complete(struct ciss_request int command_status; debug_called(1); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cn = (struct ciss_notify *)cr->cr_data; sc = cr->cr_sc; @@ -3715,7 +3729,7 @@ ciss_notify_abort(struct ciss_softc *sc) cr->cr_length = CISS_NOTIFY_DATA_SIZE; /* build the CDB */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.physical.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; cc->header.address.physical.bus = 0; cc->header.address.physical.target = 0; @@ -4174,7 +4188,7 @@ ciss_print_request(struct ciss_request * int i; sc = cr->cr_sc; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ciss_printf(sc, "REQUEST @ %p\n", cr); ciss_printf(sc, " data %p/%d tag %d flags %b\n", Modified: head/sys/dev/ciss/cissreg.h ============================================================================== --- head/sys/dev/ciss/cissreg.h Wed Sep 16 23:17:22 2009 (r197262) +++ head/sys/dev/ciss/cissreg.h Wed Sep 16 23:27:14 2009 (r197263) @@ -731,7 +731,7 @@ struct ciss_bmic_flush_cache { #define CISS_TL_PERF_INTR_OPQ (CISS_TL_SIMPLE_INTR_OPQ_SA5 | CISS_TL_SIMPLE_INTR_OPQ_SA5B) #define CISS_TL_PERF_INTR_MSI 0x01 -#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IPQ, CISS_FIND_COMMANDPHYS(cr) | (cr)->cr_sg_tag) +#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IPQ, cr->cr_ccphys | (cr)->cr_sg_tag) #define CISS_TL_PERF_FLUSH_INT(sc) CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_OSR) #define CISS_TL_PERF_CLEAR_INT(sc) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_ODC, CISS_TL_SIMPLE_ODC_CLEAR) #define CISS_CYCLE_MASK 0x00000001 @@ -747,4 +747,5 @@ struct ciss_bmic_flush_cache { CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_IMR) & ~(sc)->ciss_interrupt_mask) + #endif /* _KERNEL */ Modified: head/sys/dev/ciss/cissvar.h ============================================================================== --- head/sys/dev/ciss/cissvar.h Wed Sep 16 23:17:22 2009 (r197262) +++ head/sys/dev/ciss/cissvar.h Wed Sep 16 23:27:14 2009 (r197263) @@ -103,6 +103,8 @@ struct ciss_request void *cr_data; /* data buffer */ u_int32_t cr_length; /* data length */ bus_dmamap_t cr_datamap; /* DMA map for data */ + struct ciss_command *cr_cc; + uint32_t cr_ccphys; int cr_tag; int cr_flags; #define CISS_REQ_MAPPED (1<<0) /* data mapped */ @@ -131,18 +133,16 @@ struct ciss_request * scatter-gather list, and we also want to avoid having commands * cross page boundaries. * - * Note that 512 bytes yields 28 scatter/gather entries, or the - * ability to map (26 * PAGE_SIZE) + 2 bytes of data. On x86, this is - * 104kB. 256 bytes would only yield 12 entries, giving a mere 40kB, - * too small. + * The size of the ciss_command is 52 bytes. 65 s/g elements are reserved + * to allow a max i/o size of 256k. This gives a total command size of + * 1120 bytes, including the 32 byte alignment padding. Modern controllers + * seem to saturate nicely at this value. */ -#define CISS_COMMAND_ALLOC_SIZE 512 /* XXX tune to get sensible s/g list length */ -#define CISS_COMMAND_SG_LENGTH ((CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command)) \ - / sizeof(struct ciss_sg_entry)) - -/* XXX Prep for increasing max i/o */ -#define CISS_MAX_SG_ELEMENTS 17 +#define CISS_MAX_SG_ELEMENTS 65 +#define CISS_COMMAND_ALIGN 32 +#define CISS_COMMAND_SG_LENGTH (sizeof(struct ciss_sg_entry) * CISS_MAX_SG_ELEMENTS) +#define CISS_COMMAND_ALLOC_SIZE (roundup2(sizeof(struct ciss_command) + CISS_COMMAND_SG_LENGTH, CISS_COMMAND_ALIGN)) /* * Per-logical-drive data. @@ -259,20 +259,6 @@ struct ciss_softc struct ciss_qstat ciss_qstat[CISSQ_COUNT]; /* queue statistics */ }; -/* - * Given a request tag, find the corresponding command in virtual or - * physical space. - * - * The arithmetic here is due to the allocation of ciss_command structures - * inside CISS_COMMAND_ALLOC_SIZE blocks. See the comment at the definition - * of CISS_COMMAND_ALLOC_SIZE above. - */ -#define CISS_FIND_COMMAND(cr) \ - (struct ciss_command *)((u_int8_t *)(cr)->cr_sc->ciss_command + \ - ((cr)->cr_tag * CISS_COMMAND_ALLOC_SIZE)) -#define CISS_FIND_COMMANDPHYS(cr) ((cr)->cr_sc->ciss_command_phys + \ - ((cr)->cr_tag * CISS_COMMAND_ALLOC_SIZE)) - /************************************************************************ * Debugging/diagnostic output. */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 16 23:31:37 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F32B1065670; Wed, 16 Sep 2009 23:31:37 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 96BB18FC0A; Wed, 16 Sep 2009 23:31:35 +0000 (UTC) Received: from [IPv6:::1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n8GNVO13099773; Wed, 16 Sep 2009 17:31:24 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1075.2) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Scott Long In-Reply-To: <200909162327.n8GNREaC038896@svn.freebsd.org> Date: Wed, 16 Sep 2009 17:31:23 -0600 Content-Transfer-Encoding: 7bit Message-Id: <83DE06A4-33D2-4271-AF88-C1929DA9E254@samsco.org> References: <200909162327.n8GNREaC038896@svn.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.1075.2) X-Spam-Status: No, score=-3.9 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197263 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 23:31:37 -0000 Forgot to mention that this also re-works how command memory is allocated, and as a result allows up to 256k i/o's now. Scott On Sep 16, 2009, at 5:27 PM, Scott Long wrote: > Author: scottl > Date: Wed Sep 16 23:27:14 2009 > New Revision: 197263 > URL: http://svn.freebsd.org/changeset/base/197263 > > Log: > Sync driver with Yahoo: > > - Implement MSI support (MSIX support was already there) > - Use a table to drive MSI/MSIX exceptions > - Pre-calculate the command address instead of wasting cycles doing > the > calculation on every i/o. > > Modified: > head/sys/dev/ciss/ciss.c > head/sys/dev/ciss/cissreg.h > head/sys/dev/ciss/cissvar.h > > Modified: head/sys/dev/ciss/ciss.c > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/dev/ciss/ciss.c Wed Sep 16 23:17:22 2009 (r197262) > +++ head/sys/dev/ciss/ciss.c Wed Sep 16 23:27:14 2009 (r197263) > @@ -279,8 +279,10 @@ TUNABLE_INT("hw.ciss.force_interrupt", & > * stick with matching against subvendor/subdevice, and thus have to > * be updated for every new CISS adapter that appears. > */ > -#define CISS_BOARD_SA5 (1<<0) > -#define CISS_BOARD_SA5B (1<<1) > +#define CISS_BOARD_UNKNWON 0 > +#define CISS_BOARD_SA5 1 > +#define CISS_BOARD_SA5B 2 > +#define CISS_BOARD_NOMSI (1<<4) > > static struct > { > @@ -289,10 +291,10 @@ static struct > int flags; > char *desc; > } ciss_vendor_data[] = { > - { 0x0e11, 0x4070, CISS_BOARD_SA5, "Compaq Smart Array 5300" }, > - { 0x0e11, 0x4080, CISS_BOARD_SA5B, "Compaq Smart Array 5i" }, > - { 0x0e11, 0x4082, CISS_BOARD_SA5B, "Compaq Smart Array 532" }, > - { 0x0e11, 0x4083, CISS_BOARD_SA5B, "HP Smart Array 5312" }, > + { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI, "Compaq > Smart Array 5300" }, > + { 0x0e11, 0x4080, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq > Smart Array 5i" }, > + { 0x0e11, 0x4082, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq > Smart Array 532" }, > + { 0x0e11, 0x4083, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "HP Smart > Array 5312" }, > { 0x0e11, 0x4091, CISS_BOARD_SA5, "HP Smart Array 6i" }, > { 0x0e11, 0x409A, CISS_BOARD_SA5, "HP Smart Array 641" }, > { 0x0e11, 0x409B, CISS_BOARD_SA5, "HP Smart Array 642" }, > @@ -661,7 +663,6 @@ ciss_init_pci(struct ciss_softc *sc) > (CISS_TRANSPORT_METHOD_SIMPLE | CISS_TRANSPORT_METHOD_PERF))) { > ciss_printf(sc, "No supported transport layers: 0x%x\n", > sc->ciss_cfg->supported_methods); > - return(ENXIO); > } > > switch (ciss_force_transport) { > @@ -677,7 +678,7 @@ ciss_init_pci(struct ciss_softc *sc) > } > > setup: > - if (supported_methods & CISS_TRANSPORT_METHOD_PERF) { > + if ((supported_methods & CISS_TRANSPORT_METHOD_PERF) != 0) { > method = CISS_TRANSPORT_METHOD_PERF; > sc->ciss_perf = (struct ciss_perf_config *)(cbase + cofs + > sc->ciss_cfg->transport_offset); > @@ -744,7 +745,7 @@ setup: > * controller. Hopefully enabling this bit universally will work OK. > * It seems to work fine for SA6i controllers. > */ > - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | > CISS_TL_PERF_INTR_MSI; > + sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | > CISS_TL_PERF_INTR_MSI; > > } else { > ciss_printf(sc, "SIMPLE Transport\n"); > @@ -792,7 +793,7 @@ setup: > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filter, filterarg */ > BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ > - CISS_COMMAND_SG_LENGTH, /* nsegments */ > + CISS_MAX_SG_ELEMENTS, /* nsegments */ > BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ > 0, /* flags */ > NULL, NULL, /* lockfunc, lockarg */ > @@ -810,7 +811,7 @@ setup: > BUS_SPACE_MAXADDR, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filter, filterarg */ > - MAXBSIZE, CISS_COMMAND_SG_LENGTH, /* maxsize, nsegments */ > + MAXBSIZE, CISS_MAX_SG_ELEMENTS, /* maxsize, nsegments */ > BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ > BUS_DMA_ALLOCNOW, /* flags */ > busdma_lock_mutex, &sc->ciss_mtx, /* lockfunc, lockarg */ > @@ -823,32 +824,42 @@ setup: > > / > ************************************************************************ > * Setup MSI/MSIX operation (Performant only) > - * Four interrupts are available, but we only use 1 right now. > + * Four interrupts are available, but we only use 1 right now. If > MSI-X > + * isn't avaialble, try using MSI instead. > */ > static int > ciss_setup_msix(struct ciss_softc *sc) > { > - uint32_t id; > int val, i; > > /* Weed out devices that don't actually support MSI */ > - id = (pci_get_subvendor(sc->ciss_dev) << 16) | > - pci_get_subdevice(sc->ciss_dev); > - if ((id == 0x0e114070) || (id == 0x0e114080) || (id == > 0x0e114082) || > - (id == 0x0e114083)) > + i = ciss_lookup(sc->ciss_dev); > + if (ciss_vendor_data[i].flags & CISS_BOARD_NOMSI) > return (EINVAL); > > + /* > + * Only need to use the minimum number of MSI vectors, as the > driver > + * doesn't support directed MSIX interrupts. > + */ > val = pci_msix_count(sc->ciss_dev); > - if (val < CISS_MSI_COUNT) > - return (EINVAL); > + if (val < CISS_MSI_COUNT) { > + val = pci_msi_count(sc->ciss_dev); > + device_printf(sc->ciss_dev, "got %d MSI messages]\n", val); > + if (val < CISS_MSI_COUNT) > + return (EINVAL); > + } > val = MIN(val, CISS_MSI_COUNT); > - if (pci_alloc_msix(sc->ciss_dev, &val) != 0) > - return (EINVAL); > + if (pci_alloc_msix(sc->ciss_dev, &val) != 0) { > + if (pci_alloc_msi(sc->ciss_dev, &val) != 0) > + return (EINVAL); > + } > > sc->ciss_msi = val; > - ciss_printf(sc, "Using MSIX interrupt\n"); > + if (bootverbose) > + ciss_printf(sc, "Using %d MSIX interrupt%s\n", val, > + (val != 1) ? "s" : ""); > > - for (i = 0; i < CISS_MSI_COUNT; i++) > + for (i = 0; i < val; i++) > sc->ciss_irq_rid[i] = i + 1; > > return (0); > @@ -1031,7 +1042,7 @@ ciss_soft_reset(struct ciss_softc *sc) > NULL, 0)) != 0) > break; > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address = sc->ciss_controllers[i]; > > if ((error = ciss_synch_request(cr, 60 * 1000)) != 0) > @@ -1104,6 +1115,9 @@ ciss_init_requests(struct ciss_softc *sc > cr = &sc->ciss_request[i]; > cr->cr_sc = sc; > cr->cr_tag = i; > + cr->cr_cc = (struct ciss_command *)((uintptr_t)sc->ciss_command + > + CISS_COMMAND_ALLOC_SIZE * i); > + cr->cr_ccphys = sc->ciss_command_phys + CISS_COMMAND_ALLOC_SIZE * i; > bus_dmamap_create(sc->ciss_buffer_dmat, 0, &cr->cr_datamap); > ciss_enqueue_free(cr); > } > @@ -1257,7 +1271,7 @@ ciss_report_luns(struct ciss_softc *sc, > /* > * Build the Report Logical/Physical LUNs command. > */ > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cr->cr_data = cll; > cr->cr_length = report_size; > cr->cr_flags = CISS_REQ_DATAIN; > @@ -1582,7 +1596,7 @@ ciss_inquiry_logical(struct ciss_softc * > if ((error = ciss_get_request(sc, &cr)) != 0) > goto out; > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cr->cr_data = &ld->cl_geometry; > cr->cr_length = sizeof(ld->cl_geometry); > cr->cr_flags = CISS_REQ_DATAIN; > @@ -1646,7 +1660,7 @@ ciss_identify_logical(struct ciss_softc > (void **)&ld->cl_ldrive, > sizeof(*ld->cl_ldrive))) != 0) > goto out; > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address = *ld->cl_controller; /* target controller */ > cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); > cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); > @@ -1742,7 +1756,7 @@ ciss_get_ldrive_status(struct ciss_softc > (void **)&ld->cl_lstatus, > sizeof(*ld->cl_lstatus))) != 0) > goto out; > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address = *ld->cl_controller; /* target controller */ > cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); > cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); > @@ -1832,7 +1846,7 @@ ciss_accept_media(struct ciss_softc *sc, > if ((error = ciss_get_bmic_request(sc, &cr, > CISS_BMIC_ACCEPT_MEDIA, > NULL, 0)) != 0) > goto out; > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address = *ld->cl_controller; /* target controller */ > cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); > cbc->log_drive = ldrive; > @@ -2000,7 +2014,7 @@ ciss_start(struct ciss_request *cr) > struct ciss_command *cc; /* XXX debugging only */ > int error; > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > debug(2, "post command %d tag %d ", cr->cr_tag, cc- > >header.host_tag); > > /* > @@ -2056,7 +2070,7 @@ ciss_done(struct ciss_softc *sc, cr_qhea > continue; > } > cr = &(sc->ciss_request[index]); > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.host_tag = tag; /* not updated by adapter */ > ciss_enqueue_complete(cr, qh); > } > @@ -2085,7 +2099,7 @@ ciss_perf_done(struct ciss_softc *sc, cr > (tag & CISS_HDR_HOST_TAG_ERROR) ? " with error" : ""); > if (index < sc->ciss_max_requests) { > cr = &(sc->ciss_request[index]); > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.host_tag = tag; /* not updated by adapter */ > ciss_enqueue_complete(cr, qh); > } else { > @@ -2222,7 +2236,7 @@ _ciss_report_request(struct ciss_request > > debug_called(2); > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > ce = (struct ciss_error_info *)&(cc->sg[0]); > > /* > @@ -2369,7 +2383,7 @@ ciss_abort_request(struct ciss_request * > return(error); > > /* build the abort command */ > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address.mode.mode = > CISS_HDR_ADDRESS_MODE_PERIPHERAL; /* addressing? */ > cc->header.address.physical.target = 0; > cc->header.address.physical.bus = 0; > @@ -2438,12 +2452,12 @@ ciss_preen_command(struct ciss_request * > * Note that we set up the error_info structure here, since the > * length can be overwritten by any command. > */ > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.sg_in_list = 0; /* kinda inefficient this way */ > cc->header.sg_total = 0; > cc->header.host_tag = cr->cr_tag << 2; > cc->header.host_tag_zeroes = 0; > - cmdphys = CISS_FIND_COMMANDPHYS(cr); > + cmdphys = cr->cr_ccphys; > cc->error_info.error_info_address = cmdphys + sizeof(struct > ciss_command); > cc->error_info.error_info_length = CISS_COMMAND_ALLOC_SIZE - > sizeof(struct ciss_command); > } > @@ -2514,7 +2528,7 @@ ciss_get_bmic_request(struct ciss_softc > if (!dataout) > cr->cr_flags = CISS_REQ_DATAIN; > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address.physical.mode = > CISS_HDR_ADDRESS_MODE_PERIPHERAL; > cc->header.address.physical.bus = 0; > cc->header.address.physical.target = 0; > @@ -2562,7 +2576,7 @@ ciss_user_command(struct ciss_softc *sc, > */ > while (ciss_get_request(sc, &cr) != 0) > msleep(sc, &sc->ciss_mtx, PPAUSE, "cissREQ", hz); > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > > /* > * Allocate an in-kernel databuffer if required, copy in user > data. > @@ -2667,7 +2681,7 @@ ciss_map_request(struct ciss_request *cr > if (sc->ciss_perf) > CISS_TL_PERF_POST_CMD(sc, cr); > else > - CISS_TL_SIMPLE_POST_CMD(sc, CISS_FIND_COMMANDPHYS(cr)); > + CISS_TL_SIMPLE_POST_CMD(sc, cr->cr_ccphys); > } > > return(0); > @@ -2685,7 +2699,7 @@ ciss_request_map_helper(void *arg, bus_d > > cr = (struct ciss_request *)arg; > sc = cr->cr_sc; > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > > for (i = 0; i < nseg; i++) { > cc->sg[i].address = segs[i].ds_addr; > @@ -2725,7 +2739,7 @@ ciss_request_map_helper(void *arg, bus_d > if (sc->ciss_perf) > CISS_TL_PERF_POST_CMD(sc, cr); > else > - CISS_TL_SIMPLE_POST_CMD(sc, CISS_FIND_COMMANDPHYS(cr)); > + CISS_TL_SIMPLE_POST_CMD(sc, cr->cr_ccphys); > } > > / > ************************************************************************ > @@ -3091,7 +3105,7 @@ ciss_cam_action_io(struct cam_sim *sim, > /* > * Build the command. > */ > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cr->cr_data = csio->data_ptr; > cr->cr_length = csio->dxfer_len; > cr->cr_complete = ciss_cam_complete; > @@ -3235,7 +3249,7 @@ ciss_cam_complete(struct ciss_request *c > debug_called(2); > > sc = cr->cr_sc; > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > ce = (struct ciss_error_info *)&(cc->sg[0]); > csio = (struct ccb_scsiio *)cr->cr_private; > > @@ -3414,7 +3428,7 @@ ciss_periodic(void *arg) > * Send the NOP message and wait for a response. > */ > if (ciss_nop_message_heartbeat != 0 && (error = ciss_get_request > (sc, &cr)) == 0) { > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cr->cr_complete = ciss_nop_complete; > cc->cdb.cdb_length = 1; > cc->cdb.type = CISS_CDB_TYPE_MESSAGE; > @@ -3484,7 +3498,7 @@ ciss_disable_adapter(struct ciss_softc * > if ((cr->cr_flags & CISS_REQ_BUSY) == 0) > continue; > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > ce = (struct ciss_error_info *)&(cc->sg[0]); > ce->command_status = CISS_CMD_STATUS_HARDWARE_ERROR; > ciss_enqueue_complete(cr, &qh); > @@ -3561,7 +3575,7 @@ ciss_notify_event(struct ciss_softc *sc) > ciss_preen_command(cr); > > /* (re)build the notify event command */ > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address.physical.mode = > CISS_HDR_ADDRESS_MODE_PERIPHERAL; > cc->header.address.physical.bus = 0; > cc->header.address.physical.target = 0; > @@ -3615,7 +3629,7 @@ ciss_notify_complete(struct ciss_request > int command_status; > debug_called(1); > > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cn = (struct ciss_notify *)cr->cr_data; > sc = cr->cr_sc; > > @@ -3715,7 +3729,7 @@ ciss_notify_abort(struct ciss_softc *sc) > cr->cr_length = CISS_NOTIFY_DATA_SIZE; > > /* build the CDB */ > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > cc->header.address.physical.mode = > CISS_HDR_ADDRESS_MODE_PERIPHERAL; > cc->header.address.physical.bus = 0; > cc->header.address.physical.target = 0; > @@ -4174,7 +4188,7 @@ ciss_print_request(struct ciss_request * > int i; > > sc = cr->cr_sc; > - cc = CISS_FIND_COMMAND(cr); > + cc = cr->cr_cc; > > ciss_printf(sc, "REQUEST @ %p\n", cr); > ciss_printf(sc, " data %p/%d tag %d flags %b\n", > > Modified: head/sys/dev/ciss/cissreg.h > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/dev/ciss/cissreg.h Wed Sep 16 23:17:22 2009 (r197262) > +++ head/sys/dev/ciss/cissreg.h Wed Sep 16 23:27:14 2009 (r197263) > @@ -731,7 +731,7 @@ struct ciss_bmic_flush_cache { > #define CISS_TL_PERF_INTR_OPQ (CISS_TL_SIMPLE_INTR_OPQ_SA5 | > CISS_TL_SIMPLE_INTR_OPQ_SA5B) > #define CISS_TL_PERF_INTR_MSI 0x01 > > -#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, > CISS_TL_SIMPLE_IPQ, CISS_FIND_COMMANDPHYS(cr) | (cr)->cr_sg_tag) > +#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, > CISS_TL_SIMPLE_IPQ, cr->cr_ccphys | (cr)->cr_sg_tag) > #define CISS_TL_PERF_FLUSH_INT(sc) CISS_TL_SIMPLE_READ(sc, > CISS_TL_SIMPLE_OSR) > #define CISS_TL_PERF_CLEAR_INT(sc) CISS_TL_SIMPLE_WRITE(sc, > CISS_TL_SIMPLE_ODC, CISS_TL_SIMPLE_ODC_CLEAR) > #define CISS_CYCLE_MASK 0x00000001 > @@ -747,4 +747,5 @@ struct ciss_bmic_flush_cache { > CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_IMR) & ~(sc)- > >ciss_interrupt_mask) > > > + > #endif /* _KERNEL */ > > Modified: head/sys/dev/ciss/cissvar.h > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/dev/ciss/cissvar.h Wed Sep 16 23:17:22 2009 (r197262) > +++ head/sys/dev/ciss/cissvar.h Wed Sep 16 23:27:14 2009 (r197263) > @@ -103,6 +103,8 @@ struct ciss_request > void *cr_data; /* data buffer */ > u_int32_t cr_length; /* data length */ > bus_dmamap_t cr_datamap; /* DMA map for data */ > + struct ciss_command *cr_cc; > + uint32_t cr_ccphys; > int cr_tag; > int cr_flags; > #define CISS_REQ_MAPPED (1<<0) /* data mapped */ > @@ -131,18 +133,16 @@ struct ciss_request > * scatter-gather list, and we also want to avoid having commands > * cross page boundaries. > * > - * Note that 512 bytes yields 28 scatter/gather entries, or the > - * ability to map (26 * PAGE_SIZE) + 2 bytes of data. On x86, this > is > - * 104kB. 256 bytes would only yield 12 entries, giving a mere 40kB, > - * too small. > + * The size of the ciss_command is 52 bytes. 65 s/g elements are > reserved > + * to allow a max i/o size of 256k. This gives a total command > size of > + * 1120 bytes, including the 32 byte alignment padding. Modern > controllers > + * seem to saturate nicely at this value. > */ > > -#define CISS_COMMAND_ALLOC_SIZE 512 /* XXX tune to get sensible s/ > g list length */ > -#define CISS_COMMAND_SG_LENGTH ((CISS_COMMAND_ALLOC_SIZE - sizeof > (struct ciss_command)) \ > - / sizeof(struct ciss_sg_entry)) > - > -/* XXX Prep for increasing max i/o */ > -#define CISS_MAX_SG_ELEMENTS 17 > +#define CISS_MAX_SG_ELEMENTS 65 > +#define CISS_COMMAND_ALIGN 32 > +#define CISS_COMMAND_SG_LENGTH (sizeof(struct ciss_sg_entry) * > CISS_MAX_SG_ELEMENTS) > +#define CISS_COMMAND_ALLOC_SIZE (roundup2(sizeof(struct > ciss_command) + CISS_COMMAND_SG_LENGTH, CISS_COMMAND_ALIGN)) > > /* > * Per-logical-drive data. > @@ -259,20 +259,6 @@ struct ciss_softc > struct ciss_qstat ciss_qstat[CISSQ_COUNT]; /* queue statistics */ > }; > > -/* > - * Given a request tag, find the corresponding command in virtual or > - * physical space. > - * > - * The arithmetic here is due to the allocation of ciss_command > structures > - * inside CISS_COMMAND_ALLOC_SIZE blocks. See the comment at the > definition > - * of CISS_COMMAND_ALLOC_SIZE above. > - */ > -#define CISS_FIND_COMMAND(cr) \ > - (struct ciss_command *)((u_int8_t *)(cr)->cr_sc->ciss_command + \ > - ((cr)->cr_tag * CISS_COMMAND_ALLOC_SIZE)) > -#define CISS_FIND_COMMANDPHYS(cr) ((cr)->cr_sc->ciss_command_phys + \ > - ((cr)->cr_tag * CISS_COMMAND_ALLOC_SIZE)) > - > / > ************************************************************************ > * Debugging/diagnostic output. > */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 05:27:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEBC106566B; Thu, 17 Sep 2009 05:27:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14908FC13; Thu, 17 Sep 2009 05:27:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8H5RWKb045942; Thu, 17 Sep 2009 05:27:32 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8H5RW46045941; Thu, 17 Sep 2009 05:27:32 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200909170527.n8H5RW46045941@svn.freebsd.org> From: Scott Long Date: Thu, 17 Sep 2009 05:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197264 - stable/8/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 05:27:33 -0000 Author: scottl Date: Thu Sep 17 05:27:32 2009 New Revision: 197264 URL: http://svn.freebsd.org/changeset/base/197264 Log: Merge r197260, r197261, r197262 - Prevent a panic on modern controllers by increasing CISS_MAX_PHYSTGT to 256 - Fix MSI and PERFORMANT interrupt programming. Fixes hang on boot. - Fix locking bugs in ioctl handler Most of this has been soaking at Yahoo for several months, if not longer. The quick MFC is due to the impending 8.0-RC1 build. Approved by: re Obtained from: Yahoo! Modified: stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/ciss/cissreg.h stable/8/sys/dev/ciss/cissvar.h Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Wed Sep 16 23:27:14 2009 (r197263) +++ stable/8/sys/dev/ciss/ciss.c Thu Sep 17 05:27:32 2009 (r197264) @@ -736,11 +736,16 @@ setup: ciss_printf(sc, "PERFORMANT Transport\n"); if ((ciss_force_interrupt != 1) && (ciss_setup_msix(sc) == 0)) { intr = ciss_perf_msi_intr; - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_MSI; } else { intr = ciss_perf_intr; - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ; } + /* XXX The docs say that the 0x01 bit is only for SAS controllers. + * Unfortunately, there is no good way to know if this is a SAS + * controller. Hopefully enabling this bit universally will work OK. + * It seems to work fine for SA6i controllers. + */ + sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | CISS_TL_PERF_INTR_MSI; + } else { ciss_printf(sc, "SIMPLE Transport\n"); /* MSIX doesn't seem to work in SIMPLE mode, only enable if it forced */ @@ -834,7 +839,10 @@ ciss_setup_msix(struct ciss_softc *sc) return (EINVAL); val = pci_msix_count(sc->ciss_dev); - if ((val != CISS_MSI_COUNT) || (pci_alloc_msix(sc->ciss_dev, &val) != 0)) + if (val < CISS_MSI_COUNT) + return (EINVAL); + val = MIN(val, CISS_MSI_COUNT); + if (pci_alloc_msix(sc->ciss_dev, &val) != 0) return (EINVAL); sc->ciss_msi = val; @@ -2559,15 +2567,16 @@ ciss_user_command(struct ciss_softc *sc, /* * Allocate an in-kernel databuffer if required, copy in user data. */ + mtx_unlock(&sc->ciss_mtx); cr->cr_length = ioc->buf_size; if (ioc->buf_size > 0) { if ((cr->cr_data = malloc(ioc->buf_size, CISS_MALLOC_CLASS, M_NOWAIT)) == NULL) { error = ENOMEM; - goto out; + goto out_unlocked; } if ((error = copyin(ioc->buf, cr->cr_data, ioc->buf_size))) { debug(0, "copyin: bad data buffer %p/%d", ioc->buf, ioc->buf_size); - goto out; + goto out_unlocked; } } @@ -2578,6 +2587,7 @@ ciss_user_command(struct ciss_softc *sc, bcopy(&ioc->Request, &cc->cdb, sizeof(cc->cdb)); /* XXX anything else to populate here? */ + mtx_lock(&sc->ciss_mtx); /* * Run the command. @@ -2598,15 +2608,19 @@ ciss_user_command(struct ciss_softc *sc, * Copy the results back to the user. */ bcopy(ce, &ioc->error_info, sizeof(*ce)); + mtx_unlock(&sc->ciss_mtx); if ((ioc->buf_size > 0) && (error = copyout(cr->cr_data, ioc->buf, ioc->buf_size))) { debug(0, "copyout: bad data buffer %p/%d", ioc->buf, ioc->buf_size); - goto out; + goto out_unlocked; } /* done OK */ error = 0; +out_unlocked: + mtx_lock(&sc->ciss_mtx); + out: if ((cr != NULL) && (cr->cr_data != NULL)) free(cr->cr_data, CISS_MALLOC_CLASS); Modified: stable/8/sys/dev/ciss/cissreg.h ============================================================================== --- stable/8/sys/dev/ciss/cissreg.h Wed Sep 16 23:27:14 2009 (r197263) +++ stable/8/sys/dev/ciss/cissreg.h Thu Sep 17 05:27:32 2009 (r197264) @@ -736,7 +736,8 @@ struct ciss_bmic_flush_cache { #define CISS_TL_PERF_CLEAR_INT(sc) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_ODC, CISS_TL_SIMPLE_ODC_CLEAR) #define CISS_CYCLE_MASK 0x00000001 -#define CISS_MSI_COUNT 4 +/* Only need one MSI/MSI-X vector */ +#define CISS_MSI_COUNT 1 #define CISS_TL_SIMPLE_DISABLE_INTERRUPTS(sc) \ CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IMR, \ Modified: stable/8/sys/dev/ciss/cissvar.h ============================================================================== --- stable/8/sys/dev/ciss/cissvar.h Wed Sep 16 23:27:14 2009 (r197263) +++ stable/8/sys/dev/ciss/cissvar.h Thu Sep 17 05:27:32 2009 (r197264) @@ -176,7 +176,7 @@ struct ciss_pdrive #define CISS_PHYSICAL_SHIFT 5 #define CISS_PHYSICAL_BASE (1 << CISS_PHYSICAL_SHIFT) -#define CISS_MAX_PHYSTGT 15 +#define CISS_MAX_PHYSTGT 256 #define CISS_IS_PHYSICAL(bus) (bus >= CISS_PHYSICAL_BASE) #define CISS_CAM_TO_PBUS(bus) (bus - CISS_PHYSICAL_BASE) From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 05:30:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA379106566B; Thu, 17 Sep 2009 05:30:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69848FC14; Thu, 17 Sep 2009 05:30:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8H5UtPa046067; Thu, 17 Sep 2009 05:30:55 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8H5UtfL046063; Thu, 17 Sep 2009 05:30:55 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200909170530.n8H5UtfL046063@svn.freebsd.org> From: Scott Long Date: Thu, 17 Sep 2009 05:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197265 - stable/8/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 05:30:55 -0000 Author: scottl Date: Thu Sep 17 05:30:55 2009 New Revision: 197265 URL: http://svn.freebsd.org/changeset/base/197265 Log: Merge rev 197263: - Enable MSI support (MSIX support was already present) - Performance improvements Approved by: re Obtained from: Yahoo! Modified: stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/ciss/cissreg.h stable/8/sys/dev/ciss/cissvar.h Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Thu Sep 17 05:27:32 2009 (r197264) +++ stable/8/sys/dev/ciss/ciss.c Thu Sep 17 05:30:55 2009 (r197265) @@ -279,8 +279,10 @@ TUNABLE_INT("hw.ciss.force_interrupt", & * stick with matching against subvendor/subdevice, and thus have to * be updated for every new CISS adapter that appears. */ -#define CISS_BOARD_SA5 (1<<0) -#define CISS_BOARD_SA5B (1<<1) +#define CISS_BOARD_UNKNWON 0 +#define CISS_BOARD_SA5 1 +#define CISS_BOARD_SA5B 2 +#define CISS_BOARD_NOMSI (1<<4) static struct { @@ -289,10 +291,10 @@ static struct int flags; char *desc; } ciss_vendor_data[] = { - { 0x0e11, 0x4070, CISS_BOARD_SA5, "Compaq Smart Array 5300" }, - { 0x0e11, 0x4080, CISS_BOARD_SA5B, "Compaq Smart Array 5i" }, - { 0x0e11, 0x4082, CISS_BOARD_SA5B, "Compaq Smart Array 532" }, - { 0x0e11, 0x4083, CISS_BOARD_SA5B, "HP Smart Array 5312" }, + { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI, "Compaq Smart Array 5300" }, + { 0x0e11, 0x4080, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 5i" }, + { 0x0e11, 0x4082, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 532" }, + { 0x0e11, 0x4083, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "HP Smart Array 5312" }, { 0x0e11, 0x4091, CISS_BOARD_SA5, "HP Smart Array 6i" }, { 0x0e11, 0x409A, CISS_BOARD_SA5, "HP Smart Array 641" }, { 0x0e11, 0x409B, CISS_BOARD_SA5, "HP Smart Array 642" }, @@ -661,7 +663,6 @@ ciss_init_pci(struct ciss_softc *sc) (CISS_TRANSPORT_METHOD_SIMPLE | CISS_TRANSPORT_METHOD_PERF))) { ciss_printf(sc, "No supported transport layers: 0x%x\n", sc->ciss_cfg->supported_methods); - return(ENXIO); } switch (ciss_force_transport) { @@ -677,7 +678,7 @@ ciss_init_pci(struct ciss_softc *sc) } setup: - if (supported_methods & CISS_TRANSPORT_METHOD_PERF) { + if ((supported_methods & CISS_TRANSPORT_METHOD_PERF) != 0) { method = CISS_TRANSPORT_METHOD_PERF; sc->ciss_perf = (struct ciss_perf_config *)(cbase + cofs + sc->ciss_cfg->transport_offset); @@ -744,7 +745,7 @@ setup: * controller. Hopefully enabling this bit universally will work OK. * It seems to work fine for SA6i controllers. */ - sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | CISS_TL_PERF_INTR_MSI; + sc->ciss_interrupt_mask = CISS_TL_PERF_INTR_OPQ | CISS_TL_PERF_INTR_MSI; } else { ciss_printf(sc, "SIMPLE Transport\n"); @@ -792,7 +793,7 @@ setup: BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - CISS_COMMAND_SG_LENGTH, /* nsegments */ + CISS_MAX_SG_ELEMENTS, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ @@ -810,7 +811,7 @@ setup: BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, CISS_COMMAND_SG_LENGTH, /* maxsize, nsegments */ + MAXBSIZE, CISS_MAX_SG_ELEMENTS, /* maxsize, nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, &sc->ciss_mtx, /* lockfunc, lockarg */ @@ -823,32 +824,42 @@ setup: /************************************************************************ * Setup MSI/MSIX operation (Performant only) - * Four interrupts are available, but we only use 1 right now. + * Four interrupts are available, but we only use 1 right now. If MSI-X + * isn't avaialble, try using MSI instead. */ static int ciss_setup_msix(struct ciss_softc *sc) { - uint32_t id; int val, i; /* Weed out devices that don't actually support MSI */ - id = (pci_get_subvendor(sc->ciss_dev) << 16) | - pci_get_subdevice(sc->ciss_dev); - if ((id == 0x0e114070) || (id == 0x0e114080) || (id == 0x0e114082) || - (id == 0x0e114083)) + i = ciss_lookup(sc->ciss_dev); + if (ciss_vendor_data[i].flags & CISS_BOARD_NOMSI) return (EINVAL); + /* + * Only need to use the minimum number of MSI vectors, as the driver + * doesn't support directed MSIX interrupts. + */ val = pci_msix_count(sc->ciss_dev); - if (val < CISS_MSI_COUNT) - return (EINVAL); + if (val < CISS_MSI_COUNT) { + val = pci_msi_count(sc->ciss_dev); + device_printf(sc->ciss_dev, "got %d MSI messages]\n", val); + if (val < CISS_MSI_COUNT) + return (EINVAL); + } val = MIN(val, CISS_MSI_COUNT); - if (pci_alloc_msix(sc->ciss_dev, &val) != 0) - return (EINVAL); + if (pci_alloc_msix(sc->ciss_dev, &val) != 0) { + if (pci_alloc_msi(sc->ciss_dev, &val) != 0) + return (EINVAL); + } sc->ciss_msi = val; - ciss_printf(sc, "Using MSIX interrupt\n"); + if (bootverbose) + ciss_printf(sc, "Using %d MSIX interrupt%s\n", val, + (val != 1) ? "s" : ""); - for (i = 0; i < CISS_MSI_COUNT; i++) + for (i = 0; i < val; i++) sc->ciss_irq_rid[i] = i + 1; return (0); @@ -1031,7 +1042,7 @@ ciss_soft_reset(struct ciss_softc *sc) NULL, 0)) != 0) break; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = sc->ciss_controllers[i]; if ((error = ciss_synch_request(cr, 60 * 1000)) != 0) @@ -1104,6 +1115,9 @@ ciss_init_requests(struct ciss_softc *sc cr = &sc->ciss_request[i]; cr->cr_sc = sc; cr->cr_tag = i; + cr->cr_cc = (struct ciss_command *)((uintptr_t)sc->ciss_command + + CISS_COMMAND_ALLOC_SIZE * i); + cr->cr_ccphys = sc->ciss_command_phys + CISS_COMMAND_ALLOC_SIZE * i; bus_dmamap_create(sc->ciss_buffer_dmat, 0, &cr->cr_datamap); ciss_enqueue_free(cr); } @@ -1257,7 +1271,7 @@ ciss_report_luns(struct ciss_softc *sc, /* * Build the Report Logical/Physical LUNs command. */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_data = cll; cr->cr_length = report_size; cr->cr_flags = CISS_REQ_DATAIN; @@ -1582,7 +1596,7 @@ ciss_inquiry_logical(struct ciss_softc * if ((error = ciss_get_request(sc, &cr)) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_data = &ld->cl_geometry; cr->cr_length = sizeof(ld->cl_geometry); cr->cr_flags = CISS_REQ_DATAIN; @@ -1646,7 +1660,7 @@ ciss_identify_logical(struct ciss_softc (void **)&ld->cl_ldrive, sizeof(*ld->cl_ldrive))) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = *ld->cl_controller; /* target controller */ cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); @@ -1742,7 +1756,7 @@ ciss_get_ldrive_status(struct ciss_softc (void **)&ld->cl_lstatus, sizeof(*ld->cl_lstatus))) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = *ld->cl_controller; /* target controller */ cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); @@ -1832,7 +1846,7 @@ ciss_accept_media(struct ciss_softc *sc, if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_ACCEPT_MEDIA, NULL, 0)) != 0) goto out; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address = *ld->cl_controller; /* target controller */ cbc = (struct ciss_bmic_cdb *)&(cc->cdb.cdb[0]); cbc->log_drive = ldrive; @@ -2000,7 +2014,7 @@ ciss_start(struct ciss_request *cr) struct ciss_command *cc; /* XXX debugging only */ int error; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; debug(2, "post command %d tag %d ", cr->cr_tag, cc->header.host_tag); /* @@ -2056,7 +2070,7 @@ ciss_done(struct ciss_softc *sc, cr_qhea continue; } cr = &(sc->ciss_request[index]); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.host_tag = tag; /* not updated by adapter */ ciss_enqueue_complete(cr, qh); } @@ -2085,7 +2099,7 @@ ciss_perf_done(struct ciss_softc *sc, cr (tag & CISS_HDR_HOST_TAG_ERROR) ? " with error" : ""); if (index < sc->ciss_max_requests) { cr = &(sc->ciss_request[index]); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.host_tag = tag; /* not updated by adapter */ ciss_enqueue_complete(cr, qh); } else { @@ -2222,7 +2236,7 @@ _ciss_report_request(struct ciss_request debug_called(2); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ce = (struct ciss_error_info *)&(cc->sg[0]); /* @@ -2369,7 +2383,7 @@ ciss_abort_request(struct ciss_request * return(error); /* build the abort command */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.mode.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; /* addressing? */ cc->header.address.physical.target = 0; cc->header.address.physical.bus = 0; @@ -2438,12 +2452,12 @@ ciss_preen_command(struct ciss_request * * Note that we set up the error_info structure here, since the * length can be overwritten by any command. */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.sg_in_list = 0; /* kinda inefficient this way */ cc->header.sg_total = 0; cc->header.host_tag = cr->cr_tag << 2; cc->header.host_tag_zeroes = 0; - cmdphys = CISS_FIND_COMMANDPHYS(cr); + cmdphys = cr->cr_ccphys; cc->error_info.error_info_address = cmdphys + sizeof(struct ciss_command); cc->error_info.error_info_length = CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command); } @@ -2514,7 +2528,7 @@ ciss_get_bmic_request(struct ciss_softc if (!dataout) cr->cr_flags = CISS_REQ_DATAIN; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.physical.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; cc->header.address.physical.bus = 0; cc->header.address.physical.target = 0; @@ -2562,7 +2576,7 @@ ciss_user_command(struct ciss_softc *sc, */ while (ciss_get_request(sc, &cr) != 0) msleep(sc, &sc->ciss_mtx, PPAUSE, "cissREQ", hz); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; /* * Allocate an in-kernel databuffer if required, copy in user data. @@ -2667,7 +2681,7 @@ ciss_map_request(struct ciss_request *cr if (sc->ciss_perf) CISS_TL_PERF_POST_CMD(sc, cr); else - CISS_TL_SIMPLE_POST_CMD(sc, CISS_FIND_COMMANDPHYS(cr)); + CISS_TL_SIMPLE_POST_CMD(sc, cr->cr_ccphys); } return(0); @@ -2685,7 +2699,7 @@ ciss_request_map_helper(void *arg, bus_d cr = (struct ciss_request *)arg; sc = cr->cr_sc; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; for (i = 0; i < nseg; i++) { cc->sg[i].address = segs[i].ds_addr; @@ -2725,7 +2739,7 @@ ciss_request_map_helper(void *arg, bus_d if (sc->ciss_perf) CISS_TL_PERF_POST_CMD(sc, cr); else - CISS_TL_SIMPLE_POST_CMD(sc, CISS_FIND_COMMANDPHYS(cr)); + CISS_TL_SIMPLE_POST_CMD(sc, cr->cr_ccphys); } /************************************************************************ @@ -3091,7 +3105,7 @@ ciss_cam_action_io(struct cam_sim *sim, /* * Build the command. */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_data = csio->data_ptr; cr->cr_length = csio->dxfer_len; cr->cr_complete = ciss_cam_complete; @@ -3235,7 +3249,7 @@ ciss_cam_complete(struct ciss_request *c debug_called(2); sc = cr->cr_sc; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ce = (struct ciss_error_info *)&(cc->sg[0]); csio = (struct ccb_scsiio *)cr->cr_private; @@ -3414,7 +3428,7 @@ ciss_periodic(void *arg) * Send the NOP message and wait for a response. */ if (ciss_nop_message_heartbeat != 0 && (error = ciss_get_request(sc, &cr)) == 0) { - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cr->cr_complete = ciss_nop_complete; cc->cdb.cdb_length = 1; cc->cdb.type = CISS_CDB_TYPE_MESSAGE; @@ -3484,7 +3498,7 @@ ciss_disable_adapter(struct ciss_softc * if ((cr->cr_flags & CISS_REQ_BUSY) == 0) continue; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ce = (struct ciss_error_info *)&(cc->sg[0]); ce->command_status = CISS_CMD_STATUS_HARDWARE_ERROR; ciss_enqueue_complete(cr, &qh); @@ -3561,7 +3575,7 @@ ciss_notify_event(struct ciss_softc *sc) ciss_preen_command(cr); /* (re)build the notify event command */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.physical.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; cc->header.address.physical.bus = 0; cc->header.address.physical.target = 0; @@ -3615,7 +3629,7 @@ ciss_notify_complete(struct ciss_request int command_status; debug_called(1); - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cn = (struct ciss_notify *)cr->cr_data; sc = cr->cr_sc; @@ -3715,7 +3729,7 @@ ciss_notify_abort(struct ciss_softc *sc) cr->cr_length = CISS_NOTIFY_DATA_SIZE; /* build the CDB */ - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; cc->header.address.physical.mode = CISS_HDR_ADDRESS_MODE_PERIPHERAL; cc->header.address.physical.bus = 0; cc->header.address.physical.target = 0; @@ -4174,7 +4188,7 @@ ciss_print_request(struct ciss_request * int i; sc = cr->cr_sc; - cc = CISS_FIND_COMMAND(cr); + cc = cr->cr_cc; ciss_printf(sc, "REQUEST @ %p\n", cr); ciss_printf(sc, " data %p/%d tag %d flags %b\n", Modified: stable/8/sys/dev/ciss/cissreg.h ============================================================================== --- stable/8/sys/dev/ciss/cissreg.h Thu Sep 17 05:27:32 2009 (r197264) +++ stable/8/sys/dev/ciss/cissreg.h Thu Sep 17 05:30:55 2009 (r197265) @@ -731,7 +731,7 @@ struct ciss_bmic_flush_cache { #define CISS_TL_PERF_INTR_OPQ (CISS_TL_SIMPLE_INTR_OPQ_SA5 | CISS_TL_SIMPLE_INTR_OPQ_SA5B) #define CISS_TL_PERF_INTR_MSI 0x01 -#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IPQ, CISS_FIND_COMMANDPHYS(cr) | (cr)->cr_sg_tag) +#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IPQ, cr->cr_ccphys | (cr)->cr_sg_tag) #define CISS_TL_PERF_FLUSH_INT(sc) CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_OSR) #define CISS_TL_PERF_CLEAR_INT(sc) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_ODC, CISS_TL_SIMPLE_ODC_CLEAR) #define CISS_CYCLE_MASK 0x00000001 @@ -747,4 +747,5 @@ struct ciss_bmic_flush_cache { CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_IMR) & ~(sc)->ciss_interrupt_mask) + #endif /* _KERNEL */ Modified: stable/8/sys/dev/ciss/cissvar.h ============================================================================== --- stable/8/sys/dev/ciss/cissvar.h Thu Sep 17 05:27:32 2009 (r197264) +++ stable/8/sys/dev/ciss/cissvar.h Thu Sep 17 05:30:55 2009 (r197265) @@ -103,6 +103,8 @@ struct ciss_request void *cr_data; /* data buffer */ u_int32_t cr_length; /* data length */ bus_dmamap_t cr_datamap; /* DMA map for data */ + struct ciss_command *cr_cc; + uint32_t cr_ccphys; int cr_tag; int cr_flags; #define CISS_REQ_MAPPED (1<<0) /* data mapped */ @@ -131,18 +133,16 @@ struct ciss_request * scatter-gather list, and we also want to avoid having commands * cross page boundaries. * - * Note that 512 bytes yields 28 scatter/gather entries, or the - * ability to map (26 * PAGE_SIZE) + 2 bytes of data. On x86, this is - * 104kB. 256 bytes would only yield 12 entries, giving a mere 40kB, - * too small. + * The size of the ciss_command is 52 bytes. 65 s/g elements are reserved + * to allow a max i/o size of 256k. This gives a total command size of + * 1120 bytes, including the 32 byte alignment padding. Modern controllers + * seem to saturate nicely at this value. */ -#define CISS_COMMAND_ALLOC_SIZE 512 /* XXX tune to get sensible s/g list length */ -#define CISS_COMMAND_SG_LENGTH ((CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command)) \ - / sizeof(struct ciss_sg_entry)) - -/* XXX Prep for increasing max i/o */ -#define CISS_MAX_SG_ELEMENTS 17 +#define CISS_MAX_SG_ELEMENTS 65 +#define CISS_COMMAND_ALIGN 32 +#define CISS_COMMAND_SG_LENGTH (sizeof(struct ciss_sg_entry) * CISS_MAX_SG_ELEMENTS) +#define CISS_COMMAND_ALLOC_SIZE (roundup2(sizeof(struct ciss_command) + CISS_COMMAND_SG_LENGTH, CISS_COMMAND_ALIGN)) /* * Per-logical-drive data. @@ -259,20 +259,6 @@ struct ciss_softc struct ciss_qstat ciss_qstat[CISSQ_COUNT]; /* queue statistics */ }; -/* - * Given a request tag, find the corresponding command in virtual or - * physical space. - * - * The arithmetic here is due to the allocation of ciss_command structures - * inside CISS_COMMAND_ALLOC_SIZE blocks. See the comment at the definition - * of CISS_COMMAND_ALLOC_SIZE above. - */ -#define CISS_FIND_COMMAND(cr) \ - (struct ciss_command *)((u_int8_t *)(cr)->cr_sc->ciss_command + \ - ((cr)->cr_tag * CISS_COMMAND_ALLOC_SIZE)) -#define CISS_FIND_COMMANDPHYS(cr) ((cr)->cr_sc->ciss_command_phys + \ - ((cr)->cr_tag * CISS_COMMAND_ALLOC_SIZE)) - /************************************************************************ * Debugging/diagnostic output. */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 06:21:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAD04106566B; Thu, 17 Sep 2009 06:21:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BBDA68FC14; Thu, 17 Sep 2009 06:21:06 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5668546B0C; Thu, 17 Sep 2009 02:21:06 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id EC18D8A01F; Thu, 17 Sep 2009 02:21:04 -0400 (EDT) Message-ID: <4AB1D552.50400@FreeBSD.org> Date: Thu, 17 Sep 2009 02:21:06 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Stacey Son References: <200909160330.n8G3UCLR010920@svn.freebsd.org> In-Reply-To: <200909160330.n8G3UCLR010920@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 17 Sep 2009 02:21:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197241 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 06:21:07 -0000 Stacey Son wrote: > Author: sson > Date: Wed Sep 16 03:30:12 2009 > New Revision: 197241 > URL: http://svn.freebsd.org/changeset/base/197241 > > Log: > Add EVFILT_USER to kevents. > > Add user events support to kernel events which are not associated with any > kernel mechanism but are triggered by user level code. This is useful for > adding user level events to an event handler that may also be monitoring > kernel events. > > Approved by: rwatson (co-mentor) Very nice! I actually had an item on my personal todo list to implement this feature. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 06:32:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E65B106566C; Thu, 17 Sep 2009 06:32:00 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 122408FC1D; Thu, 17 Sep 2009 06:32:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8H6Vxag047303; Thu, 17 Sep 2009 06:31:59 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8H6VxVg047300; Thu, 17 Sep 2009 06:31:59 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200909170631.n8H6VxVg047300@svn.freebsd.org> From: Tim Kientzle Date: Thu, 17 Sep 2009 06:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197266 - in stable/8/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 06:32:00 -0000 Author: kientzle Date: Thu Sep 17 06:31:59 2009 New Revision: 197266 URL: http://svn.freebsd.org/changeset/base/197266 Log: MFC r196962: Fix /usr/bin/unzip: A bug deep in libarchive's read-ahead logic (incorrect handling of zero-length reads before the copy buffer is allocated) is masked by the iso9660 taster. Tar and cpio both enable that taster so were protected from the bug; unzip is susceptible. This both fixes the bug and updates the test harness to exercise this case. Submitted by: Ed Schouten diagnosed the bug and drafted a patch Approved by: re (kib) Modified: stable/8/lib/libarchive/ (props changed) stable/8/lib/libarchive/archive_read.c stable/8/lib/libarchive/test/test_compat_zip.c Modified: stable/8/lib/libarchive/archive_read.c ============================================================================== --- stable/8/lib/libarchive/archive_read.c Thu Sep 17 05:30:55 2009 (r197265) +++ stable/8/lib/libarchive/archive_read.c Thu Sep 17 06:31:59 2009 (r197266) @@ -928,9 +928,12 @@ __archive_read_filter_ahead(struct archi for (;;) { /* - * If we can satisfy from the copy buffer, we're done. + * If we can satisfy from the copy buffer (and the + * copy buffer isn't empty), we're done. In particular, + * note that min == 0 is a perfectly well-defined + * request. */ - if (filter->avail >= min) { + if (filter->avail >= min && filter->avail > 0) { if (avail != NULL) *avail = filter->avail; return (filter->next); Modified: stable/8/lib/libarchive/test/test_compat_zip.c ============================================================================== --- stable/8/lib/libarchive/test/test_compat_zip.c Thu Sep 17 05:30:55 2009 (r197265) +++ stable/8/lib/libarchive/test/test_compat_zip.c Thu Sep 17 06:31:59 2009 (r197266) @@ -36,7 +36,7 @@ test_compat_zip_1(void) assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); extract_reference_file(name); assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240)); From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 11:03:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9DB4106566C; Thu, 17 Sep 2009 11:03:37 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D77DB8FC12; Thu, 17 Sep 2009 11:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HB3bRg054762; Thu, 17 Sep 2009 11:03:37 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HB3br6054760; Thu, 17 Sep 2009 11:03:37 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200909171103.n8HB3br6054760@svn.freebsd.org> From: Marko Zec Date: Thu, 17 Sep 2009 11:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197267 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris compat/linux contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 11:03:38 -0000 Author: zec Date: Thu Sep 17 11:03:37 2009 New Revision: 197267 URL: http://svn.freebsd.org/changeset/base/197267 Log: MFC r197176: Lock the ifnet list while iterating over it. Submitted by: julian MFC after: 3 days Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/linux/linux_ioctl.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Thu Sep 17 06:31:59 2009 (r197266) +++ stable/8/sys/compat/linux/linux_ioctl.c Thu Sep 17 11:03:37 2009 (r197267) @@ -2152,6 +2152,7 @@ linux_ifconf(struct thread *td, struct i /* handle the 'request buffer size' case */ if (ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; + IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2159,6 +2160,7 @@ linux_ifconf(struct thread *td, struct i ifc.ifc_len += sizeof(ifr); } } + IFNET_RUNLOCK(); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 12:35:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D52110656C4; Thu, 17 Sep 2009 12:35:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2958FC20; Thu, 17 Sep 2009 12:35:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HCZEOF056698; Thu, 17 Sep 2009 12:35:14 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HCZEdd056697; Thu, 17 Sep 2009 12:35:14 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200909171235.n8HCZEdd056697@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Sep 2009 12:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197269 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 12:35:14 -0000 Author: brooks Date: Thu Sep 17 12:35:13 2009 New Revision: 197269 URL: http://svn.freebsd.org/changeset/base/197269 Log: Allocate space for the group array in a static credential used in the quota code. One case was correctly handled in r194498, but this one was missed. PR: kern/138657 Tested by: PR submitter MFC after: 3 days Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Thu Sep 17 12:27:06 2009 (r197268) +++ head/sys/ufs/ufs/ufs_vnops.c Thu Sep 17 12:35:13 2009 (r197269) @@ -1449,6 +1449,7 @@ ufs_mkdir(ap) { #ifdef QUOTA struct ucred ucred, *ucp; + gid_t ucred_group; ucp = cnp->cn_cred; #endif /* @@ -1476,6 +1477,7 @@ ufs_mkdir(ap) refcount_init(&ucred.cr_ref, 1); ucred.cr_uid = ip->i_uid; ucred.cr_ngroups = 1; + ucred.cr_groups = &ucred_group; ucred.cr_groups[0] = dp->i_gid; ucp = &ucred; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 12:41:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5CCA10656F3; Thu, 17 Sep 2009 12:41:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 883398FC27; Thu, 17 Sep 2009 12:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HCfR56056870; Thu, 17 Sep 2009 12:41:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HCfRFC056867; Thu, 17 Sep 2009 12:41:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909171241.n8HCfRFC056867@svn.freebsd.org> From: Andriy Gapon Date: Thu, 17 Sep 2009 12:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197270 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/pci dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 12:41:27 -0000 Author: avg Date: Thu Sep 17 12:41:27 2009 New Revision: 197270 URL: http://svn.freebsd.org/changeset/base/197270 Log: MFC r197077: pci: remove definitions of duplicate constants Suggested by: jhb Reviewed by: jhb Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/pci/pcireg.h stable/8/sys/dev/pci/pcivar.h stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Thu Sep 17 12:35:13 2009 (r197269) +++ stable/8/sys/dev/pci/pcireg.h Thu Sep 17 12:41:27 2009 (r197270) @@ -39,11 +39,11 @@ */ /* some PCI bus constants */ - -#define PCI_BUSMAX 255 -#define PCI_SLOTMAX 31 -#define PCI_FUNCMAX 7 -#define PCI_REGMAX 255 +#define PCI_DOMAINMAX 65535 /* highest supported domain number */ +#define PCI_BUSMAX 255 /* highest supported bus number */ +#define PCI_SLOTMAX 31 /* highest supported slot number */ +#define PCI_FUNCMAX 7 /* highest supported function number */ +#define PCI_REGMAX 255 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 /* PCI config header registers for all devices */ Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Thu Sep 17 12:35:13 2009 (r197269) +++ stable/8/sys/dev/pci/pcivar.h Thu Sep 17 12:41:27 2009 (r197270) @@ -33,13 +33,6 @@ #include /* some PCI bus constants */ - -#define PCI_DOMAINMAX 65535 /* highest supported domain number */ -#define PCI_BUSMAX 255 /* highest supported bus number */ -#define PCI_SLOTMAX 31 /* highest supported slot number */ -#define PCI_FUNCMAX 7 /* highest supported function number */ -#define PCI_REGMAX 255 /* highest supported config register addr. */ - #define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ #define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */ #define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 12:44:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70E20106566C; Thu, 17 Sep 2009 12:44:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 453068FC1F; Thu, 17 Sep 2009 12:44:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HCixGv056994; Thu, 17 Sep 2009 12:44:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HCix5Y056991; Thu, 17 Sep 2009 12:44:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909171244.n8HCix5Y056991@svn.freebsd.org> From: Andriy Gapon Date: Thu, 17 Sep 2009 12:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197271 - in stable/7/sys: . contrib/pf dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 12:44:59 -0000 Author: avg Date: Thu Sep 17 12:44:58 2009 New Revision: 197271 URL: http://svn.freebsd.org/changeset/base/197271 Log: MFC r197077: pci: remove definitions of duplicate constants Suggested by: jhb Reviewed by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pcireg.h stable/7/sys/dev/pci/pcivar.h Modified: stable/7/sys/dev/pci/pcireg.h ============================================================================== --- stable/7/sys/dev/pci/pcireg.h Thu Sep 17 12:41:27 2009 (r197270) +++ stable/7/sys/dev/pci/pcireg.h Thu Sep 17 12:44:58 2009 (r197271) @@ -39,11 +39,11 @@ */ /* some PCI bus constants */ - -#define PCI_BUSMAX 255 -#define PCI_SLOTMAX 31 -#define PCI_FUNCMAX 7 -#define PCI_REGMAX 255 +#define PCI_DOMAINMAX 65535 /* highest supported domain number */ +#define PCI_BUSMAX 255 /* highest supported bus number */ +#define PCI_SLOTMAX 31 /* highest supported slot number */ +#define PCI_FUNCMAX 7 /* highest supported function number */ +#define PCI_REGMAX 255 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 /* PCI config header registers for all devices */ Modified: stable/7/sys/dev/pci/pcivar.h ============================================================================== --- stable/7/sys/dev/pci/pcivar.h Thu Sep 17 12:41:27 2009 (r197270) +++ stable/7/sys/dev/pci/pcivar.h Thu Sep 17 12:44:58 2009 (r197271) @@ -33,13 +33,6 @@ #include /* some PCI bus constants */ - -#define PCI_DOMAINMAX 65535 /* highest supported domain number */ -#define PCI_BUSMAX 255 /* highest supported bus number */ -#define PCI_SLOTMAX 31 /* highest supported slot number */ -#define PCI_FUNCMAX 7 /* highest supported function number */ -#define PCI_REGMAX 255 /* highest supported config register addr. */ - #define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ #define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */ #define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 13:04:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8246C106568F; Thu, 17 Sep 2009 13:04:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7025B8FC20; Thu, 17 Sep 2009 13:04:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HD4kpf057671; Thu, 17 Sep 2009 13:04:46 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HD4kAt057669; Thu, 17 Sep 2009 13:04:46 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200909171304.n8HD4kAt057669@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Sep 2009 13:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197274 - head/sbin/geom/class/nop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 13:04:46 -0000 Author: brueffer Date: Thu Sep 17 13:04:46 2009 New Revision: 197274 URL: http://svn.freebsd.org/changeset/base/197274 Log: Fix the example, -w is the right switch for write failure probability. PR: 136219 Submitted by: Kouki Hashimoto Patch by: gavin MFC after: 3 days Modified: head/sbin/geom/class/nop/gnop.8 Modified: head/sbin/geom/class/nop/gnop.8 ============================================================================== --- head/sbin/geom/class/nop/gnop.8 Thu Sep 17 13:03:44 2009 (r197273) +++ head/sbin/geom/class/nop/gnop.8 Thu Sep 17 13:04:46 2009 (r197274) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2006 +.Dd September 17, 2009 .Dt GNOP 8 .Os .Sh NAME @@ -147,9 +147,9 @@ Exit status is 0 on success, and 1 if th .Sh EXAMPLES The following example shows how to create a transparent provider for disk .Pa /dev/da0 -with 50% failure probability, and how to destroy it. +with 50% write failure probability, and how to destroy it. .Bd -literal -offset indent -gnop create -v -f 50 da0 +gnop create -v -w 50 da0 gnop destroy -v da0.nop .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 13:09:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9106C106566C; Thu, 17 Sep 2009 13:09:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ECC38FC16; Thu, 17 Sep 2009 13:09:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HD98qf057802; Thu, 17 Sep 2009 13:09:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HD98as057800; Thu, 17 Sep 2009 13:09:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200909171309.n8HD98as057800@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Sep 2009 13:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197275 - head/sbin/mksnap_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 13:09:08 -0000 Author: brueffer Date: Thu Sep 17 13:09:08 2009 New Revision: 197275 URL: http://svn.freebsd.org/changeset/base/197275 Log: Fix an xref. PR: 138833 Submitted by: Alex Keda MFC after: 3 days Modified: head/sbin/mksnap_ffs/mksnap_ffs.8 Modified: head/sbin/mksnap_ffs/mksnap_ffs.8 ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.8 Thu Sep 17 13:04:46 2009 (r197274) +++ head/sbin/mksnap_ffs/mksnap_ffs.8 Thu Sep 17 13:09:08 2009 (r197275) @@ -69,7 +69,7 @@ mount -o ro /dev/md0 /mnt/ .Sh SEE ALSO .Xr chmod 2 , .Xr chown 8 , -.Xr mdconfig 8, +.Xr mdconfig 8 , .Xr mount 8 .Sh CAVEATS The disk full situation is not handled gracefully and may From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 13:12:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6272410656B7; Thu, 17 Sep 2009 13:12:24 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C0E8FC36; Thu, 17 Sep 2009 13:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HDCOWa057918; Thu, 17 Sep 2009 13:12:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HDCONr057916; Thu, 17 Sep 2009 13:12:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200909171312.n8HDCONr057916@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Sep 2009 13:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197276 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 13:12:24 -0000 Author: brueffer Date: Thu Sep 17 13:12:24 2009 New Revision: 197276 URL: http://svn.freebsd.org/changeset/base/197276 Log: Correct a sysctl name. PR: 137689 Submitted by: Thomas Mueller MFC after: 3 days Modified: head/share/man/man4/acpi_panasonic.4 Modified: head/share/man/man4/acpi_panasonic.4 ============================================================================== --- head/share/man/man4/acpi_panasonic.4 Thu Sep 17 13:09:08 2009 (r197275) +++ head/share/man/man4/acpi_panasonic.4 Thu Sep 17 13:12:24 2009 (r197276) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2004 +.Dd September 17, 2009 .Dt ACPI_PANASONIC 4 i386 .Os .Sh NAME @@ -144,7 +144,7 @@ The following MIBs are available: The maximum level of brightness. The value is read only and automatically set according to hardware model. -.It Va hw.acpi.panasonic.lcd_brightness_max +.It Va hw.acpi.panasonic.lcd_brightness_min The minimum level of brightness. The value is read only and automatically set according to hardware model. From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 13:21:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A7F1065679; Thu, 17 Sep 2009 13:21:54 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06FDC8FC13; Thu, 17 Sep 2009 13:21:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HDLrD0058176; Thu, 17 Sep 2009 13:21:53 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HDLr8d058174; Thu, 17 Sep 2009 13:21:53 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200909171321.n8HDLr8d058174@svn.freebsd.org> From: Alexander Kabaev Date: Thu, 17 Sep 2009 13:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197277 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 13:21:54 -0000 Author: kan Date: Thu Sep 17 13:21:53 2009 New Revision: 197277 URL: http://svn.freebsd.org/changeset/base/197277 Log: Make libc.a provide __stack_chk_fail_local weak alias. This is needed to satisfy static libraries that are compiled with -fpic and linked into static binary afterwards. Several libraries in gcc are examples of such static libs. Modified: head/lib/libc/sys/stack_protector.c Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Thu Sep 17 13:12:24 2009 (r197276) +++ head/lib/libc/sys/stack_protector.c Thu Sep 17 13:21:53 2009 (r197277) @@ -108,4 +108,8 @@ __chk_fail(void) __fail("buffer overflow detected; terminated"); } +#ifdef PIC __sym_compat(__stack_chk_fail_local, __stack_chk_fail, FBSD_1.0); +#else +__weak_reference(__stack_chk_fail, __stack_chk_fail_local); +#endif From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 13:42:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B21F1065696; Thu, 17 Sep 2009 13:42:00 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 163F48FC13; Thu, 17 Sep 2009 13:42:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HDfxCn058752; Thu, 17 Sep 2009 13:41:59 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HDfxSK058750; Thu, 17 Sep 2009 13:41:59 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200909171341.n8HDfxSK058750@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 17 Sep 2009 13:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197280 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 13:42:00 -0000 Author: bms Date: Thu Sep 17 13:41:59 2009 New Revision: 197280 URL: http://svn.freebsd.org/changeset/base/197280 Log: MFC revs 197129,197130,197132: Fixes to mcast userland API. -- Fix an API issue in leave processing for IPv4 multicast groups. * Do not assume that the group lookup performed by imo_match_group() is valid when ifp is NULL in this case. * Instead, return EADDRNOTAVAIL if the ifp cannot be resolved for the membership we are being asked to leave. Caveat user: * The way IPv4 multicast memberships are implemented in the inpcb layer at the moment, has the side-effect that struct ip_moptions will still hold the membership, under the old ifp, until ip_freemoptions() is called for the parent inpcb. * The underlying issue is: the inpcb layer does not get notification of ifp being detached going away in a thread-safe manner. This is non-trivial to fix. -- Fix an obvious logic error in the IPv4 multicast leave processing, where the filter mode vector was not updated correctly after the leave. -- Tighten input checking in inp_join_group(): * Don't try to use the source address, when its family is unspecified. * If we get a join without a source, on an existing inclusive mode group, this is an error, as it would change the filter mode. Fix a problem with the handling of in_mfilter for new memberships: * Do not rely on imf being NULL; it is explicitly initialized to a non-NULL pointer when constructing a membership. * Explicitly initialize *imf to EX mode when the source address is unspecified. This fixes a problem with in_mfilter slot recycling in the join path. -- Don't allow joins w/o source on an existing group. This is almost always pilot error. We don't need to check for group filter UNDEFINED state at t1, because we only ever allocate filters with their groups, so we unconditionally reject such calls with EINVAL. Trying to change the active filter mode w/o going through IP_MSFILTER is also disallowed. Deals with the case described in PR 137164 upfront, cumulative with the fix in svn rev 197132 which only calls imo_match_source() if the source address family was not unspecified. -- Revision 197136 has a text conflict, however it is a comment only change. PR: 137164, 138689, 138690, 138691 Submitted by: Stef Walter (with fixups) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/in_mcast.c Modified: stable/8/sys/netinet/in_mcast.c ============================================================================== --- stable/8/sys/netinet/in_mcast.c Thu Sep 17 13:33:40 2009 (r197279) +++ stable/8/sys/netinet/in_mcast.c Thu Sep 17 13:41:59 2009 (r197280) @@ -1957,11 +1957,6 @@ inp_join_group(struct inpcb *inp, struct if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) return (EADDRNOTAVAIL); - /* - * MCAST_JOIN_SOURCE on an exclusive membership is an error. - * On an existing inclusive membership, it just adds the - * source to the filter list. - */ imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -1969,15 +1964,33 @@ inp_join_group(struct inpcb *inp, struct } else { inm = imo->imo_membership[idx]; imf = &imo->imo_mfilters[idx]; - if (ssa->ss.ss_family != AF_UNSPEC && - imf->imf_st[1] != MCAST_INCLUDE) { - error = EINVAL; - goto out_inp_locked; - } - lims = imo_match_source(imo, idx, &ssa->sa); - if (lims != NULL) { - error = EADDRNOTAVAIL; - goto out_inp_locked; + if (ssa->ss.ss_family != AF_UNSPEC) { + /* + * MCAST_JOIN_SOURCE on an exclusive membership + * is an error. On an existing inclusive membership, + * it just adds the source to the filter list. + */ + if (imf->imf_st[1] != MCAST_INCLUDE) { + error = EINVAL; + goto out_inp_locked; + } + /* Throw out duplicates. */ + lims = imo_match_source(imo, idx, &ssa->sa); + if (lims != NULL) { + error = EADDRNOTAVAIL; + goto out_inp_locked; + } + } else { + /* + * MCAST_JOIN_GROUP on an existing inclusive + * membership is an error; if you want to change + * filter mode, you must use the userland API + * setsourcefilter(). + */ + if (imf->imf_st[1] == MCAST_INCLUDE) { + error = EINVAL; + goto out_inp_locked; + } } } @@ -2010,7 +2023,8 @@ inp_join_group(struct inpcb *inp, struct /* * Graft new source into filter list for this inpcb's * membership of the group. The in_multi may not have - * been allocated yet if this is a new membership. + * been allocated yet if this is a new membership, however, + * the in_mfilter slot will be allocated and must be initialized. */ if (ssa->ss.ss_family != AF_UNSPEC) { /* Membership starts in IN mode */ @@ -2027,6 +2041,12 @@ inp_join_group(struct inpcb *inp, struct error = ENOMEM; goto out_imo_free; } + } else { + /* No address specified; Membership starts in EX mode */ + if (is_new) { + CTR1(KTR_IGMPV3, "%s: new join w/o source", __func__); + imf_init(imf, MCAST_UNDEFINED, MCAST_EXCLUDE); + } } /* @@ -2189,6 +2209,9 @@ inp_leave_group(struct inpcb *inp, struc if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + if (ifp == NULL) + return (EADDRNOTAVAIL); + /* * Find the membership in the membership array. */ @@ -2275,9 +2298,11 @@ out_imf_rollback: imf_reap(imf); if (is_final) { - /* Remove the gap in the membership array. */ - for (++idx; idx < imo->imo_num_memberships; ++idx) + /* Remove the gap in the membership and filter array. */ + for (++idx; idx < imo->imo_num_memberships; ++idx) { imo->imo_membership[idx-1] = imo->imo_membership[idx]; + imo->imo_mfilters[idx-1] = imo->imo_mfilters[idx]; + } imo->imo_num_memberships--; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 14:05:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF9D106566B; Thu, 17 Sep 2009 14:05:06 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D85218FC14; Thu, 17 Sep 2009 14:05:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HE56Bl059471; Thu, 17 Sep 2009 14:05:06 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HE56c1059469; Thu, 17 Sep 2009 14:05:06 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200909171405.n8HE56c1059469@svn.freebsd.org> From: Ken Smith Date: Thu, 17 Sep 2009 14:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197281 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:05:07 -0000 Author: kensmith Date: Thu Sep 17 14:05:06 2009 New Revision: 197281 URL: http://svn.freebsd.org/changeset/base/197281 Log: Get ready for 8.0-RC1 builds. Approved by: re (implicit) Modified: stable/8/sys/conf/newvers.sh Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Thu Sep 17 13:41:59 2009 (r197280) +++ stable/8/sys/conf/newvers.sh Thu Sep 17 14:05:06 2009 (r197281) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.0" -BRANCH="BETA4" +BRANCH="RC1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 14:12:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B07106568F; Thu, 17 Sep 2009 14:12:22 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4508FC16; Thu, 17 Sep 2009 14:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HECLTo059695; Thu, 17 Sep 2009 14:12:21 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HECLSl059693; Thu, 17 Sep 2009 14:12:21 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909171412.n8HECLSl059693@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 17 Sep 2009 14:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197282 - in stable/8/sys: . amd64/include/xen boot/pc98 cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:12:22 -0000 Author: nyan Date: Thu Sep 17 14:12:21 2009 New Revision: 197282 URL: http://svn.freebsd.org/changeset/base/197282 Log: MFC: r197156 MFi386: Move the loader's entry point to 0x200000. This change is also needed for pc98. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/pc98/Makefile.inc stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/8/sys/boot/pc98/Makefile.inc Thu Sep 17 14:05:06 2009 (r197281) +++ stable/8/sys/boot/pc98/Makefile.inc Thu Sep 17 14:12:21 2009 (r197282) @@ -4,7 +4,7 @@ BINDIR?= /boot -LOADER_ADDRESS?=0x100000 +LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -Os From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 14:23:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DDF21065670; Thu, 17 Sep 2009 14:23:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACB48FC1B; Thu, 17 Sep 2009 14:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HENpbv060086; Thu, 17 Sep 2009 14:23:51 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HENpJt060084; Thu, 17 Sep 2009 14:23:51 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909171423.n8HENpJt060084@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 17 Sep 2009 14:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197283 - in stable/7/sys: . boot/pc98 contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:23:51 -0000 Author: nyan Date: Thu Sep 17 14:23:51 2009 New Revision: 197283 URL: http://svn.freebsd.org/changeset/base/197283 Log: MFC: r197156 MFi386: Move the loader's entry point to 0x200000. This change is also needed for pc98. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/pc98/Makefile.inc stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/7/sys/boot/pc98/Makefile.inc Thu Sep 17 14:12:21 2009 (r197282) +++ stable/7/sys/boot/pc98/Makefile.inc Thu Sep 17 14:23:51 2009 (r197283) @@ -4,7 +4,7 @@ BINDIR?= /boot -LOADER_ADDRESS?=0x100000 +LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -Os From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 14:30:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E91581065670; Thu, 17 Sep 2009 14:30:14 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5C2E8FC14; Thu, 17 Sep 2009 14:30:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HEUE4s060340; Thu, 17 Sep 2009 14:30:14 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HEUE9Z060338; Thu, 17 Sep 2009 14:30:14 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909171430.n8HEUE9Z060338@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 17 Sep 2009 14:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197284 - in stable/6/sys: . boot/pc98 conf contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:30:15 -0000 Author: nyan Date: Thu Sep 17 14:30:14 2009 New Revision: 197284 URL: http://svn.freebsd.org/changeset/base/197284 Log: MFC: r197156 MFi386: Move the loader's entry point to 0x200000. This change is also needed for pc98. Modified: stable/6/sys/ (props changed) stable/6/sys/boot/pc98/Makefile.inc stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/6/sys/boot/pc98/Makefile.inc Thu Sep 17 14:23:51 2009 (r197283) +++ stable/6/sys/boot/pc98/Makefile.inc Thu Sep 17 14:30:14 2009 (r197284) @@ -4,7 +4,7 @@ BINDIR?= /boot -LOADER_ADDRESS?=0x100000 +LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -Os From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 14:52:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CF5106566B; Thu, 17 Sep 2009 14:52:16 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFD258FC1C; Thu, 17 Sep 2009 14:52:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HEqFw1061013; Thu, 17 Sep 2009 14:52:15 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HEqFfs061011; Thu, 17 Sep 2009 14:52:15 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200909171452.n8HEqFfs061011@svn.freebsd.org> From: Marko Zec Date: Thu, 17 Sep 2009 14:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197286 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:52:16 -0000 Author: zec Date: Thu Sep 17 14:52:15 2009 New Revision: 197286 URL: http://svn.freebsd.org/changeset/base/197286 Log: V_irtualize the lltables list, making ARP and ND reasonably usable again with options VIMAGE kernels. Submitted by: bz (the original version, probably identical to this one) Reviewed by: many @ DevSummit Cambridge MFC after: 3 days Modified: head/sys/net/if_llatbl.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Thu Sep 17 14:40:57 2009 (r197285) +++ head/sys/net/if_llatbl.c Thu Sep 17 14:52:15 2009 (r197286) @@ -57,11 +57,14 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables"); -static SLIST_HEAD(, lltable) lltables = SLIST_HEAD_INITIALIZER(lltables); +static VNET_DEFINE(SLIST_HEAD(, lltable), lltables); +#define V_lltables VNET(lltables) extern void arprequest(struct ifnet *, struct in_addr *, struct in_addr *, u_char *); +static void vnet_lltable_init(void); + struct rwlock lltable_rwlock; RW_SYSINIT(lltable_rwlock, &lltable_rwlock, "lltable_rwlock"); @@ -75,7 +78,7 @@ lltable_sysctl_dumparp(int af, struct sy int error = 0; LLTABLE_RLOCK(); - SLIST_FOREACH(llt, &lltables, llt_link) { + SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af == af) { error = llt->llt_dump(llt, wr); if (error != 0) @@ -157,7 +160,7 @@ lltable_free(struct lltable *llt) KASSERT(llt != NULL, ("%s: llt is NULL", __func__)); LLTABLE_WLOCK(); - SLIST_REMOVE(&lltables, llt, lltable, llt_link); + SLIST_REMOVE(&V_lltables, llt, lltable, llt_link); LLTABLE_WUNLOCK(); for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { @@ -180,7 +183,7 @@ lltable_drain(int af) register int i; LLTABLE_RLOCK(); - SLIST_FOREACH(llt, &lltables, llt_link) { + SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af != af) continue; @@ -202,7 +205,7 @@ lltable_prefix_free(int af, struct socka struct lltable *llt; LLTABLE_RLOCK(); - SLIST_FOREACH(llt, &lltables, llt_link) { + SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af != af) continue; @@ -232,7 +235,7 @@ lltable_init(struct ifnet *ifp, int af) LIST_INIT(&llt->lle_head[i]); LLTABLE_WLOCK(); - SLIST_INSERT_HEAD(&lltables, llt, llt_link); + SLIST_INSERT_HEAD(&V_lltables, llt, llt_link); LLTABLE_WUNLOCK(); return (llt); @@ -302,7 +305,7 @@ lla_rt_output(struct rt_msghdr *rtm, str /* XXX linked list may be too expensive */ LLTABLE_RLOCK(); - SLIST_FOREACH(llt, &lltables, llt_link) { + SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af == dst->sa_family && llt->llt_ifp == ifp) break; @@ -367,3 +370,12 @@ lla_rt_output(struct rt_msghdr *rtm, str return (error); } + +static void +vnet_lltable_init() +{ + + SLIST_INIT(&V_lltables); +} +VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, vnet_lltable_init, NULL); + From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 14:58:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1641E10656DD; Thu, 17 Sep 2009 14:58:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 040B28FC08; Thu, 17 Sep 2009 14:58:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HEwLeN061192; Thu, 17 Sep 2009 14:58:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HEwLYx061190; Thu, 17 Sep 2009 14:58:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909171458.n8HEwLYx061190@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 17 Sep 2009 14:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197287 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:58:22 -0000 Author: pjd Date: Thu Sep 17 14:58:21 2009 New Revision: 197287 URL: http://svn.freebsd.org/changeset/base/197287 Log: Purge namecache for the file system being rolled back, so it doesn't point at invalid vnodes after the rollback resulting in EIO errors when trying to access files which are in the namecache. Reported by: des MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 17 14:52:15 2009 (r197286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 17 14:58:21 2009 (r197287) @@ -2354,6 +2354,9 @@ zfs_ioc_rollback(zfs_cmd_t *zc) if (error == 0) { int resume_err; +#ifdef FREEBSD_NAMECACHE + cache_purgevfs(zfsvfs->z_vfs); +#endif ASSERT(strcmp(osname, zc->zc_name) == 0); error = dmu_objset_rollback(os); resume_err = zfs_resume_fs(zfsvfs, osname, mode); From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 15:11:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0DC4106566B; Thu, 17 Sep 2009 15:11:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADE8D8FC20; Thu, 17 Sep 2009 15:11:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HFBCmA061599; Thu, 17 Sep 2009 15:11:12 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HFBCon061588; Thu, 17 Sep 2009 15:11:12 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200909171511.n8HFBCon061588@svn.freebsd.org> From: Randall Stewart Date: Thu, 17 Sep 2009 15:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197288 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 15:11:12 -0000 Author: rrs Date: Thu Sep 17 15:11:12 2009 New Revision: 197288 URL: http://svn.freebsd.org/changeset/base/197288 Log: Support for VNET in SCTP (hopefully) Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_asconf.c Thu Sep 17 15:11:12 2009 (r197288) @@ -881,7 +881,7 @@ send_reply: /* we probably don't need these operations */ (void)sa6_recoverscope(from6); sa6_embedscope(from6, - MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + MODULE_GLOBAL(ip6_use_defzone)); break; } Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_bsd_addr.c Thu Sep 17 15:11:12 2009 (r197288) @@ -126,7 +126,7 @@ sctp_gather_internal_ifa_flags(struct sc ifa6 = (struct in6_ifaddr *)ifa->ifa; ifa->flags = ifa6->ia6_flags; - if (!MODULE_GLOBAL(MOD_INET6, ip6_use_deprecated)) { + if (!MODULE_GLOBAL(ip6_use_deprecated)) { if (ifa->flags & IN6_IFF_DEPRECATED) { ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE; @@ -206,7 +206,7 @@ sctp_init_ifns_for_vrf(int vrfid) struct sctp_ifa *sctp_ifa; uint32_t ifa_flags; - TAILQ_FOREACH(ifn, &MODULE_GLOBAL(MOD_NET, ifnet), if_list) { + TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { IF_ADDR_LOCK(ifn); TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) { if (ifa->ifa_addr == NULL) { @@ -336,7 +336,7 @@ void struct ifnet *ifn; struct ifaddr *ifa; - TAILQ_FOREACH(ifn, &MODULE_GLOBAL(MOD_NET, ifnet), if_list) { + TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { if (!(*pred) (ifn)) { continue; } Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_input.c Thu Sep 17 15:11:12 2009 (r197288) @@ -5873,7 +5873,7 @@ sctp_skip_csum_4: * idea, so I will leave it in place. */ if (inp && ipsec4_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(MOD_IPSEC, ipsec4stat).in_polvio++; + MODULE_GLOBAL(ipsec4stat).in_polvio++; SCTP_STAT_INCR(sctps_hdrops); goto bad; } Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_os_bsd.h Thu Sep 17 15:11:12 2009 (r197288) @@ -78,9 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef VIMAGE -#error "SCTP is not yet compatible with VIMAGE." -#endif +#include #ifdef IPSEC #include @@ -137,25 +135,20 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); #define SCTP_CTR6 CTR6 #endif -#define SCTP_BASE_INFO(__m) system_base_info.sctppcbinfo.__m -#define SCTP_BASE_STATS system_base_info.sctpstat -#define SCTP_BASE_STAT(__m) system_base_info.sctpstat.__m -#define SCTP_BASE_SYSCTL(__m) system_base_info.sctpsysctl.__m -#define SCTP_BASE_VAR(__m) system_base_info.__m - /* * Macros to expand out globals defined by various modules * to either a real global or a virtualized instance of one, * depending on whether VIMAGE is defined. */ -/* first define modules that supply us information */ -#define MOD_NET net -#define MOD_INET inet -#define MOD_INET6 inet6 -#define MOD_IPSEC ipsec - /* then define the macro(s) that hook into the vimage macros */ -#define MODULE_GLOBAL(__MODULE, __SYMBOL) V_ ## __SYMBOL +#define MODULE_GLOBAL(__SYMBOL) V_ ## __SYMBOL + +#define V_system_base_info VNET_NAME(system_base_info) +#define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m +#define SCTP_BASE_STATS V_system_base_info.sctpstat +#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m +#define SCTP_BASE_SYSCTL(__m) V_system_base_info.sctpsysctl.__m +#define SCTP_BASE_VAR(__m) V_system_base_info.__m /* * Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_output.c Thu Sep 17 15:11:12 2009 (r197288) @@ -3829,7 +3829,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sin6 = &tmp; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } @@ -3883,7 +3883,7 @@ sctp_lowlevel_chunk_output(struct sctp_i if (net->src_addr_selected == 0) { sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } @@ -3906,7 +3906,7 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { sin6 = (struct sockaddr_in6 *)&ro->ro_dst; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } @@ -5143,7 +5143,7 @@ do_a_abort: */ (void)sa6_recoverscope(sin6); stc.scope_id = sin6->sin6_scope_id; - sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); stc.loopback_scope = 1; stc.local_scope = 0; stc.site_scope = 1; @@ -5179,7 +5179,7 @@ do_a_abort: */ (void)sa6_recoverscope(sin6); stc.scope_id = sin6->sin6_scope_id; - sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { /* * If the new destination is @@ -10768,7 +10768,7 @@ sctp_send_shutdown_complete2(struct mbuf /* Fill in the IPv6 header for the ABORT */ ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(MOD_INET6, ip6_defhlim); + ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; } else { @@ -11787,7 +11787,7 @@ sctp_send_abort(struct mbuf *m, int iphl /* Fill in the IP6 header for the ABORT */ ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(MOD_INET6, ip6_defhlim); + ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; } else { @@ -12014,7 +12014,7 @@ sctp_send_operr_to(struct mbuf *m, int i /* Fill in the IP6 header for the ABORT */ ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(MOD_INET6, ip6_defhlim); + ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; } else { @@ -13759,7 +13759,7 @@ sctp_v6src_match_nexthop(struct sockaddr return (0); /* get prefix entry of address */ - LIST_FOREACH(pfx, &MODULE_GLOBAL(MOD_INET6, nd_prefix), ndpr_entry) { + LIST_FOREACH(pfx, &MODULE_GLOBAL(nd_prefix), ndpr_entry) { if (pfx->ndpr_stateflags & NDPRF_DETACHED) continue; if (IN6_ARE_MASKED_ADDR_EQUAL(&pfx->ndpr_prefix.sin6_addr, Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_pcb.c Thu Sep 17 15:11:12 2009 (r197288) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include -struct sctp_base_info system_base_info; +VNET_DEFINE(struct sctp_base_info, system_base_info); /* FIX: we don't handle multiple link local scopes */ /* "scopeless" replacement IN6_ARE_ADDR_EQUAL */ @@ -59,11 +59,11 @@ SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 struct sockaddr_in6 tmp_a, tmp_b; memcpy(&tmp_a, a, sizeof(struct sockaddr_in6)); - if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(ip6_use_defzone)) != 0) { return 0; } memcpy(&tmp_b, b, sizeof(struct sockaddr_in6)); - if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(ip6_use_defzone)) != 0) { return 0; } return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr)); @@ -2008,7 +2008,7 @@ sctp_findassociation_addr(struct mbuf *m /* Get the scopes in properly to the sin6 addr's */ /* we probably don't need these operations */ (void)sa6_recoverscope(from6); - sa6_embedscope(from6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(from6, MODULE_GLOBAL(ip6_use_defzone)); break; } #endif @@ -2049,7 +2049,7 @@ sctp_findassociation_addr(struct mbuf *m /* Get the scopes in properly to the sin6 addr's */ /* we probably don't need these operations */ (void)sa6_recoverscope(to6); - sa6_embedscope(to6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(to6, MODULE_GLOBAL(ip6_use_defzone)); break; } #endif @@ -2316,7 +2316,7 @@ sctp_inpcb_alloc(struct socket *so, uint } #endif /* IPSEC */ SCTP_INCR_EP_COUNT(); - inp->ip_inp.inp.inp_ip_ttl = MODULE_GLOBAL(MOD_INET, ip_defttl); + inp->ip_inp.inp.inp_ip_ttl = MODULE_GLOBAL(ip_defttl); SCTP_INP_INFO_WUNLOCK(); so->so_pcb = (caddr_t)inp; @@ -2688,7 +2688,7 @@ sctp_inpcb_bind(struct socket *so, struc if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { bindall = 0; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); return (EINVAL); } @@ -2814,8 +2814,8 @@ continue_anyway: int done; if (ip_inp->inp_flags & INP_HIGHPORT) { - first = MODULE_GLOBAL(MOD_INET, ipport_hifirstauto); - last = MODULE_GLOBAL(MOD_INET, ipport_hilastauto); + first = MODULE_GLOBAL(ipport_hifirstauto); + last = MODULE_GLOBAL(ipport_hilastauto); } else if (ip_inp->inp_flags & INP_LOWPORT) { if (p && (error = priv_check(p, PRIV_NETINET_RESERVEDPORT) @@ -2826,11 +2826,11 @@ continue_anyway: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); return (error); } - first = MODULE_GLOBAL(MOD_INET, ipport_lowfirstauto); - last = MODULE_GLOBAL(MOD_INET, ipport_lowlastauto); + first = MODULE_GLOBAL(ipport_lowfirstauto); + last = MODULE_GLOBAL(ipport_lowlastauto); } else { - first = MODULE_GLOBAL(MOD_INET, ipport_firstauto); - last = MODULE_GLOBAL(MOD_INET, ipport_lastauto); + first = MODULE_GLOBAL(ipport_firstauto); + last = MODULE_GLOBAL(ipport_lastauto); } if (first > last) { uint16_t temp; @@ -3756,7 +3756,7 @@ sctp_add_remote_addr(struct sctp_tcb *st struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; - (void)sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + (void)sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); sin6->sin6_scope_id = 0; } #endif Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_pcb.h Thu Sep 17 15:11:12 2009 (r197288) @@ -462,7 +462,7 @@ struct sctp_tcb { * goes with the base info. sctp_pcb.c has * the real definition. */ -extern struct sctp_base_info system_base_info; +VNET_DECLARE(struct sctp_base_info, system_base_info); #ifdef INET6 int SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 *a, struct sockaddr_in6 *b); Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_timer.c Thu Sep 17 15:11:12 2009 (r197288) @@ -1773,7 +1773,7 @@ sctp_pathmtu_timer(struct sctp_inpcb *in struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; /* KAME hack: embed scopeid */ - (void)sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + (void)sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); } #endif Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet/sctp_usrreq.c Thu Sep 17 15:11:12 2009 (r197288) @@ -544,7 +544,7 @@ sctp_attach(struct socket *so, int proto inp->sctp_flags &= ~SCTP_PCB_FLAGS_BOUND_V6; /* I'm not v6! */ ip_inp = &inp->ip_inp.inp; ip_inp->inp_vflag |= INP_IPV4; - ip_inp->inp_ip_ttl = MODULE_GLOBAL(MOD_INET, ip_defttl); + ip_inp->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); #ifdef IPSEC error = ipsec_init_policy(so, &ip_inp->inp_sp); #ifdef SCTP_LOG_CLOSING Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Thu Sep 17 14:58:21 2009 (r197287) +++ head/sys/netinet6/sctp6_usrreq.c Thu Sep 17 15:11:12 2009 (r197288) @@ -223,7 +223,7 @@ sctp_skip_csum: */ if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { /* XXX */ - MODULE_GLOBAL(MOD_IPSEC, ipsec6stat).in_polvio++; + MODULE_GLOBAL(ipsec6stat).in_polvio++; goto bad; } #endif /* IPSEC */ @@ -695,7 +695,7 @@ sctp6_attach(struct socket *so, int prot * socket as well, because the socket may be bound to an IPv6 * wildcard address, which may match an IPv4-mapped IPv6 address. */ - inp6->inp_ip_ttl = MODULE_GLOBAL(MOD_INET, ip_defttl); + inp6->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); #endif /* * Hmm what about the IPSEC stuff that is missing here but in @@ -859,7 +859,7 @@ sctp6_send(struct socket *so, int flags, } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(MOD_INET6, ip6_v6only)) { + if (!MODULE_GLOBAL(ip6_v6only)) { struct sockaddr_in sin; /* convert v4-mapped into v4 addr and send */ @@ -990,7 +990,7 @@ sctp6_connect(struct socket *so, struct } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(MOD_INET6, ip6_v6only)) { + if (!MODULE_GLOBAL(ip6_v6only)) { /* convert v4-mapped into v4 addr */ in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); addr = (struct sockaddr *)&ss; From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 15:14:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F00C106566C; Thu, 17 Sep 2009 15:14:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3378FC12; Thu, 17 Sep 2009 15:14:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HFESSx061723; Thu, 17 Sep 2009 15:14:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HFESlN061721; Thu, 17 Sep 2009 15:14:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909171514.n8HFESlN061721@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 17 Sep 2009 15:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197289 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 15:14:28 -0000 Author: pjd Date: Thu Sep 17 15:14:28 2009 New Revision: 197289 URL: http://svn.freebsd.org/changeset/base/197289 Log: Purge file system namecache when receiving incremental stream and rolling back to it. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 17 15:11:12 2009 (r197288) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 17 15:14:28 2009 (r197289) @@ -2543,6 +2543,9 @@ zfs_ioc_recv(zfs_cmd_t *zc) if (error == 0) { int resume_err; +#ifdef FREEBSD_NAMECACHE + cache_purgevfs(zfsvfs->z_vfs); +#endif error = dmu_recv_end(&drc); resume_err = zfs_resume_fs(zfsvfs, osname, mode); error = error ? error : resume_err; From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 15:18:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5FBF106566C; Thu, 17 Sep 2009 15:18:39 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 88DE08FC0A; Thu, 17 Sep 2009 15:18:37 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 70E1645E35; Thu, 17 Sep 2009 17:18:34 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 04B1D4569A; Thu, 17 Sep 2009 17:18:27 +0200 (CEST) Date: Thu, 17 Sep 2009 17:18:24 +0200 From: Pawel Jakub Dawidek To: Marko Zec Message-ID: <20090917151723.GB2197@garage.freebsd.pl> References: <200909171452.n8HEqFfs061011@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EgVrEAR5UttbsTXg" Content-Disposition: inline In-Reply-To: <200909171452.n8HEqFfs061011@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197286 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 15:18:39 -0000 --EgVrEAR5UttbsTXg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 17, 2009 at 02:52:15PM +0000, Marko Zec wrote: > Author: zec > Date: Thu Sep 17 14:52:15 2009 > New Revision: 197286 > URL: http://svn.freebsd.org/changeset/base/197286 >=20 > Log: > V_irtualize the lltables list, making ARP and ND reasonably > usable again with options VIMAGE kernels. > =20 > Submitted by: bz (the original version, probably identical to this one) > Reviewed by: many @ DevSummit Cambridge > MFC after: 3 days [...] > +static void > +vnet_lltable_init() > +{ > + > + SLIST_INIT(&V_lltables); > +} > +VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, vnet_llta= ble_init, NULL); There is nothing we want to do when vnet is going away? --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --EgVrEAR5UttbsTXg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKslNAForvXbEpPzQRAh2XAKC5VHL+p1aIAgnH43vA5Zkcvi32yQCgpoph bT9PAS/3yoE4ufLEeH0QnyA= =nyJM -----END PGP SIGNATURE----- --EgVrEAR5UttbsTXg-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 17:41:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F129106566C; Thu, 17 Sep 2009 17:41:28 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9598FC0C; Thu, 17 Sep 2009 17:41:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HHfSvg065200; Thu, 17 Sep 2009 17:41:28 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HHfScO065197; Thu, 17 Sep 2009 17:41:28 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200909171741.n8HHfScO065197@svn.freebsd.org> From: Roman Divacky Date: Thu, 17 Sep 2009 17:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197293 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 17:41:28 -0000 Author: rdivacky Date: Thu Sep 17 17:41:28 2009 New Revision: 197293 URL: http://svn.freebsd.org/changeset/base/197293 Log: Make these argument/variable unsigned as the defines for them don't fit into signed 32bit integer. Approved by: ed (mentor, implicit) Approved by: sson Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Sep 17 16:16:44 2009 (r197292) +++ head/sys/kern/kern_event.c Thu Sep 17 17:41:28 2009 (r197293) @@ -145,7 +145,7 @@ static int filt_timer(struct knote *kn, static int filt_userattach(struct knote *kn); static void filt_userdetach(struct knote *kn); static int filt_user(struct knote *kn, long hint); -static void filt_usertouch(struct knote *kn, struct kevent *kev, long type); +static void filt_usertouch(struct knote *kn, struct kevent *kev, unsigned long type); static struct filterops file_filtops = { .f_isfd = 1, @@ -616,9 +616,9 @@ filt_user(struct knote *kn, __unused lon } static void -filt_usertouch(struct knote *kn, struct kevent *kev, long type) +filt_usertouch(struct knote *kn, struct kevent *kev, unsigned long type) { - int ffctrl; + unsigned int ffctrl; switch (type) { case EVENT_REGISTER: Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Thu Sep 17 16:16:44 2009 (r197292) +++ head/sys/sys/event.h Thu Sep 17 17:41:28 2009 (r197293) @@ -191,7 +191,7 @@ struct filterops { int (*f_attach)(struct knote *kn); void (*f_detach)(struct knote *kn); int (*f_event)(struct knote *kn, long hint); - void (*f_touch)(struct knote *kn, struct kevent *kev, long type); + void (*f_touch)(struct knote *kn, struct kevent *kev, unsigned long type); }; /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 17:48:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3463106566B; Thu, 17 Sep 2009 17:48:13 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2E5C8FC0A; Thu, 17 Sep 2009 17:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HHmDUf065385; Thu, 17 Sep 2009 17:48:13 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HHmDAJ065382; Thu, 17 Sep 2009 17:48:13 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200909171748.n8HHmDAJ065382@svn.freebsd.org> From: Roman Divacky Date: Thu, 17 Sep 2009 17:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197294 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 17:48:14 -0000 Author: rdivacky Date: Thu Sep 17 17:48:13 2009 New Revision: 197294 URL: http://svn.freebsd.org/changeset/base/197294 Log: Fix the style of the previous commit. Approved by: ed (mentor, implicit) Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Sep 17 17:41:28 2009 (r197293) +++ head/sys/kern/kern_event.c Thu Sep 17 17:48:13 2009 (r197294) @@ -145,7 +145,8 @@ static int filt_timer(struct knote *kn, static int filt_userattach(struct knote *kn); static void filt_userdetach(struct knote *kn); static int filt_user(struct knote *kn, long hint); -static void filt_usertouch(struct knote *kn, struct kevent *kev, unsigned long type); +static void filt_usertouch(struct knote *kn, struct kevent *kev, + unsigned long type); static struct filterops file_filtops = { .f_isfd = 1, Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Thu Sep 17 17:41:28 2009 (r197293) +++ head/sys/sys/event.h Thu Sep 17 17:48:13 2009 (r197294) @@ -191,7 +191,8 @@ struct filterops { int (*f_attach)(struct knote *kn); void (*f_detach)(struct knote *kn); int (*f_event)(struct knote *kn, long hint); - void (*f_touch)(struct knote *kn, struct kevent *kev, unsigned long type); + void (*f_touch)(struct knote *kn, struct kevent *kev, + unsigned long type); }; /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 19:05:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64F5A106566B; Thu, 17 Sep 2009 19:05:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF9A8FC22; Thu, 17 Sep 2009 19:05:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HJ5mJM067118; Thu, 17 Sep 2009 19:05:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HJ5mdo067114; Thu, 17 Sep 2009 19:05:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200909171905.n8HJ5mdo067114@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Sep 2009 19:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197297 - in head: etc etc/defaults share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 19:05:48 -0000 Author: dougb Date: Thu Sep 17 19:05:47 2009 New Revision: 197297 URL: http://svn.freebsd.org/changeset/base/197297 Log: Add a knob to show 'Starting foo:' messages when faststart is used, such as at boot time. Modified: head/etc/defaults/rc.conf head/etc/rc.subr head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Sep 17 18:39:53 2009 (r197296) +++ head/etc/defaults/rc.conf Thu Sep 17 19:05:47 2009 (r197297) @@ -23,6 +23,7 @@ rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. +rc_startmsgs="NO" # Show "Starting foo:" messages at boot rcshutdown_timeout="30" # Seconds to wait before terminating rc.shutdown early_late_divider="FILESYSTEMS" # Script that separates early/late # stages of the boot process. Make sure you know Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Sep 17 18:39:53 2009 (r197296) +++ head/etc/rc.subr Thu Sep 17 19:05:47 2009 (r197297) @@ -708,7 +708,13 @@ run_rc_command() # setup the full command to run # - [ -z "${rc_quiet}" ] && echo "Starting ${name}." + _show_startmsgs=1 + if [ -n "${rc_quiet}" ]; then + if ! checkyesno rc_startmsgs; then + unset _show_startmsgs + fi + fi + [ -n "$_show_startmsgs" ] && echo "Starting ${name}." if [ -n "$_chroot" ]; then _doit="\ ${_nice:+nice -n $_nice }\ Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Sep 17 18:39:53 2009 (r197296) +++ head/share/man/man5/rc.conf.5 Thu Sep 17 19:05:47 2009 (r197297) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2009 +.Dd September 17, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -95,6 +95,13 @@ disable informational messages from the Informational messages are displayed when a condition that is not serious enough to warrant a warning or an error occurs. +.It Va rc_startmsgs +.Pq Vt bool +If set to +.Dq Li YES , +show +.Dq Starting foo: +when faststart is used (e.g., at boot time). .It Va early_late_divider .Pq Vt str The name of the script that should be used as the From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 19:08:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DB881065695; Thu, 17 Sep 2009 19:08:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8C48FC12; Thu, 17 Sep 2009 19:08:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HJ8GCS067204; Thu, 17 Sep 2009 19:08:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HJ8GQs067202; Thu, 17 Sep 2009 19:08:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200909171908.n8HJ8GQs067202@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Sep 2009 19:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 19:08:16 -0000 Author: rmacklem Date: Thu Sep 17 19:08:15 2009 New Revision: 197298 URL: http://svn.freebsd.org/changeset/base/197298 Log: Change the default transport protocol for use by the Mount protocol from UDP to TCP, so that it is consistent with TCP for NFS, which became the default at r176198. Without this change, doing an NFS mount against a server that only supports UDP would result in an unusable mount point if a transport protocol option wasn't specified for the mount. Approved by: kib (mentor) MFC after: 3 days Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Thu Sep 17 19:05:47 2009 (r197297) +++ head/sbin/mount_nfs/mount_nfs.c Thu Sep 17 19:08:15 2009 (r197298) @@ -104,7 +104,7 @@ struct nfhret { #define OF_NOINET6 8 int retrycnt = -1; int opflags = 0; -int nfsproto = IPPROTO_UDP; +int nfsproto = IPPROTO_TCP; int mnttcp_ok = 1; int noconn = 0; char *portspec = NULL; /* Server nfs port; NULL means look up via rpcbind. */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 17 19:15:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D546A1065670; Thu, 17 Sep 2009 19:15:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4E8A8FC08; Thu, 17 Sep 2009 19:15:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8HJFnV0067404; Thu, 17 Sep 2009 19:15:49 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HJFnNf067401; Thu, 17 Sep 2009 19:15:49 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200909171915.n8HJFnNf067401@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 17 Sep 2009 19:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197299 - in head: sbin/savecore usr.sbin/crashinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 19:15:49 -0000 Author: ru Date: Thu Sep 17 19:15:49 2009 New Revision: 197299 URL: http://svn.freebsd.org/changeset/base/197299 Log: Fixed markup. Modified: head/sbin/savecore/savecore.8 head/usr.sbin/crashinfo/crashinfo.8 Modified: head/sbin/savecore/savecore.8 ============================================================================== --- head/sbin/savecore/savecore.8 Thu Sep 17 19:08:15 2009 (r197298) +++ head/sbin/savecore/savecore.8 Thu Sep 17 19:15:49 2009 (r197299) @@ -101,14 +101,16 @@ checks the core dump in various ways to If it passes these checks, it saves the core image in .Ar directory Ns Pa /vmcore.# and information about the core in -.Ar directory Ns Pa /info.# +.Ar directory Ns Pa /info.# . For kernel textdumps generated with the .Xr textdump 4 facility, output will be stored in the .Xr tar 5 format and named -.Ar director Ns Pa /textdump.tar.# -The ``#'' is the number from the first line of the file +.Ar directory Ns Pa /textdump.tar.# . +The +.Dq # +is the number from the first line of the file .Ar directory Ns Pa /bounds , and it is incremented and stored back into the file each time .Nm Modified: head/usr.sbin/crashinfo/crashinfo.8 ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.8 Thu Sep 17 19:08:15 2009 (r197298) +++ head/usr.sbin/crashinfo/crashinfo.8 Thu Sep 17 19:15:49 2009 (r197299) @@ -90,18 +90,18 @@ The options are as follows: .Bl -tag -width indent .It Fl d Ar crashdir Specify an alternate core dump directory. -The default crash dump directory is +The default crash dump directory is .Pa /var/crash . .It Fl n Ar dumpnr Use the core dump saved in .Pa vmcore. Ns Ar dumpnr -instead of the latest core in the core dump directory. +instead of the latest core in the core dump directory. .It Fl k Ar kernel Specify an explicit kernel file. .El .Sh SEE ALSO -.Xr savecore 8 , -.Xr textdump 4 +.Xr textdump 4 , +.Xr savecore 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 00:33:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F236F1065672; Fri, 18 Sep 2009 00:33:47 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFE2D8FC12; Fri, 18 Sep 2009 00:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8I0Xlhb073859; Fri, 18 Sep 2009 00:33:47 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8I0XllY073845; Fri, 18 Sep 2009 00:33:47 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200909180033.n8I0XllY073845@svn.freebsd.org> From: Christian Brueffer Date: Fri, 18 Sep 2009 00:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197300 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 00:33:48 -0000 Author: brueffer Date: Fri Sep 18 00:33:47 2009 New Revision: 197300 URL: http://svn.freebsd.org/changeset/base/197300 Log: Various mdoc, spelling etc fixes. MFC after: 3 days Modified: head/share/man/man9/ieee80211.9 head/share/man/man9/ieee80211_amrr.9 head/share/man/man9/ieee80211_beacon.9 head/share/man/man9/ieee80211_bmiss.9 head/share/man/man9/ieee80211_crypto.9 head/share/man/man9/ieee80211_ddb.9 head/share/man/man9/ieee80211_input.9 head/share/man/man9/ieee80211_node.9 head/share/man/man9/ieee80211_output.9 head/share/man/man9/ieee80211_proto.9 head/share/man/man9/ieee80211_radiotap.9 head/share/man/man9/ieee80211_regdomain.9 head/share/man/man9/ieee80211_scan.9 head/share/man/man9/ieee80211_vap.9 Modified: head/share/man/man9/ieee80211.9 ============================================================================== --- head/share/man/man9/ieee80211.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -225,7 +225,7 @@ Allocate and initialize a structure. This method cannot sleep. The default method allocates zero'd memory using -.Xr malloc 9. +.Xr malloc 9 . Drivers should override this method to allocate extended storage for their own needs. Memory allocated by the driver must be tagged with @@ -301,7 +301,7 @@ This method is called immediately after and must initiate the work to scan a channel and schedule a timer to advance to the next channel in the scan list. This callback is done in a sleepable context. -The default method handles active scan work (e.g. sending ProbRequest +The default method handles active scan work (e.g. sending ProbeRequest frames), and schedules a call to .Xr ieee80211_scan_next 9 according to the maximum dwell time for the channel. @@ -558,4 +558,4 @@ Device supports Reduced Inter Frame Spac .Xr ieee80211_send_action 9 , .Xr ieee80211_radiotap_attach 9 , .Xr ifnet 9 , -.Xr malloc 9 . +.Xr malloc 9 Modified: head/share/man/man9/ieee80211_amrr.9 ============================================================================== --- head/share/man/man9/ieee80211_amrr.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_amrr.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -191,4 +191,4 @@ Drivers that poll a device to retrieve s (instead or in addition). .Sh SEE ALSO .Xr ieee80211 9 , -.Xr ieee80211_output 9 , +.Xr ieee80211_output 9 Modified: head/share/man/man9/ieee80211_beacon.9 ============================================================================== --- head/share/man/man9/ieee80211_beacon.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_beacon.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -112,4 +112,4 @@ Staggering beacon frames is usually supe about eight vaps, at which point the overhead becomes significant and the channel becomes noticeably busy anyway. .Sh SEE ALSO -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: head/share/man/man9/ieee80211_bmiss.9 ============================================================================== --- head/share/man/man9/ieee80211_bmiss.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_bmiss.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -86,6 +86,6 @@ Note that software beacon miss handling it can be used in any operating mode where beacons from a peer station are received. .Sh SEE ALSO -.Xr ieee80211 9 , -.Xr ieee80211_vap 9 , .Xr wpa_supplicant 8 , +.Xr ieee80211 9 , +.Xr ieee80211_vap 9 Modified: head/share/man/man9/ieee80211_crypto.9 ============================================================================== --- head/share/man/man9/ieee80211_crypto.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_crypto.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -65,10 +65,10 @@ .\" .Ft int .Fo ieee80211_crypto_newkey -.Fa "struct ieee80211vap * -.Fa "int cipher -.Fa "int flags -.Fa "struct ieee80211_key * +.Fa "struct ieee80211vap *" +.Fa "int cipher" +.Fa "int flags" +.Fa "struct ieee80211_key *" .Fc .\" .Ft int @@ -141,7 +141,7 @@ so it can reclaim resources. .Pp Crypto modules can notify the system of two events. When a packet replay event is recognized -.Fn ieee80111_notify_replay_failure +.Fn ieee80211_notify_replay_failure can be used to signal the event. When a .Dv TKIP @@ -256,4 +256,4 @@ when receive traffic is active. .Xr ioctl 2 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , -.Xr wlan_wep 4 . +.Xr wlan_wep 4 Modified: head/share/man/man9/ieee80211_ddb.9 ============================================================================== --- head/share/man/man9/ieee80211_ddb.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_ddb.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -54,7 +54,7 @@ This is especially important because wir built for embedded environments where cross-machine or post-mortem debugging facilities like .Xr kgdb 1 -infeasible. +are infeasible. .Pp The most commonly used command is .Bd -literal -offset indent @@ -69,4 +69,4 @@ and data structures in the system. .Sh SEE ALSO .Xr ddb 4 , -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: head/share/man/man9/ieee80211_input.9 ============================================================================== --- head/share/man/man9/ieee80211_input.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_input.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -113,4 +113,4 @@ Otherwise the values are made available (with the rssi presented as a filtered average over the last ten values and the noise floor the last reported value). .Sh SEE ALSO -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: head/share/man/man9/ieee80211_node.9 ============================================================================== --- head/share/man/man9/ieee80211_node.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_node.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -248,4 +248,4 @@ then a normal lookup is done without a t .Sh SEE ALSO .Xr ddb 9 .Xr ieee80211 9 , -.Xr ieee80211_proto 9 , +.Xr ieee80211_proto 9 Modified: head/share/man/man9/ieee80211_output.9 ============================================================================== --- head/share/man/man9/ieee80211_output.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_output.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -47,9 +47,9 @@ .\" .Ft void .Fo ieee80211_process_callback -.Fa struct ieee80211_node * -.Fa struct mbuf * -.Fa int +.Fa "struct ieee80211_node *" +.Fa "struct mbuf *" +.Fa "int" .Fc .Sh DESCRIPTION The @@ -101,7 +101,7 @@ Similarly, .Nm net80211 handles activities such as background scanning and power save mode, frames will not be sent to a driver unless it is operating on the -BSS channel will +BSS channel with .Dq full power . .Pp All frames passed to a driver for transmit hold a reference to a Modified: head/share/man/man9/ieee80211_proto.9 ============================================================================== --- head/share/man/man9/ieee80211_proto.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_proto.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -119,7 +119,7 @@ and .Vt ic_bsschan are guaranteed to be usable. .It Dv IEEE80211_S_CSA -Channel Switch Annoucememnt (CSA) is pending. +Channel Switch Announcement (CSA) is pending. This state is reached only from .Dv IEEE80211_S_RUN when either a CSA is received from an access point (in station mode) @@ -229,11 +229,11 @@ handled by or, in the case of card eject or vap destroy, work will be initiated outside the driver. .Sh SEE ALSO -.Xr ioctl 2 +.Xr ioctl 2 , +.Xr wpa_supplicant 8 , .Xr ieee80211 9 , -.Xr ifnet 9 +.Xr ifnet 9 , .Xr taskqueue 9 -.Xr wpa_supplicant 8 .Sh HISTORY The state machine concept was part of the original .Nm ieee80211 Modified: head/share/man/man9/ieee80211_radiotap.9 ============================================================================== --- head/share/man/man9/ieee80211_radiotap.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_radiotap.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -198,11 +198,11 @@ RF noise power at the antenna, in decibe .\"power as unitless distance from maximum power set at factory calibration. .\"0 indicates maximum transmit power. .\"Monotonically nondecreasing with lower power levels. -\.".It Dv IEEE80211_RADIOTAP_DB_TX_ATTENUATION -\."This field contains a single unsigned 16-bit value, expressing transmit -\."power as decibel distance from maximum power set at factory calibration. -\."0 indicates maximum transmit power. -\."Monotonically nondecreasing with lower power levels. +.\".It Dv IEEE80211_RADIOTAP_DB_TX_ATTENUATION +.\"This field contains a single unsigned 16-bit value, expressing transmit +.\"power as decibel distance from maximum power set at factory calibration. +.\"0 indicates maximum transmit power. +.\"Monotonically nondecreasing with lower power levels. .It Dv IEEE80211_RADIOTAP_DBM_TX_POWER Transmit power expressed as decibels from a 1mW reference. This field is a single signed 8-bit value. @@ -223,9 +223,9 @@ This field contains a single unsigned 8- RF noise power at the antenna, in decibels difference from an arbitrary, fixed reference. .It Dv IEEE80211_RADIOTAP_XCHANNEL -This field containts four values: a 32-bit unsigned bitmap of +This field contains four values: a 32-bit unsigned bitmap of flags that describe the channel attributes, a 16-bit unsigned -freqeuncy in MHz (typically the channel center), an 8-bit +frequency in MHz (typically the channel center), an 8-bit unsigned IEEE channel number, and a signed 8-bit value that holds the maximum regulatory transmit power cap in .5 dBm (8 bytes total). @@ -237,10 +237,10 @@ This property supersedes .Dv IEEE80211_RADIOTAP_CHANNEL and is the only way to completely express all channel attributes and the -mapping between channel freqeuncy and IEEE channel number. +mapping between channel frequency and IEEE channel number. .El .Sh EXAMPLES -Radiotap receive definitions for the Intersil Prims driver: +Radiotap receive definitions for the Intersil Prism driver: .Bd -literal -offset indent #define WI_RX_RADIOTAP_PRESENT \\ ((1 << IEEE80211_RADIOTAP_TSFT) \\ @@ -298,7 +298,6 @@ definitions first appeared in .\" .Sh AUTHORS .An -nosplit -.Pp The original version of this manual page was written by .An Bruce M. Simpson Aq bms@FreeBSD.org and Modified: head/share/man/man9/ieee80211_regdomain.9 ============================================================================== --- head/share/man/man9/ieee80211_regdomain.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_regdomain.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -112,7 +112,7 @@ routine. This should be done whenever the channel table contents are modified. .Pp The -.Fn ieee80211_alloc_countrie +.Fn ieee80211_alloc_countryie function allocates an information element as specified by 802.11h. Because this is expensive to generate it is cached in .Vt ic_countryie @@ -140,4 +140,4 @@ The exact rules by which to operate are .Sh SEE ALSO .Xr regdomain 5 , .Xr ifconfig 8 , -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: head/share/man/man9/ieee80211_scan.9 ============================================================================== --- head/share/man/man9/ieee80211_scan.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_scan.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -347,4 +347,4 @@ request. .Sh SEE ALSO .Xr ioctl 2 , .Xr ieee80211 9 . -.Xr ieee80211_proto 9 . +.Xr ieee80211_proto 9 Modified: head/share/man/man9/ieee80211_vap.9 ============================================================================== --- head/share/man/man9/ieee80211_vap.9 Thu Sep 17 19:15:49 2009 (r197299) +++ head/share/man/man9/ieee80211_vap.9 Fri Sep 18 00:33:47 2009 (r197300) @@ -151,4 +151,4 @@ that beacon are stopped before stopping .Sh SEE ALSO .Xr ieee80211 9 , .Xr ifnet 9 , -.Xr malloc 9 . +.Xr malloc 9 From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 01:00:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5CE106566C; Fri, 18 Sep 2009 01:00:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5D38FC20; Fri, 18 Sep 2009 01:00:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 75CFC41C747; Fri, 18 Sep 2009 03:00:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id hN+KNiM8XlSW; Fri, 18 Sep 2009 03:00:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id CF4E141C756; Fri, 18 Sep 2009 03:00:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id CE1DF4448E6; Fri, 18 Sep 2009 00:59:49 +0000 (UTC) Date: Fri, 18 Sep 2009 00:59:49 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Pawel Jakub Dawidek In-Reply-To: <20090917151723.GB2197@garage.freebsd.pl> Message-ID: <20090918005831.B68375@maildrop.int.zabbadoz.net> References: <200909171452.n8HEqFfs061011@svn.freebsd.org> <20090917151723.GB2197@garage.freebsd.pl> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec Subject: Re: svn commit: r197286 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 01:00:13 -0000 On Thu, 17 Sep 2009, Pawel Jakub Dawidek wrote: > On Thu, Sep 17, 2009 at 02:52:15PM +0000, Marko Zec wrote: >> Author: zec >> Date: Thu Sep 17 14:52:15 2009 >> New Revision: 197286 >> URL: http://svn.freebsd.org/changeset/base/197286 >> >> Log: >> V_irtualize the lltables list, making ARP and ND reasonably >> usable again with options VIMAGE kernels. >> >> Submitted by: bz (the original version, probably identical to this one) Uncommitted for the reason to not interfere with bugfixing for 8.0-R. >> Reviewed by: many @ DevSummit Cambridge >> MFC after: 3 days > [...] >> +static void >> +vnet_lltable_init() >> +{ >> + >> + SLIST_INIT(&V_lltables); >> +} >> +VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, vnet_lltable_init, NULL); ANy I didn'thave this style bug;) > There is nothing we want to do when vnet is going away? No things will clear itself up via other ways as the interfaces will go away the table will empty itself, etc -- Bjoern A. Zeeb What was I talking about and who are you again? From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 07:07:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F96106566B; Fri, 18 Sep 2009 07:07:35 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 033108FC0A; Fri, 18 Sep 2009 07:07:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8I77Yqs081541; Fri, 18 Sep 2009 07:07:34 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8I77YUh081539; Fri, 18 Sep 2009 07:07:34 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200909180707.n8I77YUh081539@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 18 Sep 2009 07:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197304 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 07:07:35 -0000 Author: maxim Date: Fri Sep 18 07:07:34 2009 New Revision: 197304 URL: http://svn.freebsd.org/changeset/base/197304 Log: o DragonflyBSD 2.4.0 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Sep 18 04:34:42 2009 (r197303) +++ head/share/misc/bsd-family-tree Fri Sep 18 07:07:34 2009 (r197304) @@ -229,6 +229,7 @@ FreeBSD 5.2 | | | | | | | DragonFly 2.2.0 | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | | | | | | | + | | | | | DragonFly 2.4.0 | V | | | | | | | | | FreeBSD 8 -current | NetBSD -current OpenBSD -current | @@ -502,6 +503,7 @@ DragonFly 2.2.0 2009-02-17 [DFB] NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] +DragonFly 2.4.0 2009-09-16 [DFB] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 07:45:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21E7F106566C; Fri, 18 Sep 2009 07:45:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2438FC12; Fri, 18 Sep 2009 07:45:16 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n8I7jBHk046776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Sep 2009 10:45:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n8I7jB4O077388; Fri, 18 Sep 2009 10:45:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n8I7jBeF077387; Fri, 18 Sep 2009 10:45:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 18 Sep 2009 10:45:11 +0300 From: Kostik Belousov To: Stacey Son Message-ID: <20090918074511.GJ47688@deviant.kiev.zoral.com.ua> References: <200909160315.n8G3FvBB010648@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CuSbO2Y8pb0HqfpG" Content-Disposition: inline In-Reply-To: <200909160315.n8G3FvBB010648@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197240 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 07:45:17 -0000 --CuSbO2Y8pb0HqfpG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 16, 2009 at 03:15:57AM +0000, Stacey Son wrote: > Author: sson > Date: Wed Sep 16 03:15:57 2009 > New Revision: 197240 > URL: http://svn.freebsd.org/changeset/base/197240 >=20 > Log: > Add optional touch event filter hooks to kevents. > =20 > The touch event filter is called when a kernel event data is possibly > updated. There are two hook points. First, during a kevent() system > call. Second, when an event has been triggered. > =20 > Approved by: rwatson (co-mentor) >=20 > Modified: > head/sys/kern/kern_event.c > head/sys/sys/event.h >=20 > Modified: head/sys/sys/event.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/event.h Tue Sep 15 22:46:06 2009 (r197239) > +++ head/sys/sys/event.h Wed Sep 16 03:15:57 2009 (r197240) > struct filterops { > int f_isfd; /* true if ident =3D=3D filedescriptor */ > int (*f_attach)(struct knote *kn); > void (*f_detach)(struct knote *kn); > int (*f_event)(struct knote *kn, long hint); > + void (*f_touch)(struct knote *kn, struct kevent *kev, long type); > }; > =20 > /* > @@ -193,6 +204,7 @@ struct knote { > } kn_ptr; > struct filterops *kn_fop; > void *kn_hook; > + int kn_hookid; > =20 You may want to add required padding to struct filterops and struct knote on stable/8 branch now, to be able to merge this after 8.0 is released without breaking KBI. --CuSbO2Y8pb0HqfpG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkqzOoYACgkQC3+MBN1Mb4gpbwCgu+l2rFUX0ELvCp64r6GL1Sn/ YQwAoNiWBTblP3ibXNcX4qrHvJVEDdZ/ =j5yl -----END PGP SIGNATURE----- --CuSbO2Y8pb0HqfpG-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 09:03:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD61E1065672; Fri, 18 Sep 2009 09:03:23 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE35D8FC0C; Fri, 18 Sep 2009 09:03:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8I93NON083950; Fri, 18 Sep 2009 09:03:23 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8I93NQF083949; Fri, 18 Sep 2009 09:03:23 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200909180903.n8I93NQF083949@svn.freebsd.org> From: Marko Zec Date: Fri, 18 Sep 2009 09:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197306 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 09:03:23 -0000 Author: zec Date: Fri Sep 18 09:03:23 2009 New Revision: 197306 URL: http://svn.freebsd.org/changeset/base/197306 Log: Style fix - break too long a line in two. Spotted by: bz MFC after: 3 days Modified: head/sys/net/if_llatbl.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Fri Sep 18 08:02:56 2009 (r197305) +++ head/sys/net/if_llatbl.c Fri Sep 18 09:03:23 2009 (r197306) @@ -377,5 +377,6 @@ vnet_lltable_init() SLIST_INIT(&V_lltables); } -VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, vnet_lltable_init, NULL); +VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, + vnet_lltable_init, NULL); From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 09:19:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD9971065670; Fri, 18 Sep 2009 09:19:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 911818FC0C; Fri, 18 Sep 2009 09:19:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2E54346B06; Fri, 18 Sep 2009 05:19:03 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 13E478A01B; Fri, 18 Sep 2009 05:19:01 -0400 (EDT) Message-ID: <4AB35086.90502@FreeBSD.org> Date: Fri, 18 Sep 2009 05:19:02 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Rick Macklem References: <200909171908.n8HJ8GQs067202@svn.freebsd.org> In-Reply-To: <200909171908.n8HJ8GQs067202@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 18 Sep 2009 05:19:02 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 09:19:03 -0000 Rick Macklem wrote: > Author: rmacklem > Date: Thu Sep 17 19:08:15 2009 > New Revision: 197298 > URL: http://svn.freebsd.org/changeset/base/197298 > > Log: > Change the default transport protocol for use by the Mount protocol > from UDP to TCP, so that it is consistent with TCP for NFS, which > became the default at r176198. Without this change, doing an NFS mount > against a server that only supports UDP would result in an unusable > mount point if a transport protocol option wasn't specified for the > mount. > > Approved by: kib (mentor) > MFC after: 3 days Does this still use UDP for the mount protocol for a UDP mount? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 12:13:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF171065670; Fri, 18 Sep 2009 12:13:09 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id ED4118FC19; Fri, 18 Sep 2009 12:13:07 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 9374445C9F; Fri, 18 Sep 2009 14:13:06 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E72C645C8A; Fri, 18 Sep 2009 14:12:59 +0200 (CEST) Date: Fri, 18 Sep 2009 14:12:57 +0200 From: Pawel Jakub Dawidek To: "Bjoern A. Zeeb" Message-ID: <20090918121233.GB3650@garage.freebsd.pl> References: <200909171452.n8HEqFfs061011@svn.freebsd.org> <20090917151723.GB2197@garage.freebsd.pl> <20090918005831.B68375@maildrop.int.zabbadoz.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BI5RvnYi6R4T2M87" Content-Disposition: inline In-Reply-To: <20090918005831.B68375@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec Subject: Re: svn commit: r197286 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 12:13:09 -0000 --BI5RvnYi6R4T2M87 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 18, 2009 at 12:59:49AM +0000, Bjoern A. Zeeb wrote: > On Thu, 17 Sep 2009, Pawel Jakub Dawidek wrote: >=20 > >On Thu, Sep 17, 2009 at 02:52:15PM +0000, Marko Zec wrote: > >>Author: zec > >>Date: Thu Sep 17 14:52:15 2009 > >>New Revision: 197286 > >>URL: http://svn.freebsd.org/changeset/base/197286 > >> > >>Log: > >> V_irtualize the lltables list, making ARP and ND reasonably > >> usable again with options VIMAGE kernels. > >> > >> Submitted by: bz (the original version, probably identical to this=20 > >> one) >=20 > Uncommitted for the reason to not interfere with bugfixing for 8.0-R. >=20 > >> Reviewed by: many @ DevSummit Cambridge > >> MFC after: 3 days > >[...] > >>+static void > >>+vnet_lltable_init() > >>+{ > >>+ > >>+ SLIST_INIT(&V_lltables); > >>+} > >>+VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST,=20 > >>vnet_lltable_init, NULL); >=20 > ANy I didn'thave this style bug;) >=20 > >There is nothing we want to do when vnet is going away? >=20 > No things will clear itself up via other ways as the interfaces will > go away the table will empty itself, etc So I guess it won't hurt to assert on uninit that the list is really empty?:) --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --BI5RvnYi6R4T2M87 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKs3lJForvXbEpPzQRAnh4AJ0am2SikxXu5nB/S/BSxFOxOlC+ggCgjgdU qWrjJbisV66BNImPCyS2we0= =l4qo -----END PGP SIGNATURE----- --BI5RvnYi6R4T2M87-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 12:25:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BD121065695; Fri, 18 Sep 2009 12:25:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CE88FC23; Fri, 18 Sep 2009 12:25:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ICPVQo090760; Fri, 18 Sep 2009 12:25:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8ICPVL2090759; Fri, 18 Sep 2009 12:25:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200909181225.n8ICPVL2090759@svn.freebsd.org> From: Rui Paulo Date: Fri, 18 Sep 2009 12:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197307 - head/sys/dev/mwl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 12:25:32 -0000 Author: rpaulo Date: Fri Sep 18 12:25:31 2009 New Revision: 197307 URL: http://svn.freebsd.org/changeset/base/197307 Log: Call mwl_rxdma_cleanup() if there was an error setting up the RX DMA. Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Fri Sep 18 09:03:23 2009 (r197306) +++ head/sys/dev/mwl/if_mwl.c Fri Sep 18 12:25:31 2009 (r197307) @@ -2303,8 +2303,10 @@ mwl_dma_setup(struct mwl_softc *sc) int error, i; error = mwl_rxdma_setup(sc); - if (error != 0) + if (error != 0) { + mwl_rxdma_cleanup(sc); return error; + } for (i = 0; i < MWL_NUM_TX_QUEUES; i++) { error = mwl_txdma_setup(sc, &sc->sc_txq[i]); From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 13:44:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 371851065670; Fri, 18 Sep 2009 13:44:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24F258FC27; Fri, 18 Sep 2009 13:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IDiebC092312; Fri, 18 Sep 2009 13:44:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IDieVK092310; Fri, 18 Sep 2009 13:44:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909181344.n8IDieVK092310@svn.freebsd.org> From: Ed Schouten Date: Fri, 18 Sep 2009 13:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197308 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 13:44:40 -0000 Author: ed Date: Fri Sep 18 13:44:39 2009 New Revision: 197308 URL: http://svn.freebsd.org/changeset/base/197308 Log: Spell Israel correctly. Submitted by: Alexey Savartsov PR: bin/138580 Modified: head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Fri Sep 18 12:25:31 2009 (r197307) +++ head/usr.sbin/sysinstall/menus.c Fri Sep 18 13:44:39 2009 (r197308) @@ -691,7 +691,7 @@ DMenu MenuMediaFTP = { { " Ireland #3", "ftp3.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ie.freebsd.org" }, - { "Isreal", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, + { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.il.freebsd.org" }, { "Italy", "ftp.it.freebsd.org", NULL, dmenuSetVariable, NULL, From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 13:48:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12BE106566B; Fri, 18 Sep 2009 13:48:38 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEF828FC0C; Fri, 18 Sep 2009 13:48:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IDmcIb092416; Fri, 18 Sep 2009 13:48:38 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IDmc4V092414; Fri, 18 Sep 2009 13:48:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909181348.n8IDmc4V092414@svn.freebsd.org> From: Attilio Rao Date: Fri, 18 Sep 2009 13:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197309 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 13:48:38 -0000 Author: attilio Date: Fri Sep 18 13:48:38 2009 New Revision: 197309 URL: http://svn.freebsd.org/changeset/base/197309 Log: Don't allocate new unnecessary pages when devstat_alloc() looses the run for re-acuiring the lock, but recheck if new pages are allocatable from the pool and free the previously allocated ones. Tested by: pho, Giovanni Trematerra Modified: head/sys/kern/subr_devstat.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Fri Sep 18 13:44:39 2009 (r197308) +++ head/sys/kern/subr_devstat.c Fri Sep 18 13:48:38 2009 (r197309) @@ -469,7 +469,7 @@ static struct devstat * devstat_alloc(void) { struct devstat *dsp; - struct statspage *spp; + struct statspage *spp, *spp2; u_int u; static int once; @@ -479,6 +479,7 @@ devstat_alloc(void) UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME); once = 1; } + spp2 = NULL; mtx_lock(&devstat_mutex); for (;;) { TAILQ_FOREACH(spp, &pagelist, list) { @@ -487,24 +488,30 @@ devstat_alloc(void) } if (spp != NULL) break; - /* - * We had no free slot in any of our pages, drop the mutex - * and get another page. In theory we could have more than - * one process doing this at the same time and consequently - * we may allocate more pages than we will need. That is - * Just Too Bad[tm], we can live with that. - */ mtx_unlock(&devstat_mutex); - spp = malloc(sizeof *spp, M_DEVSTAT, M_ZERO | M_WAITOK); - spp->stat = malloc(PAGE_SIZE, M_DEVSTAT, M_ZERO | M_WAITOK); - spp->nfree = statsperpage; - mtx_lock(&devstat_mutex); + spp2 = malloc(sizeof *spp, M_DEVSTAT, M_ZERO | M_WAITOK); + spp2->stat = malloc(PAGE_SIZE, M_DEVSTAT, M_ZERO | M_WAITOK); + spp2->nfree = statsperpage; + /* - * It would make more sense to add the new page at the head - * but the order on the list determine the sequence of the - * mapping so we can't do that. + * If free statspages were added while the lock was released + * just reuse them. */ - TAILQ_INSERT_TAIL(&pagelist, spp, list); + mtx_lock(&devstat_mutex); + TAILQ_FOREACH(spp, &pagelist, list) + if (spp->nfree > 0) + break; + if (spp == NULL) { + spp = spp2; + + /* + * It would make more sense to add the new page at the + * head but the order on the list determine the + * sequence of the mapping so we can't do that. + */ + TAILQ_INSERT_TAIL(&pagelist, spp, list); + } else + break; } dsp = spp->stat; for (u = 0; u < statsperpage; u++) { @@ -515,6 +522,10 @@ devstat_alloc(void) spp->nfree--; dsp->allocated = 1; mtx_unlock(&devstat_mutex); + if (spp2 != NULL && spp2 != spp) { + free(spp2->stat, M_DEVSTAT); + free(spp2, M_DEVSTAT); + } return (dsp); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 14:05:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1014510656B7; Fri, 18 Sep 2009 14:05:57 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECCA48FC18; Fri, 18 Sep 2009 14:05:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IE5uuf092834; Fri, 18 Sep 2009 14:05:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IE5u7t092832; Fri, 18 Sep 2009 14:05:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200909181405.n8IE5u7t092832@svn.freebsd.org> From: Christian Brueffer Date: Fri, 18 Sep 2009 14:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197310 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:05:57 -0000 Author: brueffer Date: Fri Sep 18 14:05:56 2009 New Revision: 197310 URL: http://svn.freebsd.org/changeset/base/197310 Log: Fix mdoc, typos, contractions. This includes: PR: 135520 Submitted by: Nobuyuki Koganemaru Patch by: gavin MFC after: 3 days Modified: head/share/man/man9/fail.9 Modified: head/share/man/man9/fail.9 ============================================================================== --- head/share/man/man9/fail.9 Fri Sep 18 13:48:38 2009 (r197309) +++ head/share/man/man9/fail.9 Fri Sep 18 14:05:56 2009 (r197310) @@ -37,7 +37,6 @@ .Nm KFAIL_POINT_GOTO , .Nm fail_point , .Nm DEBUG_FP -. .Nd fail points .Sh SYNOPSIS .In sys/fail.h @@ -79,7 +78,7 @@ is derived from the .Fn return value set in the sysctl MIB. See -.Sx SYSCTL SETTINGS +.Sx SYSCTL VARIABLES below. .Pp The remaining @@ -100,7 +99,6 @@ is the equivalent of .Sy KFAIL_POINT_CODE(..., { error_var = RETURN_VALUE; goto label;}) .El -.Pp .Sh SYSCTL VARIABLES The .Fn KFAIL_POINT_* @@ -108,28 +106,28 @@ macros add sysctl MIBs where specified. Many base kernel MIBs can be found in the .Sy debug.fail_point tree (referenced in code by -.Sy DEBUG_FP -). +.Sy DEBUG_FP ) . .Pp The sysctl variable may be set using the following grammar: .Pp +.Bd -literal :: ( "->" )* -.Pp + :: ( ( "%") | ( "*" ) )* [ "(" ")" ] -.Pp + :: [ "." ] | "." -.Pp + :: "off" | "return" | "sleep" | "panic" | "break" | "print" +.Ed .Pp -The -argument specifies which action to take: +The argument specifies which action to take: .Bl -tag -width ".Dv return" .It Sy off Take no action (does not trigger fail point code) @@ -158,13 +156,13 @@ is evaluated before the count, i.e. "2%5 but only 5 times total". .Pp The operator -> can be used to express cascading terms. -If you specify ->, it means that if doesn't -'execute', is evaluated. +If you specify ->, it means that if does not +.Ql execute , + is evaluated. For the purpose of this operator, the return() and print() operators are the only types that cascade. A return() term only cascades if the code executes, and a print() term only cascades when passed a non-zero argument. -.Pp .Sh EXAMPLES .Bl -tag .It Sy sysctl debug.fail_point.foobar="2.1%return(5)" @@ -175,7 +173,7 @@ with RETURN_VALUE set to 5. 2/100ths of the time, execute .Fa code with RETURN_VALUE set to 5. -If that doesn't happen, 5% of the time execute +If that does not happen, 5% of the time execute .Fa code with RETURN_VALUE set to 22. .It Sy sysctl debug.fail_point.foobar="5*return(5)->0.1%return(22)" @@ -186,9 +184,8 @@ Return 5 for 1 in 1000 executions, but o .It Sy sysctl debug.fail_point.foobar="1%*sleep(50)" 1/100th of the time, sleep 50ms. .El -.Pp .Sh CAVEATS -It's easy to shoot yourself in the foot by setting fail points too +It is easy to shoot yourself in the foot by setting fail points too aggressively or setting too many in combination. For example, forcing .Fn malloc @@ -201,7 +198,6 @@ Currently, .Fn fail_point_eval does not verify whether the context is appropriate for calling .Fn msleep . -.Pp .Sh AUTHORS .An -nosplit This manual page was written by From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 14:12:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D57681065670; Fri, 18 Sep 2009 14:12:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C22AA8FC27; Fri, 18 Sep 2009 14:12:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IECe11093025; Fri, 18 Sep 2009 14:12:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IECecw093023; Fri, 18 Sep 2009 14:12:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909181412.n8IECecw093023@svn.freebsd.org> From: Andriy Gapon Date: Fri, 18 Sep 2009 14:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197311 - in stable/7/sys: . contrib/pf dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:12:40 -0000 Author: avg Date: Fri Sep 18 14:12:40 2009 New Revision: 197311 URL: http://svn.freebsd.org/changeset/base/197311 Log: MFC r197099: pci(4): don't perform maximum register number check Different sub-kinds of PCI buses may have different rules and thus it is up for the bus backends to do proper input checks. For example, PCIe allows configuration register numbers < 0x1000, while for PCI proper the limit is 0x100. And, in fact, the buses already do the checks. Reviewed by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pci_user.c Modified: stable/7/sys/dev/pci/pci_user.c ============================================================================== --- stable/7/sys/dev/pci/pci_user.c Fri Sep 18 14:05:56 2009 (r197310) +++ stable/7/sys/dev/pci/pci_user.c Fri Sep 18 14:12:40 2009 (r197311) @@ -605,9 +605,8 @@ getconfexit: case 4: case 2: case 1: - /* Make sure register is in bounds and aligned. */ + /* Make sure register is not negative and aligned. */ if (io->pi_reg < 0 || - io->pi_reg + io->pi_width > PCI_REGMAX + 1 || io->pi_reg & (io->pi_width - 1)) { error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 14:17:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D190F1065697; Fri, 18 Sep 2009 14:17:00 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEE088FC1F; Fri, 18 Sep 2009 14:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IEH09N093201; Fri, 18 Sep 2009 14:17:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IEH0nJ093198; Fri, 18 Sep 2009 14:17:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200909181417.n8IEH0nJ093198@svn.freebsd.org> From: Christian Brueffer Date: Fri, 18 Sep 2009 14:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197312 - in head: lib/libc/sys sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:17:00 -0000 Author: brueffer Date: Fri Sep 18 14:17:00 2009 New Revision: 197312 URL: http://svn.freebsd.org/changeset/base/197312 Log: Fix setfib(1) section number. PR: 133765 Submitted by: Konstantin Zolotukhin MFC after: 3 days Modified: head/lib/libc/sys/setfib.2 head/sbin/ipfw/ipfw.8 Modified: head/lib/libc/sys/setfib.2 ============================================================================== --- head/lib/libc/sys/setfib.2 Fri Sep 18 14:12:40 2009 (r197311) +++ head/lib/libc/sys/setfib.2 Fri Sep 18 14:17:00 2009 (r197312) @@ -67,8 +67,8 @@ if the .Fa fib argument is greater than the current system maximum. .Sh SEE ALSO -.Xr setsockopt 2 , -.Xr setfib 8 +.Xr setfib 1 , +.Xr setsockopt 2 .Sh STANDARDS The .Fn setfib Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Sep 18 14:12:40 2009 (r197311) +++ head/sbin/ipfw/ipfw.8 Fri Sep 18 14:17:00 2009 (r197312) @@ -869,7 +869,7 @@ The packet is tagged so as to use the FI .Ar fibnum in any subsequent forwarding decisions. Initially this is limited to the values 0 through 15, see -.Xr setfib 8 . +.Xr setfib 1 . Processing continues at the next rule. .It Cm reass Queue and reassemble ip fragments. From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 14:42:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0391065693; Fri, 18 Sep 2009 14:42:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 335F98FC12; Fri, 18 Sep 2009 14:42:10 +0000 (UTC) Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n8IEg8FB003742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Sep 2009 00:42:09 +1000 Date: Sat, 19 Sep 2009 00:42:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Roman Divacky In-Reply-To: <200909171748.n8HHmDAJ065382@svn.freebsd.org> Message-ID: <20090919002807.R9375@delplex.bde.org> References: <200909171748.n8HHmDAJ065382@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197294 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:42:11 -0000 On Thu, 17 Sep 2009, Roman Divacky wrote: > Log: > Fix the style of the previous commit. This fixes half of the new style bugs on the changed lines only. > Modified: head/sys/kern/kern_event.c > ============================================================================== > --- head/sys/kern/kern_event.c Thu Sep 17 17:41:28 2009 (r197293) > +++ head/sys/kern/kern_event.c Thu Sep 17 17:48:13 2009 (r197294) > @@ -145,7 +145,8 @@ static int filt_timer(struct knote *kn, > static int filt_userattach(struct knote *kn); > static void filt_userdetach(struct knote *kn); > static int filt_user(struct knote *kn, long hint); > -static void filt_usertouch(struct knote *kn, struct kevent *kev, unsigned long type); > +static void filt_usertouch(struct knote *kn, struct kevent *kev, > + unsigned long type); "unsigned foo" is spelled "u_foo" in KNF. kern/kern_event.c followed this rule in all cases until recently. Following this rule often (but not here) keeps line lengths below 80 characters. > Modified: head/sys/sys/event.h > ============================================================================== > --- head/sys/sys/event.h Thu Sep 17 17:41:28 2009 (r197293) > +++ head/sys/sys/event.h Thu Sep 17 17:48:13 2009 (r197294) > @@ -191,7 +191,8 @@ struct filterops { > int (*f_attach)(struct knote *kn); > void (*f_detach)(struct knote *kn); > int (*f_event)(struct knote *kn, long hint); > - void (*f_touch)(struct knote *kn, struct kevent *kev, unsigned long type); > + void (*f_touch)(struct knote *kn, struct kevent *kev, > + unsigned long type); void (*f_touch)(struct knote *kn, struct kevent *kev, u_long type); sys/event.h also followed the rule in all cases until now. Here, following the rule avoids the ugly split line. Elsewhere, in recent changes the rule is no longer followed for an unsigned int. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 14:53:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F28771065695; Fri, 18 Sep 2009 14:53:01 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE78A8FC0A; Fri, 18 Sep 2009 14:53:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IEr1L2093866; Fri, 18 Sep 2009 14:53:01 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IEr1xJ093865; Fri, 18 Sep 2009 14:53:01 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200909181453.n8IEr1xJ093865@svn.freebsd.org> From: Ken Smith Date: Fri, 18 Sep 2009 14:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197313 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:53:02 -0000 Author: kensmith Date: Fri Sep 18 14:53:01 2009 New Revision: 197313 URL: http://svn.freebsd.org/changeset/base/197313 Log: Have sparc64 join the separate livefs crowd. Including the docs packages on disc1 (needed now by sysinstall) overflows the target CDROM iso size. MFC after: 3 days Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Fri Sep 18 14:17:00 2009 (r197312) +++ head/release/Makefile Fri Sep 18 14:53:01 2009 (r197313) @@ -242,6 +242,7 @@ MFSSIZE= 4096 MFSINODE= 8192 MFSLABEL= auto MINIROOT= +SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "ia64" DISKLABEL= "" MAKE_DVD= From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 14:59:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54791106566C; Fri, 18 Sep 2009 14:59:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9DF328FC19; Fri, 18 Sep 2009 14:59:34 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAE89s0qDaFvK/2dsb2JhbADPV4QcBQ X-IronPort-AV: E=Sophos;i="4.44,410,1249272000"; d="scan'208";a="48505032" Received: from fraser.cs.uoguelph.ca ([131.104.91.202]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 18 Sep 2009 10:59:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by fraser.cs.uoguelph.ca (Postfix) with ESMTP id A15DF109C2BD; Fri, 18 Sep 2009 10:59:33 -0400 (EDT) X-Virus-Scanned: amavisd-new at fraser.cs.uoguelph.ca Received: from fraser.cs.uoguelph.ca ([127.0.0.1]) by localhost (fraser.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iCQqmaJkkLea; Fri, 18 Sep 2009 10:59:33 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by fraser.cs.uoguelph.ca (Postfix) with ESMTP id 048C4109C263; Fri, 18 Sep 2009 10:59:33 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8IF54126032; Fri, 18 Sep 2009 11:05:04 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Fri, 18 Sep 2009 11:05:04 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: John Baldwin In-Reply-To: <4AB35086.90502@FreeBSD.org> Message-ID: References: <200909171908.n8HJ8GQs067202@svn.freebsd.org> <4AB35086.90502@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:59:35 -0000 On Fri, 18 Sep 2009, John Baldwin wrote: > Rick Macklem wrote: >> Author: rmacklem >> Date: Thu Sep 17 19:08:15 2009 >> New Revision: 197298 >> URL: http://svn.freebsd.org/changeset/base/197298 >> >> Log: >> Change the default transport protocol for use by the Mount protocol >> from UDP to TCP, so that it is consistent with TCP for NFS, which >> became the default at r176198. Without this change, doing an NFS mount >> against a server that only supports UDP would result in an unusable >> mount point if a transport protocol option wasn't specified for the >> mount. >> Approved by: kib (mentor) >> MFC after: 3 days > > Does this still use UDP for the mount protocol for a UDP mount? > Yep. If "udp" is specified, everything uses "udp". The only case affected by the change was when neither "udp" nor "tcp" were specified as options. It happens that it still uses UDP for Portmapper by default and when "tcp" is specified, but that is down inside the libc functions and there are comments in them along the lines of "always use UDP first...", so I don't intend to change those. rick From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 15:07:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 3D7231065679; Fri, 18 Sep 2009 15:07:30 +0000 (UTC) Date: Fri, 18 Sep 2009 15:07:30 +0000 From: Alexey Dokuchaev To: Ken Smith Message-ID: <20090918150730.GA18347@FreeBSD.org> References: <200909181453.n8IEr1xJ093865@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200909181453.n8IEr1xJ093865@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197313 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 15:07:30 -0000 On Fri, Sep 18, 2009 at 02:53:01PM +0000, Ken Smith wrote: > Author: kensmith > Date: Fri Sep 18 14:53:01 2009 > New Revision: 197313 > URL: http://svn.freebsd.org/changeset/base/197313 > > Log: > Have sparc64 join the separate livefs crowd. Including the docs packages > on disc1 (needed now by sysinstall) overflows the target CDROM iso size. I've always been wondering how could docs be more important than livefs? I'd rather have -docs iso (which I won't ever download anyways) than -livefs one (which is needed far more often, e.g. to fix botched or corrupted installation) in addition to disc1. ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 15:12:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC4B106568D; Fri, 18 Sep 2009 15:12:32 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19BC48FC0A; Fri, 18 Sep 2009 15:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IFCWx2094283; Fri, 18 Sep 2009 15:12:32 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IFCW2t094281; Fri, 18 Sep 2009 15:12:32 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200909181512.n8IFCW2t094281@svn.freebsd.org> From: Bruce M Simpson Date: Fri, 18 Sep 2009 15:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197314 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 15:12:32 -0000 Author: bms Date: Fri Sep 18 15:12:31 2009 New Revision: 197314 URL: http://svn.freebsd.org/changeset/base/197314 Log: Return ENOBUFS consistently if user attempts to exceed in_mcast_maxsocksrc resource limit. Submitted by: syrinx MFC after: 3 days Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Fri Sep 18 14:53:01 2009 (r197313) +++ head/sys/netinet/in_mcast.c Fri Sep 18 15:12:31 2009 (r197314) @@ -2427,8 +2427,10 @@ inp_set_source_filters(struct inpcb *inp if (error) return (error); - if (msfr.msfr_nsrcs > in_mcast_maxsocksrc || - (msfr.msfr_fmode != MCAST_EXCLUDE && + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + return (ENOBUFS); + + if ((msfr.msfr_fmode != MCAST_EXCLUDE && msfr.msfr_fmode != MCAST_INCLUDE)) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 15:29:36 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A481065670; Fri, 18 Sep 2009 15:29:36 +0000 (UTC) (envelope-from kensmith@cse.buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 52DC18FC17; Fri, 18 Sep 2009 15:29:36 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id C296D644; Fri, 18 Sep 2009 11:12:31 -0400 (EDT) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 164A5469; Fri, 18 Sep 2009 11:12:31 -0400 (EDT) Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 0C7A76F1; Fri, 18 Sep 2009 11:12:31 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id E75935B0016; Fri, 18 Sep 2009 11:12:30 -0400 (EDT) From: Ken Smith To: Alexey Dokuchaev In-Reply-To: <20090918150730.GA18347@FreeBSD.org> References: <200909181453.n8IEr1xJ093865@svn.freebsd.org> <20090918150730.GA18347@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-xTe9v65wJ+MAJVEwPTtW" Organization: U. Buffalo CSE Department Date: Fri, 18 Sep 2009 11:12:30 -0400 Message-Id: <1253286750.18414.5.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Ken Smith Subject: Re: svn commit: r197313 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 15:29:36 -0000 --=-xTe9v65wJ+MAJVEwPTtW Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2009-09-18 at 15:07 +0000, Alexey Dokuchaev wrote: > On Fri, Sep 18, 2009 at 02:53:01PM +0000, Ken Smith wrote: > > Author: kensmith > > Date: Fri Sep 18 14:53:01 2009 > > New Revision: 197313 > > URL: http://svn.freebsd.org/changeset/base/197313 > >=20 > > Log: > > Have sparc64 join the separate livefs crowd. Including the docs pack= ages > > on disc1 (needed now by sysinstall) overflows the target CDROM iso si= ze. >=20 > I've always been wondering how could docs be more important than livefs? > I'd rather have -docs iso (which I won't ever download anyways) than > -livefs one (which is needed far more often, e.g. to fix botched or > corrupted installation) in addition to disc1. >=20 > ./danfe Bottom line on this one is that what's better for novice users is winning out over what's better for more advanced users. Having sysinstall do its thing with minimal effort (have everything it *needs* available on the same disc) gives us less of a black eye when novices try it, the folks who barely know what they're doing but write reviews for magazines/blogs/etc try it, etc... --=20 Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-xTe9v65wJ+MAJVEwPTtW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkqzo14ACgkQ/G14VSmup/b0fgCgmU8BIWbcuXHqe85vhvBjML9r k7cAn0ruZj1FC1g2uFzPlFx4AsALMM/X =G+Wz -----END PGP SIGNATURE----- --=-xTe9v65wJ+MAJVEwPTtW-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 15:31:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86B6F106566C; Fri, 18 Sep 2009 15:31:27 +0000 (UTC) (envelope-from kensmith@cse.buffalo.edu) Received: from localmailD.acsu.buffalo.edu (localmailD.acsu.buffalo.edu [128.205.5.208]) by mx1.freebsd.org (Postfix) with ESMTP id 51BA28FC08; Fri, 18 Sep 2009 15:31:27 +0000 (UTC) Received: from localmailD.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 39968C1808; Fri, 18 Sep 2009 11:15:45 -0400 (EDT) Received: from localmailD.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailD.acsu.buffalo.edu (Postfix) with ESMTP id 93A77E4F6; Fri, 18 Sep 2009 11:15:44 -0400 (EDT) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailD.acsu.buffalo.edu (Prefixe) with ESMTP id 8A3D0C1808; Fri, 18 Sep 2009 11:15:44 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id 6E8D0207C0; Fri, 18 Sep 2009 11:15:44 -0400 (EDT) From: Ken Smith To: Alexey Dokuchaev In-Reply-To: <20090918150730.GA18347@FreeBSD.org> References: <200909181453.n8IEr1xJ093865@svn.freebsd.org> <20090918150730.GA18347@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-l9V1gu2tR7qUD3jdT/LG" Organization: U. Buffalo CSE Department Date: Fri, 18 Sep 2009 11:15:44 -0400 Message-Id: <1253286944.18414.7.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Ken Smith Subject: Re: svn commit: r197313 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 15:31:27 -0000 --=-l9V1gu2tR7qUD3jdT/LG Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2009-09-18 at 15:07 +0000, Alexey Dokuchaev wrote: > I've always been wondering how could docs be more important than livefs? > I'd rather have -docs iso (which I won't ever download anyways) than > -livefs one (which is needed far more often, e.g. to fix botched or > corrupted installation) in addition to disc1. [ Sorry, a bit distracted testing RC1 stuff right now so I forgot to add to the first reply ... ] I also tested dropping SEPARATE_LIVEFS from both amd64 and i386 earlier in the release cycle just to see if that was even an option and it was not. Without SEPARATE_LIVEFS the disc1 iso image overflowed our target size even with no packages on it. --=20 Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-l9V1gu2tR7qUD3jdT/LG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkqzpCAACgkQ/G14VSmup/ZlLQCeNIlTqkEe/cgJbEX8oeXdsaff PAAAoIXMSTqJx0+dtctvbEXzu4CPhwk+ =FLpC -----END PGP SIGNATURE----- --=-l9V1gu2tR7qUD3jdT/LG-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 15:39:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E452E10656AB; Fri, 18 Sep 2009 15:39:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2EA18FC0C; Fri, 18 Sep 2009 15:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IFd9Zd094893; Fri, 18 Sep 2009 15:39:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IFd9Sl094891; Fri, 18 Sep 2009 15:39:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909181539.n8IFd9Sl094891@svn.freebsd.org> From: Ed Schouten Date: Fri, 18 Sep 2009 15:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197315 - head/sys/dev/syscons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 15:39:10 -0000 Author: ed Date: Fri Sep 18 15:39:09 2009 New Revision: 197315 URL: http://svn.freebsd.org/changeset/base/197315 Log: Just use ttydisc_rint_simple() instead of doing it ourselves. This code seems to do exactly the same as ttydisc_rint_simple() does nowadays. Just remove it. Obtained from: //depot/user/ed/newcons/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Sep 18 15:12:31 2009 (r197314) +++ head/sys/dev/syscons/syscons.c Fri Sep 18 15:39:09 2009 (r197315) @@ -634,14 +634,8 @@ sckbdevent(keyboard_t *thiskbd, int even break; case FKEY: /* function key, return string */ cp = kbdd_get_fkeystr(thiskbd, KEYCHAR(c), &len); - if (cp != NULL) { - if (ttydisc_can_bypass(cur_tty)) { - ttydisc_rint_bypass(cur_tty, cp, len); - } else { - while (len-- > 0) - ttydisc_rint(cur_tty, *cp++, 0); - } - } + if (cp != NULL) + ttydisc_rint_simple(cur_tty, cp, len); break; case MKEY: /* meta is active, prepend ESC */ ttydisc_rint(cur_tty, 0x1b, 0); From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 16:47:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D0D106568D for ; Fri, 18 Sep 2009 16:47:55 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outJ.internet-mail-service.net (outj.internet-mail-service.net [216.240.47.233]) by mx1.freebsd.org (Postfix) with ESMTP id 219098FC27 for ; Fri, 18 Sep 2009 16:47:54 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B10E7C482; Fri, 18 Sep 2009 09:47:54 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id B4C7B2D601F; Fri, 18 Sep 2009 09:47:52 -0700 (PDT) Message-ID: <4AB3B9B8.4060600@elischer.org> Date: Fri, 18 Sep 2009 09:47:52 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200909171452.n8HEqFfs061011@svn.freebsd.org> <20090917151723.GB2197@garage.freebsd.pl> <20090918005831.B68375@maildrop.int.zabbadoz.net> <20090918121233.GB3650@garage.freebsd.pl> In-Reply-To: <20090918121233.GB3650@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Marko Zec , src-committers@freebsd.org Subject: Re: svn commit: r197286 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 16:47:55 -0000 Pawel Jakub Dawidek wrote: > On Fri, Sep 18, 2009 at 12:59:49AM +0000, Bjoern A. Zeeb wrote: >> On Thu, 17 Sep 2009, Pawel Jakub Dawidek wrote: >> >>> On Thu, Sep 17, 2009 at 02:52:15PM +0000, Marko Zec wrote: >>>> Author: zec >>>> Date: Thu Sep 17 14:52:15 2009 >>>> New Revision: 197286 >>>> URL: http://svn.freebsd.org/changeset/base/197286 >>>> >>>> Log: >>>> V_irtualize the lltables list, making ARP and ND reasonably >>>> usable again with options VIMAGE kernels. >>>> >>>> Submitted by: bz (the original version, probably identical to this >>>> one) >> Uncommitted for the reason to not interfere with bugfixing for 8.0-R. >> >>>> Reviewed by: many @ DevSummit Cambridge >>>> MFC after: 3 days >>> [...] >>>> +static void >>>> +vnet_lltable_init() >>>> +{ >>>> + >>>> + SLIST_INIT(&V_lltables); >>>> +} >>>> +VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, >>>> vnet_lltable_init, NULL); >> ANy I didn'thave this style bug;) >> >>> There is nothing we want to do when vnet is going away? >> No things will clear itself up via other ways as the interfaces will >> go away the table will empty itself, etc > > So I guess it won't hurt to assert on uninit that the list is really > empty?:) > not a bad idea.. is there already an UNINIT? it may be the only user. From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 17:04:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF731106566B; Fri, 18 Sep 2009 17:04:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CE968FC16; Fri, 18 Sep 2009 17:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IH4w9C096621; Fri, 18 Sep 2009 17:04:58 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IH4wUs096610; Fri, 18 Sep 2009 17:04:58 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909181704.n8IH4wUs096610@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Sep 2009 17:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197316 - in head/sys: amd64/include arm/include i386/include ia64/include kern mips/include powerpc/include sparc64/include sun4v/include sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 17:04:59 -0000 Author: alc Date: Fri Sep 18 17:04:57 2009 New Revision: 197316 URL: http://svn.freebsd.org/changeset/base/197316 Log: Add a new sysctl for reporting all of the supported page sizes. Reviewed by: jhb MFC after: 3 weeks Modified: head/sys/amd64/include/param.h head/sys/arm/include/param.h head/sys/i386/include/param.h head/sys/ia64/include/param.h head/sys/kern/kern_mib.c head/sys/mips/include/param.h head/sys/powerpc/include/param.h head/sys/sparc64/include/param.h head/sys/sun4v/include/param.h head/sys/sys/systm.h Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Fri Sep 18 15:39:09 2009 (r197315) +++ head/sys/amd64/include/param.h Fri Sep 18 17:04:57 2009 (r197316) @@ -108,6 +108,8 @@ #define NBPML4 (1ul<flags & SCTL_MASK32) { + /* + * Recreate the "pagesizes" array with 32-bit elements. Truncate + * any page size greater than UINT32_MAX to zero. + */ + for (i = 0; i < MAXPAGESIZES; i++) + pagesizes32[i] = (uint32_t)pagesizes[i]; + + error = SYSCTL_OUT(req, pagesizes32, sizeof(pagesizes32)); + } else +#endif + error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); + return (error); +} +SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD, + NULL, 0, sysctl_hw_pagesizes, "LU", "Supported page sizes"); + static char machine_arch[] = MACHINE_ARCH; SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD, machine_arch, 0, "System architecture"); Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Fri Sep 18 15:39:09 2009 (r197315) +++ head/sys/mips/include/param.h Fri Sep 18 17:04:57 2009 (r197316) @@ -115,6 +115,8 @@ #define SEGOFSET (NBSEG-1) /* byte offset into segment */ #define SEGSHIFT 22 /* LOG2(NBSEG) */ +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + /* XXXimp: This has moved to vmparam.h */ /* Also, this differs from the mips2 definition, but likely is better */ /* since this means the kernel won't chew up TLBs when it is executing */ Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Fri Sep 18 15:39:09 2009 (r197315) +++ head/sys/powerpc/include/param.h Fri Sep 18 17:04:57 2009 (r197316) @@ -86,6 +86,8 @@ #define PAGE_MASK (PAGE_SIZE - 1) #define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* includes pcb */ #endif Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Fri Sep 18 15:39:09 2009 (r197315) +++ head/sys/sparc64/include/param.h Fri Sep 18 17:04:57 2009 (r197316) @@ -109,6 +109,8 @@ #define PAGE_SIZE_MAX PAGE_SIZE_4M #define PAGE_MASK_MAX PAGE_MASK_4M +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */ #endif Modified: head/sys/sun4v/include/param.h ============================================================================== --- head/sys/sun4v/include/param.h Fri Sep 18 15:39:09 2009 (r197315) +++ head/sys/sun4v/include/param.h Fri Sep 18 17:04:57 2009 (r197316) @@ -104,6 +104,8 @@ #define PAGE_SIZE_MAX PAGE_SIZE_4M #define PAGE_MASK_MAX PAGE_MASK_4M +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */ #endif Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Sep 18 15:39:09 2009 (r197315) +++ head/sys/sys/systm.h Fri Sep 18 17:04:57 2009 (r197316) @@ -54,6 +54,7 @@ extern int kstack_pages; /* number of ke extern int nswap; /* size of swap space */ +extern u_long pagesizes[]; /* supported page sizes */ extern long physmem; /* physical memory */ extern long realmem; /* 'real' memory */ From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 17:09:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AB4106566C; Fri, 18 Sep 2009 17:09:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 347D48FC0A; Fri, 18 Sep 2009 17:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IH9YS1096738; Fri, 18 Sep 2009 17:09:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IH9YLu096735; Fri, 18 Sep 2009 17:09:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909181709.n8IH9YLu096735@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Sep 2009 17:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197317 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 17:09:34 -0000 Author: alc Date: Fri Sep 18 17:09:33 2009 New Revision: 197317 URL: http://svn.freebsd.org/changeset/base/197317 Log: When superpages are enabled, add the 2 or 4MB page size to the array of supported page sizes. Reviewed by: jhb MFC after: 3 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Sep 18 17:04:57 2009 (r197316) +++ head/sys/amd64/amd64/pmap.c Fri Sep 18 17:09:33 2009 (r197317) @@ -701,6 +701,11 @@ pmap_init(void) * Are large page mappings enabled? */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); + if (pg_ps_enabled) { + KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0, + ("pmap_init: can't assign to pagesizes[1]")); + pagesizes[1] = NBPDR; + } /* * Calculate the size of the pv head table for superpages. Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Sep 18 17:04:57 2009 (r197316) +++ head/sys/i386/i386/pmap.c Fri Sep 18 17:09:33 2009 (r197317) @@ -702,6 +702,11 @@ pmap_init(void) * Are large page mappings enabled? */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); + if (pg_ps_enabled) { + KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0, + ("pmap_init: can't assign to pagesizes[1]")); + pagesizes[1] = NBPDR; + } /* * Calculate the size of the pv head table for superpages. From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 20:35:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE5E106566B; Fri, 18 Sep 2009 20:35:05 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9638FC0A; Fri, 18 Sep 2009 20:35:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IKZ5ux000628; Fri, 18 Sep 2009 20:35:05 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IKZ523000626; Fri, 18 Sep 2009 20:35:05 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <200909182035.n8IKZ523000626@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 18 Sep 2009 20:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197318 - in stable/8/sys: . amd64/include/xen cam cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 20:35:05 -0000 Author: ken Date: Fri Sep 18 20:35:05 2009 New Revision: 197318 URL: http://svn.freebsd.org/changeset/base/197318 Log: Merge change r197208 from head to stable/8: Fix some instances where CAM rescans get hung up or take a long time to complete. Also, allow xpt_rescan() to rescan a LUN instead of a full bus. Sponsored by: Copan Systems, Inc. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/cam_xpt.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Fri Sep 18 17:09:33 2009 (r197317) +++ stable/8/sys/cam/cam_xpt.c Fri Sep 18 20:35:05 2009 (r197318) @@ -794,8 +794,9 @@ xpt_scanner_thread(void *dummy) * processed. */ xpt_lock_buses(); - msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, - "ccb_scanq", 0); + if (TAILQ_EMPTY(&xsoftc.ccb_scanq)) + msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, + "ccb_scanq", 0); TAILQ_INIT(&queue); TAILQ_CONCAT(&queue, &xsoftc.ccb_scanq, sim_links.tqe); xpt_unlock_buses(); @@ -806,9 +807,12 @@ xpt_scanner_thread(void *dummy) sim = ccb->ccb_h.path->bus->sim; CAM_SIM_LOCK(sim); - ccb->ccb_h.func_code = XPT_SCAN_BUS; + if( ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD ) + ccb->ccb_h.func_code = XPT_SCAN_BUS; + else + ccb->ccb_h.func_code = XPT_SCAN_LUN; ccb->ccb_h.cbfcnp = xptdone; - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 5); + xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 1); cam_periph_runccb(ccb, NULL, 0, 0, NULL); xpt_free_path(ccb->ccb_h.path); xpt_free_ccb(ccb); @@ -828,6 +832,7 @@ xpt_rescan(union ccb *ccb) xpt_lock_buses(); TAILQ_FOREACH(hdr, &xsoftc.ccb_scanq, sim_links.tqe) { if (xpt_path_comp(hdr->path, ccb->ccb_h.path) == 0) { + wakeup(&xsoftc.ccb_scanq); xpt_unlock_buses(); xpt_print(ccb->ccb_h.path, "rescan already queued\n"); xpt_free_path(ccb->ccb_h.path); From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 01:48:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA79106566B; Sat, 19 Sep 2009 01:48:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28B028FC18; Sat, 19 Sep 2009 01:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8J1mD1J006295; Sat, 19 Sep 2009 01:48:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8J1mDNm006293; Sat, 19 Sep 2009 01:48:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200909190148.n8J1mDNm006293@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 19 Sep 2009 01:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197320 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci powerpc/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 01:48:13 -0000 Author: nwhitehorn Date: Sat Sep 19 01:48:12 2009 New Revision: 197320 URL: http://svn.freebsd.org/changeset/base/197320 Log: MFC r196993 Remove some debugging (KTR_VERBOSE) that crept into ppc GENERIC long ago and is present on no other architectures by default. Reviewed by: grehan Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/powerpc/conf/GENERIC Modified: stable/8/sys/powerpc/conf/GENERIC ============================================================================== --- stable/8/sys/powerpc/conf/GENERIC Fri Sep 18 21:39:59 2009 (r197319) +++ stable/8/sys/powerpc/conf/GENERIC Sat Sep 19 01:48:12 2009 (r197320) @@ -162,7 +162,3 @@ device pmu device iicbus # I2C bus code device kiic # Keywest I2C -options KTR -options KTR_COMPILE=0xffffffff -#options KTR_MASK=KTR_SIG -options KTR_VERBOSE From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 01:49:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47E09106566C; Sat, 19 Sep 2009 01:49:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 341DC8FC1E; Sat, 19 Sep 2009 01:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8J1nbeY006369; Sat, 19 Sep 2009 01:49:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8J1nbLQ006367; Sat, 19 Sep 2009 01:49:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200909190149.n8J1nbLQ006367@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 19 Sep 2009 01:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197321 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci powerpc/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 01:49:37 -0000 Author: nwhitehorn Date: Sat Sep 19 01:49:36 2009 New Revision: 197321 URL: http://svn.freebsd.org/changeset/base/197321 Log: MFC r197080 Add a few SCSI controllers to GENERIC that can be found in Powermacs. This allows installation onto SCSI disks as shipped, for example, as an option with the Powermac G3. PR: powerpc/138543 Reviewed by: grehan Approved by: re (kib) Obtained from: sparc64 Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/powerpc/conf/GENERIC Modified: stable/8/sys/powerpc/conf/GENERIC ============================================================================== --- stable/8/sys/powerpc/conf/GENERIC Sat Sep 19 01:48:12 2009 (r197320) +++ stable/8/sys/powerpc/conf/GENERIC Sat Sep 19 01:49:36 2009 (r197321) @@ -83,6 +83,16 @@ device atapicd # ATAPI CDROM drives #device atapifd # ATAPI floppy drives #device atapist # ATAPI tape drives +# SCSI Controllers +device ahc # AHA2940 and onboard AIC7xxx devices +options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O +options AHC_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~128k to driver. +device isp # Qlogic family +device ispfw # Firmware module for Qlogic host adapters +device mpt # LSI-Logic MPT-Fusion +device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D + # SCSI peripherals device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) @@ -119,6 +129,7 @@ device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying/(translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 03:33:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B33A106566B; Sat, 19 Sep 2009 03:33:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8788FC17; Sat, 19 Sep 2009 03:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8J3XI0o008488; Sat, 19 Sep 2009 03:33:18 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8J3XIGg008486; Sat, 19 Sep 2009 03:33:18 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909190333.n8J3XIGg008486@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Sep 2009 03:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197322 - head/lib/libdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 03:33:18 -0000 Author: nyan Date: Sat Sep 19 03:33:18 2009 New Revision: 197322 URL: http://svn.freebsd.org/changeset/base/197322 Log: Correct BIOS header sanitizing on pc98. MFC after: 3 days Modified: head/lib/libdisk/change.c Modified: head/lib/libdisk/change.c ============================================================================== --- head/lib/libdisk/change.c Sat Sep 19 01:49:36 2009 (r197321) +++ head/lib/libdisk/change.c Sat Sep 19 03:33:18 2009 (r197322) @@ -36,14 +36,17 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_cyl >= 65536) sane = 0; - if (disk->bios_hd > 256) - sane = 0; #ifdef PC98 + if (disk->bios_hd >= 256) + sane = 0; if (disk->bios_sect >= 256) + sane = 0; #else + if (disk->bios_hd > 256) + sane = 0; if (disk->bios_sect > 63) -#endif sane = 0; +#endif if (disk->bios_cyl * disk->bios_hd * disk->bios_sect != disk->chunks->size) sane = 0; From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 04:36:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E418106568D; Sat, 19 Sep 2009 04:36:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1C8B8FC0C; Sat, 19 Sep 2009 04:36:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8J4acwY013782; Sat, 19 Sep 2009 04:36:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8J4ac8b013780; Sat, 19 Sep 2009 04:36:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909190436.n8J4ac8b013780@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 19 Sep 2009 04:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197323 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 04:36:39 -0000 Author: jkim Date: Sat Sep 19 04:36:38 2009 New Revision: 197323 URL: http://svn.freebsd.org/changeset/base/197323 Log: Change cache attribute for VESA frame buffer from UC to write-combining. This improves scrolling speed for high resolution graphics mode console. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Sat Sep 19 03:33:18 2009 (r197322) +++ head/sys/dev/fb/vesa.c Sat Sep 19 04:36:38 2009 (r197323) @@ -870,7 +870,8 @@ vesa_map_buffer(u_int paddr, size_t size u_int off; off = paddr - trunc_page(paddr); - vaddr = (vm_offset_t)pmap_mapdev(paddr - off, size + off); + vaddr = (vm_offset_t)pmap_mapdev_attr(paddr - off, size + off, + PAT_WRITE_COMBINING); #if VESA_DEBUG > 1 printf("vesa_map_buffer: paddr:%x vaddr:%tx size:%zx off:%x\n", paddr, vaddr, size, off); From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 08:10:02 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03282106566B; Sat, 19 Sep 2009 08:10:01 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 95E368FC14; Sat, 19 Sep 2009 08:10:01 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 7652F5C025; Sat, 19 Sep 2009 16:10:00 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 4789455CD6CA; Sat, 19 Sep 2009 16:10:00 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id u0xJsB3K39gM; Sat, 19 Sep 2009 16:09:55 +0800 (CST) Received: from charlie.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id C5E5855CD6C6; Sat, 19 Sep 2009 16:09:53 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=MU0VVz7bCxbNklC7hamN1TsCKg2IFWTQ9n8IR61y3h8MWdxGjMmpdEZI4Vi2YNxBL 8TzpiFYPuDyQkEbq9gheA== Message-ID: <4AB491CD.1090705@delphij.net> Date: Sat, 19 Sep 2009 01:09:49 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Jung-uk Kim References: <200909190436.n8J4ac8b013780@svn.freebsd.org> In-Reply-To: <200909190436.n8J4ac8b013780@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r197323 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 08:10:02 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jung-uk Kim wrote: > Author: jkim > Date: Sat Sep 19 04:36:38 2009 > New Revision: 197323 > URL: http://svn.freebsd.org/changeset/base/197323 > > Log: > Change cache attribute for VESA frame buffer from UC to write-combining. > This improves scrolling speed for high resolution graphics mode console. Cool! Thanks! Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkq0kc0ACgkQi+vbBBjt66DYqQCgjMdM4fkXpMHun+ok6b71mRs3 40kAnRI2TEw8tT/KjH4+8o0aFnBsZ1Fu =Avbw -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 08:13:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5632B1065672; Sat, 19 Sep 2009 08:13:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42EC28FC15; Sat, 19 Sep 2009 08:13:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8J8DAHg017723; Sat, 19 Sep 2009 08:13:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8J8DAmE017722; Sat, 19 Sep 2009 08:13:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909190813.n8J8DAmE017722@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Sep 2009 08:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197324 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/pci dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 08:13:11 -0000 Author: avg Date: Sat Sep 19 08:13:10 2009 New Revision: 197324 URL: http://svn.freebsd.org/changeset/base/197324 Log: MFC r197099: pci(4): don't perform maximum register number check Different sub-kinds of PCI buses may have different rules and thus it is up for the bus backends to do proper input checks. For example, PCIe allows configuration register numbers < 0x1000, while for PCI proper the limit is 0x100. And, in fact, the buses already do the checks. Reviewed by: jhb Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci_user.c ============================================================================== --- stable/8/sys/dev/pci/pci_user.c Sat Sep 19 04:36:38 2009 (r197323) +++ stable/8/sys/dev/pci/pci_user.c Sat Sep 19 08:13:10 2009 (r197324) @@ -605,9 +605,8 @@ getconfexit: case 4: case 2: case 1: - /* Make sure register is in bounds and aligned. */ + /* Make sure register is not negative and aligned. */ if (io->pi_reg < 0 || - io->pi_reg + io->pi_width > PCI_REGMAX + 1 || io->pi_reg & (io->pi_width - 1)) { error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 08:27:10 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A32FE1065670; Sat, 19 Sep 2009 08:27:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7260F8FC0A; Sat, 19 Sep 2009 08:27:10 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 09AA146B0C; Sat, 19 Sep 2009 04:27:10 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 82F728A01B; Sat, 19 Sep 2009 04:27:07 -0400 (EDT) Message-ID: <4AB495DD.1010006@FreeBSD.org> Date: Sat, 19 Sep 2009 04:27:09 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Rick Macklem References: <200909171908.n8HJ8GQs067202@svn.freebsd.org> <4AB35086.90502@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Sat, 19 Sep 2009 04:27:08 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 08:27:10 -0000 Rick Macklem wrote: > > > On Fri, 18 Sep 2009, John Baldwin wrote: > >> Rick Macklem wrote: >>> Author: rmacklem >>> Date: Thu Sep 17 19:08:15 2009 >>> New Revision: 197298 >>> URL: http://svn.freebsd.org/changeset/base/197298 >>> >>> Log: >>> Change the default transport protocol for use by the Mount protocol >>> from UDP to TCP, so that it is consistent with TCP for NFS, which >>> became the default at r176198. Without this change, doing an NFS mount >>> against a server that only supports UDP would result in an unusable >>> mount point if a transport protocol option wasn't specified for the >>> mount. >>> Approved by: kib (mentor) >>> MFC after: 3 days >> >> Does this still use UDP for the mount protocol for a UDP mount? >> > Yep. If "udp" is specified, everything uses "udp". The only case > affected by the change was when neither "udp" nor "tcp" were specified > as options. Ok. > It happens that it still uses UDP for Portmapper by default and when > "tcp" is specified, but that is down inside the libc functions and there > are comments in them along the lines of "always use UDP first...", so > I don't intend to change those. Hmm, it might actually be nice to be able to change those at some point as well. I have looked at this in the past and it is quite deeply buried in libc. :-/ -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 08:56:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5819106566B; Sat, 19 Sep 2009 08:56:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6C48FC12; Sat, 19 Sep 2009 08:56:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8J8uSqu018571; Sat, 19 Sep 2009 08:56:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8J8uSnf018569; Sat, 19 Sep 2009 08:56:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909190856.n8J8uSnf018569@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Sep 2009 08:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197325 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 08:56:28 -0000 Author: avg Date: Sat Sep 19 08:56:28 2009 New Revision: 197325 URL: http://svn.freebsd.org/changeset/base/197325 Log: intpm/sb700: force polling mode if configured interrupt is SMI instead of failing to attach Modified: head/sys/pci/intpm.c Modified: head/sys/pci/intpm.c ============================================================================== --- head/sys/pci/intpm.c Sat Sep 19 08:13:10 2009 (r197324) +++ head/sys/pci/intpm.c Sat Sep 19 08:56:28 2009 (r197325) @@ -167,6 +167,12 @@ intsmb_attach(device_t dev) sc->poll == 0 ? "enabled" : "disabled"); printf("revision %d\n", pci_read_config(dev, PCI_REVID_SMB, 1)); + if (!sc->poll && intr == PCI_INTR_SMB_SMI) { + device_printf(dev, + "using polling mode when configured interrupt is SMI\n"); + sc->poll = 1; + } + if (sc->poll) goto no_intr; From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 14:02:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90925106566C; Sat, 19 Sep 2009 14:02:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC668FC12; Sat, 19 Sep 2009 14:02:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JE2HpW027184; Sat, 19 Sep 2009 14:02:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JE2HlB027178; Sat, 19 Sep 2009 14:02:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909191402.n8JE2HlB027178@svn.freebsd.org> From: Michael Tuexen Date: Sat, 19 Sep 2009 14:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197326 - in head/sys: kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 14:02:17 -0000 Author: tuexen Date: Sat Sep 19 14:02:16 2009 New Revision: 197326 URL: http://svn.freebsd.org/changeset/base/197326 Log: Get SCTP working in combination with VIMAGE. Contains code from bz. Approved by: rrs (mentor) MFC after: 1 month. Modified: head/sys/kern/uipc_syscalls.c head/sys/netinet/in_proto.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctputil.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/kern/uipc_syscalls.c Sat Sep 19 14:02:16 2009 (r197326) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2316,6 +2317,7 @@ sctp_peeloff(td, uap) goto done; td->td_retval[0] = fd; + CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); if (so == NULL) goto noconnection; @@ -2355,6 +2357,7 @@ noconnection: /* * Release explicitly held references before returning. */ + CURVNET_RESTORE(); done: if (nfp != NULL) fdrop(nfp, td); @@ -2433,9 +2436,11 @@ sctp_generic_sendmsg (td, uap) auio.uio_offset = 0; /* XXX */ auio.uio_resid = 0; len = auio.uio_resid = uap->mlen; + CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, (struct mbuf *)NULL, uap->flags, use_rcvinfo, u_sinfo, td); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -2543,9 +2548,11 @@ sctp_generic_sendmsg_iov(td, uap) } } len = auio.uio_resid; + CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, (struct mbuf *)NULL, uap->flags, use_rcvinfo, u_sinfo, td); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -2665,9 +2672,11 @@ sctp_generic_recvmsg(td, uap) if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif /* KTRACE */ + CURVNET_SET(so->so_vnet); error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL, fromsa, fromlen, &msg_flags, (struct sctp_sndrcvinfo *)&sinfo, 1); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != (int)len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/in_proto.c Sat Sep 19 14:02:16 2009 (r197326) @@ -150,39 +150,42 @@ struct protosw inetsw[] = { }, #ifdef SCTP { - .pr_type = SOCK_DGRAM, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_init = sctp_init, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs -}, -{ - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs + .pr_type = SOCK_DGRAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp_input, + .pr_ctlinput = sctp_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_init = sctp_init, +#ifdef VIMAGE + .pr_destroy = sctp_finish, +#endif + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp_usrreqs +}, +{ + .pr_type = SOCK_SEQPACKET, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp_input, + .pr_ctlinput = sctp_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp_usrreqs }, { - .pr_type = SOCK_STREAM, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs + .pr_type = SOCK_STREAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp_input, + .pr_ctlinput = sctp_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp_usrreqs }, #endif /* SCTP */ { Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/sctp_bsd_addr.c Sat Sep 19 14:02:16 2009 (r197326) @@ -89,6 +89,7 @@ sctp_wakeup_iterator(void) static void sctp_iterator_thread(void *v) { + CURVNET_SET((struct vnet *)v); SCTP_IPI_ITERATOR_WQ_LOCK(); SCTP_BASE_INFO(iterator_running) = 0; while (1) { @@ -100,6 +101,7 @@ sctp_iterator_thread(void *v) } sctp_iterator_worker(); } + CURVNET_RESTORE(); } void @@ -108,7 +110,7 @@ sctp_startup_iterator(void) int ret; ret = kproc_create(sctp_iterator_thread, - (void *)NULL, + (void *)curvnet, &SCTP_BASE_INFO(thread_proc), RFPROC, SCTP_KTHREAD_PAGES, @@ -206,6 +208,9 @@ sctp_init_ifns_for_vrf(int vrfid) struct sctp_ifa *sctp_ifa; uint32_t ifa_flags; +#if 0 + IFNET_RLOCK(); +#endif TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { IF_ADDR_LOCK(ifn); TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) { @@ -251,6 +256,9 @@ sctp_init_ifns_for_vrf(int vrfid) } IF_ADDR_UNLOCK(ifn); } +#if 0 + IFNET_RUNLOCK(); +#endif } void @@ -336,6 +344,9 @@ void struct ifnet *ifn; struct ifaddr *ifa; +#if 0 + IFNET_RLOCK(); +#endif TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { if (!(*pred) (ifn)) { continue; @@ -344,6 +355,9 @@ void sctp_addr_change(ifa, add ? RTM_ADD : RTM_DELETE); } } +#if 0 + IFNET_RUNLOCK(); +#endif } struct mbuf * Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/sctp_os_bsd.h Sat Sep 19 14:02:16 2009 (r197326) @@ -141,13 +141,14 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); * depending on whether VIMAGE is defined. */ /* then define the macro(s) that hook into the vimage macros */ -#define MODULE_GLOBAL(__SYMBOL) V_ ## __SYMBOL +#define MODULE_GLOBAL(__SYMBOL) V_##__SYMBOL -#define V_system_base_info VNET_NAME(system_base_info) +#define V_system_base_info VNET(system_base_info) #define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m #define SCTP_BASE_STATS V_system_base_info.sctpstat +#define SCTP_BASE_STATS_SYSCTL VNET_NAME(system_base_info.sctpstat) #define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m -#define SCTP_BASE_SYSCTL(__m) V_system_base_info.sctpsysctl.__m +#define SCTP_BASE_SYSCTL(__m) VNET_NAME(system_base_info.sctpsysctl.__m) #define SCTP_BASE_VAR(__m) V_system_base_info.__m /* Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/sctp_pcb.c Sat Sep 19 14:02:16 2009 (r197326) @@ -6588,22 +6588,31 @@ sctp_drain() * is LOW on MBUF's and needs help. This is where reneging will * occur. We really hope this does NOT happen! */ - struct sctp_inpcb *inp; - struct sctp_tcb *stcb; - SCTP_INP_INFO_RLOCK(); - LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { - /* For each endpoint */ - SCTP_INP_RLOCK(inp); - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - /* For each association */ - SCTP_TCB_LOCK(stcb); - sctp_drain_mbufs(inp, stcb); - SCTP_TCB_UNLOCK(stcb); + VNET_ITERATOR_DECL(vnet_iter); + + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + struct sctp_inpcb *inp; + struct sctp_tcb *stcb; + + SCTP_INP_INFO_RLOCK(); + LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { + /* For each endpoint */ + SCTP_INP_RLOCK(inp); + LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { + /* For each association */ + SCTP_TCB_LOCK(stcb); + sctp_drain_mbufs(inp, stcb); + SCTP_TCB_UNLOCK(stcb); + } + SCTP_INP_RUNLOCK(inp); } - SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_RUNLOCK(); + CURVNET_RESTORE(); } - SCTP_INP_INFO_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/sctp_structs.h Sat Sep 19 14:02:16 2009 (r197326) @@ -51,6 +51,7 @@ struct sctp_timer { void *ep; void *tcb; void *net; + void *vnet; /* for sanity checking */ void *self; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/sctp_sysctl.c Sat Sep 19 14:02:16 2009 (r197326) @@ -930,7 +930,7 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ou #endif SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, - &SCTP_BASE_STATS, sctpstat, + &SCTP_BASE_STATS_SYSCTL, sctpstat, "SCTP statistics (struct sctp_stat)"); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD, Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Sep 19 08:56:28 2009 (r197325) +++ head/sys/netinet/sctputil.c Sat Sep 19 14:02:16 2009 (r197326) @@ -1446,6 +1446,7 @@ sctp_timeout_handler(void *t) inp = (struct sctp_inpcb *)tmr->ep; stcb = (struct sctp_tcb *)tmr->tcb; net = (struct sctp_nets *)tmr->net; + CURVNET_SET((struct vnet *)tmr->vnet); did_output = 1; #ifdef SCTP_AUDITING_ENABLED @@ -1459,6 +1460,7 @@ sctp_timeout_handler(void *t) * SCTP_PRINTF("Stale SCTP timer fired (%p), ignoring...\n", * tmr); */ + CURVNET_RESTORE(); return; } tmr->stopped_from = 0xa001; @@ -1467,10 +1469,12 @@ sctp_timeout_handler(void *t) * SCTP_PRINTF("SCTP timer fired with invalid type: 0x%x\n", * tmr->type); */ + CURVNET_RESTORE(); return; } tmr->stopped_from = 0xa002; if ((tmr->type != SCTP_TIMER_TYPE_ADDR_WQ) && (inp == NULL)) { + CURVNET_RESTORE(); return; } /* if this is an iterator timeout, get the struct and clear inp */ @@ -1494,6 +1498,7 @@ sctp_timeout_handler(void *t) (tmr->type != SCTP_TIMER_TYPE_ASOCKILL)) ) { SCTP_INP_DECR_REF(inp); + CURVNET_RESTORE(); return; } } @@ -1505,6 +1510,7 @@ sctp_timeout_handler(void *t) if (inp) { SCTP_INP_DECR_REF(inp); } + CURVNET_RESTORE(); return; } } @@ -1517,6 +1523,7 @@ sctp_timeout_handler(void *t) if (stcb) { atomic_add_int(&stcb->asoc.refcnt, -1); } + CURVNET_RESTORE(); return; } tmr->stopped_from = 0xa006; @@ -1531,6 +1538,7 @@ sctp_timeout_handler(void *t) if (inp) { SCTP_INP_DECR_REF(inp); } + CURVNET_RESTORE(); return; } } @@ -1903,6 +1911,7 @@ out_decr: out_no_decr: SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type %d)\n", type); + CURVNET_RESTORE(); } void @@ -2263,6 +2272,7 @@ sctp_timer_start(int t_type, struct sctp tmr->tcb = (void *)stcb; tmr->net = (void *)net; tmr->self = (void *)tmr; + tmr->vnet = (void *)curvnet; tmr->ticks = sctp_get_tick_count(); (void)SCTP_OS_TIMER_START(&tmr->timer, to_ticks, sctp_timeout_handler, tmr); return; From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 14:18:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03073106566C; Sat, 19 Sep 2009 14:18:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E60C88FC13; Sat, 19 Sep 2009 14:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JEIgr9027570; Sat, 19 Sep 2009 14:18:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JEIgNf027568; Sat, 19 Sep 2009 14:18:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909191418.n8JEIgNf027568@svn.freebsd.org> From: Michael Tuexen Date: Sat, 19 Sep 2009 14:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197327 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 14:18:43 -0000 Author: tuexen Date: Sat Sep 19 14:18:42 2009 New Revision: 197327 URL: http://svn.freebsd.org/changeset/base/197327 Log: Fix the disabling of sctp_drain(). Approved by: rrs (mentor) MFC after: 1 month. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Sep 19 14:02:16 2009 (r197326) +++ head/sys/netinet/sctp_pcb.c Sat Sep 19 14:18:42 2009 (r197327) @@ -6422,10 +6422,6 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* We look for anything larger than the cum-ack + 1 */ - SCTP_STAT_INCR(sctps_protocol_drain_calls); - if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { - return; - } asoc = &stcb->asoc; if (asoc->cumulative_tsn == asoc->highest_tsn_inside_map) { /* none we can reneg on. */ @@ -6588,9 +6584,12 @@ sctp_drain() * is LOW on MBUF's and needs help. This is where reneging will * occur. We really hope this does NOT happen! */ - VNET_ITERATOR_DECL(vnet_iter); + SCTP_STAT_INCR(sctps_protocol_drain_calls); + if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { + return; + } VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 14:55:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65BE91065693; Sat, 19 Sep 2009 14:55:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54AC38FC2D; Sat, 19 Sep 2009 14:55:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JEtCJ4028302; Sat, 19 Sep 2009 14:55:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JEtCLC028300; Sat, 19 Sep 2009 14:55:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909191455.n8JEtCLC028300@svn.freebsd.org> From: Michael Tuexen Date: Sat, 19 Sep 2009 14:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197328 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 14:55:13 -0000 Author: tuexen Date: Sat Sep 19 14:55:12 2009 New Revision: 197328 URL: http://svn.freebsd.org/changeset/base/197328 Log: Use appropriate locking when using interface list. Approved by: rrs (mentor) MFC after: 1 month. Modified: head/sys/netinet/sctp_bsd_addr.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Sat Sep 19 14:18:42 2009 (r197327) +++ head/sys/netinet/sctp_bsd_addr.c Sat Sep 19 14:55:12 2009 (r197328) @@ -208,9 +208,7 @@ sctp_init_ifns_for_vrf(int vrfid) struct sctp_ifa *sctp_ifa; uint32_t ifa_flags; -#if 0 IFNET_RLOCK(); -#endif TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { IF_ADDR_LOCK(ifn); TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) { @@ -256,9 +254,7 @@ sctp_init_ifns_for_vrf(int vrfid) } IF_ADDR_UNLOCK(ifn); } -#if 0 IFNET_RUNLOCK(); -#endif } void @@ -344,9 +340,7 @@ void struct ifnet *ifn; struct ifaddr *ifa; -#if 0 IFNET_RLOCK(); -#endif TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { if (!(*pred) (ifn)) { continue; @@ -355,9 +349,7 @@ void sctp_addr_change(ifa, add ? RTM_ADD : RTM_DELETE); } } -#if 0 IFNET_RUNLOCK(); -#endif } struct mbuf * From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 15:49:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 239C5106566C; Sat, 19 Sep 2009 15:49:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 104648FC08; Sat, 19 Sep 2009 15:49:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JFmx2t029362; Sat, 19 Sep 2009 15:48:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JFmxRx029361; Sat, 19 Sep 2009 15:48:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909191548.n8JFmxRx029361@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Sep 2009 15:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197329 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 15:49:00 -0000 Author: jhb Date: Sat Sep 19 15:48:59 2009 New Revision: 197329 URL: http://svn.freebsd.org/changeset/base/197329 Log: Move mergeinfo for 197260-197263 up to sys/. Approved by: re (mergeinfo blanket) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 17:56:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B11BC1065672; Sat, 19 Sep 2009 17:56:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F82D8FC1C; Sat, 19 Sep 2009 17:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JHuQk3031724; Sat, 19 Sep 2009 17:56:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JHuQCq031719; Sat, 19 Sep 2009 17:56:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909191756.n8JHuQCq031719@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Sep 2009 17:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197330 - in head: sys/dev/kbd sys/sys usr.sbin/kbdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 17:56:26 -0000 Author: ed Date: Sat Sep 19 17:56:26 2009 New Revision: 197330 URL: http://svn.freebsd.org/changeset/base/197330 Log: Make the keyboard layer Unicode aware. Just take keyent_t to use an u_int to store the Unicode codepoints. Unfortunately the keymap is now too big to be loaded using an ioctl argument, so change the ioctl to pick a pointer. This change breaks kbdcontrol ABI. It doesn't break X11, because X11 doesn't do anything with syscons keymaps. It just switches the device out of K_XLATE. Obtained from: //depot/user/ed/newcons/... Modified: head/sys/dev/kbd/kbd.c head/sys/sys/kbio.h head/usr.sbin/kbdcontrol/kbdcontrol.c head/usr.sbin/kbdcontrol/kbdmap.5 Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Sat Sep 19 15:48:59 2009 (r197329) +++ head/sys/dev/kbd/kbd.c Sat Sep 19 17:56:26 2009 (r197330) @@ -837,13 +837,14 @@ static int fkey_change_ok(fkeytab_t *, f int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) { +#ifndef KBD_DISABLE_KEYMAP_LOAD + keymap_t *mapp; +#endif keyarg_t *keyp; fkeyarg_t *fkeyp; int s; int i; -#ifndef KBD_DISABLE_KEYMAP_LOAD int error; -#endif s = spltty(); switch (cmd) { @@ -869,18 +870,29 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo break; case GIO_KEYMAP: /* get keyboard translation table */ - bcopy(kbd->kb_keymap, arg, sizeof(*kbd->kb_keymap)); - break; + error = copyout(kbd->kb_keymap, *(void **)arg, + sizeof(keymap_t)); + splx(s); + return (error); case PIO_KEYMAP: /* set keyboard translation table */ #ifndef KBD_DISABLE_KEYMAP_LOAD - error = keymap_change_ok(kbd->kb_keymap, (keymap_t *)arg, - curthread); + mapp = malloc(sizeof *mapp, M_TEMP, M_NOWAIT); + error = copyin(*(void **)arg, mapp, sizeof *mapp); + if (error != 0) { + splx(s); + free(mapp, M_TEMP); + return (error); + } + + error = keymap_change_ok(kbd->kb_keymap, mapp, curthread); if (error != 0) { splx(s); + free(mapp, M_TEMP); return (error); } bzero(kbd->kb_accentmap, sizeof(*kbd->kb_accentmap)); - bcopy(arg, kbd->kb_keymap, sizeof(*kbd->kb_keymap)); + bcopy(mapp, kbd->kb_keymap, sizeof(*kbd->kb_keymap)); + free(mapp, M_TEMP); break; #else splx(s); Modified: head/sys/sys/kbio.h ============================================================================== --- head/sys/sys/kbio.h Sat Sep 19 15:48:59 2009 (r197329) +++ head/sys/sys/kbio.h Sat Sep 19 17:56:26 2009 (r197330) @@ -106,7 +106,7 @@ typedef struct keyboard_repeat keyboard_ #define _KEYMAP_DECLARED struct keyent_t { - u_char map[NUM_STATES]; + u_int map[NUM_STATES]; u_char spcl; u_char flgs; #define FLAG_LOCK_O 0 @@ -220,8 +220,9 @@ typedef struct fkeyarg fkeyarg_t; #define GIO_SCRNMAP _IOR('k', 2, scrmap_t) #define PIO_SCRNMAP _IOW('k', 3, scrmap_t) #endif -#define GIO_KEYMAP _IOR('k', 6, keymap_t) -#define PIO_KEYMAP _IOW('k', 7, keymap_t) +/* XXX: Should have keymap_t as an argument, but that's too big for ioctl()! */ +#define GIO_KEYMAP _IO('k', 6) +#define PIO_KEYMAP _IO('k', 7) #define GIO_DEADKEYMAP _IOR('k', 8, accentmap_t) #define PIO_DEADKEYMAP _IOW('k', 9, accentmap_t) #define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t) Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Sat Sep 19 15:48:59 2009 (r197329) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Sat Sep 19 17:56:26 2009 (r197330) @@ -256,7 +256,7 @@ get_entry(void) case TLET: return (unsigned char)letter; case TNUM: - if (number < 0 || number > 255) + if (number < 0x000000 || number > 0x10FFFF) return -1; return number; default: Modified: head/usr.sbin/kbdcontrol/kbdmap.5 ============================================================================== --- head/usr.sbin/kbdcontrol/kbdmap.5 Sat Sep 19 15:48:59 2009 (r197329) +++ head/usr.sbin/kbdcontrol/kbdmap.5 Sat Sep 19 17:56:26 2009 (r197330) @@ -84,7 +84,7 @@ The symbol the key should produce, in single quotes. .It Ar decnum The -.Tn ASCII +.Tn Unicode value to produce as a decimal number (see @@ -92,7 +92,7 @@ as a decimal number For example, 32 for space. .It 0x Ns Ar hexnum The -.Tn ASCII +.Tn Unicode value to produce as a hexadecimal number. For example, 0x20 for space. @@ -274,7 +274,7 @@ This is followed by the symbol for the accent, given in single quotes or as a decimal or hexadecimal -.Tn ASCII +.Tn Unicode value. This symbol will be produced if the accent key is pressed and @@ -290,7 +290,7 @@ Both symbols in a pair can be given in either single quotes or as decimal or hexadecimal -.Tn ASCII +.Tn Unicode values. .Pp For example, From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 18:01:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04BA1106566C; Sat, 19 Sep 2009 18:01:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E676E8FC17; Sat, 19 Sep 2009 18:01:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JI1WsY031870; Sat, 19 Sep 2009 18:01:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JI1Wq8031864; Sat, 19 Sep 2009 18:01:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909191801.n8JI1Wq8031864@svn.freebsd.org> From: Alan Cox Date: Sat, 19 Sep 2009 18:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197331 - in head: lib/libc/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 18:01:33 -0000 Author: alc Date: Sat Sep 19 18:01:32 2009 New Revision: 197331 URL: http://svn.freebsd.org/changeset/base/197331 Log: Add getpagesizes(3). This functions either the number of supported page sizes or some number of the sizes themselves. It is functionally compatible with a function by the same name under Solaris. Reviewed by: jhb Added: head/lib/libc/gen/getpagesizes.3 (contents, props changed) head/lib/libc/gen/getpagesizes.c (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/sys/sys/mman.h Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sat Sep 19 17:56:26 2009 (r197330) +++ head/lib/libc/gen/Makefile.inc Sat Sep 19 18:01:32 2009 (r197331) @@ -15,7 +15,7 @@ SRCS+= __getosreldate.c __xuname.c \ getbootfile.c getbsize.c \ getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \ - getosreldate.c getpagesize.c \ + getosreldate.c getpagesize.c getpagesizes.c \ getpeereid.c getprogname.c getpwent.c getttyent.c \ getusershell.c getvfsbyname.c glob.c \ initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ @@ -51,8 +51,8 @@ MAN+= alarm.3 arc4random.3 \ getbootfile.3 getbsize.3 getcap.3 getcontext.3 getcwd.3 \ getdiskbyname.3 getdomainname.3 getfsent.3 \ getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \ - getmntinfo.3 getnetgrent.3 getosreldate.3 \ - getpagesize.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \ + getmntinfo.3 getnetgrent.3 getosreldate.3 getpagesize.3 \ + getpagesizes.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \ getttyent.3 getusershell.3 getvfsbyname.3 \ glob.3 initgroups.3 isgreater.3 ldexp.3 lockf.3 makecontext.3 \ modf.3 \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Sep 19 17:56:26 2009 (r197330) +++ head/lib/libc/gen/Symbol.map Sat Sep 19 18:01:32 2009 (r197331) @@ -366,6 +366,10 @@ FBSD_1.1 { tcsetsid; }; +FBSD_1.2 { + getpagesizes; +}; + FBSDprivate_1.0 { /* needed by thread libraries */ __thr_jtable; Added: head/lib/libc/gen/getpagesizes.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/getpagesizes.3 Sat Sep 19 18:01:32 2009 (r197331) @@ -0,0 +1,98 @@ +.\" Copyright (c) 2009 Alan L. Cox +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 19, 2009 +.Dt GETPAGESIZES 3 +.Os +.Sh NAME +.Nm getpagesizes +.Nd "get system page sizes" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/mman.h +.Ft int +.Fn getpagesizes "size_t pagesize[]" "int nelem" +.Sh DESCRIPTION +The +.Fn getpagesizes +function retrieves page size information from the system. +When it is called with +.Fa pagesize +specified as +.Dv NULL +and +.Fa nelem +specified as 0, it returns the number of distinct page sizes that are +supported by the system. +Otherwise, it assigns up to +.Fa nelem +of the system-supported page sizes to consecutive elements of the +array referenced by +.Fa pagesize . +These page sizes are expressed in bytes. +In this case, +.Fn getpagesizes +returns the number of such page sizes that it assigned to the array. +.Sh RETURN VALUES +If successful, the +.Fn getpagesizes +function returns either the number of page sizes that are supported by +the system or the number of supported page sizes that it assigned to +the array referenced by +.Fa pagesize . +Otherwise, it returns the value\~\-1 and sets +.Va errno +to indicate the error. +.Sh ERRORS +The +.Fn getpagesizes +function will succeed unless: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa pagesize +argument is +.Dv NULL +and the +.Fa nelem +argument is non-zero. +.It Bq Er EINVAL +The +.Fa nelem +argument is less than zero. +.El +.Sh SEE ALSO +.Xr getpagesize 3 +.Sh HISTORY +The +.Fn getpagesizes +function first appeared in Solaris 9. +This manual page was written in conjunction with a new but compatible +implementation that was first released in +.Fx 7.3 . +.Sh AUTHOR +.An Alan L. Cox Aq alc@cs.rice.edu Added: head/lib/libc/gen/getpagesizes.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/getpagesizes.c Sat Sep 19 18:01:32 2009 (r197331) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 Alan L. Cox + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +/* + * Retrieves page size information from the system. Specifically, returns the + * number of distinct page sizes that are supported by the system, if + * "pagesize" is NULL and "nelem" is 0. Otherwise, assigns up to "nelem" of + * the system-supported page sizes to consecutive elements of the array + * referenced by "pagesize", and returns the number of such page sizes that it + * assigned to the array. These page sizes are expressed in bytes. + * + * The implementation of this function does not directly or indirectly call + * malloc(3) or any other dynamic memory allocator that may itself call this + * function. + */ +int +getpagesizes(size_t pagesize[], int nelem) +{ + static u_long ps[MAXPAGESIZES]; + static int nops; + size_t size; + int i; + + if (nelem < 0 || (nelem > 0 && pagesize == NULL)) { + errno = EINVAL; + return (-1); + } + /* Cache the result of the sysctl(2). */ + if (nops == 0) { + size = sizeof(ps); + if (sysctlbyname("hw.pagesizes", ps, &size, NULL, 0) == -1) + return (-1); + /* Count the number of page sizes that are supported. */ + nops = size / sizeof(ps[0]); + while (nops > 0 && ps[nops - 1] == 0) + nops--; + } + if (pagesize == NULL) + return (nops); + /* Return up to "nelem" page sizes from the cached result. */ + if (nelem > nops) + nelem = nops; + for (i = 0; i < nelem; i++) + pagesize[i] = ps[i]; + return (nelem); +} Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Sat Sep 19 17:56:26 2009 (r197330) +++ head/sys/sys/mman.h Sat Sep 19 18:01:32 2009 (r197331) @@ -208,6 +208,7 @@ __BEGIN_DECLS * posix_typed_mem_open(). */ #if __BSD_VISIBLE +int getpagesizes(size_t *, int); int madvise(void *, size_t, int); int mincore(const void *, size_t, char *); int minherit(void *, size_t, int); From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 20:25:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E8DA106566B; Sat, 19 Sep 2009 20:25:55 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D7D98FC28; Sat, 19 Sep 2009 20:25:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JKPsRI034527; Sat, 19 Sep 2009 20:25:54 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JKPste034525; Sat, 19 Sep 2009 20:25:54 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200909192025.n8JKPste034525@svn.freebsd.org> From: Matt Jacob Date: Sat, 19 Sep 2009 20:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197332 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 20:25:55 -0000 Author: mjacob Date: Sat Sep 19 20:25:54 2009 New Revision: 197332 URL: http://svn.freebsd.org/changeset/base/197332 Log: Remember to unlock the peripheral prior to notifying the user. Make some allocations M_NOWAIT so that we don't try and sleep with a nested non-sleepable lock. This makes the userland scsi_target begin to function again. Obtained from: Sean Bruno MFC after: 1 month Modified: head/sys/cam/scsi/scsi_target.c Modified: head/sys/cam/scsi/scsi_target.c ============================================================================== --- head/sys/cam/scsi/scsi_target.c Sat Sep 19 18:01:32 2009 (r197331) +++ head/sys/cam/scsi/scsi_target.c Sat Sep 19 20:25:54 2009 (r197332) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +/* Includes to support callout */ +#include +#include #include #include @@ -50,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include + /* Transaction information attached to each CCB sent by the user */ struct targ_cmd_descr { struct cam_periph_map_info mapinfo; @@ -92,6 +96,8 @@ struct targ_softc { targ_state state; struct selinfo read_select; struct devstat device_stats; + struct callout destroy_dev_callout; + struct mtx destroy_mtx; }; static d_open_t targopen; @@ -154,6 +160,7 @@ static void abort_all_pending(struct ta static void notify_user(struct targ_softc *softc); static int targcamstatus(cam_status status); static size_t targccblen(xpt_opcode func_code); +static void targdestroy(void *); static struct periph_driver targdriver = { @@ -211,10 +218,18 @@ targclose(struct cdev *dev, int flag, in int error; softc = (struct targ_softc *)dev->si_drv1; - if ((softc->periph == NULL) || - (softc->state & TARG_STATE_LUN_ENABLED) == 0) { + mtx_init(&softc->destroy_mtx, "targ_destroy", "SCSI Target dev destroy", MTX_DEF); + callout_init_mtx(&softc->destroy_dev_callout, &softc->destroy_mtx, CALLOUT_RETURNUNLOCKED); + if (softc->periph == NULL) { +#if 0 destroy_dev(dev); free(softc, M_TARG); +#endif + printf("%s: destroying non-enabled target\n", __func__); + mtx_lock(&softc->destroy_mtx); + callout_reset(&softc->destroy_dev_callout, hz / 2, + (void *)targdestroy, (void *)dev); + mtx_unlock(&softc->destroy_mtx); return (0); } @@ -226,18 +241,23 @@ targclose(struct cdev *dev, int flag, in cam_periph_acquire(periph); cam_periph_lock(periph); error = targdisable(softc); - if (error == CAM_REQ_CMP) { - dev->si_drv1 = 0; - if (softc->periph != NULL) { - cam_periph_invalidate(softc->periph); - softc->periph = NULL; - } - destroy_dev(dev); - free(softc, M_TARG); + if (softc->periph != NULL) { + cam_periph_invalidate(softc->periph); + softc->periph = NULL; } cam_periph_unlock(periph); cam_periph_release(periph); +#if 0 + destroy_dev(dev); + free(softc, M_TARG); +#endif + + printf("%s: close finished error(%d)\n", __func__, error); + mtx_lock(&softc->destroy_mtx); + callout_reset(&softc->destroy_dev_callout, hz / 2, + (void *)targdestroy, (void *)dev); + mtx_unlock(&softc->destroy_mtx); return (error); } @@ -821,7 +841,9 @@ targdone(struct cam_periph *periph, unio case XPT_CONT_TARGET_IO: TAILQ_INSERT_TAIL(&softc->user_ccb_queue, &done_ccb->ccb_h, periph_links.tqe); + cam_periph_unlock(softc->periph); notify_user(softc); + cam_periph_lock(softc->periph); break; default: panic("targdone: impossible xpt opcode %#x", @@ -969,13 +991,19 @@ targgetccb(struct targ_softc *softc, xpt int ccb_len; ccb_len = targccblen(type); - ccb = malloc(ccb_len, M_TARG, M_WAITOK); + ccb = malloc(ccb_len, M_TARG, M_NOWAIT); CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb)); - + if (ccb == NULL) { + return (ccb); + } xpt_setup_ccb(&ccb->ccb_h, softc->path, priority); ccb->ccb_h.func_code = type; ccb->ccb_h.cbfcnp = targdone; ccb->ccb_h.targ_descr = targgetdescr(softc); + if (ccb->ccb_h.targ_descr == NULL) { + free (ccb, M_TARG); + ccb = NULL; + } return (ccb); } @@ -1013,8 +1041,10 @@ targgetdescr(struct targ_softc *softc) struct targ_cmd_descr *descr; descr = malloc(sizeof(*descr), M_TARG, - M_WAITOK); - descr->mapinfo.num_bufs_used = 0; + M_NOWAIT); + if (descr) { + descr->mapinfo.num_bufs_used = 0; + } return (descr); } @@ -1094,8 +1124,11 @@ abort_all_pending(struct targ_softc *sof /* If we aborted anything from the work queue, wakeup user. */ if (!TAILQ_EMPTY(&softc->user_ccb_queue) - || !TAILQ_EMPTY(&softc->abort_queue)) + || !TAILQ_EMPTY(&softc->abort_queue)) { + cam_periph_unlock(softc->periph); notify_user(softc); + cam_periph_lock(softc->periph); + } } /* Notify the user that data is ready */ @@ -1188,3 +1221,25 @@ targccblen(xpt_opcode func_code) return (len); } + +/* + * work around to destroy targ device + * outside of targclose + */ +static void +targdestroy(void *dev) +{ + struct cdev *device = (struct cdev *)dev; + struct targ_softc *softc = (struct targ_softc *)device->si_drv1; + +#if 0 + callout_stop(&softc->destroy_dev_callout); +#endif + + mtx_unlock(&softc->destroy_mtx); + mtx_destroy(&softc->destroy_mtx); + free(softc, M_TARG); + device->si_drv1 = 0; + destroy_dev(device); + printf("%s: destroyed dev\n", __func__); +} From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 20:36:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F74106568F; Sat, 19 Sep 2009 20:36:43 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 752E78FC55; Sat, 19 Sep 2009 20:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JKahqr034733; Sat, 19 Sep 2009 20:36:43 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JKahHA034731; Sat, 19 Sep 2009 20:36:43 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200909192036.n8JKahHA034731@svn.freebsd.org> From: Matt Jacob Date: Sat, 19 Sep 2009 20:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197333 - head/share/examples/scsi_target X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 20:36:43 -0000 Author: mjacob Date: Sat Sep 19 20:36:43 2009 New Revision: 197333 URL: http://svn.freebsd.org/changeset/base/197333 Log: Tell about the full name we opened, not the unit. Obtained from: Sean Bruno MFC after: 1 month Modified: head/share/examples/scsi_target/scsi_target.c Modified: head/share/examples/scsi_target/scsi_target.c ============================================================================== --- head/share/examples/scsi_target/scsi_target.c Sat Sep 19 20:25:54 2009 (r197332) +++ head/share/examples/scsi_target/scsi_target.c Sat Sep 19 20:36:43 2009 (r197333) @@ -293,7 +293,7 @@ main(int argc, char *argv[]) if (targ_fd < 0) errx(1, "Tried to open %d devices, none available", unit); else - warnx("opened /dev/targ%d", unit); + warnx("opened %s", targname); /* The first three are handled by kevent() later */ signal(SIGHUP, SIG_IGN); From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 21:44:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0F301065679; Sat, 19 Sep 2009 21:44:17 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 358DE8FC0C; Sat, 19 Sep 2009 21:44:16 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALrttEqDaFvJ/2dsb2JhbADMH4QbBQ X-IronPort-AV: E=Sophos;i="4.44,416,1249272000"; d="scan'208";a="46946592" Received: from ganges.cs.uoguelph.ca ([131.104.91.201]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 19 Sep 2009 17:44:16 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ganges.cs.uoguelph.ca (Postfix) with ESMTP id 30E90FB80C3; Sat, 19 Sep 2009 17:44:16 -0400 (EDT) X-Virus-Scanned: amavisd-new at ganges.cs.uoguelph.ca Received: from ganges.cs.uoguelph.ca ([127.0.0.1]) by localhost (ganges.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xxf6bmAIuwgq; Sat, 19 Sep 2009 17:44:15 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by ganges.cs.uoguelph.ca (Postfix) with ESMTP id 321DEFB801F; Sat, 19 Sep 2009 17:44:15 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n8JLnos00735; Sat, 19 Sep 2009 17:49:50 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Sat, 19 Sep 2009 17:49:50 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: John Baldwin In-Reply-To: <4AB495DD.1010006@FreeBSD.org> Message-ID: References: <200909171908.n8HJ8GQs067202@svn.freebsd.org> <4AB35086.90502@FreeBSD.org> <4AB495DD.1010006@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197298 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 21:44:18 -0000 On Sat, 19 Sep 2009, John Baldwin wrote: >> It happens that it still uses UDP for Portmapper by default and when >> "tcp" is specified, but that is down inside the libc functions and there >> are comments in them along the lines of "always use UDP first...", so >> I don't intend to change those. > > Hmm, it might actually be nice to be able to change those at some point as > well. I have looked at this in the past and it is quite deeply buried in > libc. :-/ > Well, the function is called __rpcb_findaddr_timed() and the "nconf" argument to it specifies udp or tcp in it, so I don't think it would be hard to change the function to use the info. in the nconf argument. The scary part would be finding out what breaks after you do it. The comment I alluded to is the following: /* * Try UDP only - there are some portmappers out * there that use UDP only. */ It looks like the newer rpcbind impelementations would be ok, but who knows until you try it?? I'd at least say it isn't a change for 8.0 imho, rick From owner-svn-src-all@FreeBSD.ORG Sat Sep 19 21:46:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06718106566B; Sat, 19 Sep 2009 21:46:13 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0B2C8FC15; Sat, 19 Sep 2009 21:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8JLkC7H036209; Sat, 19 Sep 2009 21:46:12 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8JLkCsr036207; Sat, 19 Sep 2009 21:46:12 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200909192146.n8JLkCsr036207@svn.freebsd.org> From: Max Laier Date: Sat, 19 Sep 2009 21:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197334 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 21:46:13 -0000 Author: mlaier Date: Sat Sep 19 21:46:12 2009 New Revision: 197334 URL: http://svn.freebsd.org/changeset/base/197334 Log: Extract version information from git repositories. Try to find a corresponding svn version if this is a git-svn clone'ed repo. This prefers svn version information over git in case a working directory has both .svn and .git directories. MFC after: 3 days X-MFC: not stable/8 before 8.0 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sat Sep 19 20:36:43 2009 (r197333) +++ head/sys/conf/newvers.sh Sat Sep 19 21:46:12 2009 (r197334) @@ -89,28 +89,47 @@ i=`${MAKE:-make} -V KERN_IDENT` case "$d" in */sys/*) + SRCDIR=${d##*obj} + if [ -n "$MACHINE" ]; then + SRCDIR=${SRCDIR##/$MACHINE} + fi + SRCDIR=${SRCDIR%%/sys/*} + for dir in /bin /usr/bin /usr/local/bin; do - if [ -x "${dir}/svnversion" ]; then + if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then svnversion=${dir}/svnversion - SRCDIR=${d##*obj} - if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE} - fi - SRCDIR=${SRCDIR%%/sys/*} + break + fi + if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" break fi done - if [ -n "$svnversion" -a -d "${SRCDIR}/sys/.svn" ] ; then + if [ -n "$svnversion" ] ; then svn=" r`cd ${SRCDIR}/sys && $svnversion`" fi + if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="-${git}" + else + git=" ${git}" + fi + if $git_cmd --work-tree=${SRCDIR} diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi + fi ;; esac cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}: ${t}" +#define VERSTR "${VERSION} #${v}${svn}${git}: ${t}\\n ${u}@${h}:${d}\\n" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;