From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 16 10:41:47 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C3B7106564A; Sun, 16 Jan 2011 10:41:47 +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 7ACFC8FC14; Sun, 16 Jan 2011 10:41: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 p0GAflLD060618; Sun, 16 Jan 2011 10:41:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GAfl60060616; Sun, 16 Jan 2011 10:41:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101161041.p0GAfl60060616@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 16 Jan 2011 10:41:47 +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: r217470 - stable/8/lib/csu/i386-elf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 10:41:47 -0000 Author: kib Date: Sun Jan 16 10:41:47 2011 New Revision: 217470 URL: http://svn.freebsd.org/changeset/base/217470 Log: MFC r217383: The (%esp & 0xf) == 0 should be true before the call instruction is executed, for the properly aligned stack. Modified: stable/8/lib/csu/i386-elf/crt1_s.S Directory Properties: stable/8/lib/csu/ (props changed) Modified: stable/8/lib/csu/i386-elf/crt1_s.S ============================================================================== --- stable/8/lib/csu/i386-elf/crt1_s.S Sun Jan 16 10:02:46 2011 (r217469) +++ stable/8/lib/csu/i386-elf/crt1_s.S Sun Jan 16 10:41:47 2011 (r217470) @@ -40,6 +40,7 @@ _start: .cfi_def_cfa_register %ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 16 14:15:46 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC691106564A; Sun, 16 Jan 2011 14:15:46 +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 B9BF58FC15; Sun, 16 Jan 2011 14:15: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 p0GEFkiA066149; Sun, 16 Jan 2011 14:15:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GEFkOs066144; Sun, 16 Jan 2011 14:15:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101161415.p0GEFkOs066144@svn.freebsd.org> From: Rick Macklem Date: Sun, 16 Jan 2011 14:15:46 +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: r217474 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 14:15:47 -0000 Author: rmacklem Date: Sun Jan 16 14:15:46 2011 New Revision: 217474 URL: http://svn.freebsd.org/changeset/base/217474 Log: MFC: r216893 Add checks for VI_DOOMED and vn_lock() failures to the experimental NFS server, to handle the case where an exported file system is forced dismounted while an RPC is in progress. Further commits will fix the cases where a mount point is used when the associated vnode isn't locked. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:15:46 2011 (r217474) @@ -153,6 +153,10 @@ nfsvno_accchk(struct vnode *vp, accmode_ struct vattr vattr; int error = 0, getret = 0; + if (vpislocked == 0) { + if (vn_lock(vp, LK_SHARED) != 0) + return (EPERM); + } if (accmode & VWRITE) { /* Just vn_writechk() changed to check rdonly */ /* @@ -166,7 +170,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ case VREG: case VDIR: case VLNK: - return (EROFS); + error = EROFS; default: break; } @@ -176,11 +180,14 @@ nfsvno_accchk(struct vnode *vp, accmode_ * the inode, try to free it up once. If * we fail, we can't allow writing. */ - if (vp->v_vflag & VV_TEXT) - return (ETXTBSY); + if ((vp->v_vflag & VV_TEXT) != 0 && error == 0) + error = ETXTBSY; + } + if (error != 0) { + if (vpislocked == 0) + VOP_UNLOCK(vp, 0); + return (error); } - if (vpislocked == 0) - vn_lock(vp, LK_SHARED | LK_RETRY); /* * Should the override still be applied when ACLs are enabled? @@ -1097,9 +1104,11 @@ nfsvno_rename(struct nameidata *fromndp, goto out; } if (ndflag & ND_NFSV4) { - NFSVOPLOCK(fvp, LK_EXCLUSIVE | LK_RETRY, p); - error = nfsrv_checkremove(fvp, 0, p); - NFSVOPUNLOCK(fvp, 0, p); + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { + error = nfsrv_checkremove(fvp, 0, p); + VOP_UNLOCK(fvp, 0); + } else + error = EPERM; if (tvp && !error) error = nfsrv_checkremove(tvp, 1, p); } else { @@ -1156,13 +1165,16 @@ nfsvno_link(struct nameidata *ndp, struc error = EXDEV; } if (!error) { - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); + else + error = EPERM; if (ndp->ni_dvp == vp) vrele(ndp->ni_dvp); else vput(ndp->ni_dvp); - NFSVOPUNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0); } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -2793,6 +2805,11 @@ nfsvno_advlock(struct vnode *vp, int fty if (nfsrv_dolocallocks == 0) return (0); + + /* Check for VI_DOOMED here, so that VOP_ADVLOCK() isn't performed. */ + if ((vp->v_iflag & VI_DOOMED) != 0) + return (EPERM); + fl.l_whence = SEEK_SET; fl.l_type = ftype; fl.l_start = (off_t)first; Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:15:46 2011 (r217474) @@ -2676,9 +2676,12 @@ nfsrvd_open(struct nfsrv_descript *nd, _ }; stp->ls_flags |= NFSLCK_RECLAIM; vp = dp; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, stp, vp, - nd, p, nd->nd_repstat); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, + stp, vp, nd, p, nd->nd_repstat); + else + nd->nd_repstat = NFSERR_PERM; } else { nd->nd_repstat = NFSERR_BADXDR; vrele(dp); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:15:46 2011 (r217474) @@ -902,13 +902,15 @@ nfsrvd_compound(struct nfsrv_descript *n nd->nd_repstat = NFSERR_XDEV; break; } - VREF(vp); - VREF(savevp); if (nfsv4_opflag[op].modifyfs) NFS_STARTWRITE(NULL, &mp); - NFSVOPLOCK(savevp, LK_EXCLUSIVE | LK_RETRY, p); - error = (*(nfsrv4_ops2[op]))(nd, isdgram, savevp, - vp, p, &savevpnes, &vpnes); + if (vn_lock(savevp, LK_EXCLUSIVE) == 0) { + VREF(vp); + VREF(savevp); + error = (*(nfsrv4_ops2[op]))(nd, isdgram, + savevp, vp, p, &savevpnes, &vpnes); + } else + nd->nd_repstat = NFSERR_PERM; if (nfsv4_opflag[op].modifyfs) NFS_ENDWRITE(mp); } else { @@ -916,12 +918,15 @@ nfsrvd_compound(struct nfsrv_descript *n panic("nfsrvd_compound"); if (nfsv4_opflag[op].needscfh) { if (vp != NULL) { + if (nfsv4_opflag[op].modifyfs) + NFS_STARTWRITE(NULL, &mp); if (vn_lock(vp, nfsv4_opflag[op].lktype) - != 0) + == 0) + VREF(vp); + else nd->nd_repstat = NFSERR_PERM; - } else + } else { nd->nd_repstat = NFSERR_NOFILEHANDLE; - if (nd->nd_repstat != 0) { if (op == NFSV4OP_SETATTR) { /* * Setattr reply requires a @@ -934,11 +939,9 @@ nfsrvd_compound(struct nfsrv_descript *n } break; } - VREF(vp); - if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); - error = (*(nfsrv4_ops0[op]))(nd, isdgram, vp, - p, &vpnes); + if (nd->nd_repstat == 0) + error = (*(nfsrv4_ops0[op]))(nd, + isdgram, vp, p, &vpnes); if (nfsv4_opflag[op].modifyfs) NFS_ENDWRITE(mp); } else { Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 16 14:15:46 2011 (r217474) @@ -1659,7 +1659,7 @@ tryagain: if (new_stp->ls_flags & bits & NFSLCK_ACCESSBITS) { ret = nfsrv_clientconflict(tstp->ls_clp, &haslock, vp, p); - if (ret) { + if (ret == 1) { /* * nfsrv_clientconflict unlocks state * when it returns non-zero. @@ -1667,13 +1667,17 @@ tryagain: lckstp = NULL; goto tryagain; } - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); } - return (NFSERR_OPENMODE); + if (ret == 2) + return (NFSERR_PERM); + else + return (NFSERR_OPENMODE); } } } @@ -1826,7 +1830,7 @@ tryagain: other_lop = NULL; } ret = nfsrv_clientconflict(lop->lo_stp->ls_clp,&haslock,vp,p); - if (ret) { + if (ret == 1) { if (filestruct_locked != 0) { /* Roll back local locks. */ nfsrv_locallock_rollback(vp, lfp, p); @@ -1845,7 +1849,7 @@ tryagain: * Found a conflicting lock, so record the conflict and * return the error. */ - if (cfp) { + if (cfp != NULL && ret == 0) { cfp->cl_clientid.lval[0]=lop->lo_stp->ls_stateid.other[0]; cfp->cl_clientid.lval[1]=lop->lo_stp->ls_stateid.other[1]; cfp->cl_first = lop->lo_first; @@ -1855,20 +1859,23 @@ tryagain: NFSBCOPY(lop->lo_stp->ls_owner, cfp->cl_owner, cfp->cl_ownerlen); } - if (new_stp->ls_flags & NFSLCK_RECLAIM) + if (ret == 2) + error = NFSERR_PERM; + else if (new_stp->ls_flags & NFSLCK_RECLAIM) error = NFSERR_RECLAIMCONFLICT; else if (new_stp->ls_flags & NFSLCK_CHECK) error = NFSERR_LOCKED; else error = NFSERR_DENIED; - if (filestruct_locked != 0) { + if (filestruct_locked != 0 && ret == 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); } - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -2120,18 +2127,21 @@ tryagain: ((stp->ls_flags & NFSLCK_ACCESSBITS) & ((new_stp->ls_flags>>NFSLCK_SHIFT)&NFSLCK_ACCESSBITS)))){ ret = nfsrv_clientconflict(stp->ls_clp,&haslock,vp,p); - if (ret) { + if (ret == 1) { /* * nfsrv_clientconflict() unlocks * state when it returns non-zero. */ goto tryagain; } - if (new_stp->ls_flags & NFSLCK_RECLAIM) + if (ret == 2) + error = NFSERR_PERM; + else if (new_stp->ls_flags & NFSLCK_RECLAIM) error = NFSERR_RECLAIMCONFLICT; else error = NFSERR_SHAREDENIED; - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -2394,7 +2404,7 @@ tryagain: ((stp->ls_flags & NFSLCK_ACCESSBITS) & ((new_stp->ls_flags>>NFSLCK_SHIFT)&NFSLCK_ACCESSBITS))){ ret = nfsrv_clientconflict(stp->ls_clp,&haslock,vp,p); - if (ret) { + if (ret == 1) { /* * nfsrv_clientconflict() unlocks state * when it returns non-zero. @@ -2404,11 +2414,14 @@ tryagain: openstp = NULL; goto tryagain; } - if (new_stp->ls_flags & NFSLCK_RECLAIM) + if (ret == 2) + error = NFSERR_PERM; + else if (new_stp->ls_flags & NFSLCK_RECLAIM) error = NFSERR_RECLAIMCONFLICT; else error = NFSERR_SHAREDENIED; - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -4080,10 +4093,13 @@ nfsrv_updatestable(NFSPROC_T *p) NFSVNO_SETATTRVAL(&nva, size, 0); vp = NFSFPVNODE(sf->nsf_fp); NFS_STARTWRITE(vp, &mp); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); + if (vn_lock(vp, LK_EXCLUSIVE) == 0) { + error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, + NULL); + VOP_UNLOCK(vp, 0); + } else + error = EPERM; NFS_ENDWRITE(mp); - NFSVOPUNLOCK(vp, 0, p); if (!error) error = NFSD_RDWR(UIO_WRITE, vp, (caddr_t)&sf->nsf_rec, sizeof (struct nfsf_rec), (off_t)0, @@ -4211,10 +4227,11 @@ nfsrv_checkstable(struct nfsclient *clp) * Return 0 to indicate the conflict can't be revoked and 1 to indicate * the revocation worked and the conflicting client is "bye, bye", so it * can be tried again. + * Return 2 to indicate that the vnode is VI_DOOMED after vn_lock(). * Unlocks State before a non-zero value is returned. */ static int -nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, __unused vnode_t vp, +nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, NFSPROC_T *p) { int gotlock, lktype; @@ -4238,7 +4255,10 @@ nfsrv_clientconflict(struct nfsclient *c NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; vn_lock(vp, lktype | LK_RETRY); - return (1); + if ((vp->v_iflag & VI_DOOMED) != 0) + return (2); + else + return (1); } NFSUNLOCKSTATE(); @@ -4254,7 +4274,6 @@ nfsrv_clientconflict(struct nfsclient *c return (1); } - /* * Resolve a delegation conflict. * Returns 0 to indicate the conflict was resolved without sleeping. @@ -4403,6 +4422,13 @@ nfsrv_delegconflict(struct nfsstate *stp NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; vn_lock(vp, lktype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) { + *haslockp = 0; + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + return (NFSERR_PERM); + } return (-1); } @@ -4594,12 +4620,11 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) == 0) + if (vn_lock(vp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(vp, 0, p); - else + VOP_UNLOCK(vp, 0); + } else error = EPERM; - VOP_UNLOCK(vp, 0); if (error == NFSERR_DELAY) { NFSGETNANOTIME(&mytime); if (((u_int32_t)mytime.tv_sec - starttime) > From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 16 14:37:48 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF30F1065675; Sun, 16 Jan 2011 14:37:48 +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 9D38A8FC16; Sun, 16 Jan 2011 14:37: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 p0GEbmDw066811; Sun, 16 Jan 2011 14:37:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GEbmBt066807; Sun, 16 Jan 2011 14:37:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101161437.p0GEbmBt066807@svn.freebsd.org> From: Rick Macklem Date: Sun, 16 Jan 2011 14:37:48 +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: r217476 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 14:37:48 -0000 Author: rmacklem Date: Sun Jan 16 14:37:48 2011 New Revision: 217476 URL: http://svn.freebsd.org/changeset/base/217476 Log: MFC: r216894 Delete some cruft from the experimental NFS server that was only used by the OpenBSD port for its pseudo-fs. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:21:26 2011 (r217475) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:37:48 2011 (r217476) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; -extern int nfsv4root_set; extern int nfsrv_useacl; extern int newnfs_numnfsd; extern struct mount nfsv4root_mnt; @@ -2677,10 +2676,9 @@ nfsrv_v4rootexport(void *argp, struct uc fhandle_t fh; error = vfs_export(&nfsv4root_mnt, &nfsexargp->export); - if ((nfsexargp->export.ex_flags & MNT_DELEXPORT)) { + if ((nfsexargp->export.ex_flags & MNT_DELEXPORT) != 0) nfs_rootfhset = 0; - nfsv4root_set = 0; - } else if (error == 0) { + else if (error == 0) { if (nfsexargp->fspec == NULL) return (EPERM); /* Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:21:26 2011 (r217475) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:37:48 2011 (r217476) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); extern u_int32_t newnfs_false, newnfs_true; extern enum vtype nv34tov_type[8]; extern struct timeval nfsboottime; -extern int nfs_rootfhset, nfsv4root_set; +extern int nfs_rootfhset; #endif /* !APPLEKEXT */ /* @@ -2874,8 +2874,7 @@ nfsrvd_delegpurge(struct nfsrv_descript int error = 0; nfsquad_t clientid; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3073,8 +3072,7 @@ nfsrvd_renew(struct nfsrv_descript *nd, int error = 0; nfsquad_t clientid; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3212,8 +3210,7 @@ nfsrvd_setclientid(struct nfsrv_descript u_char *verf, *ucp, *ucp2, addrbuf[24]; nfsquad_t clientid, confirm; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3321,8 +3318,7 @@ nfsrvd_setclientidcfrm(struct nfsrv_desc int error = 0; nfsquad_t clientid, confirm; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3409,8 +3405,7 @@ nfsrvd_releaselckown(struct nfsrv_descri int error = 0, len; nfsquad_t clientid; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:21:26 2011 (r217475) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:37:48 2011 (r217476) @@ -50,8 +50,6 @@ extern struct nfsclienthashhead nfsclien extern int nfsrc_floodlevel, nfsrc_tcpsavedreplies; NFSV4ROOTLOCKMUTEX; NFSSTATESPINLOCK; -vnode_t nfsv4root_vp = NULL; -int nfsv4root_set = 0; int (*nfsrv3_procs0[NFS_V3NPROCS])(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *) = { @@ -748,20 +746,8 @@ nfsrvd_compound(struct nfsrv_descript *n NFSVOPUNLOCK(vp, 0, p); vpnes = nes; } - } else if (nfsv4root_vp && nfsv4root_set) { - if (vp) { - if (vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); - vrele(vp); - } - vp = nfsv4root_vp; - VREF(vp); - NFSVNO_SETEXRDONLY(&vpnes); - vpnes.nes_vfslocked = 0; - mp = vnode_mount(vp); - } else { + } else nd->nd_repstat = NFSERR_NOFILEHANDLE; - } break; case NFSV4OP_SAVEFH: if (vp && NFSVNO_EXPORTED(&vpnes)) { @@ -859,17 +845,6 @@ nfsrvd_compound(struct nfsrv_descript *n vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] || vfs_statfs(mp)->f_fsid.val[1] != vfs_statfs(vnode_mount(nvp))->f_fsid.val[1]) { - if (vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] == - NFSV4ROOT_FSID0 && - vfs_statfs(vnode_mount(nvp))->f_fsid.val[1] == - NFSV4ROOT_FSID1) { - if (vpnes.nes_vfslocked) { - nfsvno_unlockvfs(mp); - vpnes.nes_vfslocked = 0; - } - NFSVNO_SETEXRDONLY(&vpnes); - mp = vnode_mount(nvp); - } else { nd->nd_repstat = nfsvno_checkexp(vnode_mount(nvp), nd->nd_nam, &nes, &credanon); if (!nd->nd_repstat) @@ -885,7 +860,6 @@ nfsrvd_compound(struct nfsrv_descript *n vpnes.nes_vfslocked = nfsvno_lockvfs(mp); } - } } if (!nd->nd_repstat) { vrele(vp); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 16 22:10:19 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08147106566B; Sun, 16 Jan 2011 22:10:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EABC08FC15; Sun, 16 Jan 2011 22:10: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 p0GMAIUl078773; Sun, 16 Jan 2011 22:10:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GMAIs5078771; Sun, 16 Jan 2011 22:10:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101162210.p0GMAIs5078771@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 22:10: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: r217485 - stable/8/bin/sh X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 22:10:19 -0000 Author: jilles Date: Sun Jan 16 22:10:18 2011 New Revision: 217485 URL: http://svn.freebsd.org/changeset/base/217485 Log: MFC r216806: sh: Properly restore exception handler in fc. If SIGINT arrived at exactly the right moment (unlikely), an exception handler in a no longer active stack frame would be called. Because the old handler was not used in the normal path, clang thought it was a dead value and if an exception happened it would longjmp() to garbage. This caused builtins/fc1.0 to fail if histedit.c was compiled with clang. (Note: not tested on stable/8 with clang.) Modified: stable/8/bin/sh/histedit.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/histedit.c ============================================================================== --- stable/8/bin/sh/histedit.c Sun Jan 16 21:59:50 2011 (r217484) +++ stable/8/bin/sh/histedit.c Sun Jan 16 22:10:18 2011 (r217485) @@ -214,6 +214,7 @@ histcmd(int argc, char **argv) } argc -= optind, argv += optind; + savehandler = handler; /* * If executing... */ @@ -224,7 +225,6 @@ histcmd(int argc, char **argv) * Catch interrupts to reset active counter and * cleanup temp files. */ - savehandler = handler; if (setjmp(jmploc.loc)) { active = 0; if (editfile) @@ -380,6 +380,7 @@ histcmd(int argc, char **argv) --active; if (displayhist) displayhist = 0; + handler = savehandler; return 0; } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 16 23:41:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EEB4106566C; Sun, 16 Jan 2011 23:41:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3128FC1D; Sun, 16 Jan 2011 23:41: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 p0GNffAq081133; Sun, 16 Jan 2011 23:41:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GNffIi081127; Sun, 16 Jan 2011 23:41:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101162341.p0GNffIi081127@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 23:41:41 +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: r217489 - in stable/8/tools/regression/bin/sh: builtins expansion X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 23:41:41 -0000 Author: jilles Date: Sun Jan 16 23:41:40 2011 New Revision: 217489 URL: http://svn.freebsd.org/changeset/base/217489 Log: MFC r215547,r216763,r216819,r216871,r217172: sh testcases. Added: stable/8/tools/regression/bin/sh/builtins/exit1.0 - copied unchanged from r216871, head/tools/regression/bin/sh/builtins/exit1.0 stable/8/tools/regression/bin/sh/builtins/exit2.8 - copied unchanged from r217172, head/tools/regression/bin/sh/builtins/exit2.8 stable/8/tools/regression/bin/sh/builtins/wait3.0 - copied unchanged from r215547, head/tools/regression/bin/sh/builtins/wait3.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 - copied unchanged from r216763, head/tools/regression/bin/sh/expansion/cmdsubst6.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 - copied unchanged from r216819, head/tools/regression/bin/sh/expansion/cmdsubst8.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 - copied unchanged from r216819, head/tools/regression/bin/sh/expansion/cmdsubst9.0 Modified: Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/exit1.0 (from r216871, head/tools/regression/bin/sh/builtins/exit1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/exit1.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216871, head/tools/regression/bin/sh/builtins/exit1.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# exit with an argument should overwrite the exit status in an EXIT trap. + +trap 'true; exit $?' 0 +false Copied: stable/8/tools/regression/bin/sh/builtins/exit2.8 (from r217172, head/tools/regression/bin/sh/builtins/exit2.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/exit2.8 Sun Jan 16 23:41:40 2011 (r217489, copy of r217172, head/tools/regression/bin/sh/builtins/exit2.8) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# exit without arguments is the same as exit $? outside a trap. + +trap 'true; true' 0 +(exit 8) +exit Copied: stable/8/tools/regression/bin/sh/builtins/wait3.0 (from r215547, head/tools/regression/bin/sh/builtins/wait3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/wait3.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r215547, head/tools/regression/bin/sh/builtins/wait3.0) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +for i in 1 2 3 4 5 6 7 8 9 10; do + exit $i 4fifo1 +wait || failure $LINENO +(echo >&3) 2>/dev/null && failure $LINENO +wait || failure $LINENO + +test -z "$failures" Copied: stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 (from r216763, head/tools/regression/bin/sh/expansion/cmdsubst6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216763, head/tools/regression/bin/sh/expansion/cmdsubst6.0) @@ -0,0 +1,53 @@ +# $FreeBSD$ +# This tests if the cmdsubst optimization is still used if possible. + +failures='' +ok='' + +testcase() { + code="$1" + + unset v + eval "pid=\$(dummy=$code echo \$(\$SH -c echo\ \\\$PPID))" + + if [ "$pid" = "$$" ]; then + ok=x$ok + else + failures=x$failures + echo "Failure for $code" + fi +} + +unset v +w=1 +testcase '$w' +testcase '1${w+1}' +testcase '1${w-1}' +testcase '1${v+1}' +testcase '1${v-1}' +testcase '1${w:+1}' +testcase '1${w:-1}' +testcase '1${v:+1}' +testcase '1${v:-1}' +testcase '${w?}' +testcase '${w:?}' +testcase '${w#x}' +testcase '${w##x}' +testcase '${w%x}' +testcase '${w%%x}' + +testcase '$((w))' +testcase '$(((w+4)*2/3))' +testcase '$((w==1))' +testcase '$((w>=0 && w<=5 && w!=2))' +testcase '$((${#w}))' +testcase '$((${#IFS}))' +testcase '$((${#w}>=1))' +testcase '$(($$))' +testcase '$(($#))' +testcase '$(($?))' + +testcase '$(: $((w=4)))' +testcase '$(: ${v=2})' + +test "x$failures" = x Copied: stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 (from r216819, head/tools/regression/bin/sh/expansion/cmdsubst8.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216819, head/tools/regression/bin/sh/expansion/cmdsubst8.0) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Not required by POSIX (although referenced in a non-normative section), +# but possibly useful. + +: hi there & +p=$! +q=$(jobs -l $p) + +# Change tabs to spaces. +set -f +set -- $q +r="$*" + +case $r in +*" $p "*) ;; +*) echo Pid missing; exit 3 ;; +esac Copied: stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 (from r216819, head/tools/regression/bin/sh/expansion/cmdsubst9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216819, head/tools/regression/bin/sh/expansion/cmdsubst9.0) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +set -e + +cd / +dummy=$(cd /bin) +[ "$(pwd)" = / ] + +v=1 +dummy=$(eval v=2) +[ "$v" = 1 ] From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 00:59:05 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0156F106566C; Mon, 17 Jan 2011 00:59:05 +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 D98DC8FC15; Mon, 17 Jan 2011 00:59: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 p0H0x4TR083044; Mon, 17 Jan 2011 00:59:04 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H0x4LP083041; Mon, 17 Jan 2011 00:59:04 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170059.p0H0x4LP083041@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 00:59:04 +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: r217493 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 00:59:05 -0000 Author: rmacklem Date: Mon Jan 17 00:59:04 2011 New Revision: 217493 URL: http://svn.freebsd.org/changeset/base/217493 Log: MFC: r216897 Modify the experimental NFSv4 server so that the lookup ops return a locked vnode. This ensures that the associated mount point will always be valid for the code that follows the operation. Also add a couple of additional checks for non-error to the other functions that create file objects. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jan 17 00:15:01 2011 (r217492) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jan 17 00:59:04 2011 (r217493) @@ -470,12 +470,10 @@ nfsrvd_lookup(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); - if (vpp) { - NFSVOPUNLOCK(vp, 0, p); + if (vpp != NULL && nd->nd_repstat == 0) *vpp = vp; - } else { + else vput(vp); - } if (dirp) { if (nd->nd_flag & ND_NFSV3) dattr_ret = nfsvno_getattr(dirp, &dattr, nd->nd_cred, @@ -1218,12 +1216,11 @@ nfsrvd_mknod(struct nfsrv_descript *nd, if ((nd->nd_flag & ND_NFSV3) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); - if (vpp) { - NFSVOPUNLOCK(vp, 0, p); + if (vpp != NULL && nd->nd_repstat == 0) { + VOP_UNLOCK(vp, 0); *vpp = vp; - } else { + } else vput(vp); - } } diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); @@ -1706,12 +1703,11 @@ nfsrvd_symlinksub(struct nfsrv_descript nd->nd_repstat = nfsvno_getattr(ndp->ni_vp, nvap, nd->nd_cred, p, 1); } - if (vpp) { - NFSVOPUNLOCK(ndp->ni_vp, 0, p); + if (vpp != NULL && nd->nd_repstat == 0) { + VOP_UNLOCK(ndp->ni_vp, 0); *vpp = ndp->ni_vp; - } else { + } else vput(ndp->ni_vp); - } } if (dirp) { *diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p, 0); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 00:15:01 2011 (r217492) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 00:59:04 2011 (r217493) @@ -861,10 +861,14 @@ nfsrvd_compound(struct nfsrv_descript *n nfsvno_lockvfs(mp); } } + if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) + /* Lookup ops return a locked vnode */ + VOP_UNLOCK(nvp, 0); if (!nd->nd_repstat) { vrele(vp); vp = nvp; - } + } else + vrele(nvp); } if (nfsv4_opflag[op].modifyfs) NFS_ENDWRITE(mp); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 01:11:07 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21A751065670; Mon, 17 Jan 2011 01:11:07 +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 106CD8FC13; Mon, 17 Jan 2011 01:11: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 p0H1B6Ct083377; Mon, 17 Jan 2011 01:11:06 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1B6wM083375; Mon, 17 Jan 2011 01:11:06 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170111.p0H1B6wM083375@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:11: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: r217494 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:11:07 -0000 Author: rmacklem Date: Mon Jan 17 01:11:06 2011 New Revision: 217494 URL: http://svn.freebsd.org/changeset/base/217494 Log: MFC: r216898 Fix the experimental NFS server so that it doesn't leak a reference count on the directory when creating device special files. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 00:59:04 2011 (r217493) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:11:06 2011 (r217494) @@ -857,8 +857,7 @@ nfsvno_mknod(struct nameidata *ndp, stru &ndp->ni_cnd, &nvap->na_vattr); vput(ndp->ni_dvp); nfsvno_relpathbuf(ndp); - if (error) - vrele(ndp->ni_startdir); + vrele(ndp->ni_startdir); /* * Since VOP_MKNOD returns the ni_vp, I can't * see any reason to do the lookup. From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 01:26:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85278106564A; Mon, 17 Jan 2011 01:26:13 +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 71DD68FC15; Mon, 17 Jan 2011 01:26: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 p0H1QDKm083728; Mon, 17 Jan 2011 01:26:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1QDZa083717; Mon, 17 Jan 2011 01:26:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170126.p0H1QDZa083717@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:26: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: r217495 - in stable/8/sys: conf fs/nfsclient fs/nfsserver nfs nfsclient nlm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:26:13 -0000 Author: rmacklem Date: Mon Jan 17 01:26:13 2011 New Revision: 217495 URL: http://svn.freebsd.org/changeset/base/217495 Log: MFC: r216931 Fix the nlm so that it no longer depends on the regular nfs client and, as such, can be loaded for the experimental nfs client without the regular client. Modified: stable/8/sys/conf/files stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfsmount.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/nfs/nfs_lock.c stable/8/sys/nfs/nfs_mountcommon.h stable/8/sys/nfsclient/nfs_vfsops.c stable/8/sys/nfsclient/nfsmount.h stable/8/sys/nlm/nlm_advlock.c stable/8/sys/nlm/nlm_prot_impl.c Directory Properties: 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) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/conf/files Mon Jan 17 01:26:13 2011 (r217495) @@ -2659,7 +2659,7 @@ netsmb/smb_subr.c optional netsmb netsmb/smb_trantcp.c optional netsmb netsmb/smb_usr.c optional netsmb nfs/nfs_common.c optional nfsclient | nfsserver -nfs/nfs_lock.c optional nfsclient | nfscl +nfs/nfs_lock.c optional nfsclient | nfscl | nfslockd | nfsd nfsclient/bootp_subr.c optional bootp nfsclient nfsclient/krpc_subr.c optional bootp nfsclient nfsclient/nfs_bio.c optional nfsclient @@ -2675,7 +2675,7 @@ nfsserver/nfs_serv.c optional nfsserver nfsserver/nfs_srvkrpc.c optional nfsserver nfsserver/nfs_srvsubs.c optional nfsserver nfs/nfs_nfssvc.c optional nfsserver | nfscl | nfsd -nlm/nlm_advlock.c optional nfslockd nfsclient | nfsd nfsclient +nlm/nlm_advlock.c optional nfslockd | nfsd nlm/nlm_prot_clnt.c optional nfslockd | nfsd nlm/nlm_prot_impl.c optional nfslockd | nfsd nlm/nlm_prot_server.c optional nfslockd | nfsd Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Mon Jan 17 01:26:13 2011 (r217495) @@ -102,7 +102,8 @@ static int mountnfs(struct nfs_args *, s struct sockaddr *, char *, u_char *, u_char *, u_char *, struct vnode **, struct ucred *, struct thread *, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, - struct sockaddr_storage *, int *, off_t *); + struct sockaddr_storage *, int *, off_t *, + struct timeval *); static vfs_mount_t nfs_mount; static vfs_cmount_t nfs_cmount; static vfs_unmount_t nfs_unmount; @@ -1123,6 +1124,7 @@ mountnfs(struct nfs_args *argp, struct m mtx_init(&nmp->nm_sockreq.nr_mtx, "nfssock", NULL, MTX_DEF); mp->mnt_data = nmp; nmp->nm_getinfo = nfs_getnlminfo; + nmp->nm_vinvalbuf = ncl_vinvalbuf; } vfs_getnewfsid(mp); nmp->nm_mountp = mp; @@ -1465,7 +1467,8 @@ nfs_sysctl(struct mount *mp, fsctlop_t o */ static void nfs_getnlminfo(struct vnode *vp, uint8_t *fhp, size_t *fhlenp, - struct sockaddr_storage *sp, int *is_v3p, off_t *sizep) + struct sockaddr_storage *sp, int *is_v3p, off_t *sizep, + struct timeval *timeop) { struct nfsmount *nmp; struct nfsnode *np = VTONFS(vp); @@ -1481,5 +1484,9 @@ nfs_getnlminfo(struct vnode *vp, uint8_t *is_v3p = NFS_ISV3(vp); if (sizep != NULL) *sizep = np->n_size; + if (timeop != NULL) { + timeop->tv_sec = nmp->nm_timeo / NFS_HZ; + timeop->tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ); + } } Modified: stable/8/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsmount.h Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/fs/nfsclient/nfsmount.h Mon Jan 17 01:26:13 2011 (r217495) @@ -94,6 +94,7 @@ struct nfsmount { #define nm_retry nm_com.nmcom_retry #define nm_hostname nm_com.nmcom_hostname #define nm_getinfo nm_com.nmcom_getinfo +#define nm_vinvalbuf nm_com.nmcom_vinvalbuf #define NFSMNT_DIRPATH(m) (&((m)->nm_name[(m)->nm_krbnamelen + 1])) #define NFSMNT_SRVKRBNAME(m) \ Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:26:13 2011 (r217495) @@ -3142,6 +3142,7 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VF /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfsd, 1); MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1); +MODULE_DEPEND(nfsd, nfslock, 1, 1, 1); MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1); MODULE_DEPEND(nfsd, krpc, 1, 1, 1); MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1); Modified: stable/8/sys/nfs/nfs_lock.c ============================================================================== --- stable/8/sys/nfs/nfs_lock.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfs/nfs_lock.c Mon Jan 17 01:26:13 2011 (r217495) @@ -251,7 +251,7 @@ nfs_dolock(struct vop_advlock_args *ap) ASSERT_VOP_LOCKED(vp, "nfs_dolock"); nmp->nm_getinfo(vp, msg.lm_fh, &msg.lm_fh_len, &msg.lm_addr, - &msg.lm_nfsv3, NULL); + &msg.lm_nfsv3, NULL, NULL); VOP_UNLOCK(vp, 0); /* Modified: stable/8/sys/nfs/nfs_mountcommon.h ============================================================================== --- stable/8/sys/nfs/nfs_mountcommon.h Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfs/nfs_mountcommon.h Mon Jan 17 01:26:13 2011 (r217495) @@ -35,7 +35,9 @@ * a mechanism for getting the client specific info for an nfs vnode. */ typedef void nfs_getinfofromvp_ftype(struct vnode *, uint8_t *, size_t *, - struct sockaddr_storage *, int *, off_t *); + struct sockaddr_storage *, int *, off_t *, + struct timeval *); +typedef int nfs_vinvalbuf_ftype(struct vnode *, int, struct thread *, int); struct nfsmount_common { struct mtx nmcom_mtx; @@ -46,6 +48,7 @@ struct nfsmount_common { int nmcom_retry; /* Max retries */ char nmcom_hostname[MNAMELEN]; /* server's name */ nfs_getinfofromvp_ftype *nmcom_getinfo; /* Get info from nfsnode */ + nfs_vinvalbuf_ftype *nmcom_vinvalbuf; /* Invalidate buffers */ }; #endif /* _NFS_MOUNTCOMMON_H_ */ Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfsclient/nfs_vfsops.c Mon Jan 17 01:26:13 2011 (r217495) @@ -116,7 +116,8 @@ static int mountnfs(struct nfs_args *, s struct sockaddr *, char *, struct vnode **, struct ucred *cred, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, - struct sockaddr_storage *, int *, off_t *); + struct sockaddr_storage *, int *, off_t *, + struct timeval *); static vfs_mount_t nfs_mount; static vfs_cmount_t nfs_cmount; static vfs_unmount_t nfs_unmount; @@ -1205,6 +1206,7 @@ mountnfs(struct nfs_args *argp, struct m TAILQ_INIT(&nmp->nm_bufq); mp->mnt_data = nmp; nmp->nm_getinfo = nfs_getnlminfo; + nmp->nm_vinvalbuf = nfs_vinvalbuf; } vfs_getnewfsid(mp); nmp->nm_mountp = mp; @@ -1499,7 +1501,8 @@ nfs_sysctl(struct mount *mp, fsctlop_t o */ static void nfs_getnlminfo(struct vnode *vp, uint8_t *fhp, size_t *fhlenp, - struct sockaddr_storage *sp, int *is_v3p, off_t *sizep) + struct sockaddr_storage *sp, int *is_v3p, off_t *sizep, + struct timeval *timeop) { struct nfsmount *nmp; struct nfsnode *np = VTONFS(vp); @@ -1515,5 +1518,9 @@ nfs_getnlminfo(struct vnode *vp, uint8_t *is_v3p = NFS_ISV3(vp); if (sizep != NULL) *sizep = np->n_size; + if (timeop != NULL) { + timeop->tv_sec = nmp->nm_timeo / NFS_HZ; + timeop->tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ); + } } Modified: stable/8/sys/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/nfsclient/nfsmount.h Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfsclient/nfsmount.h Mon Jan 17 01:26:13 2011 (r217495) @@ -100,6 +100,7 @@ struct nfsmount { #define nm_retry nm_com.nmcom_retry #define nm_hostname nm_com.nmcom_hostname #define nm_getinfo nm_com.nmcom_getinfo +#define nm_vinvalbuf nm_com.nmcom_vinvalbuf #if defined(_KERNEL) /* Modified: stable/8/sys/nlm/nlm_advlock.c ============================================================================== --- stable/8/sys/nlm/nlm_advlock.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nlm/nlm_advlock.c Mon Jan 17 01:26:13 2011 (r217495) @@ -217,20 +217,18 @@ nlm_advlock_internal(struct vnode *vp, v ASSERT_VOP_LOCKED(vp, "nlm_advlock_1"); + nmp = VFSTONFS(vp->v_mount); /* * Push any pending writes to the server and flush our cache * so that if we are contending with another machine for a * file, we get whatever they wrote and vice-versa. */ if (op == F_SETLK || op == F_UNLCK) - nfs_vinvalbuf(vp, V_SAVE, td, 1); + nmp->nm_vinvalbuf(vp, V_SAVE, td, 1); - nmp = VFSTONFS(vp->v_mount); strcpy(servername, nmp->nm_hostname); - nmp->nm_getinfo(vp, fh.fh_bytes, &fhlen, &ss, &is_v3, &size); + nmp->nm_getinfo(vp, fh.fh_bytes, &fhlen, &ss, &is_v3, &size, &timo); sa = (struct sockaddr *) &ss; - timo.tv_sec = nmp->nm_timeo / NFS_HZ; - timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ); if (is_v3 != 0) vers = NLM_VERS4; else Modified: stable/8/sys/nlm/nlm_prot_impl.c ============================================================================== --- stable/8/sys/nlm/nlm_prot_impl.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nlm/nlm_prot_impl.c Mon Jan 17 01:26:13 2011 (r217495) @@ -2309,6 +2309,5 @@ DECLARE_MODULE(nfslockd, nfslockd_mod, S /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_DEPEND(nfslockd, krpc, 1, 1, 1); -MODULE_DEPEND(nfslockd, nfs, 1, 1, 1); MODULE_DEPEND(nfslockd, nfslock, 1, 1, 1); MODULE_VERSION(nfslockd, 1); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 01:37:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D21591065670; Mon, 17 Jan 2011 01:37:39 +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 77D3A8FC13; Mon, 17 Jan 2011 01:37: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 p0H1bd9X083995; Mon, 17 Jan 2011 01:37:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1bdvY083993; Mon, 17 Jan 2011 01:37:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170137.p0H1bdvY083993@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:37:39 +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: r217496 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:37:40 -0000 Author: rmacklem Date: Mon Jan 17 01:37:39 2011 New Revision: 217496 URL: http://svn.freebsd.org/changeset/base/217496 Log: MFC: r217017 Fix the experimental NFS server to use vfs_busyfs() instead of vfs_getvfs() so that the mount point is busied for the VFS_FHTOVP() call. This is analagous to r185432 for the regular NFS server. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:26:13 2011 (r217495) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:37:39 2011 (r217496) @@ -2548,8 +2548,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s /* * Check for the special case of the nfsv4root_fh. */ - mp = vfs_getvfs(&fhp->fh_fsid); - if (!mp) { + mp = vfs_busyfs(&fhp->fh_fsid); + if (mp == NULL) { *vpp = NULL; nd->nd_repstat = ESTALE; if (*mpp && exp->nes_vfslocked) @@ -2575,6 +2575,7 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, lktype, vpp, exp, &credanon); + vfs_unbusy(mp); /* * For NFSv4 without a pseudo root fs, unexported file handles @@ -2636,11 +2637,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s VFS_UNLOCK_GIANT(mp); exp->nes_vfslocked = 0; } - vfs_rel(mp); *vpp = NULL; *mpp = NULL; - } else { - vfs_rel(mp); } } @@ -2780,10 +2778,11 @@ nfsvno_getvp(fhandle_t *fhp) struct vnode *vp; int error; - mp = vfs_getvfs(&fhp->fh_fsid); + mp = vfs_busyfs(&fhp->fh_fsid); if (mp == NULL) return (NULL); error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp); + vfs_unbusy(mp); if (error) return (NULL); return (vp); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 01:49:48 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A84106566C; Mon, 17 Jan 2011 01:49:48 +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 D8CF08FC17; Mon, 17 Jan 2011 01:49: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 p0H1nlU1084284; Mon, 17 Jan 2011 01:49:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1nlV0084282; Mon, 17 Jan 2011 01:49:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170149.p0H1nlV0084282@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:49:47 +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: r217497 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:49:48 -0000 Author: rmacklem Date: Mon Jan 17 01:49:47 2011 New Revision: 217497 URL: http://svn.freebsd.org/changeset/base/217497 Log: MFC: r217023 Modify the experimental NFS server so that it calls vn_start_write() with a non-NULL vp. That way it will find the correct mount point mp and use that mp for the subsequent vn_finished_write() call. Also, it should fail without crashing if the mount point is being forced dismounted because vn_start_write() will set the mp NULL via VOP_GETWRITEMOUNT(). Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 01:37:39 2011 (r217496) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 01:49:47 2011 (r217497) @@ -498,7 +498,7 @@ nfsrvd_compound(struct nfsrv_descript *n u_char tag[NFSV4_SMALLSTR + 1], *tagstr; vnode_t vp, nvp, savevp; struct nfsrvfh fh; - mount_t mp, savemp; + mount_t mp, savemp, temp_mp = NULL; struct ucred *credanon; struct nfsexstuff nes, vpnes, savevpnes; static u_int64_t compref = 0; @@ -837,7 +837,7 @@ nfsrvd_compound(struct nfsrv_descript *n } VREF(vp); if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); + vn_start_write(vp, &temp_mp, V_WAIT); error = (*(nfsrv4_ops1[op]))(nd, isdgram, vp, &nvp, (fhandle_t *)fh.nfsrvfh_data, p, &vpnes); if (!error && !nd->nd_repstat) { @@ -871,7 +871,7 @@ nfsrvd_compound(struct nfsrv_descript *n vrele(nvp); } if (nfsv4_opflag[op].modifyfs) - NFS_ENDWRITE(mp); + vn_finished_write(temp_mp); } else if (nfsv4_opflag[op].retfh == 2) { if (vp == NULL || savevp == NULL) { nd->nd_repstat = NFSERR_NOFILEHANDLE; @@ -881,7 +881,7 @@ nfsrvd_compound(struct nfsrv_descript *n break; } if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); + vn_start_write(savevp, &temp_mp, V_WAIT); if (vn_lock(savevp, LK_EXCLUSIVE) == 0) { VREF(vp); VREF(savevp); @@ -890,14 +890,15 @@ nfsrvd_compound(struct nfsrv_descript *n } else nd->nd_repstat = NFSERR_PERM; if (nfsv4_opflag[op].modifyfs) - NFS_ENDWRITE(mp); + vn_finished_write(temp_mp); } else { if (nfsv4_opflag[op].retfh != 0) panic("nfsrvd_compound"); if (nfsv4_opflag[op].needscfh) { if (vp != NULL) { if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); + vn_start_write(vp, &temp_mp, + V_WAIT); if (vn_lock(vp, nfsv4_opflag[op].lktype) == 0) VREF(vp); @@ -921,7 +922,7 @@ nfsrvd_compound(struct nfsrv_descript *n error = (*(nfsrv4_ops0[op]))(nd, isdgram, vp, p, &vpnes); if (nfsv4_opflag[op].modifyfs) - NFS_ENDWRITE(mp); + vn_finished_write(temp_mp); } else { error = (*(nfsrv4_ops0[op]))(nd, isdgram, NULL, p, &vpnes); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 05:45:56 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320B9106566C; Mon, 17 Jan 2011 05:45:56 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CBE08FC12; Mon, 17 Jan 2011 05:45: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 p0H5jurv089712; Mon, 17 Jan 2011 05:45:56 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H5jtOE089685; Mon, 17 Jan 2011 05:45:55 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101170545.p0H5jtOE089685@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 17 Jan 2011 05:45: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: r217500 - in stable/8/sys: amd64/acpica amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/dev/cyclic cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 compat/linprocf... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 05:45:56 -0000 Author: lstewart Date: Mon Jan 17 05:45:55 2011 New Revision: 217500 URL: http://svn.freebsd.org/changeset/base/217500 Log: MFC r209059 (originally committed by jhb): Update several places that iterate over CPUs to use CPU_FOREACH(). Modified: stable/8/sys/amd64/acpica/madt.c stable/8/sys/amd64/amd64/legacy.c stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/8/sys/cddl/dev/cyclic/cyclic.c stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/8/sys/cddl/dev/dtrace/dtrace_debug.c stable/8/sys/cddl/dev/dtrace/dtrace_load.c stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c stable/8/sys/compat/linprocfs/linprocfs.c stable/8/sys/dev/acpica/acpi_cpu.c stable/8/sys/i386/acpica/madt.c stable/8/sys/i386/i386/legacy.c stable/8/sys/i386/i386/mp_machdep.c stable/8/sys/kern/kern_clock.c stable/8/sys/kern/kern_switch.c stable/8/sys/kern/kern_timeout.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c stable/8/sys/kern/subr_lock.c stable/8/sys/kern/subr_pcpu.c stable/8/sys/kern/subr_smp.c stable/8/sys/net/flowtable.c stable/8/sys/net/if_epair.c stable/8/sys/net/netisr.c stable/8/sys/vm/uma_core.c stable/8/sys/x86/x86/mca.c Directory Properties: 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) Modified: stable/8/sys/amd64/acpica/madt.c ============================================================================== --- stable/8/sys/amd64/acpica/madt.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/amd64/acpica/madt.c Mon Jan 17 05:45:55 2011 (r217500) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: stable/8/sys/amd64/amd64/legacy.c ============================================================================== --- stable/8/sys/amd64/amd64/legacy.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/amd64/amd64/legacy.c Mon Jan 17 05:45:55 2011 (r217500) @@ -269,12 +269,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Jan 17 05:45:55 2011 (r217500) @@ -10583,8 +10583,6 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf { #if defined(sun) cpu_t *cp; -#else - struct pcpu *cp; #endif dtrace_buffer_t *buf; @@ -10672,10 +10670,7 @@ err: #endif ASSERT(MUTEX_HELD(&dtrace_lock)); - for (i = 0; i <= mp_maxid; i++) { - if ((cp = pcpu_find(i)) == NULL) - continue; - + CPU_FOREACH(i) { if (cpu != DTRACE_CPUALL && cpu != i) continue; @@ -10715,10 +10710,7 @@ err: * Error allocating memory, so free the buffers that were * allocated before the failed allocation. */ - for (i = 0; i <= mp_maxid; i++) { - if ((cp = pcpu_find(i)) == NULL) - continue; - + CPU_FOREACH(i) { if (cpu != DTRACE_CPUALL && cpu != i) continue; @@ -12621,10 +12613,10 @@ dtrace_dstate_init(dtrace_dstate_t *dsta maxper = (limit - (uintptr_t)start) / NCPU; maxper = (maxper / dstate->dtds_chunksize) * dstate->dtds_chunksize; - for (i = 0; i < NCPU; i++) { #if !defined(sun) - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { +#else + for (i = 0; i < NCPU; i++) { #endif dstate->dtds_percpu[i].dtdsc_free = dvar = start; Modified: stable/8/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- stable/8/sys/cddl/dev/cyclic/cyclic.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/cyclic/cyclic.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1344,10 +1344,7 @@ cyclic_uninit(void) cpu_t *c; int id; - for (id = 0; id <= mp_maxid; id++) { - if (pcpu_find(id) == NULL) - continue; - + CPU_FOREACH(id) { c = &solaris_cpu[id]; if (c->cpu_cyclic == NULL) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jan 17 05:45:55 2011 (r217500) @@ -439,13 +439,10 @@ dtrace_gethrtime_init(void *arg) /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { if (i == curcpu) continue; - if (pcpu_find(i) == NULL) - continue; - map = 0; map |= (1 << curcpu); map |= (1 << i); Modified: stable/8/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Mon Jan 17 05:45:55 2011 (r217500) @@ -108,10 +108,7 @@ dtrace_debug_init(void *dummy) int i; struct dtrace_debug_data *d; - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { d = &dtrace_debug_data[i]; if (d->first == NULL) { @@ -134,10 +131,7 @@ dtrace_debug_output(void) struct dtrace_debug_data *d; uintptr_t count; - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { dtrace_debug_lock(i); d = &dtrace_debug_data[i]; Modified: stable/8/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_load.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/dtrace_load.c Mon Jan 17 05:45:55 2011 (r217500) @@ -30,8 +30,8 @@ dtrace_ap_start(void *dummy) mutex_enter(&cpu_lock); /* Setup the rest of the CPUs. */ - for (i = 1; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) + CPU_FOREACH(i) { + if (i == 0) continue; (void) dtrace_cpu_setup(CPU_CONFIG, i); Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jan 17 05:45:55 2011 (r217500) @@ -439,13 +439,10 @@ dtrace_gethrtime_init(void *arg) /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { if (i == curcpu) continue; - if (pcpu_find(i) == NULL) - continue; - map = 0; map |= (1 << curcpu); map |= (1 << i); Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/compat/linprocfs/linprocfs.c Mon Jan 17 05:45:55 2011 (r217500) @@ -473,9 +473,7 @@ linprocfs_dostat(PFS_FILL_ARGS) T2J(cp_time[CP_NICE]), T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/), T2J(cp_time[CP_IDLE])); - for (i = 0; i <= mp_maxid; ++i) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pcpu = pcpu_find(i); cp = pcpu->pc_cp_time; sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i, Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/dev/acpica/acpi_cpu.c Mon Jan 17 05:45:55 2011 (r217500) @@ -445,9 +445,7 @@ acpi_pcpu_get_id(uint32_t idx, uint32_t KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pcpu_data = pcpu_find(i); KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); if (idx-- == 0) { Modified: stable/8/sys/i386/acpica/madt.c ============================================================================== --- stable/8/sys/i386/acpica/madt.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/i386/acpica/madt.c Mon Jan 17 05:45:55 2011 (r217500) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: stable/8/sys/i386/i386/legacy.c ============================================================================== --- stable/8/sys/i386/i386/legacy.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/i386/i386/legacy.c Mon Jan 17 05:45:55 2011 (r217500) @@ -290,12 +290,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/i386/i386/mp_machdep.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1645,9 +1645,7 @@ mp_ipi_intrcnt(void *dummy) char buf[64]; int i; - for (i = 0; i < mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { snprintf(buf, sizeof(buf), "cpu%d: invltlb", i); intrcnt_add(buf, &ipi_invltlb_counts[i]); snprintf(buf, sizeof(buf), "cpu%d: invlrng", i); Modified: stable/8/sys/kern/kern_clock.c ============================================================================== --- stable/8/sys/kern/kern_clock.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/kern_clock.c Mon Jan 17 05:45:55 2011 (r217500) @@ -319,9 +319,7 @@ read_cpu_time(long *cp_time) /* Sum up global cp_time[]. */ bzero(cp_time, sizeof(long) * CPUSTATES); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); for (j = 0; j < CPUSTATES; j++) cp_time[j] += pc->pc_cp_time[j]; Modified: stable/8/sys/kern/kern_switch.c ============================================================================== --- stable/8/sys/kern/kern_switch.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/kern_switch.c Mon Jan 17 05:45:55 2011 (r217500) @@ -133,9 +133,7 @@ sysctl_stats_reset(SYSCTL_HANDLER_ARGS) if (p == oidp || p->oid_arg1 == NULL) continue; counter = (uintptr_t)p->oid_arg1; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { *(long *)(dpcpu_off[i] + counter) = 0; } } Modified: stable/8/sys/kern/kern_timeout.c ============================================================================== --- stable/8/sys/kern/kern_timeout.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/kern_timeout.c Mon Jan 17 05:45:55 2011 (r217500) @@ -228,11 +228,9 @@ start_softclock(void *dummy) panic("died while creating standard software ithreads"); cc->cc_cookie = softclock_ih; #ifdef SMP - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { if (cpu == timeout_cpu) continue; - if (CPU_ABSENT(cpu)) - continue; cc = CC_CPU(cpu); if (swi_add(NULL, "clock", softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/sched_4bsd.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1190,9 +1190,7 @@ sched_pickcpu(struct thread *td) best = td->td_lastcpu; else best = NOCPU; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) continue; @@ -1627,9 +1625,7 @@ sched_affinity(struct thread *td) */ ts = td->td_sched; ts->ts_flags &= ~TSF_AFFINITY; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) { ts->ts_flags |= TSF_AFFINITY; break; Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/sched_ule.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1254,9 +1254,7 @@ sched_setup_smp(void) int i; cpu_top = smp_topo(); - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { tdq = TDQ_CPU(i); tdq_setup(tdq); tdq->tdq_cg = smp_topo_find(cpu_top, i); @@ -2489,7 +2487,7 @@ sched_load(void) int i; total = 0; - for (i = 0; i <= mp_maxid; i++) + CPU_FOREACH(i) total += TDQ_CPU(i)->tdq_sysload; return (total); #else Modified: stable/8/sys/kern/subr_lock.c ============================================================================== --- stable/8/sys/kern/subr_lock.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/subr_lock.c Mon Jan 17 05:45:55 2011 (r217500) @@ -256,9 +256,7 @@ lock_prof_idle(void) td = curthread; thread_lock(td); - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { sched_bind(td, cpu); } sched_unbind(td); Modified: stable/8/sys/kern/subr_pcpu.c ============================================================================== --- stable/8/sys/kern/subr_pcpu.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/subr_pcpu.c Mon Jan 17 05:45:55 2011 (r217500) @@ -317,9 +317,7 @@ DB_SHOW_COMMAND(dpcpu_off, db_show_dpcpu { int id; - for (id = 0; id <= mp_maxid; id++) { - if (CPU_ABSENT(id)) - continue; + CPU_FOREACH(id) { db_printf("dpcpu_off[%2d] = 0x%jx (+ DPCPU_START = %p)\n", id, (uintmax_t)dpcpu_off[id], (void *)(uintptr_t)(dpcpu_off[id] + DPCPU_START)); Modified: stable/8/sys/kern/subr_smp.c ============================================================================== --- stable/8/sys/kern/subr_smp.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/subr_smp.c Mon Jan 17 05:45:55 2011 (r217500) @@ -395,9 +395,10 @@ smp_rendezvous_cpus(cpumask_t map, return; } - for (i = 0; i <= mp_maxid; i++) - if (((1 << i) & map) != 0 && !CPU_ABSENT(i)) + CPU_FOREACH(i) { + if (((1 << i) & map) != 0) ncpus++; + } if (ncpus == 0) panic("ncpus is 0 with map=0x%x", map); Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/net/flowtable.c Mon Jan 17 05:45:55 2011 (r217500) @@ -329,9 +329,7 @@ flowtable_show_stats(struct sbuf *sb, st if (ft->ft_flags & FL_PCPU) { bzero(&fs, sizeof(fs)); pfs = &fs; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pfs->ft_collisions += ft->ft_stats[i].ft_collisions; pfs->ft_allocated += ft->ft_stats[i].ft_allocated; pfs->ft_misses += ft->ft_stats[i].ft_misses; @@ -1495,10 +1493,7 @@ flowtable_route_flush(struct flowtable * int i; if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - + CPU_FOREACH(i) { if (smp_started == 1) { thread_lock(curthread); sched_bind(curthread, i); @@ -1527,10 +1522,7 @@ flowtable_clean_vnet(void) ft = V_flow_list_head; while (ft != NULL) { if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - + CPU_FOREACH(i) { if (smp_started == 1) { thread_lock(curthread); sched_bind(curthread, i); @@ -1800,9 +1792,7 @@ flowtable_show_vnet(void) while (ft != NULL) { printf("name: %s\n", ft->ft_name); if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { flowtable_show(ft, i); } } else { Modified: stable/8/sys/net/if_epair.c ============================================================================== --- stable/8/sys/net/if_epair.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/net/if_epair.c Mon Jan 17 05:45:55 2011 (r217500) @@ -189,10 +189,7 @@ epair_dpcpu_init(void) struct eid_list *s; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); /* Initialize per-cpu lock. */ @@ -217,10 +214,7 @@ epair_dpcpu_detach(void) struct epair_dpcpu *epair_dpcpu; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); /* Destroy per-cpu lock. */ @@ -330,10 +324,7 @@ epair_remove_ifp_from_draining(struct if struct epair_ifp_drain *elm, *tvar; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); EPAIR_LOCK(epair_dpcpu); STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, Modified: stable/8/sys/net/netisr.c ============================================================================== --- stable/8/sys/net/netisr.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/net/netisr.c Mon Jan 17 05:45:55 2011 (r217500) @@ -339,9 +339,7 @@ netisr_register(const struct netisr_hand } else netisr_proto[proto].np_qlimit = nhp->nh_qlimit; netisr_proto[proto].np_policy = nhp->nh_policy; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; bzero(npwp, sizeof(*npwp)); npwp->nw_qlimit = netisr_proto[proto].np_qlimit; @@ -373,9 +371,7 @@ netisr_clearqdrops(const struct netisr_h ("%s(%u): protocol not registered for %s", __func__, proto, name)); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; npwp->nw_qdrops = 0; } @@ -408,9 +404,7 @@ netisr_getqdrops(const struct netisr_han ("%s(%u): protocol not registered for %s", __func__, proto, name)); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; *qdropp += npwp->nw_qdrops; } @@ -474,9 +468,7 @@ netisr_setqlimit(const struct netisr_han name)); netisr_proto[proto].np_qlimit = qlimit; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; npwp->nw_qlimit = qlimit; } @@ -540,9 +532,7 @@ netisr_unregister(const struct netisr_ha netisr_proto[proto].np_m2cpuid = NULL; netisr_proto[proto].np_qlimit = 0; netisr_proto[proto].np_policy = 0; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; netisr_drain_proto(npwp); bzero(npwp, sizeof(*npwp)); @@ -1136,9 +1126,7 @@ sysctl_netisr_workstream(SYSCTL_HANDLER_ M_ZERO | M_WAITOK); counter = 0; NETISR_RLOCK(&tracker); - for (cpuid = 0; cpuid < MAXCPU; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; @@ -1192,9 +1180,7 @@ sysctl_netisr_work(SYSCTL_HANDLER_ARGS) M_TEMP, M_ZERO | M_WAITOK); counter = 0; NETISR_RLOCK(&tracker); - for (cpuid = 0; cpuid < MAXCPU; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; @@ -1243,9 +1229,7 @@ DB_SHOW_COMMAND(netisr, db_show_netisr) db_printf("%3s %6s %5s %5s %5s %8s %8s %8s %8s\n", "CPU", "Proto", "Len", "WMark", "Max", "Disp", "HDisp", "Drop", "Queue"); - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; Modified: stable/8/sys/vm/uma_core.c ============================================================================== --- stable/8/sys/vm/uma_core.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/vm/uma_core.c Mon Jan 17 05:45:55 2011 (r217500) @@ -620,9 +620,7 @@ cache_drain(uma_zone_t zone) * it is used elsewhere. Should the tear-down path be made special * there in some form? */ - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { cache = &zone->uz_cpu[cpu]; bucket_drain(zone, cache->uc_allocbucket); bucket_drain(zone, cache->uc_freebucket); @@ -3142,9 +3140,7 @@ uma_print_zone(uma_zone_t zone) zone->uz_name, zone, zone->uz_size, zone->uz_flags); LIST_FOREACH(kl, &zone->uz_kegs, kl_link) uma_print_keg(kl->kl_keg); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { cache = &zone->uz_cpu[i]; printf("CPU %d Cache:\n", i); cache_print(cache); @@ -3173,9 +3169,7 @@ uma_zone_sumstat(uma_zone_t z, int *cach allocs = frees = 0; cachefree = 0; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { cache = &z->uz_cpu[cpu]; if (cache->uc_allocbucket != NULL) cachefree += cache->uc_allocbucket->ub_cnt; Modified: stable/8/sys/x86/x86/mca.c ============================================================================== --- stable/8/sys/x86/x86/mca.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/x86/x86/mca.c Mon Jan 17 05:45:55 2011 (r217500) @@ -558,7 +558,7 @@ mca_scan(enum scan_mode mode) * If this is a bank this CPU monitors via CMCI, * update the threshold. */ - if (PCPU_GET(cmci_mask) & (1 << i)) + if (PCPU_GET(cmci_mask) & 1 << i) cmci_update(mode, i, valid, &rec); #endif } @@ -580,9 +580,7 @@ mca_scan_cpus(void *context, int pending td = curthread; count = 0; thread_lock(td); - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { sched_bind(td, cpu); thread_unlock(td); count += mca_scan(POLLED); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 15:12:29 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CADFA106564A; Mon, 17 Jan 2011 15:12:29 +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 B89868FC0A; Mon, 17 Jan 2011 15:12: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 p0HFCTEQ004018; Mon, 17 Jan 2011 15:12:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HFCTEJ004016; Mon, 17 Jan 2011 15:12:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101171512.p0HFCTEJ004016@svn.freebsd.org> From: Marius Strobl Date: Mon, 17 Jan 2011 15:12: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: r217502 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 15:12:30 -0000 Author: marius Date: Mon Jan 17 15:12:29 2011 New Revision: 217502 URL: http://svn.freebsd.org/changeset/base/217502 Log: MFC: r217415 - Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual configuration, which is used to work around issues with certain setups (see r161237) by default, should not be triggered as it may in turn cause harm in some edge cases. - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Announce PAUSE support also for manually selected 1000BASE-T, but for all manually selected media types only in full-duplex mode. Announce asymmetric PAUSE support only for manually selected 1000BASE-T. - Simplify setting the manual configuration bits to only once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. - Remove a stale comment. Reviewed by: yongari (plus additional testing) Modified: stable/8/sys/dev/mii/rgephy.c Directory Properties: 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) Modified: stable/8/sys/dev/mii/rgephy.c ============================================================================== --- stable/8/sys/dev/mii/rgephy.c Mon Jan 17 14:44:16 2011 (r217501) +++ stable/8/sys/dev/mii/rgephy.c Mon Jan 17 15:12:29 2011 (r217502) @@ -146,6 +146,13 @@ rgephy_attach(device_t dev) mii_phy_add_media(sc); printf("\n"); #undef ADD + /* + * Allow IFM_FLAG0 to be set indicating that auto-negotiation with + * manual configuration, which is used to work around issues with + * certain setups by default, should not be triggered as it may in + * turn cause harm in some edge cases. + */ + mii->mii_media.ifm_mask |= IFM_FLAG0; rgephy_reset(sc); MIIBUS_MEDIAINIT(sc->mii_dev); @@ -201,37 +208,38 @@ rgephy_service(struct mii_softc *sc, str speed = RGEPHY_S10; anar |= RGEPHY_ANAR_10_FD | RGEPHY_ANAR_10; setit: - rgephy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FLOW) != 0 && + (mii->mii_media.ifm_media & IFM_FLAG0) != 0) + return (EINVAL); + + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= RGEPHY_BMCR_FDX; gig = RGEPHY_1000CTL_AFD; anar &= ~(RGEPHY_ANAR_TX | RGEPHY_ANAR_10); + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= + RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; } else { gig = RGEPHY_1000CTL_AHD; anar &= ~(RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_10_FD); } - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, 0); - PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | - RGEPHY_BMCR_STARTNEG); - break; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= RGEPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= RGEPHY_1000CTL_MSC; + } else { + gig = 0; + anar &= ~RGEPHY_ANAR_ASP; } - - if ((ife->ifm_media & IFM_FLOW) != 0 || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) - anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; - - gig |= RGEPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0) - gig |= RGEPHY_1000CTL_MSC; + if ((mii->mii_media.ifm_media & IFM_FLAG0) == 0) + speed |= + RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG; + rgephy_loop(sc); PHY_WRITE(sc, RGEPHY_MII_1000CTL, gig); PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); + PHY_WRITE(sc, RGEPHY_MII_BMCR, speed); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); @@ -258,8 +266,7 @@ setit: /* * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. + * need to restart the autonegotiation process. */ if (rsc->mii_revision >= 2) { /* RTL8211B(L) */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 17:24:00 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EFA6106564A; Mon, 17 Jan 2011 17:24:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6F28FC13; Mon, 17 Jan 2011 17: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 p0HHO0Br007469; Mon, 17 Jan 2011 17:24:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HHO0hE007467; Mon, 17 Jan 2011 17:24:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101171724.p0HHO0hE007467@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jan 2011 17: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: r217504 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 17:24:00 -0000 Author: mav Date: Mon Jan 17 17:23:59 2011 New Revision: 217504 URL: http://svn.freebsd.org/changeset/base/217504 Log: MFC r217245: Add IDs for HighPoint RocketRAID 64x controllers. These controllers consist of two Marvell 88SE9128 6Gbps SATA chips and PLX PCIe bridge. As result, they seem to be agree to work with ahci(4) as usual HBAs. The only noticed issue is that RAID BIOS disables all drive caches during boot, though `camcontrol cmd ...` is able to fix that. Those who wants RAID functionality can still use closed proprietary driver from HighPoint site. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: 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) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Mon Jan 17 15:12:37 2011 (r217503) +++ stable/8/sys/dev/ahci/ahci.c Mon Jan 17 17:23:59 2011 (r217504) @@ -176,6 +176,8 @@ static struct { {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, {0x06221b4b, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, + {0x06401103, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, + {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 20:19:36 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF9010656B0; Mon, 17 Jan 2011 20:19:36 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1C88FC28; Mon, 17 Jan 2011 20:19: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 p0HKJaZB011788; Mon, 17 Jan 2011 20:19:36 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HKJata011786; Mon, 17 Jan 2011 20:19:36 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101172019.p0HKJata011786@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 17 Jan 2011 20:19:36 +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: r217512 - stable/8/sys/dev/if_ndis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 20:19:36 -0000 Author: bschmidt Date: Mon Jan 17 20:19:35 2011 New Revision: 217512 URL: http://svn.freebsd.org/changeset/base/217512 Log: MFC r217118: Don't try to free an unassigned pointer. Submitted by: Paul B Mahol Modified: stable/8/sys/dev/if_ndis/if_ndis.c Directory Properties: 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) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Mon Jan 17 20:15:15 2011 (r217511) +++ stable/8/sys/dev/if_ndis/if_ndis.c Mon Jan 17 20:19:35 2011 (r217512) @@ -1176,11 +1176,8 @@ ndis_rxeof_eth(adapter, ctx, addr, hdr, block = adapter; m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - - if (m == NULL) { - NdisFreePacket(p); + if (m == NULL) return; - } /* Save the data provided to us so far. */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 17 20:22:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80CDA106566B; Mon, 17 Jan 2011 20:22:03 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2F88FC0A; Mon, 17 Jan 2011 20:22: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 p0HKM3VT011892; Mon, 17 Jan 2011 20:22:03 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HKM30o011890; Mon, 17 Jan 2011 20:22:03 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101172022.p0HKM30o011890@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 17 Jan 2011 20:22:03 +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: r217513 - stable/8/sys/dev/mwl X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 20:22:03 -0000 Author: bschmidt Date: Mon Jan 17 20:22:03 2011 New Revision: 217513 URL: http://svn.freebsd.org/changeset/base/217513 Log: MFC r216835: The mwl's HAL manages an array of MWL_MBSS_MAX VAPs where the first 8 are supposed to be APs and the later 24 are pre-configured as STAs. A wrong condition during initialization is responsible for not configuring the last 8 array members. This is results in being able to create more than 8, possible uninitialized, AP-VAPs. Submitted by: Erik Fonnesbeck Modified: stable/8/sys/dev/mwl/mwlhal.c Directory Properties: 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) Modified: stable/8/sys/dev/mwl/mwlhal.c ============================================================================== --- stable/8/sys/dev/mwl/mwlhal.c Mon Jan 17 20:19:35 2011 (r217512) +++ stable/8/sys/dev/mwl/mwlhal.c Mon Jan 17 20:22:03 2011 (r217513) @@ -279,7 +279,7 @@ mwl_hal_attach(device_t dev, uint16_t de hvap->vap_type = MWL_HAL_STA; hvap->bss_type = htole16(WL_MAC_TYPE_PRIMARY_CLIENT); hvap->macid = i; - for (i++; i < MWL_MBSS_STA_MAX; i++) { + for (i++; i < MWL_MBSS_MAX; i++) { hvap = &mh->mh_vaps[i]; hvap->vap_type = MWL_HAL_STA; hvap->bss_type = htole16(WL_MAC_TYPE_SECONDARY_CLIENT); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 00:53:56 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0023C106566C; Tue, 18 Jan 2011 00:53:55 +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 E14338FC08; Tue, 18 Jan 2011 00:53: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 p0I0rtuA018784; Tue, 18 Jan 2011 00:53:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I0rtRA018778; Tue, 18 Jan 2011 00:53:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101180053.p0I0rtRA018778@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 00:53: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: r217525 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 00:53:56 -0000 Author: rmacklem Date: Tue Jan 18 00:53:55 2011 New Revision: 217525 URL: http://svn.freebsd.org/changeset/base/217525 Log: MFC: r217063 Since the VFS_LOCK_GIANT() code in the experimental NFS server is broken and the major file systems are now all mpsafe, modify the server so that it will only export mpsafe file systems. This was discussed on freebsd-fs@ and removes a fair bit of crufty code. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfs/nfsdport.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: 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) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfs/nfs_var.h Tue Jan 18 00:53:55 2011 (r217525) @@ -572,8 +572,6 @@ int nfsvno_pathconf(vnode_t, int, regist NFSPROC_T *); vnode_t nfsvno_getvp(fhandle_t *); int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *); -void nfsvno_unlockvfs(mount_t); -int nfsvno_lockvfs(mount_t); int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); uint32_t nfsrv_hashfh(fhandle_t *); Modified: stable/8/sys/fs/nfs/nfsdport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsdport.h Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfs/nfsdport.h Tue Jan 18 00:53:55 2011 (r217525) @@ -52,7 +52,6 @@ * needs to be returned by nfsd_fhtovp(). */ struct nfsexstuff { - int nes_vfslocked; /* required for all ports */ int nes_exflag; /* export flags */ int nes_numsecflavor; /* # of security flavors */ int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */ Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jan 18 00:53:55 2011 (r217525) @@ -332,18 +332,7 @@ nfsvno_namei(struct nfsrv_descript *nd, * In either case ni_startdir will be dereferenced and NULLed * out. */ - if (exp->nes_vfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; error = lookup(ndp); - /* - * The Giant lock should only change when - * crossing mount points. - */ - if (crossmnt) { - exp->nes_vfslocked = - (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - ndp->ni_cnd.cn_flags &= ~GIANTHELD; - } if (error) break; @@ -2471,7 +2460,10 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ *credp = NULL; exp->nes_numsecflavor = 0; - error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp); + if (VFS_NEEDSGIANT(mp)) + error = ESTALE; + else + error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp); if (error != 0) /* Make sure the server replies ESTALE to the client. */ error = ESTALE; @@ -2521,19 +2513,8 @@ nfsvno_pathconf(struct vnode *vp, int fl * - get vp and export rights by calling nfsvno_fhtovp() * - if cred->cr_uid == 0 or MNT_EXPORTANON set it to credanon * for AUTH_SYS - * Also handle getting the Giant lock for the file system, - * as required: - * - if same mount point as *mpp - * do nothing - * else if *mpp == NULL - * if already locked - * leave it locked - * else - * call VFS_LOCK_GIANT() - * else - * if already locked - * unlock Giant - * call VFS_LOCK_GIANT() + * - if mpp != NULL, return the mount point so that it can + * be used for vn_finished_write() by the caller */ void nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, @@ -2549,27 +2530,14 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s * Check for the special case of the nfsv4root_fh. */ mp = vfs_busyfs(&fhp->fh_fsid); + if (mpp != NULL) + *mpp = mp; if (mp == NULL) { *vpp = NULL; nd->nd_repstat = ESTALE; - if (*mpp && exp->nes_vfslocked) - VFS_UNLOCK_GIANT(*mpp); - *mpp = NULL; - exp->nes_vfslocked = 0; return; } - /* - * Now, handle Giant for the file system. - */ - if (*mpp != NULL && *mpp != mp && exp->nes_vfslocked) { - VFS_UNLOCK_GIANT(*mpp); - exp->nes_vfslocked = 0; - } - if (!exp->nes_vfslocked && *mpp != mp) - exp->nes_vfslocked = VFS_LOCK_GIANT(mp); - - *mpp = mp; if (startwrite) vn_start_write(NULL, mpp, V_WAIT); @@ -2633,12 +2601,9 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s if (nd->nd_repstat) { if (startwrite) vn_finished_write(mp); - if (exp->nes_vfslocked) { - VFS_UNLOCK_GIANT(mp); - exp->nes_vfslocked = 0; - } *vpp = NULL; - *mpp = NULL; + if (mpp != NULL) + *mpp = NULL; } } @@ -2840,29 +2805,6 @@ nfsvno_advlock(struct vnode *vp, int fty } /* - * Unlock an underlying local file system. - */ -void -nfsvno_unlockvfs(struct mount *mp) -{ - - VFS_UNLOCK_GIANT(mp); -} - -/* - * Lock an underlying file system, as required, and return - * whether or not it is locked. - */ -int -nfsvno_lockvfs(struct mount *mp) -{ - int ret; - - ret = VFS_LOCK_GIANT(mp); - return (ret); -} - -/* * Check the nfsv4 root exports. */ int Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jan 18 00:53:55 2011 (r217525) @@ -1351,7 +1351,6 @@ nfsrvd_rename(struct nfsrv_descript *nd, struct nfsvattr fdirfor, fdiraft, tdirfor, tdiraft; struct nfsexstuff tnes; struct nfsrvfh tfh; - mount_t mp = NULL; char *bufp, *tbufp = NULL; u_long *hashp; @@ -1387,9 +1386,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, return (error); } nd->nd_cred->cr_uid = nd->nd_saveduid; - /* Won't lock vfs if already locked, mp == NULL */ - tnes.nes_vfslocked = exp->nes_vfslocked; - nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, &mp, 0, p); + nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, 0, p); if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); @@ -1401,12 +1398,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (!nd->nd_repstat) { error = nfsrv_parsename(nd, tbufp, hashp, &tond.ni_pathlen); if (error) { - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } vput(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); @@ -1420,12 +1413,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, nfsrv_wcc(nd, tdirfor_ret, &tdirfor, tdiraft_ret, &tdiraft); } - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } vput(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); @@ -1445,12 +1434,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, } if (fdirp) vrele(fdirp); - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } nfsvno_relpathbuf(&tond); return (0); } @@ -1465,9 +1450,6 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (tdirp) tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p, 0); - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); if (fdirp) vrele(fdirp); if (tdirp) @@ -1505,7 +1487,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i struct nfsvattr dirfor, diraft, at; struct nfsexstuff tnes; struct nfsrvfh dfh; - mount_t mp = NULL; char *bufp; u_long *hashp; @@ -1541,9 +1522,7 @@ nfsrvd_link(struct nfsrv_descript *nd, i /* tovp is always NULL unless NFSv4 */ return (error); } - /* Won't lock vfs if already locked, mp == NULL */ - tnes.nes_vfslocked = exp->nes_vfslocked; - nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, &mp, 0, + nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, NULL, 0, p); if (dp) NFSVOPUNLOCK(dp, 0, p); @@ -1556,12 +1535,8 @@ nfsrvd_link(struct nfsrv_descript *nd, i error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) { vrele(vp); - if (dp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (dp) vrele(dp); - } nfsvno_relpathbuf(&named); return (error); } @@ -1591,9 +1566,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); vrele(dirp); } - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); vrele(vp); if (nd->nd_flag & ND_NFSV3) { nfsrv_postopattr(nd, getret, &at); @@ -3101,7 +3073,6 @@ nfsrvd_secinfo(struct nfsrv_descript *nd vnode_t dirp = NULL, vp; struct nfsrvfh fh; struct nfsexstuff retnes; - mount_t mp; u_int32_t *sizp; int error, savflag, i; char *bufp; @@ -3134,12 +3105,10 @@ nfsrvd_secinfo(struct nfsrv_descript *nd fh.nfsrvfh_len = NFSX_MYFH; vp = named.ni_vp; nd->nd_repstat = nfsvno_getfh(vp, (fhandle_t *)fh.nfsrvfh_data, p); - mp = vnode_mount(vp); /* so it won't try to re-lock filesys */ - retnes.nes_vfslocked = exp->nes_vfslocked; vput(vp); savflag = nd->nd_flag; if (!nd->nd_repstat) { - nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, &mp, 0, p); + nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0, p); if (vp) vput(vp); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jan 18 00:53:55 2011 (r217525) @@ -386,7 +386,6 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, lktype = LK_SHARED; else lktype = LK_EXCLUSIVE; - nes.nes_vfslocked = 0; if (nd->nd_flag & ND_PUBLOOKUP) nfsd_fhtovp(nd, &nfs_pubfh, lktype, &vp, &nes, &mp, nfs_writerpc[nd->nd_procnum], p); @@ -415,12 +414,8 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, if (nd->nd_repstat && (nd->nd_flag & ND_NFSV2)) { *nd->nd_errp = nfsd_errmap(nd); NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]); - if (mp != NULL) { - if (nfs_writerpc[nd->nd_procnum]) - NFS_ENDWRITE(mp); - if (nes.nes_vfslocked) - nfsvno_unlockvfs(mp); - } + if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0) + vn_finished_write(mp); return; } @@ -445,12 +440,8 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, error = (*(nfsrv3_procs0[nd->nd_procnum]))(nd, isdgram, vp, p, &nes); } - if (mp) { - if (nfs_writerpc[nd->nd_procnum]) - NFS_ENDWRITE(mp); - if (nes.nes_vfslocked) - nfsvno_unlockvfs(mp); - } + if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0) + vn_finished_write(mp); NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]); } if (error) { @@ -498,9 +489,10 @@ nfsrvd_compound(struct nfsrv_descript *n u_char tag[NFSV4_SMALLSTR + 1], *tagstr; vnode_t vp, nvp, savevp; struct nfsrvfh fh; - mount_t mp, savemp, temp_mp = NULL; + mount_t new_mp, temp_mp = NULL; struct ucred *credanon; struct nfsexstuff nes, vpnes, savevpnes; + fsid_t cur_fsid, save_fsid; static u_int64_t compref = 0; NFSVNO_EXINIT(&vpnes); @@ -597,8 +589,8 @@ nfsrvd_compound(struct nfsrv_descript *n } savevp = vp = NULL; - savevpnes.nes_vfslocked = vpnes.nes_vfslocked = 0; - savemp = mp = NULL; + save_fsid.val[0] = save_fsid.val[1] = 0; + cur_fsid.val[0] = cur_fsid.val[1] = 0; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); taglen = fxdr_unsigned(int, *tl); if (taglen < 0) { @@ -704,46 +696,44 @@ nfsrvd_compound(struct nfsrv_descript *n error = nfsrv_mtofh(nd, &fh); if (error) goto nfsmout; - if (!nd->nd_repstat) { - nes.nes_vfslocked = vpnes.nes_vfslocked; - nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, &mp, - 0, p); - } + if (!nd->nd_repstat) + nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, + NULL, 0, p); /* For now, allow this for non-export FHs */ if (!nd->nd_repstat) { if (vp) vrele(vp); vp = nvp; - NFSVOPUNLOCK(vp, 0, p); + cur_fsid = vp->v_mount->mnt_stat.f_fsid; + VOP_UNLOCK(vp, 0); vpnes = nes; } break; case NFSV4OP_PUTPUBFH: - if (nfs_pubfhset) { - nes.nes_vfslocked = vpnes.nes_vfslocked; + if (nfs_pubfhset) nfsd_fhtovp(nd, &nfs_pubfh, LK_SHARED, &nvp, - &nes, &mp, 0, p); - } else { + &nes, NULL, 0, p); + else nd->nd_repstat = NFSERR_NOFILEHANDLE; - } if (!nd->nd_repstat) { if (vp) vrele(vp); vp = nvp; - NFSVOPUNLOCK(vp, 0, p); + cur_fsid = vp->v_mount->mnt_stat.f_fsid; + VOP_UNLOCK(vp, 0); vpnes = nes; } break; case NFSV4OP_PUTROOTFH: if (nfs_rootfhset) { - nes.nes_vfslocked = vpnes.nes_vfslocked; nfsd_fhtovp(nd, &nfs_rootfh, LK_SHARED, &nvp, - &nes, &mp, 0, p); + &nes, NULL, 0, p); if (!nd->nd_repstat) { if (vp) vrele(vp); vp = nvp; - NFSVOPUNLOCK(vp, 0, p); + cur_fsid = vp->v_mount->mnt_stat.f_fsid; + VOP_UNLOCK(vp, 0); vpnes = nes; } } else @@ -759,7 +749,7 @@ nfsrvd_compound(struct nfsrv_descript *n VREF(vp); savevp = vp; savevpnes = vpnes; - savemp = mp; + save_fsid = cur_fsid; } } else { nd->nd_repstat = NFSERR_NOFILEHANDLE; @@ -771,23 +761,10 @@ nfsrvd_compound(struct nfsrv_descript *n /* If vp == savevp, a no-op */ if (vp != savevp) { VREF(savevp); - if (mp == NULL || savemp == NULL) - panic("nfscmpmp"); - if (!savevpnes.nes_vfslocked && - vpnes.nes_vfslocked) { - if (mp == savemp) - panic("nfscmp2"); - nfsvno_unlockvfs(mp); - } else if (savevpnes.nes_vfslocked && - !vpnes.nes_vfslocked) { - if (mp == savemp) - panic("nfscmp3"); - savevpnes.nes_vfslocked = nfsvno_lockvfs(savemp); - } vrele(vp); vp = savevp; vpnes = savevpnes; - mp = savemp; + cur_fsid = save_fsid; } } else { nd->nd_repstat = NFSERR_RESTOREFH; @@ -841,11 +818,14 @@ nfsrvd_compound(struct nfsrv_descript *n error = (*(nfsrv4_ops1[op]))(nd, isdgram, vp, &nvp, (fhandle_t *)fh.nfsrvfh_data, p, &vpnes); if (!error && !nd->nd_repstat) { - if (vfs_statfs(mp)->f_fsid.val[0] != - vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] || - vfs_statfs(mp)->f_fsid.val[1] != - vfs_statfs(vnode_mount(nvp))->f_fsid.val[1]) { - nd->nd_repstat = nfsvno_checkexp(vnode_mount(nvp), + if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) { + new_mp = nvp->v_mount; + if (cur_fsid.val[0] != + new_mp->mnt_stat.f_fsid.val[0] || + cur_fsid.val[1] != + new_mp->mnt_stat.f_fsid.val[1]) { + /* crossed a server mount point */ + nd->nd_repstat = nfsvno_checkexp(new_mp, nd->nd_nam, &nes, &credanon); if (!nd->nd_repstat) nd->nd_repstat = nfsd_excred(nd, @@ -853,17 +833,13 @@ nfsrvd_compound(struct nfsrv_descript *n if (credanon != NULL) crfree(credanon); if (!nd->nd_repstat) { - if (vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); - mp = vnode_mount(nvp); vpnes = nes; - vpnes.nes_vfslocked = - nfsvno_lockvfs(mp); + cur_fsid = new_mp->mnt_stat.f_fsid; } + } + /* Lookup ops return a locked vnode */ + VOP_UNLOCK(nvp, 0); } - if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) - /* Lookup ops return a locked vnode */ - VOP_UNLOCK(nvp, 0); if (!nd->nd_repstat) { vrele(vp); vp = nvp; @@ -876,7 +852,8 @@ nfsrvd_compound(struct nfsrv_descript *n if (vp == NULL || savevp == NULL) { nd->nd_repstat = NFSERR_NOFILEHANDLE; break; - } else if (mp != savemp) { + } else if (cur_fsid.val[0] != save_fsid.val[0] || + cur_fsid.val[1] != save_fsid.val[1]) { nd->nd_repstat = NFSERR_XDEV; break; } @@ -960,8 +937,6 @@ nfsmout: } else { *retopsp = txdr_unsigned(retops); } - if (mp && vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); if (vp) vrele(vp); if (savevp) From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 01:07:09 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84AA6106566B; Tue, 18 Jan 2011 01:07:09 +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 5877D8FC08; Tue, 18 Jan 2011 01:07: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 p0I1795o019161; Tue, 18 Jan 2011 01:07:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I17963019158; Tue, 18 Jan 2011 01:07:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101180107.p0I17963019158@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 01:07:09 +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: r217526 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 01:07:09 -0000 Author: rmacklem Date: Tue Jan 18 01:07:09 2011 New Revision: 217526 URL: http://svn.freebsd.org/changeset/base/217526 Log: MFC: r217066 Delete the NFS_STARTWRITE() and NFS_ENDWRITE() macros that obscured vn_start_write() and vn_finished_write() for the old OpenBSD port, since most uses have been replaced by the correct calls. Modified: stable/8/sys/fs/nfs/nfsport.h stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: 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) Modified: stable/8/sys/fs/nfs/nfsport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsport.h Tue Jan 18 00:53:55 2011 (r217525) +++ stable/8/sys/fs/nfs/nfsport.h Tue Jan 18 01:07:09 2011 (r217526) @@ -600,13 +600,6 @@ int nfsmsleep(void *, void *, int, const #define MAX_COMMIT_COUNT (1024 * 1024) /* - * These macros are called at the start and end of operations that - * might modify the underlying file system. - */ -#define NFS_STARTWRITE(v, m) vn_start_write((v), (m), V_WAIT) -#define NFS_ENDWRITE(m) vn_finished_write(m) - -/* * Define these to handle the type of va_rdev. */ #define NFSMAKEDEV(m, n) makedev((m), (n)) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jan 18 00:53:55 2011 (r217525) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jan 18 01:07:09 2011 (r217526) @@ -4092,14 +4092,14 @@ nfsrv_updatestable(NFSPROC_T *p) NFSVNO_ATTRINIT(&nva); NFSVNO_SETATTRVAL(&nva, size, 0); vp = NFSFPVNODE(sf->nsf_fp); - NFS_STARTWRITE(vp, &mp); + vn_start_write(vp, &mp, V_WAIT); if (vn_lock(vp, LK_EXCLUSIVE) == 0) { error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); VOP_UNLOCK(vp, 0); } else error = EPERM; - NFS_ENDWRITE(mp); + vn_finished_write(mp); if (!error) error = NFSD_RDWR(UIO_WRITE, vp, (caddr_t)&sf->nsf_rec, sizeof (struct nfsf_rec), (off_t)0, From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 01:20:16 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6EE106564A; Tue, 18 Jan 2011 01:20: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 494268FC17; Tue, 18 Jan 2011 01:20: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 p0I1KGFc019545; Tue, 18 Jan 2011 01:20:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I1KGfa019541; Tue, 18 Jan 2011 01:20:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101180120.p0I1KGfa019541@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 01:20:16 +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: r217527 - stable/8/sys/rpc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 01:20:16 -0000 Author: rmacklem Date: Tue Jan 18 01:20:15 2011 New Revision: 217527 URL: http://svn.freebsd.org/changeset/base/217527 Log: MFC: r217242 Fix a bug in the client side krpc where it was, sometimes erroneously, assumed that 4 bytes of data were in the first mbuf of a list by replacing the bcopy() with m_copydata(). Also, replace the uses of m_pullup(), which can fail for reasons other than not enough data, with m_copydata(). For the cases where it isn't known that there is enough data in the mbuf list, check first via m_len and m_length(). This is believed to fix a problem reported by dpd at dpdtech.com and george+freebsd at m5p.com. Modified: stable/8/sys/rpc/clnt_dg.c stable/8/sys/rpc/clnt_vc.c stable/8/sys/rpc/svc_vc.c Directory Properties: 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) Modified: stable/8/sys/rpc/clnt_dg.c ============================================================================== --- stable/8/sys/rpc/clnt_dg.c Tue Jan 18 01:07:09 2011 (r217526) +++ stable/8/sys/rpc/clnt_dg.c Tue Jan 18 01:20:15 2011 (r217527) @@ -1089,15 +1089,14 @@ clnt_dg_soupcall(struct socket *so, void /* * The XID is in the first uint32_t of the reply. */ - if (m->m_len < sizeof(xid)) - m = m_pullup(m, sizeof(xid)); - if (!m) + if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid)) /* * Should never happen. */ continue; - xid = ntohl(*mtod(m, uint32_t *)); + m_copydata(m, 0, sizeof(xid), (char *)&xid); + xid = ntohl(xid); /* * Attempt to match this reply with a pending request. Modified: stable/8/sys/rpc/clnt_vc.c ============================================================================== --- stable/8/sys/rpc/clnt_vc.c Tue Jan 18 01:07:09 2011 (r217526) +++ stable/8/sys/rpc/clnt_vc.c Tue Jan 18 01:20:15 2011 (r217527) @@ -916,7 +916,7 @@ clnt_vc_soupcall(struct socket *so, void mtx_unlock(&ct->ct_lock); break; } - bcopy(mtod(m, uint32_t *), &header, sizeof(uint32_t)); + m_copydata(m, 0, sizeof(uint32_t), (char *)&header); header = ntohl(header); ct->ct_record = NULL; ct->ct_record_resid = header & 0x7fffffff; @@ -975,14 +975,11 @@ clnt_vc_soupcall(struct socket *so, void * The XID is in the first uint32_t of * the reply. */ - if (ct->ct_record->m_len < sizeof(xid)) - ct->ct_record = - m_pullup(ct->ct_record, - sizeof(xid)); - if (!ct->ct_record) + if (ct->ct_record->m_len < sizeof(xid) && + m_length(ct->ct_record, NULL) < sizeof(xid)) break; - bcopy(mtod(ct->ct_record, uint32_t *), - &xid, sizeof(uint32_t)); + m_copydata(ct->ct_record, 0, sizeof(xid), + (char *)&xid); xid = ntohl(xid); mtx_lock(&ct->ct_lock); Modified: stable/8/sys/rpc/svc_vc.c ============================================================================== --- stable/8/sys/rpc/svc_vc.c Tue Jan 18 01:07:09 2011 (r217526) +++ stable/8/sys/rpc/svc_vc.c Tue Jan 18 01:20:15 2011 (r217527) @@ -559,11 +559,8 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms } if (n < sizeof(uint32_t)) goto readmore; - if (cd->mpending->m_len < sizeof(uint32_t)) - cd->mpending = m_pullup(cd->mpending, - sizeof(uint32_t)); - memcpy(&header, mtod(cd->mpending, uint32_t *), - sizeof(header)); + m_copydata(cd->mpending, 0, sizeof(header), + (char *)&header); header = ntohl(header); cd->eor = (header & 0x80000000) != 0; cd->resid = header & 0x7fffffff; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 06:24:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 358D5106566B; Tue, 18 Jan 2011 06:24:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242BA8FC12; Tue, 18 Jan 2011 06:24: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 p0I6Orov027841; Tue, 18 Jan 2011 06:24:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I6Or1o027839; Tue, 18 Jan 2011 06:24:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101180624.p0I6Or1o027839@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 18 Jan 2011 06:24:53 +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: r217530 - stable/8/sys/geom/nop X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 06:24:53 -0000 Author: ae Date: Tue Jan 18 06:24:52 2011 New Revision: 217530 URL: http://svn.freebsd.org/changeset/base/217530 Log: MFC r217262: Round GNOP provider's mediasize to its sectorsize. This prevents KASSERT in g_io_request when geom classes doing tasting. PR: kern/147852 MFC r217263: Remove redundant check. Modified: stable/8/sys/geom/nop/g_nop.c Directory Properties: 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) Modified: stable/8/sys/geom/nop/g_nop.c ============================================================================== --- stable/8/sys/geom/nop/g_nop.c Tue Jan 18 04:54:43 2011 (r217529) +++ stable/8/sys/geom/nop/g_nop.c Tue Jan 18 06:24:52 2011 (r217530) @@ -176,6 +176,7 @@ g_nop_create(struct gctl_req *req, struc gctl_error(req, "Invalid secsize for provider %s.", pp->name); return (EINVAL); } + size -= size % secsize; snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX); LIST_FOREACH(gp, &mp->geom, geom) { if (strcmp(gp->name, name) == 0) { From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 10:42:14 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 433D7106564A; Tue, 18 Jan 2011 10:42:14 +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 3159A8FC17; Tue, 18 Jan 2011 10:42: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 p0IAgEq0034194; Tue, 18 Jan 2011 10:42:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IAgDsL034185; Tue, 18 Jan 2011 10:42:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101181042.p0IAgDsL034185@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jan 2011 10:42: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: r217532 - in stable/8/sys: dev/random geom kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 10:42:14 -0000 Author: kib Date: Tue Jan 18 10:42:13 2011 New Revision: 217532 URL: http://svn.freebsd.org/changeset/base/217532 Log: MFC r216952: Mark some devices as eternal. Modified: stable/8/sys/dev/random/randomdev.c stable/8/sys/geom/geom_ctl.c stable/8/sys/kern/kern_descrip.c stable/8/sys/kern/subr_bus.c stable/8/sys/kern/subr_devstat.c stable/8/sys/kern/subr_log.c stable/8/sys/kern/tty.c stable/8/sys/kern/tty_tty.c Directory Properties: 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) Modified: stable/8/sys/dev/random/randomdev.c ============================================================================== --- stable/8/sys/dev/random/randomdev.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/dev/random/randomdev.c Tue Jan 18 10:42:13 2011 (r217532) @@ -195,8 +195,8 @@ random_modevent(module_t mod __unused, i printf("random: \n", random_systat.ident); - random_dev = make_dev(&random_cdevsw, RANDOM_MINOR, - UID_ROOT, GID_WHEEL, 0666, "random"); + random_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &random_cdevsw, + RANDOM_MINOR, NULL, UID_ROOT, GID_WHEEL, 0666, "random"); make_dev_alias(random_dev, "urandom"); /* XXX Deprecated */ break; Modified: stable/8/sys/geom/geom_ctl.c ============================================================================== --- stable/8/sys/geom/geom_ctl.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/geom/geom_ctl.c Tue Jan 18 10:42:13 2011 (r217532) @@ -75,7 +75,7 @@ void g_ctl_init(void) { - make_dev(&g_ctl_cdevsw, 0, + make_dev_credf(MAKEDEV_ETERNAL, &g_ctl_cdevsw, 0, NULL, UID_ROOT, GID_OPERATOR, 0640, PATH_GEOM_CTL); KASSERT(GCTL_PARAM_RD == VM_PROT_READ, ("GCTL_PARAM_RD != VM_PROT_READ")); Modified: stable/8/sys/kern/kern_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/kern_descrip.c Tue Jan 18 10:42:13 2011 (r217532) @@ -3430,11 +3430,14 @@ fildesc_drvinit(void *unused) { struct cdev *dev; - dev = make_dev(&fildesc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "fd/0"); + dev = make_dev_credf(MAKEDEV_ETERNAL, &fildesc_cdevsw, 0, NULL, + UID_ROOT, GID_WHEEL, 0666, "fd/0"); make_dev_alias(dev, "stdin"); - dev = make_dev(&fildesc_cdevsw, 1, UID_ROOT, GID_WHEEL, 0666, "fd/1"); + dev = make_dev_credf(MAKEDEV_ETERNAL, &fildesc_cdevsw, 1, NULL, + UID_ROOT, GID_WHEEL, 0666, "fd/1"); make_dev_alias(dev, "stdout"); - dev = make_dev(&fildesc_cdevsw, 2, UID_ROOT, GID_WHEEL, 0666, "fd/2"); + dev = make_dev_credf(MAKEDEV_ETERNAL, &fildesc_cdevsw, 2, NULL, + UID_ROOT, GID_WHEEL, 0666, "fd/2"); make_dev_alias(dev, "stderr"); } Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/subr_bus.c Tue Jan 18 10:42:13 2011 (r217532) @@ -405,8 +405,8 @@ static struct cdev *devctl_dev; static void devinit(void) { - devctl_dev = make_dev(&dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "devctl"); + devctl_dev = make_dev_credf(MAKEDEV_ETERNAL, &dev_cdevsw, 0, NULL, + UID_ROOT, GID_WHEEL, 0600, "devctl"); mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF); cv_init(&devsoftc.cv, "dev cv"); TAILQ_INIT(&devsoftc.devq); Modified: stable/8/sys/kern/subr_devstat.c ============================================================================== --- stable/8/sys/kern/subr_devstat.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/subr_devstat.c Tue Jan 18 10:42:13 2011 (r217532) @@ -475,7 +475,7 @@ devstat_alloc(void) mtx_assert(&devstat_mutex, MA_NOTOWNED); if (!once) { - make_dev(&devstat_cdevsw, 0, + make_dev_credf(MAKEDEV_ETERNAL, &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME); once = 1; } Modified: stable/8/sys/kern/subr_log.c ============================================================================== --- stable/8/sys/kern/subr_log.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/subr_log.c Tue Jan 18 10:42:13 2011 (r217532) @@ -247,7 +247,8 @@ static void log_drvinit(void *unused) { - make_dev(&log_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "klog"); + make_dev_credf(MAKEDEV_ETERNAL, &log_cdevsw, 0, NULL, UID_ROOT, + GID_WHEEL, 0600, "klog"); } SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,log_drvinit,NULL); Modified: stable/8/sys/kern/tty.c ============================================================================== --- stable/8/sys/kern/tty.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/tty.c Tue Jan 18 10:42:13 2011 (r217532) @@ -1924,8 +1924,8 @@ static void ttyconsdev_init(void *unused) { - dev_console = make_dev(&ttyconsdev_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0600, "console"); + dev_console = make_dev_credf(MAKEDEV_ETERNAL, &ttyconsdev_cdevsw, 0, + NULL, UID_ROOT, GID_WHEEL, 0600, "console"); } SYSINIT(tty, SI_SUB_DRIVERS, SI_ORDER_FIRST, ttyconsdev_init, NULL); Modified: stable/8/sys/kern/tty_tty.c ============================================================================== --- stable/8/sys/kern/tty_tty.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/tty_tty.c Tue Jan 18 10:42:13 2011 (r217532) @@ -87,7 +87,8 @@ ctty_drvinit(void *unused) { EVENTHANDLER_REGISTER(dev_clone, ctty_clone, 0, 1000); - ctty = make_dev(&ctty_cdevsw, 0, 0, 0, 0666, "ctty"); + ctty = make_dev_credf(MAKEDEV_ETERNAL, &ctty_cdevsw, 0, NULL, UID_ROOT, + GID_WHEEL, 0666, "ctty"); } SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ctty_drvinit,NULL); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 11:51:48 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746031065673; Tue, 18 Jan 2011 11:51:48 +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 6280A8FC17; Tue, 18 Jan 2011 11:51: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 p0IBpmFD037080; Tue, 18 Jan 2011 11:51:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IBpmVG037071; Tue, 18 Jan 2011 11:51:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101181151.p0IBpmVG037071@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jan 2011 11:51:48 +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: r217533 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 11:51:48 -0000 Author: marius Date: Tue Jan 18 11:51:48 2011 New Revision: 217533 URL: http://svn.freebsd.org/changeset/base/217533 Log: MFC: r217464, r217468, r217475 Add a manual page for rgephy(4) and reference it as appropriate. The motivation for having rgephy.4 is to document the special media option added in r217415 (MFC'ed to stable/8 in r217502). Added: stable/8/share/man/man4/rgephy.4 - copied, changed from r217464, head/share/man/man4/rgephy.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/axe.4 stable/8/share/man/man4/miibus.4 stable/8/share/man/man4/nfe.4 stable/8/share/man/man4/nve.4 stable/8/share/man/man4/re.4 stable/8/share/man/man4/sge.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/Makefile Tue Jan 18 11:51:48 2011 (r217533) @@ -331,6 +331,7 @@ MAN= aac.4 \ random.4 \ rc.4 \ re.4 \ + rgephy.4 \ rl.4 \ rndtest.4 \ route.4 \ Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/axe.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -206,6 +206,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: stable/8/share/man/man4/miibus.4 ============================================================================== --- stable/8/share/man/man4/miibus.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/miibus.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 15, 2011 .Dt MIIBUS 4 .Os .Sh NAME @@ -157,6 +157,7 @@ but as a result are not well behaved new .Xr nve 4 , .Xr pcn 4 , .Xr re 4 , +.Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , Modified: stable/8/share/man/man4/nfe.4 ============================================================================== --- stable/8/share/man/man4/nfe.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/nfe.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2008 +.Dd January, 2011 .Dt NFE 4 .Os .Sh NAME @@ -174,6 +174,7 @@ before a change takes effect. .Xr netintro 4 , .Xr pci 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY Modified: stable/8/share/man/man4/nve.4 ============================================================================== --- stable/8/share/man/man4/nve.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/nve.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ bandwidth show that the card is actually .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/re.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2010 +.Dd January, 2011 .Dt RE 4 .Os .Sh NAME @@ -213,6 +213,7 @@ the network connection (cable). .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Rs Copied and modified: stable/8/share/man/man4/rgephy.4 (from r217464, head/share/man/man4/rgephy.4) ============================================================================== --- head/share/man/man4/rgephy.4 Sat Jan 15 22:07:08 2011 (r217464, copy source) +++ stable/8/share/man/man4/rgephy.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -69,7 +69,7 @@ the .Nm driver by default also triggers an autonegotiation advertising the selected media. -This is done in order work around hardware issues in certain scenarios. +This is done in order to work around hardware issues in certain scenarios. It is believed that this behavior does not cause harm in general but in fact can have an adverse effect in edge cases. In order to manually set the media type and options without also triggering Modified: stable/8/share/man/man4/sge.4 ============================================================================== --- stable/8/share/man/man4/sge.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/sge.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 16:49:52 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C2C2106564A; Tue, 18 Jan 2011 16:49:52 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EECEB8FC16; Tue, 18 Jan 2011 16:49: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 p0IGnpgb044367; Tue, 18 Jan 2011 16:49:51 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IGnpor044365; Tue, 18 Jan 2011 16:49:51 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201101181649.p0IGnpor044365@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 18 Jan 2011 16:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217544 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 16:49:52 -0000 Author: jh Date: Tue Jan 18 16:49:51 2011 New Revision: 217544 URL: http://svn.freebsd.org/changeset/base/217544 Log: MFC r205682: Support only LOOKUP operation for "/" in relookup() because lookup() can't succeed for CREATE, DELETE and RENAME. Modified: stable/8/sys/kern/vfs_lookup.c Directory Properties: 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) Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Tue Jan 18 16:43:01 2011 (r217543) +++ stable/8/sys/kern/vfs_lookup.c Tue Jan 18 16:49:51 2011 (r217544) @@ -948,19 +948,17 @@ relookup(struct vnode *dvp, struct vnode #endif /* - * Check for degenerate name (e.g. / or "") - * which is a way of talking about a directory, - * e.g. like "/." or ".". + * Check for "" which represents the root directory after slash + * removal. */ if (cnp->cn_nameptr[0] == '\0') { - if (cnp->cn_nameiop != LOOKUP || wantparent) { - error = EISDIR; - goto bad; - } - if (dp->v_type != VDIR) { - error = ENOTDIR; - goto bad; - } + /* + * Support only LOOKUP for "/" because lookup() + * can't succeed for CREATE, DELETE and RENAME. + */ + KASSERT(cnp->cn_nameiop == LOOKUP, ("nameiop must be LOOKUP")); + KASSERT(dp->v_type == VDIR, ("dp is not a directory")); + if (!(cnp->cn_flags & LOCKLEAF)) VOP_UNLOCK(dp, 0); *vpp = dp; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 19:31:40 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87281065672; Tue, 18 Jan 2011 19:31:40 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FED08FC15; Tue, 18 Jan 2011 19:31: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 p0IJVcr6049233; Tue, 18 Jan 2011 19:31:38 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IJVc20049228; Tue, 18 Jan 2011 19:31:38 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201101181931.p0IJVc20049228@svn.freebsd.org> From: Tony Finch Date: Tue, 18 Jan 2011 19:31:38 +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: r217551 - stable/8/usr.bin/unifdef X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 19:31:40 -0000 Author: fanf Date: Tue Jan 18 19:31:38 2011 New Revision: 217551 URL: http://svn.freebsd.org/changeset/base/217551 Log: MFC unifdef-2.5 Modified: stable/8/usr.bin/unifdef/Makefile stable/8/usr.bin/unifdef/unifdef.1 stable/8/usr.bin/unifdef/unifdef.c stable/8/usr.bin/unifdef/unifdefall.sh Directory Properties: stable/8/usr.bin/unifdef/ (props changed) Modified: stable/8/usr.bin/unifdef/Makefile ============================================================================== --- stable/8/usr.bin/unifdef/Makefile Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/Makefile Tue Jan 18 19:31:38 2011 (r217551) @@ -4,6 +4,5 @@ PROG= unifdef SCRIPTS=unifdefall.sh MLINKS= unifdef.1 unifdefall.1 -WARNS?= 5 .include Modified: stable/8/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.1 Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/unifdef.1 Tue Jan 18 19:31:38 2011 (r217551) @@ -1,6 +1,6 @@ .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +.\" Copyright (c) 2002 - 2010 Tony Finch . All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. @@ -29,11 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)unifdef.1 8.2 (Berkeley) 4/1/94 -.\" $dotat: unifdef/unifdef.1,v 1.60 2009/11/25 00:11:02 fanf2 Exp $ .\" $FreeBSD$ .\" -.Dd September 24, 2002 +.Dd March 11, 2010 .Dt UNIFDEF 1 .Os .Sh NAME @@ -41,14 +39,15 @@ .Nd remove preprocessor conditionals from code .Sh SYNOPSIS .Nm -.Op Fl BbcdeKknst +.Op Fl bBcdeKknsStV .Op Fl I Ns Ar path .Op Fl D Ns Ar sym Ns Op = Ns Ar val .Op Fl U Ns Ar sym .Op Fl iD Ns Ar sym Ns Op = Ns Ar val .Op Fl iU Ns Ar sym .Ar ... -.Op Ar file +.Op Fl o Ar outfile +.Op Ar infile .Nm unifdefall .Op Fl I Ns Ar path .Ar ... @@ -167,26 +166,22 @@ with appropriate arguments to process th .Sh OPTIONS .Pp .Bl -tag -width indent -compact -.It Fl D Ns Ar sym Ns Op = Ns Ar val -Specify that a symbol is defined, -and optionally specify what value to give it -for the purpose of handling +.It Fl D Ns Ar sym Ns = Ns Ar val +Specify that a symbol is defined to a given value +which is used when evaluating .Ic #if and .Ic #elif -directives. +control expressions. +.Pp +.It Fl D Ns Ar sym +Specify that a symbol is defined to the value 1. .Pp .It Fl U Ns Ar sym Specify that a symbol is undefined. If the same symbol appears in more than one argument, the last occurrence dominates. .Pp -.It Fl B -Compress blank lines around a deleted section. -Mutually exclusive with the -.Fl b -option. -.Pp .It Fl b Replace removed lines with blank lines instead of deleting them. @@ -194,6 +189,12 @@ Mutually exclusive with the .Fl B option. .Pp +.It Fl B +Compress blank lines around a deleted section. +Mutually exclusive with the +.Fl b +option. +.Pp .It Fl c If the .Fl c @@ -205,7 +206,7 @@ i.e., the lines that would have been rem are retained and vice versa. .Pp .It Fl d -Turn on printing of degugging messages. +Turn on printing of debugging messages. .Pp .It Fl e Because @@ -254,6 +255,18 @@ directives to the output following any d so that errors produced when compiling the output file correspond to line numbers in the input file. .Pp +.It Fl o Ar outfile +Write output to the file +.Ar outfile +instead of the standard output. +If +.Ar outfile +is the same as the input file, +the output is written to a temporary file +which is renamed into place when +.Nm +completes successfully. +.Pp .It Fl s Instead of processing the input file as usual, this option causes @@ -270,6 +283,13 @@ for creating .Nm command lines. .Pp +.It Fl S +Like the +.Fl s +option, but the nesting depth of each symbol is also printed. +This is useful for working out the number of possible combinations +of interdependent defined/undefined symbols. +.Pp .It Fl t Disables parsing for C comments and line continuations, @@ -314,6 +334,9 @@ for compatibility with .Xr cpp 1 and to simplify the implementation of .Nm unifdefall . +.Pp +.It Fl V +Print version details. .El .Pp The Modified: stable/8/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.c Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/unifdef.c Tue Jan 18 19:31:38 2011 (r217551) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2009 Tony Finch + * Copyright (c) 2002 - 2010 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,27 +24,14 @@ */ /* + * unifdef - remove ifdef'ed lines + * * This code was derived from software contributed to Berkeley by Dave Yost. * It was rewritten to support ANSI C by Tony Finch. The original version * of unifdef carried the 4-clause BSD copyright licence. None of its code * remains in this version (though some of the names remain) so it now * carries a more liberal licence. * - * The latest version is available from http://dotat.at/prog/unifdef - */ - -#include - -#ifdef __IDSTRING -__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $"); -#endif -#ifdef __FBSDID -__FBSDID("$FreeBSD$"); -#endif - -/* - * unifdef - remove ifdef'ed lines - * * Wishlist: * provide an option which will append the name of the * appropriate symbol after #else's and #endif's @@ -52,12 +39,16 @@ __FBSDID("$FreeBSD$"); * #else's and #endif's to see that they match their * corresponding #ifdef or #ifndef * - * The first two items above require better buffer handling, which would - * also make it possible to handle all "dodgy" directives correctly. + * These require better buffer handling, which would also make + * it possible to handle all "dodgy" directives correctly. */ +#include +#include + #include #include +#include #include #include #include @@ -65,6 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include +const char copyright[] = + "@(#) $Version: unifdef-2.5 $\n" + "@(#) $FreeBSD$\n" + "@(#) $Author: Tony Finch (dot@dotat.at) $\n" + "@(#) $URL: http://dotat.at/prog/unifdef $\n" +; + /* types of input lines: */ typedef enum { LT_TRUEI, /* a true #if with ignore flag */ @@ -157,6 +155,11 @@ static char const * const linestate_name #define EDITSLOP 10 /* + * For temporary filenames + */ +#define TEMPLATE "unifdef.XXXXXX" + +/* * Globals. */ @@ -169,6 +172,7 @@ static bool strictlogic; /* static bool killconsts; /* -k: eval constant #ifs */ static bool lnnum; /* -n: add #line directives */ static bool symlist; /* -s: output symbol list */ +static bool symdepth; /* -S: output symbol depth */ static bool text; /* -t: this is a text file */ static const char *symname[MAXSYMS]; /* symbol name */ @@ -179,10 +183,18 @@ static int nsyms; /* numb static FILE *input; /* input file pointer */ static const char *filename; /* input file name */ static int linenum; /* current line number */ +static FILE *output; /* output file pointer */ +static const char *ofilename; /* output file name */ +static bool overwriting; /* output overwrites input */ +static char tempname[FILENAME_MAX]; /* used when overwriting */ static char tline[MAXLINE+EDITSLOP];/* input buffer plus space */ static char *keyword; /* used for editing #elif's */ +static const char *newline; /* input file format */ +static const char newline_unix[] = "\n"; +static const char newline_crlf[] = "\r\n"; + static Comment_state incomment; /* comment parser state */ static Line_state linestate; /* #if line parser state */ static Ifstate ifstate[MAXDEPTH]; /* #if processor state */ @@ -193,10 +205,13 @@ static int delcount; /* co static unsigned blankcount; /* count of blank lines */ static unsigned blankmax; /* maximum recent blankcount */ static bool constexpr; /* constant #if expression */ +static bool zerosyms = true; /* to format symdepth output */ +static bool firstsym; /* ditto */ static int exitstat; /* program exit status */ static void addsym(bool, bool, char *); +static void closeout(void); static void debug(const char *, ...); static void done(void); static void error(const char *); @@ -216,6 +231,7 @@ static void state(Ifstate); static int strlcmp(const char *, const char *, size_t); static void unnest(void); static void usage(void); +static void version(void); #define endsym(c) (!isalnum((unsigned char)c) && c != '_') @@ -227,7 +243,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:I:o:bBcdeKklnsStV")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -249,16 +265,15 @@ main(int argc, char *argv[]) case 'U': /* undef a symbol */ addsym(false, false, optarg); break; - case 'I': - /* no-op for compatibility with cpp */ - break; - case 'B': /* compress blank lines around removed section */ - compblank = true; + case 'I': /* no-op for compatibility with cpp */ break; case 'b': /* blank deleted lines instead of omitting them */ case 'l': /* backwards compatibility */ lnblank = true; break; + case 'B': /* compress blank lines around removed section */ + compblank = true; + break; case 'c': /* treat -D as -U and vice versa */ complement = true; break; @@ -277,12 +292,20 @@ main(int argc, char *argv[]) case 'n': /* add #line directive after deleted lines */ lnnum = true; break; + case 'o': /* output to a file */ + ofilename = optarg; + break; case 's': /* only output list of symbols that control #ifs */ symlist = true; break; + case 'S': /* list symbols with their nesting depth */ + symlist = symdepth = true; + break; case 't': /* don't parse C comments */ text = true; break; + case 'V': /* print version */ + version(); default: usage(); } @@ -294,21 +317,68 @@ main(int argc, char *argv[]) errx(2, "can only do one file"); } else if (argc == 1 && strcmp(*argv, "-") != 0) { filename = *argv; - input = fopen(filename, "r"); + input = fopen(filename, "rb"); if (input == NULL) err(2, "can't open %s", filename); } else { filename = "[stdin]"; input = stdin; } + if (ofilename == NULL) { + ofilename = "[stdout]"; + output = stdout; + } else { + struct stat ist, ost; + if (stat(ofilename, &ost) == 0 && + fstat(fileno(input), &ist) == 0) + overwriting = (ist.st_dev == ost.st_dev + && ist.st_ino == ost.st_ino); + if (overwriting) { + const char *dirsep; + int ofd; + + dirsep = strrchr(ofilename, '/'); + if (dirsep != NULL) + snprintf(tempname, sizeof(tempname), + "%.*s/" TEMPLATE, + (int)(dirsep - ofilename), ofilename); + else + snprintf(tempname, sizeof(tempname), + TEMPLATE); + ofd = mkstemp(tempname); + if (ofd != -1) + output = fdopen(ofd, "wb+"); + if (output == NULL) + err(2, "can't create temporary file"); + fchmod(ofd, ist.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)); + } else { + output = fopen(ofilename, "wb"); + if (output == NULL) + err(2, "can't open %s", ofilename); + } + } process(); abort(); /* bug */ } static void +version(void) +{ + const char *c = copyright; + for (;;) { + while (*++c != '$') + if (*c == '\0') + exit(0); + while (*++c != '$') + putc(*c, stderr); + putc('\n', stderr); + } +} + +static void usage(void) { - fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" + fprintf(stderr, "usage: unifdef [-bBcdeKknsStV] [-Ipath]" " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); exit(2); } @@ -326,7 +396,8 @@ usage(void) * When we have processed a group that starts off with a known-false * #if/#elif sequence (which has therefore been deleted) followed by a * #elif that we don't understand and therefore must keep, we edit the - * latter into a #if to keep the nesting correct. + * latter into a #if to keep the nesting correct. We use strncpy() to + * overwrite the 4 byte token "elif" with "if " without a '\0' byte. * * When we find a true #elif in a group, the following block will * always be kept and the rest of the sequence after the next #elif or @@ -379,11 +450,11 @@ static void Oelif (void) { if (!iocccok) static void Idrop (void) { Fdrop(); ignoreon(); } static void Itrue (void) { Ftrue(); ignoreon(); } static void Ifalse(void) { Ffalse(); ignoreon(); } -/* edit this line */ +/* modify this line */ static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } -static void Mtrue (void) { keywordedit("else\n"); state(IS_TRUE_MIDDLE); } -static void Melif (void) { keywordedit("endif\n"); state(IS_FALSE_TRAILER); } -static void Melse (void) { keywordedit("endif\n"); state(IS_FALSE_ELSE); } +static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } +static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } +static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } static state_fn * const trans_table[IS_COUNT][LT_COUNT] = { /* IS_OUTSIDE */ @@ -435,13 +506,6 @@ static state_fn * const trans_table[IS_C * State machine utility functions */ static void -done(void) -{ - if (incomment) - error("EOF in comment"); - exit(exitstat); -} -static void ignoreoff(void) { if (depth == 0) @@ -456,7 +520,8 @@ ignoreon(void) static void keywordedit(const char *replacement) { - strlcpy(keyword, replacement, tline + sizeof(tline) - keyword); + snprintf(keyword, tline + sizeof(tline) - keyword, + "%s%s", replacement, newline); print(); } static void @@ -491,24 +556,26 @@ flushline(bool keep) if (symlist) return; if (keep ^ complement) { - bool blankline = tline[strspn(tline, " \t\n")] == '\0'; + bool blankline = tline[strspn(tline, " \t\r\n")] == '\0'; if (blankline && compblank && blankcount != blankmax) { delcount += 1; blankcount += 1; } else { if (lnnum && delcount > 0) - printf("#line %d\n", linenum); - fputs(tline, stdout); + printf("#line %d%s", linenum, newline); + fputs(tline, output); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { if (lnblank) - putc('\n', stdout); + fputs(newline, output); exitstat = 1; delcount += 1; blankcount = 0; } + if (debugging) + fflush(output); } /* @@ -517,22 +584,55 @@ flushline(bool keep) static void process(void) { - Linetype lineval; - /* When compressing blank lines, act as if the file is preceded by a large number of blank lines. */ blankmax = blankcount = 1000; for (;;) { - linenum++; - lineval = parseline(); + Linetype lineval = parseline(); trans_table[ifstate[depth]][lineval](); - debug("process %s -> %s depth %d", - linetype_name[lineval], + debug("process line %d %s -> %s depth %d", + linenum, linetype_name[lineval], ifstate_name[ifstate[depth]], depth); } } /* + * Flush the output and handle errors. + */ +static void +closeout(void) +{ + if (symdepth && !zerosyms) + printf("\n"); + if (fclose(output) == EOF) { + warn("couldn't write to %s", ofilename); + if (overwriting) { + unlink(tempname); + errx(2, "%s unchanged", filename); + } else { + exit(2); + } + } +} + +/* + * Clean up and exit. + */ +static void +done(void) +{ + if (incomment) + error("EOF in comment"); + closeout(); + if (overwriting && rename(tempname, ofilename) == -1) { + warn("couldn't rename temporary file"); + unlink(tempname); + errx(2, "%s unchanged", ofilename); + } + exit(exitstat); +} + +/* * Parse a line and determine its type. We keep the preprocessor line * parser state between calls in the global variable linestate, with * help from skipcomment(). @@ -546,14 +646,22 @@ parseline(void) Linetype retval; Comment_state wascomment; + linenum++; if (fgets(tline, MAXLINE, input) == NULL) return (LT_EOF); + if (newline == NULL) { + if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) + newline = newline_crlf; + else + newline = newline_unix; + } retval = LT_PLAIN; wascomment = incomment; cp = skipcomment(tline); if (linestate == LS_START) { if (*cp == '#') { linestate = LS_HASH; + firstsym = true; cp = skipcomment(cp + 1); } else if (*cp != '\0') linestate = LS_DIRTY; @@ -563,7 +671,8 @@ parseline(void) cp = skipsym(cp); kwlen = cp - keyword; /* no way can we deal with a continuation inside a keyword */ - if (strncmp(cp, "\\\n", 2) == 0) + if (strncmp(cp, "\\\r\n", 3) == 0 || + strncmp(cp, "\\\n", 2) == 0) Eioccc(); if (strlcmp("ifdef", keyword, kwlen) == 0 || strlcmp("ifndef", keyword, kwlen) == 0) { @@ -614,9 +723,8 @@ parseline(void) size_t len = cp - tline; if (fgets(tline + len, MAXLINE - len, input) == NULL) { /* append the missing newline */ - tline[len+0] = '\n'; - tline[len+1] = '\0'; - cp++; + strcpy(tline + len, newline); + cp += strlen(newline); linestate = LS_START; } else { linestate = LS_DIRTY; @@ -627,7 +735,7 @@ parseline(void) while (*cp != '\0') cp = skipcomment(cp + 1); } - debug("parser %s comment %s line", + debug("parser line %d state %s comment %s line", linenum, comment_name[incomment], linestate_name[linestate]); return (retval); } @@ -872,11 +980,16 @@ skipcomment(const char *cp) } while (*cp != '\0') /* don't reset to LS_START after a line continuation */ - if (strncmp(cp, "\\\n", 2) == 0) + if (strncmp(cp, "\\\r\n", 3) == 0) + cp += 3; + else if (strncmp(cp, "\\\n", 2) == 0) cp += 2; else switch (incomment) { case NO_COMMENT: - if (strncmp(cp, "/\\\n", 3) == 0) { + if (strncmp(cp, "/\\\r\n", 4) == 0) { + incomment = STARTING_COMMENT; + cp += 4; + } else if (strncmp(cp, "/\\\n", 3) == 0) { incomment = STARTING_COMMENT; cp += 3; } else if (strncmp(cp, "/*", 2) == 0) { @@ -896,7 +1009,7 @@ skipcomment(const char *cp) } else if (strncmp(cp, "\n", 1) == 0) { linestate = LS_START; cp += 1; - } else if (strchr(" \t", *cp) != NULL) { + } else if (strchr(" \r\t", *cp) != NULL) { cp += 1; } else return (cp); @@ -928,7 +1041,10 @@ skipcomment(const char *cp) cp += 1; continue; case C_COMMENT: - if (strncmp(cp, "*\\\n", 3) == 0) { + if (strncmp(cp, "*\\\r\n", 4) == 0) { + incomment = FINISHING_COMMENT; + cp += 4; + } else if (strncmp(cp, "*\\\n", 3) == 0) { incomment = FINISHING_COMMENT; cp += 3; } else if (strncmp(cp, "*/", 2) == 0) { @@ -1012,7 +1128,13 @@ findsym(const char *str) if (cp == str) return (-1); if (symlist) { - printf("%.*s\n", (int)(cp-str), str); + if (symdepth && firstsym) + printf("%s%3d", zerosyms ? "" : "\n", depth); + firstsym = zerosyms = false; + printf("%s%.*s%s", + symdepth ? " " : "", + (int)(cp-str), str, + symdepth ? "" : "\n"); /* we don't care about the value of the symbol */ return (0); } @@ -1049,7 +1171,7 @@ addsym(bool ignorethis, bool definethis, value[symind] = val+1; *val = '\0'; } else if (*val == '\0') - value[symind] = ""; + value[symind] = "1"; else usage(); } else { @@ -1057,6 +1179,8 @@ addsym(bool ignorethis, bool definethis, usage(); value[symind] = NULL; } + debug("addsym %s=%s", symname[symind], + value[symind] ? value[symind] : "undef"); } /* @@ -1097,5 +1221,6 @@ error(const char *msg) else warnx("%s: %d: %s (#if line %d depth %d)", filename, linenum, msg, stifline[depth], depth); + closeout(); errx(2, "output may be truncated"); } Modified: stable/8/usr.bin/unifdef/unifdefall.sh ============================================================================== --- stable/8/usr.bin/unifdef/unifdefall.sh Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/unifdefall.sh Tue Jan 18 19:31:38 2011 (r217551) @@ -2,7 +2,8 @@ # # unifdefall: remove all the #if's from a source file # -# Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +# Copyright (c) 2002 - 2010 Tony Finch +# Copyright (c) 2009 - 2010 Jonathan Nieder # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,19 +26,30 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $dotat: unifdef/unifdefall.sh,v 1.24 2009/11/26 12:54:39 fanf2 Exp $ # $FreeBSD$ set -e -basename=$(basename $0) +unifdef="$(dirname "$0")/unifdef" +if [ ! -e "$unifdef" ] +then + unifdef=unifdef +fi + +case "$@" in +"-d "*) echo DEBUGGING 1>&2 + debug=-d + shift +esac + +basename=$(basename "$0") tmp=$(mktemp -d "${TMPDIR:-/tmp}/$basename.XXXXXXXXXX") || exit 2 -trap 'rm -r "$tmp" || exit 1' EXIT +trap 'rm -r "$tmp" || exit 2' EXIT export LC_ALL=C # list of all controlling macros -unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +"$unifdef" $debug -s "$@" | sort | uniq >"$tmp/ctrl" # list of all macro definitions cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" # list of defined macro names @@ -49,7 +61,7 @@ comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tm # and converts them to unifdef command-line arguments sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D&=/p|' <"$tmp/def" >"$tmp/script" # create the final unifdef command -{ echo unifdef -k \\ +{ echo "$unifdef" $debug -k '\' # convert the controlling undefined macros to -U arguments sed 's/.*/-U& \\/' <"$tmp/undef" # convert the controlling defined macros to quoted -D arguments @@ -57,5 +69,11 @@ sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D sed "s/'/'\\\\''/g;s/.*/'&' \\\\/" echo '"$@"' } >"$tmp/cmd" +case $debug in +-d) for i in ctrl hashdefs alldef undef def script cmd + do echo ==== $i + cat "$tmp/$i" + done 1>&2 +esac # run the command we just created sh "$tmp/cmd" "$@" From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 18 20:26:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1A41065672; Tue, 18 Jan 2011 20:26:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF908FC08; Tue, 18 Jan 2011 20:26: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 p0IKQeIB050946; Tue, 18 Jan 2011 20:26:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IKQeMY050944; Tue, 18 Jan 2011 20:26:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101182026.p0IKQeMY050944@svn.freebsd.org> From: Warner Losh Date: Tue, 18 Jan 2011 20:26: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: r217553 - stable/8/sys/modules X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 20:26:41 -0000 Author: imp Date: Tue Jan 18 20:26:40 2011 New Revision: 217553 URL: http://svn.freebsd.org/changeset/base/217553 Log: Fix mismerge. The missing _cxgb=cxgb assignment was causing cxgb to not be built at all, rather than causing it to not be built on just arm and mips. # The merge info looks correct, so this looks like a direct commit. Modified: stable/8/sys/modules/Makefile Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Tue Jan 18 19:36:04 2011 (r217552) +++ stable/8/sys/modules/Makefile Tue Jan 18 20:26:40 2011 (r217553) @@ -339,6 +339,8 @@ _siba_bwn= siba_bwn _sym= sym # no uart_cpu_$MACHINE_ARCH _uart= uart +# disable_intr() interferes +_cxgb= cxgb .endif .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 01:26:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B6D106566B; Wed, 19 Jan 2011 01:26:49 +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 79FE08FC24; Wed, 19 Jan 2011 01:26: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 p0J1QnY9058353; Wed, 19 Jan 2011 01:26:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J1Qnam058351; Wed, 19 Jan 2011 01:26:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101190126.p0J1Qnam058351@svn.freebsd.org> From: Rick Macklem Date: Wed, 19 Jan 2011 01:26:49 +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: r217567 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 01:26:49 -0000 Author: rmacklem Date: Wed Jan 19 01:26:49 2011 New Revision: 217567 URL: http://svn.freebsd.org/changeset/base/217567 Log: MFC: r217176 Modify readdirplus in the experimental NFS server in a manner analogous to r216633 for the regular server. This change busies the file system so that VFS_VGET() is guaranteed to be using the correct mount point even during a forced dismount attempt. Since nfsd_fhtovp() is not called immediately before readdirplus, the patch is actually a clone of pjd@'s nfs_serv.c.4.patch instead of the one committed in r216633. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: 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) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 19 00:57:58 2011 (r217566) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 19 01:26:49 2011 (r217567) @@ -1685,6 +1685,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct iovec iv; struct componentname cn; int not_zfs; + struct mount *mp; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1854,7 +1855,24 @@ again: toff = off; goto again; } + + /* + * Busy the file system so that the mount point won't go away + * and, as such, VFS_VGET() can be used safely. + */ + mp = vp->v_mount; + vfs_ref(mp); VOP_UNLOCK(vp, 0); + nd->nd_repstat = vfs_busy(mp, 0); + vfs_rel(mp); + if (nd->nd_repstat != 0) { + vrele(vp); + free(cookies, M_TEMP); + free(rbuf, M_TEMP); + if (nd->nd_flag & ND_NFSV3) + nfsrv_postopattr(nd, getret, &at); + return (0); + } /* * Save this position, in case there is an error before one entry @@ -1914,9 +1932,8 @@ again: vp, dp->d_fileno); if (refp == NULL) { if (usevget) - r = VFS_VGET(vp->v_mount, - dp->d_fileno, LK_SHARED, - &nvp); + r = VFS_VGET(mp, dp->d_fileno, + LK_SHARED, &nvp); else r = EOPNOTSUPP; if (r == EOPNOTSUPP) { @@ -2035,6 +2052,7 @@ again: ncookies--; } vrele(vp); + vfs_unbusy(mp); /* * If dirlen > cnt, we must strip off the last entry. If that From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 03:59:31 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A496106564A; Wed, 19 Jan 2011 03:59:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 298848FC13; Wed, 19 Jan 2011 03:59: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 p0J3xVxw062473; Wed, 19 Jan 2011 03:59:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J3xVAf062471; Wed, 19 Jan 2011 03:59:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101190359.p0J3xVAf062471@svn.freebsd.org> From: Warner Losh Date: Wed, 19 Jan 2011 03:59:31 +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: r217569 - stable/8/usr.bin/chpass X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 03:59:31 -0000 Author: imp Date: Wed Jan 19 03:59:30 2011 New Revision: 217569 URL: http://svn.freebsd.org/changeset/base/217569 Log: MFC r204707 by scottl Ignore the result of the chflags operation to allow it to continue when doing an installation over NFS. Modified: stable/8/usr.bin/chpass/Makefile (contents, props changed) Modified: stable/8/usr.bin/chpass/Makefile ============================================================================== --- stable/8/usr.bin/chpass/Makefile Wed Jan 19 03:10:24 2011 (r217568) +++ stable/8/usr.bin/chpass/Makefile Wed Jan 19 03:59:30 2011 (r217569) @@ -44,7 +44,7 @@ beforeinstall: .if !defined(NO_FSCHG) afterinstall: - chflags schg ${DESTDIR}${BINDIR}/chpass + -chflags schg ${DESTDIR}${BINDIR}/chpass .endif .include From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 05:08:33 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A383106564A; Wed, 19 Jan 2011 05:08:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 192E88FC0A; Wed, 19 Jan 2011 05:08: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 p0J58Wdt064098; Wed, 19 Jan 2011 05:08:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J58WLo064096; Wed, 19 Jan 2011 05:08:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101190508.p0J58WLo064096@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 19 Jan 2011 05:08: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: r217571 - stable/8/sys/geom/nop X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 05:08:33 -0000 Author: ae Date: Wed Jan 19 05:08:32 2011 New Revision: 217571 URL: http://svn.freebsd.org/changeset/base/217571 Log: MFC r217303: Sector size can not be greater than MAXPHYS. Modified: stable/8/sys/geom/nop/g_nop.c Directory Properties: 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) Modified: stable/8/sys/geom/nop/g_nop.c ============================================================================== --- stable/8/sys/geom/nop/g_nop.c Wed Jan 19 04:28:51 2011 (r217570) +++ stable/8/sys/geom/nop/g_nop.c Wed Jan 19 05:08:32 2011 (r217571) @@ -176,6 +176,10 @@ g_nop_create(struct gctl_req *req, struc gctl_error(req, "Invalid secsize for provider %s.", pp->name); return (EINVAL); } + if (secsize > MAXPHYS) { + gctl_error(req, "secsize is too big."); + return (EINVAL); + } size -= size % secsize; snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX); LIST_FOREACH(gp, &mp->geom, geom) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 05:13:40 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9323710656A4; Wed, 19 Jan 2011 05:13:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6706E8FC15; Wed, 19 Jan 2011 05:13: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 p0J5DeI6064264; Wed, 19 Jan 2011 05:13:40 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J5De2D064261; Wed, 19 Jan 2011 05:13:40 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101190513.p0J5De2D064261@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 19 Jan 2011 05: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: r217572 - in stable/8: sbin/geom/class/raid3 sbin/geom/class/sched sys/geom/raid3 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 05:13:40 -0000 Author: ae Date: Wed Jan 19 05:13:40 2011 New Revision: 217572 URL: http://svn.freebsd.org/changeset/base/217572 Log: MFC r217305: Sector size can not be greater than MAXPHYS. Since GRAID3 calculates sector size from user-specified block size, report to user about big blocksize. PR: kern/147851 Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c stable/8/sys/geom/raid3/g_raid3.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (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) Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- stable/8/sbin/geom/class/raid3/geom_raid3.c Wed Jan 19 05:08:32 2011 (r217571) +++ stable/8/sbin/geom/class/raid3/geom_raid3.c Wed Jan 19 05:13:40 2011 (r217572) @@ -212,6 +212,11 @@ raid3_label(struct gctl_req *req) md.md_sectorsize = sectorsize * (nargs - 2); md.md_mediasize -= (md.md_mediasize % md.md_sectorsize); + if (md.md_sectorsize > MAXPHYS) { + gctl_error(req, "The blocksize is too big."); + return; + } + /* * Clear last sector first, to spoil all components if device exists. */ Modified: stable/8/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3.c Wed Jan 19 05:08:32 2011 (r217571) +++ stable/8/sys/geom/raid3/g_raid3.c Wed Jan 19 05:13:40 2011 (r217572) @@ -2913,6 +2913,10 @@ g_raid3_read_metadata(struct g_consumer cp->provider->name); return (error); } + if (md->md_sectorsize > MAXPHYS) { + G_RAID3_DEBUG(0, "The blocksize is too big."); + return (EINVAL); + } return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 09:59:54 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6840A106564A; Wed, 19 Jan 2011 09:59:54 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575438FC15; Wed, 19 Jan 2011 09:59: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 p0J9xsMf070953; Wed, 19 Jan 2011 09:59:54 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J9xs2U070951; Wed, 19 Jan 2011 09:59:54 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201101190959.p0J9xs2U070951@svn.freebsd.org> From: Max Khon Date: Wed, 19 Jan 2011 09:59:54 +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: r217576 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 09:59:54 -0000 Author: fjoe Date: Wed Jan 19 09:59:54 2011 New Revision: 217576 URL: http://svn.freebsd.org/changeset/base/217576 Log: Fix buildworld on pre-8.2. PR: 153947 Modified: stable/8/Makefile.inc1 Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Wed Jan 19 09:47:20 2011 (r217575) +++ stable/8/Makefile.inc1 Wed Jan 19 09:59:54 2011 (r217576) @@ -926,6 +926,10 @@ _groff= gnu/usr.bin/groff/tmac _ar= usr.bin/ar .endif +.if ${BOOTSTRAPPING} < 802000 +_lex= usr.bin/lex +.endif + .if ${BOOTSTRAPPING} < 800013 _mklocale= usr.bin/mklocale .endif @@ -951,6 +955,7 @@ bootstrap-tools: ${_gperf} \ ${_groff} \ ${_ar} \ + ${_lex} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 21:09:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8125F1065672; Wed, 19 Jan 2011 21:09:39 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 664E28FC0C; Wed, 19 Jan 2011 21:09: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 p0JL9dX4089145; Wed, 19 Jan 2011 21:09:39 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JL9duf089141; Wed, 19 Jan 2011 21:09:39 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192109.p0JL9duf089141@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:09:39 +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: r217599 - stable/8/tools/regression/acct X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:09:39 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:09:39 2011 New Revision: 217599 URL: http://svn.freebsd.org/changeset/base/217599 Log: MFC r217064 - sort & fix includes, remove -include from CFLAGS of acct tests - Sort the includes of pack.c, moving sys/*.h files near the top. - Add a couple of missing #include lines, and remove the need for custom -include options in the CFLAGS of the test Makefile. - Remove the ad-hoc ’all’ target, but keep its ’regress’ bits for testing. - Convert the ad-hoc ’clean’ target to proper CLEANFILES stuff, so that the normal bsd.prog.mk machinery can clean up. - Use ‘make -V .OBJDIR’ to detect the place where ’pack’ lives, so that regress.t works both with and without ’make obj’. Modified: stable/8/tools/regression/acct/Makefile stable/8/tools/regression/acct/pack.c stable/8/tools/regression/acct/regress.t Directory Properties: stable/8/tools/regression/acct/ (props changed) Modified: stable/8/tools/regression/acct/Makefile ============================================================================== --- stable/8/tools/regression/acct/Makefile Wed Jan 19 21:03:22 2011 (r217598) +++ stable/8/tools/regression/acct/Makefile Wed Jan 19 21:09:39 2011 (r217599) @@ -1,22 +1,22 @@ # # $FreeBSD$ # -# "make" will compile what is needed and run the regression tests. +# "make" will compile the acct test programs # + PROG= pack +SRCS= pack.c NO_MAN= +CFLAGS+= -I${.OBJDIR} -all: regress - -pack: pack.c convert.c +pack.o: convert.c +CLEANFILES+= convert.c convert.c: ../../../sys/kern/kern_acct.c - sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@ + sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? | \ + sed -e 's/log(/syslog(/' >$@ regress: pack regress.t - ./regress.t - -clean: - rm -f $(PROG) convert.c + sh ${.CURDIR}/regress.t .include Modified: stable/8/tools/regression/acct/pack.c ============================================================================== --- stable/8/tools/regression/acct/pack.c Wed Jan 19 21:03:22 2011 (r217598) +++ stable/8/tools/regression/acct/pack.c Wed Jan 19 21:09:39 2011 (r217599) @@ -25,15 +25,18 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include +#include #include #include +#include #include #include - -#include -#include +#include +#include #define KASSERT(val, msg) assert(val) Modified: stable/8/tools/regression/acct/regress.t ============================================================================== --- stable/8/tools/regression/acct/regress.t Wed Jan 19 21:03:22 2011 (r217598) +++ stable/8/tools/regression/acct/regress.t Wed Jan 19 21:09:39 2011 (r217599) @@ -3,7 +3,12 @@ # $FreeBSD$ # -DIR=`dirname $0` +if test -z "${DIR}" ; then + DIR=$( make -V .OBJDIR ) +fi +if test -z "${DIR}" ; then + DIR=$( dirname $0 ) +fi check() { From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 21:28:01 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12618106564A; Wed, 19 Jan 2011 21:28:01 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00FAC8FC15; Wed, 19 Jan 2011 21:28: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 p0JLS0x2089662; Wed, 19 Jan 2011 21:28:00 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLS0Dx089660; Wed, 19 Jan 2011 21:28:00 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192128.p0JLS0Dx089660@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:28:00 +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: r217601 - stable/8/share/man/man7 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:28:01 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:28:00 2011 New Revision: 217601 URL: http://svn.freebsd.org/changeset/base/217601 Log: MFC r205978 from /head Document DEBUG_FLAGS in a more visible place, in the build(7) manpage Noticed by: Alexander Best Reviewed by: jhb Modified: stable/8/share/man/man7/build.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/build.7 ============================================================================== --- stable/8/share/man/man7/build.7 Wed Jan 19 21:19:23 2011 (r217600) +++ stable/8/share/man/man7/build.7 Wed Jan 19 21:28:00 2011 (r217601) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd March 31, 2010 .Dt BUILD 7 .Os .Sh NAME @@ -311,6 +311,20 @@ should be set as with .Sh ENVIRONMENT Variables that influence all builds include: .Bl -tag -width ".Va MAKEOBJDIRPREFIX" +.It Va DEBUG_FLAGS +Defines a set of debugging flags that will be used to build all userland +binaries under +.Pa /usr/src . +When +.Va DEBUG_FLAGS +is defined, the +.Cm install +and +.Cm installworld +targets install binaries from the current +.Va MAKEOBJDIRPREFIX +without stripping, +so that debugging information is retained in the installed binaries. .It Va DESTDIR The directory hierarchy prefix where built objects will be installed. If not set, From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 21:34:42 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B3AD106566C; Wed, 19 Jan 2011 21:34:42 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59F698FC08; Wed, 19 Jan 2011 21:34: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 p0JLYgQO089900; Wed, 19 Jan 2011 21:34:42 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLYgAh089898; Wed, 19 Jan 2011 21:34:42 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192134.p0JLYgAh089898@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217603 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:34:42 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:34:42 2011 New Revision: 217603 URL: http://svn.freebsd.org/changeset/base/217603 Log: MFC r199985 from /head Describe what setpgid(2) does when pgid=0. The text has been copied from NetBSD’s manpage, and it also matches the behavior described by the Open Group’s online copy of setpgid.2 at http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html Obtained from: NetBSD Submitted by: Petros Barbayiannis Modified: stable/8/lib/libc/sys/setpgid.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/setpgid.2 ============================================================================== --- stable/8/lib/libc/sys/setpgid.2 Wed Jan 19 21:28:21 2011 (r217602) +++ stable/8/lib/libc/sys/setpgid.2 Wed Jan 19 21:34:42 2011 (r217603) @@ -54,6 +54,11 @@ to the specified If .Fa pid is zero, then the call applies to the current process. +If +.Fa pgrp +is zero, then the process id of the process specified by +.Fa pid +is used instead. .Pp If the affected process is not the invoking process, then it must be a child of the invoking process, it must not have performed an From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 21:49:21 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1CC81065674; Wed, 19 Jan 2011 21:49:21 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B063D8FC14; Wed, 19 Jan 2011 21:49: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 p0JLnLal090515; Wed, 19 Jan 2011 21:49:21 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLnLW1090513; Wed, 19 Jan 2011 21:49:21 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192149.p0JLnLW1090513@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:49: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: r217608 - stable/8/share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:49:21 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:49:21 2011 New Revision: 217608 URL: http://svn.freebsd.org/changeset/base/217608 Log: MFC r217481 and r217606 from /head r217481... Fix the mount example of xfs(5) filesystems by including the read-only option. We only support ro mounts for xfs, so it’s nice if the examples we show in the manpage are easy to copy/paste. PR: docs/149106 Submitted by: amdmi3 r217606... Bump .Dd date of manpage for r217481 Modified: stable/8/share/man/man5/xfs.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/xfs.5 ============================================================================== --- stable/8/share/man/man5/xfs.5 Wed Jan 19 21:45:40 2011 (r217607) +++ stable/8/share/man/man5/xfs.5 Wed Jan 19 21:49:21 2011 (r217608) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2007 +.Dd January 16, 2011 .Dt XFS 5 .Os .Sh NAME @@ -53,7 +53,7 @@ To mount a volume located on .Pa /dev/ad1s1 : .Pp -.Dl "mount -t xfs /dev/ad1s1 /mnt" +.Dl "mount -t xfs -o ro /dev/ad1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 22:25:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19A131065672; Wed, 19 Jan 2011 22:25:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0783A8FC14; Wed, 19 Jan 2011 22:25: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 p0JMP7NF091860; Wed, 19 Jan 2011 22:25:07 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMP7in091856; Wed, 19 Jan 2011 22:25:07 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101192225.p0JMP7in091856@svn.freebsd.org> From: Andrew Thompson Date: Wed, 19 Jan 2011 22:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217614 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:25:08 -0000 Author: thompsa Date: Wed Jan 19 22:25:07 2011 New Revision: 217614 URL: http://svn.freebsd.org/changeset/base/217614 Log: MFC r203134,r207990,r217289 Add manpages for run(4) and runfw(4). Added: stable/8/share/man/man4/run.4 - copied, changed from r203134, head/share/man/man4/run.4 stable/8/share/man/man4/runfw.4 - copied unchanged from r217289, head/share/man/man4/runfw.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Jan 19 22:16:42 2011 (r217613) +++ stable/8/share/man/man4/Makefile Wed Jan 19 22:25:07 2011 (r217614) @@ -338,6 +338,7 @@ MAN= aac.4 \ rp.4 \ rue.4 \ rum.4 \ + runfw.4 \ sa.4 \ safe.4 \ sbp.4 \ Copied and modified: stable/8/share/man/man4/run.4 (from r203134, head/share/man/man4/run.4) ============================================================================== --- head/share/man/man4/run.4 Thu Jan 28 22:24:54 2010 (r203134, copy source) +++ stable/8/share/man/man4/run.4 Wed Jan 19 22:25:07 2011 (r217614) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2010 +.Dd January 12, 2011 .Os .Dt RUN 4 .Sh NAME @@ -36,11 +36,17 @@ kernel configuration file: .Cd "device wlan_amrr" .Ed .Pp +Firmware is also needed, and provided by: +.Bd -ragged -offset indent +.Cd "device runfw" +.Ed +.Pp Alternatively, to load the driver as a -module at boot time, place the following line in +module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent if_run_load="YES" +runfw_load="YES" .Ed .Sh DESCRIPTION The @@ -68,6 +74,9 @@ Also known as mode, this is used when associating with an access point, through which all traffic passes. This mode is the default. +.It Host AP mode +In this mode the driver acts as an access point (base station) +for other cards. .It monitor mode In this mode the driver is able to receive packets without associating with an access point. @@ -94,11 +103,11 @@ hardware for the WEP40, WEP104, TKIP(+MI The .Nm driver can be configured at runtime with -.Xr ifconfig 8 -or on boot with -.Xr hostname.if 5 . +.Xr ifconfig 8 . .Sh HARDWARE -The following adapters should work: +The +.Nm +driver supports the following wireless adapters: .Pp .Bl -tag -width Ds -offset indent -compact .It Airlink101 AWLL6090 @@ -174,7 +183,7 @@ ifconfig wlan create wlandev run0 wlanmo .Ed .Sh DIAGNOSTICS .Bl -diag -.It "run%d: error %d, could not read firmware %s" +.It "run%d: faild load firmware of file runfw" For some reason, the driver was unable to read the microcode file from the filesystem. The file might be missing or corrupted. @@ -187,6 +196,7 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO +.Xr runfw 4 , .Xr intro 4 , .Xr netintro 4 , .Xr usb 4 , Copied: stable/8/share/man/man4/runfw.4 (from r217289, head/share/man/man4/runfw.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/runfw.4 Wed Jan 19 22:25:07 2011 (r217614, copy of r217289, head/share/man/man4/runfw.4) @@ -0,0 +1,50 @@ +.\" Copyright (c) 2010 Akinori Furukoshi +.\" Copyright (c) 2010 Warren Block +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 12, 2011 +.Dt RUNFW 4 +.Os +.Sh NAME +.Nm runfw +.Nd "Firmware Module for Ralink driver" +.Sh SYNOPSIS +To compile this module into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device runfw" +.Ed +.Pp +This will include two firmware images, RT2870 and RT3071, inside the kernel. +.Xr run 4 +will load the appropriate image into the chip. +.Pp +Alternatively, to load the firmware images as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +runfw_load="YES" +.Ed +.Sh DESCRIPTION +This module provides firmware sets for the Ralink RT2700U, +RT2800U and RT3000U chip based USB WiFi adapters. +Please read Ralink's license, src/sys/contrib/dev/run/LICENSE. +.Sh SEE ALSO +.Xr run 4 , +.Xr firmware 9 From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 19 22:29:19 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E63061065697; Wed, 19 Jan 2011 22:29:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CF58FC0A; Wed, 19 Jan 2011 22:29: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 p0JMTJme091996; Wed, 19 Jan 2011 22:29:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMTJqi091994; Wed, 19 Jan 2011 22:29:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101192229.p0JMTJqi091994@svn.freebsd.org> From: Andrew Thompson Date: Wed, 19 Jan 2011 22:29: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: r217615 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:29:20 -0000 Author: thompsa Date: Wed Jan 19 22:29:19 2011 New Revision: 217615 URL: http://svn.freebsd.org/changeset/base/217615 Log: MFC r203135 Hook run(4) to the build. Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Jan 19 22:25:07 2011 (r217614) +++ stable/8/share/man/man4/Makefile Wed Jan 19 22:29:19 2011 (r217615) @@ -338,6 +338,7 @@ MAN= aac.4 \ rp.4 \ rue.4 \ rum.4 \ + run.4 \ runfw.4 \ sa.4 \ safe.4 \ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 20 15:06:42 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA22F106564A; Thu, 20 Jan 2011 15:06:42 +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 C8A598FC15; Thu, 20 Jan 2011 15:06: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 p0KF6g0T017828; Thu, 20 Jan 2011 15:06:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KF6grs017826; Thu, 20 Jan 2011 15:06:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101201506.p0KF6grs017826@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 20 Jan 2011 15:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217640 - stable/8/sys/geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 15:06:43 -0000 Author: nwhitehorn Date: Thu Jan 20 15:06:42 2011 New Revision: 217640 URL: http://svn.freebsd.org/changeset/base/217640 Log: MFC r217040: Add an entry to the gpart XML to determine if the geom has pending changes that need to be committed (or undone). Modified: stable/8/sys/geom/part/g_part.c Directory Properties: 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) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jan 20 15:02:51 2011 (r217639) +++ stable/8/sys/geom/part/g_part.c Thu Jan 20 15:06:42 2011 (r217640) @@ -1796,6 +1796,8 @@ g_part_dumpconf(struct sbuf *sb, const c table->gpt_heads); sbuf_printf(sb, "%s%s\n", indent, table->gpt_corrupt ? "CORRUPT": "OK"); + sbuf_printf(sb, "%s%s\n", indent, + table->gpt_opened ? "true": "false"); G_PART_DUMPCONF(table, NULL, sb, indent); } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 20 18:41:47 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33419106566B; Thu, 20 Jan 2011 18:41:47 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5F58FC08; Thu, 20 Jan 2011 18:41: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 p0KIfltm023970; Thu, 20 Jan 2011 18:41:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KIfk5q023959; Thu, 20 Jan 2011 18:41:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101201841.p0KIfk5q023959@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 20 Jan 2011 18:41:46 +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: r217650 - in stable/8/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 18:41:47 -0000 Author: bschmidt Date: Thu Jan 20 18:41:46 2011 New Revision: 217650 URL: http://svn.freebsd.org/changeset/base/217650 Log: MFC r217511: Pull ieee80211_ratectl_node_init() calls from drivers into net80211. This fixes hostap mode for at least ral(4) and run(4), because there is no sufficient call into drivers which could be used initialize the node related ratectl variables. Modified: stable/8/sys/dev/bwi/if_bwi.c stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/wpi/if_wpi.c stable/8/sys/net80211/ieee80211_node.c Directory Properties: 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) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jan 20 18:41:46 2011 (r217650) @@ -1764,7 +1764,6 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1818,11 +1817,6 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); - callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/bwn/if_bwn.c Thu Jan 20 18:41:46 2011 (r217650) @@ -8329,7 +8329,6 @@ bwn_phy_reset(struct bwn_mac *mac) static int bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { - const struct ieee80211_txparam *tp; struct bwn_vap *bvp = BWN_VAP(vap); struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; @@ -8378,11 +8377,6 @@ bwn_newstate(struct ieee80211vap *vap, e bwn_set_pretbtt(mac); bwn_spu_setdelay(mac, 0); bwn_set_macaddr(mac); - - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); } BWN_UNLOCK(sc); Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/iwn/if_iwn.c Thu Jan 20 18:41:46 2011 (r217650) @@ -122,7 +122,6 @@ static void iwn_read_eeprom_channels(str static void iwn_read_eeprom_enhinfo(struct iwn_softc *); static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); -static void iwn_newassoc(struct ieee80211_node *, int); static int iwn_media_change(struct ifnet *); static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, @@ -652,7 +651,6 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; - ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_wme_update; ic->ic_update_mcast = iwn_update_mcast; ic->ic_scan_start = iwn_scan_start; @@ -1929,13 +1927,6 @@ iwn_node_alloc(struct ieee80211vap *vap, return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } -static void -iwn_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int iwn_media_change(struct ifnet *ifp) { Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/ral/rt2560.c Thu Jan 20 18:41:46 2011 (r217650) @@ -103,7 +103,6 @@ static void rt2560_reset_rx_ring(struct struct rt2560_rx_ring *); static void rt2560_free_rx_ring(struct rt2560_softc *, struct rt2560_rx_ring *); -static void rt2560_newassoc(struct ieee80211_node *, int); static int rt2560_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2560_eeprom_read(struct rt2560_softc *, uint8_t); @@ -301,7 +300,6 @@ rt2560_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2560_newassoc; ic->ic_raw_xmit = rt2560_raw_xmit; ic->ic_updateslot = rt2560_update_slot; ic->ic_update_promisc = rt2560_update_promisc; @@ -757,13 +755,6 @@ rt2560_free_rx_ring(struct rt2560_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2560_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2560_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: stable/8/sys/dev/ral/rt2661.c ============================================================================== --- stable/8/sys/dev/ral/rt2661.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/ral/rt2661.c Thu Jan 20 18:41:46 2011 (r217650) @@ -100,7 +100,6 @@ static void rt2661_reset_rx_ring(struct struct rt2661_rx_ring *); static void rt2661_free_rx_ring(struct rt2661_softc *, struct rt2661_rx_ring *); -static void rt2661_newassoc(struct ieee80211_node *, int); static int rt2661_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2661_eeprom_read(struct rt2661_softc *, uint8_t); @@ -304,7 +303,6 @@ rt2661_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2661_newassoc; #if 0 ic->ic_wme.wme_update = rt2661_wme_update; #endif @@ -764,13 +762,6 @@ rt2661_free_rx_ring(struct rt2661_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2661_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/usb/wlan/if_rum.c Thu Jan 20 18:41:46 2011 (r217650) @@ -2206,8 +2206,6 @@ rum_ratectl_start(struct rum_softc *sc, /* clear statistic registers (STA_CSR0 to STA_CSR5) */ rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp); } Modified: stable/8/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_run.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/usb/wlan/if_run.c Thu Jan 20 18:41:46 2011 (r217650) @@ -2376,7 +2376,6 @@ run_newassoc(struct ieee80211_node *ni, DPRINTF("new assoc isnew=%d associd=%x addr=%s\n", isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr)); - ieee80211_ratectl_node_init(ni); sc->sc_ni[wcid] = ni; for (i = 0; i < rs->rs_nrates; i++) { Modified: stable/8/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_ural.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/usb/wlan/if_ural.c Thu Jan 20 18:41:46 2011 (r217650) @@ -2215,8 +2215,6 @@ ural_ratectl_start(struct ural_softc *sc /* clear statistic registers (STA_CSR0 to STA_CSR10) */ ural_read_multi(sc, RAL_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&uvp->ratectl_ch, hz, ural_ratectl_timeout, uvp); } Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/wpi/if_wpi.c Thu Jan 20 18:41:46 2011 (r217650) @@ -174,7 +174,6 @@ static int wpi_alloc_tx_ring(struct wpi_ int, int); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); -static void wpi_newassoc(struct ieee80211_node *, int); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_mem_lock(struct wpi_softc *); static void wpi_mem_unlock(struct wpi_softc *); @@ -668,7 +667,6 @@ wpi_attach(device_t dev) ieee80211_ifattach(ic, macaddr); /* override default methods */ ic->ic_raw_xmit = wpi_raw_xmit; - ic->ic_newassoc = wpi_newassoc; ic->ic_wme.wme_update = wpi_wme_update; ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; @@ -3233,14 +3231,6 @@ wpi_stop(struct wpi_softc *sc) } static void -wpi_newassoc(struct ieee80211_node *ni, int isnew) -{ - - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - -static void wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; Modified: stable/8/sys/net80211/ieee80211_node.c ============================================================================== --- stable/8/sys/net80211/ieee80211_node.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/net80211/ieee80211_node.c Thu Jan 20 18:41:46 2011 (r217650) @@ -1137,6 +1137,8 @@ ieee80211_alloc_node(struct ieee80211_no IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, "%s: inact_reload %u", __func__, ni->ni_inact_reload); + ieee80211_ratectl_node_init(ni); + return ni; } @@ -1174,6 +1176,8 @@ ieee80211_tmp_node(struct ieee80211vap * ni->ni_txpower = bss->ni_txpower; /* XXX optimize away */ ieee80211_psq_init(&ni->ni_psq, "unknown"); + + ieee80211_ratectl_node_init(ni); } else { /* XXX msg */ vap->iv_stats.is_rx_nodealloc++; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 00:33:10 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F625106566B; Fri, 21 Jan 2011 00:33:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB4E8FC18; Fri, 21 Jan 2011 00:33: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 p0L0XAdU033037; Fri, 21 Jan 2011 00:33:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0XAkg033035; Fri, 21 Jan 2011 00:33:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101210033.p0L0XAkg033035@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 21 Jan 2011 00:33: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: r217668 - stable/8/sys/dev/sis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:33:10 -0000 Author: yongari Date: Fri Jan 21 00:33:10 2011 New Revision: 217668 URL: http://svn.freebsd.org/changeset/base/217668 Log: MFC r217548: Rework RX filter programming by providing separate handler for DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > Modified: stable/8/sys/dev/sis/if_sis.c Directory Properties: 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) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Jan 21 00:02:27 2011 (r217667) +++ stable/8/sys/dev/sis/if_sis.c Fri Jan 21 00:33:10 2011 (r217668) @@ -149,6 +149,9 @@ static int sis_ioctl(struct ifnet *, u_l static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); static int sis_resume(device_t); static int sis_rxeof(struct sis_softc *); +static void sis_rxfilter(struct sis_softc *); +static void sis_rxfilter_ns(struct sis_softc *); +static void sis_rxfilter_sis(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -808,80 +811,117 @@ sis_mchash(struct sis_softc *sc, const u } static void -sis_setmulti_ns(struct sis_softc *sc) +sis_rxfilter(struct sis_softc *sc) +{ + + SIS_LOCK_ASSERT(sc); + + if (sc->sis_type == SIS_TYPE_83815) + sis_rxfilter_ns(sc); + else + sis_rxfilter_sis(sc); +} + +static void +sis_rxfilter_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h = 0, i, filtsave; + uint32_t h, i, filter; int bit, index; ifp = sc->sis_ifp; - - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); - return; + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + /* + * Filter should be disabled to program other bits. + */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); + CSR_READ_4(sc, SIS_RXFILT_CTL); } + filter &= ~(NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT | + NS_RXFILTCTL_MCHASH | SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_BROADCAST) + filter |= SIS_RXFILTCTL_BROAD; /* - * We have to explicitly enable the multicast hash table - * on the NatSemi chip if we want to use it, which we do. + * For the NatSemi chip, we have to explicitly enable the + * reception of ARP frames, as well as turn on the 'perfect + * match' filter where we store the station address, otherwise + * we won't receive unicasts meant for this host. */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + filter |= NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT; - filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & IFF_PROMISC) + filter |= SIS_RXFILTCTL_ALLPHYS; + } else { + /* + * We have to explicitly enable the multicast hash table + * on the NatSemi chip if we want to use it, which we do. + */ + filter |= NS_RXFILTCTL_MCHASH; - /* first, zot all the existing hash bits */ - for (i = 0; i < 32; i++) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2)); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); - } + /* first, zot all the existing hash bits */ + for (i = 0; i < 32; i++) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + (i * 2)); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); + } - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = sis_mchash(sc, - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); - index = h >> 3; - bit = h & 0x1F; - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index); - if (bit > 0xF) - bit -= 0x10; - SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = sis_mchash(sc, + LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = h >> 3; + bit = h & 0x1F; + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + index); + if (bit > 0xF) + bit -= 0x10; + SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void -sis_setmulti_sis(struct sis_softc *sc) +sis_rxfilter_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h, i, n, ctl; + uint32_t filter, h, i, n; uint16_t hashes[16]; ifp = sc->sis_ifp; /* hash table size */ - if (sc->sis_rev >= SIS_REV_635 || - sc->sis_rev == SIS_REV_900B) + if (sc->sis_rev >= SIS_REV_635 || sc->sis_rev == SIS_REV_900B) n = 16; else n = 8; - ctl = CSR_READ_4(sc, SIS_RXFILT_CTL) & SIS_RXFILTCTL_ENABLE; - + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_READ_4(sc, SIS_RXFILT_CTL); + } + filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); if (ifp->if_flags & IFF_BROADCAST) - ctl |= SIS_RXFILTCTL_BROAD; + filter |= SIS_RXFILTCTL_BROAD; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) - ctl |= SIS_RXFILTCTL_BROAD|SIS_RXFILTCTL_ALLPHYS; + filter |= SIS_RXFILTCTL_ALLPHYS; for (i = 0; i < n; i++) hashes[i] = ~0; } else { @@ -899,7 +939,7 @@ sis_setmulti_sis(struct sis_softc *sc) } if_maddr_runlock(ifp); if (i > n) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + filter |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) hashes[i] = ~0; } @@ -910,7 +950,8 @@ sis_setmulti_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, ctl); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void @@ -2106,41 +2147,7 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - if (sc->sis_type == SIS_TYPE_83815) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_ARP); - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_PERFECT); - } - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } - - /* - * Load the multicast filter. - */ - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - + sis_rxfilter(sc); /* Turn the receive filter on */ SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); @@ -2254,27 +2261,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && ((ifp->if_flags ^ sc->sis_if_flags) & - (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - } else + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + sis_rxfilter(sc); + else sis_initl(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) sis_stop(sc); - } sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 00:40:25 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1E91065672; Fri, 21 Jan 2011 00:40:25 +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 597DD8FC1D; Fri, 21 Jan 2011 00:40: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 p0L0eP2A033280; Fri, 21 Jan 2011 00:40:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0ePCm033276; Fri, 21 Jan 2011 00:40:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210040.p0L0ePCm033276@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:40: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: r217670 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:40:25 -0000 Author: marius Date: Fri Jan 21 00:40:25 2011 New Revision: 217670 URL: http://svn.freebsd.org/changeset/base/217670 Log: MFC: r217412 - Masking IFM_GMASK when also masking IFM_FDX is redundant and just complicates the code. - Don't let atphy_setmedia() announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Simplify e1000phy_service() and ip1000phy_service() to only set the manual configuration bits once after we have figured them all out. For ip1000phy_service() this also means we no longer unnecessarily update the hardware along the road. Modified: stable/8/sys/dev/mii/atphy.c stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/ip1000phy.c Directory Properties: 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) Modified: stable/8/sys/dev/mii/atphy.c ============================================================================== --- stable/8/sys/dev/mii/atphy.c Fri Jan 21 00:35:34 2011 (r217669) +++ stable/8/sys/dev/mii/atphy.c Fri Jan 21 00:40:25 2011 (r217670) @@ -187,9 +187,9 @@ atphy_service(struct mii_softc *sc, stru } anar = atphy_anar(ife); - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { bmcr |= BMCR_FDX; - if (((ife->ifm_media & IFM_GMASK) & IFM_FLOW) != 0 || + if ((ife->ifm_media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= ANAR_PAUSE_TOWARDS; } @@ -371,7 +371,7 @@ atphy_anar(struct ifmedia_entry *ife) return (0); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { if (IFM_SUBTYPE(ife->ifm_media) == IFM_100_TX) anar |= ANAR_TX_FD; else @@ -387,13 +387,13 @@ atphy_setmedia(struct mii_softc *sc, int uint16_t anar; anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (((IFM_SUBTYPE(media) == IFM_AUTO || - ((media & IFM_GMASK) & IFM_FDX) != 0) && - ((media & IFM_GMASK) & IFM_FLOW) != 0) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + if ((IFM_SUBTYPE(media) == IFM_AUTO || (media & IFM_FDX) != 0) && + ((media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) anar |= ANAR_PAUSE_TOWARDS; PHY_WRITE(sc, MII_ANAR, anar); - if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX); PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Fri Jan 21 00:35:34 2011 (r217669) +++ stable/8/sys/dev/mii/e1000phy.c Fri Jan 21 00:40:25 2011 (r217670) @@ -358,7 +358,7 @@ e1000phy_service(struct mii_softc *sc, s return (EINVAL); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= E1000_CR_FULL_DUPLEX; gig = E1000_1GCR_1000T_FD; } else @@ -373,10 +373,10 @@ e1000phy_service(struct mii_softc *sc, s if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || (mii->mii_ifp->if_flags & IFF_LINK0) != 0) gig |= E1000_1GCR_MS_VALUE; - PHY_WRITE(sc, E1000_1GCR, gig); } else if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) - PHY_WRITE(sc, E1000_1GCR, 0); + gig = 0; + PHY_WRITE(sc, E1000_1GCR, gig); PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); PHY_WRITE(sc, E1000_CR, speed | E1000_CR_RESET); done: Modified: stable/8/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/8/sys/dev/mii/ip1000phy.c Fri Jan 21 00:35:34 2011 (r217669) +++ stable/8/sys/dev/mii/ip1000phy.c Fri Jan 21 00:40:25 2011 (r217670) @@ -186,23 +186,22 @@ ip1000phy_service(struct mii_softc *sc, return (EINVAL); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= IP1000PHY_BMCR_FDX; gig = IP1000PHY_1000CR_1000T_FDX; } else gig = IP1000PHY_1000CR_1000T; - PHY_WRITE(sc, IP1000PHY_MII_1000CR, 0); - PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) - break; - - gig |= IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || - (mii->mii_ifp->if_flags & IFF_LINK0) != 0) - gig |= IP1000PHY_1000CR_MMASTER; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= + IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= IP1000PHY_1000CR_MMASTER; + } else + gig = 0; PHY_WRITE(sc, IP1000PHY_MII_1000CR, gig); + PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); done: break; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 00:48:05 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C3A1065672; Fri, 21 Jan 2011 00:48:05 +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 054058FC15; Fri, 21 Jan 2011 00:48: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 p0L0m4a1033547; Fri, 21 Jan 2011 00:48:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0m4wZ033543; Fri, 21 Jan 2011 00:48:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210048.p0L0m4wZ033543@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:48:04 +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: r217672 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:48:05 -0000 Author: marius Date: Fri Jan 21 00:48:04 2011 New Revision: 217672 URL: http://svn.freebsd.org/changeset/base/217672 Log: MFC: r217413 - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Simplify ciphy_service() to only set the manual configuration bits once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. Modified: stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/ciphy.c stable/8/sys/dev/mii/xmphy.c Directory Properties: 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) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Fri Jan 21 00:40:51 2011 (r217671) +++ stable/8/sys/dev/mii/brgphy.c Fri Jan 21 00:48:04 2011 (r217672) @@ -452,7 +452,7 @@ brgphy_setmedia(struct mii_softc *sc, in break; } - if ((media & IFM_GMASK) == IFM_FDX) { + if ((media & IFM_FDX) != 0) { bmcr |= BRGPHY_BMCR_FDX; gig = BRGPHY_1000CTL_AFD; } else { Modified: stable/8/sys/dev/mii/ciphy.c ============================================================================== --- stable/8/sys/dev/mii/ciphy.c Fri Jan 21 00:40:51 2011 (r217671) +++ stable/8/sys/dev/mii/ciphy.c Fri Jan 21 00:48:04 2011 (r217672) @@ -176,27 +176,24 @@ ciphy_service(struct mii_softc *sc, stru case IFM_10_T: speed = CIPHY_S10; setit: - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= CIPHY_BMCR_FDX; gig = CIPHY_1000CTL_AFD; - } else { + } else gig = CIPHY_1000CTL_AHD; - } - PHY_WRITE(sc, CIPHY_MII_1000CTL, 0); + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= CIPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= CIPHY_1000CTL_MSC; + speed |= + CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG; + } else + gig = 0; + PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); PHY_WRITE(sc, CIPHY_MII_BMCR, speed); PHY_WRITE(sc, CIPHY_MII_ANAR, CIPHY_SEL_TYPE); - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) - break; - - gig |= CIPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || - (mii->mii_ifp->if_flags & IFF_LINK0) != 0) - gig |= CIPHY_1000CTL_MSC; - PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); - PHY_WRITE(sc, CIPHY_MII_BMCR, - speed | CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); Modified: stable/8/sys/dev/mii/xmphy.c ============================================================================== --- stable/8/sys/dev/mii/xmphy.c Fri Jan 21 00:40:51 2011 (r217671) +++ stable/8/sys/dev/mii/xmphy.c Fri Jan 21 00:48:04 2011 (r217672) @@ -171,7 +171,7 @@ xmphy_service(struct mii_softc *sc, stru break; case IFM_1000_SX: mii_phy_reset(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { PHY_WRITE(sc, XMPHY_MII_ANAR, XMPHY_ANAR_FDX); PHY_WRITE(sc, XMPHY_MII_BMCR, XMPHY_BMCR_FDX); } else { From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 00:50:34 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA088106564A; Fri, 21 Jan 2011 00:50:34 +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 7E48F8FC0A; Fri, 21 Jan 2011 00:50: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 p0L0oYT9033720; Fri, 21 Jan 2011 00:50:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0oYGO033711; Fri, 21 Jan 2011 00:50:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210050.p0L0oYGO033711@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:50: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: r217674 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:50:34 -0000 Author: marius Date: Fri Jan 21 00:50:34 2011 New Revision: 217674 URL: http://svn.freebsd.org/changeset/base/217674 Log: MFC: r217414 - Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX. Modified: stable/8/sys/dev/mii/jmphy.c stable/8/sys/dev/mii/mii_physubr.c Directory Properties: 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) Modified: stable/8/sys/dev/mii/jmphy.c ============================================================================== --- stable/8/sys/dev/mii/jmphy.c Fri Jan 21 00:48:08 2011 (r217673) +++ stable/8/sys/dev/mii/jmphy.c Fri Jan 21 00:50:34 2011 (r217674) @@ -334,10 +334,10 @@ jmphy_setmedia(struct mii_softc *sc, str bmcr |= BMCR_LOOP; anar = jmphy_anar(ife); - if (((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || + if ((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || (ife->ifm_media & IFM_FDX) != 0) && - (ife->ifm_media & IFM_FLOW) != 0) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) anar |= ANAR_PAUSE_TOWARDS; if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { Modified: stable/8/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/8/sys/dev/mii/mii_physubr.c Fri Jan 21 00:48:08 2011 (r217673) +++ stable/8/sys/dev/mii/mii_physubr.c Fri Jan 21 00:50:34 2011 (r217674) @@ -135,8 +135,9 @@ mii_phy_setmedia(struct mii_softc *sc) gtcr |= GTCR_ADV_MS; } - if ((ife->ifm_media & IFM_GMASK) == (IFM_FDX | IFM_FLOW) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0 && + ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) { if ((sc->mii_flags & MIIF_IS_1000X) != 0) anar |= ANAR_X_PAUSE_TOWARDS; else { @@ -184,7 +185,8 @@ mii_phy_auto(struct mii_softc *sc) ANAR_CSMA; if ((ife->ifm_media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { - if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) + if ((sc->mii_capabilities & + (BMSR_10TFDX | BMSR_100TXFDX)) != 0) anar |= ANAR_FC; /* XXX Only 1000BASE-T has PAUSE_ASYM? */ if (((sc->mii_flags & MIIF_HAVE_GTCR) != 0) && From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 00:53:32 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A3611065670; Fri, 21 Jan 2011 00:53: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 488828FC14; Fri, 21 Jan 2011 00:53: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 p0L0rWD8033861; Fri, 21 Jan 2011 00:53:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0rWVD033858; Fri, 21 Jan 2011 00:53:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210053.p0L0rWVD033858@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:53: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: r217676 - stable/8/sys/dev/dc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:53:32 -0000 Author: marius Date: Fri Jan 21 00:53:32 2011 New Revision: 217676 URL: http://svn.freebsd.org/changeset/base/217676 Log: MFC: r217417 - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Just let the default case handle all unsupported media types. - In pnphy_status() don't unnecessarily read a register twice. - Remove unnused macros. Modified: stable/8/sys/dev/dc/dcphy.c stable/8/sys/dev/dc/pnphy.c Directory Properties: 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) Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Fri Jan 21 00:50:34 2011 (r217675) +++ stable/8/sys/dev/dc/dcphy.c Fri Jan 21 00:53:32 2011 (r217676) @@ -222,17 +222,12 @@ dcphy_service(struct mii_softc *sc, stru /*dcphy_reset(sc);*/ (void) dcphy_auto(sc); break; - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); case IFM_100_TX: dcphy_reset(sc); DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); mode |= DC_NETCFG_PORTSEL | DC_NETCFG_PCS | DC_NETCFG_SCRAMBLER; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mode |= DC_NETCFG_FULLDUPLEX; else mode &= ~DC_NETCFG_FULLDUPLEX; @@ -241,7 +236,7 @@ dcphy_service(struct mii_softc *sc, stru case IFM_10_T: DC_CLRBIT(dc_sc, DC_SIARESET, DC_SIA_RESET); DC_CLRBIT(dc_sc, DC_10BTCTRL, 0xFFFF); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) DC_SETBIT(dc_sc, DC_10BTCTRL, 0x7F3D); else DC_SETBIT(dc_sc, DC_10BTCTRL, 0x7F3F); @@ -249,7 +244,7 @@ dcphy_service(struct mii_softc *sc, stru DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); mode &= ~DC_NETCFG_PORTSEL; mode |= DC_NETCFG_SPEEDSEL; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mode |= DC_NETCFG_FULLDUPLEX; else mode &= ~DC_NETCFG_FULLDUPLEX; Modified: stable/8/sys/dev/dc/pnphy.c ============================================================================== --- stable/8/sys/dev/dc/pnphy.c Fri Jan 21 00:50:34 2011 (r217675) +++ stable/8/sys/dev/dc/pnphy.c Fri Jan 21 00:53:32 2011 (r217676) @@ -66,14 +66,6 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -#define DC_SETBIT(sc, reg, x) \ - CSR_WRITE_4(sc, reg, \ - CSR_READ_4(sc, reg) | x) - -#define DC_CLRBIT(sc, reg, x) \ - CSR_WRITE_4(sc, reg, \ - CSR_READ_4(sc, reg) & ~x) - static int pnphy_probe(device_t); static int pnphy_attach(device_t); @@ -170,23 +162,19 @@ pnphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; + /* + * Note that auto-negotiation is broken on this chip. + */ switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - /* NWAY is busted on this chip */ - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); case IFM_100_TX: mii->mii_media_active = IFM_ETHER | IFM_100_TX; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); return (0); case IFM_10_T: mii->mii_media_active = IFM_ETHER | IFM_10_T; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); return (0); @@ -226,15 +214,14 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active = IFM_ETHER; reg = CSR_READ_4(dc_sc, DC_ISR); - if (!(reg & DC_ISR_LINKFAIL)) mii->mii_media_status |= IFM_ACTIVE; - - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SPEEDSEL) + reg = CSR_READ_4(dc_sc, DC_NETCFG); + if (reg & DC_NETCFG_SPEEDSEL) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) + if (reg & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 01:12:22 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C963B1065670; Fri, 21 Jan 2011 01:12:22 +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 B6B438FC1B; Fri, 21 Jan 2011 01: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 p0L1CMRS034358; Fri, 21 Jan 2011 01:12:22 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L1CMea034351; Fri, 21 Jan 2011 01:12:22 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101210112.p0L1CMea034351@svn.freebsd.org> From: Rick Macklem Date: Fri, 21 Jan 2011 01:12: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: r217678 - in stable/8/sys: fs/nfs fs/nfsserver nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 01:12:23 -0000 Author: rmacklem Date: Fri Jan 21 01:12:22 2011 New Revision: 217678 URL: http://svn.freebsd.org/changeset/base/217678 Log: MFC: r217432 Modify the experimental NFSv4 server so that it posts a SIGUSR2 signal to the master nfsd daemon whenever the stable restart file has been modified. This will allow the master nfsd daemon to maintain an up to date backup copy of the file. This is enabled via the nfssvc() syscall, so that older nfsd daemons will not be signaled. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c stable/8/sys/nfs/nfs_nfssvc.c stable/8/sys/nfs/nfssvc.h Directory Properties: 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) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfs/nfs_var.h Fri Jan 21 01:12:22 2011 (r217678) @@ -575,6 +575,7 @@ int nfsvno_advlock(vnode_t, int, u_int64 int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); uint32_t nfsrv_hashfh(fhandle_t *); +void nfsrv_backupstable(void); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jan 21 01:12:22 2011 (r217678) @@ -97,6 +97,7 @@ static int nfs_proc(struct nfsrv_descrip extern u_long sb_max_adj; extern int newnfs_numnfsd; +extern struct proc *nfsd_master_proc; /* * NFS server system calls @@ -465,6 +466,7 @@ nfsrvd_init(int terminating) NFSD_LOCK_ASSERT(); if (terminating) { + nfsd_master_proc = NULL; NFSD_UNLOCK(); svcpool_destroy(nfsrvd_pool); nfsrvd_pool = NULL; Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 21 01:12:22 2011 (r217678) @@ -58,6 +58,10 @@ struct mtx nfs_cache_mutex; struct mtx nfs_v4root_mutex; struct nfsrvfh nfs_rootfh, nfs_pubfh; int nfs_pubfhset = 0, nfs_rootfhset = 0; +struct proc *nfsd_master_proc = NULL; +static pid_t nfsd_master_pid = (pid_t)-1; +static char nfsd_master_comm[MAXCOMLEN + 1]; +static struct timeval nfsd_master_start; static uint32_t nfsv4_sysid = 0; static int nfssvc_srvcall(struct thread *, struct nfssvc_args *, @@ -2905,6 +2909,7 @@ nfssvc_srvcall(struct thread *p, struct struct nameidata nd; vnode_t vp; int error = EINVAL; + struct proc *procp; if (uap->flag & NFSSVC_PUBLICFH) { NFSBZERO((caddr_t)&nfs_pubfh.nfsrvfh_data, @@ -2975,6 +2980,14 @@ nfssvc_srvcall(struct thread *p, struct CAST_USER_ADDR_T(dumplocklist.ndllck_list), len); free((caddr_t)dumplocks, M_TEMP); } + } else if (uap->flag & NFSSVC_BACKUPSTABLE) { + procp = p->td_proc; + PROC_LOCK(procp); + nfsd_master_pid = procp->p_pid; + bcopy(procp->p_comm, nfsd_master_comm, MAXCOMLEN + 1); + nfsd_master_start = procp->p_stats->p_start; + nfsd_master_proc = procp; + PROC_UNLOCK(procp); } return (error); } @@ -3030,6 +3043,32 @@ nfsrv_hashfh(fhandle_t *fhp) return (hashval); } +/* + * Signal the userland master nfsd to backup the stable restart file. + */ +void +nfsrv_backupstable(void) +{ + struct proc *procp; + + if (nfsd_master_proc != NULL) { + procp = pfind(nfsd_master_pid); + /* Try to make sure it is the correct process. */ + if (procp == nfsd_master_proc && + procp->p_stats->p_start.tv_sec == + nfsd_master_start.tv_sec && + procp->p_stats->p_start.tv_usec == + nfsd_master_start.tv_usec && + strcmp(procp->p_comm, nfsd_master_comm) == 0) + psignal(procp, SIGUSR2); + else + nfsd_master_proc = NULL; + + if (procp != NULL) + PROC_UNLOCK(procp); + } +} + extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); /* Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jan 21 01:12:22 2011 (r217678) @@ -577,6 +577,7 @@ nfsrv_adminrevoke(struct nfsd_clid *revo * Now, write out the revocation record */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); + nfsrv_backupstable(); /* * and clear out the state, marking the clientid revoked. @@ -2988,8 +2989,10 @@ nfsrv_openupdate(vnode_t vp, struct nfss * If the client just confirmed its first open, write a timestamp * to the stable storage file. */ - if (gotstate) + if (gotstate != 0) { nfsrv_writestable(client, len, NFSNST_NEWSTATE, p); + nfsrv_backupstable(); + } return (error); } @@ -4132,6 +4135,7 @@ nfsrv_updatestable(NFSPROC_T *p) LIST_REMOVE(sp, nst_list); free((caddr_t)sp, M_TEMP); } + nfsrv_backupstable(); } /* @@ -4266,6 +4270,7 @@ nfsrv_clientconflict(struct nfsclient *c * Ok, we can expire the conflicting client. */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); + nfsrv_backupstable(); nfsrv_cleanclient(clp, p); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); @@ -4441,6 +4446,7 @@ nfsrv_delegconflict(struct nfsstate *stp * sleep without the state changing. */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); + nfsrv_backupstable(); if (clp->lc_expiry < NFSD_MONOSEC) { nfsrv_cleanclient(clp, p); nfsrv_freedeleglist(&clp->lc_deleg); Modified: stable/8/sys/nfs/nfs_nfssvc.c ============================================================================== --- stable/8/sys/nfs/nfs_nfssvc.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/nfs/nfs_nfssvc.c Fri Jan 21 01:12:22 2011 (r217678) @@ -99,7 +99,7 @@ nfssvc(struct thread *td, struct nfssvc_ else if ((uap->flag & (NFSSVC_NFSDNFSD | NFSSVC_NFSDADDSOCK | NFSSVC_PUBLICFH | NFSSVC_V4ROOTEXPORT | NFSSVC_NOPUBLICFH | NFSSVC_STABLERESTART | NFSSVC_ADMINREVOKE | - NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS)) && + NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE)) && nfsd_call_nfsd != NULL) error = (*nfsd_call_nfsd)(td, uap); if (error == EINTR || error == ERESTART) Modified: stable/8/sys/nfs/nfssvc.h ============================================================================== --- stable/8/sys/nfs/nfssvc.h Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/nfs/nfssvc.h Fri Jan 21 01:12:22 2011 (r217678) @@ -63,5 +63,6 @@ #define NFSSVC_NFSCBD 0x00100000 #define NFSSVC_CBADDSOCK 0x00200000 #define NFSSVC_GETSTATS 0x00400000 +#define NFSSVC_BACKUPSTABLE 0x00800000 #endif /* _NFS_NFSSVC_H */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 01:24:00 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94B4E1065672; Fri, 21 Jan 2011 01:24:00 +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 835C58FC14; Fri, 21 Jan 2011 01: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 p0L1O0ur034648; Fri, 21 Jan 2011 01:24:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L1O0ZP034646; Fri, 21 Jan 2011 01:24:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101210124.p0L1O0ZP034646@svn.freebsd.org> From: Rick Macklem Date: Fri, 21 Jan 2011 01:24:00 +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: r217679 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 01:24:00 -0000 Author: rmacklem Date: Fri Jan 21 01:24:00 2011 New Revision: 217679 URL: http://svn.freebsd.org/changeset/base/217679 Log: MFC: r217535 Fix the experimental NFSv4 server so that it uses VOP_ACCESSX() to check for VREAD_ACL instead of VOP_ACCESS(). Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c Directory Properties: 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) Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Fri Jan 21 01:12:22 2011 (r217678) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Fri Jan 21 01:24:00 2011 (r217679) @@ -2002,7 +2002,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd #ifdef NFS4_ACL_EXTATTR_NAME } else if (naclp != NULL) { if (vn_lock(vp, LK_SHARED) == 0) { - error = VOP_ACCESS(vp, VREAD_ACL, cred, p); + error = VOP_ACCESSX(vp, VREAD_ACL, cred, p); if (error == 0) error = VOP_GETACL(vp, ACL_TYPE_NFS4, naclp, cred, p); From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 17:53:40 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0738106566C; Fri, 21 Jan 2011 17:53:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE548FC16; Fri, 21 Jan 2011 17:53: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 p0LHreT1062107; Fri, 21 Jan 2011 17:53:40 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LHrekZ062105; Fri, 21 Jan 2011 17:53:40 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201101211753.p0LHrekZ062105@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 21 Jan 2011 17:53: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: r217697 - stable/8/share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 17:53:40 -0000 Author: trasz Date: Fri Jan 21 17:53:40 2011 New Revision: 217697 URL: http://svn.freebsd.org/changeset/base/217697 Log: MFC r216667: The 'kern.corefile="whatever"' syntax won't work with sysctl.conf; remove the quotes to not mislead people. MFC r216668: Fix date, broken in r216667. Modified: stable/8/share/man/man5/core.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/core.5 ============================================================================== --- stable/8/share/man/man5/core.5 Fri Jan 21 16:22:11 2011 (r217696) +++ stable/8/share/man/man5/core.5 Fri Jan 21 17:53:40 2011 (r217697) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 9, 2002 +.Dd December 22, 2010 .Dt CORE 5 .Os .Sh NAME @@ -96,7 +96,7 @@ the following .Xr sysctl 8 command can be used: .Pp -.Dl sysctl kern.corefile="/var/coredumps/\&%U/\&%N.core" +.Dl sysctl kern.corefile=/var/coredumps/\&%U/\&%N.core .Sh SEE ALSO .Xr gdb 1 , .Xr kgdb 1 , From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 18:18:55 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981531065672; Fri, 21 Jan 2011 18:18:55 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9B18FC1F; Fri, 21 Jan 2011 18:18: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 p0LIItFk062979; Fri, 21 Jan 2011 18:18:55 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LIItCi062977; Fri, 21 Jan 2011 18:18:55 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201101211818.p0LIItCi062977@svn.freebsd.org> From: Tony Finch Date: Fri, 21 Jan 2011 18:18: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: r217699 - stable/8/usr.bin/unifdef X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 18:18:55 -0000 Author: fanf Date: Fri Jan 21 18:18:55 2011 New Revision: 217699 URL: http://svn.freebsd.org/changeset/base/217699 Log: MFC r217698: unifdef-2.5.6 Modified: stable/8/usr.bin/unifdef/unifdef.c Directory Properties: stable/8/usr.bin/unifdef/ (props changed) Modified: stable/8/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.c Fri Jan 21 18:10:11 2011 (r217698) +++ stable/8/usr.bin/unifdef/unifdef.c Fri Jan 21 18:18:55 2011 (r217699) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2010 Tony Finch + * Copyright (c) 2002 - 2011 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,7 +57,7 @@ #include const char copyright[] = - "@(#) $Version: unifdef-2.5 $\n" + "@(#) $Version: unifdef-2.5.6.21f1388 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" "@(#) $URL: http://dotat.at/prog/unifdef $\n" @@ -549,6 +549,7 @@ state(Ifstate is) /* * Write a line to the output or not, according to command line options. + * If writing fails, closeout() will print the error and exit. */ static void flushline(bool keep) @@ -561,21 +562,23 @@ flushline(bool keep) delcount += 1; blankcount += 1; } else { - if (lnnum && delcount > 0) - printf("#line %d%s", linenum, newline); - fputs(tline, output); + if (lnnum && delcount > 0 && + fprintf(output, "#line %d%s", linenum, newline) < 0) + closeout(); + if (fputs(tline, output) == EOF) + closeout(); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { - if (lnblank) - fputs(newline, output); + if (lnblank && fputs(newline, output) == EOF) + closeout(); exitstat = 1; delcount += 1; blankcount = 0; } - if (debugging) - fflush(output); + if (debugging && fflush(output) == EOF) + closeout(); } /* @@ -604,13 +607,13 @@ closeout(void) { if (symdepth && !zerosyms) printf("\n"); - if (fclose(output) == EOF) { - warn("couldn't write to %s", ofilename); + if (ferror(output) || fclose(output) == EOF) { if (overwriting) { + warn("couldn't write to temporary file"); unlink(tempname); - errx(2, "%s unchanged", filename); + errx(2, "%s unchanged", ofilename); } else { - exit(2); + err(2, "couldn't write to %s", ofilename); } } } @@ -647,8 +650,12 @@ parseline(void) Comment_state wascomment; linenum++; - if (fgets(tline, MAXLINE, input) == NULL) - return (LT_EOF); + if (fgets(tline, MAXLINE, input) == NULL) { + if (ferror(input)) + error(strerror(errno)); + else + return (LT_EOF); + } if (newline == NULL) { if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) newline = newline_crlf; @@ -722,7 +729,9 @@ parseline(void) if (linestate == LS_HASH) { size_t len = cp - tline; if (fgets(tline + len, MAXLINE - len, input) == NULL) { - /* append the missing newline */ + if (ferror(input)) + error(strerror(errno)); + /* append the missing newline at eof */ strcpy(tline + len, newline); cp += strlen(newline); linestate = LS_START; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 21 18:31:57 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0B3106564A; Fri, 21 Jan 2011 18:31:57 +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 9A3FF8FC19; Fri, 21 Jan 2011 18:31: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 p0LIVv52063452; Fri, 21 Jan 2011 18:31:57 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LIVvYQ063449; Fri, 21 Jan 2011 18:31:57 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101211831.p0LIVvYQ063449@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 21 Jan 2011 18:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217700 - in stable/8/sys/amd64: ia32 linux32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 18:31:57 -0000 Author: jkim Date: Fri Jan 21 18:31:57 2011 New Revision: 217700 URL: http://svn.freebsd.org/changeset/base/217700 Log: MFC: r217424 Remove redundant, bogus, and even harmful uses of setting TS bit in CR0. It is done from fpstate_drop() when it is really necessary. Modified: stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/amd64/linux32/linux32_sysvec.c Directory Properties: 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) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Fri Jan 21 18:18:55 2011 (r217699) +++ stable/8/sys/amd64/ia32/ia32_signal.c Fri Jan 21 18:31:57 2011 (r217700) @@ -741,7 +741,6 @@ ia32_setregs(td, entry, stack, ps_string regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - load_cr0(rcr0() | CR0_MP | CR0_TS); fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysvec.c Fri Jan 21 18:18:55 2011 (r217699) +++ stable/8/sys/amd64/linux32/linux32_sysvec.c Fri Jan 21 18:31:57 2011 (r217700) @@ -875,7 +875,7 @@ exec_linux_setregs(td, entry, stack, ps_ regs->tf_flags = TF_HASSEGS; regs->tf_cs = _ucode32sel; regs->tf_rbx = ps_strings; - load_cr0(rcr0() | CR0_MP | CR0_TS); + fpstate_drop(td); /* Do full restore on return so that we can change to a different %cs */ From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 22 01:34:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96CEC106566C; Sat, 22 Jan 2011 01:34:08 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 851148FC12; Sat, 22 Jan 2011 01:34: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 p0M1Y8pE075614; Sat, 22 Jan 2011 01:34:08 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1Y8Nt075612; Sat, 22 Jan 2011 01:34:08 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220134.p0M1Y8Nt075612@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:34: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: r217710 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:34:08 -0000 Author: jfv Date: Sat Jan 22 01:34:08 2011 New Revision: 217710 URL: http://svn.freebsd.org/changeset/base/217710 Log: MFC rev 217295 Modified: stable/8/sys/dev/e1000/if_em.c Directory Properties: 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) Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:31:59 2011 (r217709) +++ stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:34:08 2011 (r217710) @@ -93,7 +93,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.1.8"; +char em_driver_version[] = "7.1.9"; /********************************************************************* * PCI Device ID Table @@ -1909,14 +1909,23 @@ em_xmit(struct tx_ring *txr, struct mbuf error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { + if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); + } else if (error != 0) { adapter->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } + + } else if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); } else if (error != 0) { adapter->no_tx_dma_setup++; + m_freem(*m_headp); + *m_headp = NULL; return (error); } @@ -2206,7 +2215,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - EM_TX_UNLOCK(txr); em_init_locked(adapter); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 22 01:37:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE718106566B; Sat, 22 Jan 2011 01:37:53 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD5E8FC0A; Sat, 22 Jan 2011 01:37: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 p0M1brJS075767; Sat, 22 Jan 2011 01:37:53 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1briF075765; Sat, 22 Jan 2011 01:37:53 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220137.p0M1briF075765@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:37:53 +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: r217711 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:37:53 -0000 Author: jfv Date: Sat Jan 22 01:37:53 2011 New Revision: 217711 URL: http://svn.freebsd.org/changeset/base/217711 Log: MFC rev 217591 Modified: stable/8/sys/dev/e1000/if_em.c Directory Properties: 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) Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:34:08 2011 (r217710) +++ stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:37:53 2011 (r217711) @@ -1820,12 +1820,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1849,6 +1849,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 22 01:43:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 306AA106564A; Sat, 22 Jan 2011 01:43:08 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ED808FC16; Sat, 22 Jan 2011 01:43: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 p0M1h812075932; Sat, 22 Jan 2011 01:43:08 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1h8Kv075930; Sat, 22 Jan 2011 01:43:08 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220143.p0M1h8Kv075930@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217712 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:43:08 -0000 Author: jfv Date: Sat Jan 22 01:43:07 2011 New Revision: 217712 URL: http://svn.freebsd.org/changeset/base/217712 Log: MFC rev 217127 - correct a couple SYSCTL variables Modified: stable/8/sys/dev/ixgbe/ixgbe.c Directory Properties: 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) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:37:53 2011 (r217711) +++ stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:43:07 2011 (r217712) @@ -5129,13 +5129,13 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLFLAG_RD, &stats->lxontxc, "Link XON Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xon_rcvd", - CTLFLAG_RD, &stats->lxontxc, + CTLFLAG_RD, &stats->lxonrxc, "Link XON Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xoff_txd", CTLFLAG_RD, &stats->lxofftxc, "Link XOFF Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xoff_rcvd", - CTLFLAG_RD, &stats->lxofftxc, + CTLFLAG_RD, &stats->lxoffrxc, "Link XOFF Received"); /* Packet Reception Stats */ From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 22 01:48:12 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 620C41065670; Sat, 22 Jan 2011 01:48:12 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8D88FC20; Sat, 22 Jan 2011 01:48: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 p0M1mCRC076127; Sat, 22 Jan 2011 01:48:12 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1mC66076122; Sat, 22 Jan 2011 01:48:12 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220148.p0M1mC66076122@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:48: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: r217713 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:48:12 -0000 Author: jfv Date: Sat Jan 22 01:48:12 2011 New Revision: 217713 URL: http://svn.freebsd.org/changeset/base/217713 Log: MFC rev 217593: Critical fix for panic on 82598 Phy detection now dynamic Flow Director improvement Critical fix for buf sz (jumbos) Release RX lock to fix LOR Modified: stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixgbe.h stable/8/sys/dev/ixgbe/ixgbe_82599.c stable/8/sys/dev/ixgbe/ixgbe_api.h stable/8/sys/dev/ixgbe/ixgbe_common.c stable/8/sys/dev/ixgbe/ixgbe_common.h stable/8/sys/dev/ixgbe/ixgbe_mbx.c stable/8/sys/dev/ixgbe/ixgbe_type.h Directory Properties: 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) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:43:07 2011 (r217712) +++ stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:48:12 2011 (r217713) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.7"; +char ixgbe_driver_version[] = "2.3.8"; /********************************************************************* * PCI Device ID Table @@ -175,6 +175,7 @@ static __inline void ixgbe_rx_input(stru /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); +static void ixgbe_setup_optics(struct adapter *); /* Legacy (single vector interrupt handler */ static void ixgbe_legacy_irq(void *); @@ -290,13 +291,6 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; -/* -** The number of scatter-gather segments -** differs for 82598 and 82599, default to -** the former. -*/ -static int ixgbe_num_segs = IXGBE_82598_SCATTER; - #ifdef IXGBE_FDIR /* ** For Flow Director: this is the @@ -386,7 +380,7 @@ ixgbe_attach(device_t dev) struct adapter *adapter; struct ixgbe_hw *hw; int error = 0; - u16 pci_device_id, csum; + u16 csum; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -399,52 +393,6 @@ ixgbe_attach(device_t dev) /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* Keep track of optics */ - pci_device_id = pci_get_device(dev); - switch (pci_device_id) { - case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: - case IXGBE_DEV_ID_82598EB_CX4: - adapter->optics = IFM_10G_CX4; - break; - case IXGBE_DEV_ID_82598: - case IXGBE_DEV_ID_82598AF_DUAL_PORT: - case IXGBE_DEV_ID_82598AF_SINGLE_PORT: - case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: - case IXGBE_DEV_ID_82598EB_SFP_LOM: - case IXGBE_DEV_ID_82598AT: - adapter->optics = IFM_10G_SR; - break; - case IXGBE_DEV_ID_82598AT2: - adapter->optics = IFM_10G_T; - break; - case IXGBE_DEV_ID_82598EB_XF_LR: - adapter->optics = IFM_10G_LR; - break; - case IXGBE_DEV_ID_82599_SFP: - adapter->optics = IFM_10G_SR; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82598_DA_DUAL_PORT : - adapter->optics = IFM_10G_TWINAX; - break; - case IXGBE_DEV_ID_82599_KX4: - case IXGBE_DEV_ID_82599_KX4_MEZZ: - case IXGBE_DEV_ID_82599_CX4: - adapter->optics = IFM_10G_CX4; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_XAUI_LOM: - case IXGBE_DEV_ID_82599_COMBO_BACKPLANE: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_T3_LOM: - ixgbe_num_segs = IXGBE_82599_SCATTER; - adapter->optics = IFM_10G_T; - default: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - } - /* SYSCTL APIs */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -547,10 +495,6 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Pick up the smart speed setting */ - if (hw->mac.type == ixgbe_mac_82599EB) - hw->phy.smart_speed = ixgbe_smart_speed; - /* Get Hardware Flow Control setting */ hw->fc.requested_mode = ixgbe_fc_full; hw->fc.pause_time = IXGBE_FC_PAUSE; @@ -574,6 +518,9 @@ ixgbe_attach(device_t dev) goto err_late; } + /* Detect and set physical type */ + ixgbe_setup_optics(adapter); + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1054,7 +1001,7 @@ ixgbe_init_locked(struct adapter *adapte return; } - ixgbe_reset_hw(hw); + ixgbe_init_hw(hw); ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -1068,8 +1015,10 @@ ixgbe_init_locked(struct adapter *adapte adapter->rx_mbuf_sz = MCLBYTES; else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; - else + else if (adapter->max_frame_size <= 9216) adapter->rx_mbuf_sz = MJUM9BYTES; + else + adapter->rx_mbuf_sz = MJUM16BYTES; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1600,7 +1549,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m int i, j, error, nsegs; int first, last = 0; struct mbuf *m_head; - bus_dma_segment_t segs[ixgbe_num_segs]; + bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; struct ixgbe_tx_buf *txbuf, *txbuf_mapped; union ixgbe_adv_tx_desc *txd = NULL; @@ -2010,16 +1959,68 @@ static void ixgbe_identify_hardware(struct adapter *adapter) { device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; /* Save off the information about this board */ - adapter->hw.vendor_id = pci_get_vendor(dev); - adapter->hw.device_id = pci_get_device(dev); - adapter->hw.revision_id = pci_read_config(dev, PCIR_REVID, 1); - adapter->hw.subsystem_vendor_id = + hw->vendor_id = pci_get_vendor(dev); + hw->device_id = pci_get_device(dev); + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); + hw->subsystem_vendor_id = pci_read_config(dev, PCIR_SUBVEND_0, 2); - adapter->hw.subsystem_device_id = + hw->subsystem_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); + /* We need this here to set the num_segs below */ + ixgbe_set_mac_type(hw); + + /* Pick up the 82599 and VF settings */ + if (hw->mac.type != ixgbe_mac_82598EB) { + hw->phy.smart_speed = ixgbe_smart_speed; + adapter->num_segs = IXGBE_82599_SCATTER; + } else + adapter->num_segs = IXGBE_82598_SCATTER; + + return; +} + +/********************************************************************* + * + * Determine optic type + * + **********************************************************************/ +static void +ixgbe_setup_optics(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + int layer; + + layer = ixgbe_get_supported_physical_layer(hw); + switch (layer) { + case IXGBE_PHYSICAL_LAYER_10GBASE_T: + adapter->optics = IFM_10G_T; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_T: + adapter->optics = IFM_1000_T; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_LR: + case IXGBE_PHYSICAL_LAYER_10GBASE_LRM: + adapter->optics = IFM_10G_LR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_SR: + adapter->optics = IFM_10G_SR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_KX4: + case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: + adapter->optics = IFM_10G_CX4; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_KX: + case IXGBE_PHYSICAL_LAYER_10GBASE_KR: + case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: + case IXGBE_PHYSICAL_LAYER_UNKNOWN: + default: + adapter->optics = IFM_ETHER | IFM_AUTO; + break; + } return; } @@ -2216,8 +2217,8 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; - /* Set max queues to 8 */ - else if (queues > 8) + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) queues = 8; /* @@ -2413,8 +2414,8 @@ ixgbe_setup_interface(device_t dev, stru */ ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); - ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics | - IFM_FDX, 0, NULL); + ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics, 0, NULL); + ifmedia_set(&adapter->media, IFM_ETHER | adapter->optics); if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); @@ -2718,7 +2719,7 @@ ixgbe_allocate_transmit_buffers(struct t BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ IXGBE_TSO_SIZE, /* maxsize */ - ixgbe_num_segs, /* nsegments */ + adapter->num_segs, /* nsegments */ PAGE_SIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -3181,72 +3182,67 @@ ixgbe_atr(struct tx_ring *txr, struct mb { struct adapter *adapter = txr->adapter; struct ix_queue *que; - union ixgbe_atr_input atr_input; struct ip *ip; struct tcphdr *th; struct udphdr *uh; struct ether_vlan_header *eh; + union ixgbe_atr_hash_dword input = {.dword = 0}; + union ixgbe_atr_hash_dword common = {.dword = 0}; int ehdrlen, ip_hlen; - u16 etype, vlan_id, src_port, dst_port, flex_bytes; - u32 src_ipv4_addr, dst_ipv4_addr; - u8 l4type = 0, ipproto = 0; + u16 etype; eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - else + etype = eh->evl_proto; + } else { ehdrlen = ETHER_HDR_LEN; - etype = ntohs(eh->evl_proto); + etype = eh->evl_encap_proto; + } /* Only handling IPv4 */ - if (etype != ETHERTYPE_IP) + if (etype != htons(ETHERTYPE_IP)) return; ip = (struct ip *)(mp->m_data + ehdrlen); - ipproto = ip->ip_p; ip_hlen = ip->ip_hl << 2; - src_port = dst_port = 0; /* check if we're UDP or TCP */ - switch (ipproto) { + switch (ip->ip_p) { case IPPROTO_TCP: th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - src_port = th->th_sport; - dst_port = th->th_dport; - l4type |= IXGBE_ATR_L4TYPE_TCP; + /* src and dst are inverted */ + common.port.dst ^= th->th_sport; + common.port.src ^= th->th_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_TCPV4; break; case IPPROTO_UDP: uh = (struct udphdr *)((caddr_t)ip + ip_hlen); - src_port = uh->uh_sport; - dst_port = uh->uh_dport; - l4type |= IXGBE_ATR_L4TYPE_UDP; + /* src and dst are inverted */ + common.port.dst ^= uh->uh_sport; + common.port.src ^= uh->uh_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_UDPV4; break; default: return; } - memset(&atr_input, 0, sizeof(union ixgbe_atr_input)); + input.formatted.vlan_id = htobe16(mp->m_pkthdr.ether_vtag); + if (mp->m_pkthdr.ether_vtag) + common.flex_bytes ^= htons(ETHERTYPE_VLAN); + else + common.flex_bytes ^= etype; + common.ip ^= ip->ip_src.s_addr ^ ip->ip_dst.s_addr; - vlan_id = htole16(mp->m_pkthdr.ether_vtag); - src_ipv4_addr = ip->ip_src.s_addr; - dst_ipv4_addr = ip->ip_dst.s_addr; - flex_bytes = etype; que = &adapter->queues[txr->me]; - - ixgbe_atr_set_vlan_id_82599(&atr_input, vlan_id); - ixgbe_atr_set_src_port_82599(&atr_input, dst_port); - ixgbe_atr_set_dst_port_82599(&atr_input, src_port); - ixgbe_atr_set_flex_byte_82599(&atr_input, flex_bytes); - ixgbe_atr_set_l4type_82599(&atr_input, l4type); - /* src and dst are inverted, think how the receiver sees them */ - ixgbe_atr_set_src_ipv4_82599(&atr_input, dst_ipv4_addr); - ixgbe_atr_set_dst_ipv4_82599(&atr_input, src_ipv4_addr); - - /* This assumes the Rx queue and Tx queue are bound to the same CPU */ + /* + ** This assumes the Rx queue and Tx + ** queue are bound to the same CPU + */ ixgbe_fdir_add_signature_filter_82599(&adapter->hw, - &atr_input, que->msix); + input, common, que->msix); } -#endif +#endif /* IXGBE_FDIR */ /********************************************************************** * @@ -3508,9 +3504,9 @@ ixgbe_allocate_receive_buffers(struct rx BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MJUM9BYTES, /* maxsize */ + MJUM16BYTES, /* maxsize */ 1, /* nsegments */ - MJUM9BYTES, /* maxsegsize */ + MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ @@ -3582,8 +3578,13 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) */ if (adapter->rx_mbuf_sz == MCLBYTES) rscctrl |= IXGBE_RSCCTL_MAXDESC_16; - else /* using 4K clusters */ + else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) rscctrl |= IXGBE_RSCCTL_MAXDESC_8; + else if (adapter->rx_mbuf_sz == MJUM9BYTES) + rscctrl |= IXGBE_RSCCTL_MAXDESC_4; + else /* Using 16K cluster */ + rscctrl |= IXGBE_RSCCTL_MAXDESC_1; + IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(rxr->me), rscctrl); /* Enable TCP header recognition */ @@ -3821,15 +3822,14 @@ ixgbe_initialize_receive_units(struct ad /* Set for Jumbo Frames? */ hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0); - if (ifp->if_mtu > ETHERMTU) { + if (ifp->if_mtu > ETHERMTU) hlreg |= IXGBE_HLREG0_JUMBOEN; - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } else { + else hlreg &= ~IXGBE_HLREG0_JUMBOEN; - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); + bufsz = adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; @@ -4028,7 +4028,9 @@ ixgbe_rx_input(struct rx_ring *rxr, stru if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } + IXGBE_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); + IXGBE_RX_LOCK(rxr); } static __inline void @@ -4289,8 +4291,11 @@ next_desc: i = 0; /* Now send to the stack or do LRO */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; ixgbe_rx_input(rxr, ifp, sendmp, ptype); + i = rxr->next_to_check; + } /* Every 8 descriptors we go to refresh mbufs */ if (processed == 8) { @@ -4654,6 +4659,8 @@ static bool ixgbe_sfp_probe(struct adapt device_printf(dev,"SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; + /* Set the optics type so system reports correctly */ + ixgbe_setup_optics(adapter); result = TRUE; } out: @@ -4718,10 +4725,6 @@ ixgbe_handle_msf(void *context, int pend hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, negotiate, TRUE); -#if 0 - ixgbe_check_link(&adapter->hw, &speed, &adapter->link_up, 0); - ixgbe_update_link_status(adapter); -#endif return; } @@ -4830,7 +4833,8 @@ ixgbe_update_stats_counters(struct adapt bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); adapter->stats.bprc += bprc; adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); - adapter->stats.mprc -= bprc; + if (hw->mac.type == ixgbe_mac_82598EB) + adapter->stats.mprc -= bprc; adapter->stats.prc64 += IXGBE_READ_REG(hw, IXGBE_PRC64); adapter->stats.prc127 += IXGBE_READ_REG(hw, IXGBE_PRC127); @@ -4871,12 +4875,14 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.xec += IXGBE_READ_REG(hw, IXGBE_XEC); adapter->stats.fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); adapter->stats.fclast += IXGBE_READ_REG(hw, IXGBE_FCLAST); - adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); - adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); - adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); - adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); - adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); - + /* Only read FCOE on 82599 */ + if (hw->mac.type == ixgbe_mac_82599EB) { + adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); + adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); + adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); + adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); + adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); + } /* Fill out the OS statistics structure */ ifp->if_ipackets = adapter->stats.gprc; @@ -5012,18 +5018,6 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &adapter->mbuf_defrag_failed, "m_defrag() failed"); -#if 0 - /* These counters are not updated by the software */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_header_failed", - CTLFLAG_RD, &adapter->mbuf_header_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_packet_failed", - CTLFLAG_RD, &adapter->mbuf_packet_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_map_avail", - CTLFLAG_RD, &adapter->no_tx_map_avail, - "???"); -#endif SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_dma_setup", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); Modified: stable/8/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.h Sat Jan 22 01:43:07 2011 (r217712) +++ stable/8/sys/dev/ixgbe/ixgbe.h Sat Jan 22 01:48:12 2011 (r217713) @@ -385,6 +385,7 @@ struct adapter { int advertise; /* link speeds */ bool link_active; u16 max_frame_size; + u16 num_segs; u32 link_speed; bool link_up; u32 linkvec; Modified: stable/8/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe_82599.c Sat Jan 22 01:43:07 2011 (r217712) +++ stable/8/sys/dev/ixgbe/ixgbe_82599.c Sat Jan 22 01:48:12 2011 (r217713) @@ -67,13 +67,13 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); s32 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw); -void ixgbe_enable_relaxed_ordering_82599(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw); u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval); -s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps); static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); +bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); + void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) { @@ -101,7 +101,8 @@ void ixgbe_init_mac_link_ops_82599(struc } else { if ((ixgbe_get_media_type(hw) == ixgbe_media_type_backplane) && (hw->phy.smart_speed == ixgbe_smart_speed_auto || - hw->phy.smart_speed == ixgbe_smart_speed_on)) { + hw->phy.smart_speed == ixgbe_smart_speed_on) && + !ixgbe_verify_lesm_fw_enabled_82599(hw)) { mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed; } else { mac->ops.setup_link = &ixgbe_setup_mac_link_82599; @@ -253,7 +254,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw /* MAC */ mac->ops.reset_hw = &ixgbe_reset_hw_82599; - mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_82599; + mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_gen2; mac->ops.get_media_type = &ixgbe_get_media_type_82599; mac->ops.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599; @@ -263,7 +264,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw mac->ops.start_hw = &ixgbe_start_hw_rev_1_82599; mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic; mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic; - mac->ops.get_device_caps = &ixgbe_get_device_caps_82599; + mac->ops.get_device_caps = &ixgbe_get_device_caps_generic; mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic; mac->ops.get_fcoe_boot_status = &ixgbe_get_fcoe_boot_status_generic; @@ -1375,7 +1376,7 @@ s32 ixgbe_init_fdir_perfect_82599(struct * @stream: input bitstream to compute the hash on * @key: 32-bit hash key **/ -u16 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, +u32 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, u32 key) { /* @@ -1419,54 +1420,45 @@ u16 ixgbe_atr_compute_hash_82599(union i * */ __be32 common_hash_dword = 0; - u32 hi_hash_dword, lo_hash_dword; - u16 hash_result = 0; - u8 i; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 hash_result = 0; + u8 i; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(atr_input->dword_stream[0]); /* generate common hash dword */ - for (i = 1; i < 11; i++) - common_hash_dword ^= (u32)atr_input->dword_stream[i]; - hi_hash_dword ^= IXGBE_NTOHL(common_hash_dword); + for (i = 10; i; i -= 2) + common_hash_dword ^= atr_input->dword_stream[i] ^ + atr_input->dword_stream[i - 1]; - /* low dword is word swapped version of common with vlan added */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + hi_hash_dword = IXGBE_NTOHL(common_hash_dword); - /* hi dword is common dword with l4type and vm_pool shifted */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* low dword is word swapped version of common */ + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); + + /* Process bits 0 and 16 */ + if (key & 0x0001) hash_result ^= lo_hash_dword; + if (key & 0x00010000) hash_result ^= hi_hash_dword; /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. - */ - if (key & 0x0001) { - hash_result ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & - 0x0FFFF; - hash_result ^= lo_hash_dword; - } - if (key & 0x00010000) - hash_result ^= hi_hash_dword; - - /* process the remaining bits in the key */ - for (i = 1; i < 16; i++) { - if (key & (0x0001 << i)) - hash_result ^= lo_hash_dword >> i; - if (key & (0x00010000 << i)) - hash_result ^= hi_hash_dword >> i; + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed + */ + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + + /* process the remaining 30 bits in the key 2 bits at a time */ + for (i = 15; i; i-- ) { + if (key & (0x0001 << i)) hash_result ^= lo_hash_dword >> i; + if (key & (0x00010000 << i)) hash_result ^= hi_hash_dword >> i; } - return hash_result; + return hash_result & IXGBE_ATR_HASH_MASK; } /* @@ -1479,30 +1471,18 @@ u16 ixgbe_atr_compute_hash_82599(union i #define IXGBE_COMPUTE_SIG_HASH_ITERATION(_n) \ do { \ u32 n = (_n); \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - common_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) \ common_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - bucket_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) \ bucket_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - sig_hash ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ - sig_hash ^= lo_hash_dword >> n; \ - } \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) \ + sig_hash ^= lo_hash_dword << (16 - n); \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << (n + 16))) \ common_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << (n + 16))) \ bucket_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x010000 << n)) \ - sig_hash ^= hi_hash_dword >> n; \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << (n + 16))) \ + sig_hash ^= hi_hash_dword << (16 - n); \ } while (0); /** @@ -1515,47 +1495,35 @@ do { \ * defines, and computing two keys at once since the hashed dword stream * will be the same for both keys. **/ -static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_input *atr_input) +static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, + union ixgbe_atr_hash_dword common) { - u32 hi_hash_dword, lo_hash_dword; - u16 sig_hash = 0, bucket_hash = 0, common_hash = 0; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 sig_hash = 0, bucket_hash = 0, common_hash = 0; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. The part masked off - * is the part of the hash reserved to 0. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(input.dword); /* generate common hash dword */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[1] ^ - atr_input->dword_stream[2] ^ - atr_input->dword_stream[3] ^ - atr_input->dword_stream[4] ^ - atr_input->dword_stream[5] ^ - atr_input->dword_stream[6] ^ - atr_input->dword_stream[7] ^ - atr_input->dword_stream[8] ^ - atr_input->dword_stream[9] ^ - atr_input->dword_stream[10]); + hi_hash_dword = IXGBE_NTOHL(common.dword); /* low dword is word swapped version of common */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); - /* hi dword is common dword with l4type and vm_pool added */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* Process bits 0 and 16 */ + IXGBE_COMPUTE_SIG_HASH_ITERATION(0); /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed */ - IXGBE_COMPUTE_SIG_HASH_ITERATION(0); + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + /* Process remaining 30 bit of the key */ IXGBE_COMPUTE_SIG_HASH_ITERATION(1); IXGBE_COMPUTE_SIG_HASH_ITERATION(2); IXGBE_COMPUTE_SIG_HASH_ITERATION(3); @@ -1573,339 +1541,14 @@ static u32 ixgbe_atr_compute_sig_hash_82 IXGBE_COMPUTE_SIG_HASH_ITERATION(15); /* combine common_hash result with signature and bucket hashes */ - sig_hash ^= common_hash; bucket_hash ^= common_hash; + bucket_hash &= IXGBE_ATR_HASH_MASK; - /* return completed signature hash */ - return ((u32)sig_hash << 16) | (bucket_hash & IXGBE_ATR_HASH_MASK); -} - -/** - * ixgbe_atr_set_vlan_id_82599 - Sets the VLAN id in the ATR input stream - * @input: input stream to modify - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_set_vlan_id_82599(union ixgbe_atr_input *input, __be16 vlan) -{ - DEBUGFUNC("ixgbe_atr_set_vlan_id_82599"); - - input->formatted.vlan_id = vlan; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv4_82599 - Sets the source IPv4 address - * @input: input stream to modify - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv4_82599(union ixgbe_atr_input *input, __be32 src_addr) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv4_82599"); - - input->formatted.src_ip[0] = src_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv4_82599 - Sets the destination IPv4 address - * @input: input stream to modify - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 dst_addr) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv4_82599"); - - input->formatted.dst_ip[0] = dst_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv6_82599 - Sets the source IPv6 address - * @input: input stream to modify - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 src_addr_0, __be32 src_addr_1, - __be32 src_addr_2, __be32 src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv6_82599"); - - input->formatted.src_ip[0] = src_addr_0; - input->formatted.src_ip[1] = src_addr_1; - input->formatted.src_ip[2] = src_addr_2; - input->formatted.src_ip[3] = src_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv6_82599 - Sets the destination IPv6 address - * @input: input stream to modify - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 dst_addr_0, __be32 dst_addr_1, - __be32 dst_addr_2, __be32 dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv6_82599"); - - input->formatted.dst_ip[0] = dst_addr_0; - input->formatted.dst_ip[1] = dst_addr_1; - input->formatted.dst_ip[2] = dst_addr_2; - input->formatted.dst_ip[3] = dst_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_port_82599 - Sets the source port - * @input: input stream to modify - * @src_port: the source port to load - **/ -s32 ixgbe_atr_set_src_port_82599(union ixgbe_atr_input *input, __be16 src_port) -{ - DEBUGFUNC("ixgbe_atr_set_src_port_82599"); - - input->formatted.src_port = src_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_port_82599 - Sets the destination port - * @input: input stream to modify - * @dst_port: the destination port to load - **/ -s32 ixgbe_atr_set_dst_port_82599(union ixgbe_atr_input *input, __be16 dst_port) -{ - DEBUGFUNC("ixgbe_atr_set_dst_port_82599"); - - input->formatted.dst_port = dst_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_flex_byte_82599 - Sets the flexible bytes - * @input: input stream to modify - * @flex_bytes: the flexible bytes to load - **/ -s32 ixgbe_atr_set_flex_byte_82599(union ixgbe_atr_input *input, __be16 flex_bytes) -{ - DEBUGFUNC("ixgbe_atr_set_flex_byte_82599"); - - input->formatted.flex_bytes = flex_bytes; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_vm_pool_82599 - Sets the Virtual Machine pool - * @input: input stream to modify - * @vm_pool: the Virtual Machine pool to load - **/ -s32 ixgbe_atr_set_vm_pool_82599(union ixgbe_atr_input *input, u8 vm_pool) -{ - DEBUGFUNC("ixgbe_atr_set_vm_pool_82599"); - - input->formatted.vm_pool = vm_pool; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type - * @input: input stream to modify - * @l4type: the layer 4 type value to load - * - * This call is deprecated and should be replaced with a direct access to - * input->formatted.flow_type. - **/ -s32 ixgbe_atr_set_l4type_82599(union ixgbe_atr_input *input, u8 l4type) -{ - DEBUGFUNC("ixgbe_atr_set_l4type_82599"); - - input->formatted.flow_type = l4type; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_vlan_id_82599 - Gets the VLAN id from the ATR input stream - * @input: input stream to search - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_get_vlan_id_82599(union ixgbe_atr_input *input, __be16 *vlan) -{ - DEBUGFUNC("ixgbe_atr_get_vlan_id_82599"); - - *vlan = input->formatted.vlan_id; - - return IXGBE_SUCCESS; -} + sig_hash ^= common_hash << 16; + sig_hash &= IXGBE_ATR_HASH_MASK << 16; -/** - * ixgbe_atr_get_src_ipv4_82599 - Gets the source IPv4 address - * @input: input stream to search - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv4_82599(union ixgbe_atr_input *input, __be32 *src_addr) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv4_82599"); - - *src_addr = input->formatted.src_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv4_82599 - Gets the destination IPv4 address - * @input: input stream to search - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_get_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 *dst_addr) -{ - DEBUGFUNC("ixgbe_atr_get_dst_ipv4_82599"); - - *dst_addr = input->formatted.dst_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_src_ipv6_82599 - Gets the source IPv6 address - * @input: input stream to search - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 *src_addr_0, __be32 *src_addr_1, - __be32 *src_addr_2, __be32 *src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv6_82599"); - - *src_addr_0 = input->formatted.src_ip[0]; - *src_addr_1 = input->formatted.src_ip[1]; - *src_addr_2 = input->formatted.src_ip[2]; - *src_addr_3 = input->formatted.src_ip[3]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv6_82599 - Gets the destination IPv6 address - * @input: input stream to search - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_get_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 *dst_addr_0, __be32 *dst_addr_1, - __be32 *dst_addr_2, __be32 *dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_get_dst_ipv6_82599"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 22 11:27:11 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173A01065673; Sat, 22 Jan 2011 11:27:11 +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 04F658FC1C; Sat, 22 Jan 2011 11:27: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 p0MBRAnf089976; Sat, 22 Jan 2011 11:27:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MBRAkc089974; Sat, 22 Jan 2011 11:27:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221127.p0MBRAkc089974@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 11:27: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: r217715 - stable/8/sys/vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 11:27:11 -0000 Author: kib Date: Sat Jan 22 11:27:10 2011 New Revision: 217715 URL: http://svn.freebsd.org/changeset/base/217715 Log: MFC r217463: For consistency, use kernel_object instead of &kernel_object_store when initializing the object mutex. Do the same for kmem_object. Modified: stable/8/sys/vm/vm_object.c Directory Properties: 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) Modified: stable/8/sys/vm/vm_object.c ============================================================================== --- stable/8/sys/vm/vm_object.c Sat Jan 22 05:21:20 2011 (r217714) +++ stable/8/sys/vm/vm_object.c Sat Jan 22 11:27:10 2011 (r217715) @@ -248,7 +248,7 @@ vm_object_init(void) TAILQ_INIT(&vm_object_list); mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF); - VM_OBJECT_LOCK_INIT(&kernel_object_store, "kernel object"); + VM_OBJECT_LOCK_INIT(kernel_object, "kernel object"); _vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), kernel_object); #if VM_NRESERVLEVEL > 0 @@ -256,7 +256,7 @@ vm_object_init(void) kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); #endif - VM_OBJECT_LOCK_INIT(&kmem_object_store, "kmem object"); + VM_OBJECT_LOCK_INIT(kmem_object, "kmem object"); _vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), kmem_object); #if VM_NRESERVLEVEL > 0 From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 22 11:29:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A397F1065670; Sat, 22 Jan 2011 11:29:13 +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 91E468FC0A; Sat, 22 Jan 2011 11:29: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 p0MBTDgW090061; Sat, 22 Jan 2011 11:29:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MBTDH3090059; Sat, 22 Jan 2011 11:29:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221129.p0MBTDH3090059@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 11:29: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: r217716 - stable/8/sys/dev/md X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 11:29:13 -0000 Author: kib Date: Sat Jan 22 11:29:13 2011 New Revision: 217716 URL: http://svn.freebsd.org/changeset/base/217716 Log: MFC r217583: Add missed (). Modified: stable/8/sys/dev/md/md.c Directory Properties: 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) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Sat Jan 22 11:27:10 2011 (r217715) +++ stable/8/sys/dev/md/md.c Sat Jan 22 11:29:13 2011 (r217716) @@ -854,8 +854,8 @@ mdcreate_malloc(struct md_s *sc, struct nsectors = sc->mediasize / sc->sectorsize; for (u = 0; u < nsectors; u++) { - sp = (uintptr_t)uma_zalloc(sc->uma, md_malloc_wait ? - M_WAITOK : M_NOWAIT | M_ZERO); + sp = (uintptr_t)uma_zalloc(sc->uma, (md_malloc_wait ? + M_WAITOK : M_NOWAIT) | M_ZERO); if (sp != 0) error = s_write(sc->indir, u, sp); else