From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 03:40:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90440915; Sun, 14 Oct 2012 03:40:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78F008FC0A; Sun, 14 Oct 2012 03:40:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E3e9iQ077302; Sun, 14 Oct 2012 03:40:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E3e9rN077300; Sun, 14 Oct 2012 03:40:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201210140340.q9E3e9rN077300@svn.freebsd.org> From: Alan Cox Date: Sun, 14 Oct 2012 03:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241520 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 03:40:09 -0000 Author: alc Date: Sun Oct 14 03:40:08 2012 New Revision: 241520 URL: http://svn.freebsd.org/changeset/base/241520 Log: Correct an error in pmap_pv_reclaim(). It can legitimately encounter wired mappings. If it does, it should just skip them. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Oct 13 23:54:26 2012 (r241519) +++ head/sys/mips/mips/pmap.c Sun Oct 14 03:40:08 2012 (r241520) @@ -1434,8 +1434,8 @@ pmap_pv_reclaim(pmap_t locked_pmap) ("pmap_pv_reclaim: pde")); pte = pmap_pde_to_pte(pde, va); oldpte = *pte; - KASSERT(!pte_test(&oldpte, PTE_W), - ("wired pte for unwired page")); + if (pte_test(&oldpte, PTE_W)) + continue; if (is_kernel_pmap(pmap)) *pte = PTE_G; else From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 03:51:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C252DD21; Sun, 14 Oct 2012 03:51:59 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9D998FC08; Sun, 14 Oct 2012 03:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E3pxkv079234; Sun, 14 Oct 2012 03:51:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E3pxEe079225; Sun, 14 Oct 2012 03:51:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210140351.q9E3pxEe079225@svn.freebsd.org> From: Attilio Rao Date: Sun, 14 Oct 2012 03:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241521 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 03:51:59 -0000 Author: attilio Date: Sun Oct 14 03:51:59 2012 New Revision: 241521 URL: http://svn.freebsd.org/changeset/base/241521 Log: Rename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to avoid a name clash in sparc64. MFC after: 2 months X-MFC: r241519 Modified: head/sys/fs/fuse/fuse_debug.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_debug.h ============================================================================== --- head/sys/fs/fuse/fuse_debug.h Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_debug.h Sun Oct 14 03:51:59 2012 (r241521) @@ -65,11 +65,11 @@ #define FUSE_DEBUG_VAR __CONCAT(FUSE_DEBUG_,FUSE_DEBUG_MODULE) #endif -#define DEBUG(fmt, ...) DEBUGX(FUSE_DEBUG_VAR >= 1, fmt, ## __VA_ARGS__) -#define DEBUG2G(fmt, ...) DEBUGX(FUSE_DEBUG_VAR >= 2, fmt, ## __VA_ARGS__) +#define FS_DEBUG(fmt, ...) DEBUGX(FUSE_DEBUG_VAR >= 1, fmt, ## __VA_ARGS__) +#define FS_DEBUG2G(fmt, ...) DEBUGX(FUSE_DEBUG_VAR >= 2, fmt, ## __VA_ARGS__) -#define debug_printf(fmt, ...) DEBUG(fmt, ## __VA_ARGS__) -#define kdebug_printf(fmt, ...) DEBUG(fmt, ## __VA_ARGS__) +#define debug_printf(fmt, ...) FS_DEBUG(fmt, ## __VA_ARGS__) +#define kdebug_printf(fmt, ...) FS_DEBUG(fmt, ## __VA_ARGS__) #define fuse_trace_printf(fmt, ...) \ DEBUGX(FUSE_DEBUG_VAR && FUSE_TRACE, fmt, ## __VA_ARGS__) Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_device.c Sun Oct 14 03:51:59 2012 (r241521) @@ -126,14 +126,14 @@ fuse_device_open(struct cdev *dev, int o struct fuse_data *fdata; int error; - DEBUG("device %p\n", dev); + FS_DEBUG("device %p\n", dev); fdata = fdata_alloc(dev, td->td_ucred); error = devfs_set_cdevpriv(fdata, fdata_dtor); if (error != 0) fdata_trydestroy(fdata); else - DEBUG("%s: device opened by thread %d.\n", dev->si_name, + FS_DEBUG("%s: device opened by thread %d.\n", dev->si_name, td->td_tid); return (error); } @@ -169,7 +169,7 @@ fuse_device_close(struct cdev *dev, int fuse_lck_mtx_unlock(data->aw_mtx); FUSE_UNLOCK(); - DEBUG("%s: device closed by thread %d.\n", dev->si_name, td->td_tid); + FS_DEBUG("%s: device closed by thread %d.\n", dev->si_name, td->td_tid); return (0); } @@ -213,7 +213,7 @@ fuse_device_read(struct cdev *dev, struc int buflen[3]; int i; - DEBUG("fuse device being read on thread %d\n", uio->uio_td->td_tid); + FS_DEBUG("fuse device being read on thread %d\n", uio->uio_td->td_tid); err = devfs_get_cdevpriv((void **)&data); if (err != 0) @@ -222,7 +222,7 @@ fuse_device_read(struct cdev *dev, struc fuse_lck_mtx_lock(data->ms_mtx); again: if (fdata_get_dead(data)) { - DEBUG2G("we know early on that reader should be kicked so we don't wait for news\n"); + FS_DEBUG2G("we know early on that reader should be kicked so we don't wait for news\n"); fuse_lck_mtx_unlock(data->ms_mtx); return (ENODEV); } @@ -248,7 +248,7 @@ again: * -- and some other cases, too, tho not totally clear, when * (cv_signal/wakeup_one signals the whole process ?) */ - DEBUG("no message on thread #%d\n", uio->uio_td->td_tid); + FS_DEBUG("no message on thread #%d\n", uio->uio_td->td_tid); goto again; } fuse_lck_mtx_unlock(data->ms_mtx); @@ -258,16 +258,16 @@ again: * somebody somewhere -- eg., umount routine -- * wants this liaison finished off */ - DEBUG2G("reader is to be sacked\n"); + FS_DEBUG2G("reader is to be sacked\n"); if (tick) { - DEBUG2G("weird -- \"kick\" is set tho there is message\n"); + FS_DEBUG2G("weird -- \"kick\" is set tho there is message\n"); FUSE_ASSERT_MS_DONE(tick); fuse_ticket_drop(tick); } return (ENODEV); /* This should make the daemon get off * of us */ } - DEBUG("message got on thread #%d\n", uio->uio_td->td_tid); + FS_DEBUG("message got on thread #%d\n", uio->uio_td->td_tid); KASSERT(tick->tk_ms_bufdata || tick->tk_ms_bufsize == 0, ("non-null buf pointer with positive size")); @@ -301,7 +301,7 @@ again: */ if (uio->uio_resid < buflen[i]) { fdata_set_dead(data); - DEBUG2G("daemon is stupid, kick it off...\n"); + FS_DEBUG2G("daemon is stupid, kick it off...\n"); err = ENODEV; break; } @@ -319,16 +319,16 @@ again: static __inline int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { - DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n", + FS_DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n", ohead->len, ohead->error, (unsigned long long)ohead->unique, uio->uio_iovcnt); if (uio->uio_resid + sizeof(struct fuse_out_header) != ohead->len) { - DEBUG("Format error: body size differs from size claimed by header\n"); + FS_DEBUG("Format error: body size differs from size claimed by header\n"); return (EINVAL); } if (uio->uio_resid && ohead->error) { - DEBUG("Format error: non zero error but message had a body\n"); + FS_DEBUG("Format error: non zero error but message had a body\n"); return (EINVAL); } /* Sanitize the linuxism of negative errnos */ @@ -352,7 +352,7 @@ fuse_device_write(struct cdev *dev, stru struct fuse_ticket *tick, *x_tick; int found = 0; - DEBUG("resid: %zd, iovcnt: %d, thread: %d\n", + FS_DEBUG("resid: %zd, iovcnt: %d, thread: %d\n", uio->uio_resid, uio->uio_iovcnt, uio->uio_td->td_tid); err = devfs_get_cdevpriv((void **)&data); @@ -360,7 +360,7 @@ fuse_device_write(struct cdev *dev, stru return (err); if (uio->uio_resid < sizeof(struct fuse_out_header)) { - DEBUG("got less than a header!\n"); + FS_DEBUG("got less than a header!\n"); fdata_set_dead(data); return (EINVAL); } @@ -384,7 +384,7 @@ fuse_device_write(struct cdev *dev, stru fuse_lck_mtx_lock(data->aw_mtx); TAILQ_FOREACH_SAFE(tick, &data->aw_head, tk_aw_link, x_tick) { - DEBUG("bumped into callback #%llu\n", + FS_DEBUG("bumped into callback #%llu\n", (unsigned long long)tick->tk_unique); if (tick->tk_unique == ohead.unique) { found = 1; @@ -404,12 +404,12 @@ fuse_device_write(struct cdev *dev, stru * via ticket_drop(), so no manual mucking * around...) */ - DEBUG("pass ticket to a callback\n"); + FS_DEBUG("pass ticket to a callback\n"); memcpy(&tick->tk_aw_ohead, &ohead, sizeof(ohead)); err = tick->tk_aw_handler(tick, uio); } else { /* pretender doesn't wanna do anything with answer */ - DEBUG("stuff devalidated, so we drop it\n"); + FS_DEBUG("stuff devalidated, so we drop it\n"); } /* @@ -420,7 +420,7 @@ fuse_device_write(struct cdev *dev, stru fuse_ticket_drop(tick); } else { /* no callback at all! */ - DEBUG("erhm, no handler for this response\n"); + FS_DEBUG("erhm, no handler for this response\n"); err = EINVAL; } Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_file.c Sun Oct 14 03:51:59 2012 (r241521) @@ -245,7 +245,7 @@ fuse_filehandle_init(struct vnode *vp, struct fuse_vnode_data *fvdat = VTOFUD(vp); struct fuse_filehandle *fufh; - DEBUG("id=%jd type=%d\n", (intmax_t)fh_id, fufh_type); + FS_DEBUG("id=%jd type=%d\n", (intmax_t)fh_id, fufh_type); fufh = &(fvdat->fufh[fufh_type]); MPASS(!FUFH_IS_VALID(fufh)); fufh->fh_id = fh_id; Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_io.c Sun Oct 14 03:51:59 2012 (r241521) @@ -145,23 +145,23 @@ fuse_io_dispatch(struct vnode *vp, struc switch (uio->uio_rw) { case UIO_READ: if (directio) { - DEBUG("direct read of vnode %ju via file handle %ju\n", + FS_DEBUG("direct read of vnode %ju via file handle %ju\n", (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id); err = fuse_read_directbackend(vp, uio, cred, fufh); } else { - DEBUG("buffered read of vnode %ju\n", + FS_DEBUG("buffered read of vnode %ju\n", (uintmax_t)VTOILLU(vp)); err = fuse_read_biobackend(vp, uio, cred, fufh); } break; case UIO_WRITE: if (directio) { - DEBUG("direct write of vnode %ju via file handle %ju\n", + FS_DEBUG("direct write of vnode %ju via file handle %ju\n", (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id); err = fuse_write_directbackend(vp, uio, cred, fufh); fuse_invalidate_attr(vp); } else { - DEBUG("buffered write of vnode %ju\n", + FS_DEBUG("buffered write of vnode %ju\n", (uintmax_t)VTOILLU(vp)); err = fuse_write_biobackend(vp, uio, cred, fufh); } @@ -185,7 +185,7 @@ fuse_read_biobackend(struct vnode *vp, s const int biosize = fuse_iosize(vp); - DEBUG("resid=%zx offset=%jx fsize=%jx\n", + FS_DEBUG("resid=%zx offset=%jx fsize=%jx\n", uio->uio_resid, uio->uio_offset, VTOFUD(vp)->filesize); if (uio->uio_resid == 0) @@ -204,7 +204,7 @@ fuse_read_biobackend(struct vnode *vp, s lbn = uio->uio_offset / biosize; on = uio->uio_offset & (biosize - 1); - DEBUG2G("biosize %d, lbn %d, on %d\n", biosize, (int)lbn, on); + FS_DEBUG2G("biosize %d, lbn %d, on %d\n", biosize, (int)lbn, on); /* * Obtain the buffer cache block. Figure out the buffer size @@ -253,13 +253,13 @@ fuse_read_biobackend(struct vnode *vp, s if (on < bcount) n = MIN((unsigned)(bcount - on), uio->uio_resid); if (n > 0) { - DEBUG2G("feeding buffeater with %d bytes of buffer %p," + FS_DEBUG2G("feeding buffeater with %d bytes of buffer %p," " saying %d was asked for\n", n, bp->b_data + on, n + (int)bp->b_resid); err = uiomove(bp->b_data + on, n, uio); } brelse(bp); - DEBUG2G("end of turn, err %d, uio->uio_resid %zd, n %d\n", + FS_DEBUG2G("end of turn, err %d, uio->uio_resid %zd, n %d\n", err, uio->uio_resid, n); } while (err == 0 && uio->uio_resid > 0 && n > 0); @@ -296,14 +296,14 @@ fuse_read_directbackend(struct vnode *vp fri->size = MIN(uio->uio_resid, fuse_get_mpdata(vp->v_mount)->max_read); - DEBUG2G("fri->fh %ju, fri->offset %ju, fri->size %ju\n", + FS_DEBUG2G("fri->fh %ju, fri->offset %ju, fri->size %ju\n", (uintmax_t)fri->fh, (uintmax_t)fri->offset, (uintmax_t)fri->size); if ((err = fdisp_wait_answ(&fdi))) goto out; - DEBUG2G("complete: got iosize=%d, requested fri.size=%zd; " + FS_DEBUG2G("complete: got iosize=%d, requested fri.size=%zd; " "resid=%zd offset=%ju\n", fri->size, fdi.iosize, uio->uio_resid, (uintmax_t)uio->uio_offset); @@ -383,7 +383,7 @@ fuse_write_biobackend(struct vnode *vp, const int biosize = fuse_iosize(vp); KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); - DEBUG("resid=%zx offset=%jx fsize=%jx\n", + FS_DEBUG("resid=%zx offset=%jx fsize=%jx\n", uio->uio_resid, uio->uio_offset, fvdat->filesize); if (vp->v_type != VREG) return (EIO); @@ -409,7 +409,7 @@ fuse_write_biobackend(struct vnode *vp, on = uio->uio_offset & (biosize - 1); n = MIN((unsigned)(biosize - on), uio->uio_resid); - DEBUG2G("lbn %ju, on %d, n %d, uio offset %ju, uio resid %zd\n", + FS_DEBUG2G("lbn %ju, on %d, n %d, uio offset %ju, uio resid %zd\n", (uintmax_t)lbn, on, n, (uintmax_t)uio->uio_offset, uio->uio_resid); @@ -426,7 +426,7 @@ again: * readers from reading garbage. */ bcount = on; - DEBUG("getting block from OS, bcount %d\n", bcount); + FS_DEBUG("getting block from OS, bcount %d\n", bcount); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp != NULL) { @@ -456,7 +456,7 @@ again: bcount = fvdat->filesize - (off_t)lbn *biosize; } - DEBUG("getting block from OS, bcount %d\n", bcount); + FS_DEBUG("getting block from OS, bcount %d\n", bcount); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp && uio->uio_offset + n > fvdat->filesize) { err = fuse_vnode_setsize(vp, cred, @@ -518,7 +518,7 @@ again: */ if (bp->b_dirtyend > bcount) { - DEBUG("FUSE append race @%lx:%d\n", + FS_DEBUG("FUSE append race @%lx:%d\n", (long)bp->b_blkno * biosize, bp->b_dirtyend - bcount); bp->b_dirtyend = bcount; @@ -614,7 +614,7 @@ fuse_io_strategy(struct vnode *vp, struc MPASS(vp->v_type == VREG); MPASS(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE); - DEBUG("inode=%ju offset=%jd resid=%ld\n", + FS_DEBUG("inode=%ju offset=%jd resid=%ld\n", (uintmax_t)VTOI(vp), (intmax_t)(((off_t)bp->b_blkno) * biosize), bp->b_bcount); @@ -688,7 +688,7 @@ fuse_io_strategy(struct vnode *vp, struc * If we only need to commit, try to commit */ if (bp->b_flags & B_NEEDCOMMIT) { - DEBUG("write: B_NEEDCOMMIT flags set\n"); + FS_DEBUG("write: B_NEEDCOMMIT flags set\n"); } /* * Setup for actual write Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_ipc.c Sun Oct 14 03:51:59 2012 (r241521) @@ -246,7 +246,7 @@ fticket_init(void *mem, int size, int fl { struct fuse_ticket *ftick = mem; - DEBUG("ftick=%p\n", ftick); + FS_DEBUG("ftick=%p\n", ftick); bzero(ftick, sizeof(struct fuse_ticket)); @@ -265,7 +265,7 @@ fticket_fini(void *mem, int size) { struct fuse_ticket *ftick = mem; - DEBUG("ftick=%p\n", ftick); + FS_DEBUG("ftick=%p\n", ftick); fiov_teardown(&ftick->tk_ms_fiov); fiov_teardown(&ftick->tk_aw_fiov); @@ -433,10 +433,10 @@ fdata_alloc(struct cdev *fdev, struct uc void fdata_trydestroy(struct fuse_data *data) { - DEBUG("data=%p data.mp=%p data.fdev=%p data.flags=%04x\n", + FS_DEBUG("data=%p data.mp=%p data.fdev=%p data.flags=%04x\n", data, data->mp, data->fdev, data->dataflags); - DEBUG("destroy: data=%p\n", data); + FS_DEBUG("destroy: data=%p\n", data); data->ref--; MPASS(data->ref >= 0); if (data->ref != 0) Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_node.c Sun Oct 14 03:51:59 2012 (r241521) @@ -180,7 +180,7 @@ fuse_vnode_alloc(struct mount *mp, struct vnode *vp2; int err = 0; - DEBUG("been asked for vno #%ju\n", (uintmax_t)nodeid); + FS_DEBUG("been asked for vno #%ju\n", (uintmax_t)nodeid); if (vtyp == VNON) { return EINVAL; @@ -193,7 +193,7 @@ fuse_vnode_alloc(struct mount *mp, if (*vpp) { MPASS((*vpp)->v_type == vtyp && (*vpp)->v_data != NULL); - DEBUG("vnode taken from hash\n"); + FS_DEBUG("vnode taken from hash\n"); return (0); } fvdat = malloc(sizeof(*fvdat), M_FUSEVN, M_WAITOK | M_ZERO); @@ -302,7 +302,7 @@ fuse_vnode_savesize(struct vnode *vp, st struct fuse_setattr_in *fsai; int err = 0; - DEBUG("inode=%ju size=%ju\n", (uintmax_t)VTOI(vp), + FS_DEBUG("inode=%ju size=%ju\n", (uintmax_t)VTOI(vp), (uintmax_t)fvdat->filesize); ASSERT_VOP_ELOCKED(vp, "fuse_io_extend"); @@ -355,7 +355,7 @@ fuse_vnode_refreshsize(struct vnode *vp, return; VOP_GETATTR(vp, &va, cred); - DEBUG("refreshed file size: %jd\n", (intmax_t)VTOFUD(vp)->filesize); + FS_DEBUG("refreshed file size: %jd\n", (intmax_t)VTOFUD(vp)->filesize); } int @@ -365,7 +365,7 @@ fuse_vnode_setsize(struct vnode *vp, str off_t oldsize; int err = 0; - DEBUG("inode=%ju oldsize=%ju newsize=%ju\n", + FS_DEBUG("inode=%ju oldsize=%ju newsize=%ju\n", (uintmax_t)VTOI(vp), (uintmax_t)fvdat->filesize, (uintmax_t)newsize); ASSERT_VOP_ELOCKED(vp, "fuse_vnode_setsize"); Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_vfsops.c Sun Oct 14 03:51:59 2012 (r241521) @@ -285,11 +285,11 @@ fuse_vfsop_mount(struct mount *mp) } subtype = vfs_getopts(opts, "subtype=", &err); - DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); + FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); err = fget(td, fd, CAP_READ, &fp); if (err != 0) { - DEBUG("invalid or not opened device: data=%p\n", data); + FS_DEBUG("invalid or not opened device: data=%p\n", data); goto out; } fptmp = td->td_fpop; @@ -299,14 +299,14 @@ fuse_vfsop_mount(struct mount *mp) fdrop(fp, td); FUSE_LOCK(); if (err != 0 || data == NULL || data->mp != NULL) { - DEBUG("invalid or not opened device: data=%p data.mp=%p\n", + FS_DEBUG("invalid or not opened device: data=%p data.mp=%p\n", data, data != NULL ? data->mp : NULL); err = ENXIO; FUSE_UNLOCK(); goto out; } if (fdata_get_dead(data)) { - DEBUG("device is dead during mount: data=%p\n", data); + FS_DEBUG("device is dead during mount: data=%p\n", data); err = ENOTCONN; FUSE_UNLOCK(); goto out; @@ -346,7 +346,7 @@ fuse_vfsop_mount(struct mount *mp) } copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len); bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); - DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname); + FS_DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname); /* Now handshaking with daemon */ fuse_internal_send_init(data, td); @@ -359,7 +359,7 @@ out: * Destroy device only if we acquired reference to * it */ - DEBUG("mount failed, destroy device: data=%p mp=%p" + FS_DEBUG("mount failed, destroy device: data=%p mp=%p" " err=%d\n", data, mp, err); data->mp = NULL; @@ -450,12 +450,12 @@ fuse_vfsop_root(struct mount *mp, int lk FUSE_LOCK(); MPASS(data->vroot == NULL || data->vroot == *vpp); if (data->vroot == NULL) { - DEBUG("new root vnode\n"); + FS_DEBUG("new root vnode\n"); data->vroot = *vpp; FUSE_UNLOCK(); vref(*vpp); } else if (data->vroot != *vpp) { - DEBUG("root vnode race\n"); + FS_DEBUG("root vnode race\n"); FUSE_UNLOCK(); VOP_UNLOCK(*vpp, 0); vrele(*vpp); @@ -477,7 +477,7 @@ fuse_vfsop_statfs(struct mount *mp, stru struct fuse_statfs_out *fsfo; struct fuse_data *data; - DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname); + FS_DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname); data = fuse_get_mpdata(mp); if (!(data->dataflags & FSESS_INITED)) @@ -508,7 +508,7 @@ fuse_vfsop_statfs(struct mount *mp, stru sbp->f_namemax = fsfo->st.namelen; sbp->f_bsize = fsfo->st.frsize; /* cast from uint32_t to uint64_t */ - DEBUG("fuse_statfs_out -- blocks: %llu, bfree: %llu, bavail: %llu, " + FS_DEBUG("fuse_statfs_out -- blocks: %llu, bfree: %llu, bavail: %llu, " "fil es: %llu, ffree: %llu, bsize: %i, namelen: %i\n", (unsigned long long)fsfo->st.blocks, (unsigned long long)fsfo->st.bfree, Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sun Oct 14 03:40:08 2012 (r241520) +++ head/sys/fs/fuse/fuse_vnops.c Sun Oct 14 03:51:59 2012 (r241521) @@ -219,7 +219,7 @@ fuse_vnop_access(struct vop_access_args int err; - DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); if (fuse_isdeadfs(vp)) { if (vnode_isvroot(vp)) { @@ -242,7 +242,7 @@ fuse_vnop_access(struct vop_access_args bzero(&facp, sizeof(facp)); err = fuse_internal_access(vp, accmode, &facp, ap->a_td, ap->a_cred); - DEBUG2G("err=%d accmode=0x%x\n", err, accmode); + FS_DEBUG2G("err=%d accmode=0x%x\n", err, accmode); return err; } @@ -478,7 +478,7 @@ fuse_vnop_getattr(struct vop_getattr_arg int dataflags; struct fuse_dispatcher fdi; - DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); dataflags = fuse_get_mpdata(vnode_mount(vp))->dataflags; @@ -567,7 +567,7 @@ fuse_vnop_inactive(struct vop_inactive_a int type, need_flush = 1; - DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp)); for (type = 0; type < FUFH_MAXTYPE; type++) { fufh = &(fvdat->fufh[type]); @@ -678,7 +678,7 @@ fuse_vnop_lookup(struct vop_lookup_args uint64_t nid; struct fuse_access_param facp; - DEBUG2G("parent_inode=%ju - %*s\n", + FS_DEBUG2G("parent_inode=%ju - %*s\n", (uintmax_t)VTOI(dvp), (int)cnp->cn_namelen, cnp->cn_nameptr); if (fuse_isdeadfs(dvp)) { @@ -808,7 +808,7 @@ calldaemon: */ #if 0 if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) { - DEBUG("inserting NULL into cache\n"); + FS_DEBUG("inserting NULL into cache\n"); cache_enter(dvp, NULL, cnp); } #endif @@ -1058,7 +1058,7 @@ out: } if (err) { if (tmpvtype == VLNK) - DEBUG("weird, permission error with a symlink?\n"); + FS_DEBUG("weird, permission error with a symlink?\n"); vput(*vpp); *vpp = NULL; } @@ -1145,7 +1145,7 @@ fuse_vnop_open(struct vop_open_args *ap) int error, isdir = 0; - DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode); + FS_DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode); if (fuse_isdeadfs(vp)) { return ENXIO; @@ -1186,7 +1186,7 @@ fuse_vnop_read(struct vop_read_args *ap) int ioflag = ap->a_ioflag; struct ucred *cred = ap->a_cred; - DEBUG2G("inode=%ju offset=%jd resid=%zd\n", + FS_DEBUG2G("inode=%ju offset=%jd resid=%zd\n", (uintmax_t)VTOI(vp), uio->uio_offset, uio->uio_resid); if (fuse_isdeadfs(vp)) { @@ -1219,7 +1219,7 @@ fuse_vnop_readdir(struct vop_readdir_arg int err = 0; int freefufh = 0; - DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); if (fuse_isdeadfs(vp)) { return ENXIO; @@ -1231,7 +1231,7 @@ fuse_vnop_readdir(struct vop_readdir_arg fvdat = VTOFUD(vp); if (!fuse_filehandle_valid(vp, FUFH_RDONLY)) { - DEBUG("calling readdir() before open()"); + FS_DEBUG("calling readdir() before open()"); err = fuse_filehandle_open(vp, FUFH_RDONLY, &fufh, NULL, cred); freefufh = 1; } else { @@ -1269,7 +1269,7 @@ fuse_vnop_readlink(struct vop_readlink_a struct fuse_dispatcher fdi; int err; - DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); if (fuse_isdeadfs(vp)) { return ENXIO; @@ -1316,7 +1316,7 @@ fuse_vnop_reclaim(struct vop_reclaim_arg if (!fvdat) { panic("FUSE: no vnode data during recycling"); } - DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp)); for (type = 0; type < FUFH_MAXTYPE; type++) { fufh = &(fvdat->fufh[type]); @@ -1356,7 +1356,7 @@ fuse_vnop_remove(struct vop_remove_args int err; - DEBUG2G("inode=%ju name=%*s\n", + FS_DEBUG2G("inode=%ju name=%*s\n", (uintmax_t)VTOI(vp), (int)cnp->cn_namelen, cnp->cn_nameptr); if (fuse_isdeadfs(vp)) { @@ -1399,7 +1399,7 @@ fuse_vnop_rename(struct vop_rename_args int err = 0; - DEBUG2G("from: inode=%ju name=%*s -> to: inode=%ju name=%*s\n", + FS_DEBUG2G("from: inode=%ju name=%*s -> to: inode=%ju name=%*s\n", (uintmax_t)VTOI(fvp), (int)fcnp->cn_namelen, fcnp->cn_nameptr, (uintmax_t)(tvp == NULL ? -1 : VTOI(tvp)), (int)tcnp->cn_namelen, tcnp->cn_nameptr); @@ -1409,7 +1409,7 @@ fuse_vnop_rename(struct vop_rename_args } if (fvp->v_mount != tdvp->v_mount || (tvp && fvp->v_mount != tvp->v_mount)) { - DEBUG("cross-device rename: %s -> %s\n", + FS_DEBUG("cross-device rename: %s -> %s\n", fcnp->cn_nameptr, (tcnp != NULL ? tcnp->cn_nameptr : "(NULL)")); err = EXDEV; goto out; @@ -1474,7 +1474,7 @@ fuse_vnop_rmdir(struct vop_rmdir_args *a int err; - DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); if (fuse_isdeadfs(vp)) { return ENXIO; @@ -1516,7 +1516,7 @@ fuse_vnop_setattr(struct vop_setattr_arg int sizechanged = 0; uint64_t newsize = 0; - DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); + FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); if (fuse_isdeadfs(vp)) { return ENXIO; @@ -1693,7 +1693,7 @@ fuse_vnop_symlink(struct vop_symlink_arg int err; size_t len; - DEBUG2G("inode=%ju name=%*s\n", + FS_DEBUG2G("inode=%ju name=%*s\n", (uintmax_t)VTOI(dvp), (int)cnp->cn_namelen, cnp->cn_nameptr); if (fuse_isdeadfs(dvp)) { @@ -1772,7 +1772,7 @@ fuse_vnop_getpages(struct vop_getpages_a struct ucred *cred; vm_page_t *pages; - DEBUG2G("heh\n"); + FS_DEBUG2G("heh\n"); vp = ap->a_vp; KASSERT(vp->v_object, ("objectless vp passed to getpages")); @@ -1782,7 +1782,7 @@ fuse_vnop_getpages(struct vop_getpages_a count = ap->a_count; if (!fsess_opt_mmap(vnode_mount(vp))) { - DEBUG("called on non-cacheable vnode??\n"); + FS_DEBUG("called on non-cacheable vnode??\n"); return (VM_PAGER_ERROR); } npages = btoc(count); @@ -1837,7 +1837,7 @@ fuse_vnop_getpages(struct vop_getpages_a relpbuf(bp, &fuse_pbuf_freecnt); if (error && (uio.uio_resid == count)) { - DEBUG("error %d\n", error); + FS_DEBUG("error %d\n", error); VM_OBJECT_LOCK(vp->v_object); fuse_vm_page_lock_queues(); for (i = 0; i < npages; ++i) { @@ -1951,7 +1951,7 @@ fuse_vnop_putpages(struct vop_putpages_a vm_page_t *pages; vm_ooffset_t fsize; - DEBUG2G("heh\n"); + FS_DEBUG2G("heh\n"); vp = ap->a_vp; KASSERT(vp->v_object, ("objectless vp passed to putpages")); @@ -1965,7 +1965,7 @@ fuse_vnop_putpages(struct vop_putpages_a offset = IDX_TO_OFF(pages[0]->pindex); if (!fsess_opt_mmap(vnode_mount(vp))) { - DEBUG("called on non-cacheable vnode??\n"); + FS_DEBUG("called on non-cacheable vnode??\n"); } for (i = 0; i < npages; i++) rtvals[i] = VM_PAGER_AGAIN; From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 03:59:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C08AAEDE; Sun, 14 Oct 2012 03:59:17 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7A7F8FC0A; Sun, 14 Oct 2012 03:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E3xHOC080265; Sun, 14 Oct 2012 03:59:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E3xHJS080263; Sun, 14 Oct 2012 03:59:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210140359.q9E3xHJS080263@svn.freebsd.org> From: Attilio Rao Date: Sun, 14 Oct 2012 03:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241522 - head/sbin/mount_fusefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 03:59:17 -0000 Author: attilio Date: Sun Oct 14 03:59:17 2012 New Revision: 241522 URL: http://svn.freebsd.org/changeset/base/241522 Log: getopt_long() returns an int. Use the return value accordingly. Pointy hat to: me MFC after: 2 months X-MFC: r241519,241521 Modified: head/sbin/mount_fusefs/mount_fusefs.c Modified: head/sbin/mount_fusefs/mount_fusefs.c ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.c Sun Oct 14 03:51:59 2012 (r241521) +++ head/sbin/mount_fusefs/mount_fusefs.c Sun Oct 14 03:59:17 2012 (r241522) @@ -107,7 +107,6 @@ int main(int argc, char *argv[]) { struct iovec *iov; - char ch = '\0'; int mntflags, iovlen, verbose = 0; char *dev = NULL, *dir = NULL, mntpath[MAXPATHLEN]; char *devo = NULL, *diro = NULL; @@ -115,6 +114,7 @@ main(int argc, char *argv[]) int i, done = 0, reject_allow_other = 0, safe_level = 0; int altflags = DEFAULT_MOUNT_FLAGS; int __altflags = DEFAULT_MOUNT_FLAGS; + int ch = 0; struct mntopt *mo; struct mntval *mv; static struct option longopts[] = { From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 06:52:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CA616A0; Sun, 14 Oct 2012 06:52:50 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6324E8FC08; Sun, 14 Oct 2012 06:52:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E6qoih008304; Sun, 14 Oct 2012 06:52:50 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E6qoF7008300; Sun, 14 Oct 2012 06:52:50 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201210140652.q9E6qoF7008300@svn.freebsd.org> From: Devin Teske Date: Sun, 14 Oct 2012 06:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241523 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 06:52:50 -0000 Author: dteske Date: Sun Oct 14 06:52:49 2012 New Revision: 241523 URL: http://svn.freebsd.org/changeset/base/241523 Log: Since the introduction of the new advanced boot menu (r222417), options like "boot verbose", "single user mode", "ACPI" and more are now stateful boolean menuitems rather than direct action-items. A short-coming in this new menu system is that when a user sets a non-default value in loader.conf(5), this non-default state is not reflected in the menu -- leading to confusion as to whether the option was taking effect or not. This patch adds dynamic menuitem constructors _and_ the necessary Forth callbacks to initialize these stateful menuitems -- causing the aforementioned menuitems to adhere to loader.conf(5) settings. PR: bin/172529 Approved by: adrian (co-mentor) MFC after: 21 days Modified: head/sys/boot/forth/menu-commands.4th head/sys/boot/forth/menu.4th head/sys/boot/forth/menu.rc Modified: head/sys/boot/forth/menu-commands.4th ============================================================================== --- head/sys/boot/forth/menu-commands.4th Sun Oct 14 03:59:17 2012 (r241522) +++ head/sys/boot/forth/menu-commands.4th Sun Oct 14 06:52:49 2012 (r241523) @@ -26,6 +26,9 @@ marker task-menu-commands.4th +variable kernel_state +variable root_state + : acpi_enable ( -- ) s" set acpi_load=YES" evaluate \ XXX deprecated but harmless s" set hint.acpi.0.disabled=0" evaluate @@ -53,6 +56,13 @@ marker task-menu-commands.4th TRUE \ loop menu again ; +: init_safemode ( N -- N ) + s" kern.smp.disabled" getenv -1 <> if + drop ( n c-addr -- n ) \ unused + toggle_menuitem ( n -- n ) + then +; + : toggle_safemode ( N -- N TRUE ) toggle_menuitem @@ -84,6 +94,13 @@ marker task-menu-commands.4th TRUE \ loop menu again ; +: init_singleuser ( N -- N ) + s" boot_single" getenv -1 <> if + drop ( n c-addr -- n ) \ unused + toggle_menuitem ( n -- n ) + then +; + : toggle_singleuser ( N -- N TRUE ) toggle_menuitem menu-redraw @@ -102,6 +119,13 @@ marker task-menu-commands.4th TRUE \ loop menu again ; +: init_verbose ( N -- N ) + s" boot_verbose" getenv -1 <> if + drop ( n c-addr -- n ) \ unused + toggle_menuitem ( n -- n ) + then +; + : toggle_verbose ( N -- N TRUE ) toggle_menuitem menu-redraw @@ -132,6 +156,27 @@ marker task-menu-commands.4th FALSE \ exit the menu ; +: init_cyclestate ( N K -- N ) + over ( n k -- n k n ) + s" cycle_stateN" ( n k n -- n k n c-addr u ) + -rot tuck 11 + c! swap ( n k n c-addr u -- n k c-addr u ) + evaluate ( n k c-addr u -- n k addr ) + begin + tuck @ ( n k addr -- n addr k c ) + over <> ( n addr k c -- n addr k 0|-1 ) + while + rot ( n addr k -- addr k n ) + cycle_menuitem + swap rot ( addr k n -- n k addr ) + repeat + 2drop ( n k addr -- n ) +; + +: init_kernel ( N -- N ) + kernel_state @ ( n -- n k ) + init_cyclestate ( n k -- n ) +; + : cycle_kernel ( N -- N TRUE ) cycle_menuitem menu-redraw @@ -142,6 +187,7 @@ marker task-menu-commands.4th -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral evaluate \ translate name into address @ \ dereference address into value + dup kernel_state ! \ save a copy for re-initialization 48 + \ convert to ASCII numeral s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}" @@ -152,6 +198,11 @@ marker task-menu-commands.4th TRUE \ loop menu again ; +: init_root ( N -- N ) + root_state @ ( n -- n k ) + init_cyclestate ( n k -- n ) +; + : cycle_root ( N -- N TRUE ) cycle_menuitem menu-redraw @@ -162,6 +213,7 @@ marker task-menu-commands.4th -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral evaluate \ translate name into address @ \ dereference address into value + dup root_state ! \ save a copy for re-initialization 48 + \ convert to ASCII numeral s" set root=${root_prefix}${root[N]}${root_suffix}" Modified: head/sys/boot/forth/menu.4th ============================================================================== --- head/sys/boot/forth/menu.4th Sun Oct 14 03:59:17 2012 (r241522) +++ head/sys/boot/forth/menu.4th Sun Oct 14 06:52:49 2012 (r241523) @@ -76,6 +76,16 @@ variable menu_timeout \ determin variable menu_timeout_x \ column position of timeout message variable menu_timeout_y \ row position of timeout message +\ Menu initialization status variables +variable init_state1 +variable init_state2 +variable init_state3 +variable init_state4 +variable init_state5 +variable init_state6 +variable init_state7 +variable init_state8 + \ Boolean option status variables variable toggle_state1 variable toggle_state2 @@ -421,6 +431,16 @@ create init_text8 255 allot then 24 over 2 / - 9 at-xy type + \ If $menu_init is set, evaluate it (allowing for whole menus to be + \ constructed dynamically -- as this function could conceivably set + \ the remaining environment variables to construct the menu entirely). + \ + s" menu_init" getenv dup -1 <> if + evaluate + else + drop + then + \ Print our menu options with respective key/variable associations. \ `printmenuitem' ends by adding the decimal ASCII value for the \ numerical prefix to the stack. We store the value left on the stack @@ -499,6 +519,24 @@ create init_text8 255 allot dup menuacpi @ = if acpimenuitem ( -- C-Addr/U | -1 ) else + \ make sure we have not already initialized this item + s" init_stateN" + -rot 2dup 10 + c! rot \ repace 'N' + evaluate dup @ 0= if + 1 swap ! + + \ If this menuitem has an initializer, run it + s" menu_init[x]" + -rot 2dup 10 + c! rot \ replace 'x' + getenv dup -1 <> if + evaluate + else + drop + then + else + drop + then + loader_color? if s" ansi_caption[x]" else @@ -917,6 +955,10 @@ create init_text8 255 allot -rot 2dup 13 + c! rot \ replace 'x' unsetenv + s" menu_init[x]" \ initializer basename + -rot 2dup 10 + c! rot \ replace 'x' + unsetenv + s" menu_keycode[x]" \ keycode basename -rot 2dup 13 + c! rot \ replace 'x' unsetenv @@ -959,6 +1001,10 @@ create init_text8 255 allot -rot 2dup 9 + c! rot \ replace 'N' with current iteration evaluate \ assign zero (0) to key assoc. var + s" 0 init_stateN !" \ used by menu-create + -rot 2dup 12 + c! rot \ replace 'N' + evaluate + 1+ dup 56 > \ increment, continue if less than 57 until drop \ iterator @@ -979,6 +1025,8 @@ create init_text8 255 allot s" menu_optionstext" unsetenv 0 menuoptions ! + \ clear the menu initializer + s" menu_init" unsetenv ; \ This function both unsets menu variables and visually erases the menu area @@ -994,6 +1042,16 @@ bullet menubllt ! 10 menuY ! 5 menuX ! +\ Initialize our menu initialization state variables +0 init_state1 ! +0 init_state2 ! +0 init_state3 ! +0 init_state4 ! +0 init_state5 ! +0 init_state6 ! +0 init_state7 ! +0 init_state8 ! + \ Initialize our boolean state variables 0 toggle_state1 ! 0 toggle_state2 ! Modified: head/sys/boot/forth/menu.rc ============================================================================== --- head/sys/boot/forth/menu.rc Sun Oct 14 03:59:17 2012 (r241522) +++ head/sys/boot/forth/menu.rc Sun Oct 14 06:52:49 2012 (r241523) @@ -48,6 +48,7 @@ set toggled_ansi[4]="ACPI Suppo set menu_caption[5]="Safe [M]ode... off" set toggled_text[5]="Safe [M]ode... On" +set menu_init[5]="init_safemode" set menu_command[5]="toggle_safemode" set menu_keycode[5]="109" set ansi_caption[5]="Safe Mode... Off" @@ -55,6 +56,7 @@ set toggled_ansi[5]="Safe Mode. set menu_caption[6]="[S]ingle User. off" set toggled_text[6]="[S]ingle User. On" +set menu_init[6]="init_singleuser" set menu_command[6]="toggle_singleuser" set menu_keycode[6]="115" set ansi_caption[6]="Single User. Off" @@ -62,6 +64,7 @@ set toggled_ansi[6]="Single Use set menu_caption[7]="[V]erbose..... off" set toggled_text[7]="[V]erbose..... On" +set menu_init[7]="init_verbose" set menu_command[7]="toggle_verbose" set menu_keycode[7]="118" set ansi_caption[7]="Verbose..... Off" From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 07:19:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE43FE3C; Sun, 14 Oct 2012 07:19:42 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0C98FC19; Sun, 14 Oct 2012 07:19:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E7JgYB012487; Sun, 14 Oct 2012 07:19:42 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E7JgHF012485; Sun, 14 Oct 2012 07:19:42 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210140719.q9E7JgHF012485@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Oct 2012 07:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241526 - head/sbin/mount_fusefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 07:19:43 -0000 Author: joel (doc committer) Date: Sun Oct 14 07:19:42 2012 New Revision: 241526 URL: http://svn.freebsd.org/changeset/base/241526 Log: Minor mdoc and language fixes. Modified: head/sbin/mount_fusefs/mount_fusefs.8 Modified: head/sbin/mount_fusefs/mount_fusefs.8 ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.8 Sun Oct 14 07:18:32 2012 (r241525) +++ head/sbin/mount_fusefs/mount_fusefs.8 Sun Oct 14 07:19:42 2012 (r241526) @@ -77,7 +77,7 @@ From that on mounting goes as in the sim .Pp The .Ar special -argument normally will be treated as the path of the special file to mount. +argument will normally be treated as the path of the special file to mount. .Pp However, if .Pa auto @@ -147,7 +147,7 @@ Refuse shared mounting of the daemon. Th to allow sharing, expicitly use .Fl o Cm noprivate .It Cm neglect_shares -Don't refuse unmounting if there are secondary mounts +Do not refuse unmounting if there are secondary mounts .It Cm push_symlinks_in Prefix absolute symlinks with the mountpoint .El @@ -170,7 +170,7 @@ By default cached buffers of a given fil This option disables this behaviour .El .Sh DAEMON MOUNTS -Usually users don't need to use +Usually users do not need to use .Nm directly, as the Fuse library enables Fuse daemons to invoke .Nm . @@ -274,7 +274,7 @@ Adjust behaviour to the needs of the FUS help output. .El .Pp -Although the following variables don't have any effect on +Although the following variables do not have any effect on .Nm itself, they affect the behaviour of fuse daemons: .Bl -tag -width ".Ev FUSE_DEV_NAME" @@ -286,7 +286,7 @@ is used. File desciptor of an opened Fuse device to use. Overrides .Ev FUSE_DEV_NAME . .It Ev FUSE_NO_MOUNT -If set, the library won't attempt to mount the filesystem, even +If set, the library will not attempt to mount the filesystem, even if a mountpoint argument is supplied. .El .Sh FILES @@ -317,7 +317,7 @@ Doing the same in two steps, using .Pp A script wrapper for fusexmp which ensures that .Nm -doesn't call any external utility and also provides a hacky +does not call any external utility and also provides a hacky (non race-free) automatic device selection: .Pp .Dl #!/bin/sh -e @@ -329,6 +329,10 @@ doesn't call any external utility and al .Xr mount 8 , .Xr umount 8 , .Xr sudo 8 +.Sh HISTORY +.Nm +appears as the part of the FreeBSD implementation of the Fuse userspace filesystem +framework (see http://fuse.sourceforge.net). This user interface is FreeBSD specific. .Sh CAVEATS Secondary mounts should be unmounted via their device name. If an attempt is made to be unmount them via their filesystem root path, the unmount request @@ -344,12 +348,8 @@ options, it will be invoked via .Xr system 3 , and the daemon's command line will also have an .Dq & -control operator appended, so that we don't have to wait for its termination. +control operator appended, so that we do not have to wait for its termination. You should use a simple command line when invoking the daemon via these options. -.Sh HISTORY -.Nm -appears as the part of the FreeBSD implementation of the Fuse userspace filesystem -framework (see http://fuse.sourceforge.net). This user interface is FreeBSD specific. .Sh BUGS .Ar special is treated as a multiplexer if and only if it is literally the same as From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 07:22:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BD14FDA; Sun, 14 Oct 2012 07:22:57 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF9E68FC12; Sun, 14 Oct 2012 07:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E7MucO013018; Sun, 14 Oct 2012 07:22:56 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E7MuNo013016; Sun, 14 Oct 2012 07:22:56 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210140722.q9E7MuNo013016@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Oct 2012 07:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241527 - head/sbin/mount_fusefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 07:22:57 -0000 Author: joel (doc committer) Date: Sun Oct 14 07:22:56 2012 New Revision: 241527 URL: http://svn.freebsd.org/changeset/base/241527 Log: Remove trailing whitespace. Modified: head/sbin/mount_fusefs/mount_fusefs.8 Modified: head/sbin/mount_fusefs/mount_fusefs.8 ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.8 Sun Oct 14 07:19:42 2012 (r241526) +++ head/sbin/mount_fusefs/mount_fusefs.8 Sun Oct 14 07:22:56 2012 (r241527) @@ -135,17 +135,17 @@ by prefixing them with .Bl -tag -width indent .It Cm default_permissions Enable traditional (file mode based) permission checking in kernel -.It Cm allow_other +.It Cm allow_other Do not apply .Sx STRICT ACCESS POLICY . Only root can use this option .It Cm max_read Ns = Ns Ar n Limit size of read requests to -.Ar n +.Ar n .It Cm private Refuse shared mounting of the daemon. This is the default behaviour, to allow sharing, expicitly use -.Fl o Cm noprivate +.Fl o Cm noprivate .It Cm neglect_shares Do not refuse unmounting if there are secondary mounts .It Cm push_symlinks_in @@ -158,7 +158,7 @@ Besides the above mount options, there i are supported by the Fuse library. One can list these by passing .Fl h to a Fuse daemon. Most of these options have effect only on the behaviour of -the daemon (that is, their scope is limited to userspace). However, +the daemon (that is, their scope is limited to userspace). However, there are some which do require in-kernel support. Currently the options supported by the kernel are: .Bl -tag -width indent @@ -240,7 +240,7 @@ and .Fl A ) , and command line parsing is done in a flexible way: mixing options and non-options is allowed, but processing them stops at the third non-option -argument (after the first two has been utilized as device and mountpoint). +argument (after the first two has been utilized as device and mountpoint). The rest of the command line specifies the daemon and its arguments. (Alternatively, the daemon, the special and the mount path can be specified using the respective options.) Note that @@ -316,8 +316,8 @@ Doing the same in two steps, using .Dl mount_fusefs /dev/fuse /mnt/fuse .Pp A script wrapper for fusexmp which ensures that -.Nm -does not call any external utility and also provides a hacky +.Nm +does not call any external utility and also provides a hacky (non race-free) automatic device selection: .Pp .Dl #!/bin/sh -e @@ -360,4 +360,4 @@ Other paths which are equivalent with .Pa /dev/fuse (eg., .Pa /../dev/fuse ) -are not. +are not. From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 08:50:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16292B0E; Sun, 14 Oct 2012 08:50:06 +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 F24508FC0C; Sun, 14 Oct 2012 08:50:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E8o580026779; Sun, 14 Oct 2012 08:50:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E8o523026777; Sun, 14 Oct 2012 08:50:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210140850.q9E8o523026777@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Oct 2012 08:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241536 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 08:50:06 -0000 Author: mav Date: Sun Oct 14 08:50:05 2012 New Revision: 241536 URL: http://svn.freebsd.org/changeset/base/241536 Log: Add explicit check for not set time inside cam_periph_freeze_after_event(). System time is set later on boot process then initial bus scan by CAM. Until that moment microtime() is equal to microuptime(), and if system boots quickly, the value can be close to zero. That causes settle time waiting even for buses that don't use reset during probe. On my test system this reduces boot time by 1 second if USB enabled, or by 4 seconds if USB disabled. CAM waited for ctl2cam0 bus "settle". Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sun Oct 14 07:55:14 2012 (r241535) +++ head/sys/cam/cam_periph.c Sun Oct 14 08:50:05 2012 (r241536) @@ -1250,6 +1250,9 @@ cam_periph_freeze_after_event(struct cam struct timeval delta; struct timeval duration_tv; + if (!timevalisset(event_time)) + return; + microtime(&delta); timevalsub(&delta, event_time); duration_tv.tv_sec = duration_ms / 1000; From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 09:31:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BE8F21B; Sun, 14 Oct 2012 09:31:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2427C8FC1A; Sun, 14 Oct 2012 09:31:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E9VBur032946; Sun, 14 Oct 2012 09:31:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E9VBnF032944; Sun, 14 Oct 2012 09:31:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210140931.q9E9VBnF032944@svn.freebsd.org> From: Andriy Gapon Date: Sun, 14 Oct 2012 09:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241537 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 09:31:12 -0000 Author: avg Date: Sun Oct 14 09:31:11 2012 New Revision: 241537 URL: http://svn.freebsd.org/changeset/base/241537 Log: acpi_wmi: move wmi_info_list into sc different instances of acpi_wmi couldn't properly share it and, in fact, there was no reason to do that MFC after: 10 days Modified: head/sys/dev/acpi_support/acpi_wmi.c Modified: head/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_wmi.c Sun Oct 14 08:50:05 2012 (r241536) +++ head/sys/dev/acpi_support/acpi_wmi.c Sun Oct 14 09:31:11 2012 (r241537) @@ -74,6 +74,7 @@ struct acpi_wmi_softc { struct sbuf wmistat_sbuf; /* sbuf for /dev/wmistat output */ pid_t wmistat_open_pid; /* pid operating on /dev/wmistat */ int wmistat_bufptr; /* /dev/wmistat ptr to buffer position */ + TAILQ_HEAD(wmi_info_list_head, wmi_info) wmi_info_list; }; /* @@ -105,8 +106,6 @@ struct wmi_info { void *event_handler_user_data; /* ev handler cookie */ }; -TAILQ_HEAD(wmi_info_list_head, wmi_info) - wmi_info_list = TAILQ_HEAD_INITIALIZER(wmi_info_list); ACPI_SERIAL_DECL(acpi_wmi, "ACPI-WMI Mapping"); @@ -144,13 +143,13 @@ static ACPI_STATUS acpi_wmi_ec_handler(U UINT64 *value, void *context, void *region_context); /* helpers */ -static ACPI_STATUS acpi_wmi_read_wdg_blocks(ACPI_HANDLE h); +static ACPI_STATUS acpi_wmi_read_wdg_blocks(struct acpi_wmi_softc *sc, ACPI_HANDLE h); static ACPI_STATUS acpi_wmi_toggle_we_event_generation(device_t dev, struct wmi_info *winfo, enum event_generation_state state); static int acpi_wmi_guid_string_to_guid(const UINT8 *guid_string, UINT8 *guid); -static struct wmi_info* acpi_wmi_lookup_wmi_info_by_guid_string( +static struct wmi_info* acpi_wmi_lookup_wmi_info_by_guid_string(struct acpi_wmi_softc *sc, const char *guid_string); static d_open_t acpi_wmi_wmistat_open; @@ -238,7 +237,7 @@ acpi_wmi_attach(device_t dev) ACPI_SERIAL_BEGIN(acpi_wmi); sc->wmi_dev = dev; sc->wmi_handle = acpi_get_handle(dev); - TAILQ_INIT(&wmi_info_list); + TAILQ_INIT(&sc->wmi_info_list); /* XXX Only works with one EC, but nearly all systems only have one. */ if ((sc->ec_dev = devclass_get_device(devclass_find("acpi_ec"), 0)) == NULL) @@ -254,7 +253,7 @@ acpi_wmi_attach(device_t dev) AcpiFormatException(status)); AcpiRemoveNotifyHandler(sc->wmi_handle, ACPI_DEVICE_NOTIFY, acpi_wmi_notify_handler); - } else if (ACPI_FAILURE((status = acpi_wmi_read_wdg_blocks( + } else if (ACPI_FAILURE((status = acpi_wmi_read_wdg_blocks(sc, sc->wmi_handle)))) { device_printf(sc->wmi_dev, "couldn't parse _WDG - %s\n", AcpiFormatException(status)); @@ -305,11 +304,11 @@ acpi_wmi_detach(device_t dev) acpi_wmi_notify_handler); AcpiRemoveAddressSpaceHandler(sc->wmi_handle, ACPI_ADR_SPACE_EC, acpi_wmi_ec_handler); - TAILQ_FOREACH_SAFE(winfo, &wmi_info_list, wmi_list, tmp) { + TAILQ_FOREACH_SAFE(winfo, &sc->wmi_info_list, wmi_list, tmp) { if (winfo->event_handler) acpi_wmi_toggle_we_event_generation(dev, winfo, EVENT_GENERATION_OFF); - TAILQ_REMOVE(&wmi_info_list, winfo, wmi_list); + TAILQ_REMOVE(&sc->wmi_info_list, winfo, wmi_list); free(winfo, M_ACPIWMI); } if (sc->wmistat_bufptr != -1) { @@ -334,12 +333,14 @@ acpi_wmi_detach(device_t dev) static int acpi_wmi_provides_guid_string_method(device_t dev, const char *guid_string) { + struct acpi_wmi_softc *sc; struct wmi_info *winfo; int ret; + sc = device_get_softc(dev); ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); ACPI_SERIAL_BEGIN(acpi_wmi); - winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string); + winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string); ret = (winfo == NULL)?0:winfo->ginfo.max_instance+1; ACPI_SERIAL_END(acpi_wmi); @@ -365,7 +366,7 @@ acpi_wmi_evaluate_call_method(device_t d sc = device_get_softc(dev); ACPI_SERIAL_BEGIN(acpi_wmi); - if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string)) + if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string)) == NULL) status = AE_NOT_FOUND; else if (!(winfo->ginfo.flags & ACPI_WMI_REGFLAG_METHOD)) @@ -407,6 +408,7 @@ static ACPI_STATUS acpi_wmi_install_event_handler_method(device_t dev, const char *guid_string, ACPI_NOTIFY_HANDLER event_handler, void *data) { + struct acpi_wmi_softc *sc = device_get_softc(dev); struct wmi_info *winfo; ACPI_STATUS status; @@ -416,7 +418,7 @@ acpi_wmi_install_event_handler_method(de ACPI_SERIAL_BEGIN(acpi_wmi); if (guid_string == NULL || event_handler == NULL) status = AE_BAD_PARAMETER; - else if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string)) + else if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string)) == NULL) status = AE_NOT_EXIST; else if (winfo->event_handler != NULL || @@ -438,6 +440,7 @@ acpi_wmi_install_event_handler_method(de static ACPI_STATUS acpi_wmi_remove_event_handler_method(device_t dev, const char *guid_string) { + struct acpi_wmi_softc *sc = device_get_softc(dev); struct wmi_info *winfo; ACPI_STATUS status; @@ -446,7 +449,7 @@ acpi_wmi_remove_event_handler_method(dev status = AE_OK; ACPI_SERIAL_BEGIN(acpi_wmi); if (guid_string && - (winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string)) + (winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string)) != NULL && winfo->event_handler) { status = acpi_wmi_toggle_we_event_generation(dev, winfo, EVENT_GENERATION_OFF); @@ -481,7 +484,7 @@ acpi_wmi_get_event_data_method(device_t params[0].Integer.Value = event_id; input.Pointer = params; input.Count = 1; - TAILQ_FOREACH(winfo, &wmi_info_list, wmi_list) { + TAILQ_FOREACH(winfo, &sc->wmi_info_list, wmi_list) { if ((winfo->ginfo.flags & ACPI_WMI_REGFLAG_EVENT) && ((UINT8) winfo->ginfo.oid[0] == event_id)) { status = AcpiEvaluateObject(sc->wmi_handle, "_WED", @@ -525,7 +528,7 @@ acpi_wmi_get_block_method(device_t dev, ACPI_SERIAL_BEGIN(acpi_wmi); if (guid_string == NULL || out == NULL) status = AE_BAD_PARAMETER; - else if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string)) + else if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string)) == NULL) status = AE_ERROR; else if (instance > winfo->ginfo.max_instance) @@ -589,7 +592,7 @@ acpi_wmi_set_block_method(device_t dev, ACPI_SERIAL_BEGIN(acpi_wmi); if (guid_string == NULL || in == NULL) status = AE_BAD_DATA; - else if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string)) + else if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string)) == NULL) status = AE_ERROR; else if (instance > winfo->ginfo.max_instance) @@ -623,6 +626,7 @@ acpi_wmi_set_block_method(device_t dev, static void acpi_wmi_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) { + struct acpi_wmi_softc *sc = context; ACPI_NOTIFY_HANDLER handler; void *handler_data; struct wmi_info *winfo; @@ -632,7 +636,7 @@ acpi_wmi_notify_handler(ACPI_HANDLE h, U handler = NULL; handler_data = NULL; ACPI_SERIAL_BEGIN(acpi_wmi); - TAILQ_FOREACH(winfo, &wmi_info_list, wmi_list) { + TAILQ_FOREACH(winfo, &sc->wmi_info_list, wmi_list) { if ((winfo->ginfo.flags & ACPI_WMI_REGFLAG_EVENT) && ((UINT8) winfo->ginfo.oid[0] == notify)) { if (winfo->event_handler) { @@ -705,7 +709,7 @@ acpi_wmi_ec_handler(UINT32 function, ACP * into wmi_info_list. */ static ACPI_STATUS -acpi_wmi_read_wdg_blocks(ACPI_HANDLE h) +acpi_wmi_read_wdg_blocks(struct acpi_wmi_softc *sc, ACPI_HANDLE h) { ACPI_BUFFER out = {ACPI_ALLOCATE_BUFFER, NULL}; struct guid_info *ginfo; @@ -736,7 +740,7 @@ acpi_wmi_read_wdg_blocks(ACPI_HANDLE h) return (AE_NO_MEMORY); } winfo->ginfo = ginfo[i]; - TAILQ_INSERT_TAIL(&wmi_info_list, winfo, wmi_list); + TAILQ_INSERT_TAIL(&sc->wmi_info_list, winfo, wmi_list); } AcpiOsFree(out.Pointer); free(ginfo, M_ACPIWMI); @@ -846,7 +850,7 @@ acpi_wmi_guid_string_to_guid(const UINT8 * Return NULL if the GUID is unknown in the _WDG */ static struct wmi_info* -acpi_wmi_lookup_wmi_info_by_guid_string(const char *guid_string) +acpi_wmi_lookup_wmi_info_by_guid_string(struct acpi_wmi_softc *sc, const char *guid_string) { char guid[16]; struct wmi_info *winfo; @@ -856,7 +860,7 @@ acpi_wmi_lookup_wmi_info_by_guid_string( ACPI_SERIAL_ASSERT(acpi_wmi); if (!acpi_wmi_guid_string_to_guid(guid_string, guid)) { - TAILQ_FOREACH(winfo, &wmi_info_list, wmi_list) { + TAILQ_FOREACH(winfo, &sc->wmi_info_list, wmi_list) { if (!memcmp(winfo->ginfo.guid, guid, 16)) { return (winfo); } @@ -955,7 +959,7 @@ acpi_wmi_wmistat_read(struct cdev *dev, sbuf_printf(&sc->wmistat_sbuf, "GUID " " INST EXPE METH STR " "EVENT OID\n"); - TAILQ_FOREACH(winfo, &wmi_info_list, wmi_list) { + TAILQ_FOREACH(winfo, &sc->wmi_info_list, wmi_list) { guid = (UINT8*)winfo->ginfo.guid; sbuf_printf(&sc->wmistat_sbuf, "{%02X%02X%02X%02X-%02X%02X-" From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 09:32:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77E5B42D; Sun, 14 Oct 2012 09:32:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ECC48FC12; Sun, 14 Oct 2012 09:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9E9Wdqk033189; Sun, 14 Oct 2012 09:32:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9E9WdIK033187; Sun, 14 Oct 2012 09:32:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210140932.q9E9WdIK033187@svn.freebsd.org> From: Andriy Gapon Date: Sun, 14 Oct 2012 09:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241538 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 09:32:39 -0000 Author: avg Date: Sun Oct 14 09:32:38 2012 New Revision: 241538 URL: http://svn.freebsd.org/changeset/base/241538 Log: acpi_thermal: when _ACx is tripped, all _ALi i>= x should be on ... and not just _ALx as it is now. MFC after: 20 days Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Sun Oct 14 09:31:11 2012 (r241537) +++ head/sys/dev/acpica/acpi_thermal.c Sun Oct 14 09:32:38 2012 (r241538) @@ -121,6 +121,8 @@ struct acpi_tz_softc { int tz_cooling_saved_freq; }; +#define TZ_ACTIVE_LEVEL(act) ((act) >= 0 ? (act) : TZ_NUMLEVELS) + #define CPUFREQ_MAX_LEVELS 64 /* XXX cpufreq should export this */ static int acpi_tz_probe(device_t dev); @@ -565,18 +567,21 @@ acpi_tz_monitor(void *Context) } if (newactive != sc->tz_active) { - /* Turn off the cooling devices that are on, if any are */ - if (sc->tz_active != TZ_ACTIVE_NONE) + /* Turn off unneeded cooling devices that are on, if any are */ + for (i = TZ_ACTIVE_LEVEL(sc->tz_active); + i < TZ_ACTIVE_LEVEL(newactive); i++) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[sc->tz_active].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_off, sc); - + } /* Turn on cooling devices that are required, if any are */ - if (newactive != TZ_ACTIVE_NONE) { + for (i = TZ_ACTIVE_LEVEL(sc->tz_active) - 1; + i >= TZ_ACTIVE_LEVEL(newactive); i--) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[newactive].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_on, sc); } + ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), "switched from %s to %s: %d.%dC\n", acpi_tz_aclevel_string(sc->tz_active), From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 10:12:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C9C6622; Sun, 14 Oct 2012 10:12:33 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34AC98FC17; Sun, 14 Oct 2012 10:12:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EACXmj039194; Sun, 14 Oct 2012 10:12:33 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EACWRU039192; Sun, 14 Oct 2012 10:12:33 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210141012.q9EACWRU039192@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Oct 2012 10:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241539 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 10:12:33 -0000 Author: joel (doc committer) Date: Sun Oct 14 10:12:32 2012 New Revision: 241539 URL: http://svn.freebsd.org/changeset/base/241539 Log: Remove cvs/cvsup reference. Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.8 Sun Oct 14 09:32:38 2012 (r241538) +++ head/usr.sbin/portsnap/portsnap/portsnap.8 Sun Oct 14 10:12:32 2012 (r241539) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2012 +.Dd October 14, 2012 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -55,10 +55,6 @@ In a normal update operation, .Nm will routinely restore modified files to their unmodified state and delete unrecognized local files. -This behavior is different to -.Xr cvs 1 -and -.Xr cvsup 1 . .Sh OPTIONS The following options are supported: .Bl -tag -width "-f conffile" From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 10:13:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8FCA787E; Sun, 14 Oct 2012 10:13:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78DFF8FC1A; Sun, 14 Oct 2012 10:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EADpZE039404; Sun, 14 Oct 2012 10:13:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EADp7c039401; Sun, 14 Oct 2012 10:13:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210141013.q9EADp7c039401@svn.freebsd.org> From: Andriy Gapon Date: Sun, 14 Oct 2012 10:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241540 - in head/sys: amd64/pci i386/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 10:13:51 -0000 Author: avg Date: Sun Oct 14 10:13:50 2012 New Revision: 241540 URL: http://svn.freebsd.org/changeset/base/241540 Log: pciereg_cfg*: use assembly to access the mem-mapped cfg space AMD BKDG for CPU families 10h and later requires that the memory mapped config is always read into or written from al/ax/eax register. Discussed with: kib, alc Reviewed by: kib (earlier version) MFC after: 25 days Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- head/sys/amd64/pci/pci_cfgreg.c Sun Oct 14 10:12:32 2012 (r241539) +++ head/sys/amd64/pci/pci_cfgreg.c Sun Oct 14 10:13:50 2012 (r241540) @@ -295,6 +295,13 @@ pcie_cfgregopen(uint64_t base, uint8_t m return (1); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ #define PCIE_VADDR(base, reg, bus, slot, func) \ ((base) + \ ((((bus) & 0xff) << 20) | \ @@ -317,13 +324,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -344,13 +354,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } } Modified: head/sys/i386/pci/pci_cfgreg.c ============================================================================== --- head/sys/i386/pci/pci_cfgreg.c Sun Oct 14 10:12:32 2012 (r241539) +++ head/sys/i386/pci/pci_cfgreg.c Sun Oct 14 10:13:50 2012 (r241540) @@ -652,6 +652,14 @@ pciereg_findelem(vm_paddr_t papage) return (elem); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ + static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) @@ -673,13 +681,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -707,13 +718,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 10:26:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8F9FE1D; Sun, 14 Oct 2012 10:26:29 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D08AD8FC18; Sun, 14 Oct 2012 10:26:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EAQTc4041180; Sun, 14 Oct 2012 10:26:29 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EAQTZb041178; Sun, 14 Oct 2012 10:26:29 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210141026.q9EAQTZb041178@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Oct 2012 10:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241541 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 10:26:30 -0000 Author: joel (doc committer) Date: Sun Oct 14 10:26:29 2012 New Revision: 241541 URL: http://svn.freebsd.org/changeset/base/241541 Log: Minor mdoc improvements. Also remove unnecessary csup reference. Modified: head/share/man/man5/portindex.5 Modified: head/share/man/man5/portindex.5 ============================================================================== --- head/share/man/man5/portindex.5 Sun Oct 14 10:13:50 2012 (r241540) +++ head/share/man/man5/portindex.5 Sun Oct 14 10:26:29 2012 (r241541) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd October 14, 2012 .Dt PORTINDEX 5 .Os .Sh NAME @@ -48,7 +48,7 @@ branch, i.e.: .Pa INDEX-7 , or .Pa INDEX-8 . -.Bl -tag -compact -width indent +.Bl -tag -width XXXXXXXXXX .It Cm \&name The name of the package. .It Cm \&path @@ -77,7 +77,7 @@ Ports that may be required to patch this Ports that may be required to fetch this port. .El .Sh FILES -.Bl -tag -width /usr/ports/INDEX-8 +.Bl -tag -width /usr/ports/INDEX-8XX .It Pa /usr/ports/INDEX- Ns Ar N where .Ar N @@ -91,7 +91,6 @@ vim-6.3.15|/usr/ports/editors/vim|/usr/l .Ed .Sh SEE ALSO .Xr build 7 , -.Xr csup 1 , .Xr ports 7 .Sh AUTHORS .An -nosplit From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 13:41:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08B99FD7; Sun, 14 Oct 2012 13:41:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5C338FC16; Sun, 14 Oct 2012 13:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EDfgPa074166; Sun, 14 Oct 2012 13:41:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EDfgKt074164; Sun, 14 Oct 2012 13:41:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210141341.q9EDfgKt074164@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Oct 2012 13:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241542 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 13:41:43 -0000 Author: eadler Date: Sun Oct 14 13:41:42 2012 New Revision: 241542 URL: http://svn.freebsd.org/changeset/base/241542 Log: Don't document the PORTSSUPFILE variable. Even though this still works, try to discourage users from depending on it. Approved by: joel MFC after: 3 days Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sun Oct 14 10:26:29 2012 (r241541) +++ head/share/man/man5/make.conf.5 Sun Oct 14 13:41:42 2012 (r241542) @@ -259,14 +259,6 @@ Set this to not update the ports tree du .Pq Vt bool Set this to not update the www tree during .Dq Li "make update" . -.It Va PORTSSUPFILE -.Pq Vt str -The ports -.Ar supfile -to use when doing a -.Dq Li "make update" . -For example, -.Pa /usr/share/examples/cvsup/ports-supfile . .It Va SUP .Pq Vt str The location of the From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 13:45:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCC36214; Sun, 14 Oct 2012 13:45:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CD758FC08; Sun, 14 Oct 2012 13:45:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EDjE61074757; Sun, 14 Oct 2012 13:45:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EDjEMC074755; Sun, 14 Oct 2012 13:45:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210141345.q9EDjEMC074755@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Oct 2012 13:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241543 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 13:45:14 -0000 Author: eadler Date: Sun Oct 14 13:45:13 2012 New Revision: 241543 URL: http://svn.freebsd.org/changeset/base/241543 Log: Bump .Dd Approved by: joel Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sun Oct 14 13:41:42 2012 (r241542) +++ head/share/man/man5/make.conf.5 Sun Oct 14 13:45:13 2012 (r241543) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 9, 2012 +.Dd October 14, 2012 .Dt MAKE.CONF 5 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 13:59:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8670854; Sun, 14 Oct 2012 13:59:17 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0DE58FC1A; Sun, 14 Oct 2012 13:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EDxHtA076853; Sun, 14 Oct 2012 13:59:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EDxHTi076851; Sun, 14 Oct 2012 13:59:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210141359.q9EDxHTi076851@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Oct 2012 13:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241544 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 13:59:18 -0000 Author: joel (doc committer) Date: Sun Oct 14 13:59:17 2012 New Revision: 241544 URL: http://svn.freebsd.org/changeset/base/241544 Log: mdoc: don't nest displays. The markup here isn't adding anything anyway. Fixes a mandoc lint warning. Discussed with: brueffer, Jason McIntyre Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Oct 14 13:45:13 2012 (r241543) +++ head/bin/sh/sh.1 Sun Oct 14 13:59:17 2012 (r241544) @@ -649,8 +649,8 @@ The following redirection is often calle .Dq here-document . .Bd -unfilled -offset indent .Oo Ar n Oc Ns Li << Ar delimiter -.D1 Ar here-doc-text -.D1 ... +.Ar here-doc-text +.Ar ... .Ar delimiter .Ed .Pp From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 14:45:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 693BD867; Sun, 14 Oct 2012 14:45:55 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BE68FC12; Sun, 14 Oct 2012 14:45:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EEjtPc084231; Sun, 14 Oct 2012 14:45:55 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EEjtlf084229; Sun, 14 Oct 2012 14:45:55 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210141445.q9EEjtlf084229@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Oct 2012 14:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241545 - head/lib/msun/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 14:45:55 -0000 Author: joel (doc committer) Date: Sun Oct 14 14:45:54 2012 New Revision: 241545 URL: http://svn.freebsd.org/changeset/base/241545 Log: mdoc: avoid nested displays. Modified: head/lib/msun/man/ieee.3 Modified: head/lib/msun/man/ieee.3 ============================================================================== --- head/lib/msun/man/ieee.3 Sun Oct 14 13:59:17 2012 (r241544) +++ head/lib/msun/man/ieee.3 Sun Oct 14 14:45:54 2012 (r241545) @@ -156,59 +156,60 @@ Wordsize: 32 bits. .Pp Precision: 24 significant bits, roughly like 7 significant decimals. -.Bd -ragged -offset indent -compact +.Pp If x and x' are consecutive positive single-precision numbers (they differ by 1 .Em ulp ) , then -.Bd -ragged -compact +.Bl -column "XXX" -compact 5.9e\-08 < 0.5**24 < (x'\-x)/x \(<= 0.5**23 < 1.2e\-07. -.Ed -.Ed +.El .Pp .Bl -column "XXX" -compact Range: Overflow threshold = 2.0**128 = 3.4e38 Underflow threshold = 0.5**126 = 1.2e\-38 .El -.Bd -ragged -offset indent -compact +.Pp Underflowed results round to the nearest -integer multiple of 0.5**149 = 1.4e\-45. -.Ed +integer multiple of +.Bl -column "XXX" -compact +0.5**149 = 1.4e\-45. +.El .Ed .Pp Double-precision: .Bd -ragged -offset indent -compact Type name: .Vt double -.Bd -ragged -offset indent -compact -On some architectures, +.Po On some architectures, .Vt long double is the same as -.Vt double . -.Ed +.Vt double +.Pc .Pp Wordsize: 64 bits. .Pp Precision: 53 significant bits, roughly like 16 significant decimals. -.Bd -ragged -offset indent -compact +.Pp If x and x' are consecutive positive double-precision numbers (they differ by 1 .Em ulp ) , then -.Bd -ragged -compact +.Bl -column "XXX" -compact 1.1e\-16 < 0.5**53 < (x'\-x)/x \(<= 0.5**52 < 2.3e\-16. -.Ed -.Ed +.El .Pp .Bl -column "XXX" -compact Range: Overflow threshold = 2.0**1024 = 1.8e308 Underflow threshold = 0.5**1022 = 2.2e\-308 .El -.Bd -ragged -offset indent -compact +.Pp Underflowed results round to the nearest -integer multiple of 0.5**1074 = 4.9e\-324. -.Ed +integer multiple of +.Bl -column "XXX" -compact +0.5**1074 = 4.9e\-324. +.El .Ed .Pp Extended-precision: @@ -221,24 +222,25 @@ Wordsize: 96 bits. .Pp Precision: 64 significant bits, roughly like 19 significant decimals. -.Bd -ragged -offset indent -compact +.Pp If x and x' are consecutive positive extended-precision numbers (they differ by 1 .Em ulp ) , then -.Bd -ragged -compact +.Bl -column "XXX" -compact 1.0e\-19 < 0.5**63 < (x'\-x)/x \(<= 0.5**62 < 2.2e\-19. -.Ed -.Ed +.El .Pp .Bl -column "XXX" -compact Range: Overflow threshold = 2.0**16384 = 1.2e4932 Underflow threshold = 0.5**16382 = 3.4e\-4932 .El -.Bd -ragged -offset indent -compact +.Pp Underflowed results round to the nearest -integer multiple of 0.5**16445 = 5.7e\-4953. -.Ed +integer multiple of +.Bl -column "XXX" -compact +0.5**16445 = 5.7e\-4953. +.El .Ed .Pp Quad-extended-precision: @@ -251,24 +253,25 @@ Wordsize: 128 bits. .Pp Precision: 113 significant bits, roughly like 34 significant decimals. -.Bd -ragged -offset indent -compact +.Pp If x and x' are consecutive positive quad-extended-precision numbers (they differ by 1 .Em ulp ) , then -.Bd -ragged -compact +.Bl -column "XXX" -compact 9.6e\-35 < 0.5**113 < (x'\-x)/x \(<= 0.5**112 < 2.0e\-34. -.Ed -.Ed +.El .Pp .Bl -column "XXX" -compact Range: Overflow threshold = 2.0**16384 = 1.2e4932 Underflow threshold = 0.5**16382 = 3.4e\-4932 .El -.Bd -ragged -offset indent -compact +.Pp Underflowed results round to the nearest -integer multiple of 0.5**16494 = 6.5e\-4966. -.Ed +integer multiple of +.Bl -column "XXX" -compact +0.5**16494 = 6.5e\-4966. +.El .Ed .Ss Additional Information Regarding Exceptions For each kind of floating-point exception, IEEE 754 From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 15:03:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96790D97; Sun, 14 Oct 2012 15:03:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F08E8FC0C; Sun, 14 Oct 2012 15:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EF37oF087020; Sun, 14 Oct 2012 15:03:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EF37rE087018; Sun, 14 Oct 2012 15:03:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210141503.q9EF37rE087018@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 14 Oct 2012 15:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241546 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 15:03:07 -0000 Author: glebius Date: Sun Oct 14 15:03:06 2012 New Revision: 241546 URL: http://svn.freebsd.org/changeset/base/241546 Log: Fix defines in r241245. We actually don't define FreeBSD. Reported & tested by: Oleg Ginzburg Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Sun Oct 14 14:45:54 2012 (r241545) +++ head/sys/contrib/ipfilter/netinet/fil.c Sun Oct 14 15:03:06 2012 (r241546) @@ -2513,7 +2513,7 @@ int out; } else #endif { -#if ((defined(OpenBSD) && (OpenBSD >= 200311)) || (defined(FreeBSD) && (__FreeBSD_version >= 1000019))) && defined(_KERNEL) +#if ((defined(OpenBSD) && (OpenBSD >= 200311)) || (__FreeBSD_version >= 1000019)) && defined(_KERNEL) ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); #endif @@ -2777,7 +2777,7 @@ finished: RWLOCK_EXIT(&ipf_global); #ifdef _KERNEL -# if (defined(OpenBSD) && (OpenBSD >= 200311)) || (defined(FreeBSD) && (__FreeBSD_version >= 1000019)) +# if (defined(OpenBSD) && (OpenBSD >= 200311)) || (__FreeBSD_version >= 1000019) if (FR_ISPASS(pass) && (v == 4)) { ip = fin->fin_ip; ip->ip_len = ntohs(ip->ip_len); From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 15:08:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B261F69; Sun, 14 Oct 2012 15:08:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6384E8FC14; Sun, 14 Oct 2012 15:08:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EF88Cx087805; Sun, 14 Oct 2012 15:08:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EF88iO087803; Sun, 14 Oct 2012 15:08:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210141508.q9EF88iO087803@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 14 Oct 2012 15:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241547 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 15:08:08 -0000 Author: glebius Date: Sun Oct 14 15:08:07 2012 New Revision: 241547 URL: http://svn.freebsd.org/changeset/base/241547 Log: Fix a miss from r241344: in ip_mloopback() we need to go to net byte order prior to calling in_delayed_cksum(). Reported by: Olivier Cochard-Labbe Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun Oct 14 15:03:06 2012 (r241546) +++ head/sys/netinet/ip_output.c Sun Oct 14 15:08:07 2012 (r241547) @@ -1313,6 +1313,9 @@ ip_mloopback(struct ifnet *ifp, struct m if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen)) copym = m_pullup(copym, hlen); if (copym != NULL) { + ip = mtod(copym, struct ip *); + ip->ip_len = htons(ip->ip_len); + ip->ip_off = htons(ip->ip_off); /* If needed, compute the checksum and mark it as valid. */ if (copym->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { in_delayed_cksum(copym); @@ -1325,9 +1328,6 @@ ip_mloopback(struct ifnet *ifp, struct m * We don't bother to fragment if the IP length is greater * than the interface's MTU. Can this possibly matter? */ - ip = mtod(copym, struct ip *); - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); ip->ip_sum = 0; ip->ip_sum = in_cksum(copym, hlen); #if 1 /* XXX */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:07:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD49D445; Sun, 14 Oct 2012 17:07:34 +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 96B718FC0C; Sun, 14 Oct 2012 17:07:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EH7Y1c005849; Sun, 14 Oct 2012 17:07:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EH7YgL005846; Sun, 14 Oct 2012 17:07:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210141707.q9EH7YgL005846@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Oct 2012 17:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241548 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:07:34 -0000 Author: kib Date: Sun Oct 14 17:07:34 2012 New Revision: 241548 URL: http://svn.freebsd.org/changeset/base/241548 Log: Replace the XXX comment with the proper description. MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun Oct 14 15:08:07 2012 (r241547) +++ head/sys/fs/nullfs/null_vnops.c Sun Oct 14 17:07:34 2012 (r241548) @@ -665,7 +665,9 @@ null_unlock(struct vop_unlock_args *ap) } /* - * XXXKIB + * Do not allow the VOP_INACTIVE to be bypassed to the lower layer, + * since the reference count on the lower vnode is not related with + * our. */ static int null_inactive(struct vop_inactive_args *ap __unused) From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:08:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EEB55B3; Sun, 14 Oct 2012 17:08: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 07BB98FC12; Sun, 14 Oct 2012 17:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EH8k3k006049; Sun, 14 Oct 2012 17:08:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EH8kjX006047; Sun, 14 Oct 2012 17:08:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210141708.q9EH8kjX006047@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Oct 2012 17:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241549 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:08:47 -0000 Author: kib Date: Sun Oct 14 17:08:46 2012 New Revision: 241549 URL: http://svn.freebsd.org/changeset/base/241549 Log: Print the %rip value for uprintf_signal. MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Oct 14 17:07:34 2012 (r241548) +++ head/sys/amd64/amd64/trap.c Sun Oct 14 17:08:46 2012 (r241549) @@ -617,8 +617,10 @@ trap(struct trapframe *frame) ksi.ksi_addr = (void *)addr; if (uprintf_signal) { uprintf("pid %d comm %s: signal %d err %lx code %d type %d " - "addr 0x%lx <%02x %02x %02x %02x %02x %02x %02x %02x>\n", + "addr 0x%lx rip 0x%lx " + "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, + frame->tf_rip, fubyte((void *)(frame->tf_rip + 0)), fubyte((void *)(frame->tf_rip + 1)), fubyte((void *)(frame->tf_rip + 2)), From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:09:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DCBA7A2; Sun, 14 Oct 2012 17:09:51 +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 06C1F8FC0C; Sun, 14 Oct 2012 17:09:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EH9oGO006241; Sun, 14 Oct 2012 17:09:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EH9oWD006238; Sun, 14 Oct 2012 17:09:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210141709.q9EH9oWD006238@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Oct 2012 17:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241550 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:09:51 -0000 Author: kib Date: Sun Oct 14 17:09:50 2012 New Revision: 241550 URL: http://svn.freebsd.org/changeset/base/241550 Log: MFamd64: add machdep.uprintf_signal. MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun Oct 14 17:08:46 2012 (r241549) +++ head/sys/i386/i386/trap.c Sun Oct 14 17:09:50 2012 (r241550) @@ -195,6 +195,10 @@ TUNABLE_INT("machdep.panic_on_nmi", &pan static int prot_fault_translation = 0; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); +static int uprintf_signal; +SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, + &uprintf_signal, 0, + "Print debugging information on trap signal to ctty"); /* * Exception, fault, and trap interface to the FreeBSD kernel. @@ -761,6 +765,21 @@ trap(struct trapframe *frame) ksi.ksi_code = ucode; ksi.ksi_addr = (void *)addr; ksi.ksi_trapno = type; + if (uprintf_signal) { + uprintf("pid %d comm %s: signal %d err %x code %d type %d " + "addr 0x%x eip 0x%08x " + "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", + p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, + frame->tf_eip, + fubyte((void *)(frame->tf_eip + 0)), + fubyte((void *)(frame->tf_eip + 1)), + fubyte((void *)(frame->tf_eip + 2)), + fubyte((void *)(frame->tf_eip + 3)), + fubyte((void *)(frame->tf_eip + 4)), + fubyte((void *)(frame->tf_eip + 5)), + fubyte((void *)(frame->tf_eip + 6)), + fubyte((void *)(frame->tf_eip + 7))); + } trapsignal(td, &ksi); #ifdef DEBUG From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:26:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15ACECA4; Sun, 14 Oct 2012 17:26:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F27A98FC0A; Sun, 14 Oct 2012 17:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EHQW6S008662; Sun, 14 Oct 2012 17:26:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EHQWB1008659; Sun, 14 Oct 2012 17:26:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210141726.q9EHQWB1008659@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Oct 2012 17:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241551 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:26:33 -0000 Author: eadler Date: Sun Oct 14 17:26:32 2012 New Revision: 241551 URL: http://svn.freebsd.org/changeset/base/241551 Log: Add support for the Buffalo RUF2 flash drive. PR: usb/166848 Submitted by: Andrew Gregory Reviewed by: hselasky Approved by: cperciva (implicit) MFC after: 3 days Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 14 17:09:50 2012 (r241550) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 14 17:26:32 2012 (r241551) @@ -177,6 +177,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(EMTEC, RUF2PS, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(EPSON, STYLUS_875DC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(EPSON, STYLUS_895, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 14 17:09:50 2012 (r241550) +++ head/sys/dev/usb/usbdevs Sun Oct 14 17:26:32 2012 (r241551) @@ -1588,6 +1588,9 @@ product ELV USBI2C 0xe00f USB-I2C inter /* EMS products */ product EMS DUAL_SHOOTER 0x0003 PSX gun controller converter +/* Emtec products */ +product EMTEC RUF2PS 0x2240 Flash Drive + /* Encore products */ product ENCORE RT3070_1 0x1480 RT3070 product ENCORE RT3070_2 0x14a1 RT3070 From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:26:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B854DF5; Sun, 14 Oct 2012 17:26:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64F548FC08; Sun, 14 Oct 2012 17:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EHQfMG008717; Sun, 14 Oct 2012 17:26:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EHQfVM008714; Sun, 14 Oct 2012 17:26:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210141726.q9EHQfVM008714@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Oct 2012 17:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241552 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:26:41 -0000 Author: eadler Date: Sun Oct 14 17:26:40 2012 New Revision: 241552 URL: http://svn.freebsd.org/changeset/base/241552 Log: Add support for Feiya Elango USB MicroSD PR: usb/153599 Submitted by: CyberLeo Approved by: cperciva (implicit) MFC after: 3 days Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 14 17:26:32 2012 (r241551) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 14 17:26:40 2012 (r241552) @@ -184,6 +184,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(FEIYA, 5IN1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(FEIYA, ELANGO, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(FREECOM, DVD, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(FUJIPHOTO, MASS0100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_NO_SYNC_CACHE), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 14 17:26:32 2012 (r241551) +++ head/sys/dev/usb/usbdevs Sun Oct 14 17:26:40 2012 (r241552) @@ -1673,6 +1673,7 @@ product FALCOM SAMBA 0x0005 FTDI compat /* FEIYA products */ product FEIYA DUMMY 0x0000 Dummy product product FEIYA 5IN1 0x1132 5-in-1 Card Reader +product FEIYA ELANGO 0x6200 MicroSDHC Card Reader product FEIYA AC110 0x6300 AC-110 Card Reader /* Festo */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:26:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44CEEE12; Sun, 14 Oct 2012 17:26:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB598FC0C; Sun, 14 Oct 2012 17:26:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EHQk7U008764; Sun, 14 Oct 2012 17:26:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EHQj1W008761; Sun, 14 Oct 2012 17:26:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210141726.q9EHQj1W008761@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Oct 2012 17:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241553 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:26:46 -0000 Author: eadler Date: Sun Oct 14 17:26:45 2012 New Revision: 241553 URL: http://svn.freebsd.org/changeset/base/241553 Log: Add support for the extrememory Snippy PR: usb/159611 Submitted by: Fabian Keil Approved by: cperciva (implicit) MFC after: 3 days Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 14 17:26:40 2012 (r241552) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 14 17:26:45 2012 (r241553) @@ -392,6 +392,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(SUPERTOP, IDE, 0x0000, 0xffff, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(SUPERTOP, FLASHDRIVE, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(TAUGA, CAMERAMATE, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(TEAC, FD05PUB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_UFI), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 14 17:26:40 2012 (r241552) +++ head/sys/dev/usb/usbdevs Sun Oct 14 17:26:45 2012 (r241553) @@ -3970,6 +3970,7 @@ product SUNPLUS USBMOUSE 0x0007 USB Opti /* Super Top products */ product SUPERTOP IDE 0x6600 USB-IDE +product SUPERTOP FLASHDRIVE 0x121c extrememory Snippy /* Syntech products */ product SYNTECH CPT8001C 0x0001 CPT-8001C Barcode scanner From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 18:13:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0E1AE78; Sun, 14 Oct 2012 18:13:33 +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 C8C798FC08; Sun, 14 Oct 2012 18:13:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EIDXYC015810; Sun, 14 Oct 2012 18:13:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EIDXjx015808; Sun, 14 Oct 2012 18:13:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210141813.q9EIDXjx015808@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Oct 2012 18:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241554 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 18:13:34 -0000 Author: kib Date: Sun Oct 14 18:13:33 2012 New Revision: 241554 URL: http://svn.freebsd.org/changeset/base/241554 Log: Grammar fixes. Submitted by: bf MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun Oct 14 17:26:45 2012 (r241553) +++ head/sys/fs/nullfs/null_vnops.c Sun Oct 14 18:13:33 2012 (r241554) @@ -665,9 +665,9 @@ null_unlock(struct vop_unlock_args *ap) } /* - * Do not allow the VOP_INACTIVE to be bypassed to the lower layer, - * since the reference count on the lower vnode is not related with - * our. + * Do not allow the VOP_INACTIVE to be passed to the lower layer, + * since the reference count on the lower vnode is not related to + * ours. */ static int null_inactive(struct vop_inactive_args *ap __unused) From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 19:15:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CFD6E134; Sun, 14 Oct 2012 19:15:54 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B76698FC0C; Sun, 14 Oct 2012 19:15:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EJFsnW025206; Sun, 14 Oct 2012 19:15:54 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EJFsTv025204; Sun, 14 Oct 2012 19:15:54 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201210141915.q9EJFsTv025204@svn.freebsd.org> From: Nick Hibma Date: Sun, 14 Oct 2012 19:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241555 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 19:15:54 -0000 Author: n_hibma Date: Sun Oct 14 19:15:54 2012 New Revision: 241555 URL: http://svn.freebsd.org/changeset/base/241555 Log: Implement modem control in u3g. Tested on Option GTM382W, Huawei E220, and Sierra Wireless MC8790V. Also implement the .ucom_poll method. Note: This makes it possible to use lqr/echo in ppp.conf. And it resolves ppp hanging during the PPp> phase. Reviewed by: hps MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Oct 14 18:13:33 2012 (r241554) +++ head/sys/dev/usb/serial/u3g.c Sun Oct 14 19:15:54 2012 (r241555) @@ -53,6 +53,7 @@ #include #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR u3g_debug @@ -99,6 +100,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, enum { U3G_BULK_WR, U3G_BULK_RD, + U3G_INTR, U3G_N_TRANSFER, }; @@ -107,12 +109,15 @@ struct u3g_softc { struct ucom_softc sc_ucom[U3G_MAXPORTS]; struct usb_xfer *sc_xfer[U3G_MAXPORTS][U3G_N_TRANSFER]; + uint8_t sc_iface[U3G_MAXPORTS]; /* local status register */ + uint8_t sc_lsr[U3G_MAXPORTS]; /* local status register */ + uint8_t sc_msr[U3G_MAXPORTS]; /* u3g status register */ + uint16_t sc_line[U3G_MAXPORTS]; /* line status */ + struct usb_device *sc_udev; struct mtx sc_mtx; - uint8_t sc_lsr; /* local status register */ - uint8_t sc_msr; /* U3G status register */ - uint8_t sc_numports; + uint8_t sc_numports; }; static device_probe_t u3g_probe; @@ -122,12 +127,17 @@ static void u3g_free_softc(struct u3g_so static usb_callback_t u3g_write_callback; static usb_callback_t u3g_read_callback; +static usb_callback_t u3g_intr_callback; -static void u3g_free(struct ucom_softc *ucom); +static void u3g_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static void u3g_cfg_set_dtr(struct ucom_softc *, uint8_t); +static void u3g_cfg_set_rts(struct ucom_softc *, uint8_t); static void u3g_start_read(struct ucom_softc *ucom); static void u3g_stop_read(struct ucom_softc *ucom); static void u3g_start_write(struct ucom_softc *ucom); static void u3g_stop_write(struct ucom_softc *ucom); +static void u3g_poll(struct ucom_softc *ucom); +static void u3g_free(struct ucom_softc *ucom); static void u3g_test_autoinst(void *, struct usb_device *, @@ -155,13 +165,26 @@ static const struct usb_config u3g_confi .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &u3g_read_callback, }, + + [U3G_INTR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &u3g_intr_callback, + }, }; static const struct ucom_callback u3g_callback = { + .ucom_cfg_get_status = &u3g_cfg_get_status, + .ucom_cfg_set_dtr = &u3g_cfg_set_dtr, + .ucom_cfg_set_rts = &u3g_cfg_set_rts, .ucom_start_read = &u3g_start_read, .ucom_stop_read = &u3g_stop_read, .ucom_start_write = &u3g_start_write, .ucom_stop_write = &u3g_stop_write, + .ucom_poll = &u3g_poll, .ucom_free = &u3g_free, }; @@ -849,6 +872,15 @@ u3g_attach(device_t dev) continue; } + iface = usbd_get_iface(uaa->device, i); + id = usbd_get_interface_descriptor(iface); + sc->sc_iface[nports] = id->bInterfaceNumber; + + if (bootverbose && sc->sc_xfer[nports][U3G_INTR]) { + device_printf(dev, "port %d supports modem control", + nports); + } + /* set stall by default */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[nports][U3G_BULK_WR]); @@ -926,6 +958,9 @@ u3g_start_read(struct ucom_softc *ucom) { struct u3g_softc *sc = ucom->sc_parent; + /* start interrupt endpoint (if configured) */ + usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_INTR]); + /* start read endpoint */ usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); } @@ -935,6 +970,9 @@ u3g_stop_read(struct ucom_softc *ucom) { struct u3g_softc *sc = ucom->sc_parent; + /* stop interrupt endpoint (if configured) */ + usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_INTR]); + /* stop read endpoint */ usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); } @@ -1012,3 +1050,134 @@ tr_setup: break; } } + +static void +u3g_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr) +{ + struct u3g_softc *sc = ucom->sc_parent; + + *lsr = sc->sc_lsr[ucom->sc_subunit]; + *msr = sc->sc_msr[ucom->sc_subunit]; +} + +static void +u3g_cfg_set_line(struct ucom_softc *ucom) +{ + struct u3g_softc *sc = ucom->sc_parent; + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UCDC_SET_CONTROL_LINE_STATE; + USETW(req.wValue, sc->sc_line[ucom->sc_subunit]); + req.wIndex[0] = sc->sc_iface[ucom->sc_subunit]; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + + ucom_cfg_do_request(sc->sc_udev, ucom, + &req, NULL, 0, 1000); +} + +static void +u3g_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff) +{ + struct u3g_softc *sc = ucom->sc_parent; + + DPRINTF("onoff = %d\n", onoff); + + if (onoff) + sc->sc_line[ucom->sc_subunit] |= UCDC_LINE_DTR; + else + sc->sc_line[ucom->sc_subunit] &= ~UCDC_LINE_DTR; + + u3g_cfg_set_line(ucom); +} + +static void +u3g_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff) +{ + struct u3g_softc *sc = ucom->sc_parent; + + DPRINTF("onoff = %d\n", onoff); + + if (onoff) + sc->sc_line[ucom->sc_subunit] |= UCDC_LINE_RTS; + else + sc->sc_line[ucom->sc_subunit] &= ~UCDC_LINE_RTS; + + u3g_cfg_set_line(ucom); +} + +static void +u3g_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct ucom_softc *ucom = usbd_xfer_softc(xfer); + struct u3g_softc *sc = ucom->sc_parent; + struct usb_page_cache *pc; + struct usb_cdc_notification pkt; + int actlen; + uint16_t wLen; + uint8_t mstatus; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + if (actlen < 8) { /* usb_cdc_notification with 2 data bytes */ + DPRINTF("message too short (expected 8, received %d)\n", actlen); + goto tr_setup; + } + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, &pkt, actlen); + + wLen = UGETW(pkt.wLength); + if (wLen < 2) { + DPRINTF("message too short (expected 2 data bytes, received %d)\n", wLen); + goto tr_setup; + } + + if (pkt.bmRequestType == UCDC_NOTIFICATION + && pkt.bNotification == UCDC_N_SERIAL_STATE) { + /* + * Set the serial state in ucom driver based on + * the bits from the notify message + */ + DPRINTF("notify bytes = 0x%02x, 0x%02x\n", + pkt.data[0], pkt.data[1]); + + /* currently, lsr is always zero. */ + sc->sc_lsr[ucom->sc_subunit] = 0; + sc->sc_msr[ucom->sc_subunit] = 0; + + mstatus = pkt.data[0]; + + if (mstatus & UCDC_N_SERIAL_RI) + sc->sc_msr[ucom->sc_subunit] |= SER_RI; + if (mstatus & UCDC_N_SERIAL_DSR) + sc->sc_msr[ucom->sc_subunit] |= SER_DSR; + if (mstatus & UCDC_N_SERIAL_DCD) + sc->sc_msr[ucom->sc_subunit] |= SER_DCD; + ucom_status_change(ucom); + } + + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +u3g_poll(struct ucom_softc *ucom) +{ + struct u3g_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer[ucom->sc_subunit], U3G_N_TRANSFER); +} From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 19:43:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62DC6887; Sun, 14 Oct 2012 19:43:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41FF68FC08; Sun, 14 Oct 2012 19:43:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EJhcsk029538; Sun, 14 Oct 2012 19:43:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EJhclS029533; Sun, 14 Oct 2012 19:43:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210141943.q9EJhclS029533@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Oct 2012 19:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241556 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 19:43:38 -0000 Author: kib Date: Sun Oct 14 19:43:37 2012 New Revision: 241556 URL: http://svn.freebsd.org/changeset/base/241556 Log: Add a KPI to allow to reserve some amount of space in the numvnodes counter, without actually allocating the vnodes. The supposed use of the getnewvnode_reserve(9) is to reclaim enough free vnodes while the code still does not hold any resources that might be needed during the reclamation, and to consume the slack later for getnewvnode() calls made from the innards. After the critical block is finished, the caller shall free any reserve left, by getnewvnode_drop_reserve(9). Reviewed by: avg Tested by: pho MFC after: 1 week Modified: head/sys/kern/subr_trap.c head/sys/kern/vfs_subr.c head/sys/sys/proc.h head/sys/sys/vnode.h Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Oct 14 19:15:54 2012 (r241555) +++ head/sys/kern/subr_trap.c Sun Oct 14 19:43:37 2012 (r241556) @@ -154,6 +154,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with sleep disabled")); KASSERT(td->td_pinned == 0, ("userret: Returning with with pinned thread")); + KASSERT(td->td_vp_reserv == 0, + ("userret: Returning while holding vnode reservation")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Oct 14 19:15:54 2012 (r241555) +++ head/sys/kern/vfs_subr.c Sun Oct 14 19:43:37 2012 (r241556) @@ -935,34 +935,22 @@ vtryrecycle(struct vnode *vp) } /* - * Return the next vnode from the free list. + * Wait for available vnodes. */ -int -getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, - struct vnode **vpp) +static int +getnewvnode_wait(int suspended) { - struct vnode *vp = NULL; - struct bufobj *bo; - CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); - mtx_lock(&vnode_free_list_mtx); - /* - * Lend our context to reclaim vnodes if they've exceeded the max. - */ - if (freevnodes > wantfreevnodes) - vnlru_free(1); - /* - * Wait for available vnodes. - */ + mtx_assert(&vnode_free_list_mtx, MA_OWNED); if (numvnodes > desiredvnodes) { - if (mp != NULL && (mp->mnt_kern_flag & MNTK_SUSPEND)) { + if (suspended) { /* * File system is beeing suspended, we cannot risk a * deadlock here, so allocate new vnode anyway. */ if (freevnodes > wantfreevnodes) vnlru_free(freevnodes - wantfreevnodes); - goto alloc; + return (0); } if (vnlruproc_sig == 0) { vnlruproc_sig = 1; /* avoid unnecessary wakeups */ @@ -970,16 +958,76 @@ getnewvnode(const char *tag, struct moun } msleep(&vnlruproc_sig, &vnode_free_list_mtx, PVFS, "vlruwk", hz); -#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ - if (numvnodes > desiredvnodes) { - mtx_unlock(&vnode_free_list_mtx); - return (ENFILE); + } + return (numvnodes > desiredvnodes ? ENFILE : 0); +} + +void +getnewvnode_reserve(u_int count) +{ + struct thread *td; + + td = curthread; + mtx_lock(&vnode_free_list_mtx); + while (count > 0) { + if (getnewvnode_wait(0) == 0) { + count--; + td->td_vp_reserv++; + numvnodes++; } -#endif } -alloc: + mtx_unlock(&vnode_free_list_mtx); +} + +void +getnewvnode_drop_reserve(void) +{ + struct thread *td; + + td = curthread; + mtx_lock(&vnode_free_list_mtx); + KASSERT(numvnodes >= td->td_vp_reserv, ("reserve too large")); + numvnodes -= td->td_vp_reserv; + mtx_unlock(&vnode_free_list_mtx); + td->td_vp_reserv = 0; +} + +/* + * Return the next vnode from the free list. + */ +int +getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, + struct vnode **vpp) +{ + struct vnode *vp; + struct bufobj *bo; + struct thread *td; + int error; + + CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); + vp = NULL; + td = curthread; + if (td->td_vp_reserv > 0) { + td->td_vp_reserv -= 1; + goto alloc; + } + mtx_lock(&vnode_free_list_mtx); + /* + * Lend our context to reclaim vnodes if they've exceeded the max. + */ + if (freevnodes > wantfreevnodes) + vnlru_free(1); + error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag & + MNTK_SUSPEND)); +#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ + if (error != 0) { + mtx_unlock(&vnode_free_list_mtx); + return (error); + } +#endif numvnodes++; mtx_unlock(&vnode_free_list_mtx); +alloc: vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO); /* * Setup locks. Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Oct 14 19:15:54 2012 (r241555) +++ head/sys/sys/proc.h Sun Oct 14 19:43:37 2012 (r241556) @@ -272,6 +272,7 @@ struct thread { struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ + u_int td_vp_reserv; /* (k) Count of reserved vnodes. */ #define td_endzero td_sigmask /* Copied during fork1() or create_thread(). */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Oct 14 19:15:54 2012 (r241555) +++ head/sys/sys/vnode.h Sun Oct 14 19:43:37 2012 (r241556) @@ -600,6 +600,8 @@ void cvtstat(struct stat *st, struct ost void cvtnstat(struct stat *sb, struct nstat *nsb); int getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp); +void getnewvnode_reserve(u_int count); +void getnewvnode_drop_reserve(void); int insmntque1(struct vnode *vp, struct mount *mp, void (*dtr)(struct vnode *, void *), void *dtr_arg); int insmntque(struct vnode *vp, struct mount *mp); From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 20:31:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1D25874; Sun, 14 Oct 2012 20:31:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A07828FC17; Sun, 14 Oct 2012 20:31:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EKVc1P037121; Sun, 14 Oct 2012 20:31:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EKVcpD037119; Sun, 14 Oct 2012 20:31:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210142031.q9EKVcpD037119@svn.freebsd.org> From: Adrian Chadd Date: Sun, 14 Oct 2012 20:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241558 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 20:31:38 -0000 Author: adrian Date: Sun Oct 14 20:31:38 2012 New Revision: 241558 URL: http://svn.freebsd.org/changeset/base/241558 Log: Break the RX processing up into smaller chunks of 128 frames each. Right now processing a full 512 frame queue takes quite a while (measured on the order of milliseconds.) Because of this, the TX processing ends up sometimes preempting the taskqueue: * userland sends a frame * it goes in through net80211 and out to ath_start() * ath_start() will end up either direct dispatching or software queuing a frame. If TX had to wait for RX to finish, it would add quite a few ms of additional latency to the packet transmission. This in the past has caused issues with TCP throughput. Now, as part of my attempt to bring sanity to the TX/RX paths, the first step is to make the RX processing happen in smaller 'parts'. That way when TX is pushed into the ath taskqueue, there won't be so much latency in the way of things. The bigger scale change (which will come much later) is to actually process the frames in the ath_intr taskqueue but process _frames_ in the ath driver taskqueue. That would reduce the latency between processing and requeuing new descriptors. But that'll come later. The actual work: * Add ATH_RX_MAX at 128 (static for now); * break out of the processing loop if npkts reaches ATH_RX_MAX; * if we processed ATH_RX_MAX or more frames during the processing loop, immediately reschedule another RX taskqueue run. This will handle the further frames in the taskqueue. This should have very minimal impact on the general throughput case, unless the scheduler is being very very strange or the ath taskqueue ends up spending a lot of time on non-RX operations (such as TX completion.) Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Oct 14 20:00:00 2012 (r241557) +++ head/sys/dev/ath/if_ath_rx.c Sun Oct 14 20:31:38 2012 (r241558) @@ -797,6 +797,8 @@ rx_next: return (is_good); } +#define ATH_RX_MAX 128 + static void ath_rx_proc(struct ath_softc *sc, int resched) { @@ -832,6 +834,15 @@ ath_rx_proc(struct ath_softc *sc, int re sc->sc_stats.ast_rx_noise = nf; tsf = ath_hal_gettsf64(ah); do { + /* + * Don't process too many packets at a time; give the + * TX thread time to also run - otherwise the TX + * latency can jump by quite a bit, causing throughput + * degredation. + */ + if (npkts >= ATH_RX_MAX) + break; + bf = TAILQ_FIRST(&sc->sc_rxbuf); if (sc->sc_rxslink && bf == NULL) { /* NB: shouldn't happen */ if_printf(ifp, "%s: no buffer!\n", __func__); @@ -942,11 +953,22 @@ rx_proc_next: } #undef PA2DESC + /* + * If we hit the maximum number of frames in this round, + * reschedule for another immediate pass. This gives + * the TX and TX completion routines time to run, which + * will reduce latency. + */ + if (npkts >= ATH_RX_MAX) + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt--; ATH_PCU_UNLOCK(sc); } +#undef ATH_RX_MAX + /* * Only run the RX proc if it's not already running. * Since this may get run as part of the reset/flush path, From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 20:44:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03DC7D4F; Sun, 14 Oct 2012 20:44:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFFDF8FC0A; Sun, 14 Oct 2012 20:44:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EKi8p8039001; Sun, 14 Oct 2012 20:44:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EKi8Kt038996; Sun, 14 Oct 2012 20:44:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210142044.q9EKi8Kt038996@svn.freebsd.org> From: Adrian Chadd Date: Sun, 14 Oct 2012 20:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241559 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 20:44:09 -0000 Author: adrian Date: Sun Oct 14 20:44:08 2012 New Revision: 241559 URL: http://svn.freebsd.org/changeset/base/241559 Log: Push the actual TX processing into the ath taskqueue, rather than having it run out of multiple concurrent contexts. Right now the ath(4) TX processing is a bit hairy. Specifically: * It was running out of ath_start(), which could occur from multiple concurrent sending processes (as if_start() can be started from multiple sending threads nowdays.. sigh) * during RX if fast frames are enabled (so not really at the moment, not until I fix this particular feature again..) * during ath_reset() - so anything which calls that * during ath_tx_proc*() in the ath taskqueue - ie, TX is attempted again after TX completion, as there's now hopefully some ath_bufs available. * Then, the ic_raw_xmit() method can queue raw frames for transmission at any time, from any net80211 TX context. Ew. This has caused packet ordering issues in the past - specifically, there's absolutely no guarantee that preemption won't occuring _during_ ath_start() by the TX completion processing, which will call ath_start() again. It's a mess - 802.11 really, really wants things to be in sequence or things go all kinds of loopy. So: * create a new task struct for TX'ing; * make the if_start method simply queue the task on the ath taskqueue; * make ath_start() just be called by the new TX task; * make ath_tx_kick() just schedule the ath TX task, rather than directly calling ath_start(). Now yes, this means that I've taken a step backwards in terms of concurrency - TX -and- RX now occur in the same single-task taskqueue. But there's nothing stopping me from separating out the TX / TX completion code into a separate taskqueue which runs in parallel with the RX path, if that ends up being appropriate for some platforms. This fixes the CCMP/seqno concurrency issues that creep up when you transmit large amounts of uni-directional UDP traffic (>200MBit) on a FreeBSD STA -> AP, as now there's only one TX context no matter what's going on (TX completion->retry/software queue, userland->net80211->ath_start(), TX completion -> ath_start()); but it won't fix any concurrency issues between raw transmitted frames and non-raw transmitted frames (eg EAPOL frames on TID 16 and any other TID 16 multicast traffic that gets put on the CABQ.) That is going to require a bunch more re-architecture before it's feasible to fix. In any case, this is a big step towards making the majority of the TX path locking irrelevant, as now almost all TX activity occurs in the taskqueue. Phew. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Oct 14 20:31:38 2012 (r241558) +++ head/sys/dev/ath/if_ath.c Sun Oct 14 20:44:08 2012 (r241559) @@ -142,6 +142,7 @@ static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); +static void ath_start_queue(struct ifnet *ifp); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); static int ath_ioctl(struct ifnet *, u_long, caddr_t); @@ -420,6 +421,7 @@ ath_attach(u_int16_t devid, struct ath_s TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); TASK_INIT(&sc->sc_txqtask,0, ath_txq_sched_tasklet, sc); TASK_INIT(&sc->sc_fataltask,0, ath_fatal_proc, sc); + TASK_INIT(&sc->sc_txsndtask, 0, ath_start_task, sc); /* * Allocate hardware transmit queues: one queue for @@ -531,7 +533,7 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - ifp->if_start = ath_start; + ifp->if_start = ath_start_queue; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); @@ -2246,7 +2248,7 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * XXX should this be done by the caller, rather than * ath_reset() ? */ - ath_start(ifp); /* restart xmit */ + ath_tx_kick(sc); /* restart xmit */ return 0; } @@ -2428,17 +2430,19 @@ ath_getbuf(struct ath_softc *sc, ath_buf return bf; } -void -ath_start(struct ifnet *ifp) +static void +ath_start_queue(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; - struct ieee80211_node *ni; - struct ath_buf *bf; - struct mbuf *m, *next; - ath_bufhead frags; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) - return; + ath_tx_kick(sc); +} + +void +ath_start_task(void *arg, int npending) +{ + struct ath_softc *sc = (struct ath_softc *) arg; + struct ifnet *ifp = sc->sc_ifp; /* XXX is it ok to hold the ATH_LOCK here? */ ATH_PCU_LOCK(sc); @@ -2455,6 +2459,25 @@ ath_start(struct ifnet *ifp) sc->sc_txstart_cnt++; ATH_PCU_UNLOCK(sc); + ath_start(sc->sc_ifp); + + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); +} + +void +ath_start(struct ifnet *ifp) +{ + struct ath_softc *sc = ifp->if_softc; + struct ieee80211_node *ni; + struct ath_buf *bf; + struct mbuf *m, *next; + ath_bufhead frags; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) + return; + for (;;) { ATH_TXBUF_LOCK(sc); if (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree) { @@ -2549,10 +2572,6 @@ ath_start(struct ifnet *ifp) sc->sc_wd_timer = 5; } - - ATH_PCU_LOCK(sc); - sc->sc_txstart_cnt--; - ATH_PCU_UNLOCK(sc); } static int Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun Oct 14 20:31:38 2012 (r241558) +++ head/sys/dev/ath/if_ath_misc.h Sun Oct 14 20:44:08 2012 (r241559) @@ -115,12 +115,13 @@ extern int ath_stoptxdma(struct ath_soft * we can kill this. */ extern void ath_start(struct ifnet *ifp); +extern void ath_start_task(void *arg, int npending); static inline void ath_tx_kick(struct ath_softc *sc) { - ath_start(sc->sc_ifp); + taskqueue_enqueue(sc->sc_tq, &sc->sc_txsndtask); } #endif Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Oct 14 20:31:38 2012 (r241558) +++ head/sys/dev/ath/if_athvar.h Sun Oct 14 20:44:08 2012 (r241559) @@ -632,6 +632,7 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ + struct task sc_txsndtask; /* tx send processing */ struct ath_descdma sc_txcompdma; /* TX EDMA completion */ struct mtx sc_txcomplock; /* TX EDMA completion lock */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 22:33:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D26DA986; Sun, 14 Oct 2012 22:33:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFC9B8FC12; Sun, 14 Oct 2012 22:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EMXHLZ055806; Sun, 14 Oct 2012 22:33:17 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EMXHvG055801; Sun, 14 Oct 2012 22:33:17 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201210142233.q9EMXHvG055801@svn.freebsd.org> From: Rick Macklem Date: Sun, 14 Oct 2012 22:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241561 - in head/sys: fs/nfsserver nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 22:33:17 -0000 Author: rmacklem Date: Sun Oct 14 22:33:17 2012 New Revision: 241561 URL: http://svn.freebsd.org/changeset/base/241561 Log: Add two new options to the nfssvc(2) syscall that allow processes running as root to suspend/resume execution of the kernel nfsd threads. An earlier version of this patch was tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/nfs/nfs_nfssvc.c head/sys/nfs/nfssvc.h Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun Oct 14 22:28:56 2012 (r241560) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun Oct 14 22:33:17 2012 (r241561) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include NFSDLOCKMUTEX; +NFSV4ROOTLOCKMUTEX; +struct nfsv4lock nfsd_suspend_lock; /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. @@ -221,9 +223,24 @@ nfssvc_program(struct svc_req *rqst, SVC #ifdef MAC mac_cred_associate_nfsd(nd.nd_cred); #endif + /* + * Get a refcnt (shared lock) on nfsd_suspend_lock. + * NFSSVC_SUSPENDNFSD will take an exclusive lock on + * nfsd_suspend_lock to suspend these threads. + * This must be done here, before the check of + * nfsv4root exports by nfsvno_v4rootexport(). + */ + NFSLOCKV4ROOTMUTEX(); + nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); + NFSUNLOCKV4ROOTMUTEX(); + if ((nd.nd_flag & ND_NFSV4) != 0) { nd.nd_repstat = nfsvno_v4rootexport(&nd); if (nd.nd_repstat != 0) { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); @@ -233,6 +250,9 @@ nfssvc_program(struct svc_req *rqst, SVC cacherep = nfs_proc(&nd, rqst->rq_xid, xprt->xp_socket, xprt->xp_sockref, &rp); + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); } else { NFSMGET(nd.nd_mreq); nd.nd_mreq->m_len = 0; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Oct 14 22:28:56 2012 (r241560) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Oct 14 22:33:17 2012 (r241561) @@ -57,6 +57,7 @@ extern struct mount nfsv4root_mnt; extern struct nfsrv_stablefirst nfsrv_stablefirst; extern void (*nfsd_call_servertimer)(void); extern SVCPOOL *nfsrvd_pool; +extern struct nfsv4lock nfsd_suspend_lock; struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; NFSDLOCKMUTEX; struct mtx nfs_cache_mutex; @@ -3095,8 +3096,9 @@ nfssvc_srvcall(struct thread *p, struct struct nfsd_dumplocks *dumplocks; struct nameidata nd; vnode_t vp; - int error = EINVAL; + int error = EINVAL, igotlock; struct proc *procp; + static int suspend_nfsd = 0; if (uap->flag & NFSSVC_PUBLICFH) { NFSBZERO((caddr_t)&nfs_pubfh.nfsrvfh_data, @@ -3175,6 +3177,26 @@ nfssvc_srvcall(struct thread *p, struct nfsd_master_start = procp->p_stats->p_start; nfsd_master_proc = procp; PROC_UNLOCK(procp); + } else if ((uap->flag & NFSSVC_SUSPENDNFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd == 0) { + /* Lock out all nfsd threads */ + do { + igotlock = nfsv4_lock(&nfsd_suspend_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (igotlock == 0 && suspend_nfsd == 0); + suspend_nfsd = 1; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; + } else if ((uap->flag & NFSSVC_RESUMENFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd != 0) { + nfsv4_unlock(&nfsd_suspend_lock, 0); + suspend_nfsd = 0; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; } NFSEXITCODE(error); Modified: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- head/sys/nfs/nfs_nfssvc.c Sun Oct 14 22:28:56 2012 (r241560) +++ head/sys/nfs/nfs_nfssvc.c Sun Oct 14 22:33:17 2012 (r241561) @@ -102,7 +102,8 @@ sys_nfssvc(struct thread *td, struct nfs else if ((uap->flag & (NFSSVC_NFSDNFSD | NFSSVC_NFSDADDSOCK | NFSSVC_PUBLICFH | NFSSVC_V4ROOTEXPORT | NFSSVC_NOPUBLICFH | NFSSVC_STABLERESTART | NFSSVC_ADMINREVOKE | - NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE)) && + NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE | + NFSSVC_SUSPENDNFSD | NFSSVC_RESUMENFSD)) && nfsd_call_nfsd != NULL) error = (*nfsd_call_nfsd)(td, uap); if (error == EINTR || error == ERESTART) Modified: head/sys/nfs/nfssvc.h ============================================================================== --- head/sys/nfs/nfssvc.h Sun Oct 14 22:28:56 2012 (r241560) +++ head/sys/nfs/nfssvc.h Sun Oct 14 22:33:17 2012 (r241561) @@ -66,5 +66,7 @@ #define NFSSVC_BACKUPSTABLE 0x00800000 #define NFSSVC_ZEROCLTSTATS 0x01000000 /* modifier for GETSTATS */ #define NFSSVC_ZEROSRVSTATS 0x02000000 /* modifier for GETSTATS */ +#define NFSSVC_SUSPENDNFSD 0x04000000 +#define NFSSVC_RESUMENFSD 0x08000000 #endif /* _NFS_NFSSVC_H */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 22:58:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2A57346; Sun, 14 Oct 2012 22:58:12 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AA558FC1C; Sun, 14 Oct 2012 22:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EMwCb7059333; Sun, 14 Oct 2012 22:58:12 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EMwCSS059331; Sun, 14 Oct 2012 22:58:12 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201210142258.q9EMwCSS059331@svn.freebsd.org> From: Tim Kientzle Date: Sun, 14 Oct 2012 22:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241562 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 22:58:12 -0000 Author: kientzle Date: Sun Oct 14 22:58:12 2012 New Revision: 241562 URL: http://svn.freebsd.org/changeset/base/241562 Log: Return correct packet size. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 22:33:17 2012 (r241561) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 22:58:12 2012 (r241562) @@ -804,9 +804,9 @@ cpsw_intr_rx_locked(void *arg) bus_dmamap_sync(sc->mbuf_dtag, sc->rx_dmamap[i], BUS_DMASYNC_POSTREAD); /* Fill mbuf */ - sc->rx_mbuf[i]->m_hdr.mh_data +=2; - sc->rx_mbuf[i]->m_len = bd.pktlen-2; - sc->rx_mbuf[i]->m_pkthdr.len = bd.pktlen-2; + sc->rx_mbuf[i]->m_hdr.mh_data += bd.bufoff; + sc->rx_mbuf[i]->m_hdr.mh_len = bd.pktlen - 4; + sc->rx_mbuf[i]->m_pkthdr.len = bd.pktlen - 4; sc->rx_mbuf[i]->m_flags |= M_PKTHDR; sc->rx_mbuf[i]->m_pkthdr.rcvif = ifp; From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 23:00:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB9514E6; Sun, 14 Oct 2012 23:00:24 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3D138FC08; Sun, 14 Oct 2012 23:00:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EN0OPr059742; Sun, 14 Oct 2012 23:00:24 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EN0ONO059740; Sun, 14 Oct 2012 23:00:24 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201210142300.q9EN0ONO059740@svn.freebsd.org> From: Tim Kientzle Date: Sun, 14 Oct 2012 23:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241563 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 23:00:24 -0000 Author: kientzle Date: Sun Oct 14 23:00:24 2012 New Revision: 241563 URL: http://svn.freebsd.org/changeset/base/241563 Log: Name cpsw_stop to cpsw_stop_locked consistently with other functions in this file that assume locks are already held. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 22:58:12 2012 (r241562) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 23:00:24 2012 (r241563) @@ -93,7 +93,7 @@ static void cpsw_init(void *arg); static void cpsw_init_locked(void *arg); static void cpsw_start(struct ifnet *ifp); static void cpsw_start_locked(struct ifnet *ifp); -static void cpsw_stop(struct cpsw_softc *sc); +static void cpsw_stop_locked(struct cpsw_softc *sc); static int cpsw_ioctl(struct ifnet *ifp, u_long command, caddr_t data); static int cpsw_allocate_dma(struct cpsw_softc *sc); static int cpsw_free_dma(struct cpsw_softc *sc); @@ -397,7 +397,7 @@ cpsw_shutdown(device_t dev) CPSW_GLOBAL_LOCK(sc); - cpsw_stop(sc); + cpsw_stop_locked(sc); CPSW_GLOBAL_UNLOCK(sc); @@ -656,10 +656,12 @@ cpsw_start_locked(struct ifnet *ifp) } static void -cpsw_stop(struct cpsw_softc *sc) +cpsw_stop_locked(struct cpsw_softc *sc) { struct ifnet *ifp; + CPSW_GLOBAL_LOCK_ASSERT(sc) + ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -708,7 +710,7 @@ cpsw_ioctl(struct ifnet *ifp, u_long com } } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) - cpsw_stop(sc); + cpsw_stop_locked(sc); sc->cpsw_if_flags = ifp->if_flags; CPSW_GLOBAL_UNLOCK(sc); @@ -948,7 +950,7 @@ cpsw_watchdog(struct cpsw_softc *sc) ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); - cpsw_stop(sc); + cpsw_stop_locked(sc); cpsw_init_locked(sc); CPSW_GLOBAL_UNLOCK(sc); From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 23:07:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 140C2838; Sun, 14 Oct 2012 23:07:55 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0FB88FC18; Sun, 14 Oct 2012 23:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EN7sHB060834; Sun, 14 Oct 2012 23:07:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EN7swU060832; Sun, 14 Oct 2012 23:07:54 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201210142307.q9EN7swU060832@svn.freebsd.org> From: Tim Kientzle Date: Sun, 14 Oct 2012 23:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241564 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 23:07:55 -0000 Author: kientzle Date: Sun Oct 14 23:07:54 2012 New Revision: 241564 URL: http://svn.freebsd.org/changeset/base/241564 Log: Cut-and-paste dropped semicolon. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 23:00:24 2012 (r241563) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 23:07:54 2012 (r241564) @@ -660,7 +660,7 @@ cpsw_stop_locked(struct cpsw_softc *sc) { struct ifnet *ifp; - CPSW_GLOBAL_LOCK_ASSERT(sc) + CPSW_GLOBAL_LOCK_ASSERT(sc); ifp = sc->ifp; From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 23:45:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C1382DB; Sun, 14 Oct 2012 23:45:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0538E8FC0A; Sun, 14 Oct 2012 23:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ENjuJR067289; Sun, 14 Oct 2012 23:45:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ENjuCN067287; Sun, 14 Oct 2012 23:45:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201210142345.q9ENjuCN067287@svn.freebsd.org> From: Devin Teske Date: Sun, 14 Oct 2012 23:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241565 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 23:45:57 -0000 Author: dteske Date: Sun Oct 14 23:45:56 2012 New Revision: 241565 URL: http://svn.freebsd.org/changeset/base/241565 Log: Mirror the changes made in SVN r240798: Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Sun Oct 14 23:07:54 2012 (r241564) +++ head/usr.sbin/sysrc/sysrc Sun Oct 14 23:45:56 2012 (r241565) @@ -251,7 +251,7 @@ shift $(( $OPTIND - 1 )) # Taint-check all rc.conf(5) files # errmsg="$pgm: Exiting due to previous syntax errors" -if ( : ${RC_CONFS?} ) > /dev/null 2>&1; then +if [ "${RC_CONFS+set}" ]; then ( for i in $RC_CONFS; do [ -e "$i" ] || continue /bin/sh -n "$i" || exit $FAILURE @@ -311,7 +311,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then $( [ "$SHOW_VALUE" ] || echo \ -N ) $( [ "$SHOW_FILE" ] && echo \ -F ) " - if ( : ${RC_CONFS?} ) > /dev/null 2>&1; then + if [ "${RC_CONFS+set}" ]; then args="$args -f '$RC_CONFS'" fi for arg in "$@"; do @@ -437,8 +437,7 @@ if [ "$SHOW_ALL" ]; then # explicit value, modifying the default behavior of # source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 && - rc_conf_files="$RC_CONFS" + [ "${RC_CONFS+set}" ] && rc_conf_files="$RC_CONFS" source_rc_confs From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 23:52:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4209D54D; Sun, 14 Oct 2012 23:52:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23A668FC08; Sun, 14 Oct 2012 23:52:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ENqUGv068325; Sun, 14 Oct 2012 23:52:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ENqUF6068322; Sun, 14 Oct 2012 23:52:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210142352.q9ENqUF6068322@svn.freebsd.org> From: Adrian Chadd Date: Sun, 14 Oct 2012 23:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241566 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 23:52:31 -0000 Author: adrian Date: Sun Oct 14 23:52:30 2012 New Revision: 241566 URL: http://svn.freebsd.org/changeset/base/241566 Log: Stop abusing the ATH_TID_*() queue macros for filtered frames and give them their own macro set. Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Oct 14 23:45:56 2012 (r241565) +++ head/sys/dev/ath/if_ath_tx.c Sun Oct 14 23:52:30 2012 (r241566) @@ -2947,7 +2947,7 @@ ath_tx_tid_filt_addbuf(struct ath_softc ath_tx_set_retry(sc, bf); sc->sc_stats.ast_tx_swfiltered++; - ATH_TID_INSERT_TAIL(&tid->filtq, bf, bf_list); + ATH_TID_FILT_INSERT_TAIL(tid, bf, bf_list); } /* @@ -2996,8 +2996,8 @@ ath_tx_tid_filt_comp_complete(struct ath tid->clrdmask = 1; /* XXX this is really quite inefficient */ - while ((bf = ATH_TID_LAST(&tid->filtq, ath_bufhead_s)) != NULL) { - ATH_TID_REMOVE(&tid->filtq, bf, bf_list); + while ((bf = ATH_TID_FILT_LAST(tid, ath_bufhead_s)) != NULL) { + ATH_TID_FILT_REMOVE(tid, bf, bf_list); ATH_TID_INSERT_HEAD(tid, bf, bf_list); } @@ -3408,7 +3408,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s /* And now, drain the filtered frame queue */ t = 0; for (;;) { - bf = ATH_TID_FIRST(&tid->filtq); + bf = ATH_TID_FILT_FIRST(tid); if (bf == NULL) break; @@ -3417,7 +3417,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s t = 1; } - ATH_TID_REMOVE(&tid->filtq, bf, bf_list); + ATH_TID_FILT_REMOVE(tid, bf, bf_list); ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf); } @@ -3667,8 +3667,8 @@ ath_tx_tid_cleanup(struct ath_softc *sc, * we run off and discard/process things. */ /* XXX this is really quite inefficient */ - while ((bf = ATH_TID_LAST(&atid->filtq, ath_bufhead_s)) != NULL) { - ATH_TID_REMOVE(&atid->filtq, bf, bf_list); + while ((bf = ATH_TID_FILT_LAST(atid, ath_bufhead_s)) != NULL) { + ATH_TID_FILT_REMOVE(atid, bf, bf_list); ATH_TID_INSERT_HEAD(atid, bf, bf_list); } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Oct 14 23:45:56 2012 (r241565) +++ head/sys/dev/ath/if_athvar.h Sun Oct 14 23:52:30 2012 (r241566) @@ -374,7 +374,7 @@ struct ath_txq { #define ATH_TXQ_LAST(_tq, _field) TAILQ_LAST(&(_tq)->axq_q, _field) /* - * These are for the TID software queue and filtered frames queues. + * These are for the TID software queue. */ #define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \ @@ -391,6 +391,24 @@ struct ath_txq { #define ATH_TID_FIRST(_tq) TAILQ_FIRST(&(_tq)->tid_q) #define ATH_TID_LAST(_tq, _field) TAILQ_LAST(&(_tq)->tid_q, _field) +/* + * These are for the TID filtered frame queue + */ +#define ATH_TID_FILT_INSERT_HEAD(_tq, _elm, _field) do { \ + TAILQ_INSERT_HEAD(&(_tq)->filtq.tid_q, (_elm), _field); \ + (_tq)->axq_depth++; \ +} while (0) +#define ATH_TID_FILT_INSERT_TAIL(_tq, _elm, _field) do { \ + TAILQ_INSERT_TAIL(&(_tq)->filtq.tid_q, (_elm), _field); \ + (_tq)->axq_depth++; \ +} while (0) +#define ATH_TID_FILT_REMOVE(_tq, _elm, _field) do { \ + TAILQ_REMOVE(&(_tq)->filtq.tid_q, _elm, _field); \ + (_tq)->axq_depth--; \ +} while (0) +#define ATH_TID_FILT_FIRST(_tq) TAILQ_FIRST(&(_tq)->filtq.tid_q) +#define ATH_TID_FILT_LAST(_tq, _field) TAILQ_LAST(&(_tq)->filtq.tid_q,_field) + struct ath_vap { struct ieee80211vap av_vap; /* base class */ int av_bslot; /* beacon slot index */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 00:07:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BE9D874; Mon, 15 Oct 2012 00:07:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF0AB8FC18; Mon, 15 Oct 2012 00:07:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9F07IQv071308; Mon, 15 Oct 2012 00:07:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9F07IS5071306; Mon, 15 Oct 2012 00:07:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210150007.q9F07IS5071306@svn.freebsd.org> From: Adrian Chadd Date: Mon, 15 Oct 2012 00:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241567 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 00:07:19 -0000 Author: adrian Date: Mon Oct 15 00:07:18 2012 New Revision: 241567 URL: http://svn.freebsd.org/changeset/base/241567 Log: Track the total number of software queued frames in an atomic variable stashed away in ath_node. As much as I tried to stuff that behind the ATH_NODE lock, unfortunately the locking is just too plain hairy (for me! And I wrote it!) to do cleanly. Hence using atomics here instead of a lock. The ATH_NODE lock just isn't currently used anywhere besides the rate control updates. If in the future everything gets migrated back to using a single ATH_NODE lock or a single global ATH_TX lock (ie, a single TX lock for all TX and TX completion) then fine, I'll remove the atomics. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Oct 14 23:52:30 2012 (r241566) +++ head/sys/dev/ath/if_athvar.h Mon Oct 15 00:07:18 2012 (r241567) @@ -35,6 +35,8 @@ #ifndef _DEV_ATH_ATHVAR_H #define _DEV_ATH_ATHVAR_H +#include + #include #include #include @@ -175,6 +177,8 @@ struct ath_node { struct ath_tid an_tid[IEEE80211_TID_SIZE]; /* per-TID state */ char an_name[32]; /* eg "wlan0_a1" */ struct mtx an_mtx; /* protecting the ath_node state */ + uint32_t an_swq_depth; /* how many SWQ packets for this + node */ /* variable-length rate control state follows */ }; #define ATH_NODE(ni) ((struct ath_node *)(ni)) @@ -379,14 +383,17 @@ struct ath_txq { #define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ + atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ } while (0) #define ATH_TID_INSERT_TAIL(_tq, _elm, _field) do { \ TAILQ_INSERT_TAIL(&(_tq)->tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ + atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ } while (0) #define ATH_TID_REMOVE(_tq, _elm, _field) do { \ TAILQ_REMOVE(&(_tq)->tid_q, _elm, _field); \ (_tq)->axq_depth--; \ + atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \ } while (0) #define ATH_TID_FIRST(_tq) TAILQ_FIRST(&(_tq)->tid_q) #define ATH_TID_LAST(_tq, _field) TAILQ_LAST(&(_tq)->tid_q, _field) @@ -397,14 +404,17 @@ struct ath_txq { #define ATH_TID_FILT_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->filtq.tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ + atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ } while (0) #define ATH_TID_FILT_INSERT_TAIL(_tq, _elm, _field) do { \ TAILQ_INSERT_TAIL(&(_tq)->filtq.tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ + atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ } while (0) #define ATH_TID_FILT_REMOVE(_tq, _elm, _field) do { \ TAILQ_REMOVE(&(_tq)->filtq.tid_q, _elm, _field); \ (_tq)->axq_depth--; \ + atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \ } while (0) #define ATH_TID_FILT_FIRST(_tq) TAILQ_FIRST(&(_tq)->filtq.tid_q) #define ATH_TID_FILT_LAST(_tq, _field) TAILQ_LAST(&(_tq)->filtq.tid_q,_field) From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 00:17:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB2B9BC6; Mon, 15 Oct 2012 00:17: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 899C48FC08; Mon, 15 Oct 2012 00:17:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9F0HGku072849; Mon, 15 Oct 2012 00:17:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9F0HGOl072847; Mon, 15 Oct 2012 00:17:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201210150017.q9F0HGOl072847@svn.freebsd.org> From: Rick Macklem Date: Mon, 15 Oct 2012 00:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241568 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 00:17:16 -0000 Author: rmacklem Date: Mon Oct 15 00:17:16 2012 New Revision: 241568 URL: http://svn.freebsd.org/changeset/base/241568 Log: Add a new '-S' option to mountd, which tells it to suspend execution of the nfsd threads while it is reloading the exports. This avoids clients from getting intermittent access errors when the exports are being reloaded non-atomically. It is not an ideal solution, since requests will back up while the nfsd threads are suspended. Also, when this option is used, if mountd crashes while reloading exports, mountd will have to be restarted to get the nfsd threads to resume execution. This has been tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). The nfse patch offers a more comprehensive solution for this issue. PR: kern/9619, kern/131342 Reviewed by: kib MFC after: 2 weeks Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Oct 15 00:07:18 2012 (r241567) +++ head/usr.sbin/mountd/mountd.c Mon Oct 15 00:17:16 2012 (r241568) @@ -246,6 +246,7 @@ static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; static int sock_fdpos; +static int suspend_nfsd = 0; int opt_flags; static int have_v6 = 1; @@ -311,7 +312,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnop:r")) != -1) + while ((c = getopt(argc, argv, "2deh:lnop:rS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -363,6 +364,9 @@ main(int argc, char **argv) out_of_mem(); } break; + case 'S': + suspend_nfsd = 1; + break; default: usage(); }; @@ -921,7 +925,7 @@ usage(void) { fprintf(stderr, "usage: mountd [-2] [-d] [-e] [-l] [-n] [-p ] [-r] " - "[-h ] [export_file ...]\n"); + "[-S] [-h ] [export_file ...]\n"); exit(1); } @@ -1659,6 +1663,8 @@ get_exportlist(void) int done; struct nfsex_args eargs; + if (suspend_nfsd != 0) + (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); v4root_dirpath[0] = '\0'; bzero(&export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; @@ -1787,6 +1793,9 @@ get_exportlist(void) */ if (run_v4server > 0 && has_publicfh == 0) (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); + + /* Resume the nfsd. If they weren't suspended, this is harmless. */ + (void)nfssvc(NFSSVC_RESUMENFSD, NULL); } /* From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 00:24:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 674B9D8A; Mon, 15 Oct 2012 00:24:24 +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 4FD0B8FC08; Mon, 15 Oct 2012 00:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9F0OOSd073909; Mon, 15 Oct 2012 00:24:24 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9F0OOuY073907; Mon, 15 Oct 2012 00:24:24 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201210150024.q9F0OOuY073907@svn.freebsd.org> From: Rick Macklem Date: Mon, 15 Oct 2012 00:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241569 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 00:24:24 -0000 Author: rmacklem Date: Mon Oct 15 00:24:23 2012 New Revision: 241569 URL: http://svn.freebsd.org/changeset/base/241569 Log: Add a description for the '-S' option to the mountd man page. This is a content change. Reviewed by: kib MFC after: 2 weeks Modified: head/usr.sbin/mountd/mountd.8 Modified: head/usr.sbin/mountd/mountd.8 ============================================================================== --- head/usr.sbin/mountd/mountd.8 Mon Oct 15 00:17:16 2012 (r241568) +++ head/usr.sbin/mountd/mountd.8 Mon Oct 15 00:24:23 2012 (r241569) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 23, 2011 +.Dd October 14, 2012 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnor +.Op Fl 2delnorS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -131,6 +131,19 @@ flag. Specify an alternate location for the exports file. More than one exports file can be specified. +.It Fl S +Tell mountd to suspend/resume execution of the nfsd threads whenever +the exports list is being reloaded. +This avoids intermittent access +errors for clients that do NFS RPCs while the exports are being +reloaded, but introduces a delay in RPC response while the reload +is in progress. +If +.Nm +crashes while an exports load is in progress, +.Nm +must be restarted to get the nfsd threads running again, if this +option is used. .El .Pp When From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 04:10:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1ADDB86; Mon, 15 Oct 2012 04:10:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7898FC12; Mon, 15 Oct 2012 04:10:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9F4AnlP009606; Mon, 15 Oct 2012 04:10:49 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9F4AnJg009604; Mon, 15 Oct 2012 04:10:49 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201210150410.q9F4AnJg009604@svn.freebsd.org> From: Tim Kientzle Date: Mon, 15 Oct 2012 04:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241572 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 04:10:50 -0000 Author: kientzle Date: Mon Oct 15 04:10:49 2012 New Revision: 241572 URL: http://svn.freebsd.org/changeset/base/241572 Log: Fix an mbuf leak in cpsw driver, clean up mbuf management: * Record TX mbufs when we get them so we can release them. * Set TX/RX mbuf slots to NULL when we are no longer responsible for them * Move dma sync on RX into RX intr routine Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 15 01:13:36 2012 (r241571) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 15 04:10:49 2012 (r241572) @@ -522,11 +522,6 @@ cpsw_new_rxbuf(struct cpsw_softc *sc, ui int error; int nsegs; - if (sc->rx_mbuf[i]) { - bus_dmamap_sync(sc->mbuf_dtag, sc->rx_dmamap[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->mbuf_dtag, sc->rx_dmamap[i]); - } - sc->rx_mbuf[i] = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (sc->rx_mbuf[i] == NULL) return (ENOBUFS); @@ -593,6 +588,7 @@ cpsw_encap(struct cpsw_softc *sc, struct /* Write descriptor */ cpsw_cpdma_write_txbd(idx, &bd); + sc->tx_mbuf[idx] = m0; /* Previous descriptor should point to us */ cpsw_cpdma_write_txbd_next(((idx-1<0)?(CPSW_MAX_TX_BUFFERS-1):(idx-1)), @@ -821,9 +817,15 @@ cpsw_intr_rx_locked(void *arg) } } + bus_dmamap_sync(sc->mbuf_dtag, + sc->rx_dmamap[i], + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->mbuf_dtag, sc->rx_dmamap[i]); + /* Handover packet */ CPSW_RX_UNLOCK(sc); (*ifp->if_input)(ifp, sc->rx_mbuf[i]); + sc->rx_mbuf[i] = NULL; CPSW_RX_LOCK(sc); /* Allocate new buffer for current descriptor */ @@ -890,6 +892,7 @@ cpsw_intr_tx_locked(void *arg) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->mbuf_dtag, sc->tx_dmamap[sc->txbd_head]); m_freem(sc->tx_mbuf[sc->txbd_head]); + sc->tx_mbuf[sc->txbd_head] = NULL; cpsw_write_4(CPSW_CPDMA_TX_CP(0), cpsw_cpdma_txbd_paddr(sc->txbd_head)); From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 06:18:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06162C18; Mon, 15 Oct 2012 06:18:27 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id 431FA8FC08; Mon, 15 Oct 2012 06:18:25 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 157508120; Mon, 15 Oct 2012 08:13:16 +0200 From: Hans Petter Selasky To: Eitan Adler Subject: Re: svn commit: r241553 - in head/sys/dev/usb: . quirk Date: Mon, 15 Oct 2012 08:14:42 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201210141726.q9EHQj1W008761@svn.freebsd.org> In-Reply-To: <201210141726.q9EHQj1W008761@svn.freebsd.org> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210150814.42609.hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 06:18:27 -0000 On Sunday 14 October 2012 19:26:45 Eitan Adler wrote: > Author: eadler > Date: Sun Oct 14 17:26:45 2012 > New Revision: 241553 > URL: http://svn.freebsd.org/changeset/base/241553 > > Modified: head/sys/dev/usb/usbdevs > =========================================================================== > === --- head/sys/dev/usb/usbdevs Sun Oct 14 17:26:40 2012 (r241552) > +++ head/sys/dev/usb/usbdevs Sun Oct 14 17:26:45 2012 (r241553) > @@ -3970,6 +3970,7 @@ product SUNPLUS USBMOUSE 0x0007 USB Opti > > /* Super Top products */ > product SUPERTOP IDE 0x6600 USB-IDE > +product SUPERTOP FLASHDRIVE 0x121c extrememory Snippy > Hi, > /* Syntech products */ > product SYNTECH CPT8001C 0x0001 CPT-8001C Barcode scanner If a vendor has many products in this list, we simply quirk all products from that vendor simply instead of keeping track of every each and single product. --HPS From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 07:57:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE562E7A; Mon, 15 Oct 2012 07:57:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B63F68FC0A; Mon, 15 Oct 2012 07:57:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9F7vtpf043853; Mon, 15 Oct 2012 07:57:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9F7vtQg043851; Mon, 15 Oct 2012 07:57:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210150757.q9F7vtQg043851@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 15 Oct 2012 07:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241575 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 07:57:55 -0000 Author: glebius Date: Mon Oct 15 07:57:55 2012 New Revision: 241575 URL: http://svn.freebsd.org/changeset/base/241575 Log: We don't need to convert ip6_len to host byte order before ip6_output(), the IPv6 stack is working in net byte order. The reason this code worked before is that ip6_output() doesn't look at ip6_plen at all and recalculates it based on mbuf length. Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon Oct 15 06:48:50 2012 (r241574) +++ head/sys/netinet/ip_divert.c Mon Oct 15 07:57:55 2012 (r241575) @@ -402,8 +402,6 @@ div_output(struct socket *so, struct mbu INP_RUNLOCK(inp); goto cantsend; } - - ip6->ip6_plen = ntohs(ip6->ip6_plen); break; } #endif From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 08:21:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F7165B2; Mon, 15 Oct 2012 08:21:50 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660C38FC08; Mon, 15 Oct 2012 08:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9F8LosJ047581; Mon, 15 Oct 2012 08:21:50 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9F8Lobc047576; Mon, 15 Oct 2012 08:21:50 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201210150821.q9F8Lobc047576@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 15 Oct 2012 08:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 08:21:50 -0000 Author: sobomax Date: Mon Oct 15 08:21:49 2012 New Revision: 241576 URL: http://svn.freebsd.org/changeset/base/241576 Log: Add per-second scheduling into the cron(8). Right now it's only available via the new @every_second shortcut. ENOTIME to implement crontab(5) format extensions to allow more flexible scheduling. In order to address some concerns expressed by Terry Lambert while discussing the topic few years ago, about per-second cron possibly causing some bad effects on /etc/crontab by stat()ing it every second instead of every minute now (i.e. atime update), only check that database needs to be reloaded on every 60-th loop run. This should be close enough to the current behaviour. Add "@every_minute" shortcut while I am here. MFC after: 1 month Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Mon Oct 15 07:57:55 2012 (r241575) +++ head/usr.sbin/cron/cron/cron.c Mon Oct 15 08:21:49 2012 (r241576) @@ -98,6 +98,7 @@ main(argc, argv) char *argv[]; { cron_db database; + int runnum; ProgramName = argv[0]; @@ -149,21 +150,24 @@ main(argc, argv) load_database(&database); run_reboot_jobs(&database); cron_sync(); + runnum = 0; while (TRUE) { # if DEBUGGING /* if (!(DebugFlags & DTEST)) */ # endif /*DEBUGGING*/ cron_sleep(&database); - load_database(&database); + if (runnum % 60 == 0) + load_database(&database); /* do this iteration */ cron_tick(&database); - /* sleep 1 minute + /* sleep 1 second */ - TargetTime += 60; + TargetTime += 1; + runnum += 1; } } @@ -194,22 +198,23 @@ cron_tick(db) static time_t diff = 0, /* time difference in seconds from the last offset change */ difflimit = 0; /* end point for the time zone correction */ struct tm otztm; /* time in the old time zone */ - int otzminute, otzhour, otzdom, otzmonth, otzdow; + int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; register struct tm *tm = localtime(&TargetTime); - register int minute, hour, dom, month, dow; + register int second, minute, hour, dom, month, dow; register user *u; register entry *e; /* make 0-based values out of these so we can use them as indicies */ + second = tm->tm_sec -FIRST_SECOND; minute = tm->tm_min -FIRST_MINUTE; hour = tm->tm_hour -FIRST_HOUR; dom = tm->tm_mday -FIRST_DOM; month = tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH; dow = tm->tm_wday -FIRST_DOW; - Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n", - getpid(), minute, hour, dom, month, dow)) + Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d,%d)\n", + getpid(), second, minute, hour, dom, month, dow)) if (dst_enabled && last_time != 0 && TargetTime > last_time /* exclude stepping back */ @@ -262,6 +267,7 @@ cron_tick(db) /* make 0-based values out of these so we can use them as indicies */ + otzsecond = otztm.tm_sec -FIRST_SECOND; otzminute = otztm.tm_min -FIRST_MINUTE; otzhour = otztm.tm_hour -FIRST_HOUR; otzdom = otztm.tm_mday -FIRST_DOM; @@ -283,7 +289,8 @@ cron_tick(db) e->uid, e->gid, e->cmd)) if ( diff != 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { - if (bit_test(e->minute, otzminute) + if (bit_test(e->second, otzsecond) + && bit_test(e->minute, otzminute) && bit_test(e->hour, otzhour) && bit_test(e->month, otzmonth) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) @@ -302,7 +309,8 @@ cron_tick(db) continue; } - if (bit_test(e->minute, minute) + if (bit_test(e->second, second) + && bit_test(e->minute, minute) && bit_test(e->hour, hour) && bit_test(e->month, month) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Mon Oct 15 07:57:55 2012 (r241575) +++ head/usr.sbin/cron/cron/cron.h Mon Oct 15 08:21:49 2012 (r241576) @@ -124,6 +124,10 @@ LineNumber = ln; \ } +#define FIRST_SECOND 0 +#define LAST_SECOND 59 +#define SECOND_COUNT (LAST_SECOND - FIRST_SECOND + 1) + #define FIRST_MINUTE 0 #define LAST_MINUTE 59 #define MINUTE_COUNT (LAST_MINUTE - FIRST_MINUTE + 1) @@ -165,6 +169,7 @@ typedef struct _entry { #endif char **envp; char *cmd; + bitstr_t bit_decl(second, SECOND_COUNT); bitstr_t bit_decl(minute, MINUTE_COUNT); bitstr_t bit_decl(hour, HOUR_COUNT); bitstr_t bit_decl(dom, DOM_COUNT); Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Mon Oct 15 07:57:55 2012 (r241575) +++ head/usr.sbin/cron/crontab/crontab.5 Mon Oct 15 08:21:49 2012 (r241576) @@ -232,6 +232,8 @@ string meaning @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *". +@every_minute Run once a minute, "*/1 * * * *". +@every_second Run once a second. .Ed .Sh EXAMPLE CRON FILE .Bd -literal Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Mon Oct 15 07:57:55 2012 (r241575) +++ head/usr.sbin/cron/lib/entry.c Mon Oct 15 08:21:49 2012 (r241576) @@ -151,6 +151,7 @@ load_entry(file, error_func, pw, envp) e->flags |= WHEN_REBOOT; } else if (!strcmp("yearly", cmd) || !strcmp("annually", cmd)){ Debug(DPARS, ("load_entry()...yearly shortcut\n")) + bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_set(e->dom, 0); @@ -159,6 +160,7 @@ load_entry(file, error_func, pw, envp) e->flags |= DOW_STAR; } else if (!strcmp("monthly", cmd)) { Debug(DPARS, ("load_entry()...monthly shortcut\n")) + bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_set(e->dom, 0); @@ -167,6 +169,7 @@ load_entry(file, error_func, pw, envp) e->flags |= DOW_STAR; } else if (!strcmp("weekly", cmd)) { Debug(DPARS, ("load_entry()...weekly shortcut\n")) + bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); @@ -175,6 +178,7 @@ load_entry(file, error_func, pw, envp) bit_set(e->dow, 0); } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) { Debug(DPARS, ("load_entry()...daily shortcut\n")) + bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); @@ -182,11 +186,28 @@ load_entry(file, error_func, pw, envp) bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else if (!strcmp("hourly", cmd)) { Debug(DPARS, ("load_entry()...hourly shortcut\n")) + bit_set(e->second, 0); bit_set(e->minute, 0); bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); + } else if (!strcmp("every_minute", cmd)) { + Debug(DPARS, ("load_entry()...every_minute shortcut\n")) + bit_set(e->second, 0); + bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); + bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); + bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); + bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); + } else if (!strcmp("every_second", cmd)) { + Debug(DPARS, ("load_entry()...every_second shortcut\n")) + bit_nset(e->second, 0, (LAST_SECOND-FIRST_SECOND+1)); + bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); + bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); + bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); + bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else { ecode = e_timespec; goto eof; From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 12:03:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00F87B45; Mon, 15 Oct 2012 12:03:11 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDC018FC08; Mon, 15 Oct 2012 12:03:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FC3BIv083384; Mon, 15 Oct 2012 12:03:11 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FC3Bfp083382; Mon, 15 Oct 2012 12:03:11 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201210151203.q9FC3Bfp083382@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 15 Oct 2012 12:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241577 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 12:03:12 -0000 Author: ray Date: Mon Oct 15 12:03:11 2012 New Revision: 241577 URL: http://svn.freebsd.org/changeset/base/241577 Log: Defaulting to id "0" if ar7240_probe(dev) success, fix warning when building with DEBUG. Submitted by: Luiz Otavio O Souza Approved by: adrian (mentor) Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Oct 15 08:21:49 2012 (r241576) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Oct 15 12:03:11 2012 (r241577) @@ -102,6 +102,7 @@ arswitch_probe(device_t dev) if (ar7240_probe(dev) == 0) { chipname = "AR7240"; sc->sc_switchtype = AR8X16_SWITCH_AR7240; + id = 0; goto done; } From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 12:20:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF4B711F; Mon, 15 Oct 2012 12:20:41 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C796C8FC14; Mon, 15 Oct 2012 12:20:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FCKfcO086303; Mon, 15 Oct 2012 12:20:41 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FCKf3F086297; Mon, 15 Oct 2012 12:20:41 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201210151220.q9FCKf3F086297@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 15 Oct 2012 12:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241578 - in head/sys/dev/etherswitch: . arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 12:20:42 -0000 Author: ray Date: Mon Oct 15 12:20:40 2012 New Revision: 241578 URL: http://svn.freebsd.org/changeset/base/241578 Log: Locking for etherswitch framework: * add lock/unlock methods; * add lock/unlock default implementation; * surround switch IOCTLs with locking; * add lock/unlock implementation for arswitch; Submitted by: Luiz Otavio O Souza Approved by: adrian (mentor) Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/etherswitch.c head/sys/dev/etherswitch/etherswitch_if.m Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Oct 15 12:03:11 2012 (r241577) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Oct 15 12:20:40 2012 (r241578) @@ -263,7 +263,10 @@ arswitch_attach(device_t dev) return (err); callout_init_mtx(&sc->callout_tick, &sc->sc_mtx, 0); + + ARSWITCH_LOCK(sc); arswitch_tick(sc); + ARSWITCH_UNLOCK(sc); return (err); } @@ -371,6 +374,8 @@ arswitch_miipollstat(struct arswitch_sof struct mii_softc *miisc; int portstatus; + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + for (i = 0; i < sc->numphys; i++) { if (sc->miibus[i] == NULL) continue; @@ -404,6 +409,24 @@ arswitch_tick(void *arg) callout_reset(&sc->callout_tick, hz, arswitch_tick, sc); } +static void +arswitch_lock(device_t dev) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + ARSWITCH_LOCK(sc); +} + +static void +arswitch_unlock(device_t dev) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + ARSWITCH_UNLOCK(sc); +} + static etherswitch_info_t * arswitch_getinfo(device_t dev) { @@ -552,6 +575,8 @@ static device_method_t arswitch_methods[ DEVMETHOD(mdio_writereg, arswitch_writephy), /* etherswitch interface */ + DEVMETHOD(etherswitch_lock, arswitch_lock), + DEVMETHOD(etherswitch_unlock, arswitch_unlock), DEVMETHOD(etherswitch_getinfo, arswitch_getinfo), DEVMETHOD(etherswitch_readreg, arswitch_readreg), DEVMETHOD(etherswitch_writereg, arswitch_writereg), Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Mon Oct 15 12:03:11 2012 (r241577) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Mon Oct 15 12:20:40 2012 (r241578) @@ -75,13 +75,19 @@ static SYSCTL_NODE(_debug, OID_AUTO, ars int arswitch_readphy(device_t dev, int phy, int reg) { + struct arswitch_softc *sc; uint32_t data = 0, ctrl; int err, timeout; + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + if (phy < 0 || phy >= 32) return (ENXIO); if (reg < 0 || reg >= 32) return (ENXIO); + + ARSWITCH_LOCK(sc); err = arswitch_writereg_msb(dev, AR8X16_REG_MDIO_CTRL, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_READ | @@ -89,41 +95,50 @@ arswitch_readphy(device_t dev, int phy, (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT)); DEVERR(dev, err, "arswitch_readphy()=%d: phy=%d.%02x\n", phy, reg); if (err != 0) - return (-1); + goto fail; for (timeout = 100; timeout--; ) { ctrl = arswitch_readreg_msb(dev, AR8X16_REG_MDIO_CTRL); if ((ctrl & AR8X16_MDIO_CTRL_BUSY) == 0) break; } if (timeout < 0) - err = EIO; + goto fail; data = arswitch_readreg_lsb(dev, AR8X16_REG_MDIO_CTRL) & AR8X16_MDIO_CTRL_DATA_MASK; + ARSWITCH_UNLOCK(sc); return (data); + +fail: + ARSWITCH_UNLOCK(sc); + return (-1); } int arswitch_writephy(device_t dev, int phy, int reg, int data) { + struct arswitch_softc *sc; uint32_t ctrl; int err, timeout; - + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + if (reg < 0 || reg >= 32) return (ENXIO); + + ARSWITCH_LOCK(sc); err = arswitch_writereg_lsb(dev, AR8X16_REG_MDIO_CTRL, (data & AR8X16_MDIO_CTRL_DATA_MASK)); - DEVERR(dev, err, "arswitch_writephy()=%d: phy=%d.%02x\n", phy, reg); if (err != 0) - return (err); + goto out; err = arswitch_writereg_msb(dev, AR8X16_REG_MDIO_CTRL, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_WRITE | (phy << AR8X16_MDIO_CTRL_PHY_ADDR_SHIFT) | (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT)); - DEVERR(dev, err, "arswitch_writephy()=%d: phy=%d.%02x\n", phy, reg); if (err != 0) - return (err); + goto out; for (timeout = 100; timeout--; ) { ctrl = arswitch_readreg(dev, AR8X16_REG_MDIO_CTRL); if ((ctrl & AR8X16_MDIO_CTRL_BUSY) == 0) @@ -131,6 +146,8 @@ arswitch_writephy(device_t dev, int phy, } if (timeout < 0) err = EIO; +out: DEVERR(dev, err, "arswitch_writephy()=%d: phy=%d.%02x\n", phy, reg); + ARSWITCH_UNLOCK(sc); return (err); } Modified: head/sys/dev/etherswitch/etherswitch.c ============================================================================== --- head/sys/dev/etherswitch/etherswitch.c Mon Oct 15 12:03:11 2012 (r241577) +++ head/sys/dev/etherswitch/etherswitch.c Mon Oct 15 12:20:40 2012 (r241578) @@ -213,12 +213,16 @@ etherswitchioctl(struct cdev *cdev, u_lo case IOETHERSWITCHGETREG: reg = (etherswitch_reg_t *)data; + ETHERSWITCH_LOCK(etherswitch); reg->val = ETHERSWITCH_READREG(etherswitch, reg->reg); + ETHERSWITCH_UNLOCK(etherswitch); break; case IOETHERSWITCHSETREG: reg = (etherswitch_reg_t *)data; + ETHERSWITCH_LOCK(etherswitch); error = ETHERSWITCH_WRITEREG(etherswitch, reg->reg, reg->val); + ETHERSWITCH_UNLOCK(etherswitch); break; case IOETHERSWITCHGETPORT: Modified: head/sys/dev/etherswitch/etherswitch_if.m ============================================================================== --- head/sys/dev/etherswitch/etherswitch_if.m Mon Oct 15 12:03:11 2012 (r241577) +++ head/sys/dev/etherswitch/etherswitch_if.m Mon Oct 15 12:20:40 2012 (r241578) @@ -11,6 +11,21 @@ INTERFACE etherswitch; # +# Default implementation +# +CODE { + static void + null_etherswitch_lock(device_t dev) + { + } + + static void + null_etherswitch_unlock(device_t dev) + { + } +}; + +# # Return device info # METHOD etherswitch_info_t* getinfo { @@ -18,6 +33,20 @@ METHOD etherswitch_info_t* getinfo { } # +# Lock access to switch registers +# +METHOD void lock { + device_t dev; +} DEFAULT null_etherswitch_lock; + +# +# Unlock access to switch registers +# +METHOD void unlock { + device_t dev; +} DEFAULT null_etherswitch_unlock; + +# # Read switch register # METHOD int readreg { From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 12:28:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C0EA5A8; Mon, 15 Oct 2012 12:28:15 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8DB58FC08; Mon, 15 Oct 2012 12:28:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FCSEIJ087471; Mon, 15 Oct 2012 12:28:14 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FCSEal087469; Mon, 15 Oct 2012 12:28:14 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201210151228.q9FCSEal087469@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 15 Oct 2012 12:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241579 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 12:28:15 -0000 Author: ray Date: Mon Oct 15 12:28:14 2012 New Revision: 241579 URL: http://svn.freebsd.org/changeset/base/241579 Log: Mask data to only 16 bits to be sure on write into switch reg. Submitted by: Luiz Otavio O Souza Approved by: adrian (mentor) Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Mon Oct 15 12:20:40 2012 (r241578) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Mon Oct 15 12:28:14 2012 (r241579) @@ -148,7 +148,7 @@ int arswitch_writereg_msb(device_t dev, int addr, int data) { - return (arswitch_writereg16(dev, addr + 2, data >> 16)); + return (arswitch_writereg16(dev, addr + 2, (data >> 16) & 0xffff)); } int From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 12:33:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4F08958; Mon, 15 Oct 2012 12:33:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE5BC8FC08; Mon, 15 Oct 2012 12:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FCXrpD088505; Mon, 15 Oct 2012 12:33:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FCXrge088503; Mon, 15 Oct 2012 12:33:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210151233.q9FCXrge088503@svn.freebsd.org> From: Eitan Adler Date: Mon, 15 Oct 2012 12:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241580 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 12:33:53 -0000 Author: eadler Date: Mon Oct 15 12:33:53 2012 New Revision: 241580 URL: http://svn.freebsd.org/changeset/base/241580 Log: Add support for the USB DISK Pro PMAP. This patch has sit for 6 years in the PR database. PR: usb/96381 Submitted by: jhs Reviewed by: mav Approved by: cperciva (implicit) MFC after: 3 days Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Oct 15 12:28:14 2012 (r241579) +++ head/sys/cam/scsi/scsi_da.c Mon Oct 15 12:33:53 2012 (r241580) @@ -387,6 +387,15 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * USB DISK Pro PMAP + * Reported by: jhs + * PR: usb/96381 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, " ", "USB DISK Pro", "PMAP"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* * Motorola E398 Mobile Phone (TransFlash memory card). * Reported by: Wojciech A. Koszek * PR: usb/89889 From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 13:04:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE6C117A; Mon, 15 Oct 2012 13:04:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B1B8E8FC14; Mon, 15 Oct 2012 13:04:28 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 23EA4B924; Mon, 15 Oct 2012 09:04:28 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet Date: Mon, 15 Oct 2012 08:34:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210141503.q9EF37rE087018@svn.freebsd.org> In-Reply-To: <201210141503.q9EF37rE087018@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210150834.09553.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 15 Oct 2012 09:04:28 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 13:04:29 -0000 On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: > Author: glebius > Date: Sun Oct 14 15:03:06 2012 > New Revision: 241546 > URL: http://svn.freebsd.org/changeset/base/241546 > > Log: > Fix defines in r241245. We actually don't define FreeBSD. > > Reported & tested by: Oleg Ginzburg Seems like it should be using 'defined(__FreeBSD_version)' instead? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 13:04:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64B1E17C; Mon, 15 Oct 2012 13:04:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 377668FC16; Mon, 15 Oct 2012 13:04:29 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 98C0CB958; Mon, 15 Oct 2012 09:04:28 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r241556 - in head/sys: kern sys Date: Mon, 15 Oct 2012 08:37:04 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210141943.q9EJhclS029533@svn.freebsd.org> In-Reply-To: <201210141943.q9EJhclS029533@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210150837.04943.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 15 Oct 2012 09:04:28 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 13:04:29 -0000 On Sunday, October 14, 2012 3:43:37 pm Konstantin Belousov wrote: > Author: kib > Date: Sun Oct 14 19:43:37 2012 > New Revision: 241556 > URL: http://svn.freebsd.org/changeset/base/241556 > > Log: > Add a KPI to allow to reserve some amount of space in the numvnodes > counter, without actually allocating the vnodes. The supposed use of > the getnewvnode_reserve(9) is to reclaim enough free vnodes while the > code still does not hold any resources that might be needed during the > reclamation, and to consume the slack later for getnewvnode() calls > made from the innards. After the critical block is finished, the > caller shall free any reserve left, by getnewvnode_drop_reserve(9). Can you describe an intended use-case for this? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 13:20:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E08686E; Mon, 15 Oct 2012 13:20:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 260FF8FC0A; Mon, 15 Oct 2012 13:20:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FDK91T096139; Mon, 15 Oct 2012 13:20:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FDK8Mi096136; Mon, 15 Oct 2012 13:20:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210151320.q9FDK8Mi096136@svn.freebsd.org> From: Eitan Adler Date: Mon, 15 Oct 2012 13:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241581 - head/sbin/mount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 13:20:09 -0000 Author: eadler Date: Mon Oct 15 13:20:08 2012 New Revision: 241581 URL: http://svn.freebsd.org/changeset/base/241581 Log: Fix minor nits: use a comma after "i.e." sentences begin on new lines. No .Dd bump for trivial modification. Approved by: wblock MFC after: 3 days Modified: head/sbin/mount/getmntopts.3 head/sbin/mount/mount.8 Modified: head/sbin/mount/getmntopts.3 ============================================================================== --- head/sbin/mount/getmntopts.3 Mon Oct 15 12:33:53 2012 (r241580) +++ head/sbin/mount/getmntopts.3 Mon Oct 15 13:20:08 2012 (r241581) @@ -70,8 +70,8 @@ has the following format: .Bd -literal struct mntopt { char *m_option; /* option name */ - int m_inverse; /* is this a negative option, e.g. "dev" */ - int m_flag; /* bit to set, e.g. MNT_RDONLY */ + int m_inverse; /* is this a negative option, e.g., "dev" */ + int m_flag; /* bit to set, e.g., MNT_RDONLY */ int m_altloc; /* non-zero to use altflagp rather than flagp */ }; .Ed Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Mon Oct 15 12:33:53 2012 (r241580) +++ head/sbin/mount/mount.8 Mon Oct 15 13:20:08 2012 (r241581) @@ -176,7 +176,8 @@ Force .Nm to use the specified program to mount the file system, instead of calling .Xr nmount 2 -directly. For example: +directly. +For example: .Bd -literal mount -t foofs -o mountprog=/mydir/fooprog /dev/acd0 /mnt .Ed From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 13:20:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD8F19F6; Mon, 15 Oct 2012 13:20:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6FC0E8FC14; Mon, 15 Oct 2012 13:20:46 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA10699; Mon, 15 Oct 2012 16:20:44 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <507C0DAC.1040606@FreeBSD.org> Date: Mon, 15 Oct 2012 16:20:44 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121012 Thunderbird/16.0.1 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r241556 - in head/sys: kern sys References: <201210141943.q9EJhclS029533@svn.freebsd.org> <201210150837.04943.jhb@freebsd.org> In-Reply-To: <201210150837.04943.jhb@freebsd.org> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 13:20:49 -0000 on 15/10/2012 15:37 John Baldwin said the following: > On Sunday, October 14, 2012 3:43:37 pm Konstantin Belousov wrote: >> Author: kib >> Date: Sun Oct 14 19:43:37 2012 >> New Revision: 241556 >> URL: http://svn.freebsd.org/changeset/base/241556 >> >> Log: >> Add a KPI to allow to reserve some amount of space in the numvnodes >> counter, without actually allocating the vnodes. The supposed use of >> the getnewvnode_reserve(9) is to reclaim enough free vnodes while the >> code still does not hold any resources that might be needed during the >> reclamation, and to consume the slack later for getnewvnode() calls >> made from the innards. After the critical block is finished, the >> caller shall free any reserve left, by getnewvnode_drop_reserve(9). > > Can you describe an intended use-case for this? > The use-case is primarily ZFS, but could be useful in other filesystems. The idea is to avoid recursion back into the filesystem code when it is written in such a way that (1) it must hold internal locks around getnewvnode call and (2) it doesn't handle well calls to vop_inactive/vop_reclaim when the said internal locks are already held. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 13:25:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BBCDD50 for ; Mon, 15 Oct 2012 13:25:54 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3F18FC08 for ; Mon, 15 Oct 2012 13:25:53 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so5235662pbb.13 for ; Mon, 15 Oct 2012 06:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=1oH8pVWa0sp3W0Gp84F/zuZYEYZiRCsr+N+1/ToQ8wY=; b=cJcNzh1mr2f2e05YLYzKX2UOSdGgPifWaKlPuezPxbtRbsIwwce3j6N9NHtXetNgj4 P3k5XUKsPEjtn48otYRbafSyYowQdit7MMZKU1Vt+vCHGbga4KGs1R5SaU5tp0Znz3Ag WVdX8tzmfKgWzaba2os6oWG/2mZugQ/LdqJos= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=1oH8pVWa0sp3W0Gp84F/zuZYEYZiRCsr+N+1/ToQ8wY=; b=A6zEFcL0TlO3jqrdfEPguPSxdsg+T0doXvFyhuHta1Gbok2r0kdVcmsDZm9+/dy0QF hKrR9wulQsY0N6JeRtZPlNEE0UO9qt+c1p2FHhWRv9yddLFmr7Cp+MTCFqOWl0lektd/ qDZIDRTg3ufN4FU++svGwSgIgbvArc+AprnJnzgU0p7l5wHI1cI5lXq27m0iEsG2G05O SBsjScxKj5GidzcB0YZQMqkRis/jDIMXaczxA/V79y9jaJju/LXLLQKAIXiLOrt5+POF K2ydTAt/ogknCtLGklfZW5Rb7A010CAan92w6fQ48y45JzTZY3j+N5hRzKqSfOv+FRgG bX1A== Received: by 10.68.200.231 with SMTP id jv7mr36913815pbc.140.1350307553808; Mon, 15 Oct 2012 06:25:53 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.161.163 with HTTP; Mon, 15 Oct 2012 06:25:23 -0700 (PDT) In-Reply-To: <201210150814.42609.hselasky@c2i.net> References: <201210141726.q9EHQj1W008761@svn.freebsd.org> <201210150814.42609.hselasky@c2i.net> From: Eitan Adler Date: Mon, 15 Oct 2012 09:25:23 -0400 X-Google-Sender-Auth: 4olBncncggBdI8Pp3s0CNgJwrGo Message-ID: Subject: Re: svn commit: r241553 - in head/sys/dev/usb: . quirk To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkbMY5GSOHVXw3j80HqdI+746HUWD9vuR0CE0EDVqQ0ZdNldPeNoVoGEY2SaiN9PVVVKc74 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 13:25:54 -0000 On 15 October 2012 02:14, Hans Petter Selasky wrote: > On Sunday 14 October 2012 19:26:45 Eitan Adler wrote: >> Author: eadler >> Date: Sun Oct 14 17:26:45 2012 >> New Revision: 241553 >> URL: http://svn.freebsd.org/changeset/base/241553 >> > >> Modified: head/sys/dev/usb/usbdevs >> =========================================================================== >> === --- head/sys/dev/usb/usbdevs Sun Oct 14 17:26:40 2012 (r241552) >> +++ head/sys/dev/usb/usbdevs Sun Oct 14 17:26:45 2012 (r241553) >> @@ -3970,6 +3970,7 @@ product SUNPLUS USBMOUSE 0x0007 USB Opti >> >> /* Super Top products */ >> product SUPERTOP IDE 0x6600 USB-IDE >> +product SUPERTOP FLASHDRIVE 0x121c extrememory Snippy >> > > Hi, > >> /* Syntech products */ >> product SYNTECH CPT8001C 0x0001 CPT-8001C Barcode scanner > > If a vendor has many products in this list, we simply quirk all products from > that vendor simply instead of keeping track of every each and single product. Okay. How do I do that? Looking at this list it seems like all the examples are for individual products. -- Eitan Adler Source & Ports committer X11, Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 13:38:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5FA11E9; Mon, 15 Oct 2012 13:38:25 +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 ADC218FC0A; Mon, 15 Oct 2012 13:38:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FDcPuw099146; Mon, 15 Oct 2012 13:38:25 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FDcPCj099144; Mon, 15 Oct 2012 13:38:25 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201210151338.q9FDcPCj099144@svn.freebsd.org> From: Rick Macklem Date: Mon, 15 Oct 2012 13:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241582 - head/sys/rpc/rpcsec_gss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 13:38:25 -0000 Author: rmacklem Date: Mon Oct 15 13:38:25 2012 New Revision: 241582 URL: http://svn.freebsd.org/changeset/base/241582 Log: Add a comment describing why r241097 was done. Suggested by: rwatson MFC after: 1 week Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Oct 15 13:20:08 2012 (r241581) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Oct 15 13:38:25 2012 (r241582) @@ -1024,6 +1024,17 @@ svc_rpc_gss_validate(struct svc_rpc_gss_ if (maj_stat != GSS_S_COMPLETE) { rpc_gss_log_status("gss_verify_mic", client->cl_mech, maj_stat, min_stat); + /* + * Attila Bogar and Herbert Poeckl reported similar problems + * w.r.t. a Linux NFS client doing a krb5 NFS mount against the + * FreeBSD server. We determined this was a Linux bug: + * http://www.spinics.net/lists/linux-nfs/msg32466.html, where + * the mount failed to work because a Destroy operation with a + * bogus encrypted checksum destroyed the authenticator handle. + * Since the checksum is bogus (gss_verify_mic() failed), it + * doesn't make sense to destroy the handle and not doing so + * fixes the Linux mount. + */ if (gcproc != RPCSEC_GSS_DESTROY) client->cl_state = CLIENT_STALE; return (FALSE); From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 14:14:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7596A02; Mon, 15 Oct 2012 14:14:21 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67298FC12; Mon, 15 Oct 2012 14:14:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FEEL42005217; Mon, 15 Oct 2012 14:14:21 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FEELaj005215; Mon, 15 Oct 2012 14:14:21 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201210151414.q9FEELaj005215@svn.freebsd.org> From: Peter Wemm Date: Mon, 15 Oct 2012 14:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241583 - head/etc/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 14:14:22 -0000 Author: peter Date: Mon Oct 15 14:14:21 2012 New Revision: 241583 URL: http://svn.freebsd.org/changeset/base/241583 Log: mx1 -> smarthost.ysv Modified: head/etc/sendmail/freefall.mc Modified: head/etc/sendmail/freefall.mc ============================================================================== --- head/etc/sendmail/freefall.mc Mon Oct 15 13:38:25 2012 (r241582) +++ head/etc/sendmail/freefall.mc Mon Oct 15 14:14:21 2012 (r241583) @@ -43,5 +43,5 @@ divert(0)dnl VERSIONID(`$FreeBSD$') OSTYPE(freebsd6) -FEATURE(nullclient, mx1.$m) +FEATURE(nullclient, smarthost.ysv.$m) MASQUERADE_AS(FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 14:37:07 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37D1B5EE; Mon, 15 Oct 2012 14:37:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id A3F118FC14; Mon, 15 Oct 2012 14:37:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9FEawgG020039; Mon, 15 Oct 2012 18:36:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9FEawJq020038; Mon, 15 Oct 2012 18:36:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 15 Oct 2012 18:36:58 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet Message-ID: <20121015143658.GU89655@FreeBSD.org> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210150834.09553.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 14:37:07 -0000 On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: J> > Author: glebius J> > Date: Sun Oct 14 15:03:06 2012 J> > New Revision: 241546 J> > URL: http://svn.freebsd.org/changeset/base/241546 J> > J> > Log: J> > Fix defines in r241245. We actually don't define FreeBSD. J> > J> > Reported & tested by: Oleg Ginzburg J> J> Seems like it should be using 'defined(__FreeBSD_version)' instead? AFAIU, the construction which left after r241546 works fine. Anything undefined resolves to zero, so in case of non-FreeBSD build we test if (0 > 10000019) and this fails which is what we expect. I have used this construction several times already without any side effects. I have also seen it in some software in ports, where it works okay, too. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 14:42:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5659971; Mon, 15 Oct 2012 14:42:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 01B508FC0C; Mon, 15 Oct 2012 14:42:33 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q9FEgSot058280; Mon, 15 Oct 2012 17:42:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q9FEgGwX015793; Mon, 15 Oct 2012 17:42:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q9FEgGbS015792; Mon, 15 Oct 2012 17:42:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Oct 2012 17:42:16 +0300 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet Message-ID: <20121015144216.GI35915@deviant.kiev.zoral.com.ua> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ekB8d505ZB0gDS8i" Content-Disposition: inline In-Reply-To: <20121015143658.GU89655@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 14:42:34 -0000 --ekB8d505ZB0gDS8i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: > On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: > J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: > J> > Author: glebius > J> > Date: Sun Oct 14 15:03:06 2012 > J> > New Revision: 241546 > J> > URL: http://svn.freebsd.org/changeset/base/241546 > J> >=20 > J> > Log: > J> > Fix defines in r241245. We actually don't define FreeBSD. > J> > =20 > J> > Reported & tested by: Oleg Ginzburg > J>=20 > J> Seems like it should be using 'defined(__FreeBSD_version)' instead? >=20 > AFAIU, the construction which left after r241546 works fine. Anything > undefined resolves to zero, so in case of non-FreeBSD build we test > if (0 > 10000019) and this fails which is what we expect. >=20 > I have used this construction several times already without any side effe= cts. > I have also seen it in some software in ports, where it works okay, too. We do define __FreeBSD__. --ekB8d505ZB0gDS8i Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlB8IMgACgkQC3+MBN1Mb4iI/QCfQziwANRcyr+JykDgF34Sve3n Q9sAn1QnTQPl2OpleQaNdQwhhgRBhQya =p8ZL -----END PGP SIGNATURE----- --ekB8d505ZB0gDS8i-- From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 15:11:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A13165D6; Mon, 15 Oct 2012 15:11:49 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 3920A8FC1A; Mon, 15 Oct 2012 15:11:49 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0A445358C54; Mon, 15 Oct 2012 17:11:48 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id DFCFF2848C; Mon, 15 Oct 2012 17:11:47 +0200 (CEST) Date: Mon, 15 Oct 2012 17:11:47 +0200 From: Jilles Tjoelker To: Gleb Smirnoff Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet Message-ID: <20121015151147.GA92923@stack.nl> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121015143658.GU89655@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 15:11:49 -0000 On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: > On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: > J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: > J> > Author: glebius > J> > Date: Sun Oct 14 15:03:06 2012 > J> > New Revision: 241546 > J> > URL: http://svn.freebsd.org/changeset/base/241546 > J> > Log: > J> > Fix defines in r241245. We actually don't define FreeBSD. > J> > Reported & tested by: Oleg Ginzburg > J> Seems like it should be using 'defined(__FreeBSD_version)' instead? > AFAIU, the construction which left after r241546 works fine. Anything > undefined resolves to zero, so in case of non-FreeBSD build we test > if (0 > 10000019) and this fails which is what we expect. > I have used this construction several times already without any side > effects. I have also seen it in some software in ports, where it works > okay, too. The C standard indeed permits this, but gcc -Wundef will warn about it. That compiler warning is in CWARNFLAGS in sys/conf/kern.mk so I suggest adding the 'defined(__FreeBSD_version) &&'. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 15:26:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 858FFC35; Mon, 15 Oct 2012 15:26:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2F68FC1C; Mon, 15 Oct 2012 15:26:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FFQ1mw016866; Mon, 15 Oct 2012 15:26:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FFQ1pL016856; Mon, 15 Oct 2012 15:26:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210151526.q9FFQ1pL016856@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Oct 2012 15:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241588 - head/sys/dev/advansys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 15:26:01 -0000 Author: jhb Date: Mon Oct 15 15:26:00 2012 New Revision: 241588 URL: http://svn.freebsd.org/changeset/base/241588 Log: Add locking to the adw(4) driver and mark it MPSAFE. - Use device_printf() and device_get_nameunit() instead of adw_name(). - Remove use of explicit bus space handles and tags. - Use pci_enable_busmaster() rather than frobbing the PCI command register directly. - Use the softc provided by new-bus rather than allocating a new one. Tested by: no one Modified: head/sys/dev/advansys/adw_pci.c head/sys/dev/advansys/adwcam.c head/sys/dev/advansys/adwlib.c head/sys/dev/advansys/adwlib.h head/sys/dev/advansys/adwvar.h Modified: head/sys/dev/advansys/adw_pci.c ============================================================================== --- head/sys/dev/advansys/adw_pci.c Mon Oct 15 14:16:25 2012 (r241587) +++ head/sys/dev/advansys/adw_pci.c Mon Oct 15 15:26:00 2012 (r241588) @@ -254,8 +254,7 @@ adw_pci_attach(device_t dev) return (error); /* Ensure busmastering is enabled */ - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1); + pci_enable_busmaster(dev); /* Allocate a dmatag for our transfer DMA maps */ error = bus_dma_tag_create( @@ -270,15 +269,15 @@ adw_pci_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADW_PCI_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adw->parent_dmat); adw->init_level++; if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adw_name(adw), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adw_free(adw); return (error); } Modified: head/sys/dev/advansys/adwcam.c ============================================================================== --- head/sys/dev/advansys/adwcam.c Mon Oct 15 14:16:25 2012 (r241587) +++ head/sys/dev/advansys/adwcam.c Mon Oct 15 15:26:00 2012 (r241588) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); #define ccb_acb_ptr spriv_ptr0 #define ccb_adw_ptr spriv_ptr1 -u_long adw_unit; - static __inline cam_status adwccbstatus(union ccb*); static __inline struct acb* adwgetacb(struct adw_softc *adw); static __inline void adwfreeacb(struct adw_softc *adw, @@ -90,6 +89,7 @@ static int adwallocacbs(struct adw_soft static void adwexecuteacb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error); static void adw_action(struct cam_sim *sim, union ccb *ccb); +static void adw_intr_locked(struct adw_softc *adw); static void adw_poll(struct cam_sim *sim); static void adw_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); @@ -110,21 +110,20 @@ static __inline struct acb* adwgetacb(struct adw_softc *adw) { struct acb* acb; - int s; - s = splcam(); + if (!dumping) + mtx_assert(&adw->lock, MA_OWNED); if ((acb = SLIST_FIRST(&adw->free_acb_list)) != NULL) { SLIST_REMOVE_HEAD(&adw->free_acb_list, links); } else if (adw->num_acbs < adw->max_acbs) { adwallocacbs(adw); acb = SLIST_FIRST(&adw->free_acb_list); if (acb == NULL) - printf("%s: Can't malloc ACB\n", adw_name(adw)); + device_printf(adw->device, "Can't malloc ACB\n"); else { SLIST_REMOVE_HEAD(&adw->free_acb_list, links); } } - splx(s); return (acb); } @@ -132,9 +131,9 @@ adwgetacb(struct adw_softc *adw) static __inline void adwfreeacb(struct adw_softc *adw, struct acb *acb) { - int s; - s = splcam(); + if (!dumping) + mtx_assert(&adw->lock, MA_OWNED); if ((acb->state & ACB_ACTIVE) != 0) LIST_REMOVE(&acb->ccb->ccb_h, sim_links.le); if ((acb->state & ACB_RELEASE_SIMQ) != 0) @@ -146,7 +145,6 @@ adwfreeacb(struct adw_softc *adw, struct } acb->state = ACB_FREE; SLIST_INSERT_HEAD(&adw->free_acb_list, acb, links); - splx(s); } static void @@ -186,7 +184,6 @@ adwallocsgmap(struct adw_softc *adw) /* * Allocate another chunk of CCB's. Return count of entries added. - * Assumed to be called at splcam(). */ static int adwallocacbs(struct adw_softc *adw) @@ -222,6 +219,7 @@ adwallocacbs(struct adw_softc *adw) next_acb->sg_blocks = blocks; next_acb->sg_busaddr = busaddr; next_acb->state = ACB_FREE; + callout_init_mtx(&next_acb->timer, &adw->lock, 0); SLIST_INSERT_HEAD(&adw->free_acb_list, next_acb, links); blocks += ADW_SG_BLOCKCNT; busaddr += ADW_SG_BLOCKCNT * sizeof(*blocks); @@ -237,16 +235,17 @@ adwexecuteacb(void *arg, bus_dma_segment struct acb *acb; union ccb *ccb; struct adw_softc *adw; - int s; acb = (struct acb *)arg; ccb = acb->ccb; adw = (struct adw_softc *)ccb->ccb_h.ccb_adw_ptr; + if (!dumping) + mtx_assert(&adw->lock, MA_OWNED); if (error != 0) { if (error != EFBIG) - printf("%s: Unexepected error 0x%x returned from " - "bus_dmamap_load\n", adw_name(adw), error); + device_printf(adw->device, "Unexepected error 0x%x " + "returned from bus_dmamap_load\n", error); if (ccb->ccb_h.status == CAM_REQ_INPROG) { xpt_freeze_devq(ccb->ccb_h.path, /*count*/1); ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN; @@ -315,8 +314,6 @@ adwexecuteacb(void *arg, bus_dma_segment acb->queue.sg_real_addr = 0; } - s = splcam(); - /* * Last time we need to check if this CCB needs to * be aborted. @@ -326,20 +323,16 @@ adwexecuteacb(void *arg, bus_dma_segment bus_dmamap_unload(adw->buffer_dmat, acb->dmamap); adwfreeacb(adw, acb); xpt_done(ccb); - splx(s); return; } acb->state |= ACB_ACTIVE; ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&adw->pending_ccbs, &ccb->ccb_h, sim_links.le); - ccb->ccb_h.timeout_ch = - timeout(adwtimeout, (caddr_t)acb, - (ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&acb->timer, (ccb->ccb_h.timeout * hz) / 1000, + adwtimeout, acb); adw_send_acb(adw, acb, acbvtob(adw, acb)); - - splx(s); } static void @@ -350,6 +343,8 @@ adw_action(struct cam_sim *sim, union cc CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("adw_action\n")); adw = (struct adw_softc *)cam_sim_softc(sim); + if (!dumping) + mtx_assert(&adw->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -370,11 +365,7 @@ adw_action(struct cam_sim *sim, union cc } if ((acb = adwgetacb(adw)) == NULL) { - int s; - - s = splcam(); adw->state |= ADW_RESOURCE_SHORTAGE; - splx(s); xpt_freeze_simq(sim, /*count*/1); ccb->ccb_h.status = CAM_REQUEUE_REQ; xpt_done(ccb); @@ -447,10 +438,8 @@ adw_action(struct cam_sim *sim, union cc * to a single buffer. */ if ((ccbh->flags & CAM_DATA_PHYS) == 0) { - int s; int error; - s = splsoftvm(); error = bus_dmamap_load(adw->buffer_dmat, acb->dmamap, @@ -468,7 +457,6 @@ adw_action(struct cam_sim *sim, union cc xpt_freeze_simq(sim, 1); acb->state |= CAM_RELEASE_SIMQ; } - splx(s); } else { struct bus_dma_segment seg; @@ -530,12 +518,10 @@ adw_action(struct cam_sim *sim, union cc struct ccb_trans_settings_spi *spi; struct ccb_trans_settings *cts; u_int target_mask; - int s; cts = &ccb->cts; target_mask = 0x01 << ccb->ccb_h.target_id; - s = splcam(); scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { @@ -647,7 +633,6 @@ adw_action(struct cam_sim *sim, union cc } } } - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -801,7 +786,7 @@ adw_action(struct cam_sim *sim, union cc static void adw_poll(struct cam_sim *sim) { - adw_intr(cam_sim_softc(sim)); + adw_intr_locked(cam_sim_softc(sim)); } static void @@ -813,33 +798,15 @@ struct adw_softc * adw_alloc(device_t dev, struct resource *regs, int regs_type, int regs_id) { struct adw_softc *adw; - int i; - - /* - * Allocate a storage area for us - */ - adw = malloc(sizeof(struct adw_softc), M_DEVBUF, M_NOWAIT | M_ZERO); - if (adw == NULL) { - printf("adw%d: cannot malloc!\n", device_get_unit(dev)); - return NULL; - } + + adw = device_get_softc(dev); LIST_INIT(&adw->pending_ccbs); SLIST_INIT(&adw->sg_maps); + mtx_init(&adw->lock, "adw", NULL, MTX_DEF); adw->device = dev; - adw->unit = device_get_unit(dev); adw->regs_res_type = regs_type; adw->regs_res_id = regs_id; adw->regs = regs; - adw->tag = rman_get_bustag(regs); - adw->bsh = rman_get_bushandle(regs); - i = adw->unit / 10; - adw->name = malloc(sizeof("adw") + i + 1, M_DEVBUF, M_NOWAIT); - if (adw->name == NULL) { - printf("adw%d: cannot malloc name!\n", adw->unit); - free(adw, M_DEVBUF); - return NULL; - } - sprintf(adw->name, "adw%d", adw->unit); return(adw); } @@ -904,8 +871,7 @@ adw_free(struct adw_softc *adw) xpt_bus_deregister(cam_sim_path(adw->sim)); cam_sim_free(adw->sim, /*free_devq*/TRUE); } - free(adw->name, M_DEVBUF); - free(adw, M_DEVBUF); + mtx_destroy(&adw->lock); } int @@ -924,8 +890,8 @@ adw_init(struct adw_softc *adw) u_int16_t serial_number[3]; adw->flags |= ADW_EEPROM_FAILED; - printf("%s: EEPROM checksum failed. Restoring Defaults\n", - adw_name(adw)); + device_printf(adw->device, + "EEPROM checksum failed. Restoring Defaults\n"); /* * Restore the default EEPROM settings. @@ -1004,10 +970,10 @@ adw_init(struct adw_softc *adw) if ((adw->features & ADW_ULTRA2) != 0) { switch (eep_config.termination_lvd) { default: - printf("%s: Invalid EEPROM LVD Termination Settings.\n", - adw_name(adw)); - printf("%s: Reverting to Automatic LVD Termination\n", - adw_name(adw)); + device_printf(adw->device, + "Invalid EEPROM LVD Termination Settings.\n"); + device_printf(adw->device, + "Reverting to Automatic LVD Termination\n"); /* FALLTHROUGH */ case ADW_EEPROM_TERM_AUTO: break; @@ -1025,10 +991,10 @@ adw_init(struct adw_softc *adw) switch (eep_config.termination_se) { default: - printf("%s: Invalid SE EEPROM Termination Settings.\n", - adw_name(adw)); - printf("%s: Reverting to Automatic SE Termination\n", - adw_name(adw)); + device_printf(adw->device, + "Invalid SE EEPROM Termination Settings.\n"); + device_printf(adw->device, + "Reverting to Automatic SE Termination\n"); /* FALLTHROUGH */ case ADW_EEPROM_TERM_AUTO: break; @@ -1042,7 +1008,7 @@ adw_init(struct adw_softc *adw) scsicfg1 |= ADW_SCSI_CFG1_TERM_CTL_MANUAL; break; } - printf("%s: SCSI ID %d, ", adw_name(adw), adw->initiator_id); + device_printf(adw->device, "SCSI ID %d, ", adw->initiator_id); /* DMA tag for mapping buffers into device visible space. */ if (bus_dma_tag_create( @@ -1058,7 +1024,7 @@ adw_init(struct adw_softc *adw) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &adw->lock, &adw->buffer_dmat) != 0) { return (ENOMEM); } @@ -1080,8 +1046,8 @@ adw_init(struct adw_softc *adw) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adw->carrier_dmat) != 0) { return (ENOMEM); } @@ -1141,8 +1107,8 @@ adw_init(struct adw_softc *adw) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adw->acb_dmat) != 0) { return (ENOMEM); } @@ -1178,8 +1144,8 @@ adw_init(struct adw_softc *adw) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adw->sg_dmat) != 0) { return (ENOMEM); } @@ -1187,13 +1153,19 @@ adw_init(struct adw_softc *adw) adw->init_level++; /* Allocate our first batch of ccbs */ - if (adwallocacbs(adw) == 0) + mtx_lock(&adw->lock); + if (adwallocacbs(adw) == 0) { + mtx_unlock(&adw->lock); return (ENOMEM); + } - if (adw_init_chip(adw, scsicfg1) != 0) + if (adw_init_chip(adw, scsicfg1) != 0) { + mtx_unlock(&adw->lock); return (ENXIO); + } printf("Queue Depth %d\n", adw->max_acbs); + mtx_unlock(&adw->lock); return (0); } @@ -1206,18 +1178,16 @@ adw_attach(struct adw_softc *adw) { struct ccb_setasync csa; struct cam_devq *devq; - int s; int error; - error = 0; - s = splcam(); /* Hook up our interrupt handler */ - if ((error = bus_setup_intr(adw->device, adw->irq, - INTR_TYPE_CAM | INTR_ENTROPY, NULL, - adw_intr, adw, &adw->ih)) != 0) { + error = bus_setup_intr(adw->device, adw->irq, + INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE, NULL, adw_intr, adw, + &adw->ih); + if (error != 0) { device_printf(adw->device, "bus_setup_intr() failed: %d\n", error); - goto fail; + return (error); } /* Start the Risc processor now that we are fully configured. */ @@ -1233,16 +1203,15 @@ adw_attach(struct adw_softc *adw) /* * Construct our SIM entry. */ - adw->sim = cam_sim_alloc(adw_action, adw_poll, "adw", adw, adw->unit, - &Giant, 1, adw->max_acbs, devq); - if (adw->sim == NULL) { - error = ENOMEM; - goto fail; - } + adw->sim = cam_sim_alloc(adw_action, adw_poll, "adw", adw, + device_get_unit(adw->device), &adw->lock, 1, adw->max_acbs, devq); + if (adw->sim == NULL) + return (ENOMEM); /* * Register the bus. */ + mtx_lock(&adw->lock); if (xpt_bus_register(adw->sim, adw->device, 0) != CAM_SUCCESS) { cam_sim_free(adw->sim, /*free devq*/TRUE); error = ENOMEM; @@ -1261,7 +1230,7 @@ adw_attach(struct adw_softc *adw) } fail: - splx(s); + mtx_unlock(&adw->lock); return (error); } @@ -1269,9 +1238,18 @@ void adw_intr(void *arg) { struct adw_softc *adw; + + adw = arg; + mtx_lock(&adw->lock); + adw_intr_locked(adw); + mtx_unlock(&adw->lock); +} + +void +adw_intr_locked(struct adw_softc *adw) +{ u_int int_stat; - adw = (struct adw_softc *)arg; if ((adw_inw(adw, ADW_CTRL_REG) & ADW_CTRL_REG_HOST_INTR) == 0) return; @@ -1296,7 +1274,7 @@ adw_intr(void *arg) /* * The firmware detected a SCSI Bus reset. */ - printf("Someone Reset the Bus\n"); + device_printf(adw->device, "Someone Reset the Bus\n"); adw_handle_bus_reset(adw, /*initiated*/FALSE); break; case ADW_ASYNC_RDMA_FAILURE: @@ -1356,7 +1334,7 @@ adw_intr(void *arg) /* Process CCB */ ccb = acb->ccb; - untimeout(adwtimeout, acb, ccb->ccb_h.timeout_ch); + callout_stop(&acb->timer); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; @@ -1433,6 +1411,7 @@ adwprocesserror(struct adw_softc *adw, s break; case QHSTA_M_QUEUE_ABORTED: /* BDR or Bus Reset */ + xpt_print_path(adw->path); printf("Saw Queue Aborted\n"); ccb->ccb_h.status = adw->last_reset; break; @@ -1446,7 +1425,7 @@ adwprocesserror(struct adw_softc *adw, s { /* The SCSI bus hung in a phase */ xpt_print_path(adw->path); - printf("Watch Dog timer expired. Reseting bus\n"); + printf("Watch Dog timer expired. Resetting bus\n"); adw_reset_bus(adw); break; } @@ -1475,7 +1454,8 @@ adwprocesserror(struct adw_softc *adw, s break; default: panic("%s: Unhandled Host status error %x", - adw_name(adw), acb->queue.host_status); + device_get_nameunit(adw->device), + acb->queue.host_status); /* NOTREACHED */ } } @@ -1500,7 +1480,6 @@ adwtimeout(void *arg) struct adw_softc *adw; adw_idle_cmd_status_t status; int target_id; - int s; acb = (struct acb *)arg; ccb = acb->ccb; @@ -1508,13 +1487,12 @@ adwtimeout(void *arg) xpt_print_path(ccb->ccb_h.path); printf("ACB %p - timed out\n", (void *)acb); - s = splcam(); + mtx_assert(&adw->lock, MA_OWNED); if ((acb->state & ACB_ACTIVE) == 0) { xpt_print_path(ccb->ccb_h.path); printf("ACB %p - timed out CCB already completed\n", (void *)acb); - splx(s); return; } @@ -1524,10 +1502,9 @@ adwtimeout(void *arg) /* Attempt a BDR first */ status = adw_idle_cmd_send(adw, ADW_IDLE_CMD_DEVICE_RESET, ccb->ccb_h.target_id); - splx(s); if (status == ADW_IDLE_CMD_SUCCESS) { - printf("%s: BDR Delivered. No longer in timeout\n", - adw_name(adw)); + device_printf(adw->device, + "BDR Delivered. No longer in timeout\n"); adw_handle_device_reset(adw, target_id); } else { adw_reset_bus(adw); Modified: head/sys/dev/advansys/adwlib.c ============================================================================== --- head/sys/dev/advansys/adwlib.c Mon Oct 15 14:16:25 2012 (r241587) +++ head/sys/dev/advansys/adwlib.c Mon Oct 15 15:26:00 2012 (r241588) @@ -46,8 +46,12 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include #include +#include #include @@ -198,6 +202,8 @@ adw_reset_bus(struct adw_softc *adw) { adw_idle_cmd_status_t status; + if (!dumping) + mtx_assert(&adw->lock, MA_OWNED); status = adw_idle_cmd_send(adw, ADW_IDLE_CMD_SCSI_RESET_START, /*param*/0); if (status != ADW_IDLE_CMD_SUCCESS) { @@ -249,7 +255,8 @@ adw_eeprom_wait(struct adw_softc *adw) DELAY(1000); } if (i == ADW_EEP_DELAY_MS) - panic("%s: Timedout Reading EEPROM", adw_name(adw)); + panic("%s: Timedout Reading EEPROM", + device_get_nameunit(adw->device)); } /* @@ -473,7 +480,7 @@ adw_init_chip(struct adw_softc *adw, u_i checksum += adw_inw(adw, ADW_RAM_DATA); if (checksum != adw->mcode_data->mcode_chksum) { - printf("%s: Firmware load failed!\n", adw_name(adw)); + device_printf(adw->device, "Firmware load failed!\n"); return (EIO); } @@ -550,8 +557,8 @@ adw_init_chip(struct adw_softc *adw, u_i * this condition is found. */ if ((adw_inw(adw, ADW_SCSI_CTRL) & 0x3F07) == 0x3F07) { - printf("%s: Illegal Cable Config!\n", adw_name(adw)); - printf("%s: Internal cable is reversed!\n", adw_name(adw)); + device_printf(adw->device, "Illegal Cable Config!\n"); + device_printf(adw->device, "Internal cable is reversed!\n"); return (EIO); } @@ -562,17 +569,17 @@ adw_init_chip(struct adw_softc *adw, u_i if ((adw->features & ADW_ULTRA) != 0) { if ((scsicfg1 & ADW_SCSI_CFG1_DIFF_MODE) != 0 && (scsicfg1 & ADW_SCSI_CFG1_DIFF_SENSE) == 0) { - printf("%s: A Single Ended Device is attached to our " - "differential bus!\n", adw_name(adw)); + device_printf(adw->device, "A Single Ended Device is " + "attached to our differential bus!\n"); return (EIO); } } else { if ((scsicfg1 & ADW2_SCSI_CFG1_DEV_DETECT_HVD) != 0) { - printf("%s: A High Voltage Differential Device " - "is attached to this controller.\n", - adw_name(adw)); - printf("%s: HVD devices are not supported.\n", - adw_name(adw)); + device_printf(adw->device, + "A High Voltage Differential Device " + "is attached to this controller.\n"); + device_printf(adw->device, + "HVD devices are not supported.\n"); return (EIO); } } @@ -647,10 +654,10 @@ adw_init_chip(struct adw_softc *adw, u_i cable_count++; if (cable_count == 3) { - printf("%s: Illegal Cable Config!\n", - adw_name(adw)); - printf("%s: Only Two Ports may be used at " - "a time!\n", adw_name(adw)); + device_printf(adw->device, + "Illegal Cable Config!\n"); + device_printf(adw->device, + "Only Two Ports may be used at a time!\n"); } else if (cable_count <= 1) { /* * At least two out of three cables missing. @@ -852,9 +859,9 @@ adw_idle_cmd_send(struct adw_softc *adw, { u_int timeout; adw_idle_cmd_status_t status; - int s; - s = splcam(); + if (!dumping) + mtx_assert(&adw->lock, MA_OWNED); /* * Clear the idle command status which is set by the microcode @@ -886,7 +893,7 @@ adw_idle_cmd_send(struct adw_softc *adw, } if (timeout == 0) - panic("%s: Idle Command Timed Out!\n", adw_name(adw)); - splx(s); + panic("%s: Idle Command Timed Out!", + device_get_nameunit(adw->device)); return (status); } Modified: head/sys/dev/advansys/adwlib.h ============================================================================== --- head/sys/dev/advansys/adwlib.h Mon Oct 15 14:16:25 2012 (r241587) +++ head/sys/dev/advansys/adwlib.h Mon Oct 15 15:26:00 2012 (r241588) @@ -421,6 +421,7 @@ struct acb { acb_state state; union ccb *ccb; struct adw_sg_block* sg_blocks; + struct callout timer; bus_addr_t sg_busaddr; struct scsi_sense_data sense_data; SLIST_ENTRY(acb) links; @@ -601,8 +602,7 @@ struct adw_syncrate #define ADW_NUM_CARRIER_QUEUES 2 struct adw_softc { - bus_space_tag_t tag; - bus_space_handle_t bsh; + struct resource *res; adw_state state; bus_dma_tag_t buffer_dmat; struct acb *acbs; @@ -626,6 +626,7 @@ struct adw_softc adw_flag flags; u_int memsize; char channel; + struct mtx lock; struct cam_path *path; struct cam_sim *sim; struct resource *regs; @@ -641,8 +642,6 @@ struct adw_softc u_int num_acbs; u_int initiator_id; u_int init_level; - u_int unit; - char* name; cam_status last_reset; /* Last reset type */ u_int16_t bios_ctrl; u_int16_t user_wdtr; @@ -659,23 +658,22 @@ extern const struct adw_syncrate adw_syn extern const int adw_num_syncrates; #define adw_inb(adw, port) \ - bus_space_read_1((adw)->tag, (adw)->bsh, port) + bus_read_1((adw)->res, port) #define adw_inw(adw, port) \ - bus_space_read_2((adw)->tag, (adw)->bsh, port) + bus_read_2((adw)->res, port) #define adw_inl(adw, port) \ - bus_space_read_4((adw)->tag, (adw)->bsh, port) + bus_read_4((adw)->res, port) #define adw_outb(adw, port, value) \ - bus_space_write_1((adw)->tag, (adw)->bsh, port, value) + bus_write_1((adw)->res, port, value) #define adw_outw(adw, port, value) \ - bus_space_write_2((adw)->tag, (adw)->bsh, port, value) + bus_write_2((adw)->res, port, value) #define adw_outl(adw, port, value) \ - bus_space_write_4((adw)->tag, (adw)->bsh, port, value) + bus_write_4((adw)->res, port, value) #define adw_set_multi_2(adw, port, value, count) \ - bus_space_set_multi_2((adw)->tag, (adw)->bsh, port, value, count) + bus_set_multi_2((adw)->res, port, value, count) -static __inline const char* adw_name(struct adw_softc *adw); static __inline u_int adw_lram_read_8(struct adw_softc *adw, u_int addr); static __inline u_int adw_lram_read_16(struct adw_softc *adw, u_int addr); static __inline u_int adw_lram_read_32(struct adw_softc *adw, u_int addr); @@ -705,12 +703,6 @@ static __inline struct adw_carrier * carrierbtov(struct adw_softc *adw, u_int32_t baddr); -static __inline const char* -adw_name(struct adw_softc *adw) -{ - return (adw->name); -} - static __inline u_int adw_lram_read_8(struct adw_softc *adw, u_int addr) { Modified: head/sys/dev/advansys/adwvar.h ============================================================================== --- head/sys/dev/advansys/adwvar.h Mon Oct 15 14:16:25 2012 (r241587) +++ head/sys/dev/advansys/adwvar.h Mon Oct 15 15:26:00 2012 (r241588) @@ -49,7 +49,6 @@ int adw_attach(struct adw_softc *adw); void adw_done(struct adw_softc *adw, union ccb* ccb, u_int done_stat, u_int host_stat, u_int scsi_stat, u_int q_no); -timeout_t adw_timeout; +void adw_timeout(void *arg); -extern u_long adw_unit; #endif /* _ADWVAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 15:59:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B822C2A; Mon, 15 Oct 2012 15:59:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F778FC0C; Mon, 15 Oct 2012 15:59:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FFxEe6022014; Mon, 15 Oct 2012 15:59:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FFxEtg022008; Mon, 15 Oct 2012 15:59:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210151559.q9FFxEtg022008@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Oct 2012 15:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241589 - head/sys/dev/aha X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 15:59:14 -0000 Author: jhb Date: Mon Oct 15 15:59:13 2012 New Revision: 241589 URL: http://svn.freebsd.org/changeset/base/241589 Log: Add locking to the aha(4) driver and mark it MPSAFE. - Remove use of explicit bus space handles and tags. Tested by: no one Modified: head/sys/dev/aha/aha.c head/sys/dev/aha/aha_isa.c head/sys/dev/aha/aha_mca.c head/sys/dev/aha/ahareg.h Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Mon Oct 15 15:26:00 2012 (r241588) +++ head/sys/dev/aha/aha.c Mon Oct 15 15:59:13 2012 (r241589) @@ -147,6 +147,7 @@ static void ahaallocccbs(struct aha_sof static bus_dmamap_callback_t ahaexecuteccb; static void ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_code); +static void aha_intr_locked(struct aha_softc *aha); /* Host adapter command functions */ static int ahareset(struct aha_softc* aha, int hard_reset); @@ -168,7 +169,7 @@ static void ahaaction(struct cam_sim *si static void ahapoll(struct cam_sim *sim); /* Our timeout handler */ -static timeout_t ahatimeout; +static void ahatimeout(void *arg); /* Exported functions */ void @@ -179,11 +180,9 @@ aha_alloc(struct aha_softc *aha, int uni SLIST_INIT(&aha->free_aha_ccbs); LIST_INIT(&aha->pending_ccbs); SLIST_INIT(&aha->sg_maps); - aha->unit = unit; - aha->tag = tag; - aha->bsh = bsh; aha->ccb_sg_opcode = INITIATOR_SG_CCB_WRESID; aha->ccb_ccb_opcode = INITIATOR_CCB_WRESID; + mtx_init(&aha->lock, "aha", NULL, MTX_DEF); } void @@ -225,6 +224,7 @@ aha_free(struct aha_softc *aha) case 0: break; } + mtx_destroy(&aha->lock); } /* @@ -464,7 +464,7 @@ aha_init(struct aha_softc* aha) /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &aha->lock, &aha->buffer_dmat) != 0) { goto error_exit; } @@ -484,8 +484,8 @@ aha_init(struct aha_softc* aha) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &aha->mailbox_dmat) != 0) { goto error_exit; } @@ -523,8 +523,8 @@ aha_init(struct aha_softc* aha) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &aha->ccb_dmat) != 0) { goto error_exit; } @@ -556,8 +556,8 @@ aha_init(struct aha_softc* aha) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &aha->sg_dmat) != 0) goto error_exit; @@ -605,22 +605,27 @@ aha_attach(struct aha_softc *aha) /* * Construct our SIM entry */ - aha->sim = cam_sim_alloc(ahaaction, ahapoll, "aha", aha, aha->unit, - &Giant, 2, tagged_dev_openings, devq); + aha->sim = cam_sim_alloc(ahaaction, ahapoll, "aha", aha, + device_get_unit(aha->dev), &aha->lock, 2, tagged_dev_openings, + devq); if (aha->sim == NULL) { cam_simq_free(devq); return (ENOMEM); } + mtx_lock(&aha->lock); if (xpt_bus_register(aha->sim, aha->dev, 0) != CAM_SUCCESS) { cam_sim_free(aha->sim, /*free_devq*/TRUE); + mtx_unlock(&aha->lock); return (ENXIO); } if (xpt_create_path(&aha->path, /*periph*/NULL, cam_sim_path(aha->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(aha->sim)); cam_sim_free(aha->sim, /*free_devq*/TRUE); + mtx_unlock(&aha->lock); return (ENXIO); } + mtx_unlock(&aha->lock); return (0); } @@ -664,6 +669,7 @@ ahaallocccbs(struct aha_softc *aha) next_ccb->sg_list = segs; next_ccb->sg_list_phys = physaddr; next_ccb->flags = ACCB_FREE; + callout_init_mtx(&next_ccb->timer, &aha->lock, 0); error = bus_dmamap_create(aha->buffer_dmat, /*flags*/0, &next_ccb->dmamap); if (error != 0) @@ -685,9 +691,9 @@ ahaallocccbs(struct aha_softc *aha) static __inline void ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb) { - int s; - s = splcam(); + if (!dumping) + mtx_assert(&aha->lock, MA_OWNED); if ((accb->flags & ACCB_ACTIVE) != 0) LIST_REMOVE(&accb->ccb->ccb_h, sim_links.le); if (aha->resource_shortage != 0 @@ -698,16 +704,15 @@ ahafreeccb(struct aha_softc *aha, struct accb->flags = ACCB_FREE; SLIST_INSERT_HEAD(&aha->free_aha_ccbs, accb, links); aha->active_ccbs--; - splx(s); } static struct aha_ccb* ahagetccb(struct aha_softc *aha) { struct aha_ccb* accb; - int s; - s = splcam(); + if (!dumping) + mtx_assert(&aha->lock, MA_OWNED); if ((accb = SLIST_FIRST(&aha->free_aha_ccbs)) != NULL) { SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links); aha->active_ccbs++; @@ -721,7 +726,6 @@ ahagetccb(struct aha_softc *aha) aha->active_ccbs++; } } - splx(s); return (accb); } @@ -730,11 +734,11 @@ static void ahaaction(struct cam_sim *sim, union ccb *ccb) { struct aha_softc *aha; - int s; CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahaaction\n")); aha = (struct aha_softc *)cam_sim_softc(sim); + mtx_assert(&aha->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -747,9 +751,7 @@ ahaaction(struct cam_sim *sim, union ccb * Get an accb to use. */ if ((accb = ahagetccb(aha)) == NULL) { - s = splcam(); aha->resource_shortage = TRUE; - splx(s); xpt_freeze_simq(aha->sim, /*count*/1); ccb->ccb_h.status = CAM_REQUEUE_REQ; xpt_done(ccb); @@ -818,7 +820,6 @@ ahaaction(struct cam_sim *sim, union ccb if ((ccbh->flags & CAM_DATA_PHYS)==0) { int error; - s = splsoftvm(); error = bus_dmamap_load( aha->buffer_dmat, accb->dmamap, @@ -840,7 +841,6 @@ ahaaction(struct cam_sim *sim, union ccb csio->ccb_h.status |= CAM_RELEASE_SIMQ; } - splx(s); } else { struct bus_dma_segment seg; @@ -1017,7 +1017,6 @@ ahaexecuteccb(void *arg, bus_dma_segment struct aha_ccb *accb; union ccb *ccb; struct aha_softc *aha; - int s; uint32_t paddr; accb = (struct aha_ccb *)arg; @@ -1077,8 +1076,6 @@ ahaexecuteccb(void *arg, bus_dma_segment ahautoa24(0, accb->hccb.data_addr); } - s = splcam(); - /* * Last time we need to check if this CCB needs to * be aborted. @@ -1088,7 +1085,6 @@ ahaexecuteccb(void *arg, bus_dma_segment bus_dmamap_unload(aha->buffer_dmat, accb->dmamap); ahafreeccb(aha, accb); xpt_done(ccb); - splx(s); return; } @@ -1096,8 +1092,8 @@ ahaexecuteccb(void *arg, bus_dma_segment ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&aha->pending_ccbs, &ccb->ccb_h, sim_links.le); - ccb->ccb_h.timeout_ch = timeout(ahatimeout, (caddr_t)accb, - (ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&accb->timer, (ccb->ccb_h.timeout * hz) / 1000, + ahatimeout, accb); /* Tell the adapter about this command */ if (aha->cur_outbox->action_code != AMBO_FREE) { @@ -1111,7 +1107,7 @@ ahaexecuteccb(void *arg, bus_dma_segment device_printf(aha->dev, "Encountered busy mailbox with %d out of %d " "commands active!!!", aha->active_ccbs, aha->max_ccbs); - untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch); + callout_stop(&aacb->timer); if (nseg != 0) bus_dmamap_unload(aha->buffer_dmat, accb->dmamap); ahafreeccb(aha, accb); @@ -1127,17 +1123,25 @@ ahaexecuteccb(void *arg, bus_dma_segment aha_outb(aha, COMMAND_REG, AOP_START_MBOX); ahanextoutbox(aha); - splx(s); } void aha_intr(void *arg) { struct aha_softc *aha; + + aha = arg; + mtx_lock(&aha->lock); + aha_intr_locked(aha); + mtx_unlock(&aha->lock); +} + +void +aha_intr_locked(struct aha_softc *aha) +{ u_int intstat; uint32_t paddr; - aha = (struct aha_softc *)arg; while (((intstat = aha_inb(aha, INTSTAT_REG)) & INTR_PENDING) != 0) { if ((intstat & CMD_COMPLETE) != 0) { aha->latched_status = aha_inb(aha, STATUS_REG); @@ -1220,9 +1224,9 @@ ahadone(struct aha_softc *aha, struct ah ccb_h = LIST_NEXT(ccb_h, sim_links.le); ahadone(aha, pending_accb, AMBI_ERROR); } else { - ccb_h->timeout_ch = timeout(ahatimeout, - (caddr_t)pending_accb, - (ccb_h->timeout * hz) / 1000); + callout_reset(&pending_accb->timer, + (ccb_h->timeout * hz) / 1000, + ahatimeout, pending_accb); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } } @@ -1230,7 +1234,7 @@ ahadone(struct aha_softc *aha, struct ah return; } - untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch); + callout_stop(&accb->timer); switch (comp_code) { case AMBI_FREE: @@ -1446,7 +1450,6 @@ aha_cmd(struct aha_softc *aha, aha_op_t u_int saved_status; u_int intstat; u_int reply_buf_size; - int s; int cmd_complete; int error; @@ -1465,15 +1468,11 @@ aha_cmd(struct aha_softc *aha, aha_op_t * and wait for all completions to occur if necessary. */ timeout = 10000; - s = splcam(); while (LIST_FIRST(&aha->pending_ccbs) != NULL && --timeout) { /* Fire the interrupt handler in case interrupts are blocked */ aha_intr(aha); - splx(s); DELAY(10); - s = splcam(); } - splx(s); if (timeout == 0) { device_printf(aha->dev, @@ -1516,10 +1515,8 @@ aha_cmd(struct aha_softc *aha, aha_op_t timeout = 10000; while (param_len && --timeout) { DELAY(100); - s = splcam(); status = aha_inb(aha, STATUS_REG); intstat = aha_inb(aha, INTSTAT_REG); - splx(s); if ((intstat & (INTR_PENDING|CMD_COMPLETE)) == (INTR_PENDING|CMD_COMPLETE)) { @@ -1553,10 +1550,8 @@ aha_cmd(struct aha_softc *aha, aha_op_t */ while (cmd_complete == 0 && --cmd_timeout) { - s = splcam(); status = aha_inb(aha, STATUS_REG); intstat = aha_inb(aha, INTSTAT_REG); - splx(s); if (aha->command_cmp != 0) { cmd_complete = 1; @@ -1601,9 +1596,7 @@ aha_cmd(struct aha_softc *aha, aha_op_t * Clear any pending interrupts. Block interrupts so our * interrupt handler is not re-entered. */ - s = splcam(); aha_intr(aha); - splx(s); if (error != 0) return (error); @@ -1764,7 +1757,7 @@ ahamapsgs(void *arg, bus_dma_segment_t * static void ahapoll(struct cam_sim *sim) { - aha_intr(cam_sim_softc(sim)); + aha_intr_locked(cam_sim_softc(sim)); } static void @@ -1773,23 +1766,20 @@ ahatimeout(void *arg) struct aha_ccb *accb; union ccb *ccb; struct aha_softc *aha; - int s; uint32_t paddr; struct ccb_hdr *ccb_h; accb = (struct aha_ccb *)arg; ccb = accb->ccb; aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr; + mtx_assert(&aha->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("CCB %p - timed out\n", (void *)accb); - s = splcam(); - if ((accb->flags & ACCB_ACTIVE) == 0) { xpt_print_path(ccb->ccb_h.path); printf("CCB %p - timed out CCB already completed\n", (void *)accb); - splx(s); return; } @@ -1814,7 +1804,7 @@ ahatimeout(void *arg) struct aha_ccb *pending_accb; pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr; - untimeout(ahatimeout, pending_accb, ccb_h->timeout_ch); + callout_stop(&pending_accb->timer); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } } @@ -1843,7 +1833,7 @@ ahatimeout(void *arg) * later which will attempt a bus reset. */ accb->flags |= ACCB_DEVICE_RESET; - ccb->ccb_h.timeout_ch = timeout(ahatimeout, (caddr_t)accb, 2 * hz); + callout_reset(&aacb->timer, 2 * hz, ahatimeout, accb); aha->recovery_accb->hccb.opcode = INITIATOR_BUS_DEV_RESET; /* No Data Transfer */ @@ -1860,17 +1850,18 @@ ahatimeout(void *arg) aha_outb(aha, COMMAND_REG, AOP_START_MBOX); ahanextoutbox(aha); } - - splx(s); } int aha_detach(struct aha_softc *aha) { + mtx_lock(&aha->lock); xpt_async(AC_LOST_DEVICE, aha->path, NULL); xpt_free_path(aha->path); xpt_bus_deregister(cam_sim_path(aha->sim)); cam_sim_free(aha->sim, /*free_devq*/TRUE); + mtx_unlock(&aha->lock); + /* XXX: Drain all timers? */ return (0); } MODULE_DEPEND(aha, cam, 1, 1, 1); Modified: head/sys/dev/aha/aha_isa.c ============================================================================== --- head/sys/dev/aha/aha_isa.c Mon Oct 15 15:26:00 2012 (r241588) +++ head/sys/dev/aha/aha_isa.c Mon Oct 15 15:59:13 2012 (r241589) @@ -109,7 +109,6 @@ aha_isa_probe(device_t dev) struct aha_softc *aha = device_get_softc(dev); int error; u_long port_start; - struct resource *port_res; int port_rid; int drq; int irq; @@ -121,20 +120,19 @@ aha_isa_probe(device_t dev) return (ENXIO); port_rid = 0; - port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, - 0, ~0, AHA_NREGS, RF_ACTIVE); + aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, + 0ul, ~0ul, AHA_NREGS, RF_ACTIVE); - if (port_res == NULL) + if (aha->port == NULL) return (ENXIO); port_start = rman_get_start(port_res); - aha_alloc(aha, device_get_unit(dev), rman_get_bustag(port_res), - rman_get_bushandle(port_res)); + aha_alloc(aha); /* See if there is really a card present */ if (aha_probe(aha) || aha_fetch_adapter_info(aha)) { aha_free(aha); - bus_release_resource(dev, SYS_RES_IOPORT, port_rid, port_res); + bus_release_resource(dev, SYS_RES_IOPORT, port_rid, aha->port); return (ENXIO); } @@ -151,11 +149,12 @@ aha_isa_probe(device_t dev) (uintmax_t)port_start); aha_free(aha); bus_release_resource(dev, SYS_RES_IOPORT, port_rid, - port_res); + aha->port); return (ENXIO); } - bus_release_resource(dev, SYS_RES_IOPORT, port_rid, port_res); + bus_release_resource(dev, SYS_RES_IOPORT, port_rid, aha->port); + aha->port = NULL; switch (config_data.dma_chan) { case DMA_CHAN_5: @@ -188,17 +187,12 @@ static int aha_isa_attach(device_t dev) { struct aha_softc *aha = device_get_softc(dev); - bus_dma_filter_t *filter; - void *filter_arg; - bus_addr_t lowaddr; - void *ih; int error = ENOMEM; - int aha_free_needed = 0; aha->dev = dev; aha->portrid = 0; aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid, - 0, ~0, AHA_NREGS, RF_ACTIVE); + 0ul, ~0ul, AHA_NREGS, RF_ACTIVE); if (!aha->port) { device_printf(dev, "Unable to allocate I/O ports\n"); goto fail; @@ -227,23 +221,19 @@ aha_isa_attach(device_t dev) isa_dmacascade(rman_get_start(aha->drq)); /* Allocate our parent dmatag */ - filter = NULL; - filter_arg = NULL; - lowaddr = BUS_SPACE_MAXADDR_24BIT; - if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, - /* lowaddr */ lowaddr, + /* lowaddr */ BUS_SPACE_MAXADDR_24BIT, /* highaddr */ BUS_SPACE_MAXADDR, - /* filter */ filter, - /* filterarg */ filter_arg, + /* filter */ NULL, + /* filterarg */ NULL, /* maxsize */ BUS_SPACE_MAXSIZE_24BIT, /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &aha->parent_dmat) != 0) { device_printf(dev, "dma tag create failed.\n"); goto fail; @@ -263,7 +253,6 @@ aha_isa_attach(device_t dev) aha->ccb_sg_opcode = INITIATOR_SG_CCB; aha->ccb_ccb_opcode = INITIATOR_CCB; } - aha_free_needed++; error = aha_attach(aha); if (error) { @@ -271,20 +260,20 @@ aha_isa_attach(device_t dev) goto fail; } - error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY, - NULL, aha_intr, aha, &ih); + error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY| + INTR_MPSAFE, NULL, aha_intr, aha, &aha->ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); + aha_detach(aha); goto fail; } return (0); fail: ; + aha_free(aha); bus_free_resource(dev, SYS_RES_IOPORT, aha->port); bus_free_resource(dev, SYS_RES_IRQ, aha->irq); bus_free_resource(dev, SYS_RES_DRQ, aha->drq); - if (aha_free_needed) - aha_free(aha); return (error); } @@ -298,16 +287,15 @@ aha_isa_detach(device_t dev) if (error) device_printf(dev, "failed to unregister interrupt handler\n"); - bus_free_resource(dev, SYS_RES_IOPORT, aha->port); - bus_free_resource(dev, SYS_RES_IRQ, aha->irq); - bus_free_resource(dev, SYS_RES_DRQ, aha->drq); - error = aha_detach(aha); if (error) { device_printf(dev, "detach failed\n"); return (error); } aha_free(aha); + bus_free_resource(dev, SYS_RES_IOPORT, aha->port); + bus_free_resource(dev, SYS_RES_IRQ, aha->irq); + bus_free_resource(dev, SYS_RES_DRQ, aha->drq); return (0); } @@ -319,7 +307,6 @@ aha_isa_identify(driver_t *driver, devic bus_addr_t ioport; struct aha_softc aha; int rid; - struct resource *res; device_t child; /* Attempt to find an adapter */ @@ -334,12 +321,11 @@ aha_isa_identify(driver_t *driver, devic * XXX kldload/kldunload. */ rid = 0; - res = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, + aha->port = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, ioport, ioport, AHA_NREGS, RF_ACTIVE); - if (res == NULL) + if (aha->port == NULL) continue; - aha_alloc(&aha, -1, rman_get_bustag(res), - rman_get_bushandle(res)); + aha_alloc(&aha); /* See if there is really a card present */ if (aha_probe(&aha) || aha_fetch_adapter_info(&aha)) goto not_this_one; @@ -350,7 +336,7 @@ aha_isa_identify(driver_t *driver, devic * that. */ not_this_one:; - bus_release_resource(parent, SYS_RES_IOPORT, rid, res); + bus_release_resource(parent, SYS_RES_IOPORT, rid, aha->port); aha_free(&aha); } } Modified: head/sys/dev/aha/aha_mca.c ============================================================================== --- head/sys/dev/aha/aha_mca.c Mon Oct 15 15:26:00 2012 (r241588) +++ head/sys/dev/aha/aha_mca.c Mon Oct 15 15:59:13 2012 (r241589) @@ -118,8 +118,6 @@ aha_mca_attach (device_t dev) { struct aha_softc * sc = device_get_softc(dev); int error = ENOMEM; - int unit = device_get_unit(dev); - void * ih; sc->portrid = 0; sc->port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->portrid, @@ -145,8 +143,7 @@ aha_mca_attach (device_t dev) goto bad; } - aha_alloc(sc, unit, rman_get_bustag(sc->port), - rman_get_bushandle(sc->port)); + aha_alloc(sc); error = aha_probe(sc); if (error) { device_printf(dev, "aha_probe() failed!\n"); @@ -173,8 +170,8 @@ aha_mca_attach (device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &sc->parent_dmat); if (error) { device_printf(dev, "bus_dma_tag_create() failed!\n"); @@ -193,10 +190,11 @@ aha_mca_attach (device_t dev) goto bad; } - error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY, - NULL, aha_intr, sc, &ih); + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); + aha_detach(sc); goto bad; } Modified: head/sys/dev/aha/ahareg.h ============================================================================== --- head/sys/dev/aha/ahareg.h Mon Oct 15 15:26:00 2012 (r241588) +++ head/sys/dev/aha/ahareg.h Mon Oct 15 15:59:13 2012 (r241589) @@ -297,6 +297,7 @@ struct aha_ccb { uint32_t flags; union ccb *ccb; bus_dmamap_t dmamap; + struct callout timer; aha_sg_t *sg_list; uint32_t sg_list_phys; }; @@ -309,8 +310,6 @@ struct sg_map_node { }; struct aha_softc { - bus_space_tag_t tag; - bus_space_handle_t bsh; struct cam_sim *sim; struct cam_path *path; aha_mbox_out_t *cur_outbox; @@ -368,11 +367,12 @@ struct aha_softc { struct resource *irq; struct resource *port; struct resource *drq; - int irqrid; - int portrid; - int drqrid; + int irqrid; + int portrid; + int drqrid; void **ih; device_t dev; + struct mtx lock; }; void aha_alloc(struct aha_softc *, int, bus_space_tag_t, bus_space_handle_t); @@ -390,10 +390,10 @@ int aha_probe(struct aha_softc *); #define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */ #define aha_inb(aha, port) \ - bus_space_read_1((aha)->tag, (aha)->bsh, port) + bus_read_1((aha)->port, port) #define aha_outb(aha, port, value) \ - bus_space_write_1((aha)->tag, (aha)->bsh, port, value) + bus_write_1((aha)->port, port, value) #define ADP0100_PNP 0x00019004 /* ADP0100 */ #define AHA1540_PNP 0x40159004 /* ADP1540 */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 16:05:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EAF6AB; Mon, 15 Oct 2012 16:05:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04D578FC14; Mon, 15 Oct 2012 16:05:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FG52cd023021; Mon, 15 Oct 2012 16:05:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FG52CX023018; Mon, 15 Oct 2012 16:05:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210151605.q9FG52CX023018@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Oct 2012 16:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241590 - head/sys/dev/ahb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 16:05:03 -0000 Author: jhb Date: Mon Oct 15 16:05:02 2012 New Revision: 241590 URL: http://svn.freebsd.org/changeset/base/241590 Log: Add locking to the ahb(4) driver and mark it MPSAFE. - Use device_printf() and device_get_unit() instead of storing the unit number in the softc. - Remove use of explicit bus space handles and tags. - Compare pointers against NULL. - Let new-bus allocate a softc rather than doing it by hand. Tested by: no one Modified: head/sys/dev/ahb/ahb.c head/sys/dev/ahb/ahbreg.h Modified: head/sys/dev/ahb/ahb.c ============================================================================== --- head/sys/dev/ahb/ahb.c Mon Oct 15 15:59:13 2012 (r241589) +++ head/sys/dev/ahb/ahb.c Mon Oct 15 16:05:02 2012 (r241590) @@ -29,6 +29,7 @@ */ #include +#include #include #include #include @@ -57,16 +58,16 @@ #define ccb_ahb_ptr spriv_ptr1 #define ahb_inb(ahb, port) \ - bus_space_read_1((ahb)->tag, (ahb)->bsh, port) + bus_read_1((ahb)->res, port) #define ahb_inl(ahb, port) \ - bus_space_read_4((ahb)->tag, (ahb)->bsh, port) + bus_read_4((ahb)->res, port) #define ahb_outb(ahb, port, value) \ - bus_space_write_1((ahb)->tag, (ahb)->bsh, port, value) + bus_write_1((ahb)->res, port, value) #define ahb_outl(ahb, port, value) \ - bus_space_write_4((ahb)->tag, (ahb)->bsh, port, value) + bus_write_4((ahb)->res, port, value) static const char *ahbmatch(eisa_id_t type); static struct ahb_softc *ahballoc(device_t dev, struct resource *res); @@ -82,12 +83,13 @@ static void ahbcalcresid(struct ahb_s static __inline void ahbdone(struct ahb_softc *ahb, u_int32_t mbox, u_int intstat); static void ahbintr(void *arg); +static void ahbintr_locked(struct ahb_softc *ahb); static bus_dmamap_callback_t ahbexecuteecb; static void ahbaction(struct cam_sim *sim, union ccb *ccb); static void ahbpoll(struct cam_sim *sim); /* Our timeout handler */ -static timeout_t ahbtimeout; +static void ahbtimeout(void *arg); static __inline struct ecb* ahbecbget(struct ahb_softc *ahb); static __inline void ahbecbfree(struct ahb_softc* ahb, @@ -107,12 +109,11 @@ static __inline struct ecb* ahbecbget(struct ahb_softc *ahb) { struct ecb* ecb; - int s; - s = splcam(); + if (!dumping) + mtx_assert(&ahb->lock, MA_OWNED); if ((ecb = SLIST_FIRST(&ahb->free_ecbs)) != NULL) SLIST_REMOVE_HEAD(&ahb->free_ecbs, links); - splx(s); return (ecb); } @@ -120,12 +121,11 @@ ahbecbget(struct ahb_softc *ahb) static __inline void ahbecbfree(struct ahb_softc* ahb, struct ecb* ecb) { - int s; - s = splcam(); + if (!dumping) + mtx_assert(&ahb->lock, MA_OWNED); ecb->state = ECB_FREE; SLIST_INSERT_HEAD(&ahb->free_ecbs, ecb, links); - splx(s); } static __inline u_int32_t @@ -175,7 +175,8 @@ ahbqueuembox(struct ahb_softc *ahb, u_in DELAY(20); } if (loopmax == 0) - panic("ahb%ld: adapter not taking commands\n", ahb->unit); + panic("%s: adapter not taking commands\n", + device_get_nameunit(ahb->dev)); ahb_outl(ahb, MBOXOUT0, mboxval); ahb_outb(ahb, ATTN, attn_code); @@ -259,28 +260,27 @@ ahbattach(device_t dev) */ struct ahb_softc *ahb; struct ecb* next_ecb; - struct resource *io = 0; - struct resource *irq = 0; + struct resource *io; + struct resource *irq; int rid; void *ih; + irq = NULL; rid = 0; io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); - if (!io) { + if (io == NULL) { device_printf(dev, "No I/O space?!\n"); return ENOMEM; } - if ((ahb = ahballoc(dev, io)) == NULL) { - goto error_exit2; - } + ahb = ahballoc(dev, io); if (ahbreset(ahb) != 0) goto error_exit; rid = 0; irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (!irq) { + if (irq == NULL) { device_printf(dev, "Can't allocate interrupt\n"); goto error_exit; } @@ -303,7 +303,7 @@ ahbattach(device_t dev) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &ahb->lock, &ahb->buffer_dmat) != 0) goto error_exit; @@ -323,8 +323,8 @@ ahbattach(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &ahb->ecb_dmat) != 0) goto error_exit; @@ -356,6 +356,7 @@ ahbattach(device_t dev) if (bus_dmamap_create(ahb->buffer_dmat, /*flags*/0, &next_ecb->dmamap)) break; + callout_init_mtx(&next_ecb->timer, &ahb->lock, 0); ecb_paddr = ahbecbvtop(ahb, next_ecb); next_ecb->hecb.status_ptr = ahbstatuspaddr(ecb_paddr); next_ecb->hecb.sense_ptr = ahbsensepaddr(ecb_paddr); @@ -364,9 +365,6 @@ ahbattach(device_t dev) next_ecb++; } - if (ahb->num_ecbs == 0) - goto error_exit; - ahb->init_level++; /* @@ -377,8 +375,8 @@ ahbattach(device_t dev) goto error_exit; /* Enable our interrupt */ - if (bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr, - ahb, &ih) != 0) + if (bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, + NULL, ahbintr, ahb, &ih) != 0) goto error_exit; return (0); @@ -386,15 +384,13 @@ ahbattach(device_t dev) error_exit: /* * The board's IRQ line will not be left enabled - * if we can't intialize correctly, so its safe + * if we can't initialize correctly, so its safe * to release the irq. */ ahbfree(ahb); -error_exit2: - if (io) - bus_release_resource(dev, SYS_RES_IOPORT, 0, io); - if (irq) + if (irq != NULL) bus_release_resource(dev, SYS_RES_IRQ, 0, irq); + bus_release_resource(dev, SYS_RES_IOPORT, 0, io); return (-1); } @@ -403,22 +399,14 @@ ahballoc(device_t dev, struct resource * { struct ahb_softc *ahb; - /* - * Allocate a storage area for us - */ - ahb = malloc(sizeof(struct ahb_softc), M_DEVBUF, M_NOWAIT | M_ZERO); - if (!ahb) { - device_printf(dev, "cannot malloc!\n"); - return (NULL); - } + ahb = device_get_softc(dev); SLIST_INIT(&ahb->free_ecbs); LIST_INIT(&ahb->pending_ccbs); - ahb->unit = device_get_unit(dev); - ahb->tag = rman_get_bustag(res); - ahb->bsh = rman_get_bushandle(res); + ahb->res = res; ahb->disc_permitted = ~0; ahb->tags_permitted = ~0; ahb->dev = dev; + mtx_init(&ahb->lock, "ahb", NULL, MTX_DEF); return (ahb); } @@ -441,7 +429,7 @@ ahbfree(struct ahb_softc *ahb) case 0: break; } - free(ahb, M_DEVBUF); + mtx_destroy(&ahb->lock); } /* @@ -503,7 +491,9 @@ ahbxptattach(struct ahb_softc *ahb) struct ecb *ecb; u_int i; - /* Remeber who are we on the scsi bus */ + mtx_lock(&ahb->lock); + + /* Remember who are we on the scsi bus */ ahb->scsi_id = ahb_inb(ahb, SCSIDEF) & HSCSIID; /* Use extended translation?? */ @@ -524,14 +514,15 @@ ahbxptattach(struct ahb_softc *ahb) /* Poll for interrupt completion */ for (i = 1000; ecb->state != ECB_FREE && i != 0; i--) { - ahbintr(ahb); + ahbintr_locked(ahb); DELAY(1000); } ahb->num_ecbs = MIN(ahb->num_ecbs, ahb->ha_inq_data->scsi_data.spc2_flags); - printf("ahb%ld: %.8s %s SCSI Adapter, FW Rev. %.4s, ID=%d, %d ECBs\n", - ahb->unit, ahb->ha_inq_data->scsi_data.product, + device_printf(ahb->dev, + "%.8s %s SCSI Adapter, FW Rev. %.4s, ID=%d, %d ECBs\n", + ahb->ha_inq_data->scsi_data.product, (ahb->ha_inq_data->scsi_data.flags & 0x4) ? "Differential" : "Single Ended", ahb->ha_inq_data->scsi_data.revision, @@ -546,21 +537,25 @@ ahbxptattach(struct ahb_softc *ahb) * Create the device queue for our SIM. */ devq = cam_simq_alloc(ahb->num_ecbs); - if (devq == NULL) + if (devq == NULL) { + mtx_unlock(&ahb->lock); return (ENOMEM); + } /* * Construct our SIM entry */ - ahb->sim = cam_sim_alloc(ahbaction, ahbpoll, "ahb", ahb, ahb->unit, - &Giant, 2, ahb->num_ecbs, devq); + ahb->sim = cam_sim_alloc(ahbaction, ahbpoll, "ahb", ahb, + device_get_unit(ahb->dev), &ahb->lock, 2, ahb->num_ecbs, devq); if (ahb->sim == NULL) { cam_simq_free(devq); + mtx_unlock(&ahb->lock); return (ENOMEM); } if (xpt_bus_register(ahb->sim, ahb->dev, 0) != CAM_SUCCESS) { cam_sim_free(ahb->sim, /*free_devq*/TRUE); + mtx_unlock(&ahb->lock); return (ENXIO); } @@ -569,6 +564,7 @@ ahbxptattach(struct ahb_softc *ahb) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(ahb->sim)); cam_sim_free(ahb->sim, /*free_devq*/TRUE); + mtx_unlock(&ahb->lock); return (ENXIO); } @@ -576,6 +572,7 @@ ahbxptattach(struct ahb_softc *ahb) * Allow the board to generate interrupts. */ ahb_outb(ahb, INTDEF, ahb_inb(ahb, INTDEF) | INTEN); + mtx_unlock(&ahb->lock); return (0); } @@ -587,8 +584,8 @@ ahbhandleimmed(struct ahb_softc *ahb, u_ u_int target_id; if (ahb->immed_cmd == 0) { - printf("ahb%ld: Immediate Command complete with no " - " pending command\n", ahb->unit); + device_printf(ahb->dev, "Immediate Command complete with no " + " pending command\n"); return; } @@ -604,8 +601,7 @@ ahbhandleimmed(struct ahb_softc *ahb, u_ ccb_h = LIST_NEXT(ccb_h, sim_links.le); if (ccb->ccb_h.target_id == target_id || target_id == ahb->scsi_id) { - untimeout(ahbtimeout, pending_ecb, - ccb->ccb_h.timeout_ch); + callout_stop(&pending_ecb->timer); LIST_REMOVE(&ccb->ccb_h, sim_links.le); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) bus_dmamap_unload(ahb->buffer_dmat, @@ -621,20 +617,20 @@ ahbhandleimmed(struct ahb_softc *ahb, u_ xpt_done(ccb); } else if (ahb->immed_ecb != NULL) { /* Re-instate timeout */ - ccb->ccb_h.timeout_ch = - timeout(ahbtimeout, (caddr_t)pending_ecb, - (ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&pending_ecb->timer, + (ccb->ccb_h.timeout * hz) / 1000, + ahbtimeout, pending_ecb); } } if (ahb->immed_ecb != NULL) { ahb->immed_ecb = NULL; - printf("ahb%ld: No longer in timeout\n", ahb->unit); + device_printf(ahb->dev, "No longer in timeout\n"); } else if (target_id == ahb->scsi_id) - printf("ahb%ld: SCSI Bus Reset Delivered\n", ahb->unit); + device_printf(ahb->dev, "SCSI Bus Reset Delivered\n"); else - printf("ahb%ld: Bus Device Reset Delibered to target %d\n", - ahb->unit, target_id); + device_printf(ahb->dev, + "Bus Device Reset Delivered to target %d\n", target_id); ahb->immed_cmd = 0; } @@ -764,16 +760,17 @@ ahbprocesserror(struct ahb_softc *ahb, s ccb->ccb_h.status = CAM_SCSI_BUS_RESET; break; case HS_INVALID_ECB_PARAM: - printf("ahb%ld: opcode 0x%02x, flag_word1 0x%02x, flag_word2 0x%02x\n", - ahb->unit, hecb->opcode, hecb->flag_word1, hecb->flag_word2); + device_printf(ahb->dev, + "opcode 0x%02x, flag_word1 0x%02x, flag_word2 0x%02x\n", + hecb->opcode, hecb->flag_word1, hecb->flag_word2); ccb->ccb_h.status = CAM_SCSI_BUS_RESET; break; case HS_DUP_TCB_RECEIVED: case HS_INVALID_OPCODE: case HS_INVALID_CMD_LINK: case HS_PROGRAM_CKSUM_ERROR: - panic("ahb%ld: Can't happen host status %x occurred", - ahb->unit, status->ha_status); + panic("%s: Can't happen host status %x occurred", + device_get_nameunit(ahb->dev), status->ha_status); break; } if (ccb->ccb_h.status != CAM_REQ_CMP) { @@ -796,7 +793,7 @@ ahbdone(struct ahb_softc *ahb, u_int32_t ccb = ecb->ccb; if (ccb != NULL) { - untimeout(ahbtimeout, ecb, ccb->ccb_h.timeout_ch); + callout_stop(&ecb->timer); LIST_REMOVE(&ccb->ccb_h, sim_links.le); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { @@ -821,8 +818,8 @@ ahbdone(struct ahb_softc *ahb, u_int32_t } else { /* Non CCB Command */ if ((intstat & INTSTAT_MASK) != INTSTAT_ECB_OK) { - printf("ahb%ld: Command 0%x Failed %x:%x:%x\n", - ahb->unit, ecb->hecb.opcode, + device_printf(ahb->dev, "Command 0%x Failed %x:%x:%x\n", + ecb->hecb.opcode, *((u_int16_t*)&ecb->status), ecb->status.ha_status, ecb->status.resid_count); } @@ -837,11 +834,19 @@ static void ahbintr(void *arg) { struct ahb_softc *ahb; + + ahb = arg; + mtx_lock(&ahb->lock); + ahbintr_locked(ahb); + mtx_unlock(&ahb->lock); +} + +static void +ahbintr_locked(struct ahb_softc *ahb) +{ u_int intstat; u_int32_t mbox; - ahb = (struct ahb_softc *)arg; - while (ahb_inb(ahb, HOSTSTAT) & HOSTSTAT_INTPEND) { /* * Fetch information about this interrupt. @@ -900,16 +905,17 @@ ahbexecuteecb(void *arg, bus_dma_segment union ccb *ccb; struct ahb_softc *ahb; u_int32_t ecb_paddr; - int s; ecb = (struct ecb *)arg; ccb = ecb->ccb; ahb = (struct ahb_softc *)ccb->ccb_h.ccb_ahb_ptr; + mtx_assert(&ahb->lock, MA_OWNED); if (error != 0) { if (error != EFBIG) - printf("ahb%ld: Unexepected error 0x%x returned from " - "bus_dmamap_load\n", ahb->unit, error); + device_printf(ahb->dev, + "Unexepected error 0x%x returned from " + "bus_dmamap_load\n", error); if (ccb->ccb_h.status == CAM_REQ_INPROG) { xpt_freeze_devq(ccb->ccb_h.path, /*count*/1); ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN; @@ -961,8 +967,6 @@ ahbexecuteecb(void *arg, bus_dma_segment ecb->hecb.data_len = 0; } - s = splcam(); - /* * Last time we need to check if this CCB needs to * be aborted. @@ -972,7 +976,6 @@ ahbexecuteecb(void *arg, bus_dma_segment bus_dmamap_unload(ahb->buffer_dmat, ecb->dmamap); ahbecbfree(ahb, ecb); xpt_done(ccb); - splx(s); return; } @@ -983,9 +986,8 @@ ahbexecuteecb(void *arg, bus_dma_segment /* Tell the adapter about this command */ ahbqueuembox(ahb, ecb_paddr, ATTN_STARTECB|ccb->ccb_h.target_id); - ccb->ccb_h.timeout_ch = timeout(ahbtimeout, (caddr_t)ecb, - (ccb->ccb_h.timeout * hz) / 1000); - splx(s); + callout_reset(&ecb->timer, (ccb->ccb_h.timeout * hz) / 1000, ahbtimeout, + ecb); } static void @@ -996,6 +998,7 @@ ahbaction(struct cam_sim *sim, union ccb CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahbaction\n")); ahb = (struct ahb_softc *)cam_sim_softc(sim); + mtx_assert(&ahb->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -1064,10 +1067,8 @@ ahbaction(struct cam_sim *sim, union ccb * to a single buffer. */ if ((ccb->ccb_h.flags & CAM_DATA_PHYS)==0) { - int s; int error; - s = splsoftvm(); error = bus_dmamap_load( ahb->buffer_dmat, ecb->dmamap, @@ -1086,7 +1087,6 @@ ahbaction(struct cam_sim *sim, union ccb ccb->ccb_h.status |= CAM_RELEASE_SIMQ; } - splx(s); } else { struct bus_dma_segment seg; @@ -1176,17 +1176,14 @@ ahbaction(struct cam_sim *sim, union ccb case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ { int i; - int s; - s = splcam(); ahb->immed_cmd = IMMED_RESET; ahbqueuembox(ahb, IMMED_RESET, ATTN_IMMED|ccb->ccb_h.target_id); /* Poll for interrupt completion */ for (i = 1000; ahb->immed_cmd != 0 && i != 0; i--) { DELAY(1000); - ahbintr(cam_sim_softc(sim)); + ahbintr_locked(cam_sim_softc(sim)); } - splx(s); break; } case XPT_CALC_GEOMETRY: @@ -1263,21 +1260,18 @@ ahbtimeout(void *arg) struct ecb *ecb; union ccb *ccb; struct ahb_softc *ahb; - int s; ecb = (struct ecb *)arg; ccb = ecb->ccb; ahb = (struct ahb_softc *)ccb->ccb_h.ccb_ahb_ptr; + mtx_assert(&ahb->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("ECB %p - timed out\n", (void *)ecb); - s = splcam(); - if ((ecb->state & ECB_ACTIVE) == 0) { xpt_print_path(ccb->ccb_h.path); printf("ECB %p - timed out ECB already completed\n", (void *)ecb); - splx(s); return; } /* @@ -1298,13 +1292,11 @@ ahbtimeout(void *arg) ecb->state |= ECB_RELEASE_SIMQ; } - ccb_h = LIST_FIRST(&ahb->pending_ccbs); - while (ccb_h != NULL) { + LIST_FOREACH(ccb_h, &ahb->pending_ccbs, sim_links.le) { struct ecb *pending_ecb; pending_ecb = (struct ecb *)ccb_h->ccb_ecb_ptr; - untimeout(ahbtimeout, pending_ecb, ccb_h->timeout_ch); - ccb_h = LIST_NEXT(ccb_h, sim_links.le); + callout_stop(&pending_ecb->timer); } /* Store for our interrupt handler */ @@ -1324,8 +1316,7 @@ ahbtimeout(void *arg) xpt_print_path(ccb->ccb_h.path); printf("Queuing BDR\n"); ecb->state |= ECB_DEVICE_RESET; - ccb->ccb_h.timeout_ch = - timeout(ahbtimeout, (caddr_t)ecb, 2 * hz); + callout_reset(&ecb->timer, 2 * hz, ahbtimeout, ecb); ahb->immed_cmd = IMMED_RESET; ahbqueuembox(ahb, IMMED_RESET, ATTN_IMMED|ccb->ccb_h.target_id); @@ -1337,8 +1328,7 @@ ahbtimeout(void *arg) xpt_print_path(ccb->ccb_h.path); printf("Attempting SCSI Bus reset\n"); ecb->state |= ECB_SCSIBUS_RESET; - ccb->ccb_h.timeout_ch = - timeout(ahbtimeout, (caddr_t)ecb, 2 * hz); + callout_reset(&ecb->timer, 2 * hz, ahbtimeout, ecb); ahb->immed_cmd = IMMED_RESET; ahbqueuembox(ahb, IMMED_RESET, ATTN_IMMED|ahb->scsi_id); } else { @@ -1348,8 +1338,6 @@ ahbtimeout(void *arg) /* Simulate the reset complete interrupt */ ahbhandleimmed(ahb, 0, ahb->scsi_id|INTSTAT_IMMED_OK); } - - splx(s); } static device_method_t ahb_eisa_methods[] = { @@ -1363,7 +1351,7 @@ static device_method_t ahb_eisa_methods[ static driver_t ahb_eisa_driver = { "ahb", ahb_eisa_methods, - 1, /* unused */ + sizeof(struct ahb_softc), }; static devclass_t ahb_devclass; Modified: head/sys/dev/ahb/ahbreg.h ============================================================================== --- head/sys/dev/ahb/ahbreg.h Mon Oct 15 15:59:13 2012 (r241589) +++ head/sys/dev/ahb/ahbreg.h Mon Oct 15 16:05:02 2012 (r241590) @@ -255,12 +255,13 @@ struct ecb { ecb_state state; union ccb *ccb; bus_dmamap_t dmamap; + struct callout timer; }; struct ahb_softc { device_t dev; - bus_space_tag_t tag; - bus_space_handle_t bsh; + struct resource *res; + struct mtx lock; struct cam_sim *sim; struct cam_path *path; SLIST_HEAD(,ecb) free_ecbs; @@ -274,7 +275,6 @@ struct ahb_softc { struct ecb *immed_ecb; struct ha_inquiry_data *ha_inq_data; u_int32_t ha_inq_physbase; - u_long unit; u_int init_level; u_int scsi_id; u_int num_ecbs; From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 16:09:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8B5940D; Mon, 15 Oct 2012 16:09:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDBEE8FC14; Mon, 15 Oct 2012 16:09:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FG9x0C023763; Mon, 15 Oct 2012 16:09:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FG9xUI023756; Mon, 15 Oct 2012 16:09:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210151609.q9FG9xUI023756@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Oct 2012 16:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241591 - head/sys/dev/aic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 16:10:00 -0000 Author: jhb Date: Mon Oct 15 16:09:59 2012 New Revision: 241591 URL: http://svn.freebsd.org/changeset/base/241591 Log: Add locking to the aic(4) driver and mark it MPSAFE. - Move 'free_scbs' into the softc rather than having it be a global list and convert it to an SLIST instead of a hand-rolled linked-list. - Use device_printf() and device_get_unit() instead of storing the unit number in the softc. - Remove use of explicit bus space handles and tags. - Don't call device_set_desc() in the pccard attach routine, instead set a default description during the pccard probe if the matching product doesn't have a name. Tested by: no one Modified: head/sys/dev/aic/aic.c head/sys/dev/aic/aic_cbus.c head/sys/dev/aic/aic_isa.c head/sys/dev/aic/aic_pccard.c head/sys/dev/aic/aicvar.h Modified: head/sys/dev/aic/aic.c ============================================================================== --- head/sys/dev/aic/aic.c Mon Oct 15 16:05:02 2012 (r241590) +++ head/sys/dev/aic/aic.c Mon Oct 15 16:09:59 2012 (r241591) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -36,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -51,6 +53,7 @@ __FBSDID("$FreeBSD$"); static void aic_action(struct cam_sim *sim, union ccb *ccb); static void aic_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error); +static void aic_intr_locked(struct aic_softc *aic); static void aic_start(struct aic_softc *aic); static void aic_select(struct aic_softc *aic); static void aic_selected(struct aic_softc *aic); @@ -71,43 +74,42 @@ static void aic_reset(struct aic_softc * devclass_t aic_devclass; -static struct aic_scb *free_scbs; - static struct aic_scb * aic_get_scb(struct aic_softc *aic) { struct aic_scb *scb; - int s = splcam(); - if ((scb = free_scbs) != NULL) - free_scbs = (struct aic_scb *)free_scbs->ccb; - splx(s); + + if (!dumping) + mtx_assert(&aic->lock, MA_OWNED); + if ((scb = SLIST_FIRST(&aic->free_scbs)) != NULL) + SLIST_REMOVE_HEAD(&aic->free_scbs, link); return (scb); } static void aic_free_scb(struct aic_softc *aic, struct aic_scb *scb) { - int s = splcam(); + + if (!dumping) + mtx_assert(&aic->lock, MA_OWNED); if ((aic->flags & AIC_RESOURCE_SHORTAGE) != 0 && (scb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) { scb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; aic->flags &= ~AIC_RESOURCE_SHORTAGE; } scb->flags = 0; - scb->ccb = (union ccb *)free_scbs; - free_scbs = scb; - splx(s); + SLIST_INSERT_HEAD(&aic->free_scbs, scb, link); } static void aic_action(struct cam_sim *sim, union ccb *ccb) { struct aic_softc *aic; - int s; CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("aic_action\n")); aic = (struct aic_softc *)cam_sim_softc(sim); + mtx_assert(&aic->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: /* Execute the requested I/O operation */ @@ -116,9 +118,7 @@ aic_action(struct cam_sim *sim, union cc struct aic_scb *scb; if ((scb = aic_get_scb(aic)) == NULL) { - s = splcam(); aic->flags |= AIC_RESOURCE_SHORTAGE; - splx(s); xpt_freeze_simq(aic->sim, /*count*/1); ccb->ccb_h.status = CAM_REQUEUE_REQ; xpt_done(ccb); @@ -175,8 +175,6 @@ aic_action(struct cam_sim *sim, union cc struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; - s = splcam(); - if ((spi->valid & CTS_SPI_VALID_DISC) != 0 && (aic->flags & AIC_DISC_ENABLE) != 0) { if ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) != 0) @@ -214,7 +212,6 @@ aic_action(struct cam_sim *sim, union cc || (ti->goal.offset != ti->current.offset)) ti->flags |= TINFO_SDTR_NEGO; - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -235,7 +232,6 @@ aic_action(struct cam_sim *sim, union cc scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB; - s = splcam(); if ((ti->flags & TINFO_DISC_ENB) != 0) spi->flags |= CTS_SPI_FLAGS_DISC_ENB; if ((ti->flags & TINFO_TAG_ENB) != 0) @@ -248,7 +244,6 @@ aic_action(struct cam_sim *sim, union cc spi->sync_period = ti->user.period; spi->sync_offset = ti->user.offset; } - splx(s); spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT; spi->valid = CTS_SPI_VALID_SYNC_RATE @@ -311,12 +306,10 @@ aic_execute_scb(void *arg, bus_dma_segme struct aic_scb *scb = (struct aic_scb *)arg; union ccb *ccb = scb->ccb; struct aic_softc *aic = (struct aic_softc *)ccb->ccb_h.ccb_aic_ptr; - int s; - - s = splcam(); + if (!dumping) + mtx_assert(&aic->lock, MA_OWNED); if (ccb->ccb_h.status != CAM_REQ_INPROG) { - splx(s); aic_free_scb(aic, scb); xpt_done(ccb); return; @@ -326,11 +319,10 @@ aic_execute_scb(void *arg, bus_dma_segme ccb->ccb_h.status |= CAM_SIM_QUEUED; TAILQ_INSERT_TAIL(&aic->pending_ccbs, &ccb->ccb_h, sim_links.tqe); - ccb->ccb_h.timeout_ch = timeout(aic_timeout, (caddr_t)scb, - (ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&scb->timer, (ccb->ccb_h.timeout * hz) / 1000, + aic_timeout, scb); aic_start(aic); - splx(s); } /* @@ -1053,7 +1045,7 @@ aic_done(struct aic_softc *aic, struct a ("aic_done - ccb %p status %x resid %d\n", ccb, ccb->ccb_h.status, ccb->csio.resid)); - untimeout(aic_timeout, (caddr_t)scb, ccb->ccb_h.timeout_ch); + callout_stop(&scb->timer); if ((scb->flags & SCB_DEVICE_RESET) != 0 && ccb->ccb_h.func_code != XPT_RESET_DEV) { @@ -1083,9 +1075,9 @@ aic_done(struct aic_softc *aic, struct a &pending_scb->ccb->ccb_h, sim_links.tqe); aic_done(aic, pending_scb); } else { - ccb_h->timeout_ch = - timeout(aic_timeout, (caddr_t)pending_scb, - (ccb_h->timeout * hz) / 1000); + callout_reset(&pending_scb->timer, + (ccb_h->timeout * hz) / 1000, aic_timeout, + pending_scb); ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); } } @@ -1102,9 +1094,9 @@ aic_done(struct aic_softc *aic, struct a &nexus_scb->ccb->ccb_h, sim_links.tqe); aic_done(aic, nexus_scb); } else { - ccb_h->timeout_ch = - timeout(aic_timeout, (caddr_t)nexus_scb, - (ccb_h->timeout * hz) / 1000); + callout_reset(&nexus_scb->timer, + (ccb_h->timeout * hz) / 1000, aic_timeout, + nexus_scb); ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); } } @@ -1123,7 +1115,7 @@ aic_done(struct aic_softc *aic, struct a static void aic_poll(struct cam_sim *sim) { - aic_intr(cam_sim_softc(sim)); + aic_intr_locked(cam_sim_softc(sim)); } static void @@ -1132,18 +1124,15 @@ aic_timeout(void *arg) struct aic_scb *scb = (struct aic_scb *)arg; union ccb *ccb = scb->ccb; struct aic_softc *aic = (struct aic_softc *)ccb->ccb_h.ccb_aic_ptr; - int s; + mtx_assert(&aic->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("ccb %p - timed out", ccb); if (aic->nexus && aic->nexus != scb) printf(", nexus %p", aic->nexus->ccb); printf(", phase 0x%x, state %d\n", aic_inb(aic, SCSISIGI), aic->state); - s = splcam(); - if ((scb->flags & SCB_ACTIVE) == 0) { - splx(s); xpt_print_path(ccb->ccb_h.path); printf("ccb %p - timed out already completed\n", ccb); return; @@ -1151,6 +1140,7 @@ aic_timeout(void *arg) if ((scb->flags & SCB_DEVICE_RESET) == 0 && aic->nexus == scb) { struct ccb_hdr *ccb_h = &scb->ccb->ccb_h; + struct aic_scb *pending_scb; if ((ccb_h->status & CAM_RELEASE_SIMQ) == 0) { xpt_freeze_simq(aic->sim, /*count*/1); @@ -1158,18 +1148,17 @@ aic_timeout(void *arg) } TAILQ_FOREACH(ccb_h, &aic->pending_ccbs, sim_links.tqe) { - untimeout(aic_timeout, (caddr_t)ccb_h->ccb_scb_ptr, - ccb_h->timeout_ch); + pending_scb = ccb_h->ccb_scb_ptr; + callout_stop(&pending_scb->timer); } TAILQ_FOREACH(ccb_h, &aic->nexus_ccbs, sim_links.tqe) { - untimeout(aic_timeout, (caddr_t)ccb_h->ccb_scb_ptr, - ccb_h->timeout_ch); + pending_scb = ccb_h->ccb_scb_ptr; + callout_stop(&pending_scb->timer); } scb->flags |= SCB_DEVICE_RESET; - ccb->ccb_h.timeout_ch = - timeout(aic_timeout, (caddr_t)scb, 5 * hz); + callout_reset(&scb->timer, 5 * hz, aic_timeout, scb); aic_sched_msgout(aic, MSG_BUS_DEV_RESET); } else { if (aic->nexus == scb) { @@ -1178,14 +1167,21 @@ aic_timeout(void *arg) } aic_reset(aic, /*initiate_reset*/TRUE); } - - splx(s); } void aic_intr(void *arg) { struct aic_softc *aic = (struct aic_softc *)arg; + + mtx_lock(&aic->lock); + aic_intr_locked(aic); + mtx_unlock(&aic->lock); +} + +void +aic_intr_locked(struct aic_softc *aic) +{ u_int8_t sstat0, sstat1; union ccb *ccb; struct aic_scb *scb; @@ -1434,6 +1430,7 @@ aic_init(struct aic_softc *aic) TAILQ_INIT(&aic->pending_ccbs); TAILQ_INIT(&aic->nexus_ccbs); + SLIST_INIT(&aic->free_scbs); aic->nexus = NULL; aic->state = AIC_IDLE; aic->prev_phase = -1; @@ -1481,10 +1478,10 @@ aic_init(struct aic_softc *aic) aic->max_period = AIC_SYNC_PERIOD; aic->min_period = AIC_MIN_SYNC_PERIOD; - free_scbs = NULL; for (i = 255; i >= 0; i--) { scb = &aic->scbs[i]; scb->tag = i; + callout_init_mtx(&scb->timer, &aic->lock, 0); aic_free_scb(aic, scb); } @@ -1543,14 +1540,16 @@ aic_attach(struct aic_softc *aic) * Construct our SIM entry */ aic->sim = cam_sim_alloc(aic_action, aic_poll, "aic", aic, - aic->unit, &Giant, 2, 256, devq); + device_get_unit(aic->dev), &aic->lock, 2, 256, devq); if (aic->sim == NULL) { cam_simq_free(devq); return (ENOMEM); } + mtx_lock(&aic->lock); if (xpt_bus_register(aic->sim, aic->dev, 0) != CAM_SUCCESS) { cam_sim_free(aic->sim, /*free_devq*/TRUE); + mtx_unlock(&aic->lock); return (ENXIO); } @@ -1559,12 +1558,13 @@ aic_attach(struct aic_softc *aic) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(aic->sim)); cam_sim_free(aic->sim, /*free_devq*/TRUE); + mtx_unlock(&aic->lock); return (ENXIO); } aic_init(aic); - printf("aic%d: %s", aic->unit, aic_chip_names[aic->chip_type]); + device_printf(aic->dev, "%s", aic_chip_names[aic->chip_type]); if (aic->flags & AIC_DMA_ENABLE) printf(", dma"); if (aic->flags & AIC_DISC_ENABLE) @@ -1574,15 +1574,25 @@ aic_attach(struct aic_softc *aic) if (aic->flags & AIC_FAST_ENABLE) printf(", fast SCSI"); printf("\n"); + mtx_unlock(&aic->lock); return (0); } int aic_detach(struct aic_softc *aic) { + struct aic_scb *scb; + int i; + + mtx_lock(&aic->lock); xpt_async(AC_LOST_DEVICE, aic->path, NULL); xpt_free_path(aic->path); xpt_bus_deregister(cam_sim_path(aic->sim)); cam_sim_free(aic->sim, /*free_devq*/TRUE); + mtx_unlock(&aic->lock); + for (i = 255; i >= 0; i--) { + scb = &aic->scbs[i]; + callout_drain(&scb->timer); + } return (0); } Modified: head/sys/dev/aic/aic_cbus.c ============================================================================== --- head/sys/dev/aic/aic_cbus.c Mon Oct 15 16:05:02 2012 (r241590) +++ head/sys/dev/aic/aic_cbus.c Mon Oct 15 16:09:59 2012 (r241591) @@ -28,8 +28,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include +#include #include #include @@ -92,7 +95,7 @@ aic_isa_alloc_resources(device_t dev) else bs_iat = aicport_generic; - sc->sc_port = sc->sc_irq = sc->sc_drq = 0; + sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; rid = 0; sc->sc_port = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, @@ -102,6 +105,7 @@ aic_isa_alloc_resources(device_t dev) return (ENOMEM); } isa_load_resourcev(sc->sc_port, bs_iat, AIC_ISA_PORTSIZE); + mtx_init(&sc->sc_aic.lock, "aic", NULL, MTX_DEF); if (isa_get_irq(dev) != -1) { rid = 0; @@ -126,9 +130,7 @@ aic_isa_alloc_resources(device_t dev) } sc->sc_aic.dev = dev; - sc->sc_aic.unit = device_get_unit(dev); - sc->sc_aic.tag = rman_get_bustag(sc->sc_port); - sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port); + sc->sc_aic.res = sc->sc_port; return (0); } @@ -143,7 +145,8 @@ aic_isa_release_resources(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); if (sc->sc_drq) bus_release_resource(dev, SYS_RES_DRQ, 0, sc->sc_drq); - sc->sc_port = sc->sc_irq = sc->sc_drq = 0; + sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; + mtx_destroy(&sc->sc_aic.lock); } static int @@ -172,10 +175,8 @@ aic_isa_probe(device_t dev) continue; if (aic_isa_alloc_resources(dev)) continue; - if (!aic_probe(aic)) { - aic_isa_release_resources(dev); + if (aic_probe(aic) == 0) break; - } aic_isa_release_resources(dev); } @@ -183,6 +184,7 @@ aic_isa_probe(device_t dev) return (ENXIO); porta = aic_inb(aic, PORTA); + aic_isa_release_resources(dev); if (isa_get_irq(dev) == -1) bus_set_resource(dev, SYS_RES_IRQ, 0, PORTA_IRQ(porta), 1); if ((aic->flags & AIC_DMA_ENABLE) && isa_get_drq(dev) == -1) @@ -211,8 +213,8 @@ aic_isa_attach(device_t dev) return (error); } - error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY, - NULL, aic_intr, aic, &sc->sc_ih); + error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, aic_intr, aic, &sc->sc_ih); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_isa_release_resources(dev); Modified: head/sys/dev/aic/aic_isa.c ============================================================================== --- head/sys/dev/aic/aic_isa.c Mon Oct 15 16:05:02 2012 (r241590) +++ head/sys/dev/aic/aic_isa.c Mon Oct 15 16:09:59 2012 (r241591) @@ -28,8 +28,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include +#include #include #include @@ -69,7 +72,7 @@ aic_isa_alloc_resources(device_t dev) struct aic_isa_softc *sc = device_get_softc(dev); int rid; - sc->sc_port = sc->sc_irq = sc->sc_drq = 0; + sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; rid = 0; sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, @@ -102,9 +105,8 @@ aic_isa_alloc_resources(device_t dev) } sc->sc_aic.dev = dev; - sc->sc_aic.unit = device_get_unit(dev); - sc->sc_aic.tag = rman_get_bustag(sc->sc_port); - sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port); + sc->sc_aic.res = sc->sc_port; + mtx_init(&sc->sc_aic.lock, "aic", NULL, MTX_DEF); return (0); } @@ -119,7 +121,8 @@ aic_isa_release_resources(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); if (sc->sc_drq) bus_release_resource(dev, SYS_RES_DRQ, 0, sc->sc_drq); - sc->sc_port = sc->sc_irq = sc->sc_drq = 0; + sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; + mtx_destroy(&sc->sc_aic.lock); } static int @@ -149,10 +152,8 @@ aic_isa_probe(device_t dev) continue; if (aic_isa_alloc_resources(dev)) continue; - if (!aic_probe(aic)) { - aic_isa_release_resources(dev); + if (aic_probe(aic) == 0) break; - } aic_isa_release_resources(dev); } @@ -160,6 +161,7 @@ aic_isa_probe(device_t dev) return (ENXIO); porta = aic_inb(aic, PORTA); + aic_isa_release_resources(dev); if (isa_get_irq(dev) == -1) bus_set_resource(dev, SYS_RES_IRQ, 0, PORTA_IRQ(porta), 1); if ((aic->flags & AIC_DMA_ENABLE) && isa_get_drq(dev) == -1) @@ -188,8 +190,8 @@ aic_isa_attach(device_t dev) return (error); } - error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY, - NULL, aic_intr, aic, &sc->sc_ih); + error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, aic_intr, aic, &sc->sc_ih); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_isa_release_resources(dev); Modified: head/sys/dev/aic/aic_pccard.c ============================================================================== --- head/sys/dev/aic/aic_pccard.c Mon Oct 15 16:05:02 2012 (r241590) +++ head/sys/dev/aic/aic_pccard.c Mon Oct 15 16:09:59 2012 (r241591) @@ -28,8 +28,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include +#include #include #include @@ -71,7 +74,7 @@ aic_pccard_alloc_resources(device_t dev) struct aic_pccard_softc *sc = device_get_softc(dev); int rid; - sc->sc_port = sc->sc_irq = 0; + sc->sc_port = sc->sc_irq = NULL; rid = 0; sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, @@ -87,9 +90,8 @@ aic_pccard_alloc_resources(device_t dev) } sc->sc_aic.dev = dev; - sc->sc_aic.unit = device_get_unit(dev); - sc->sc_aic.tag = rman_get_bustag(sc->sc_port); - sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port); + sc->sc_aic.res = sc->sc_port; + mtx_init(&sc->sc_aic.lock, "aic", NULL, MTX_DEF); return (0); } @@ -102,7 +104,8 @@ aic_pccard_release_resources(device_t de bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port); if (sc->sc_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); - sc->sc_port = sc->sc_irq = 0; + sc->sc_port = sc->sc_irq = NULL; + mtx_destroy(&sc->sc_aic.lock); } static int @@ -114,9 +117,12 @@ aic_pccard_probe(device_t dev) sizeof(aic_pccard_products[0]), NULL)) != NULL) { if (pp->pp_name != NULL) device_set_desc(dev, pp->pp_name); - return 0; + else + device_set_desc(dev, + "Adaptec 6260/6360 SCSI controller"); + return (BUS_PROBE_DEFAULT); } - return EIO; + return (ENXIO); } static int @@ -133,8 +139,6 @@ aic_pccard_attach(device_t dev) return (ENXIO); } - device_set_desc(dev, "Adaptec 6260/6360 SCSI controller"); - error = aic_attach(aic); if (error) { device_printf(dev, "attach failed\n"); @@ -142,8 +146,8 @@ aic_pccard_attach(device_t dev) return (error); } - error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY, - NULL, aic_intr, aic, &sc->sc_ih); + error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, aic_intr, aic, &sc->sc_ih); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_pccard_release_resources(dev); Modified: head/sys/dev/aic/aicvar.h ============================================================================== --- head/sys/dev/aic/aicvar.h Mon Oct 15 16:05:02 2012 (r241590) +++ head/sys/dev/aic/aicvar.h Mon Oct 15 16:09:59 2012 (r241591) @@ -47,6 +47,8 @@ struct aic_tinfo { struct aic_scb { union ccb *ccb; + SLIST_ENTRY(aic_scb) link; + struct callout timer; u_int8_t flags; u_int8_t tag; u_int8_t target; @@ -70,14 +72,14 @@ enum { AIC6260, AIC6360, AIC6370, GM82C7 struct aic_softc { device_t dev; - int unit; - bus_space_tag_t tag; - bus_space_handle_t bsh; + struct mtx lock; + struct resource *res; bus_dma_tag_t dmat; struct cam_sim *sim; struct cam_path *path; TAILQ_HEAD(,ccb_hdr) pending_ccbs, nexus_ccbs; + SLIST_HEAD(,aic_scb) free_scbs; struct aic_scb *nexus; u_int32_t flags; @@ -127,32 +129,28 @@ struct aic_softc { #define AIC_SYNC_OFFSET 8 #define aic_inb(aic, port) \ - bus_space_read_1((aic)->tag, (aic)->bsh, (port)) + bus_read_1((aic)->res, (port)) #define aic_outb(aic, port, value) \ - bus_space_write_1((aic)->tag, (aic)->bsh, (port), (value)) + bus_write_1((aic)->res, (port), (value)) #define aic_insb(aic, port, addr, count) \ - bus_space_read_multi_1((aic)->tag, (aic)->bsh, (port), (addr), (count)) + bus_read_multi_1((aic)->res, (port), (addr), (count)) #define aic_outsb(aic, port, addr, count) \ - bus_space_write_multi_1((aic)->tag, (aic)->bsh, (port), (addr), (count)) + bus_write_multi_1((aic)->res, (port), (addr), (count)) #define aic_insw(aic, port, addr, count) \ - bus_space_read_multi_2((aic)->tag, (aic)->bsh, (port), \ - (u_int16_t *)(addr), (count)) + bus_read_multi_2((aic)->res, (port), (u_int16_t *)(addr), (count)) #define aic_outsw(aic, port, addr, count) \ - bus_space_write_multi_2((aic)->tag, (aic)->bsh, (port), \ - (u_int16_t *)(addr), (count)) + bus_write_multi_2((aic)->res, (port), (u_int16_t *)(addr), (count)) #define aic_insl(aic, port, addr, count) \ - bus_space_read_multi_4((aic)->tag, (aic)->bsh, (port), \ - (u_int32_t *)(addr), (count)) + bus_read_multi_4((aic)->res, (port), (u_int32_t *)(addr), (count)) #define aic_outsl(aic, port, addr, count) \ - bus_space_write_multi_4((aic)->tag, (aic)->bsh, (port), \ - (u_int32_t *)(addr), (count)) + bus_write_multi_4((aic)->res, (port), (u_int32_t *)(addr), (count)) extern int aic_probe(struct aic_softc *); extern int aic_attach(struct aic_softc *); From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 16:13:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46CF15D2; Mon, 15 Oct 2012 16:13:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE4F8FC08; Mon, 15 Oct 2012 16:13:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FGDu6W024604; Mon, 15 Oct 2012 16:13:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FGDtpb024597; Mon, 15 Oct 2012 16:13:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210151613.q9FGDtpb024597@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Oct 2012 16:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241592 - head/sys/dev/buslogic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 16:13:56 -0000 Author: jhb Date: Mon Oct 15 16:13:55 2012 New Revision: 241592 URL: http://svn.freebsd.org/changeset/base/241592 Log: Add locking to the bt(4) driver and mark it MPSAFE. - Use device_printf() and device_get_unit() instead of storing the unit number in the softc. - Remove use of explicit bus space handles and tags. - Return an errno value from bt_eisa_attach() if an error occurs rather than -1. - Use BUS_PROBE_DEFAULT rather than 0. Tested by: no one Modified: head/sys/dev/buslogic/bt.c head/sys/dev/buslogic/bt_eisa.c head/sys/dev/buslogic/bt_isa.c head/sys/dev/buslogic/bt_mca.c head/sys/dev/buslogic/bt_pci.c head/sys/dev/buslogic/btreg.h Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Mon Oct 15 16:09:59 2012 (r241591) +++ head/sys/dev/buslogic/bt.c Mon Oct 15 16:13:55 2012 (r241592) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -140,6 +141,7 @@ static void btallocccbs(struct bt_softc static bus_dmamap_callback_t btexecuteccb; static void btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code); +static void bt_intr_locked(struct bt_softc *bt); /* Host adapter command functions */ static int btreset(struct bt_softc* bt, int hard_reset); @@ -161,9 +163,7 @@ static void btaction(struct cam_sim *sim static void btpoll(struct cam_sim *sim); /* Our timeout handler */ -timeout_t bttimeout; - -u_long bt_unit = 0; +static void bttimeout(void *arg); /* * XXX @@ -206,12 +206,10 @@ bt_init_softc(device_t dev, struct resou LIST_INIT(&bt->pending_ccbs); SLIST_INIT(&bt->sg_maps); bt->dev = dev; - bt->unit = device_get_unit(dev); bt->port = port; bt->irq = irq; bt->drq = drq; - bt->tag = rman_get_bustag(port); - bt->bsh = rman_get_bushandle(port); + mtx_init(&bt->lock, "bt", NULL, MTX_DEF); } void @@ -270,6 +268,7 @@ bt_free_softc(device_t dev) case 0: break; } + mtx_destroy(&bt->lock); } int @@ -287,9 +286,11 @@ bt_port_probe(device_t dev, struct bt_pr * Determine our IRQ, and DMA settings and * export them to the configuration system. */ + mtx_lock(&bt->lock); error = bt_cmd(bt, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0, (u_int8_t*)&config_data, sizeof(config_data), DEFAULT_CMD_TIMEOUT); + mtx_unlock(&bt->lock); if (error != 0) { printf("bt_port_probe: Could not determine IRQ or DMA " "settings for adapter.\n"); @@ -381,7 +382,9 @@ bt_probe(device_t dev) * adapter and attempt to fetch the extended setup * information. This should filter out all 1542 cards. */ + mtx_lock(&bt->lock); if ((error = btreset(bt, /*hard_reset*/TRUE)) != 0) { + mtx_unlock(&bt->lock); if (bootverbose) device_printf(dev, "Failed Reset\n"); return (ENXIO); @@ -391,6 +394,7 @@ bt_probe(device_t dev) error = bt_cmd(bt, BOP_INQUIRE_ESETUP_INFO, ¶m, /*parmlen*/1, (u_int8_t*)&esetup_info, sizeof(esetup_info), DEFAULT_CMD_TIMEOUT); + mtx_unlock(&bt->lock); if (error != 0) { return (ENXIO); } @@ -412,10 +416,12 @@ bt_fetch_adapter_info(device_t dev) u_int8_t length_param; /* First record the firmware version */ + mtx_lock(&bt->lock); error = bt_cmd(bt, BOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0, (u_int8_t*)&board_id, sizeof(board_id), DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); device_printf(dev, "bt_fetch_adapter_info - Failed Get Board Info\n"); return (error); } @@ -434,6 +440,7 @@ bt_fetch_adapter_info(device_t dev) (u_int8_t*)&bt->firmware_ver[3], 1, DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); device_printf(dev, "bt_fetch_adapter_info - Failed Get " "Firmware 3rd Digit\n"); @@ -450,6 +457,7 @@ bt_fetch_adapter_info(device_t dev) (u_int8_t*)&bt->firmware_ver[4], 1, DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); device_printf(dev, "bt_fetch_adapter_info - Failed Get " "Firmware 4th Digit\n"); @@ -483,6 +491,7 @@ bt_fetch_adapter_info(device_t dev) (u_int8_t*)&esetup_info, sizeof(esetup_info), DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); return (error); } @@ -514,6 +523,7 @@ bt_fetch_adapter_info(device_t dev) (u_int8_t*)&model_data, sizeof(model_data), DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); device_printf(dev, "bt_fetch_adapter_info - Failed Inquire " "Model Number\n"); @@ -600,6 +610,7 @@ bt_fetch_adapter_info(device_t dev) sizeof(auto_scsi_data), DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); device_printf(dev, "bt_fetch_adapter_info - Failed " "Get Auto SCSI Info\n"); @@ -635,6 +646,7 @@ bt_fetch_adapter_info(device_t dev) sizeof(setup_info), DEFAULT_CMD_TIMEOUT); if (error != 0) { + mtx_unlock(&bt->lock); device_printf(dev, "bt_fetch_adapter_info - Failed " "Get Setup Info\n"); @@ -662,6 +674,7 @@ bt_fetch_adapter_info(device_t dev) error = bt_cmd(bt, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0, (u_int8_t*)&config_data, sizeof(config_data), DEFAULT_CMD_TIMEOUT); + mtx_unlock(&bt->lock); if (error != 0) { device_printf(dev, "bt_fetch_adapter_info - Failed Get Config\n"); @@ -720,7 +733,7 @@ bt_init(device_t dev) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &bt->lock, &bt->buffer_dmat) != 0) { goto error_exit; } @@ -740,8 +753,8 @@ bt_init(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->mailbox_dmat) != 0) { goto error_exit; } @@ -767,7 +780,9 @@ bt_init(device_t dev) bt->in_boxes = (bt_mbox_in_t *)&bt->out_boxes[bt->num_boxes]; + mtx_lock(&bt->lock); btinitmboxes(bt); + mtx_unlock(&bt->lock); /* DMA tag for our ccb structures */ if (bus_dma_tag_create( /* parent */ bt->parent_dmat, @@ -782,8 +797,8 @@ bt_init(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->ccb_dmat) != 0) { goto error_exit; } @@ -818,8 +833,8 @@ bt_init(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->sg_dmat) != 0) { goto error_exit; } @@ -837,7 +852,7 @@ bt_init(device_t dev) } /* - * Note that we are going and return (to probe) + * Note that we are going and return (to attach) */ return 0; @@ -873,15 +888,17 @@ bt_attach(device_t dev) /* * Construct our SIM entry */ - bt->sim = cam_sim_alloc(btaction, btpoll, "bt", bt, bt->unit, - &Giant, 2, tagged_dev_openings, devq); + bt->sim = cam_sim_alloc(btaction, btpoll, "bt", bt, + device_get_unit(bt->dev), &bt->lock, 2, tagged_dev_openings, devq); if (bt->sim == NULL) { cam_simq_free(devq); return (ENOMEM); } - + + mtx_lock(&bt->lock); if (xpt_bus_register(bt->sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(bt->sim, /*free_devq*/TRUE); + mtx_unlock(&bt->lock); return (ENXIO); } @@ -890,14 +907,16 @@ bt_attach(device_t dev) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(bt->sim)); cam_sim_free(bt->sim, /*free_devq*/TRUE); + mtx_unlock(&bt->lock); return (ENXIO); } + mtx_unlock(&bt->lock); /* * Setup interrupt. */ - error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, - bt_intr, bt, &bt->ih); + error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, bt_intr, bt, &bt->ih); if (error) { device_printf(dev, "bus_setup_intr() failed: %d\n", error); return (error); @@ -1024,6 +1043,7 @@ btallocccbs(struct bt_softc *bt) next_ccb->sg_list = segs; next_ccb->sg_list_phys = physaddr; next_ccb->flags = BCCB_FREE; + callout_init_mtx(&next_ccb->timer, &bt->lock, 0); error = bus_dmamap_create(bt->buffer_dmat, /*flags*/0, &next_ccb->dmamap); if (error != 0) @@ -1051,9 +1071,9 @@ error_exit: static __inline void btfreeccb(struct bt_softc *bt, struct bt_ccb *bccb) { - int s; - s = splcam(); + if (!dumping) + mtx_assert(&bt->lock, MA_OWNED); if ((bccb->flags & BCCB_ACTIVE) != 0) LIST_REMOVE(&bccb->ccb->ccb_h, sim_links.le); if (bt->resource_shortage != 0 @@ -1064,16 +1084,15 @@ btfreeccb(struct bt_softc *bt, struct bt bccb->flags = BCCB_FREE; SLIST_INSERT_HEAD(&bt->free_bt_ccbs, bccb, links); bt->active_ccbs--; - splx(s); } static __inline struct bt_ccb* btgetccb(struct bt_softc *bt) { struct bt_ccb* bccb; - int s; - s = splcam(); + if (!dumping) + mtx_assert(&bt->lock, MA_OWNED); if ((bccb = SLIST_FIRST(&bt->free_bt_ccbs)) != NULL) { SLIST_REMOVE_HEAD(&bt->free_bt_ccbs, links); bt->active_ccbs++; @@ -1085,7 +1104,6 @@ btgetccb(struct bt_softc *bt) bt->active_ccbs++; } } - splx(s); return (bccb); } @@ -1098,6 +1116,7 @@ btaction(struct cam_sim *sim, union ccb CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("btaction\n")); bt = (struct bt_softc *)cam_sim_softc(sim); + mtx_assert(&bt->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -1111,11 +1130,8 @@ btaction(struct cam_sim *sim, union ccb * get a bccb to use. */ if ((bccb = btgetccb(bt)) == NULL) { - int s; - s = splcam(); bt->resource_shortage = TRUE; - splx(s); xpt_freeze_simq(bt->sim, /*count*/1); ccb->ccb_h.status = CAM_REQUEUE_REQ; xpt_done(ccb); @@ -1197,10 +1213,8 @@ btaction(struct cam_sim *sim, union ccb * to a single buffer. */ if ((ccbh->flags & CAM_DATA_PHYS)==0) { - int s; int error; - s = splsoftvm(); error = bus_dmamap_load( bt->buffer_dmat, bccb->dmamap, @@ -1222,7 +1236,6 @@ btaction(struct cam_sim *sim, union ccb csio->ccb_h.status |= CAM_RELEASE_SIMQ; } - splx(s); } else { struct bus_dma_segment seg; @@ -1426,7 +1439,6 @@ btexecuteccb(void *arg, bus_dma_segment_ struct bt_ccb *bccb; union ccb *ccb; struct bt_softc *bt; - int s; bccb = (struct bt_ccb *)arg; ccb = bccb->ccb; @@ -1484,8 +1496,6 @@ btexecuteccb(void *arg, bus_dma_segment_ bccb->hccb.data_addr = 0; } - s = splcam(); - /* * Last time we need to check if this CCB needs to * be aborted. @@ -1495,7 +1505,6 @@ btexecuteccb(void *arg, bus_dma_segment_ bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); btfreeccb(bt, bccb); xpt_done(ccb); - splx(s); return; } @@ -1503,9 +1512,8 @@ btexecuteccb(void *arg, bus_dma_segment_ ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&bt->pending_ccbs, &ccb->ccb_h, sim_links.le); - ccb->ccb_h.timeout_ch = - timeout(bttimeout, (caddr_t)bccb, - (ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&bccb->timer, (ccb->ccb_h.timeout * hz) / 1000, + bttimeout, bccb); /* Tell the adapter about this command */ bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb); @@ -1521,7 +1529,7 @@ btexecuteccb(void *arg, bus_dma_segment_ "Encountered busy mailbox with %d out of %d " "commands active!!!\n", bt->active_ccbs, bt->max_ccbs); - untimeout(bttimeout, bccb, ccb->ccb_h.timeout_ch); + callout_stop(&bccb->timer); if (nseg != 0) bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); btfreeccb(bt, bccb); @@ -1534,16 +1542,24 @@ btexecuteccb(void *arg, bus_dma_segment_ bt->cur_outbox->action_code = BMBO_START; bt_outb(bt, COMMAND_REG, BOP_START_MBOX); btnextoutbox(bt); - splx(s); } void bt_intr(void *arg) { struct bt_softc *bt; + + bt = arg; + mtx_lock(&bt->lock); + bt_intr_locked(bt); + mtx_unlock(&bt->lock); +} + +void +bt_intr_locked(struct bt_softc *bt) +{ u_int intstat; - bt = (struct bt_softc *)arg; while (((intstat = bt_inb(bt, INTSTAT_REG)) & INTR_PENDING) != 0) { if ((intstat & CMD_COMPLETE) != 0) { @@ -1629,9 +1645,9 @@ btdone(struct bt_softc *bt, struct bt_cc ccb_h = LIST_NEXT(ccb_h, sim_links.le); btdone(bt, pending_bccb, BMBI_ERROR); } else { - ccb_h->timeout_ch = - timeout(bttimeout, (caddr_t)pending_bccb, - (ccb_h->timeout * hz) / 1000); + callout_reset(&pending_bccb->timer, + (ccb_h->timeout * hz) / 1000, + bttimeout, pending_bccb); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } } @@ -1639,7 +1655,7 @@ btdone(struct bt_softc *bt, struct bt_cc return; } - untimeout(bttimeout, bccb, ccb->ccb_h.timeout_ch); + callout_stop(&bccb->timer); switch (comp_code) { case BMBI_FREE: @@ -1822,8 +1838,9 @@ btreset(struct bt_softc* bt, int hard_re } if (timeout == 0) { if (bootverbose) - printf("%s: btreset - Diagnostic Active failed to " - "assert. status = 0x%x\n", bt_name(bt), status); + device_printf(bt->dev, + "btreset - Diagnostic Active failed to " + "assert. status = 0x%x\n", status); return (ETIMEDOUT); } @@ -1850,20 +1867,22 @@ btreset(struct bt_softc* bt, int hard_re DELAY(100); } if (timeout == 0) { - printf("%s: btreset - Host adapter failed to come ready. " - "status = 0x%x\n", bt_name(bt), status); + device_printf(bt->dev, + "btreset - Host adapter failed to come ready. " + "status = 0x%x\n", status); return (ETIMEDOUT); } /* If the diagnostics failed, tell the user */ if ((status & DIAG_FAIL) != 0 || (status & HA_READY) == 0) { - printf("%s: btreset - Adapter failed diagnostics\n", - bt_name(bt)); + device_printf(bt->dev, + "btreset - Adapter failed diagnostics\n"); if ((status & DATAIN_REG_READY) != 0) - printf("%s: btreset - Host Adapter Error code = 0x%x\n", - bt_name(bt), bt_inb(bt, DATAIN_REG)); + device_printf(bt->dev, + "btreset - Host Adapter Error code = 0x%x\n", + bt_inb(bt, DATAIN_REG)); return (ENXIO); } @@ -1901,7 +1920,6 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco u_int saved_status; u_int intstat; u_int reply_buf_size; - int s; int cmd_complete; int error; @@ -1934,8 +1952,9 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco DELAY(100); } if (timeout == 0) { - printf("%s: bt_cmd: Timeout waiting for adapter ready, " - "status = 0x%x\n", bt_name(bt), status); + device_printf(bt->dev, + "bt_cmd: Timeout waiting for adapter ready, " + "status = 0x%x\n", status); return (ETIMEDOUT); } @@ -1951,10 +1970,8 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco timeout = 10000; while (param_len && --timeout) { DELAY(100); - s = splcam(); status = bt_inb(bt, STATUS_REG); intstat = bt_inb(bt, INTSTAT_REG); - splx(s); if ((intstat & (INTR_PENDING|CMD_COMPLETE)) == (INTR_PENDING|CMD_COMPLETE)) { @@ -1976,8 +1993,8 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco } } if (timeout == 0) { - printf("%s: bt_cmd: Timeout sending parameters, " - "status = 0x%x\n", bt_name(bt), status); + device_printf(bt->dev, "bt_cmd: Timeout sending parameters, " + "status = 0x%x\n", status); cmd_complete = 1; saved_status = status; error = ETIMEDOUT; @@ -1988,7 +2005,6 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco */ while (cmd_complete == 0 && --cmd_timeout) { - s = splcam(); status = bt_inb(bt, STATUS_REG); intstat = bt_inb(bt, INTSTAT_REG); /* @@ -2000,8 +2016,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco */ if ((intstat & (INTR_PENDING|IMB_LOADED)) == (INTR_PENDING|IMB_LOADED)) - bt_intr(bt); - splx(s); + bt_intr_locked(bt); if (bt->command_cmp != 0) { /* @@ -2035,9 +2050,9 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco if (reply_len < reply_buf_size) { *reply_data++ = data; } else { - printf("%s: bt_cmd - Discarded reply data byte " - "for opcode 0x%x\n", bt_name(bt), - opcode); + device_printf(bt->dev, + "bt_cmd - Discarded reply data byte " + "for opcode 0x%x\n", opcode); } /* * Reset timeout to ensure at least a second @@ -2054,20 +2069,18 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco DELAY(100); } if (cmd_timeout == 0) { - printf("%s: bt_cmd: Timeout waiting for command (%x) " - "to complete.\n%s: status = 0x%x, intstat = 0x%x, " - "rlen %d\n", bt_name(bt), opcode, - bt_name(bt), status, intstat, reply_len); + device_printf(bt->dev, + "bt_cmd: Timeout waiting for command (%x) " + "to complete.\n", opcode); + device_printf(bt->dev, "status = 0x%x, intstat = 0x%x, " + "rlen %d\n", status, intstat, reply_len); error = (ETIMEDOUT); } /* - * Clear any pending interrupts. Block interrupts so our - * interrupt handler is not re-entered. + * Clear any pending interrupts. */ - s = splcam(); - bt_intr(bt); - splx(s); + bt_intr_locked(bt); if (error != 0) return (error); @@ -2083,7 +2096,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco * reset above), perform a soft reset. */ if (bootverbose) - printf("%s: Invalid Command 0x%x\n", bt_name(bt), + device_printf(bt->dev, "Invalid Command 0x%x\n", opcode); DELAY(1000); status = bt_inb(bt, STATUS_REG); @@ -2151,8 +2164,8 @@ btinitmboxes(struct bt_softc *bt) { printf("btinitmboxes: Unable to enable strict RR\n"); error = 0; } else if (bootverbose) { - printf("%s: Using Strict Round Robin Mailbox Mode\n", - bt_name(bt)); + device_printf(bt->dev, + "Using Strict Round Robin Mailbox Mode\n"); } } @@ -2199,8 +2212,9 @@ btfetchtransinfo(struct bt_softc *bt, st DEFAULT_CMD_TIMEOUT); if (error != 0) { - printf("%s: btfetchtransinfo - Inquire Setup Info Failed %x\n", - bt_name(bt), error); + device_printf(bt->dev, + "btfetchtransinfo - Inquire Setup Info Failed %x\n", + error); return; } @@ -2254,8 +2268,9 @@ btfetchtransinfo(struct bt_softc *bt, st DEFAULT_CMD_TIMEOUT); if (error != 0) { - printf("%s: btfetchtransinfo - Inquire Sync " - "Info Failed 0x%x\n", bt_name(bt), error); + device_printf(bt->dev, + "btfetchtransinfo - Inquire Sync " + "Info Failed 0x%x\n", error); return; } sync_period = sync_info.sync_rate[target] * 100; @@ -2316,7 +2331,7 @@ btmapsgs(void *arg, bus_dma_segment_t *s static void btpoll(struct cam_sim *sim) { - bt_intr(cam_sim_softc(sim)); + bt_intr_locked(cam_sim_softc(sim)); } void @@ -2325,21 +2340,18 @@ bttimeout(void *arg) struct bt_ccb *bccb; union ccb *ccb; struct bt_softc *bt; - int s; bccb = (struct bt_ccb *)arg; ccb = bccb->ccb; bt = (struct bt_softc *)ccb->ccb_h.ccb_bt_ptr; + mtx_assert(&bt->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("CCB %p - timed out\n", (void *)bccb); - s = splcam(); - if ((bccb->flags & BCCB_ACTIVE) == 0) { xpt_print_path(ccb->ccb_h.path); printf("CCB %p - timed out CCB already completed\n", (void *)bccb); - splx(s); return; } @@ -2366,7 +2378,7 @@ bttimeout(void *arg) struct bt_ccb *pending_bccb; pending_bccb = (struct bt_ccb *)ccb_h->ccb_bccb_ptr; - untimeout(bttimeout, pending_bccb, ccb_h->timeout_ch); + callout_stop(&pending_bccb->timer); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } } @@ -2389,7 +2401,7 @@ bttimeout(void *arg) */ ccb->ccb_h.status = CAM_CMD_TIMEOUT; btreset(bt, /*hardreset*/TRUE); - printf("%s: No longer in timeout\n", bt_name(bt)); + device_printf(bt->dev, "No longer in timeout\n"); } else { /* * Send a Bus Device Reset message: @@ -2403,8 +2415,7 @@ bttimeout(void *arg) * later which will attempt a bus reset. */ bccb->flags |= BCCB_DEVICE_RESET; - ccb->ccb_h.timeout_ch = - timeout(bttimeout, (caddr_t)bccb, 2 * hz); + callout_reset(&bccb->timer, 2 * hz, bttimeout, bccb); bt->recovery_bccb->hccb.opcode = INITIATOR_BUS_DEV_RESET; @@ -2421,8 +2432,6 @@ bttimeout(void *arg) bt_outb(bt, COMMAND_REG, BOP_START_MBOX); btnextoutbox(bt); } - - splx(s); } MODULE_VERSION(bt, 1); Modified: head/sys/dev/buslogic/bt_eisa.c ============================================================================== --- head/sys/dev/buslogic/bt_eisa.c Mon Oct 15 16:09:59 2012 (r241591) +++ head/sys/dev/buslogic/bt_eisa.c Mon Oct 15 16:13:55 2012 (r241592) @@ -140,7 +140,7 @@ bt_eisa_alloc_resources(device_t dev) return (ENOMEM); } } else - irq = 0; + irq = NULL; bt->irq = irq; return (0); @@ -287,7 +287,7 @@ bt_eisa_probe(device_t dev) result = ENXIO; } else { eisa_add_intr(dev, info.irq, shared); - result = 0; + result = BUS_PROBE_DEFAULT; } bt_eisa_release_resources(dev); @@ -315,11 +315,11 @@ bt_eisa_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg, */ &Giant, + /* lockfunc */ NULL, + /* lockarg, */ NULL, &bt->parent_dmat) != 0) { bt_eisa_release_resources(dev); - return -1; + return (ENOMEM); } /* @@ -328,7 +328,7 @@ bt_eisa_attach(device_t dev) */ if (bt_probe(dev) || bt_fetch_adapter_info(dev) || bt_init(dev)) { bt_eisa_release_resources(dev); - return -1; + return (ENXIO); } /* Attach sub-devices - always succeeds (sets up intr) */ Modified: head/sys/dev/buslogic/bt_isa.c ============================================================================== --- head/sys/dev/buslogic/bt_isa.c Mon Oct 15 16:09:59 2012 (r241591) +++ head/sys/dev/buslogic/bt_isa.c Mon Oct 15 16:13:55 2012 (r241592) @@ -75,7 +75,7 @@ bt_isa_alloc_resources(device_t dev, u_l return (ENOMEM); } } else - irq = 0; + irq = NULL; if (isa_get_drq(dev) != -1) { rid = 0; @@ -90,7 +90,7 @@ bt_isa_alloc_resources(device_t dev, u_l return (ENOMEM); } } else - drq = 0; + drq = NULL; bt_init_softc(dev, port, irq, drq); @@ -176,7 +176,7 @@ bt_isa_probe(device_t dev) bus_set_resource(dev, SYS_RES_DRQ, 0, info.drq, 1); bus_set_resource(dev, SYS_RES_IRQ, 0, info.irq, 1); - return (0); + return (BUS_PROBE_DEFAULT); } return (ENXIO); @@ -233,7 +233,7 @@ bt_isa_attach(device_t dev) } /* XXX Should be a child of the ISA or VL bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ lowaddr, @@ -244,8 +244,8 @@ bt_isa_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->parent_dmat) != 0) { bt_isa_release_resources(dev); return (ENOMEM); @@ -272,8 +272,8 @@ bt_isa_attach(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->sense_dmat) != 0) { bt_isa_release_resources(dev); return (ENOMEM); Modified: head/sys/dev/buslogic/bt_mca.c ============================================================================== --- head/sys/dev/buslogic/bt_mca.c Mon Oct 15 16:09:59 2012 (r241591) +++ head/sys/dev/buslogic/bt_mca.c Mon Oct 15 16:13:55 2012 (r241592) @@ -196,7 +196,7 @@ bt_mca_probe (device_t dev) } else { mca_add_drq(dev, drq); mca_add_irq(dev, irq); - result = 0; + result = BUS_PROBE_DEFAULT; } bt_mca_release_resources(dev); @@ -229,8 +229,8 @@ bt_mca_attach (device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->parent_dmat) != 0) { bt_mca_release_resources(dev); return (ENOMEM); @@ -254,8 +254,8 @@ bt_mca_attach (device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->sense_dmat) != 0) { bt_mca_release_resources(dev); return (ENOMEM); Modified: head/sys/dev/buslogic/bt_pci.c ============================================================================== --- head/sys/dev/buslogic/bt_pci.c Mon Oct 15 16:09:59 2012 (r241591) +++ head/sys/dev/buslogic/bt_pci.c Mon Oct 15 16:13:55 2012 (r241592) @@ -148,7 +148,7 @@ bt_pci_probe(device_t dev) } bt_pci_release_resources(dev); device_set_desc(dev, "Buslogic Multi-Master SCSI Host Adapter"); - return (0); + return (BUS_PROBE_DEFAULT); } default: break; @@ -161,7 +161,6 @@ static int bt_pci_attach(device_t dev) { struct bt_softc *bt = device_get_softc(dev); - int opri; int error; /* Initialize softc */ @@ -183,31 +182,19 @@ bt_pci_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &bt->parent_dmat) != 0) { bt_pci_release_resources(dev); return (ENOMEM); } - /* - * Protect ourself from spurrious interrupts during - * intialization and attach. We should really rely - * on interrupts during attach, but we don't have - * access to our interrupts during ISA probes, so until - * that changes, we mask our interrupts during attach - * too. - */ - opri = splcam(); - if (bt_probe(dev) || bt_fetch_adapter_info(dev) || bt_init(dev)) { bt_pci_release_resources(dev); - splx(opri); return (ENXIO); } error = bt_attach(dev); - splx(opri); if (error) { bt_pci_release_resources(dev); Modified: head/sys/dev/buslogic/btreg.h ============================================================================== --- head/sys/dev/buslogic/btreg.h Mon Oct 15 16:09:59 2012 (r241591) +++ head/sys/dev/buslogic/btreg.h Mon Oct 15 16:13:55 2012 (r241592) @@ -582,6 +582,7 @@ struct bt_ccb { u_int32_t flags; union ccb *ccb; bus_dmamap_t dmamap; + struct callout timer; bt_sg_t *sg_list; u_int32_t sg_list_phys; }; @@ -599,8 +600,7 @@ struct bt_softc { struct resource *irq; struct resource *drq; void *ih; - bus_space_tag_t tag; - bus_space_handle_t bsh; + struct mtx lock; struct cam_sim *sim; struct cam_path *path; bt_mbox_out_t *cur_outbox; @@ -637,7 +637,6 @@ struct bt_softc { u_int num_ccbs; /* Number of CCBs malloc'd */ u_int max_ccbs; /* Maximum allocatable CCBs */ u_int max_sg; - u_int unit; u_int scsi_id; u_int32_t extended_trans :1, wide_bus :1, @@ -664,8 +663,6 @@ struct bt_softc { char model[5]; }; -extern u_long bt_unit; - #define BT_TEMP_UNIT 0xFF /* Unit for probes */ void bt_init_softc(device_t dev, struct resource *port, @@ -696,10 +693,10 @@ int bt_cmd(struct bt_softc *bt, bt_op_ #define bt_name(bt) device_get_nameunit(bt->dev) -#define bt_inb(bt, port) \ - bus_space_read_1((bt)->tag, (bt)->bsh, port) +#define bt_inb(bt, reg) \ + bus_read_1((bt)->port, reg) -#define bt_outb(bt, port, value) \ - bus_space_write_1((bt)->tag, (bt)->bsh, port, value) +#define bt_outb(bt, reg, value) \ + bus_write_1((bt)->port, reg, value) #endif /* _BT_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 16:29:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6475B1C; Mon, 15 Oct 2012 16:29:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2188FC16; Mon, 15 Oct 2012 16:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FGT8vP027412; Mon, 15 Oct 2012 16:29:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FGT83s027406; Mon, 15 Oct 2012 16:29:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210151629.q9FGT83s027406@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Oct 2012 16:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241593 - head/sys/dev/dpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 16:29:08 -0000 Author: jhb Date: Mon Oct 15 16:29:08 2012 New Revision: 241593 URL: http://svn.freebsd.org/changeset/base/241593 Log: Add locking to the dpt(4) driver and mark it MPSAFE. - Use device_printf() and device_get_unit() instead of storing the unit number in the softc. - Remove use of explicit bus space handles and tags. - Remove the global dpt_softcs list and use devclass_get_device() instead. - Use pci_enable_busmaster() rather than frobbing the PCI command register directly. Tested by: no one Modified: head/sys/dev/dpt/dpt.h head/sys/dev/dpt/dpt_eisa.c head/sys/dev/dpt/dpt_isa.c head/sys/dev/dpt/dpt_pci.c head/sys/dev/dpt/dpt_scsi.c Modified: head/sys/dev/dpt/dpt.h ============================================================================== --- head/sys/dev/dpt/dpt.h Mon Oct 15 16:13:55 2012 (r241592) +++ head/sys/dev/dpt/dpt.h Mon Oct 15 16:29:08 2012 (r241593) @@ -876,6 +876,7 @@ typedef enum { typedef struct dpt_ccb { eata_ccb_t eata_ccb; bus_dmamap_t dmamap; + struct callout timer; dpt_sg_t *sg_list; u_int32_t sg_busaddr; dccb_state state; @@ -1017,6 +1018,7 @@ struct sg_map_node { /* Main state machine and interface structure */ typedef struct dpt_softc { device_t dev; + struct mtx lock; struct resource * io_res; int io_rid; @@ -1030,8 +1032,6 @@ typedef struct dpt_softc { struct resource * drq_res; int drq_rid; - bus_space_tag_t tag; - bus_space_handle_t bsh; bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */ dpt_ccb_t *dpt_dccbs; /* Array of dpt ccbs */ bus_addr_t dpt_ccb_busbase; /* phys base address of array */ @@ -1079,7 +1079,6 @@ typedef struct dpt_softc { u_int8_t dma_channel; TAILQ_ENTRY(dpt_softc) links; - int unit; int init_level; /* @@ -1275,9 +1274,6 @@ dpt_time_delta(struct timeval start, (end.tv_usec - start.tv_usec) ); } -extern TAILQ_HEAD(dpt_softc_list, dpt_softc) dpt_softcs; - -extern int dpt_controllers_present; extern devclass_t dpt_devclass; #ifdef _KERNEL Modified: head/sys/dev/dpt/dpt_eisa.c ============================================================================== --- head/sys/dev/dpt/dpt_eisa.c Mon Oct 15 16:13:55 2012 (r241592) +++ head/sys/dev/dpt/dpt_eisa.c Mon Oct 15 16:29:08 2012 (r241593) @@ -105,11 +105,11 @@ static int dpt_eisa_attach (device_t dev) { dpt_softc_t * dpt; - int s; int error = 0; dpt = device_get_softc(dev); dpt->dev = dev; + dpt_alloc(dev); dpt->io_rid = 0; dpt->io_type = SYS_RES_IOPORT; @@ -120,11 +120,8 @@ dpt_eisa_attach (device_t dev) goto bad; } - dpt_alloc(dev); - /* Allocate a dmatag representing the capabilities of this attachment */ - /* XXX Should be a child of the EISA bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, @@ -135,17 +132,14 @@ dpt_eisa_attach (device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &dpt->parent_dmat) != 0) { error = ENXIO; goto bad; } - s = splcam(); - if (dpt_init(dpt) != 0) { - splx(s); error = ENXIO; goto bad; } @@ -153,10 +147,8 @@ dpt_eisa_attach (device_t dev) /* Register with the XPT */ dpt_attach(dpt); - splx(s); - - if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - NULL, dpt_intr, dpt, &dpt->ih)) { + if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, dpt_intr, dpt, &dpt->ih)) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; Modified: head/sys/dev/dpt/dpt_isa.c ============================================================================== --- head/sys/dev/dpt/dpt_isa.c Mon Oct 15 16:13:55 2012 (r241592) +++ head/sys/dev/dpt/dpt_isa.c Mon Oct 15 16:29:08 2012 (r241593) @@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -150,11 +152,11 @@ static int dpt_isa_attach (device_t dev) { dpt_softc_t * dpt; - int s; int error = 0; dpt = device_get_softc(dev); dpt->dev = dev; + dpt_alloc(dev); dpt->io_rid = 0; dpt->io_type = SYS_RES_IOPORT; @@ -176,10 +178,8 @@ dpt_isa_attach (device_t dev) isa_dma_acquire(rman_get_start(dpt->drq_res)); isa_dmacascade(rman_get_start(dpt->drq_res)); - dpt_alloc(dev); - /* Allocate a dmatag representing the capabilities of this attachment */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, @@ -190,17 +190,14 @@ dpt_isa_attach (device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &dpt->parent_dmat) != 0) { error = ENXIO; goto bad; } - s = splcam(); - if (dpt_init(dpt) != 0) { - splx(s); error = ENXIO; goto bad; } @@ -208,10 +205,8 @@ dpt_isa_attach (device_t dev) /* Register with the XPT */ dpt_attach(dpt); - splx(s); - - if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - dpt_intr, dpt, &dpt->ih)) { + if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, dpt_intr, dpt, &dpt->ih)) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; Modified: head/sys/dev/dpt/dpt_pci.c ============================================================================== --- head/sys/dev/dpt/dpt_pci.c Mon Oct 15 16:13:55 2012 (r241592) +++ head/sys/dev/dpt/dpt_pci.c Mon Oct 15 16:29:08 2012 (r241593) @@ -75,13 +75,13 @@ static int dpt_pci_attach (device_t dev) { dpt_softc_t * dpt; - int s; int error = 0; u_int32_t command; dpt = device_get_softc(dev); dpt->dev = dev; + dpt_alloc(dev); command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); @@ -117,8 +117,7 @@ dpt_pci_attach (device_t dev) } /* Ensure busmastering is enabled */ - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1); + pci_enable_busmaster(dev); if (rman_get_start(dpt->io_res) == (ISA_PRIMARY_WD_ADDRESS - 0x10)) { #ifdef DPT_DEBUG_WARN @@ -129,8 +128,6 @@ dpt_pci_attach (device_t dev) goto bad; } - dpt_alloc(dev); - /* Allocate a dmatag representing the capabilities of this attachment */ if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, @@ -143,15 +140,13 @@ dpt_pci_attach (device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &dpt->parent_dmat) != 0) { error = ENXIO; goto bad; } - s = splcam(); - if (dpt_init(dpt) != 0) { error = ENXIO; goto bad; @@ -160,10 +155,8 @@ dpt_pci_attach (device_t dev) /* Register with the XPT */ dpt_attach(dpt); - splx(s); - - if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - NULL, dpt_intr, dpt, &dpt->ih)) { + if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, dpt_intr, dpt, &dpt->ih)) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Mon Oct 15 16:13:55 2012 (r241592) +++ head/sys/dev/dpt/dpt_scsi.c Mon Oct 15 16:29:08 2012 (r241593) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -79,19 +80,18 @@ __FBSDID("$FreeBSD$"); #include /* dpt_isa.c, dpt_eisa.c, and dpt_pci.c need this in a central place */ -int dpt_controllers_present; devclass_t dpt_devclass; #define microtime_now dpt_time_now() #define dpt_inl(dpt, port) \ - bus_space_read_4((dpt)->tag, (dpt)->bsh, port) + bus_read_4((dpt)->io_res, (dpt)->io_offset + port) #define dpt_inb(dpt, port) \ - bus_space_read_1((dpt)->tag, (dpt)->bsh, port) + bus_read_1((dpt)->io_res, (dpt)->io_offset + port) #define dpt_outl(dpt, port, value) \ - bus_space_write_4((dpt)->tag, (dpt)->bsh, port, value) + bus_write_4((dpt)->io_res, (dpt)->io_offset + port, value) #define dpt_outb(dpt, port, value) \ - bus_space_write_1((dpt)->tag, (dpt)->bsh, port, value) + bus_write_1((dpt)->io_res, (dpt)->io_offset + port, value) /* * These will have to be setup by parameters passed at boot/load time. For @@ -142,6 +142,7 @@ static void dpt_detect_cache(dpt_softc_ u_int8_t *buff); static void dpt_poll(struct cam_sim *sim); +static void dpt_intr_locked(dpt_softc_t *dpt); static void dptexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error); @@ -222,9 +223,9 @@ static __inline struct dpt_ccb* dptgetccb(struct dpt_softc *dpt) { struct dpt_ccb* dccb; - int s; - s = splcam(); + if (!dumping) + mtx_assert(&dpt->lock, MA_OWNED); if ((dccb = SLIST_FIRST(&dpt->free_dccb_list)) != NULL) { SLIST_REMOVE_HEAD(&dpt->free_dccb_list, links); dpt->free_dccbs--; @@ -232,13 +233,12 @@ dptgetccb(struct dpt_softc *dpt) dptallocccbs(dpt); dccb = SLIST_FIRST(&dpt->free_dccb_list); if (dccb == NULL) - printf("dpt%d: Can't malloc DCCB\n", dpt->unit); + device_printf(dpt->dev, "Can't malloc DCCB\n"); else { SLIST_REMOVE_HEAD(&dpt->free_dccb_list, links); dpt->free_dccbs--; } } - splx(s); return (dccb); } @@ -246,9 +246,9 @@ dptgetccb(struct dpt_softc *dpt) static __inline void dptfreeccb(struct dpt_softc *dpt, struct dpt_ccb *dccb) { - int s; - s = splcam(); + if (!dumping) + mtx_assert(&dpt->lock, MA_OWNED); if ((dccb->state & DCCB_ACTIVE) != 0) LIST_REMOVE(&dccb->ccb->ccb_h, sim_links.le); if ((dccb->state & DCCB_RELEASE_SIMQ) != 0) @@ -261,7 +261,6 @@ dptfreeccb(struct dpt_softc *dpt, struct dccb->state = DCCB_FREE; SLIST_INSERT_HEAD(&dpt->free_dccb_list, dccb, links); ++dpt->free_dccbs; - splx(s); } static __inline bus_addr_t @@ -332,7 +331,6 @@ dptallocsgmap(struct dpt_softc *dpt) /* * Allocate another chunk of CCB's. Return count of entries added. - * Assumed to be called at splcam(). */ static int dptallocccbs(dpt_softc_t *dpt) @@ -344,6 +342,8 @@ dptallocccbs(dpt_softc_t *dpt) int newcount; int i; + if (!dumping) + mtx_assert(&dpt->lock, MA_OWNED); next_ccb = &dpt->dpt_dccbs[dpt->total_dccbs]; if (next_ccb == dpt->dpt_dccbs) { @@ -371,6 +371,7 @@ dptallocccbs(dpt_softc_t *dpt) &next_ccb->dmamap); if (error != 0) break; + callout_init_mtx(&next_ccb->timer, &dpt->lock, 0); next_ccb->sg_list = segs; next_ccb->sg_busaddr = htonl(physaddr); next_ccb->eata_ccb.cp_dataDMA = htonl(physaddr); @@ -404,7 +405,7 @@ dpt_pio_get_conf (u_int32_t base) */ if (!conf) { conf = (dpt_conf_t *)malloc(sizeof(dpt_conf_t), - M_DEVBUF, M_NOWAIT); + M_DEVBUF, M_NOWAIT | M_ZERO); } /* @@ -416,11 +417,6 @@ dpt_pio_get_conf (u_int32_t base) } /* - * If we have one, clean it up. - */ - bzero(conf, sizeof(dpt_conf_t)); - - /* * Reset the controller. */ outb((base + HA_WCOMMAND), EATA_CMD_RESET); @@ -498,9 +494,9 @@ dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t u_int8_t status; int ndx; - int ospl; int result; + mtx_assert(&dpt->lock, MA_OWNED); cp = &dccb->eata_ccb; bzero((void *)(uintptr_t)(volatile void *)dpt->sp, sizeof(*dpt->sp)); @@ -523,8 +519,6 @@ dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t cp->cp_identify = 1; cp->cp_datalen = htonl(size); - ospl = splcam(); - /* * This could be a simple for loop, but we suspected the compiler To * have optimized it a bit too much. Wait for the controller to @@ -540,9 +534,8 @@ dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t * the DPT controller is in a NON PC (PCI?) platform). */ if (dpt_raid_busy(dpt)) { - printf("dpt%d WARNING: Get_conf() RSUS failed.\n", - dpt->unit); - splx(ospl); + device_printf(dpt->dev, + "WARNING: Get_conf() RSUS failed.\n"); return (0); } } @@ -557,10 +550,10 @@ dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t if ((result = dpt_send_eata_command(dpt, cp, dccb_busaddr, EATA_CMD_DMA_SEND_CP, 10000, 0, 0, 0)) != 0) { - printf("dpt%d WARNING: Get_conf() failed (%d) to send " + device_printf(dpt->dev, + "WARNING: Get_conf() failed (%d) to send " "EATA_CMD_DMA_READ_CONFIG\n", - dpt->unit, result); - splx(ospl); + result); return (0); } /* Wait for two seconds for a response. This can be slow */ @@ -574,8 +567,6 @@ dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t /* Grab the status and clear interrupts */ status = dpt_inb(dpt, HA_RSTATUS); - splx(ospl); - /* * Check the status carefully. Return only if the * command was successful. @@ -601,10 +592,11 @@ dpt_detect_cache(dpt_softc_t *dpt, dpt_c u_int8_t *param; int bytes; int result; - int ospl; int ndx; u_int8_t status; + mtx_assert(&dpt->lock, MA_OWNED); + /* * Default setting, for best perfromance.. * This is what virtually all cards default to.. @@ -646,14 +638,13 @@ dpt_detect_cache(dpt_softc_t *dpt, dpt_c cp->cp_datalen = htonl(512); - ospl = splcam(); result = dpt_send_eata_command(dpt, cp, dccb_busaddr, EATA_CMD_DMA_SEND_CP, 10000, 0, 0, 0); if (result != 0) { - printf("dpt%d WARNING: detect_cache() failed (%d) to send " - "EATA_CMD_DMA_SEND_CP\n", dpt->unit, result); - splx(ospl); + device_printf(dpt->dev, + "WARNING: detect_cache() failed (%d) to send " + "EATA_CMD_DMA_SEND_CP\n", result); return; } /* Wait for two seconds for a response. This can be slow... */ @@ -666,7 +657,6 @@ dpt_detect_cache(dpt_softc_t *dpt, dpt_c /* Grab the status and clear interrupts */ status = dpt_inb(dpt, HA_RSTATUS); - splx(ospl); /* * Sanity check @@ -681,8 +671,7 @@ dpt_detect_cache(dpt_softc_t *dpt, dpt_c /* * DPT Log Page layout error */ - printf("dpt%d: NOTICE: Log Page (1) layout error\n", - dpt->unit); + device_printf(dpt->dev, "NOTICE: Log Page (1) layout error\n"); return; } if (!(param[4] & 0x4)) { @@ -721,7 +710,7 @@ dpt_detect_cache(dpt_softc_t *dpt, dpt_c static void dpt_poll(struct cam_sim *sim) { - dpt_intr(cam_sim_softc(sim)); + dpt_intr_locked(cam_sim_softc(sim)); } static void @@ -730,16 +719,18 @@ dptexecuteccb(void *arg, bus_dma_segment struct dpt_ccb *dccb; union ccb *ccb; struct dpt_softc *dpt; - int s; + if (!dumping) + mtx_assert(&dpt->lock, MA_OWNED); dccb = (struct dpt_ccb *)arg; ccb = dccb->ccb; dpt = (struct dpt_softc *)ccb->ccb_h.ccb_dpt_ptr; if (error != 0) { if (error != EFBIG) - printf("dpt%d: Unexepected error 0x%x returned from " - "bus_dmamap_load\n", dpt->unit, error); + device_printf(dpt->dev, + "Unexepected error 0x%x returned from " + "bus_dmamap_load\n", error); if (ccb->ccb_h.status == CAM_REQ_INPROG) { xpt_freeze_devq(ccb->ccb_h.path, /*count*/1); ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN; @@ -787,8 +778,6 @@ dptexecuteccb(void *arg, bus_dma_segment dccb->eata_ccb.cp_datalen = 0; } - s = splcam(); - /* * Last time we need to check if this CCB needs to * be aborted. @@ -798,16 +787,14 @@ dptexecuteccb(void *arg, bus_dma_segment bus_dmamap_unload(dpt->buffer_dmat, dccb->dmamap); dptfreeccb(dpt, dccb); xpt_done(ccb); - splx(s); return; } dccb->state |= DCCB_ACTIVE; ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&dpt->pending_ccb_list, &ccb->ccb_h, sim_links.le); - ccb->ccb_h.timeout_ch = - timeout(dpttimeout, (caddr_t)dccb, - (ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&dccb->timer, (ccb->ccb_h.timeout * hz) / 1000, + dpttimeout, dccb); if (dpt_send_eata_command(dpt, &dccb->eata_ccb, dccb->eata_ccb.cp_busaddr, EATA_CMD_DMA_SEND_CP, 0, 0, 0, 0) != 0) { @@ -817,8 +804,6 @@ dptexecuteccb(void *arg, bus_dma_segment dptfreeccb(dpt, dccb); xpt_done(ccb); } - - splx(s); } static void @@ -829,6 +814,7 @@ dpt_action(struct cam_sim *sim, union cc CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("dpt_action\n")); dpt = (struct dpt_softc *)cam_sim_softc(sim); + mtx_assert(&dpt->lock, MA_OWNED); if ((dpt->state & DPT_HA_SHUTDOWN_ACTIVE) != 0) { xpt_print_path(ccb->ccb_h.path); @@ -856,11 +842,7 @@ dpt_action(struct cam_sim *sim, union cc return; } if ((dccb = dptgetccb(dpt)) == NULL) { - int s; - - s = splcam(); dpt->resource_shortage = 1; - splx(s); xpt_freeze_simq(sim, /*count*/1); ccb->ccb_h.status = CAM_REQUEUE_REQ; xpt_done(ccb); @@ -934,10 +916,8 @@ dpt_action(struct cam_sim *sim, union cc * to a single buffer. */ if ((ccbh->flags & CAM_DATA_PHYS) == 0) { - int s; int error; - s = splsoftvm(); error = bus_dmamap_load(dpt->buffer_dmat, dccb->dmamap, @@ -955,7 +935,6 @@ dpt_action(struct cam_sim *sim, union cc xpt_freeze_simq(sim, 1); dccb->state |= CAM_RELEASE_SIMQ; } - splx(s); } else { struct bus_dma_segment seg; @@ -1105,7 +1084,6 @@ dpt_action(struct cam_sim *sim, union cc * This routine will try to send an EATA command to the DPT HBA. * It will, by default, try 20,000 times, waiting 50us between tries. * It returns 0 on success and 1 on failure. - * It is assumed to be called at splcam(). */ static int dpt_send_eata_command(dpt_softc_t *dpt, eata_ccb_t *cmd_block, @@ -1183,9 +1161,7 @@ dpt_alloc(device_t dev) dpt_softc_t *dpt = device_get_softc(dev); int i; - dpt->tag = rman_get_bustag(dpt->io_res); - dpt->bsh = rman_get_bushandle(dpt->io_res) + dpt->io_offset; - dpt->unit = device_get_unit(dev); + mtx_init(&dpt->lock, "dpt", NULL, MTX_DEF); SLIST_INIT(&dpt->free_dccb_list); LIST_INIT(&dpt->pending_ccb_list); for (i = 0; i < MAX_CHANNELS; i++) @@ -1229,6 +1205,7 @@ dpt_free(struct dpt_softc *dpt) case 0: break; } + mtx_destroy(&dpt->lock); } int @@ -1301,9 +1278,10 @@ dpt_init(struct dpt_softc *dpt) dpt->init_level = 0; SLIST_INIT(&dpt->sg_maps); + mtx_lock(&dpt->lock); #ifdef DPT_RESET_BOARD - printf("dpt%d: resetting HBA\n", dpt->unit); + device_printf(dpt->dev, "resetting HBA\n"); dpt_outb(dpt, HA_WCOMMAND, EATA_CMD_RESET); DELAY(750000); /* XXX Shouldn't we poll a status register or something??? */ @@ -1320,8 +1298,8 @@ dpt_init(struct dpt_softc *dpt) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &dpt->sg_dmat) != 0) { goto error_exit; } @@ -1357,8 +1335,8 @@ dpt_init(struct dpt_softc *dpt) sizeof(conf), 0xc1, 7, 1); if (retval != 0) { - printf("dpt%d: Failed to get board configuration\n", dpt->unit); - return (retval); + device_printf(dpt->dev, "Failed to get board configuration\n"); + goto error_exit; } bcopy(&dccb[1], &conf, sizeof(conf)); @@ -1366,8 +1344,8 @@ dpt_init(struct dpt_softc *dpt) retval = dpt_get_conf(dpt, dccb, sg_map->sg_physaddr + sizeof(dpt_sp_t), sizeof(dpt->board_data), 0, conf.scsi_id0, 0); if (retval != 0) { - printf("dpt%d: Failed to get inquiry information\n", dpt->unit); - return (retval); + device_printf(dpt->dev, "Failed to get inquiry information\n"); + goto error_exit; } bcopy(&dccb[1], &dpt->board_data, sizeof(dpt->board_data)); @@ -1416,8 +1394,8 @@ dpt_init(struct dpt_softc *dpt) dpt->max_dccbs = ntohs(conf.queuesiz); if (dpt->max_dccbs > 256) { - printf("dpt%d: Max CCBs reduced from %d to " - "256 due to tag algorithm\n", dpt->unit, dpt->max_dccbs); + device_printf(dpt->dev, "Max CCBs reduced from %d to " + "256 due to tag algorithm\n", dpt->max_dccbs); dpt->max_dccbs = 256; } @@ -1450,9 +1428,10 @@ dpt_init(struct dpt_softc *dpt) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &dpt->lock, &dpt->buffer_dmat) != 0) { - printf("dpt: bus_dma_tag_create(...,dpt->buffer_dmat) failed\n"); + device_printf(dpt->dev, + "bus_dma_tag_create(...,dpt->buffer_dmat) failed\n"); goto error_exit; } @@ -1472,10 +1451,11 @@ dpt_init(struct dpt_softc *dpt) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &dpt->dccb_dmat) != 0) { - printf("dpt: bus_dma_tag_create(...,dpt->dccb_dmat) failed\n"); + device_printf(dpt->dev, + "bus_dma_tag_create(...,dpt->dccb_dmat) failed\n"); goto error_exit; } @@ -1484,7 +1464,8 @@ dpt_init(struct dpt_softc *dpt) /* Allocation for our ccbs and interrupt status packet */ if (bus_dmamem_alloc(dpt->dccb_dmat, (void **)&dpt->dpt_dccbs, BUS_DMA_NOWAIT, &dpt->dccb_dmamap) != 0) { - printf("dpt: bus_dmamem_alloc(dpt->dccb_dmat,...) failed\n"); + device_printf(dpt->dev, + "bus_dmamem_alloc(dpt->dccb_dmat,...) failed\n"); goto error_exit; } @@ -1510,7 +1491,8 @@ dpt_init(struct dpt_softc *dpt) /* Allocate our first batch of ccbs */ if (dptallocccbs(dpt) == 0) { - printf("dpt: dptallocccbs(dpt) == 0\n"); + device_printf(dpt->dev, "dptallocccbs(dpt) == 0\n"); + mtx_unlock(&dpt->lock); return (2); } @@ -1526,8 +1508,8 @@ dpt_init(struct dpt_softc *dpt) strp += string_sizes[i]; } - printf("dpt%d: %.8s %.16s FW Rev. %.4s, ", - dpt->unit, dpt->board_data.vendor, + device_printf(dpt->dev, "%.8s %.16s FW Rev. %.4s, ", + dpt->board_data.vendor, dpt->board_data.modelNum, dpt->board_data.firmware); printf("%d channel%s, ", dpt->channels, dpt->channels > 1 ? "s" : ""); @@ -1540,9 +1522,11 @@ dpt_init(struct dpt_softc *dpt) } printf("%d CCBs\n", dpt->max_dccbs); + mtx_unlock(&dpt->lock); return (0); error_exit: + mtx_unlock(&dpt->lock); return (1); } @@ -1559,12 +1543,13 @@ dpt_attach(dpt_softc_t *dpt) if (devq == NULL) return (0); + mtx_lock(&dpt->lock); for (i = 0; i < dpt->channels; i++) { /* * Construct our SIM entry */ dpt->sims[i] = cam_sim_alloc(dpt_action, dpt_poll, "dpt", - dpt, dpt->unit, &Giant, + dpt, device_get_unit(dpt->dev), &dpt->lock, /*untagged*/2, /*tagged*/dpt->max_dccbs, devq); if (dpt->sims[i] == NULL) { @@ -1594,6 +1579,7 @@ dpt_attach(dpt_softc_t *dpt) } } + mtx_unlock(&dpt->lock); if (i > 0) EVENTHANDLER_REGISTER(shutdown_final, dptshutdown, dpt, SHUTDOWN_PRI_DEFAULT); @@ -1608,6 +1594,7 @@ dpt_detach (device_t dev) dpt = device_get_softc(dev); + mtx_lock(&dpt->lock); for (i = 0; i < dpt->channels; i++) { #if 0 xpt_async(AC_LOST_DEVICE, dpt->paths[i], NULL); @@ -1616,6 +1603,7 @@ dpt_detach (device_t dev) xpt_bus_deregister(cam_sim_path(dpt->sims[i])); cam_sim_free(dpt->sims[i], /*free_devq*/TRUE); } + mtx_unlock(&dpt->lock); dptshutdown((void *)dpt, SHUTDOWN_PRI_DEFAULT); @@ -1633,6 +1621,16 @@ void dpt_intr(void *arg) { dpt_softc_t *dpt; + + dpt = arg; + mtx_lock(&dpt->lock); + dpt_intr_locked(dpt); + mtx_unlock(&dpt->lock); +} + +void +dpt_intr_locked(dpt_softc_t *dpt) +{ dpt_ccb_t *dccb; union ccb *ccb; u_int status; @@ -1641,8 +1639,6 @@ dpt_intr(void *arg) u_int scsi_stat; u_int32_t residue_len; /* Number of bytes not transferred */ - dpt = (dpt_softc_t *)arg; - /* First order of business is to check if this interrupt is for us */ while (((aux_status = dpt_inb(dpt, HA_RAUXSTAT)) & HA_AIRQ) != 0) { @@ -1653,7 +1649,8 @@ dpt_intr(void *arg) */ if (dpt->sp->ccb_busaddr < dpt->dpt_ccb_busbase || dpt->sp->ccb_busaddr >= dpt->dpt_ccb_busend) { - printf("Encountered bogus status packet\n"); + device_printf(dpt->dev, + "Encountered bogus status packet\n"); status = dpt_inb(dpt, HA_RSTATUS); return; } @@ -1664,9 +1661,10 @@ dpt_intr(void *arg) /* Ignore status packets with EOC not set */ if (dpt->sp->EOC == 0) { - printf("dpt%d ERROR: Request %d received with " + device_printf(dpt->dev, + "ERROR: Request %d received with " "clear EOC.\n Marking as LOST.\n", - dpt->unit, dccb->transaction_id); + dccb->transaction_id); #ifdef DPT_HANDLE_TIMEOUTS dccb->state |= DPT_CCB_STATE_MARKED_LOST; @@ -1696,20 +1694,20 @@ dpt_intr(void *arg) /* Check that this is not a board reset interrupt */ if (dpt_just_reset(dpt)) { - printf("dpt%d: HBA rebooted.\n" + device_printf(dpt->dev, "HBA rebooted.\n" " All transactions should be " - "resubmitted\n", - dpt->unit); + "resubmitted\n"); - printf("dpt%d: >>---->> This is incomplete, " - "fix me.... <<----<<", dpt->unit); + device_printf(dpt->dev, + ">>---->> This is incomplete, " + "fix me.... <<----<<"); panic("DPT Rebooted"); } } /* Process CCB */ ccb = dccb->ccb; - untimeout(dpttimeout, dccb, ccb->ccb_h.timeout_ch); + callout_stop(&dccb->timer); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; @@ -1803,7 +1801,7 @@ dptprocesserror(dpt_softc_t *dpt, dpt_cc ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; break; default: - printf("dpt%d: Undocumented Error %x\n", dpt->unit, hba_stat); + device_printf(dpt->dev, "Undocumented Error %x\n", hba_stat); printf("Please mail this message to shimon@simon-shapiro.org\n"); ccb->ccb_h.status = CAM_REQ_CMP_ERR; break; @@ -1818,29 +1816,26 @@ dpttimeout(void *arg) struct dpt_ccb *dccb; union ccb *ccb; struct dpt_softc *dpt; - int s; dccb = (struct dpt_ccb *)arg; ccb = dccb->ccb; dpt = (struct dpt_softc *)ccb->ccb_h.ccb_dpt_ptr; + mtx_assert(&dpt->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("CCB %p - timed out\n", (void *)dccb); - s = splcam(); - /* * Try to clear any pending jobs. FreeBSD will lose interrupts, * leaving the controller suspended, and commands timed-out. * By calling the interrupt handler, any command thus stuck will be * completed. */ - dpt_intr(dpt); + dpt_intr_locked(dpt); if ((dccb->state & DCCB_ACTIVE) == 0) { xpt_print_path(ccb->ccb_h.path); printf("CCB %p - timed out CCB already completed\n", (void *)dccb); - splx(s); return; } @@ -1848,7 +1843,6 @@ dpttimeout(void *arg) dpt_send_immediate(dpt, &dccb->eata_ccb, dccb->eata_ccb.cp_busaddr, /*retries*/20000, EATA_SPECIFIC_ABORT, 0, 0); ccb->ccb_h.status = CAM_CMD_TIMEOUT; - splx(s); } /* @@ -1862,16 +1856,18 @@ dptshutdown(void *arg, int howto) dpt = (dpt_softc_t *)arg; - printf("dpt%d: Shutting down (mode %x) HBA. Please wait...\n", - dpt->unit, howto); + device_printf(dpt->dev, + "Shutting down (mode %x) HBA. Please wait...\n", howto); /* * What we do for a shutdown, is give the DPT early power loss warning */ + mtx_lock(&dpt->lock); dpt_send_immediate(dpt, NULL, 0, EATA_POWER_OFF_WARN, 0, 0, 0); + mtx_unlock(&dpt->lock); DELAY(1000 * 1000 * 5); - printf("dpt%d: Controller was warned of shutdown and is now " - "disabled\n", dpt->unit); + device_printf(dpt->dev, "Controller was warned of shutdown and is now " + "disabled\n"); } /*============================================================================*/ @@ -1890,11 +1886,12 @@ static void dpt_reset_hba(dpt_softc_t *dpt) { eata_ccb_t *ccb; - int ospl; dpt_ccb_t dccb, *dccbp; int result; struct scsi_xfer *xs; - + + mtx_assert(&dpt->lock, MA_OWNED); + /* Prepare a control block. The SCSI command part is immaterial */ dccb.xs = NULL; dccb.flags = 0; @@ -1920,26 +1917,24 @@ dpt_reset_hba(dpt_softc_t *dpt) ccb->cp_scsi_cmd = 0; /* Should be ignored */ /* Lock up the submitted queue. We are very persistant here */ - ospl = splcam(); while (dpt->queue_status & DPT_SUBMITTED_QUEUE_ACTIVE) { DELAY(100); } dpt->queue_status |= DPT_SUBMITTED_QUEUE_ACTIVE; - splx(ospl); /* Send the RESET message */ if ((result = dpt_send_eata_command(dpt, &dccb.eata_ccb, EATA_CMD_RESET, 0, 0, 0, 0)) != 0) { - printf("dpt%d: Failed to send the RESET message.\n" - " Trying cold boot (ouch!)\n", dpt->unit); + device_printf(dpt->dev, "Failed to send the RESET message.\n" + " Trying cold boot (ouch!)\n"); if ((result = dpt_send_eata_command(dpt, &dccb.eata_ccb, EATA_COLD_BOOT, 0, 0, 0, 0)) != 0) { - panic("dpt%d: Faild to cold boot the HBA\n", - dpt->unit); + panic("%s: Faild to cold boot the HBA\n", + device_get_nameunit(dpt->dev)); } #ifdef DPT_MEASURE_PERFORMANCE dpt->performance.cold_boots++; @@ -1950,8 +1945,8 @@ dpt_reset_hba(dpt_softc_t *dpt) dpt->performance.warm_starts++; #endif /* DPT_MEASURE_PERFORMANCE */ - printf("dpt%d: Aborting pending requests. O/S should re-submit\n", - dpt->unit); + device_printf(dpt->dev, + "Aborting pending requests. O/S should re-submit\n"); while ((dccbp = TAILQ_FIRST(&dpt->completed_ccbs)) != NULL) { struct scsi_xfer *xs = dccbp->xs; @@ -1971,13 +1966,11 @@ dpt_reset_hba(dpt_softc_t *dpt) (dccbp->std_callback)(dpt, dccbp->eata_ccb.cp_channel, dccbp); } else { - ospl = splcam(); dpt_Qpush_free(dpt, dccbp); - splx(ospl); } } - printf("dpt%d: reset done aborting all pending commands\n", dpt->unit); + device_printf(dpt->dev, "reset done aborting all pending commands\n"); dpt->queue_status &= ~DPT_SUBMITTED_QUEUE_ACTIVE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 17:10:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D21613B9; Mon, 15 Oct 2012 17:10:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBACD8FC18; Mon, 15 Oct 2012 17:10:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FHAfVE034560; Mon, 15 Oct 2012 17:10:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FHAfel034556; Mon, 15 Oct 2012 17:10:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210151710.q9FHAfel034556@svn.freebsd.org> From: Eitan Adler Date: Mon, 15 Oct 2012 17:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241595 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 17:10:41 -0000 Author: eadler Date: Mon Oct 15 17:10:41 2012 New Revision: 241595 URL: http://svn.freebsd.org/changeset/base/241595 Log: Add my new association with bcr and jkois. Thanks! MFC after: 3 days Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Mon Oct 15 17:02:03 2012 (r241594) +++ head/share/misc/committers-doc.dot Mon Oct 15 17:10:41 2012 (r241595) @@ -58,6 +58,7 @@ brueffer [label="Christian Brueffer\nbru chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] +eadler [label="Eitan Adler\neadler@FreeBSD.org\n2012/10/15"] ebrandi [label="Edson Brandi\nebrandi@FreeBSD.org\n2012/09/13"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2007/02/02"] ganbold [label="Ganbold Tsagaankhuu\nganbold@FreeBSD.org\n2008/02/26"] @@ -91,6 +92,7 @@ zeising [label="Niclas Zeising\nzeising@ bcr -> gavin bcr -> wblock +bcr -> eadler blackend -> ale @@ -125,6 +127,7 @@ jkois -> miwi jkois -> bcr jkois -> gavin jkois -> gjb +jkois -> eadler joel -> zeising From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 17:19:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 410E096F; Mon, 15 Oct 2012 17:19:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293FE8FC16; Mon, 15 Oct 2012 17:19:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FHJlMM036150; Mon, 15 Oct 2012 17:19:47 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FHJl5E036148; Mon, 15 Oct 2012 17:19:47 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201210151719.q9FHJl5E036148@svn.freebsd.org> From: Ed Maste Date: Mon, 15 Oct 2012 17:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241596 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 17:19:48 -0000 Author: emaste Date: Mon Oct 15 17:19:47 2012 New Revision: 241596 URL: http://svn.freebsd.org/changeset/base/241596 Log: Exclude potential circular symlink This does not occur with normal release builds but can happen when reusing these release parts for other purposes. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Oct 15 17:10:41 2012 (r241595) +++ head/release/Makefile Mon Oct 15 17:19:47 2012 (r241596) @@ -84,7 +84,7 @@ src.txz: mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn \ - --exclude CVS --exclude @ usr/src + --exclude CVS --exclude @ --exclude usr/src/release/dist usr/src ports.txz: mkdir -p ${DISTDIR}/usr From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 18:09:42 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADB1C319; Mon, 15 Oct 2012 18:09:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF688FC12; Mon, 15 Oct 2012 18:09:41 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9FI9VUl008873 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Oct 2012 05:09:33 +1100 Date: Tue, 16 Oct 2012 05:09:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet In-Reply-To: <20121015151147.GA92923@stack.nl> Message-ID: <20121016045904.Q15233@besplex.bde.org> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> <20121015151147.GA92923@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-CMAE-Score: 0 X-CMAE-Analysis: v=2.0 cv=f7kQn5OM c=1 sm=1 a=qS4vZm_gVugA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=20xahBMZJpIA:10 a=6I5d2MoRAAAA:8 a=WLNeoykpRNQgHBetxKEA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 18:09:42 -0000 On Mon, 15 Oct 2012, Jilles Tjoelker wrote: > On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: >> On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: >> J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: >> J> > Author: glebius >> J> > Date: Sun Oct 14 15:03:06 2012 >> J> > New Revision: 241546 >> J> > URL: http://svn.freebsd.org/changeset/base/241546 > >> J> > Log: >> J> > Fix defines in r241245. We actually don't define FreeBSD. > >> J> > Reported & tested by: Oleg Ginzburg > >> J> Seems like it should be using 'defined(__FreeBSD_version)' instead? > >> AFAIU, the construction which left after r241546 works fine. Anything >> undefined resolves to zero, so in case of non-FreeBSD build we test >> if (0 > 10000019) and this fails which is what we expect. > >> I have used this construction several times already without any side >> effects. I have also seen it in some software in ports, where it works >> okay, too. > > The C standard indeed permits this, but gcc -Wundef will warn about it. > That compiler warning is in CWARNFLAGS in sys/conf/kern.mk so I suggest > adding the 'defined(__FreeBSD_version) &&'. The C standard requires this, but some misconfigured compilers like gcc -Wundef warn about it, and some non-C compilers like gcc -Wundef -Werror fail on it. The bug is sometimes hidden by -Wno-system-headers, but FreeBSD wants to detect bugs in system headers so it sets -Wsystem-headers at WARNS >= 1, and then the buggy compilers find this non-bug in system headers. The result is uglification of many system headers to use if `defined(__FOO) && ...' instead of depending on this standard and useful feature. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 18:15:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 084FAC33; Mon, 15 Oct 2012 18:15:19 +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 CD4DA8FC1E; Mon, 15 Oct 2012 18:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9FIFIU3044815; Mon, 15 Oct 2012 18:15:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9FIFI6W044813; Mon, 15 Oct 2012 18:15:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210151815.q9FIFI6W044813@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 15 Oct 2012 18:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241597 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 18:15:19 -0000 Author: kib Date: Mon Oct 15 18:15:18 2012 New Revision: 241597 URL: http://svn.freebsd.org/changeset/base/241597 Log: Acquire the rangelock for truncate(2) as well. Reported and reviewed by: avg Tested by: pho MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Oct 15 17:19:47 2012 (r241596) +++ head/sys/kern/vfs_syscalls.c Mon Oct 15 18:15:18 2012 (r241597) @@ -3433,10 +3433,10 @@ kern_truncate(struct thread *td, char *p { struct mount *mp; struct vnode *vp; + void *rl_cookie; struct vattr vattr; - int error; struct nameidata nd; - int vfslocked; + int error, vfslocked; if (length < 0) return(EINVAL); @@ -3445,7 +3445,9 @@ kern_truncate(struct thread *td, char *p return (error); vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; + rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { + vn_rangelock_unlock(vp, rl_cookie); vrele(vp); VFS_UNLOCK_GIANT(vfslocked); return (error); @@ -3464,8 +3466,10 @@ kern_truncate(struct thread *td, char *p vattr.va_size = length; error = VOP_SETATTR(vp, &vattr, td->td_ucred); } - vput(vp); + VOP_UNLOCK(vp, 0); vn_finished_write(mp); + vn_rangelock_unlock(vp, rl_cookie); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 20:25:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0D2F45B; Mon, 15 Oct 2012 20:25:41 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 6595A8FC0A; Mon, 15 Oct 2012 20:25:40 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 13824686; Mon, 15 Oct 2012 22:24:18 +0200 (CEST) Date: Mon, 15 Oct 2012 22:26:16 +0200 From: Pawel Jakub Dawidek To: Maxim Sobolev Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib Message-ID: <20121015202615.GJ1383@garage.freebsd.pl> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rpGc+ACYPE+RMC+Z" Content-Disposition: inline In-Reply-To: <201210150821.q9F8Lobc047576@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 20:25:42 -0000 --rpGc+ACYPE+RMC+Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Mon Oct 15 08:21:49 2012 > New Revision: 241576 > URL: http://svn.freebsd.org/changeset/base/241576 >=20 > Log: > Add per-second scheduling into the cron(8). Right now it's > only available via the new @every_second shortcut. ENOTIME to > implement crontab(5) format extensions to allow more flexible > scheduling. > =20 > In order to address some concerns expressed by Terry Lambert > while discussing the topic few years ago, about per-second cron > possibly causing some bad effects on /etc/crontab by stat()ing > it every second instead of every minute now (i.e. atime update), > only check that database needs to be reloaded on every 60-th > loop run. This should be close enough to the current behaviour. > =20 > Add "@every_minute" shortcut while I am here. Do I read the code correctly and the cron deamon will wake up every second now even if @every_second is not used at all? > =20 > MFC after: 1 month >=20 > Modified: > head/usr.sbin/cron/cron/cron.c > head/usr.sbin/cron/cron/cron.h > head/usr.sbin/cron/crontab/crontab.5 > head/usr.sbin/cron/lib/entry.c >=20 > Modified: head/usr.sbin/cron/cron/cron.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/cron/cron/cron.c Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/cron/cron.c Mon Oct 15 08:21:49 2012 (r241576) > @@ -98,6 +98,7 @@ main(argc, argv) > char *argv[]; > { > cron_db database; > + int runnum; > =20 > ProgramName =3D argv[0]; > =20 > @@ -149,21 +150,24 @@ main(argc, argv) > load_database(&database); > run_reboot_jobs(&database); > cron_sync(); > + runnum =3D 0; > while (TRUE) { > # if DEBUGGING > /* if (!(DebugFlags & DTEST)) */ > # endif /*DEBUGGING*/ > cron_sleep(&database); > =20 > - load_database(&database); > + if (runnum % 60 =3D=3D 0) > + load_database(&database); > =20 > /* do this iteration > */ > cron_tick(&database); > =20 > - /* sleep 1 minute > + /* sleep 1 second > */ > - TargetTime +=3D 60; > + TargetTime +=3D 1; > + runnum +=3D 1; > } > } > =20 > @@ -194,22 +198,23 @@ cron_tick(db) > static time_t diff =3D 0, /* time difference in seconds from the last o= ffset change */ > difflimit =3D 0; /* end point for the time zone correction */ > struct tm otztm; /* time in the old time zone */ > - int otzminute, otzhour, otzdom, otzmonth, otzdow; > + int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; > register struct tm *tm =3D localtime(&TargetTime); > - register int minute, hour, dom, month, dow; > + register int second, minute, hour, dom, month, dow; > register user *u; > register entry *e; > =20 > /* make 0-based values out of these so we can use them as indicies > */ > + second =3D tm->tm_sec -FIRST_SECOND; > minute =3D tm->tm_min -FIRST_MINUTE; > hour =3D tm->tm_hour -FIRST_HOUR; > dom =3D tm->tm_mday -FIRST_DOM; > month =3D tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH; > dow =3D tm->tm_wday -FIRST_DOW; > =20 > - Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n", > - getpid(), minute, hour, dom, month, dow)) > + Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d,%d)\n", > + getpid(), second, minute, hour, dom, month, dow)) > =20 > if (dst_enabled && last_time !=3D 0=20 > && TargetTime > last_time /* exclude stepping back */ > @@ -262,6 +267,7 @@ cron_tick(db) > =20 > /* make 0-based values out of these so we can use them as indicies > */ > + otzsecond =3D otztm.tm_sec -FIRST_SECOND; > otzminute =3D otztm.tm_min -FIRST_MINUTE; > otzhour =3D otztm.tm_hour -FIRST_HOUR; > otzdom =3D otztm.tm_mday -FIRST_DOM; > @@ -283,7 +289,8 @@ cron_tick(db) > e->uid, e->gid, e->cmd)) > =20 > if ( diff !=3D 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { > - if (bit_test(e->minute, otzminute) > + if (bit_test(e->second, otzsecond) > + && bit_test(e->minute, otzminute) > && bit_test(e->hour, otzhour) > && bit_test(e->month, otzmonth) > && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) > @@ -302,7 +309,8 @@ cron_tick(db) > continue; > } > =20 > - if (bit_test(e->minute, minute) > + if (bit_test(e->second, second) > + && bit_test(e->minute, minute) > && bit_test(e->hour, hour) > && bit_test(e->month, month) > && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) >=20 > Modified: head/usr.sbin/cron/cron/cron.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/cron/cron/cron.h Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/cron/cron.h Mon Oct 15 08:21:49 2012 (r241576) > @@ -124,6 +124,10 @@ > LineNumber =3D ln; \ > } > =20 > +#define FIRST_SECOND 0 > +#define LAST_SECOND 59 > +#define SECOND_COUNT (LAST_SECOND - FIRST_SECOND + 1) > + > #define FIRST_MINUTE 0 > #define LAST_MINUTE 59 > #define MINUTE_COUNT (LAST_MINUTE - FIRST_MINUTE + 1) > @@ -165,6 +169,7 @@ typedef struct _entry { > #endif > char **envp; > char *cmd; > + bitstr_t bit_decl(second, SECOND_COUNT); > bitstr_t bit_decl(minute, MINUTE_COUNT); > bitstr_t bit_decl(hour, HOUR_COUNT); > bitstr_t bit_decl(dom, DOM_COUNT); >=20 > Modified: head/usr.sbin/cron/crontab/crontab.5 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/cron/crontab/crontab.5 Mon Oct 15 07:57:55 2012 (r24157= 5) > +++ head/usr.sbin/cron/crontab/crontab.5 Mon Oct 15 08:21:49 2012 (r24157= 6) > @@ -232,6 +232,8 @@ string meaning > @daily Run once a day, "0 0 * * *". > @midnight (same as @daily) > @hourly Run once an hour, "0 * * * *". > +@every_minute Run once a minute, "*/1 * * * *". > +@every_second Run once a second. > .Ed > .Sh EXAMPLE CRON FILE > .Bd -literal >=20 > Modified: head/usr.sbin/cron/lib/entry.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/cron/lib/entry.c Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/lib/entry.c Mon Oct 15 08:21:49 2012 (r241576) > @@ -151,6 +151,7 @@ load_entry(file, error_func, pw, envp) > e->flags |=3D WHEN_REBOOT; > } else if (!strcmp("yearly", cmd) || !strcmp("annually", cmd)){ > Debug(DPARS, ("load_entry()...yearly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_set(e->dom, 0); > @@ -159,6 +160,7 @@ load_entry(file, error_func, pw, envp) > e->flags |=3D DOW_STAR; > } else if (!strcmp("monthly", cmd)) { > Debug(DPARS, ("load_entry()...monthly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_set(e->dom, 0); > @@ -167,6 +169,7 @@ load_entry(file, error_func, pw, envp) > e->flags |=3D DOW_STAR; > } else if (!strcmp("weekly", cmd)) { > Debug(DPARS, ("load_entry()...weekly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > @@ -175,6 +178,7 @@ load_entry(file, error_func, pw, envp) > bit_set(e->dow, 0); > } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) { > Debug(DPARS, ("load_entry()...daily shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > @@ -182,11 +186,28 @@ load_entry(file, error_func, pw, envp) > bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > } else if (!strcmp("hourly", cmd)) { > Debug(DPARS, ("load_entry()...hourly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); > bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); > bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > + } else if (!strcmp("every_minute", cmd)) { > + Debug(DPARS, ("load_entry()...every_minute shortcut\n")) > + bit_set(e->second, 0); > + bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); > + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); > + bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > + bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); > + bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > + } else if (!strcmp("every_second", cmd)) { > + Debug(DPARS, ("load_entry()...every_second shortcut\n")) > + bit_nset(e->second, 0, (LAST_SECOND-FIRST_SECOND+1)); > + bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); > + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); > + bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > + bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); > + bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > } else { > ecode =3D e_timespec; > goto eof; --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --rpGc+ACYPE+RMC+Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlB8cWcACgkQForvXbEpPzTJcACfbxP5m46avBuKBBv+wFkEVp/A SmAAnjEcJqYtDRcIHlY1MUGpC+RFVTVk =/UTG -----END PGP SIGNATURE----- --rpGc+ACYPE+RMC+Z-- From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 20:44:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB763D6C; Mon, 15 Oct 2012 20:44:55 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id B44358FC08; Mon, 15 Oct 2012 20:44:55 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q9FKimsi053307; Mon, 15 Oct 2012 14:44:48 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q9FKijiw087725; Mon, 15 Oct 2012 14:44:45 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Ian Lepore To: Pawel Jakub Dawidek In-Reply-To: <20121015202615.GJ1383@garage.freebsd.pl> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> Content-Type: text/plain; charset="us-ascii" Date: Mon, 15 Oct 2012 14:44:45 -0600 Message-ID: <1350333885.1123.153.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 20:44:56 -0000 On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: > On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: > > Author: sobomax > > Date: Mon Oct 15 08:21:49 2012 > > New Revision: 241576 > > URL: http://svn.freebsd.org/changeset/base/241576 > > > > Log: > > Add per-second scheduling into the cron(8). Right now it's > > only available via the new @every_second shortcut. ENOTIME to > > implement crontab(5) format extensions to allow more flexible > > scheduling. > > > > In order to address some concerns expressed by Terry Lambert > > while discussing the topic few years ago, about per-second cron > > possibly causing some bad effects on /etc/crontab by stat()ing > > it every second instead of every minute now (i.e. atime update), > > only check that database needs to be reloaded on every 60-th > > loop run. This should be close enough to the current behaviour. > > > > Add "@every_minute" shortcut while I am here. > > Do I read the code correctly and the cron deamon will wake up every > second now even if @every_second is not used at all? It appears to, which I don't think is a bad thing at all. But the way it waits is to wake up, do some work, and go back to sleep for an integer 1 second. That will occasionally lead to a second in which no wakeup happens, as the "do some work" part always takes some fraction of a second. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 20:52:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFA96185; Mon, 15 Oct 2012 20:52:30 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 62C718FC14; Mon, 15 Oct 2012 20:52:30 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so7283477oag.13 for ; Mon, 15 Oct 2012 13:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=b1B/oTVJYyr5tyD293cwC48JtkE9egVrw6mmcc87AYo=; b=oS11gMHiDuBPB+8LnlUtVSTt4nloeojv6q4c1REy3fGGnE2iQGqdmJuYFQetTIuQzw vedL1acANi3MKJdZLtWuHiM8EFcZnk/bh57KIHgAV5crwqhd0k1vE1HQk8SnWGU25GEF dWEq3w9XB5uw+BW6sZWn+ZihTftOKq+o4hhRe8hsEquG3XTZ2e2e5pCecMpVPySkAxqI GjbLzagF/mZhiRuoOXkh/U2TDkF2HL7n2I1i4nUk5ThrqV0iZI+4NLD+ffz50V/WlXYq 3alRRtzxW8NNrT5V6YyTz/WN5LaDHfV2fjk5iVFDu13jSjRUBL5pXBjQcSmI8YhnYsPK grpw== MIME-Version: 1.0 Received: by 10.60.170.15 with SMTP id ai15mr10593167oec.62.1350334349054; Mon, 15 Oct 2012 13:52:29 -0700 (PDT) Received: by 10.76.167.202 with HTTP; Mon, 15 Oct 2012 13:52:29 -0700 (PDT) In-Reply-To: <1350333885.1123.153.camel@revolution.hippie.lan> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> Date: Mon, 15 Oct 2012 13:52:29 -0700 Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Garrett Cooper To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 20:52:31 -0000 On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore wrote: > On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: >> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: >> > Author: sobomax >> > Date: Mon Oct 15 08:21:49 2012 >> > New Revision: 241576 >> > URL: http://svn.freebsd.org/changeset/base/241576 >> > >> > Log: >> > Add per-second scheduling into the cron(8). Right now it's >> > only available via the new @every_second shortcut. ENOTIME to >> > implement crontab(5) format extensions to allow more flexible >> > scheduling. >> > >> > In order to address some concerns expressed by Terry Lambert >> > while discussing the topic few years ago, about per-second cron >> > possibly causing some bad effects on /etc/crontab by stat()ing >> > it every second instead of every minute now (i.e. atime update), >> > only check that database needs to be reloaded on every 60-th >> > loop run. This should be close enough to the current behaviour. >> > >> > Add "@every_minute" shortcut while I am here. >> >> Do I read the code correctly and the cron deamon will wake up every >> second now even if @every_second is not used at all? > > It appears to, which I don't think is a bad thing at all. But the way > it waits is to wake up, do some work, and go back to sleep for an > integer 1 second. That will occasionally lead to a second in which no > wakeup happens, as the "do some work" part always takes some fraction of > a second. This is silly. It should be waking up at the lowest common denominator of time quanta, not every second; this could be determined via the crontab its managing. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 21:18:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A77989C; Mon, 15 Oct 2012 21:18:15 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id DF7648FC18; Mon, 15 Oct 2012 21:18:14 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q9FLIEVw054257; Mon, 15 Oct 2012 15:18:14 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q9FLIBXO087756; Mon, 15 Oct 2012 15:18:11 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Ian Lepore To: Garrett Cooper In-Reply-To: References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Mon, 15 Oct 2012 15:18:11 -0600 Message-ID: <1350335891.1123.160.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 21:18:15 -0000 On Mon, 2012-10-15 at 13:52 -0700, Garrett Cooper wrote: > On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore > wrote: > > On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: > >> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: > >> > Author: sobomax > >> > Date: Mon Oct 15 08:21:49 2012 > >> > New Revision: 241576 > >> > URL: http://svn.freebsd.org/changeset/base/241576 > >> > > >> > Log: > >> > Add per-second scheduling into the cron(8). Right now it's > >> > only available via the new @every_second shortcut. ENOTIME to > >> > implement crontab(5) format extensions to allow more flexible > >> > scheduling. > >> > > >> > In order to address some concerns expressed by Terry Lambert > >> > while discussing the topic few years ago, about per-second cron > >> > possibly causing some bad effects on /etc/crontab by stat()ing > >> > it every second instead of every minute now (i.e. atime update), > >> > only check that database needs to be reloaded on every 60-th > >> > loop run. This should be close enough to the current behaviour. > >> > > >> > Add "@every_minute" shortcut while I am here. > >> > >> Do I read the code correctly and the cron deamon will wake up every > >> second now even if @every_second is not used at all? > > > > It appears to, which I don't think is a bad thing at all. But the way > > it waits is to wake up, do some work, and go back to sleep for an > > integer 1 second. That will occasionally lead to a second in which no > > wakeup happens, as the "do some work" part always takes some fraction of > > a second. > > This is silly. It should be waking up at the lowest common > denominator of time quanta, not every second; this could be determined > via the crontab its managing. In 1987 I would have been outraged at waking up at 1hz needlessly. Sitting here typing on a machine that's doing 12,000 interrupts/sec just to maintain clocks, and top shows interrupts using 0.0% cpu, it's hard to get too upset about a 1hz loop anymore. On the other hand, if people are going to rely on this new feature of being able to execute something every second, then the integer sleep needs to be changed to a nanosleep() calculated to truly wake up at a 1hz rate without eliding seconds now and then. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 21:31:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64491C14; Mon, 15 Oct 2012 21:31:27 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id C6D848FC08; Mon, 15 Oct 2012 21:31:26 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so7330870oag.13 for ; Mon, 15 Oct 2012 14:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mcPLte4l+fnAzLz00reF/Ipk/ZZiLl93fRcKavtyLn4=; b=ktvXCMaUfne34Uha0ZVU22PlTwY0+XVZErNyPAenyekPa1qfQpZh5oLRvPQIqaW/GO TPY/pncHSAIqXxuR3kQxQVw063e1zky1y49xtnTYAbnlDkFzcZgpi9leqSM+FEaS6weG X/XLHYZV3OcL01P6WCbRgE6gIO64s+pGjYncGGhFBnnSXvK4mSSiLGWNy/PJm2HKmE2W 6mtZctDLyrhbY1YLsPNJqyvgO0/dXDYeRLUzEe9iEHjcOvUbQmm+swdRCUQxo/HU0Xdz Ohw+rsQMvK2SHDWH5UFV3cCpbsH1DDwdOvUf7e2vwiWM3Ek3gOEUMn65oASQu81JOrDP mFmg== MIME-Version: 1.0 Received: by 10.60.30.136 with SMTP id s8mr10569021oeh.81.1350336686158; Mon, 15 Oct 2012 14:31:26 -0700 (PDT) Received: by 10.76.167.202 with HTTP; Mon, 15 Oct 2012 14:31:26 -0700 (PDT) In-Reply-To: <1350335891.1123.160.camel@revolution.hippie.lan> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> Date: Mon, 15 Oct 2012 14:31:26 -0700 Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Garrett Cooper To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 21:31:27 -0000 On Mon, Oct 15, 2012 at 2:18 PM, Ian Lepore wrote: > On Mon, 2012-10-15 at 13:52 -0700, Garrett Cooper wrote: >> On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore >> wrote: >> > On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: >> >> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: >> >> > Author: sobomax >> >> > Date: Mon Oct 15 08:21:49 2012 >> >> > New Revision: 241576 >> >> > URL: http://svn.freebsd.org/changeset/base/241576 >> >> > >> >> > Log: >> >> > Add per-second scheduling into the cron(8). Right now it's >> >> > only available via the new @every_second shortcut. ENOTIME to >> >> > implement crontab(5) format extensions to allow more flexible >> >> > scheduling. >> >> > >> >> > In order to address some concerns expressed by Terry Lambert >> >> > while discussing the topic few years ago, about per-second cron >> >> > possibly causing some bad effects on /etc/crontab by stat()ing >> >> > it every second instead of every minute now (i.e. atime update), >> >> > only check that database needs to be reloaded on every 60-th >> >> > loop run. This should be close enough to the current behaviour. >> >> > >> >> > Add "@every_minute" shortcut while I am here. >> >> >> >> Do I read the code correctly and the cron deamon will wake up every >> >> second now even if @every_second is not used at all? >> > >> > It appears to, which I don't think is a bad thing at all. But the way >> > it waits is to wake up, do some work, and go back to sleep for an >> > integer 1 second. That will occasionally lead to a second in which no >> > wakeup happens, as the "do some work" part always takes some fraction of >> > a second. >> >> This is silly. It should be waking up at the lowest common >> denominator of time quanta, not every second; this could be determined >> via the crontab its managing. > > In 1987 I would have been outraged at waking up at 1hz needlessly. > Sitting here typing on a machine that's doing 12,000 interrupts/sec just > to maintain clocks, and top shows interrupts using 0.0% cpu, it's hard > to get too upset about a 1hz loop anymore. > > On the other hand, if people are going to rely on this new feature of > being able to execute something every second, then the integer sleep > needs to be changed to a nanosleep() calculated to truly wake up at a > 1hz rate without eliding seconds now and then. This is also assuming that there's only one copy of cron running for the entire system and per-user. On a more heavily loaded system this isn't necessarily the case. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 22:21:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30215CC3; Mon, 15 Oct 2012 22:21:32 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 0986F8FC0A; Mon, 15 Oct 2012 22:21:32 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id BD5F51DB1E; Mon, 15 Oct 2012 15:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1350339691; bh=BCVaqHDNRiga+vozp8KmS/IJWvKwI7JfaQ8K5ms/gXc=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=f9IQsKWpgHuZGgw21lDEZNKbM0iMydK/8zBnXYCu4FZT7b5kIVj16klIrqAfJYm67 uyxidSPU2Uuxg9mHfkYAU4XP1WOldazjK9y2Ktrk5Z2F6RazZ+JmINLT6awNjpZA1V pAEH04C6UU/k287lHmG7p5ps5TAkSxph4XSwMy2E= Message-ID: <507C8C6B.80707@delphij.net> Date: Mon, 15 Oct 2012 15:21:31 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> In-Reply-To: X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ian Lepore , src-committers@freebsd.org, Pawel Jakub Dawidek , Maxim Sobolev , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 22:21:32 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 10/15/12 13:52, Garrett Cooper wrote: > On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore > wrote: >> On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: >>> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: >>>> Author: sobomax Date: Mon Oct 15 08:21:49 2012 New Revision: >>>> 241576 URL: http://svn.freebsd.org/changeset/base/241576 >>>> >>>> Log: Add per-second scheduling into the cron(8). Right now >>>> it's only available via the new @every_second shortcut. >>>> ENOTIME to implement crontab(5) format extensions to allow >>>> more flexible scheduling. >>>> >>>> In order to address some concerns expressed by Terry Lambert >>>> while discussing the topic few years ago, about per-second >>>> cron possibly causing some bad effects on /etc/crontab by >>>> stat()ing it every second instead of every minute now (i.e. >>>> atime update), only check that database needs to be reloaded >>>> on every 60-th loop run. This should be close enough to the >>>> current behaviour. >>>> >>>> Add "@every_minute" shortcut while I am here. >>> >>> Do I read the code correctly and the cron deamon will wake up >>> every second now even if @every_second is not used at all? >> >> It appears to, which I don't think is a bad thing at all. But >> the way it waits is to wake up, do some work, and go back to >> sleep for an integer 1 second. That will occasionally lead to a >> second in which no wakeup happens, as the "do some work" part >> always takes some fraction of a second. > > This is silly. It should be waking up at the lowest common > denominator of time quanta, not every second; this could be > determined via the crontab its managing. This will break crontab change detection -- instead of pickup the change in a minute, now you end up with the smallest common divisor. BTW it seems that I need to clean dust on my forever WIP cron update sooner :-/ Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJQfIxrAAoJEG80Jeu8UPuz8AEH/RHsUiCrbjws2GwyNcIn2Qz5 JEkmK4SAvMigIok2JZNyuKtP/6j9wmhk6EtuDLV9s196hdarfBPl/JJcv7x+JM/W OTOtJuh8i59bTNSSUPVUlgEpXXh8I77CfVO3RfadcchCMzkhUuonHGpgqVflYS4n LbjJEbZMrGq7JSat3kjUX6bU+jOb2cA1Ieoe9ykp3vsFZWHFeAimMzPcH/knO/wi M9YgzO4mfuATYUDDcj6Istvm2O3mwsftPwTPCe2RUov5fvWG05InygwqglaYtvx9 e6tKYqbwbd+kVr9ZOLVc9Izk51b3pATDuItYDSXUyI2DW8ymsgvvdk2vOkZfDnQ= =q1rQ -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 22:22:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D379E39; Mon, 15 Oct 2012 22:22:12 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [93.89.92.64]) by mx1.freebsd.org (Postfix) with ESMTP id EAC068FC08; Mon, 15 Oct 2012 22:22:11 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 9858FE659F; Mon, 15 Oct 2012 23:25:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=mail; bh=PISz2/vbfJbo GLVsKxeu+9mu3yM=; b=QuNuQvfxcN+UXv3vZPN3yUSatdKIUqvOC84x/vlMx9qg 5oVWbcD+DfAtXBToNTCyUkLkmrVSV84+fXdDpACDVAIPMbfqgvTE9ih/P5dGOXzi o1ZT3yKBkX5pF3KXSv6c/v8sUysz21sWtNyyCAJgzCog0rlHp2+57cY74FyggA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=mail; b=nduzYi +kk0cwK8smaWjnXM8l1YrjBnUMDu2LUnsscKhfPFNvF42durPepOBTAJPd4V59Na 5TuhaaCbCsgOFbJ4j4VhgCnDkRyTe6doNFfy0CdV1c3+der+4Wgt5KhDrpL8g2kF f0SMERUoZkopvsIjjDsysTQfAi49GT2glwheg= Received: from [192.168.2.33] (unknown [93.89.81.205]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 55C31E657C; Mon, 15 Oct 2012 23:25:37 +0100 (BST) Message-ID: <507C8C8B.8010704@cran.org.uk> Date: Mon, 15 Oct 2012 23:22:03 +0100 From: Bruce Cran User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> In-Reply-To: <1350335891.1123.160.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Maxim Sobolev , src-committers@freebsd.org, Pawel Jakub Dawidek , Garrett Cooper , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 22:22:12 -0000 On 15/10/2012 22:18, Ian Lepore wrote: > In 1987 I would have been outraged at waking up at 1hz needlessly. > Sitting here typing on a machine that's doing 12,000 interrupts/sec just > to maintain clocks, and top shows interrupts using 0.0% cpu, it's hard > to get too upset about a 1hz loop anymore. People are getting upset about unnecessary wakeups again because it's possible to save quite a bit of power by keeping the system idle. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 22:23:36 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3241FB3; Mon, 15 Oct 2012 22:23:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 3DFAC8FC08; Mon, 15 Oct 2012 22:23:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9FMNYKM022495; Tue, 16 Oct 2012 02:23:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9FMNX9S022494; Tue, 16 Oct 2012 02:23:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 16 Oct 2012 02:23:33 +0400 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet Message-ID: <20121015222333.GY89655@FreeBSD.org> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> <20121015151147.GA92923@stack.nl> <20121016045904.Q15233@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20121016045904.Q15233@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin , Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 22:23:37 -0000 On Tue, Oct 16, 2012 at 05:09:31AM +1100, Bruce Evans wrote: B> > On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: B> >> On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: B> >> J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: B> >> J> > Author: glebius B> >> J> > Date: Sun Oct 14 15:03:06 2012 B> >> J> > New Revision: 241546 B> >> J> > URL: http://svn.freebsd.org/changeset/base/241546 B> > B> >> J> > Log: B> >> J> > Fix defines in r241245. We actually don't define FreeBSD. B> > B> >> J> > Reported & tested by: Oleg Ginzburg B> > B> >> J> Seems like it should be using 'defined(__FreeBSD_version)' instead? B> > B> >> AFAIU, the construction which left after r241546 works fine. Anything B> >> undefined resolves to zero, so in case of non-FreeBSD build we test B> >> if (0 > 10000019) and this fails which is what we expect. B> > B> >> I have used this construction several times already without any side B> >> effects. I have also seen it in some software in ports, where it works B> >> okay, too. B> > B> > The C standard indeed permits this, but gcc -Wundef will warn about it. B> > That compiler warning is in CWARNFLAGS in sys/conf/kern.mk so I suggest B> > adding the 'defined(__FreeBSD_version) &&'. B> B> The C standard requires this, but some misconfigured compilers like B> gcc -Wundef warn about it, and some non-C compilers like gcc -Wundef B> -Werror fail on it. The bug is sometimes hidden by -Wno-system-headers, B> but FreeBSD wants to detect bugs in system headers so it sets B> -Wsystem-headers at WARNS >= 1, and then the buggy compilers find this B> non-bug in system headers. The result is uglification of many system B> headers to use if `defined(__FOO) && ...' instead of depending on this B> standard and useful feature. Shouldn't we then remove -Wundef from CWARNFLAGS in kern.mk? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 22:24:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2804419F; Mon, 15 Oct 2012 22:24:29 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 01B208FC0C; Mon, 15 Oct 2012 22:24:29 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id B9EB41DB49; Mon, 15 Oct 2012 15:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1350339868; bh=Tw9CTx5NKO5AjDBSsfcM9qWHHko9HNlSMzUHrQ2XjLM=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=Fd7JvJP+460XHe5ux4rhpeu0mTTdBopNG3FimCEez6YAOSFFR+DRcDEfo0MZt284Z 8E6x9A+g8S1uki3wnHkaM9ZyZ2Ck2ScR24fB6hVekf9MYu5TWl93J/ZuEOwee1hI6+ F2FFHhLHDYKPk3pHieYypLVZ/Fht0TIY8g/QrSw4= Message-ID: <507C8D1C.3000306@delphij.net> Date: Mon, 15 Oct 2012 15:24:28 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: d@delphij.net Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <507C8C6B.80707@delphij.net> In-Reply-To: <507C8C6B.80707@delphij.net> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ian Lepore , src-committers@freebsd.org, Pawel Jakub Dawidek , Maxim Sobolev , Garrett Cooper , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 22:24:29 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 10/15/12 15:21, Xin Li wrote: > On 10/15/12 13:52, Garrett Cooper wrote: >> On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore >> wrote: >>> On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: >>>> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev >>>> wrote: >>>>> Author: sobomax Date: Mon Oct 15 08:21:49 2012 New >>>>> Revision: 241576 URL: >>>>> http://svn.freebsd.org/changeset/base/241576 >>>>> >>>>> Log: Add per-second scheduling into the cron(8). Right now >>>>> it's only available via the new @every_second shortcut. >>>>> ENOTIME to implement crontab(5) format extensions to allow >>>>> more flexible scheduling. >>>>> >>>>> In order to address some concerns expressed by Terry >>>>> Lambert while discussing the topic few years ago, about >>>>> per-second cron possibly causing some bad effects on >>>>> /etc/crontab by stat()ing it every second instead of every >>>>> minute now (i.e. atime update), only check that database >>>>> needs to be reloaded on every 60-th loop run. This should >>>>> be close enough to the current behaviour. >>>>> >>>>> Add "@every_minute" shortcut while I am here. >>>> >>>> Do I read the code correctly and the cron deamon will wake >>>> up every second now even if @every_second is not used at >>>> all? >>> >>> It appears to, which I don't think is a bad thing at all. But >>> the way it waits is to wake up, do some work, and go back to >>> sleep for an integer 1 second. That will occasionally lead to >>> a second in which no wakeup happens, as the "do some work" >>> part always takes some fraction of a second. > >> This is silly. It should be waking up at the lowest common >> denominator of time quanta, not every second; this could be >> determined via the crontab its managing. > > This will break crontab change detection -- instead of pickup the > change in a minute, now you end up with the smallest common > divisor. *greatest > BTW it seems that I need to clean dust on my forever WIP cron > update sooner :-/ > > Cheers, > - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJQfI0cAAoJEG80Jeu8UPuz4awH/jO2L6/aA7ocMQYGaT+epiOg XqfbhcnvmzI5X1Fgjx5rJI+B8bO2r9HCcuvwYq3RFRPdEUQPG3HGHKWnYACV6Sz2 Zkjx+mks0GdB413W5A2aX09BHe/9bT7aZ01SvHppvMkILuXn0tXJtaNE4YB7S8Df r1idCHX0hJnJl4WHqUl/AndKMtx1Nh2AfrlwubLc1W4XyTkPXMv1v2FZ3OjtgUJy byEnQZIISuSHE9S8rExCJdYUzkuwEZAMijc4v32e+2ZYFyvIYVdS1hiujnrmoIxm gCE/ZV8G4VGq8MX2/4FGGfQLetWelZCm9ogJaPpGvhfCY6PU8GUj5Ovs7pkzSA4= =IurG -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 22:45:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 179BC71D; Mon, 15 Oct 2012 22:45:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id C371C8FC08; Mon, 15 Oct 2012 22:45:37 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so5659473pad.13 for ; Mon, 15 Oct 2012 15:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ac0cpyXJBAs69O3B0zoCDqzwgm+Xy6rGPONd24OtZwY=; b=lKSx3jqSLRmpibLG2+PKX2RmI2Gb2pZHj7rvjsYaFwY/1r4aSii/ft3X9LEzo73G51 9MK5KrqilfzETEWrWMxb4IfJ0gaNg6gSL8jObqv4Q+03SoSDOF6QbRnuB66vwiDHAqkh Agwuh34UMP0tfn2yfR31bApaEaq9EVBeE7uoXAr1do/NK5rCz/jYhQSiiklV5qiLcUna ZytnbAvedWhVts861ryRd2sLtmz9vO3qyMopcupQxxm9U8IJr/FL76BNkg6W7qsIAv+S Yh5l72loaf5A+41UwBUaiEiLmfp3LoX0l3NhQIbgnEQOuftonCQWEOwSG/rbxQ9hTcYv dV5g== MIME-Version: 1.0 Received: by 10.68.229.201 with SMTP id ss9mr41239658pbc.80.1350341137411; Mon, 15 Oct 2012 15:45:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Mon, 15 Oct 2012 15:45:37 -0700 (PDT) In-Reply-To: <201210150821.q9F8Lobc047576@svn.freebsd.org> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> Date: Mon, 15 Oct 2012 15:45:37 -0700 X-Google-Sender-Auth: a9zZkLmTOo5XEjQQ96LxBFUs4Co Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Adrian Chadd To: Maxim Sobolev Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 22:45:38 -0000 Why not sleep for the amonut of time needed before the next event? adrian On 15 October 2012 01:21, Maxim Sobolev wrote: > Author: sobomax > Date: Mon Oct 15 08:21:49 2012 > New Revision: 241576 > URL: http://svn.freebsd.org/changeset/base/241576 > > Log: > Add per-second scheduling into the cron(8). Right now it's > only available via the new @every_second shortcut. ENOTIME to > implement crontab(5) format extensions to allow more flexible > scheduling. > > In order to address some concerns expressed by Terry Lambert > while discussing the topic few years ago, about per-second cron > possibly causing some bad effects on /etc/crontab by stat()ing > it every second instead of every minute now (i.e. atime update), > only check that database needs to be reloaded on every 60-th > loop run. This should be close enough to the current behaviour. > > Add "@every_minute" shortcut while I am here. > > MFC after: 1 month > > Modified: > head/usr.sbin/cron/cron/cron.c > head/usr.sbin/cron/cron/cron.h > head/usr.sbin/cron/crontab/crontab.5 > head/usr.sbin/cron/lib/entry.c > > Modified: head/usr.sbin/cron/cron/cron.c > ============================================================================== > --- head/usr.sbin/cron/cron/cron.c Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/cron/cron.c Mon Oct 15 08:21:49 2012 (r241576) > @@ -98,6 +98,7 @@ main(argc, argv) > char *argv[]; > { > cron_db database; > + int runnum; > > ProgramName = argv[0]; > > @@ -149,21 +150,24 @@ main(argc, argv) > load_database(&database); > run_reboot_jobs(&database); > cron_sync(); > + runnum = 0; > while (TRUE) { > # if DEBUGGING > /* if (!(DebugFlags & DTEST)) */ > # endif /*DEBUGGING*/ > cron_sleep(&database); > > - load_database(&database); > + if (runnum % 60 == 0) > + load_database(&database); > > /* do this iteration > */ > cron_tick(&database); > > - /* sleep 1 minute > + /* sleep 1 second > */ > - TargetTime += 60; > + TargetTime += 1; > + runnum += 1; > } > } > > @@ -194,22 +198,23 @@ cron_tick(db) > static time_t diff = 0, /* time difference in seconds from the last offset change */ > difflimit = 0; /* end point for the time zone correction */ > struct tm otztm; /* time in the old time zone */ > - int otzminute, otzhour, otzdom, otzmonth, otzdow; > + int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; > register struct tm *tm = localtime(&TargetTime); > - register int minute, hour, dom, month, dow; > + register int second, minute, hour, dom, month, dow; > register user *u; > register entry *e; > > /* make 0-based values out of these so we can use them as indicies > */ > + second = tm->tm_sec -FIRST_SECOND; > minute = tm->tm_min -FIRST_MINUTE; > hour = tm->tm_hour -FIRST_HOUR; > dom = tm->tm_mday -FIRST_DOM; > month = tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH; > dow = tm->tm_wday -FIRST_DOW; > > - Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n", > - getpid(), minute, hour, dom, month, dow)) > + Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d,%d)\n", > + getpid(), second, minute, hour, dom, month, dow)) > > if (dst_enabled && last_time != 0 > && TargetTime > last_time /* exclude stepping back */ > @@ -262,6 +267,7 @@ cron_tick(db) > > /* make 0-based values out of these so we can use them as indicies > */ > + otzsecond = otztm.tm_sec -FIRST_SECOND; > otzminute = otztm.tm_min -FIRST_MINUTE; > otzhour = otztm.tm_hour -FIRST_HOUR; > otzdom = otztm.tm_mday -FIRST_DOM; > @@ -283,7 +289,8 @@ cron_tick(db) > e->uid, e->gid, e->cmd)) > > if ( diff != 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { > - if (bit_test(e->minute, otzminute) > + if (bit_test(e->second, otzsecond) > + && bit_test(e->minute, otzminute) > && bit_test(e->hour, otzhour) > && bit_test(e->month, otzmonth) > && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) > @@ -302,7 +309,8 @@ cron_tick(db) > continue; > } > > - if (bit_test(e->minute, minute) > + if (bit_test(e->second, second) > + && bit_test(e->minute, minute) > && bit_test(e->hour, hour) > && bit_test(e->month, month) > && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) > > Modified: head/usr.sbin/cron/cron/cron.h > ============================================================================== > --- head/usr.sbin/cron/cron/cron.h Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/cron/cron.h Mon Oct 15 08:21:49 2012 (r241576) > @@ -124,6 +124,10 @@ > LineNumber = ln; \ > } > > +#define FIRST_SECOND 0 > +#define LAST_SECOND 59 > +#define SECOND_COUNT (LAST_SECOND - FIRST_SECOND + 1) > + > #define FIRST_MINUTE 0 > #define LAST_MINUTE 59 > #define MINUTE_COUNT (LAST_MINUTE - FIRST_MINUTE + 1) > @@ -165,6 +169,7 @@ typedef struct _entry { > #endif > char **envp; > char *cmd; > + bitstr_t bit_decl(second, SECOND_COUNT); > bitstr_t bit_decl(minute, MINUTE_COUNT); > bitstr_t bit_decl(hour, HOUR_COUNT); > bitstr_t bit_decl(dom, DOM_COUNT); > > Modified: head/usr.sbin/cron/crontab/crontab.5 > ============================================================================== > --- head/usr.sbin/cron/crontab/crontab.5 Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/crontab/crontab.5 Mon Oct 15 08:21:49 2012 (r241576) > @@ -232,6 +232,8 @@ string meaning > @daily Run once a day, "0 0 * * *". > @midnight (same as @daily) > @hourly Run once an hour, "0 * * * *". > +@every_minute Run once a minute, "*/1 * * * *". > +@every_second Run once a second. > .Ed > .Sh EXAMPLE CRON FILE > .Bd -literal > > Modified: head/usr.sbin/cron/lib/entry.c > ============================================================================== > --- head/usr.sbin/cron/lib/entry.c Mon Oct 15 07:57:55 2012 (r241575) > +++ head/usr.sbin/cron/lib/entry.c Mon Oct 15 08:21:49 2012 (r241576) > @@ -151,6 +151,7 @@ load_entry(file, error_func, pw, envp) > e->flags |= WHEN_REBOOT; > } else if (!strcmp("yearly", cmd) || !strcmp("annually", cmd)){ > Debug(DPARS, ("load_entry()...yearly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_set(e->dom, 0); > @@ -159,6 +160,7 @@ load_entry(file, error_func, pw, envp) > e->flags |= DOW_STAR; > } else if (!strcmp("monthly", cmd)) { > Debug(DPARS, ("load_entry()...monthly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_set(e->dom, 0); > @@ -167,6 +169,7 @@ load_entry(file, error_func, pw, envp) > e->flags |= DOW_STAR; > } else if (!strcmp("weekly", cmd)) { > Debug(DPARS, ("load_entry()...weekly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > @@ -175,6 +178,7 @@ load_entry(file, error_func, pw, envp) > bit_set(e->dow, 0); > } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) { > Debug(DPARS, ("load_entry()...daily shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_set(e->hour, 0); > bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > @@ -182,11 +186,28 @@ load_entry(file, error_func, pw, envp) > bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > } else if (!strcmp("hourly", cmd)) { > Debug(DPARS, ("load_entry()...hourly shortcut\n")) > + bit_set(e->second, 0); > bit_set(e->minute, 0); > bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); > bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); > bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > + } else if (!strcmp("every_minute", cmd)) { > + Debug(DPARS, ("load_entry()...every_minute shortcut\n")) > + bit_set(e->second, 0); > + bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); > + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); > + bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > + bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); > + bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > + } else if (!strcmp("every_second", cmd)) { > + Debug(DPARS, ("load_entry()...every_second shortcut\n")) > + bit_nset(e->second, 0, (LAST_SECOND-FIRST_SECOND+1)); > + bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); > + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); > + bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); > + bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); > + bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); > } else { > ecode = e_timespec; > goto eof; From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 23:10:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 467A3D16 for ; Mon, 15 Oct 2012 23:10:41 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id EE86F8FC14 for ; Mon, 15 Oct 2012 23:10:40 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so5761903pbb.13 for ; Mon, 15 Oct 2012 16:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=IEPY254e1n/icKULubFVefR4bu8JzGOB0SOQSxeQjv4=; b=WWBasVOlXGvQXLRYC0LeKGfTMoCSPHFBA4povzjUZ8IZARxWJriFksjgDf+OzzhxY6 UOv66sCs8LVBNIIuJxjsXyC9YHLM3IV077lEa6UVa40L8AbI5tYHCvL8B3WT6QbywrOZ wccEHE0LLo2naPiCSNlv+51z+EFAitjpHfxu4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=IEPY254e1n/icKULubFVefR4bu8JzGOB0SOQSxeQjv4=; b=mZNyQP3bH1EU7JUWJRlCP+4PrhE5rZOgtswSKMy+yWwasqayWHxZuzWQu/l9NGvH69 62LZx9uEsCdhykGAPIifMjyFvWbAcaD47zUS4sb8TVEBdrH0bH9U1XDvPHJelKR9xopV fFCiNIf08AObIn4TuP5VPnH/xreheCHZmsAs4kIoEWGcvnYWhOUzNjBcYtsJhv0RfvRA toHgrG6qyS0D57dfuxM8E5+NfD5Qq/z9MgI12qEbXCyE8Vdvtl5mizhP5QLyeEpavP7t Jw21GkGaibJiUTSH+V5AX/Se2Gu4gAgMvPJkEYJ4V6DmKt695yOJcDka1rqj7fNia8UC YGBw== Received: by 10.68.200.231 with SMTP id jv7mr41090521pbc.140.1350342639707; Mon, 15 Oct 2012 16:10:39 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.161.163 with HTTP; Mon, 15 Oct 2012 16:10:09 -0700 (PDT) In-Reply-To: References: <201210150821.q9F8Lobc047576@svn.freebsd.org> From: Eitan Adler Date: Mon, 15 Oct 2012 19:10:09 -0400 X-Google-Sender-Auth: Q5Pejc8QzrQDjzY5FMacr0WNoik Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkR9ZZUHD5h9i7dPDr+k5TkdhI2UT0O8A33jgjz0LzmaBn6PCF8zfUE1PtAaeqAI9VQwFJJ Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 23:10:41 -0000 On 15 October 2012 18:45, Adrian Chadd wrote: > Why not sleep for the amonut of time needed before the next event? If the crontab changes in the meantime. If the next event is in a week, but you modify the crontab, you don't want to sleep until next event. Why we stat the file every quantum instead of using something kqueue is a different question. -- Eitan Adler Source & Ports committer X11, Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 23:26:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 69CD62F7; Mon, 15 Oct 2012 23:26:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id BE5B18FC0A; Mon, 15 Oct 2012 23:26:21 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so5771733pbb.13 for ; Mon, 15 Oct 2012 16:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=8UpvucirNALRI7J975XwJda9TG5rXOlGRJtfGfSYHCU=; b=x2NRlStNswEshSY2J9RqCU11LKPXY+liIIl9cDOEvLaLo38zW8UJ3kenYZ+xEfdR0m p+89BEVqqqTT3xE5HKVAcjNNK7yxor8Y4MeU2z/euzpRpo11D+77GF8ExxUr1gyWkM0q eRYVS00o7sJTIWDunxjOgeJzh5eB3l6y25DQxqGHta0bC7bqidr7pCZqTfAsEvhisS/H Hev8lqE0+JrFflaEh34AytyMWJ6LY5yB872TzWJuUeQeEwk3h/JOiYsrh2oqd7pQ8stV OR6MSrKSA+tGtTKBuMQssOEb9XrqtzA35vvDBEIgZupUOMvGXhCbYdWSnPw/tZTNRecD SN+g== MIME-Version: 1.0 Received: by 10.68.218.226 with SMTP id pj2mr41853358pbc.33.1350343581425; Mon, 15 Oct 2012 16:26:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Mon, 15 Oct 2012 16:26:21 -0700 (PDT) In-Reply-To: References: <201210150821.q9F8Lobc047576@svn.freebsd.org> Date: Mon, 15 Oct 2012 16:26:21 -0700 X-Google-Sender-Auth: PUtSQsEPV6Gy37SGwnrIxcRck6Y Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Adrian Chadd To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 23:26:22 -0000 On 15 October 2012 16:10, Eitan Adler wrote: > On 15 October 2012 18:45, Adrian Chadd wrote: >> Why not sleep for the amonut of time needed before the next event? > > If the crontab changes in the meantime. If the next event is in a week, > but you modify the crontab, you don't want to sleep until next event. Right. So "check the crontab file" event is also an event with a timestamp in the future. Maybe crontab should be using a command via a socket to reload, rather than stat'ing files.. Adrian > Why we stat the file every quantum instead of using something kqueue is > a different question. > > > -- > Eitan Adler > Source & Ports committer > X11, Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 23:26:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C021146D; Mon, 15 Oct 2012 23:26:51 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 34F8A8FC14; Mon, 15 Oct 2012 23:26:50 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id wc20so7375145obb.13 for ; Mon, 15 Oct 2012 16:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fQu9NLg918E01ivRzU6hzg0+W1mqCreFOaoEAHBJmCQ=; b=VMQmh8m3h2WGA77fY7e2dyyRZJqEXpLCgLk0ZdoX4JMERN/Blt8YGxtJWUUNjjPvLw T85+A8olishF6nUEpOTkB6nck/uzQy7JbOFWgdSQZABrA8iLjLPjhW1GVk9kh5HiJT36 dQOTQP3vLActVnPWVOp4K2qu4TBHHxMewCVSTHun6Kli4yMs8qaLzI6cACNB3pySPlV9 opJs92gjAlKOcc+4ldYl0dx+5I/Wn+EKLSA7hnzoaQNaPbPkQcFjj88/mN1W40zlVJl2 4BX8K7zy8vDFYYRTu/dQVVPGJ2EXVoALURBzGP8Qk7/MpdCuf1EeiqULREbJZsB9AbDq 3+Rg== MIME-Version: 1.0 Received: by 10.182.218.37 with SMTP id pd5mr10970641obc.24.1350343610387; Mon, 15 Oct 2012 16:26:50 -0700 (PDT) Received: by 10.76.167.202 with HTTP; Mon, 15 Oct 2012 16:26:50 -0700 (PDT) In-Reply-To: <20121015222333.GY89655@FreeBSD.org> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> <20121015151147.GA92923@stack.nl> <20121016045904.Q15233@besplex.bde.org> <20121015222333.GY89655@FreeBSD.org> Date: Mon, 15 Oct 2012 16:26:50 -0700 Message-ID: Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet From: Garrett Cooper To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, John Baldwin , Jilles Tjoelker , svn-src-all@freebsd.org, Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 23:26:51 -0000 On Mon, Oct 15, 2012 at 3:23 PM, Gleb Smirnoff wrote: > On Tue, Oct 16, 2012 at 05:09:31AM +1100, Bruce Evans wrote: > B> > On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: > B> >> On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: > B> >> J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: > B> >> J> > Author: glebius > B> >> J> > Date: Sun Oct 14 15:03:06 2012 > B> >> J> > New Revision: 241546 > B> >> J> > URL: http://svn.freebsd.org/changeset/base/241546 > B> > > B> >> J> > Log: > B> >> J> > Fix defines in r241245. We actually don't define FreeBSD. > B> > > B> >> J> > Reported & tested by: Oleg Ginzburg > B> > > B> >> J> Seems like it should be using 'defined(__FreeBSD_version)' instead? > B> > > B> >> AFAIU, the construction which left after r241546 works fine. Anything > B> >> undefined resolves to zero, so in case of non-FreeBSD build we test > B> >> if (0 > 10000019) and this fails which is what we expect. > B> > > B> >> I have used this construction several times already without any side > B> >> effects. I have also seen it in some software in ports, where it works > B> >> okay, too. > B> > > B> > The C standard indeed permits this, but gcc -Wundef will warn about it. > B> > That compiler warning is in CWARNFLAGS in sys/conf/kern.mk so I suggest > B> > adding the 'defined(__FreeBSD_version) &&'. > B> > B> The C standard requires this, but some misconfigured compilers like > B> gcc -Wundef warn about it, and some non-C compilers like gcc -Wundef > B> -Werror fail on it. The bug is sometimes hidden by -Wno-system-headers, > B> but FreeBSD wants to detect bugs in system headers so it sets > B> -Wsystem-headers at WARNS >= 1, and then the buggy compilers find this > B> non-bug in system headers. The result is uglification of many system > B> headers to use if `defined(__FOO) && ...' instead of depending on this > B> standard and useful feature. > > Shouldn't we then remove -Wundef from CWARNFLAGS in kern.mk? There is some value to -Wundef if used properly: -Wundef Warn whenever an identifier which is not a macro is encountered in an #if directive, outside of defined. Such identifiers are replaced with zero. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 23:33:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E63DD620; Mon, 15 Oct 2012 23:33:05 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 702728FC08; Mon, 15 Oct 2012 23:33:05 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 23702E659F; Tue, 16 Oct 2012 00:36:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=mail; bh=YAEL2Fg4w0M2 /aJCqtlNdjPOzao=; b=b9WyqbaHehx45N+EQWDfSthHPHPI60hUaiwExNW1qhya 7ZKTFxyPpSgrJMkLsVvZCOAfumvNiXfQoaFkrlCMs9RFrqz3d3TlsN880MtPstN3 n352lfAgo0QSG/Ic/IvKhpe/9AaCW/3/wAaaFGMMktVSR//KjLqLWbwVxupVIgA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=mail; b=AxTPio TAIwvEdb8AHmPgwFVYmRYEgJ7jBb7H8djXDouMIG7IW8verspiyR8CkI+Cg8OtiT MJzt0OZDWSNn63latuu6LxR1RYCGHGSYI+GyswClAfxLJCJCjOe3epTVCkV2Xsx1 N6uB/wrzLIk1TGbQDEpRObmShWPLkMOgWJPQI= Received: from [IPv6:2a01:348:301:2:2827:2d9e:7939:abfb] (unknown [IPv6:2a01:348:301:2:2827:2d9e:7939:abfb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id DEEE5E6581; Tue, 16 Oct 2012 00:36:37 +0100 (BST) Message-ID: <507C9D2F.3010505@cran.org.uk> Date: Tue, 16 Oct 2012 00:33:03 +0100 From: Bruce Cran User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 23:33:06 -0000 On 16/10/2012 00:26, Adrian Chadd wrote: > Maybe crontab should be using a command via a socket to reload, rather > than stat'ing files.. Or kqueue? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 00:24:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCE652E9 for ; Tue, 16 Oct 2012 00:24:31 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA918FC1C for ; Tue, 16 Oct 2012 00:24:30 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so5807494pbb.13 for ; Mon, 15 Oct 2012 17:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=F3vNJJYJky7OS70/BHX2Eb2sAF8w31Xib+RslrW0HVY=; b=J8flDkdVeny+EXwOWO9mLr9Z+gpPART8hdJCr2MqTbpch1YMwJXOlf4IaVpYG3OrLl PNqgH8dIFBq4sbEiTOCMIRMkNai6D+ng419FyDFt+7BUWfTi+DTS+bi3MtlpvEiSA3Wc kBUasKfwdqCgvqJKw0XzDPaExJ7K6DvrPIT9Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=F3vNJJYJky7OS70/BHX2Eb2sAF8w31Xib+RslrW0HVY=; b=jNwuhK0pikbZvHEXhn1KDob/7Kk6Bj99XbmDPT6gEorzgtXYOW7vgV53QqFoFoZRlS gUEKOZJRDedBxRipehWmACORyZejE/wnShbh18fA7pu+Nbwp6dScxhSp5g6On2KkTtmy 8az00hVOo9sGnJWpLSmEH0hoXSaCT6OJKfupGv5QKWY0OTZ3uMQ+VAJQlIQOe3s+NMSe 1e5q2yKogKTIvIlYQb6atkPh1eWrBPtPT8bxp1BR0ZBgIUABkS1pcyXk1nJV7G5WM9Ob n5r1syj2y6HNhc0ywwUY90mQTX0+HhZSNdIgT7Uf+CtUbNfjyBz0v2X7YR6QC9muC7qm yQcg== Received: by 10.68.242.231 with SMTP id wt7mr41594716pbc.99.1350347070079; Mon, 15 Oct 2012 17:24:30 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.161.163 with HTTP; Mon, 15 Oct 2012 17:23:59 -0700 (PDT) In-Reply-To: References: <201210150821.q9F8Lobc047576@svn.freebsd.org> From: Eitan Adler Date: Mon, 15 Oct 2012 20:23:59 -0400 X-Google-Sender-Auth: DAdApl0xQHq26Z9tp5fHlIvMqWg Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlMcZ5BHB35JVFfP8TIoHQgYYvWGPTiUzZqxUtyyx7rr2+lKKqOm86cpUyLbS1Lkj2Oluvk Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 00:24:31 -0000 On 15 October 2012 19:26, Adrian Chadd wrote: > On 15 October 2012 16:10, Eitan Adler wrote: >> On 15 October 2012 18:45, Adrian Chadd wrote: >>> Why not sleep for the amonut of time needed before the next event? >> >> If the crontab changes in the meantime. If the next event is in a week, >> but you modify the crontab, you don't want to sleep until next event. > > Right. So "check the crontab file" event is also an event with a > timestamp in the future. > > Maybe crontab should be using a command via a socket to reload, rather > than stat'ing files.. "Why we stat the file every quantum instead of using kqueue is a different question." -- Eitan Adler Source & Ports committer X11, Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 01:07:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C38B2E5D; Tue, 16 Oct 2012 01:07:20 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 99ABE8FC08; Tue, 16 Oct 2012 01:07:20 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 5274B1E319; Mon, 15 Oct 2012 18:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1350349640; bh=4UM/uyxfuaYhne5pMcDBXFqbAr3sTmlqYqbsF3mcb0w=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=lhPvvcw5nOYo3yBJAYNVWff7ePCqxapyLjkQ6REqLu3DkkBbg9zGOzeFuTCat7leq wEj5i7C9caJhxWWZxWo/t+2n8b6OAtv9jI2qqUsqjBFyaPN5wtDRuOJLI/PqJLHfJg vJeEsVAjoN7XGXn4/J+tRcTFNOid4Xnvrb5KSi0M= Message-ID: <507CB347.3040502@delphij.net> Date: Mon, 15 Oct 2012 18:07:19 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Maxim Sobolev , Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 01:07:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 10/15/12 17:23, Eitan Adler wrote: > On 15 October 2012 19:26, Adrian Chadd wrote: >> On 15 October 2012 16:10, Eitan Adler >> wrote: >>> On 15 October 2012 18:45, Adrian Chadd >>> wrote: >>>> Why not sleep for the amonut of time needed before the next >>>> event? >>> >>> If the crontab changes in the meantime. If the next event is in >>> a week, but you modify the crontab, you don't want to sleep >>> until next event. >> >> Right. So "check the crontab file" event is also an event with a >> timestamp in the future. >> >> Maybe crontab should be using a command via a socket to reload, >> rather than stat'ing files.. > > "Why we stat the file every quantum instead of using kqueue is a > different question." Because it's not guaranteed to work on every filesystems? But yes I think it would be a good idea to implement it and use it when all filesystems used to store crontabs supports it. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJQfLNHAAoJEG80Jeu8UPuz9bgH/ROQ6e0aAvEQMpRWMNVUYrKq efrqozcXHQU+eK7ceU5f3tX4PSPlMQ3pXGzt02n7sbsblFAnLZPCnJVfesaDBTav Cy9fnfU6dfwCGm7acwVYSAR+s6Wt1nOiKEn/ZNB1QUuvH+XbvdtZ4nAbEjeJzA45 ZBEdj/Dpj2Om3gTBbnmYVMpXeild0OPIFjupfWv0MZvAB2Dp8rOr6qJZXToBH+CZ XHN0ldR6djKVSLWVobY+rqII76pAhhMmgeEeHps8jUPShOtO0jGTqqMf/gk91gb/ cvXGbjqXSU/jBkNJExyCafkyWlocNiGSvYNvnaIT2Xts49WShD0DuScUgr8I+qQ= =1ZYE -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 01:10:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B6B4103; Tue, 16 Oct 2012 01:10:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5448FC14; Tue, 16 Oct 2012 01:10:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G1AiHZ012471; Tue, 16 Oct 2012 01:10:44 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G1AiH0012464; Tue, 16 Oct 2012 01:10:44 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201210160110.q9G1AiH0012464@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 16 Oct 2012 01:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241600 - in head: . sys/conf sys/dev/mmc sys/dev/sdhci sys/modules sys/modules/sdhci sys/modules/sdhci_pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 01:10:44 -0000 Author: gonzo Date: Tue Oct 16 01:10:43 2012 New Revision: 241600 URL: http://svn.freebsd.org/changeset/base/241600 Log: Split sdhci driver in two parts: sdhci and sdhci_pci. sdchi encapsulates a generic SD Host Controller logic that relies on actual hardware driver for register access. sdhci_pci implements driver for PCI SDHC controllers using new SDHCI interface No kernel config modifications are required, but if you load sdhc as a module you must switch to sdhci_pci instead. Added: head/sys/dev/sdhci/sdhci_if.m (contents, props changed) head/sys/dev/sdhci/sdhci_pci.c (contents, props changed) head/sys/modules/sdhci_pci/ head/sys/modules/sdhci_pci/Makefile (contents, props changed) Modified: head/UPDATING head/sys/conf/files head/sys/conf/kmod.mk head/sys/dev/mmc/mmc.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/modules/Makefile head/sys/modules/sdhci/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 15 21:53:26 2012 (r241599) +++ head/UPDATING Tue Oct 16 01:10:43 2012 (r241600) @@ -24,6 +24,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20121015: + The sdhci driver was split in two parts: sdhci (generic SD Host + Controller logic) and sdhci_pci (actual hardware driver). + No kernel config modifications are required, but if you + load sdhc as a module you must switch to sdhci_pci instead. + 20121014: Import the FUSE kernel and userland support into base system. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 15 21:53:26 2012 (r241599) +++ head/sys/conf/files Tue Oct 16 01:10:43 2012 (r241600) @@ -1905,7 +1905,9 @@ dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa -dev/sdhci/sdhci.c optional sdhci pci +dev/sdhci/sdhci.c optional sdhci +dev/sdhci/sdhci_if.m optional sdhci +dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci dev/si/si.c optional si Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Oct 15 21:53:26 2012 (r241599) +++ head/sys/conf/kmod.mk Tue Oct 16 01:10:43 2012 (r241600) @@ -345,7 +345,8 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \ dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ - dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ + dev/pci/pcib_if.m dev/ppbus/ppbus_if.m \ + dev/sdhci/sdhci_if.m dev/smbus/smbus_if.m \ dev/sound/pci/hda/hdac_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Oct 15 21:53:26 2012 (r241599) +++ head/sys/dev/mmc/mmc.c Tue Oct 16 01:10:43 2012 (r241600) @@ -1730,4 +1730,4 @@ static devclass_t mmc_devclass; DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Oct 15 21:53:26 2012 (r241599) +++ head/sys/dev/sdhci/sdhci.c Tue Oct 16 01:10:43 2012 (r241600) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include #include @@ -52,104 +49,12 @@ __FBSDID("$FreeBSD$"); #include "mmcbr_if.h" #include "sdhci.h" - -#define DMA_BLOCK_SIZE 4096 -#define DMA_BOUNDARY 0 /* DMA reload every 4K */ - -/* Controller doesn't honor resets unless we touch the clock register */ -#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) -/* Controller really supports DMA */ -#define SDHCI_QUIRK_FORCE_DMA (1<<1) -/* Controller has unusable DMA engine */ -#define SDHCI_QUIRK_BROKEN_DMA (1<<2) -/* Controller doesn't like to be reset when there is no card inserted. */ -#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<3) -/* Controller has flaky internal state so reset it on each ios change */ -#define SDHCI_QUIRK_RESET_ON_IOS (1<<4) -/* Controller can only DMA chunk sizes that are a multiple of 32 bits */ -#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<5) -/* Controller needs to be reset after each request to stay stable */ -#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<6) -/* Controller has an off-by-one issue with timeout value */ -#define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) -/* Controller has broken read timings */ -#define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) -/* Controller needs lowered frequency */ -#define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) - -static const struct sdhci_device { - uint32_t model; - uint16_t subvendor; - char *desc; - u_int quirks; -} sdhci_devices[] = { - { 0x08221180, 0xffff, "RICOH R5C822 SD", - SDHCI_QUIRK_FORCE_DMA }, - { 0xe8221180, 0xffff, "RICOH SD", - SDHCI_QUIRK_FORCE_DMA }, - { 0xe8231180, 0xffff, "RICOH R5CE823 SD", - SDHCI_QUIRK_LOWER_FREQUENCY }, - { 0x8034104c, 0xffff, "TI XX21/XX11 SD", - SDHCI_QUIRK_FORCE_DMA }, - { 0x05501524, 0xffff, "ENE CB712 SD", - SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x05511524, 0xffff, "ENE CB712 SD 2", - SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x07501524, 0xffff, "ENE CB714 SD", - SDHCI_QUIRK_RESET_ON_IOS | - SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x07511524, 0xffff, "ENE CB714 SD 2", - SDHCI_QUIRK_RESET_ON_IOS | - SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x410111ab, 0xffff, "Marvell CaFe SD", - SDHCI_QUIRK_INCR_TIMEOUT_CONTROL }, - { 0x2381197B, 0xffff, "JMicron JMB38X SD", - SDHCI_QUIRK_32BIT_DMA_SIZE | - SDHCI_QUIRK_RESET_AFTER_REQUEST }, - { 0, 0xffff, NULL, - 0 } -}; +#include "sdhci_if.h" struct sdhci_softc; -struct sdhci_slot { - struct sdhci_softc *sc; - device_t dev; /* Slot device */ - u_char num; /* Slot number */ - u_char opt; /* Slot options */ -#define SDHCI_HAVE_DMA 1 - uint32_t max_clk; /* Max possible freq */ - uint32_t timeout_clk; /* Timeout freq */ - struct resource *mem_res; /* Memory resource */ - int mem_rid; - bus_dma_tag_t dmatag; - bus_dmamap_t dmamap; - u_char *dmamem; - bus_addr_t paddr; /* DMA buffer address */ - struct task card_task; /* Card presence check task */ - struct callout card_callout; /* Card insert delay callout */ - struct mmc_host host; /* Host parameters */ - struct mmc_request *req; /* Current request */ - struct mmc_command *curcmd; /* Current command of current request */ - - uint32_t intmask; /* Current interrupt mask */ - uint32_t clock; /* Current clock freq. */ - size_t offset; /* Data buffer offset */ - uint8_t hostctrl; /* Current host control register */ - u_char power; /* Current power */ - u_char bus_busy; /* Bus busy status */ - u_char cmd_done; /* CMD command part done flag */ - u_char data_done; /* DAT command part done flag */ - u_char flags; /* Request execution flags */ -#define CMD_STARTED 1 -#define STOP_STARTED 2 -#define SDHCI_USE_DMA 4 /* Use DMA for this req. */ - struct mtx mtx; /* Slot mutex */ -}; - struct sdhci_softc { device_t dev; /* Controller device */ - u_int quirks; /* Chip specific quirks */ struct resource *irq_res; /* IRQ resource */ int irq_rid; void *intrhand; /* Interrupt handle */ @@ -160,63 +65,21 @@ struct sdhci_softc { static SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); -int sdhci_debug; +int sdhci_debug = 0; TUNABLE_INT("hw.sdhci.debug", &sdhci_debug); SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RW, &sdhci_debug, 0, "Debug level"); -static inline uint8_t -RD1(struct sdhci_slot *slot, bus_size_t off) -{ - bus_barrier(slot->mem_res, 0, 0xFF, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return bus_read_1(slot->mem_res, off); -} - -static inline void -WR1(struct sdhci_slot *slot, bus_size_t off, uint8_t val) -{ - bus_barrier(slot->mem_res, 0, 0xFF, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - bus_write_1(slot->mem_res, off, val); -} - -static inline uint16_t -RD2(struct sdhci_slot *slot, bus_size_t off) -{ - bus_barrier(slot->mem_res, 0, 0xFF, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return bus_read_2(slot->mem_res, off); -} - -static inline void -WR2(struct sdhci_slot *slot, bus_size_t off, uint16_t val) -{ - bus_barrier(slot->mem_res, 0, 0xFF, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - bus_write_2(slot->mem_res, off, val); -} - -static inline uint32_t -RD4(struct sdhci_slot *slot, bus_size_t off) -{ - bus_barrier(slot->mem_res, 0, 0xFF, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return bus_read_4(slot->mem_res, off); -} - -static inline void -WR4(struct sdhci_slot *slot, bus_size_t off, uint32_t val) -{ - bus_barrier(slot->mem_res, 0, 0xFF, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - bus_write_4(slot->mem_res, off, val); -} - -/* bus entry points */ -static int sdhci_probe(device_t dev); -static int sdhci_attach(device_t dev); -static int sdhci_detach(device_t dev); -static void sdhci_intr(void *); +#define RD1(slot, off) SDHCI_READ_1((slot)->bus, (slot), (off)) +#define RD2(slot, off) SDHCI_READ_2((slot)->bus, (slot), (off)) +#define RD4(slot, off) SDHCI_READ_4((slot)->bus, (slot), (off)) +#define RD_MULTI_4(slot, off, ptr, count) \ + SDHCI_READ_MULTI_4((slot)->bus, (slot), (off), (ptr), (count)) + +#define WR1(slot, off, val) SDHCI_WRITE_1((slot)->bus, (slot), (off), (val)) +#define WR2(slot, off, val) SDHCI_WRITE_2((slot)->bus, (slot), (off), (val)) +#define WR4(slot, off, val) SDHCI_WRITE_4((slot)->bus, (slot), (off), (val)) +#define WR_MULTI_4(slot, off, ptr, count) \ + SDHCI_WRITE_MULTI_4((slot)->bus, (slot), (off), (ptr), (count)) static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock); static void sdhci_start(struct sdhci_slot *slot); @@ -233,6 +96,16 @@ static void sdhci_card_task(void *, int) #define SDHCI_ASSERT_LOCKED(_slot) mtx_assert(&_slot->mtx, MA_OWNED); #define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert(&_slot->mtx, MA_NOTOWNED); +static void +sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) { + printf("getaddr: error %d\n", error); + return; + } + *(bus_addr_t *)arg = segs[0].ds_addr; +} + static int slot_printf(struct sdhci_slot *slot, const char * fmt, ...) { @@ -240,7 +113,7 @@ slot_printf(struct sdhci_slot *slot, con int retval; retval = printf("%s-slot%d: ", - device_get_nameunit(slot->sc->dev), slot->num); + device_get_nameunit(slot->bus), slot->num); va_start(ap, fmt); retval += vprintf(fmt, ap); @@ -249,16 +122,6 @@ slot_printf(struct sdhci_slot *slot, con } static void -sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) { - printf("getaddr: error %d\n", error); - return; - } - *(bus_addr_t *)arg = segs[0].ds_addr; -} - -static void sdhci_dumpregs(struct sdhci_slot *slot) { slot_printf(slot, @@ -295,7 +158,7 @@ sdhci_reset(struct sdhci_slot *slot, uin int timeout; uint8_t res; - if (slot->sc->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { + if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { if (!(RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) return; @@ -303,7 +166,7 @@ sdhci_reset(struct sdhci_slot *slot, uin /* Some controllers need this kick or reset won't work. */ if ((mask & SDHCI_RESET_ALL) == 0 && - (slot->sc->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)) { + (slot->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)) { uint32_t clock; /* This is to force an update */ @@ -354,24 +217,6 @@ sdhci_init(struct sdhci_slot *slot) } static void -sdhci_lower_frequency(device_t dev) -{ - - /* Enable SD2.0 mode. */ - pci_write_config(dev, SDHC_PCI_MODE_KEY, 0xfc, 1); - pci_write_config(dev, SDHC_PCI_MODE, SDHC_PCI_MODE_SD20, 1); - pci_write_config(dev, SDHC_PCI_MODE_KEY, 0x00, 1); - - /* - * Some SD/MMC cards don't work with the default base - * clock frequency of 200MHz. Lower it to 50MHz. - */ - pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1); - pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1); - pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x00, 1); -} - -static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) { uint32_t res; @@ -427,6 +272,7 @@ sdhci_set_power(struct sdhci_slot *slot, if (slot->power == power) return; + slot->power = power; /* Turn off the power. */ @@ -469,7 +315,7 @@ sdhci_read_block_pio(struct sdhci_slot * slot->offset += left; /* If we are too fast, broken controllers return zeroes. */ - if (slot->sc->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) + if (slot->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) DELAY(10); /* Handle unalligned and alligned buffer cases. */ if ((intptr_t)buffer & 3) { @@ -483,7 +329,7 @@ sdhci_read_block_pio(struct sdhci_slot * left -= 4; } } else { - bus_read_multi_stream_4(slot->mem_res, SDHCI_BUFFER, + RD_MULTI_4(slot, SDHCI_BUFFER, (uint32_t *)buffer, left >> 2); left &= 3; } @@ -523,7 +369,7 @@ sdhci_write_block_pio(struct sdhci_slot WR4(slot, SDHCI_BUFFER, data); } } else { - bus_write_multi_stream_4(slot->mem_res, SDHCI_BUFFER, + WR_MULTI_4(slot, SDHCI_BUFFER, (uint32_t *)buffer, left >> 2); left &= 3; } @@ -577,7 +423,7 @@ sdhci_card_task(void *arg, int pending) if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ - slot->dev = device_add_child(slot->sc->dev, "mmc", -1); + slot->dev = device_add_child(slot->bus, "mmc", -1); device_set_ivars(slot->dev, slot); SDHCI_UNLOCK(slot); device_probe_and_attach(slot->dev); @@ -589,281 +435,171 @@ sdhci_card_task(void *arg, int pending) device_t d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); - device_delete_child(slot->sc->dev, d); + device_delete_child(slot->bus, d); } else SDHCI_UNLOCK(slot); } } -static int -sdhci_probe(device_t dev) +int +sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) { - uint32_t model; - uint16_t subvendor; - uint8_t class, subclass; - int i, result; - - model = (uint32_t)pci_get_device(dev) << 16; - model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; - subvendor = pci_get_subvendor(dev); - class = pci_get_class(dev); - subclass = pci_get_subclass(dev); - - result = ENXIO; - for (i = 0; sdhci_devices[i].model != 0; i++) { - if (sdhci_devices[i].model == model && - (sdhci_devices[i].subvendor == 0xffff || - sdhci_devices[i].subvendor == subvendor)) { - device_set_desc(dev, sdhci_devices[i].desc); - result = BUS_PROBE_DEFAULT; - break; - } - } - if (result == ENXIO && class == PCIC_BASEPERIPH && - subclass == PCIS_BASEPERIPH_SDHC) { - device_set_desc(dev, "Generic SD HCI"); - result = BUS_PROBE_GENERIC; - } - - return (result); -} + uint32_t caps; + int err; -static int -sdhci_attach(device_t dev) -{ - struct sdhci_softc *sc = device_get_softc(dev); - uint32_t model; - uint16_t subvendor; - uint8_t class, subclass, progif; - int err, slots, bar, i; - - sc->dev = dev; - model = (uint32_t)pci_get_device(dev) << 16; - model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; - subvendor = pci_get_subvendor(dev); - class = pci_get_class(dev); - subclass = pci_get_subclass(dev); - progif = pci_get_progif(dev); - /* Apply chip specific quirks. */ - for (i = 0; sdhci_devices[i].model != 0; i++) { - if (sdhci_devices[i].model == model && - (sdhci_devices[i].subvendor == 0xffff || - sdhci_devices[i].subvendor == subvendor)) { - sc->quirks = sdhci_devices[i].quirks; - break; - } + SDHCI_LOCK_INIT(slot); + slot->num = num; + slot->bus = dev; + + /* Allocate DMA tag. */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), + DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, + DMA_BLOCK_SIZE, 1, DMA_BLOCK_SIZE, + BUS_DMA_ALLOCNOW, NULL, NULL, + &slot->dmatag); + if (err != 0) { + device_printf(dev, "Can't create DMA tag\n"); + SDHCI_LOCK_DESTROY(slot); + return (err); } - /* Some controllers need to be bumped into the right mode. */ - if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) - sdhci_lower_frequency(dev); - /* Read slots info from PCI registers. */ - slots = pci_read_config(dev, PCI_SLOT_INFO, 1); - bar = PCI_SLOT_INFO_FIRST_BAR(slots); - slots = PCI_SLOT_INFO_SLOTS(slots); - if (slots > 6 || bar > 5) { - device_printf(dev, "Incorrect slots information (%d, %d).\n", - slots, bar); - return (EINVAL); + /* Allocate DMA memory. */ + err = bus_dmamem_alloc(slot->dmatag, (void **)&slot->dmamem, + BUS_DMA_NOWAIT, &slot->dmamap); + if (err != 0) { + device_printf(dev, "Can't alloc DMA memory\n"); + SDHCI_LOCK_DESTROY(slot); + return (err); + } + /* Map the memory. */ + err = bus_dmamap_load(slot->dmatag, slot->dmamap, + (void *)slot->dmamem, DMA_BLOCK_SIZE, + sdhci_getaddr, &slot->paddr, 0); + if (err != 0 || slot->paddr == 0) { + device_printf(dev, "Can't load DMA memory\n"); + SDHCI_LOCK_DESTROY(slot); + if(err) + return (err); + else + return (EFAULT); } - /* Allocate IRQ. */ - sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->irq_res == NULL) { - device_printf(dev, "Can't allocate IRQ\n"); - return (ENOMEM); - } - /* Scan all slots. */ - for (i = 0; i < slots; i++) { - struct sdhci_slot *slot = &sc->slots[sc->num_slots]; - uint32_t caps; - - SDHCI_LOCK_INIT(slot); - slot->sc = sc; - slot->num = sc->num_slots; - /* Allocate memory. */ - slot->mem_rid = PCIR_BAR(bar + i); - slot->mem_res = bus_alloc_resource(dev, - SYS_RES_MEMORY, &slot->mem_rid, 0ul, ~0ul, 0x100, RF_ACTIVE); - if (slot->mem_res == NULL) { - device_printf(dev, "Can't allocate memory\n"); - SDHCI_LOCK_DESTROY(slot); - continue; - } - /* Allocate DMA tag. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), - DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - DMA_BLOCK_SIZE, 1, DMA_BLOCK_SIZE, - BUS_DMA_ALLOCNOW, NULL, NULL, - &slot->dmatag); - if (err != 0) { - device_printf(dev, "Can't create DMA tag\n"); - SDHCI_LOCK_DESTROY(slot); - continue; - } - /* Allocate DMA memory. */ - err = bus_dmamem_alloc(slot->dmatag, (void **)&slot->dmamem, - BUS_DMA_NOWAIT, &slot->dmamap); - if (err != 0) { - device_printf(dev, "Can't alloc DMA memory\n"); - SDHCI_LOCK_DESTROY(slot); - continue; - } - /* Map the memory. */ - err = bus_dmamap_load(slot->dmatag, slot->dmamap, - (void *)slot->dmamem, DMA_BLOCK_SIZE, - sdhci_getaddr, &slot->paddr, 0); - if (err != 0 || slot->paddr == 0) { - device_printf(dev, "Can't load DMA memory\n"); - SDHCI_LOCK_DESTROY(slot); - continue; - } - /* Initialize slot. */ - sdhci_init(slot); - caps = RD4(slot, SDHCI_CAPABILITIES); - /* Calculate base clock frequency. */ - slot->max_clk = - (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; - if (slot->max_clk == 0) { - device_printf(dev, "Hardware doesn't specify base clock " - "frequency.\n"); - } - slot->max_clk *= 1000000; - /* Calculate timeout clock frequency. */ - slot->timeout_clk = - (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; - if (slot->timeout_clk == 0) { - device_printf(dev, "Hardware doesn't specify timeout clock " - "frequency.\n"); - } - if (caps & SDHCI_TIMEOUT_CLK_UNIT) - slot->timeout_clk *= 1000; - - slot->host.f_min = slot->max_clk / 256; - slot->host.f_max = slot->max_clk; - slot->host.host_ocr = 0; - if (caps & SDHCI_CAN_VDD_330) - slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340; - if (caps & SDHCI_CAN_VDD_300) - slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; - if (caps & SDHCI_CAN_VDD_180) - slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; - if (slot->host.host_ocr == 0) { - device_printf(dev, "Hardware doesn't report any " - "support voltages.\n"); - } - slot->host.caps = MMC_CAP_4_BIT_DATA; - if (caps & SDHCI_CAN_DO_HISPD) - slot->host.caps |= MMC_CAP_HSPEED; - /* Decide if we have usable DMA. */ - if (caps & SDHCI_CAN_DO_DMA) - slot->opt |= SDHCI_HAVE_DMA; - if (class == PCIC_BASEPERIPH && - subclass == PCIS_BASEPERIPH_SDHC && - progif != PCI_SDHCI_IFDMA) - slot->opt &= ~SDHCI_HAVE_DMA; - if (sc->quirks & SDHCI_QUIRK_BROKEN_DMA) - slot->opt &= ~SDHCI_HAVE_DMA; - if (sc->quirks & SDHCI_QUIRK_FORCE_DMA) - slot->opt |= SDHCI_HAVE_DMA; - - if (bootverbose || sdhci_debug) { - slot_printf(slot, "%uMHz%s 4bits%s%s%s %s\n", - slot->max_clk / 1000000, - (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", - (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", - (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", - (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", - (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); - sdhci_dumpregs(slot); - } - - TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); - callout_init(&slot->card_callout, 1); - sc->num_slots++; - } - device_printf(dev, "%d slot(s) allocated\n", sc->num_slots); - /* Activate the interrupt */ - err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, sdhci_intr, sc, &sc->intrhand); - if (err) - device_printf(dev, "Can't setup IRQ\n"); - pci_enable_busmaster(dev); - /* Process cards detection. */ - for (i = 0; i < sc->num_slots; i++) { - struct sdhci_slot *slot = &sc->slots[i]; - sdhci_card_task(slot, 0); + /* Initialize slot. */ + sdhci_init(slot); + slot->version = (RD2(slot, SDHCI_HOST_VERSION) + >> SDHCI_SPEC_VER_SHIFT) & SDHCI_SPEC_VER_MASK; + caps = RD4(slot, SDHCI_CAPABILITIES); + /* Calculate base clock frequency. */ + slot->max_clk = + (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; + if (slot->max_clk == 0) { + slot->max_clk = 50; + device_printf(dev, "Hardware doesn't specify base clock " + "frequency.\n"); + } + slot->max_clk *= 1000000; + /* Calculate timeout clock frequency. */ + slot->timeout_clk = + (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; + if (slot->timeout_clk == 0) { + device_printf(dev, "Hardware doesn't specify timeout clock " + "frequency.\n"); + } + if (caps & SDHCI_TIMEOUT_CLK_UNIT) + slot->timeout_clk *= 1000; + + slot->host.f_min = slot->max_clk / 256; + slot->host.f_max = slot->max_clk; + slot->host.host_ocr = 0; + if (caps & SDHCI_CAN_VDD_330) + slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340; + if (caps & SDHCI_CAN_VDD_300) + slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + if (caps & SDHCI_CAN_VDD_180) + slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + if (slot->host.host_ocr == 0) { + device_printf(dev, "Hardware doesn't report any " + "support voltages.\n"); + } + slot->host.caps = MMC_CAP_4_BIT_DATA; + if (caps & SDHCI_CAN_DO_HISPD) + slot->host.caps |= MMC_CAP_HSPEED; + /* Decide if we have usable DMA. */ + if (caps & SDHCI_CAN_DO_DMA) + slot->opt |= SDHCI_HAVE_DMA; + + if (slot->quirks & SDHCI_QUIRK_BROKEN_DMA) + slot->opt &= ~SDHCI_HAVE_DMA; + if (slot->quirks & SDHCI_QUIRK_FORCE_DMA) + slot->opt |= SDHCI_HAVE_DMA; + + if (bootverbose || sdhci_debug) { + slot_printf(slot, "%uMHz%s 4bits%s%s%s %s\n", + slot->max_clk / 1000000, + (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", + (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", + (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", + (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", + (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); + sdhci_dumpregs(slot); } - + + TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); + callout_init(&slot->card_callout, 1); return (0); } -static int -sdhci_detach(device_t dev) +void +sdhci_start_slot(struct sdhci_slot *slot) { - struct sdhci_softc *sc = device_get_softc(dev); - int i; + sdhci_card_task(slot, 0); +} - bus_teardown_intr(dev, sc->irq_res, sc->intrhand); - bus_release_resource(dev, SYS_RES_IRQ, - sc->irq_rid, sc->irq_res); - - for (i = 0; i < sc->num_slots; i++) { - struct sdhci_slot *slot = &sc->slots[i]; - device_t d; - - callout_drain(&slot->card_callout); - taskqueue_drain(taskqueue_swi_giant, &slot->card_task); - - SDHCI_LOCK(slot); - d = slot->dev; - slot->dev = NULL; - SDHCI_UNLOCK(slot); - if (d != NULL) - device_delete_child(dev, d); +int +sdhci_cleanup_slot(struct sdhci_slot *slot) +{ + device_t d; + + callout_drain(&slot->card_callout); + taskqueue_drain(taskqueue_swi_giant, &slot->card_task); + + SDHCI_LOCK(slot); + d = slot->dev; + slot->dev = NULL; + SDHCI_UNLOCK(slot); + if (d != NULL) + device_delete_child(slot->bus, d); + + SDHCI_LOCK(slot); + sdhci_reset(slot, SDHCI_RESET_ALL); + SDHCI_UNLOCK(slot); + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); + + SDHCI_LOCK_DESTROY(slot); - SDHCI_LOCK(slot); - sdhci_reset(slot, SDHCI_RESET_ALL); - SDHCI_UNLOCK(slot); - bus_dmamap_unload(slot->dmatag, slot->dmamap); - bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); - bus_dma_tag_destroy(slot->dmatag); - bus_release_resource(dev, SYS_RES_MEMORY, - slot->mem_rid, slot->mem_res); - SDHCI_LOCK_DESTROY(slot); - } return (0); } -static int -sdhci_suspend(device_t dev) +int +sdhci_generic_suspend(struct sdhci_slot *slot) { - struct sdhci_softc *sc = device_get_softc(dev); - int i, err; + sdhci_reset(slot, SDHCI_RESET_ALL); - err = bus_generic_suspend(dev); - if (err) - return (err); - for (i = 0; i < sc->num_slots; i++) - sdhci_reset(&sc->slots[i], SDHCI_RESET_ALL); return (0); } -static int -sdhci_resume(device_t dev) +int +sdhci_generic_resume(struct sdhci_slot *slot) { - struct sdhci_softc *sc = device_get_softc(dev); - int i; + sdhci_init(slot); - for (i = 0; i < sc->num_slots; i++) - sdhci_init(&sc->slots[i]); - return (bus_generic_resume(dev)); + return (0); } -static int -sdhci_update_ios(device_t brdev, device_t reqdev) +int +sdhci_generic_update_ios(device_t brdev, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); struct mmc_ios *ios = &slot->host.ios; @@ -887,7 +623,7 @@ sdhci_update_ios(device_t brdev, device_ slot->hostctrl &= ~SDHCI_CTRL_HISPD; WR1(slot, SDHCI_HOST_CONTROL, slot->hostctrl); /* Some controllers like reset after bus changes. */ - if(slot->sc->quirks & SDHCI_QUIRK_RESET_ON_IOS) + if(slot->quirks & SDHCI_QUIRK_RESET_ON_IOS) sdhci_reset(slot, SDHCI_RESET_CMD | SDHCI_RESET_DATA); SDHCI_UNLOCK(slot); @@ -1009,10 +745,8 @@ sdhci_start_command(struct sdhci_slot *s WR4(slot, SDHCI_ARGUMENT, cmd->arg); /* Set data transfer mode. */ sdhci_set_transfer_mode(slot, cmd->data); - /* Set command flags. */ - WR1(slot, SDHCI_COMMAND_FLAGS, flags); /* Start command. */ - WR1(slot, SDHCI_COMMAND, cmd->opcode); + WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); } static void @@ -1075,7 +809,7 @@ sdhci_start_data(struct sdhci_slot *slot break; } /* Compensate for an off-by-one error in the CaFe chip.*/ - if (slot->sc->quirks & SDHCI_QUIRK_INCR_TIMEOUT_CONTROL) + if (slot->quirks & SDHCI_QUIRK_INCR_TIMEOUT_CONTROL) div++; if (div >= 0xF) { slot_printf(slot, "Timeout too large!\n"); @@ -1090,11 +824,11 @@ sdhci_start_data(struct sdhci_slot *slot if ((slot->opt & SDHCI_HAVE_DMA)) slot->flags |= SDHCI_USE_DMA; /* If data is small, broken DMA may return zeroes instead of data, */ - if ((slot->sc->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) && + if ((slot->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) && (data->len <= 512)) slot->flags &= ~SDHCI_USE_DMA; /* Some controllers require even block sizes. */ - if ((slot->sc->quirks & SDHCI_QUIRK_32BIT_DMA_SIZE) && + if ((slot->quirks & SDHCI_QUIRK_32BIT_DMA_SIZE) && ((data->len) & 0x3)) slot->flags &= ~SDHCI_USE_DMA; /* Load DMA buffer. */ @@ -1183,7 +917,7 @@ sdhci_start(struct sdhci_slot *slot) if (sdhci_debug > 1) slot_printf(slot, "result: %d\n", req->cmd->error); if (!req->cmd->error && - (slot->sc->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST)) { + (slot->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST)) { sdhci_reset(slot, SDHCI_RESET_CMD); sdhci_reset(slot, SDHCI_RESET_DATA); } @@ -1194,8 +928,8 @@ sdhci_start(struct sdhci_slot *slot) req->done(req); } -static int -sdhci_request(device_t brdev, device_t reqdev, struct mmc_request *req) +int +sdhci_generic_request(device_t brdev, device_t reqdev, struct mmc_request *req) { struct sdhci_slot *slot = device_get_ivars(reqdev); @@ -1216,15 +950,15 @@ sdhci_request(device_t brdev, device_t r SDHCI_UNLOCK(slot); if (dumping) { while (slot->req != NULL) { - sdhci_intr(slot->sc); + sdhci_generic_intr(slot); DELAY(10); } } return (0); } -static int -sdhci_get_ro(device_t brdev, device_t reqdev) +int +sdhci_generic_get_ro(device_t brdev, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); uint32_t val; @@ -1235,8 +969,8 @@ sdhci_get_ro(device_t brdev, device_t re return (!(val & SDHCI_WRITE_PROTECT)); } -static int -sdhci_acquire_host(device_t brdev, device_t reqdev) +int +sdhci_generic_acquire_host(device_t brdev, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); int err = 0; @@ -1251,8 +985,8 @@ sdhci_acquire_host(device_t brdev, devic return (err); } -static int -sdhci_release_host(device_t brdev, device_t reqdev) +int +sdhci_generic_release_host(device_t brdev, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); @@ -1382,85 +1116,79 @@ sdhci_acmd_irq(struct sdhci_slot *slot) sdhci_reset(slot, SDHCI_RESET_CMD); } -static void -sdhci_intr(void *arg) +void +sdhci_generic_intr(struct sdhci_slot *slot) { - struct sdhci_softc *sc = (struct sdhci_softc *)arg; - int i; - - for (i = 0; i < sc->num_slots; i++) { - struct sdhci_slot *slot = &sc->slots[i]; - uint32_t intmask; - - SDHCI_LOCK(slot); - /* Read slot interrupt status. */ - intmask = RD4(slot, SDHCI_INT_STATUS); - if (intmask == 0 || intmask == 0xffffffff) { - SDHCI_UNLOCK(slot); - continue; - } - if (sdhci_debug > 2) - slot_printf(slot, "Interrupt %#x\n", intmask); - - /* Handle card presence interrupts. */ - if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { - WR4(slot, SDHCI_INT_STATUS, intmask & - (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); - - if (intmask & SDHCI_INT_CARD_REMOVE) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card removed\n"); - callout_stop(&slot->card_callout); - taskqueue_enqueue(taskqueue_swi_giant, - &slot->card_task); - } - if (intmask & SDHCI_INT_CARD_INSERT) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card inserted\n"); - callout_reset(&slot->card_callout, hz / 2, - sdhci_card_delay, slot); - } - intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); - } - /* Handle command interrupts. */ - if (intmask & SDHCI_INT_CMD_MASK) { - WR4(slot, SDHCI_INT_STATUS, intmask & SDHCI_INT_CMD_MASK); - sdhci_cmd_irq(slot, intmask & SDHCI_INT_CMD_MASK); - } - /* Handle data interrupts. */ - if (intmask & SDHCI_INT_DATA_MASK) { - WR4(slot, SDHCI_INT_STATUS, intmask & SDHCI_INT_DATA_MASK); - sdhci_data_irq(slot, intmask & SDHCI_INT_DATA_MASK); - } - /* Handle AutoCMD12 error interrupt. */ - if (intmask & SDHCI_INT_ACMD12ERR) { - WR4(slot, SDHCI_INT_STATUS, SDHCI_INT_ACMD12ERR); - sdhci_acmd_irq(slot); - } - intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); - intmask &= ~SDHCI_INT_ACMD12ERR; - intmask &= ~SDHCI_INT_ERROR; - /* Handle bus power interrupt. */ - if (intmask & SDHCI_INT_BUS_POWER) { - WR4(slot, SDHCI_INT_STATUS, SDHCI_INT_BUS_POWER); - slot_printf(slot, - "Card is consuming too much power!\n"); - intmask &= ~SDHCI_INT_BUS_POWER; - } - /* The rest is unknown. */ - if (intmask) { - WR4(slot, SDHCI_INT_STATUS, intmask); - slot_printf(slot, "Unexpected interrupt 0x%08x.\n", - intmask); - sdhci_dumpregs(slot); - } - + uint32_t intmask; + + SDHCI_LOCK(slot); + /* Read slot interrupt status. */ + intmask = RD4(slot, SDHCI_INT_STATUS); + if (intmask == 0 || intmask == 0xffffffff) { SDHCI_UNLOCK(slot); + return; } + if (sdhci_debug > 2) + slot_printf(slot, "Interrupt %#x\n", intmask); + + /* Handle card presence interrupts. */ + if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { + WR4(slot, SDHCI_INT_STATUS, intmask & + (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); + + if (intmask & SDHCI_INT_CARD_REMOVE) { + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card removed\n"); + callout_stop(&slot->card_callout); + taskqueue_enqueue(taskqueue_swi_giant, + &slot->card_task); + } + if (intmask & SDHCI_INT_CARD_INSERT) { + if (bootverbose || sdhci_debug) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 01:24:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0FA3961B; Tue, 16 Oct 2012 01:24:17 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0258FC0C; Tue, 16 Oct 2012 01:24:16 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TNvtH-0003xr-Kz; Mon, 15 Oct 2012 18:24:15 -0700 Message-ID: <507CB73B.1050801@FreeBSD.org> Date: Mon, 15 Oct 2012 18:24:11 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: d@delphij.net Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <507CB347.3040502@delphij.net> In-Reply-To: <507CB347.3040502@delphij.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: Adrian Chadd , src-committers@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Xin Li X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 01:24:17 -0000 On 10/15/2012 6:07 PM, Xin Li wrote: > Because it's not guaranteed to work on every filesystems? But yes I > think it would be a good idea to implement it and use it when all > filesystems used to store crontabs supports it. I considered it, but it seems inadequate for things like: # mv /etc /etc.old # mv /etc.new /etc -Maxim From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 01:34:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDD89A6A; Tue, 16 Oct 2012 01:34:15 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 91F768FC0C; Tue, 16 Oct 2012 01:34:15 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TNvrh-0003xl-WE; Mon, 15 Oct 2012 18:22:38 -0700 Message-ID: <507CB6D7.7000706@sippysoft.com> Date: Mon, 15 Oct 2012 18:22:31 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ssp-trusted: yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 01:34:15 -0000 On 10/15/2012 4:26 PM, Adrian Chadd wrote: > Maybe crontab should be using a command via a socket to reload, rather > than stat'ing files.. Simple signal would do. kqueuing the file is not as easy, but this would complicate logic as you would need to look at renames, removes etc. I really doubt that it can catch things like renaming the whole directory at the upper level and replacing it with something else. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts Tel: +1-646-651-1110 Fax: +1-866-857-6942 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 02:52:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 169EDAC6; Tue, 16 Oct 2012 02:52:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC3B28FC0C; Tue, 16 Oct 2012 02:52:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G2qUe2028639; Tue, 16 Oct 2012 02:52:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G2qUTs028637; Tue, 16 Oct 2012 02:52:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210160252.q9G2qUTs028637@svn.freebsd.org> From: Eitan Adler Date: Tue, 16 Oct 2012 02:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241602 - head/share/examples/csh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 02:52:31 -0000 Author: eadler Date: Tue Oct 16 02:52:30 2012 New Revision: 241602 URL: http://svn.freebsd.org/changeset/base/241602 Log: Add a bunch more example completions. Submitted by: wblock Approved by: cperciva (implicit) MFC after: 3 days Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Tue Oct 16 01:37:17 2012 (r241601) +++ head/share/examples/csh/dot.cshrc Tue Oct 16 02:52:30 2012 (r241602) @@ -25,29 +25,99 @@ bindkey "^[[3~" delete-char-or-list-or-e # Make the Ins key work bindkey "\e[2~" overwrite-mode -# Aliases used for completions -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1' -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' - # Some common completions +complete cd 'p/1/d/' complete chown 'p/1/u/' complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' +complete find 'n/-fstype/"(nfs 4.2)"/' 'n/-name/f/' \ + 'n/-type/(c b d f p l s)/' \ + 'n/-user/u/ n/-group/g/' \ + 'n/-exec/c/' 'n/-ok/c/' \ + 'n/-cpio/f/' \ + 'n/-ncpio/f/' \ + 'n/-newer/f/' \ + 'c/-/(fstype name perm prune type user nouser group nogroup size inum atime mtime ctime exec \ + ok print ls cpio ncpio newer xdev depth daystart follow maxdepth mindepth noleaf version \ + anewer cnewer amin cmin mmin true false uid gid ilname iname ipath iregex links lname empty path \ + regex used xtype fprint fprint0 fprintf print0 printf not a and o or)/' \ + 'n/*/d/' +complete fg 'c/%/j/' +complete gpart 'p/1/(add backup bootcode commit create delete destroy modify recover resize restore set show undo unset)/' \ + 'n/add/x:-t type [-a alignment] [-b start] [-s size] [-i index] [-l label] -f flags geom/' \ + 'n/backup/x:geom/' \ + 'n/bootcode/x:[-b bootcode] [-p partcode -i index] [-f flags] geom/' \ + 'n/commit/x:geom/' \ + 'n/create/x:-s scheme [-n entries] [-f flags] provider/' \ + 'n/delete/x:-i index [-f flags] geom/' \ + 'n/destroy/x:[-F] [-f flags] geom/' \ + 'n/modify/x:-i index [-l label] [-t type] [-f flags] geom/' \ + 'n/recover/x:[-f flags] geom/' \ + 'n/resize/x:-i index [-a alignment] [-s size] [-f flags] geom/' \ + 'n/restore/x:[-lF] [-f flags] provider [...]/' \ + 'n/set/x:-a attrib -i index [-f flags] geom/' \ + 'n/show/x:[-l | -r] [-p] [geom ...]/' \ + 'n/undo/x:geom/' \ + 'n/unset/x:-a attrib -i index [-f flags] geom/' +complete grep 'c/-*A/x:<#_lines_after>/' \ + 'c/-*B/x:<#_lines_before>/' \ + 'c/--/(extended-regexp fixed-regexp basic-regexp regexp file ignore-case word-regexp line-regexp \ + no-messages revert-match version help byte-offset line-number with-filename no-filename quiet silent \ + text directories recursive files-without-match files-with-matches count before-context after-context \ + context binary unix-byte-offsets)/' \ + 'c/-/(A a B b C c d E e F f G H h i L l n q r s U u V v w x)/' \ + 'p/1/x:/ N/-*e/f/' \ + 'n/-*e/x:/' \ + 'n/-*f/f/' \ + 'n/*/f/' +complete ifconfig 'p@1@`ifconfig -l`@' \ + 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' + 'c/%/j/' \ + 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' -complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' -complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' -complete man 'C/*/c/' +complete kldload 'n@*@`ls -1 /boot/modules/ /boot/kernel/ | awk -F/ \$NF\ \~\ \".ko\"\ \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\}`@' +complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name`@' +complete make 'p@1@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' \ + 'n@-V@`make -ndv | & grep Global: | sed -E -e "s/^Global://" -e "s/ .*//" -e "/^[[:lower:]]/d" | sort | uniq`@' +complete man 'C/*/c/' +complete netstat 'n@-I@`ifconfig -l`@' complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@' -complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ - clean-packages delete-build-only delete-packages force-config help \ - index index-first index-only list-origins local-packagedir no-confirm \ - no-index-fetch no-term-title packages packages-build packages-if-newer \ - packages-local packages-only show-work update-if-newer version)/' \ - 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ - 'n@*@`_PKGS_PkGs_PoRtS_`@' +complete ping 'p/1/$hosts/' +complete pkill 'c/-/S/' \ + 'n@*@`ps -axc -o command="" | sort | uniq`@' +complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles clean-packages delete-build-only \ + delete-packages force-config help index index-first index-only list-origins local-packagedir \ + no-confirm no-index-fetch no-term-title packages packages-build packages-if-newer packages-local \ + packages-only show-work update-if-newer version)/' \ + 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ + 'n@*@`pkg_info -E \*`@' +complete rsync "c,*:/,F:/," \ + "c,*:,F:$HOME," \ + 'c/*@/$hosts/:/' +complete scp "c,*:/,F:/," \ + "c,*:,F:$HOME," \ + 'c/*@/$hosts/:/' complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' +complete svn 'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \ + 'n@ls@(file:/// svn+ssh:// svn://)@@' \ + 'n@help@(add blame cat checkout cleanup commit copy delete export help import info list ls lock log merge mkdir move propdel \ + propedit propget proplist propset resolved revert status switch unlock update)@' 'p@1@(add blame cat checkout cleanup commit \ + copy delete export help import info list ls lock log merge mkdir move propdel propedit propget proplist propset resolved \ + revert status switch unlock update)@' +complete ssh 'p/1/$hosts/' \ + 'c/-/(l n)/' \ + 'n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/' complete sysctl 'n/*/`sysctl -Na`/' +complete tmux 'n/*/(attach detach has kill-server kill-session lsc lscm ls lockc locks new refresh rename showmsgs source start suspendc switchc)/' +complete which 'C/*/c/' + +if ( -f /etc/printcap ) then + set printers=(`sed -n -e "/^[^ #].*:/s/:.*//p" /etc/printcap`) + complete lpr 'c/-P/$printers/' + complete lpq 'c/-P/$printers/' + complete lprm 'c/-P/$printers/' +endif # Alternate prompts set prompt = '#' From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 03:01:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FEDDE4A; Tue, 16 Oct 2012 03:01:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id AACB88FC12; Tue, 16 Oct 2012 03:01:50 +0000 (UTC) Received: from mail27.syd.optusnet.com.au (mail27.syd.optusnet.com.au [211.29.133.168]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9G31mjR027241; Tue, 16 Oct 2012 14:01:48 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail27.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9G31VqE018357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Oct 2012 14:01:33 +1100 Date: Tue, 16 Oct 2012 14:01:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib In-Reply-To: <1350335891.1123.160.camel@revolution.hippie.lan> Message-ID: <20121016133233.I1358@besplex.bde.org> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-CMAE-Score: 0 X-CMAE-Analysis: v=2.0 cv=f7kQn5OM c=1 sm=1 a=l03AIqCZp40A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=QofNcMrMajQA:10 a=vGqK-bROAAAA:8 a=VBVLp-hbcsnfAaLx1pQA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: Maxim Sobolev , src-committers@freebsd.org, Pawel Jakub Dawidek , Garrett Cooper , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 03:01:52 -0000 On Mon, 15 Oct 2012, Ian Lepore wrote: > On Mon, 2012-10-15 at 13:52 -0700, Garrett Cooper wrote: >> On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore >> wrote: >>> On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: >>>> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: >>>>> ... >>>>> >>>>> Log: >>>>> Add per-second scheduling into the cron(8). Right now it's >>>>> only available via the new @every_second shortcut. ENOTIME to >>>>> implement crontab(5) format extensions to allow more flexible >>>>> scheduling. >>>>> ... >>>> >>>> Do I read the code correctly and the cron deamon will wake up every >>>> second now even if @every_second is not used at all? >>> >>> It appears to, which I don't think is a bad thing at all. But the way >>> it waits is to wake up, do some work, and go back to sleep for an >>> integer 1 second. That will occasionally lead to a second in which no >>> wakeup happens, as the "do some work" part always takes some fraction of >>> a second. >> >> This is silly. It should be waking up at the lowest common >> denominator of time quanta, not every second; this could be determined >> via the crontab its managing. > > In 1987 I would have been outraged at waking up at 1hz needlessly. > Sitting here typing on a machine that's doing 12,000 interrupts/sec just > to maintain clocks, and top shows interrupts using 0.0% cpu, it's hard > to get too upset about a 1hz loop anymore. It's more outrageous now, since there are more battery-powered systems and even mains power is much more expensive. In 1987 I didn't worry about kernel clock interrupts at 60 Hz, but they are outrageous now too :-). Clock interrupts normally aren't accounted for properly. With proper accounting, I've seen them taking 1-10% on bad systems in 1987 and 2007, but 0.1% is more normal. Even a fast x86 probably takes 1 microsecond per clock interrupt to do almost nothing, so the bad default of HZ = 1000 costs 0.1%, and HZ = 10000 costs 1%. > On the other hand, if people are going to rely on this new feature of > being able to execute something every second, then the integer sleep > needs to be changed to a nanosleep() calculated to truly wake up at a > 1hz rate without eliding seconds now and then. My version of ping does this so as to send out packets every second instead of drifting at a rate of approximately 2/HZ per second (normal ping sends a packet and then tries to wait for 1 second but actually waits for 1 second plus the scheduling granularity (rounded up) plus any scheduling delay. Then it has a minor delay sending the next packet before trying to wait for 1 second again). The drift is very noticable if the scheduling granularity is large. I use select timeouts for this (ping already uses select timeouts and I just calculate the time to the next second instead of always using 1), but I now think this would be better implemented as a periodic itimer. Old versions of ping used non-periodic alarms and had significant (at least in 1987-1997) system overheads from this (for restarting the alarms), so ping was changed to use select timeouts. It still has to restart the timeouts but this now happens in the same syscall that waits for a packet to come back. cron should care more about waking up at exact seconds boundaries. Periodic itimers aren't accurate enough for this (they drift, but at a constant rate). Except high resolution timers might "fix" this using lots more clock interrupts and outrageous slowness to get precise timing. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 03:12:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF3511AE; Tue, 16 Oct 2012 03:12:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 34C9E8FC16; Tue, 16 Oct 2012 03:12:12 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9G3C8rG032286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Oct 2012 14:12:09 +1100 Date: Tue, 16 Oct 2012 14:12:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message-ID: <20121016140607.Y1358@besplex.bde.org> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> <20121015151147.GA92923@stack.nl> <20121016045904.Q15233@besplex.bde.org> <20121015222333.GY89655@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-CMAE-Score: 0 X-CMAE-Analysis: v=2.0 cv=fsSE/yEf c=1 sm=1 a=qS4vZm_gVugA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=20xahBMZJpIA:10 a=6I5d2MoRAAAA:8 a=9o6XcbDuoQn1XFczO7MA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: src-committers@freebsd.org, Jilles Tjoelker , John Baldwin , svn-src-all@freebsd.org, Gleb Smirnoff , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 03:12:12 -0000 On Mon, 15 Oct 2012, Garrett Cooper wrote: > On Mon, Oct 15, 2012 at 3:23 PM, Gleb Smirnoff wrote: >> On Tue, Oct 16, 2012 at 05:09:31AM +1100, Bruce Evans wrote: >> B> > On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: >[>]* >> B> >> I have used this construction several times already without any side >> B> >> effects. I have also seen it in some software in ports, where it works >> B> >> okay, too. >> B> > >> B> > The C standard indeed permits this, but gcc -Wundef will warn about it. >> B> > That compiler warning is in CWARNFLAGS in sys/conf/kern.mk so I suggest >> B> > adding the 'defined(__FreeBSD_version) &&'. >> B> >> B> The C standard requires this, but some misconfigured compilers like >> B> gcc -Wundef warn about it, and some non-C compilers like gcc -Wundef >> B> -Werror fail on it. The bug is sometimes hidden by -Wno-system-headers, >> B> but FreeBSD wants to detect bugs in system headers so it sets >> B> -Wsystem-headers at WARNS >= 1, and then the buggy compilers find this >> B> non-bug in system headers. The result is uglification of many system >> B> headers to use if `defined(__FOO) && ...' instead of depending on this >> B> standard and useful feature. >> >> Shouldn't we then remove -Wundef from CWARNFLAGS in kern.mk? I objected when it was committed... It still isn't in bsd.sys.mk. It's not too bad for the kernel, since we control all the sources. > There is some value to -Wundef if used properly: > > -Wundef > Warn whenever an identifier which is not a macro is encountered in > an #if directive, outside of defined. Such identifiers are > replaced with zero. Like the -u option in sh. It is useful mainly for avoiding bugs in quickly written code. It is most useful in ineractive sh since quickly written command lines are normal and go live immediately. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 03:56:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03738B0B for ; Tue, 16 Oct 2012 03:56:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm32-vm6.bullet.mail.gq1.yahoo.com (nm32-vm6.bullet.mail.gq1.yahoo.com [98.136.216.229]) by mx1.freebsd.org (Postfix) with ESMTP id B5BC58FC0A for ; Tue, 16 Oct 2012 03:56:38 +0000 (UTC) Received: from [98.137.12.57] by nm32.bullet.mail.gq1.yahoo.com with NNFMP; 16 Oct 2012 03:50:48 -0000 Received: from [208.71.42.191] by tm2.bullet.mail.gq1.yahoo.com with NNFMP; 16 Oct 2012 03:50:48 -0000 Received: from [127.0.0.1] by smtp202.mail.gq1.yahoo.com with NNFMP; 16 Oct 2012 03:50:48 -0000 X-Yahoo-Newman-Id: 699518.54932.bm@smtp202.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: YkJbOf4VM1l0uF_C4iJnPKMDTjLLPgY9laTl6vJ3JTYf5Ko xM63oQshGcWEXMYHxEBJYrEN9Zr2mnXeQjyXjxZugLbD.Cmy4njxV0ad6jhh iak_nwGhiDXbrT2omexHp2WtmLEgvs3im6LWd10M8KaXHw5WZ35KA3RqcypC XnHw0JE8bk7RzYDqXgNjCSqd7svSz8lTPoVTbUQMqpC0rSMqhtk8CsXuNgXk Wg1hvCaVoqYkdCQl8mVK5CwaFRlr_IBNujDipJPUW_vkoRvbtNkh7WsKAmqy POwFeb32Rnl4e8Qr0Jxhjzoe23NaeAMe9oMglS8wHFqo5m7axzLx1D5Mw6Eu NU52EzUB5ODd8pHtq8x5fZeEL4yei4WKqAdZ0EVu5qSYJzbUvi9V2D.QJFHN 8b3BaN.W59vuJwTb5b_vfMZurAlnnv41a_Kx8IMZVXhkrMx3D0QEXMzeKS7D Xgkzgau1CrHlyEP4FIbpH6zB2ZGncHQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.101] (pfg@200.118.157.7 with plain) by smtp202.mail.gq1.yahoo.com with SMTP; 15 Oct 2012 20:50:48 -0700 PDT Message-ID: <507CD99D.1070606@FreeBSD.org> Date: Mon, 15 Oct 2012 22:50:53 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> <20121016133233.I1358@besplex.bde.org> In-Reply-To: <20121016133233.I1358@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Ian Lepore , src-committers@freebsd.org, Pawel Jakub Dawidek , Maxim Sobolev , Garrett Cooper , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 03:56:39 -0000 On 10/15/2012 22:01, Bruce Evans wrote: > On Mon, 15 Oct 2012, Ian Lepore wrote: > >> On Mon, 2012-10-15 at 13:52 -0700, Garrett Cooper wrote: >>> ... >> >> In 1987 I would have been outraged at waking up at 1hz needlessly. >> Sitting here typing on a machine that's doing 12,000 interrupts/sec just >> to maintain clocks, and top shows interrupts using 0.0% cpu, it's hard >> to get too upset about a 1hz loop anymore. > > It's more outrageous now, since there are more battery-powered systems > and even mains power is much more expensive. > Which reminds me why Apple created launchd for ;). Pedro. From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 04:40:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A84D577; Tue, 16 Oct 2012 04:40:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 064E38FC08; Tue, 16 Oct 2012 04:40:16 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so7689177oag.13 for ; Mon, 15 Oct 2012 21:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=NuV+394nNAQgLkIndSQlV0pdohw/5bJf+JG2IZXrWzo=; b=VN5jOlgzlVEJVcPeRP6T2g0Mz9GSm/tJDLgb6UTiZOW2AU2Zngewr4l3CRPQq2QMso nl5gq3nde9SFKkJvAYX48eky/cjcDwOVy6exPGE8i0qvuoqxYq+Txleb7PC8tlpmqh8h bjXFJgt4fkz8fgWwYOqZIF3efxCGnLGiizl6GE0nkvdRvHQgwbwtRnFss2KY1JwRjgGE qnu3ZqObSY4KhpqoEqjquAEqtZnUtixyKFE93jQ3X10+Hkz3JYwiquKA+TdSA+6H6dNt GNeWV8/RKgoVxaNoX8n0t9IuSdoXqHcQZQKTQC4WlMLoFozgQJFo9AeB3LpkLxvb8Z8R AgZQ== MIME-Version: 1.0 Received: by 10.60.170.142 with SMTP id am14mr11475890oec.40.1350362416004; Mon, 15 Oct 2012 21:40:16 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.76.153.69 with HTTP; Mon, 15 Oct 2012 21:40:15 -0700 (PDT) In-Reply-To: <507CD99D.1070606@FreeBSD.org> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> <20121016133233.I1358@besplex.bde.org> <507CD99D.1070606@FreeBSD.org> Date: Mon, 15 Oct 2012 21:40:15 -0700 X-Google-Sender-Auth: aIa_lqBjkNIn6TlcFzZTdm0hUvM Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Adrian Chadd To: Pedro Giffuni Content-Type: text/plain; charset=ISO-8859-1 Cc: Ian Lepore , src-committers@freebsd.org, Pawel Jakub Dawidek , Maxim Sobolev , Garrett Cooper , svn-src-all@freebsd.org, Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 04:40:17 -0000 Gah, I think there's quite a lot of push back on this. Maxim, would you please consider reverting this patch? Can we have a discussion on the best way to do this, taking various things like embedded and power-saving systems into effect? Thanks, Adrian From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 06:05:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD54141B; Tue, 16 Oct 2012 06:05:03 +0000 (UTC) (envelope-from netch@segfault.kiev.ua) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4F97E8FC08; Tue, 16 Oct 2012 06:05:02 +0000 (UTC) Received: from segfault.kiev.ua (localhost.segfault.kiev.ua [127.0.0.1]) by segfault.kiev.ua (8.14.5/8.14.5/8.Who.Cares) with ESMTP id q9G64u3x065646; Tue, 16 Oct 2012 09:04:56 +0300 (EEST) (envelope-from netch@segfault.kiev.ua) Received: (from netch@localhost) by segfault.kiev.ua (8.14.5/8.14.5/Submit) id q9G64pXh065643; Tue, 16 Oct 2012 09:04:51 +0300 (EEST) (envelope-from netch) Date: Tue, 16 Oct 2012 09:04:51 +0300 From: Valentin Nechayev To: Adrian Chadd Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib Message-ID: <20121016060451.GZ94815@netch.kiev.ua> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-42: On Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 06:05:03 -0000 Mon, Oct 15, 2012 at 15:45:37, adrian wrote about "Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib": > Why not sleep for the amonut of time needed before the next event? If you do this for all events listed currently in all crontabs, you need event engine. Currently request to recheck crontabs each minute masks the need to build event list. Switching this to 1-second step breaks former success. But we still can do something like if (per_second_requests_count > 0) sleep(1); else sleep_until_next_minute_margin(); as soon as there will be really few systems where @every_second is used. -netch- From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 07:01:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4BF355C8; Tue, 16 Oct 2012 07:01:06 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 223818FC14; Tue, 16 Oct 2012 07:01:05 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TO19E-0004rj-IL; Tue, 16 Oct 2012 00:01:04 -0700 Message-ID: <507D062A.8060109@FreeBSD.org> Date: Tue, 16 Oct 2012 00:00:58 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> In-Reply-To: <1350333885.1123.153.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 07:01:06 -0000 On 10/15/2012 1:44 PM, Ian Lepore wrote: > It appears to, which I don't think is a bad thing at all. But the way > it waits is to wake up, do some work, and go back to sleep for an > integer 1 second. That will occasionally lead to a second in which no > wakeup happens, as the "do some work" part always takes some fraction of > a second. Right, I will look into it. I believe the reason why we cannot "sleep until the next event" is that time can go back and forth in the meantime (e.g. ntpd / ntpdate), so that amount you think you can sleep can change while you are already sleeping. It should not be that hard to change it to wake up every 60 seconds if there is no per-second activity planned. Also I think some more logic necessary to ignore seconds in comparison, unless it's "every x seconds" job. Otherwise we might loose job set up for 00:00:00 by waking up say 00:00:00:01, not at 00:00:00:00 due to paging, network latency (e.g. running off nfs), etc. -Maxim From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 07:06:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9678B773; Tue, 16 Oct 2012 07:06:49 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 64ABE8FC0C; Tue, 16 Oct 2012 07:06:48 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TO1El-0004sH-6U; Tue, 16 Oct 2012 00:06:47 -0700 Message-ID: <507D077C.6080108@FreeBSD.org> Date: Tue, 16 Oct 2012 00:06:36 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> <20121016133233.I1358@besplex.bde.org> <507CD99D.1070606@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: Ian Lepore , src-committers@freebsd.org, Pawel Jakub Dawidek , Garrett Cooper , svn-src-all@freebsd.org, Pedro Giffuni , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 07:06:49 -0000 On 10/15/2012 9:40 PM, Adrian Chadd wrote: > Gah, I think there's quite a lot of push back on this. > > Maxim, would you please consider reverting this patch? Can we have a > discussion on the best way to do this, taking various things like > embedded and power-saving systems into effect? I am working on improved version, so that in the absence of @every_second it would revert to the previous behavior. Even though I seriously doubt that few thousand additional CPU cycles every second would make any measurable differences in any practical application. -Maxim From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 08:40:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 501ADE70; Tue, 16 Oct 2012 08:40:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36B068FC16; Tue, 16 Oct 2012 08:40:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G8eAjc094072; Tue, 16 Oct 2012 08:40:10 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G8e9K7094068; Tue, 16 Oct 2012 08:40:09 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210160840.q9G8e9K7094068@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 16 Oct 2012 08:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241603 - head/sys/dev/aha X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 08:40:10 -0000 Author: glebius Date: Tue Oct 16 08:40:09 2012 New Revision: 241603 URL: http://svn.freebsd.org/changeset/base/241603 Log: Fix build of aha(4). Submitted by: delphij Modified: head/sys/dev/aha/aha.c head/sys/dev/aha/aha_isa.c head/sys/dev/aha/ahareg.h Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Tue Oct 16 02:52:30 2012 (r241602) +++ head/sys/dev/aha/aha.c Tue Oct 16 08:40:09 2012 (r241603) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -68,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -173,8 +175,7 @@ static void ahatimeout(void *arg); /* Exported functions */ void -aha_alloc(struct aha_softc *aha, int unit, bus_space_tag_t tag, - bus_space_handle_t bsh) +aha_alloc(struct aha_softc *aha) { SLIST_INIT(&aha->free_aha_ccbs); @@ -1107,7 +1108,7 @@ ahaexecuteccb(void *arg, bus_dma_segment device_printf(aha->dev, "Encountered busy mailbox with %d out of %d " "commands active!!!", aha->active_ccbs, aha->max_ccbs); - callout_stop(&aacb->timer); + callout_stop(&accb->timer); if (nseg != 0) bus_dmamap_unload(aha->buffer_dmat, accb->dmamap); ahafreeccb(aha, accb); @@ -1833,7 +1834,7 @@ ahatimeout(void *arg) * later which will attempt a bus reset. */ accb->flags |= ACCB_DEVICE_RESET; - callout_reset(&aacb->timer, 2 * hz, ahatimeout, accb); + callout_reset(&accb->timer, 2 * hz, ahatimeout, accb); aha->recovery_accb->hccb.opcode = INITIATOR_BUS_DEV_RESET; /* No Data Transfer */ Modified: head/sys/dev/aha/aha_isa.c ============================================================================== --- head/sys/dev/aha/aha_isa.c Tue Oct 16 02:52:30 2012 (r241602) +++ head/sys/dev/aha/aha_isa.c Tue Oct 16 08:40:09 2012 (r241603) @@ -126,7 +126,7 @@ aha_isa_probe(device_t dev) if (aha->port == NULL) return (ENXIO); - port_start = rman_get_start(port_res); + port_start = rman_get_start(aha->port); aha_alloc(aha); /* See if there is really a card present */ @@ -321,9 +321,9 @@ aha_isa_identify(driver_t *driver, devic * XXX kldload/kldunload. */ rid = 0; - aha->port = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, + aha.port = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, ioport, ioport, AHA_NREGS, RF_ACTIVE); - if (aha->port == NULL) + if (aha.port == NULL) continue; aha_alloc(&aha); /* See if there is really a card present */ @@ -335,8 +335,8 @@ aha_isa_identify(driver_t *driver, devic * Could query the board and set IRQ/DRQ, but probe does * that. */ - not_this_one:; - bus_release_resource(parent, SYS_RES_IOPORT, rid, aha->port); + not_this_one: + bus_release_resource(parent, SYS_RES_IOPORT, rid, aha.port); aha_free(&aha); } } Modified: head/sys/dev/aha/ahareg.h ============================================================================== --- head/sys/dev/aha/ahareg.h Tue Oct 16 02:52:30 2012 (r241602) +++ head/sys/dev/aha/ahareg.h Tue Oct 16 08:40:09 2012 (r241603) @@ -370,12 +370,12 @@ struct aha_softc { int irqrid; int portrid; int drqrid; - void **ih; + void *ih; device_t dev; struct mtx lock; }; -void aha_alloc(struct aha_softc *, int, bus_space_tag_t, bus_space_handle_t); +void aha_alloc(struct aha_softc *); int aha_attach(struct aha_softc *); int aha_cmd(struct aha_softc *, aha_op_t, uint8_t *, u_int, uint8_t *, u_int, u_int); @@ -389,11 +389,11 @@ int aha_probe(struct aha_softc *); #define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */ -#define aha_inb(aha, port) \ - bus_read_1((aha)->port, port) +#define aha_inb(aha, reg) \ + bus_read_1((aha)->port, reg) -#define aha_outb(aha, port, value) \ - bus_write_1((aha)->port, port, value) +#define aha_outb(aha, reg, value) \ + bus_write_1((aha)->port, reg, value) #define ADP0100_PNP 0x00019004 /* ADP0100 */ #define AHA1540_PNP 0x40159004 /* ADP1540 */ From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 09:55:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E306A8A; Tue, 16 Oct 2012 09:55:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D168FC12; Tue, 16 Oct 2012 09:55:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G9tV51010499; Tue, 16 Oct 2012 09:55:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G9tVBY010493; Tue, 16 Oct 2012 09:55:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210160955.q9G9tVBY010493@svn.freebsd.org> From: Attilio Rao Date: Tue, 16 Oct 2012 09:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241604 - in head/sys: conf kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 09:55:32 -0000 Author: attilio Date: Tue Oct 16 09:55:31 2012 New Revision: 241604 URL: http://svn.freebsd.org/changeset/base/241604 Log: Disconnect non-MPSAFE HPFS from the build in preparation for dropping GIANT from VFS. This is not targeted for MFC. Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/kern/Make.tags.inc Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 16 08:40:09 2012 (r241603) +++ head/sys/conf/NOTES Tue Oct 16 09:55:31 2012 (r241604) @@ -1004,7 +1004,6 @@ options NFSCLIENT #Network File System options CD9660 #ISO 9660 filesystem options FDESCFS #File descriptor filesystem options FUSE #FUSE support module -options HPFS #OS/2 File system options MSDOSFS #MS DOS File System (FAT, FAT32) options NFSSERVER #Network File System server options NFSLOCKD #Network Lock Manager Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 16 08:40:09 2012 (r241603) +++ head/sys/conf/files Tue Oct 16 09:55:31 2012 (r241604) @@ -2328,11 +2328,6 @@ fs/fuse/fuse_main.c optional fuse fs/fuse/fuse_node.c optional fuse fs/fuse/fuse_vfsops.c optional fuse fs/fuse/fuse_vnops.c optional fuse -fs/hpfs/hpfs_alsubr.c optional hpfs -fs/hpfs/hpfs_lookup.c optional hpfs -fs/hpfs/hpfs_subr.c optional hpfs -fs/hpfs/hpfs_vfsops.c optional hpfs -fs/hpfs/hpfs_vnops.c optional hpfs fs/msdosfs/msdosfs_conv.c optional msdosfs fs/msdosfs/msdosfs_denode.c optional msdosfs fs/msdosfs/msdosfs_fat.c optional msdosfs Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 16 08:40:09 2012 (r241603) +++ head/sys/conf/options Tue Oct 16 09:55:31 2012 (r241604) @@ -212,7 +212,6 @@ EXT2FS opt_dontuse.h FDESCFS opt_dontuse.h FFS opt_dontuse.h FUSE opt_dontuse.h -HPFS opt_dontuse.h MSDOSFS opt_dontuse.h NANDFS opt_dontuse.h NTFS opt_dontuse.h Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Tue Oct 16 08:40:09 2012 (r241603) +++ head/sys/kern/Make.tags.inc Tue Oct 16 09:55:31 2012 (r241604) @@ -27,7 +27,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/fs/devfs/*.[ch] \ ${SYS}/fs/fdescfs/*.[ch] \ ${SYS}/fs/fifofs/*.[ch] \ - ${SYS}/fs/hpfs/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ ${SYS}/fs/ntfs/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 09:57:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28EF6C42; Tue, 16 Oct 2012 09:57:35 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10A4E8FC0A; Tue, 16 Oct 2012 09:57:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G9vYpr010903; Tue, 16 Oct 2012 09:57:34 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G9vYQe010899; Tue, 16 Oct 2012 09:57:34 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201210160957.q9G9vYQe010899@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 16 Oct 2012 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241605 - head/sys/dev/dpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 09:57:35 -0000 Author: pluknet Date: Tue Oct 16 09:57:34 2012 New Revision: 241605 URL: http://svn.freebsd.org/changeset/base/241605 Log: Fix build of dpt(4). Modified: head/sys/dev/dpt/dpt_scsi.c Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Tue Oct 16 09:55:31 2012 (r241604) +++ head/sys/dev/dpt/dpt_scsi.c Tue Oct 16 09:57:34 2012 (r241605) @@ -720,11 +720,11 @@ dptexecuteccb(void *arg, bus_dma_segment union ccb *ccb; struct dpt_softc *dpt; - if (!dumping) - mtx_assert(&dpt->lock, MA_OWNED); dccb = (struct dpt_ccb *)arg; ccb = dccb->ccb; dpt = (struct dpt_softc *)ccb->ccb_h.ccb_dpt_ptr; + if (!dumping) + mtx_assert(&dpt->lock, MA_OWNED); if (error != 0) { if (error != EFBIG) From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 09:59:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6E1BDBD; Tue, 16 Oct 2012 09:59:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5938FC0A; Tue, 16 Oct 2012 09:59:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G9xBCN011242; Tue, 16 Oct 2012 09:59:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G9xBTr011224; Tue, 16 Oct 2012 09:59:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210160959.q9G9xBTr011224@svn.freebsd.org> From: Attilio Rao Date: Tue, 16 Oct 2012 09:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241606 - in head: etc/defaults etc/mtree include sbin/mount share/doc/smm/01.setup share/examples share/man/man7 sys/boot/forth sys/conf sys/kern sys/modules usr.sbin usr.sbin/crunch/e... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 09:59:11 -0000 Author: attilio Date: Tue Oct 16 09:59:10 2012 New Revision: 241606 URL: http://svn.freebsd.org/changeset/base/241606 Log: Disconnect non-MPSAFE PORTALFS from the build in preparation for dropping GIANT from VFS. This is not targeted for MFC. Modified: head/etc/defaults/rc.conf head/etc/mtree/BSD.usr.dist head/include/Makefile head/sbin/mount/mount.8 head/sbin/mount/mount.c head/share/doc/smm/01.setup/3.t head/share/doc/smm/01.setup/4.t head/share/examples/Makefile head/share/man/man7/hier.7 head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/kern/Make.tags.inc head/sys/modules/Makefile head/usr.sbin/Makefile head/usr.sbin/crunch/examples/really-big.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Oct 16 09:57:34 2012 (r241605) +++ head/etc/defaults/rc.conf Tue Oct 16 09:59:10 2012 (r241606) @@ -92,7 +92,7 @@ fsck_y_enable="NO" # Set to YES to do fs fsck_y_flags="" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. -netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB portalfs:PORTAL nwfs:NWFS" # Net filesystems. +netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB nwfs:NWFS" # Net filesystems. extra_netfs_types="NO" # List of network extra filesystem types for delayed # mount at startup (or NO). Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Oct 16 09:57:34 2012 (r241605) +++ head/etc/mtree/BSD.usr.dist Tue Oct 16 09:59:10 2012 (r241606) @@ -289,8 +289,6 @@ .. pf .. - portal - .. ppi .. ppp Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Oct 16 09:57:34 2012 (r241605) +++ head/include/Makefile Tue Oct 16 09:59:10 2012 (r241606) @@ -44,7 +44,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ - ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ + ${_fs_nwfs} fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Tue Oct 16 09:57:34 2012 (r241605) +++ head/sbin/mount/mount.8 Tue Oct 16 09:59:10 2012 (r241606) @@ -450,7 +450,6 @@ However, for the following file system t .Cm nwfs , .Cm nullfs , .Cm oldnfs , -.Cm portalfs , .Cm smbfs , .Cm udf , and @@ -548,7 +547,6 @@ support for a particular file system mig .Xr mount_ntfs 8 , .Xr mount_nullfs 8 , .Xr mount_nwfs 8 , -.Xr mount_portalfs 8 , .Xr mount_smbfs 8 , .Xr mount_udf 8 , .Xr mount_unionfs 8 , Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Tue Oct 16 09:57:34 2012 (r241605) +++ head/sbin/mount/mount.c Tue Oct 16 09:59:10 2012 (r241606) @@ -143,7 +143,7 @@ use_mountprog(const char *vfstype) unsigned int i; const char *fs[] = { "cd9660", "mfs", "msdosfs", "nfs", "ntfs", - "nwfs", "nullfs", "oldnfs", "portalfs", "smbfs", "udf", "unionfs", + "nwfs", "nullfs", "oldnfs", "smbfs", "udf", "unionfs", NULL }; Modified: head/share/doc/smm/01.setup/3.t ============================================================================== --- head/share/doc/smm/01.setup/3.t Tue Oct 16 09:57:34 2012 (r241605) +++ head/share/doc/smm/01.setup/3.t Tue Oct 16 09:59:10 2012 (r241606) @@ -1237,10 +1237,8 @@ location that uses a different password .PP Other new filesystems that may be stacked include the loopback filesystem .Xr mount_lofs (8), -the kernel filesystem -.Xr mount_kernfs (8), -and the portal filesystem -.Xr mount_portal (8). +and the kernel filesystem +.Xr mount_kernfs (8). .PP The buffer cache in the kernel is now organized as a file block cache rather than a device block cache. Modified: head/share/doc/smm/01.setup/4.t ============================================================================== --- head/share/doc/smm/01.setup/4.t Tue Oct 16 09:57:34 2012 (r241605) +++ head/share/doc/smm/01.setup/4.t Tue Oct 16 09:59:10 2012 (r241606) @@ -89,7 +89,6 @@ miscfs miscellaneous filesystems broken kernfs filesystem access to kernel data structures lofs loopback filesystem nullfs another loopback filesystem - portal associate processes with filesystem locations specfs device special files umapfs provide alternate uid/gid mappings dev generic device drivers (SCSI, vnode, concatenated disk) Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Tue Oct 16 09:57:34 2012 (r241605) +++ head/share/examples/Makefile Tue Oct 16 09:59:10 2012 (r241606) @@ -26,7 +26,6 @@ LDIRS= BSD_daemon \ netgraph \ nwclient \ perfmon \ - portal \ ppi \ ppp \ printing \ @@ -135,8 +134,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ perfmon/Makefile \ perfmon/README \ perfmon/perfmon.c \ - portal/README \ - portal/portal.conf \ ppi/Makefile \ ppi/ppilcd.c \ ppp/chap-auth \ Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Tue Oct 16 09:57:34 2012 (r241605) +++ head/share/man/man7/hier.7 Tue Oct 16 09:59:10 2012 (r241606) @@ -258,8 +258,6 @@ NTFS file system loopback file system .It Pa nwfs/ NetWare file system -.It Pa portalfs/ -portal file system .It Pa procfs/ process file system .It Pa smbfs/ Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Oct 16 09:57:34 2012 (r241605) +++ head/sys/boot/forth/loader.conf Tue Oct 16 09:59:10 2012 (r241606) @@ -172,7 +172,6 @@ nfsserver_load="NO" # NFS server ntfs_load="NO" # NTFS ntfs_iconv_load="NO" # NTFS iconv character support nullfs_load="NO" # Null filesystem -portalfs_load="NO" # Portal filesystem procfs_load="NO" # Process filesystem reiserfs_load="NO" # ReiserFS unionfs_load="NO" # Union filesystem Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 16 09:57:34 2012 (r241605) +++ head/sys/conf/NOTES Tue Oct 16 09:59:10 2012 (r241606) @@ -988,10 +988,7 @@ options ZERO_COPY_SOCKETS # time. Some people still prefer to statically compile other # filesystems as well. # -# NB: The PORTAL filesystem is known to be buggy, and WILL panic your -# system if you attempt to do anything with it. It is included here -# as an incentive for some enterprising soul to sit down and fix it. -# The UNION filesystem was known to be buggy in the past. It is now +# NB: The UNION filesystem was known to be buggy in the past. It is now # being actively maintained, although there are still some issues being # resolved. # @@ -1019,7 +1016,6 @@ options NTFS options NULLFS #NULL filesystem # Broken (depends on NCP): #options NWFS #NetWare filesystem -options PORTALFS #Portal filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework options PSEUDOFS_TRACE #Debugging support for PSEUDOFS Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 16 09:57:34 2012 (r241605) +++ head/sys/conf/files Tue Oct 16 09:59:10 2012 (r241606) @@ -2387,8 +2387,6 @@ fs/nwfs/nwfs_node.c optional nwfs fs/nwfs/nwfs_subr.c optional nwfs fs/nwfs/nwfs_vfsops.c optional nwfs fs/nwfs/nwfs_vnops.c optional nwfs -fs/portalfs/portal_vfsops.c optional portalfs -fs/portalfs/portal_vnops.c optional portalfs fs/procfs/procfs.c optional procfs fs/procfs/procfs_ctl.c optional procfs fs/procfs/procfs_dbregs.c optional procfs Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 16 09:57:34 2012 (r241605) +++ head/sys/conf/options Tue Oct 16 09:59:10 2012 (r241606) @@ -217,7 +217,6 @@ NANDFS opt_dontuse.h NTFS opt_dontuse.h NULLFS opt_dontuse.h NWFS opt_dontuse.h -PORTALFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h REISERFS opt_dontuse.h Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Tue Oct 16 09:57:34 2012 (r241605) +++ head/sys/kern/Make.tags.inc Tue Oct 16 09:59:10 2012 (r241606) @@ -31,7 +31,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/fs/ntfs/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ ${SYS}/fs/nwfs/*.[ch] \ - ${SYS}/fs/portalfs/*.[ch] \ ${SYS}/fs/procfs/*.[ch] \ ${SYS}/fs/smbfs/*.[ch] \ ${SYS}/fs/udf/*.[ch] \ @@ -92,7 +91,6 @@ COMMDIR2= ${SYS}/dev/advansys \ ${SYS}/fs/fifofs \ ${SYS}/fs/msdosfs \ ${SYS}/fs/nullfs \ - ${SYS}/fs/portalfs \ ${SYS}/fs/procfs \ ${SYS}/fs/specfs \ ${SYS}/fs/unionfs \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Oct 16 09:57:34 2012 (r241605) +++ head/sys/modules/Makefile Tue Oct 16 09:59:10 2012 (r241606) @@ -263,7 +263,6 @@ SUBDIR= \ ${_pfsync} \ plip \ ${_pmc} \ - portalfs \ ppbus \ ppc \ ppi \ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Oct 16 09:57:34 2012 (r241605) +++ head/usr.sbin/Makefile Tue Oct 16 09:59:10 2012 (r241606) @@ -46,7 +46,6 @@ SUBDIR= adduser \ mixer \ mlxcontrol \ mountd \ - mount_portalfs \ mptutil \ mtest \ mtree \ Modified: head/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- head/usr.sbin/crunch/examples/really-big.conf Tue Oct 16 09:57:34 2012 (r241605) +++ head/usr.sbin/crunch/examples/really-big.conf Tue Oct 16 09:59:10 2012 (r241606) @@ -25,7 +25,7 @@ srcdirs /usr/src/sbin progs badsect bim clri disklabel dmesg dump dumpfs fdisk fsck halt progs ifconfig init mknod modload modunload mount mount_isofs -progs mount_lofs mount_msdosfs mount_portalfs mountd +progs mount_lofs mount_msdosfs mountd progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore progs shutdown swapon ttyflags tunefs umount # shell scripts: fastboot From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 10:04:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E8C4210; Tue, 16 Oct 2012 10:04:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D61E8FC0A; Tue, 16 Oct 2012 10:04:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GA41cs012220; Tue, 16 Oct 2012 10:04:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GA40Uw012211; Tue, 16 Oct 2012 10:04:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210161004.q9GA40Uw012211@svn.freebsd.org> From: Attilio Rao Date: Tue, 16 Oct 2012 10:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241607 - in head: . share/man/man5 sys/boot/forth sys/conf sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 10:04:01 -0000 Author: attilio Date: Tue Oct 16 10:04:00 2012 New Revision: 241607 URL: http://svn.freebsd.org/changeset/base/241607 Log: Disconnect non-MPSAFE XFS from the build in preparation for dropping GIANT from VFS. This is not targeted for MFC. Modified: head/MAINTAINERS head/share/man/man5/Makefile head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/conf/options head/sys/modules/Makefile Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Oct 16 09:59:10 2012 (r241606) +++ head/MAINTAINERS Tue Oct 16 10:04:00 2012 (r241607) @@ -100,8 +100,6 @@ nfs alfred Will be happy to review code rpc.lockd alfred Will be happy to review code, but not mandatory. truss alfred Will be happy to review code, but not mandatory. rpc alfred Pre-commit review requested. -xfs kan@FreeBSD.org,rodrigc@FreeBSD.org,cattelan@xfs.org - Pre-commit review preferred. pkg_install portmgr Pre-commit review or approval from portmgr@ requested. linux emul emulation Please discuss changes here. bs{diff,patch} cperciva Pre-commit review requested. Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Tue Oct 16 09:59:10 2012 (r241606) +++ head/share/man/man5/Makefile Tue Oct 16 10:04:00 2012 (r241607) @@ -68,8 +68,7 @@ MAN= acct.5 \ stab.5 \ style.Makefile.5 \ sysctl.conf.5 \ - tmpfs.5 \ - xfs.5 + tmpfs.5 MLINKS= dir.5 dirent.5 MLINKS+=fs.5 inode.5 Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Oct 16 09:59:10 2012 (r241606) +++ head/sys/boot/forth/loader.conf Tue Oct 16 10:04:00 2012 (r241607) @@ -175,7 +175,6 @@ nullfs_load="NO" # Null filesystem procfs_load="NO" # Process filesystem reiserfs_load="NO" # ReiserFS unionfs_load="NO" # Union filesystem -xfs_load="NO" # XFS zfs_load="NO" # ZFS # Related stuff Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 16 09:59:10 2012 (r241606) +++ head/sys/conf/NOTES Tue Oct 16 10:04:00 2012 (r241607) @@ -1106,12 +1106,6 @@ options EXT2FS # options REISERFS -# -# Add support for the SGI XFS filesystem. Currently, -# this is limited to read-only access. -# -options XFS - # Use real implementations of the aio_* system calls. There are numerous # stability and security issues in the current aio code that make it # unsuitable for inclusion on machines with untrusted local users. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 16 09:59:10 2012 (r241606) +++ head/sys/conf/files Tue Oct 16 10:04:00 2012 (r241607) @@ -3632,142 +3632,6 @@ xdr/xdr_mbuf.c optional krpc | nfslock xdr/xdr_mem.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd xdr/xdr_reference.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd xdr/xdr_sizeof.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd -# -gnu/fs/xfs/xfs_alloc.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ - warning "kernel contains GPL contaminated xfs filesystem" -gnu/fs/xfs/xfs_alloc_btree.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_bit.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_bmap.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_bmap_btree.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_btree.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_buf_item.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_da_btree.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2_block.c optional xfs \ - compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2_data.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2_leaf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2_node.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2_sf.c optional xfs \ - compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir2_trace.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dir_leaf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_error.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_extfree_item.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_fsops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_ialloc.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_ialloc_btree.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_inode.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_inode_item.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_iocore.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_itable.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dfrag.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_log.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_log_recover.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_mount.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_rename.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_trans.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_trans_ail.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_trans_buf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_trans_extfree.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_trans_inode.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_trans_item.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_utils.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_vfsops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_vnodeops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_rw.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_attr_leaf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_attr.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_dmops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_qmops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_iget.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_mountops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_vnops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_frw.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_buf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_globals.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_dmistubs.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_super.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_stats.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_vfs.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_vnode.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_sysctl.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_fs_subr.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/xfs_ioctl.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/support/debug.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/support/ktrace.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/support/mrlock.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/support/uuid.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/FreeBSD/support/kmem.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_iomap.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" -gnu/fs/xfs/xfs_behavior.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" xen/gnttab.c optional xen | xenhvm xen/features.c optional xen | xenhvm Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Oct 16 09:59:10 2012 (r241606) +++ head/sys/conf/kern.pre.mk Tue Oct 16 10:04:00 2012 (r241607) @@ -73,9 +73,6 @@ INCLUDES+= -I$S/contrib/ngatm # ... and the same for twa INCLUDES+= -I$S/dev/twa -# ... and the same for XFS -INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs - # ... and the same for cxgb and cxgbe INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 16 09:59:10 2012 (r241606) +++ head/sys/conf/options Tue Oct 16 10:04:00 2012 (r241607) @@ -838,9 +838,6 @@ HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h # XBOX options for FreeBSD/i386, but some files are MI XBOX opt_xbox.h -# XFS -XFS - ZFS opt_dontuse.h # Interrupt filtering Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Oct 16 09:59:10 2012 (r241606) +++ head/sys/modules/Makefile Tue Oct 16 10:04:00 2012 (r241607) @@ -360,7 +360,6 @@ SUBDIR= \ ${_wpifw} \ ${_x86bios} \ ${_xe} \ - xfs \ xl \ ${_zfs} \ zlib \ From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 10:09:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8DC6575; Tue, 16 Oct 2012 10:09:21 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA838FC08; Tue, 16 Oct 2012 10:09:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GA9LFo013391; Tue, 16 Oct 2012 10:09:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GA9L9c013384; Tue, 16 Oct 2012 10:09:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210161009.q9GA9L9c013384@svn.freebsd.org> From: Attilio Rao Date: Tue, 16 Oct 2012 10:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241608 - in head: share/man/man4 sys/boot/forth sys/conf sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 10:09:22 -0000 Author: attilio Date: Tue Oct 16 10:09:21 2012 New Revision: 241608 URL: http://svn.freebsd.org/changeset/base/241608 Log: Disconnect non-MPSAFE CODAFS from the build in preparation for dropping GIANT from VFS. This is not targeted for MFC. Modified: head/share/man/man4/Makefile head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Oct 16 10:04:00 2012 (r241607) +++ head/share/man/man4/Makefile Tue Oct 16 10:09:21 2012 (r241608) @@ -93,7 +93,6 @@ MAN= aac.4 \ ciss.4 \ cm.4 \ cmx.4 \ - coda.4 \ ${_coretemp.4} \ ${_cpuctl.4} \ cpufreq.4 \ Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Oct 16 10:04:00 2012 (r241607) +++ head/sys/boot/forth/loader.conf Tue Oct 16 10:09:21 2012 (r241608) @@ -162,7 +162,6 @@ atavia_load="NO" # VIA Technologies Inc # Filesystems cd9660_load="NO" # ISO 9660 filesystem -coda_load="NO" # CODA filesystem fdescfs_load="NO" # Filedescriptors filesystem linprocfs_load="NO" # Linux compatibility process filesystem linsysfs_load="NO" # Linux compatibility system filesystem Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 16 10:04:00 2012 (r241607) +++ head/sys/conf/NOTES Tue Oct 16 10:09:21 2012 (r241608) @@ -1085,13 +1085,6 @@ options NFS_GATHERDELAY=10 # Default wr options NFS_WDELAYHASHSIZ=16 # and with this options NFS_DEBUG # Enable NFS Debugging -# Coda stuff: -options CODA #CODA filesystem. -device vcoda #coda minicache <-> venus comm. -# Use the old Coda 5.x venus<->kernel interface instead of the new -# realms-aware 6.x protocol. -#options CODA_COMPAT_5 - # # Add support for the EXT2FS filesystem of Linux fame. Be a bit # careful with this - the ext2fs code has a tendency to lag behind Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 16 10:04:00 2012 (r241607) +++ head/sys/conf/files Tue Oct 16 10:09:21 2012 (r241608) @@ -2304,12 +2304,6 @@ dev/xe/if_xe.c optional xe dev/xe/if_xe_pccard.c optional xe pccard dev/xl/if_xl.c optional xl pci dev/xl/xlphy.c optional xl pci -fs/coda/coda_fbsd.c optional vcoda -fs/coda/coda_psdev.c optional vcoda -fs/coda/coda_subr.c optional vcoda -fs/coda/coda_venus.c optional vcoda -fs/coda/coda_vfsops.c optional vcoda -fs/coda/coda_vnops.c optional vcoda fs/deadfs/dead_vnops.c standard fs/devfs/devfs_devs.c standard fs/devfs/devfs_dir.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 16 10:04:00 2012 (r241607) +++ head/sys/conf/options Tue Oct 16 10:09:21 2012 (r241608) @@ -68,7 +68,6 @@ ALQ AUDIT opt_global.h CAPABILITIES opt_capsicum.h CAPABILITY_MODE opt_capsicum.h -CODA_COMPAT_5 opt_coda.h COMPAT_43 opt_compat.h COMPAT_43TTY opt_compat.h COMPAT_FREEBSD4 opt_compat.h @@ -207,7 +206,6 @@ INCLUDE_CONFIG_FILE opt_config.h # dependencies. Unusability is enforced by hiding the defines for the # options in a never-included header. CD9660 opt_dontuse.h -CODA opt_dontuse.h EXT2FS opt_dontuse.h FDESCFS opt_dontuse.h FFS opt_dontuse.h Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Oct 16 10:04:00 2012 (r241607) +++ head/sys/modules/Makefile Tue Oct 16 10:09:21 2012 (r241608) @@ -67,8 +67,6 @@ SUBDIR= \ ${_ciss} \ ${_cm} \ ${_cmx} \ - coda \ - coda5 \ ${_coff} \ ${_coretemp} \ ${_cp} \ From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 12:49:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9055119; Tue, 16 Oct 2012 12:49:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B4D338FC0C; Tue, 16 Oct 2012 12:49:18 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 18C2FB94F; Tue, 16 Oct 2012 08:49:18 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r241603 - head/sys/dev/aha Date: Tue, 16 Oct 2012 08:32:00 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210160840.q9G8e9K7094068@svn.freebsd.org> In-Reply-To: <201210160840.q9G8e9K7094068@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210160832.00204.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 16 Oct 2012 08:49:18 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 12:49:19 -0000 On Tuesday, October 16, 2012 4:40:09 am Gleb Smirnoff wrote: > Author: glebius > Date: Tue Oct 16 08:40:09 2012 > New Revision: 241603 > URL: http://svn.freebsd.org/changeset/base/241603 > > Log: > Fix build of aha(4). > > Submitted by: delphij > > Modified: > head/sys/dev/aha/aha.c > head/sys/dev/aha/aha_isa.c > head/sys/dev/aha/ahareg.h My apologies for this and dpt(4). :( I have done various 'make tinderbox' runs on the branch these changes lived in (and I had built the dpt module before commit, but perhaps only clang reported the warning?), but apparently they must have been before I had done these changes. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 13:37:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75B2F733; Tue, 16 Oct 2012 13:37:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BA7F8FC0C; Tue, 16 Oct 2012 13:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GDbtE0049938; Tue, 16 Oct 2012 13:37:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GDbtr8049924; Tue, 16 Oct 2012 13:37:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210161337.q9GDbtr8049924@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 16 Oct 2012 13:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241610 - in head: . sys/dev/usb sys/net sys/net80211 sys/netpfil/ipfw sys/netpfil/pf sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 13:37:55 -0000 Author: glebius Date: Tue Oct 16 13:37:54 2012 New Revision: 241610 URL: http://svn.freebsd.org/changeset/base/241610 Log: Make the "struct if_clone" opaque to users of the cloning API. Users now use function calls: if_clone_simple() if_clone_advanced() to initialize a cloner, instead of macros that initialize if_clone structure. Discussed with: brooks, bz, 1 year ago Modified: head/UPDATING head/sys/dev/usb/usb_pf.c head/sys/net/if_bridge.c head/sys/net/if_clone.c head/sys/net/if_clone.h head/sys/net/if_disc.c head/sys/net/if_edsc.c head/sys/net/if_enc.c head/sys/net/if_epair.c head/sys/net/if_faith.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_lagg.c head/sys/net/if_loop.c head/sys/net/if_stf.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/net/if_vlan.c head/sys/net80211/ieee80211_freebsd.c head/sys/netpfil/ipfw/ip_fw_log.c head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/if_pfsync.c head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Oct 16 13:27:20 2012 (r241609) +++ head/UPDATING Tue Oct 16 13:37:54 2012 (r241610) @@ -24,6 +24,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20121016: + The interface cloning API and ABI has changed. The following + modules need to be recompiled together with kernel: + ipfw(4), pfsync(4), pflog(4), usb(4), wlan(4), stf(4), + vlan(4), disc(4), edsc(4), if_bridge(4), gif(4), tap(4), + faith(4), epair(4), enc(4), tun(4), if_lagg(4), gre(4). + 20121015: The sdhci driver was split in two parts: sdhci (generic SD Host Controller logic) and sdhci_pci (actual hardware driver). Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/dev/usb/usb_pf.c Tue Oct 16 13:37:54 2012 (r241610) @@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define USBUSNAME "usbus" - static void usbpf_init(void); static void usbpf_uninit(void); static int usbpf_ioctl(struct ifnet *, u_long, caddr_t); @@ -74,9 +72,8 @@ static uint32_t usbpf_aggregate_status(s static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t); static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int); -static struct if_clone usbpf_cloner = IFC_CLONE_INITIALIZER( - USBUSNAME, NULL, IF_MAXUNIT, - NULL, usbpf_clone_match, usbpf_clone_create, usbpf_clone_destroy); +static struct if_clone *usbpf_cloner; +static const char usbusname[] = "usbus"; SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL); SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL); @@ -85,7 +82,8 @@ static void usbpf_init(void) { - if_clone_attach(&usbpf_cloner); + usbpf_cloner = if_clone_advanced(usbusname, 0, usbpf_clone_match, + usbpf_clone_create, usbpf_clone_destroy); } static void @@ -98,9 +96,9 @@ usbpf_uninit(void) int error; int i; - if_clone_detach(&usbpf_cloner); + if_clone_detach(usbpf_cloner); - dc = devclass_find(USBUSNAME); + dc = devclass_find(usbusname); if (dc == NULL) return; error = devclass_get_devices(dc, &devlp, &devlcnt); @@ -109,7 +107,7 @@ usbpf_uninit(void) for (i = 0; i < devlcnt; i++) { ubus = device_get_softc(devlp[i]); if (ubus != NULL && ubus->ifp != NULL) - usbpf_clone_destroy(&usbpf_cloner, ubus->ifp); + usbpf_clone_destroy(usbpf_cloner, ubus->ifp); } free(devlp, M_TEMP); } @@ -130,12 +128,12 @@ usbpf_ifname2ubus(const char *ifname) int unit; int error; - if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME) - 1) != 0) + if (strncmp(ifname, usbusname, sizeof(usbusname) - 1) != 0) return (NULL); error = ifc_name2unit(ifname, &unit); if (error || unit < 0) return (NULL); - dc = devclass_find(USBUSNAME); + dc = devclass_find(usbusname); if (dc == NULL) return (NULL); dev = devclass_get_device(dc, unit); @@ -195,7 +193,7 @@ usbpf_clone_create(struct if_clone *ifc, } strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname)); ifp->if_softc = ubus; - ifp->if_dname = ifc->ifc_name; + ifp->if_dname = usbusname; ifp->if_dunit = unit; ifp->if_ioctl = usbpf_ioctl; if_attach(ifp); @@ -242,7 +240,7 @@ usbpf_detach(struct usb_bus *ubus) { if (ubus->ifp != NULL) - usbpf_clone_destroy(&usbpf_cloner, ubus->ifp); + usbpf_clone_destroy(usbpf_cloner, ubus->ifp); if (bootverbose) device_printf(ubus->parent, "usbpf: Detached\n"); } Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_bridge.c Tue Oct 16 13:37:54 2012 (r241610) @@ -481,7 +481,8 @@ const int bridge_control_table_size = LIST_HEAD(, bridge_softc) bridge_list; -IFC_SIMPLE_DECLARE(bridge, 0); +static struct if_clone *bridge_cloner; +static const char bridge_name[] = "bridge"; static int bridge_modevent(module_t mod, int type, void *data) @@ -490,7 +491,8 @@ bridge_modevent(module_t mod, int type, switch (type) { case MOD_LOAD: mtx_init(&bridge_list_mtx, "if_bridge list", NULL, MTX_DEF); - if_clone_attach(&bridge_cloner); + bridge_cloner = if_clone_simple(bridge_name, + bridge_clone_create, bridge_clone_destroy, 0); bridge_rtnode_zone = uma_zcreate("bridge_rtnode", sizeof(struct bridge_rtnode), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -506,7 +508,7 @@ bridge_modevent(module_t mod, int type, case MOD_UNLOAD: EVENTHANDLER_DEREGISTER(ifnet_departure_event, bridge_detach_cookie); - if_clone_detach(&bridge_cloner); + if_clone_detach(bridge_cloner); uma_zdestroy(bridge_rtnode_zone); bridge_input_p = NULL; bridge_output_p = NULL; @@ -595,7 +597,7 @@ bridge_clone_create(struct if_clone *ifc LIST_INIT(&sc->sc_spanlist); ifp->if_softc = sc; - if_initname(ifp, ifc->ifc_name, unit); + if_initname(ifp, bridge_name, unit); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = bridge_ioctl; ifp->if_transmit = bridge_transmit; Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_clone.c Tue Oct 16 13:37:54 2012 (r241610) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2012 Gleb Smirnoff * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. * @@ -42,19 +43,65 @@ #include #include -#if 0 -#include -#endif -#include #include #include #include #include +/* Current IF_MAXUNIT expands maximum to 5 characters. */ +#define IFCLOSIZ (IFNAMSIZ - 5) + +/* + * Structure describing a `cloning' interface. + * + * List of locks + * (c) const until freeing + * (d) driver specific data, may need external protection. + * (e) locked by if_cloners_mtx + * (i) locked by ifc_mtx mtx + */ +struct if_clone { + char ifc_name[IFCLOSIZ]; /* (c) Name of device, e.g. `gif' */ + struct unrhdr *ifc_unrhdr; /* (c) alloc_unr(9) header */ + int ifc_maxunit; /* (c) maximum unit number */ + long ifc_refcnt; /* (i) Reference count. */ + LIST_HEAD(, ifnet) ifc_iflist; /* (i) List of cloned interfaces */ + struct mtx ifc_mtx; /* Mutex to protect members. */ + + enum { SIMPLE, ADVANCED } ifc_type; /* (c) */ + + /* (c) Driver specific cloning functions. Called with no locks held. */ + union { + struct { /* advanced cloner */ + ifc_match_t *_ifc_match; + ifc_create_t *_ifc_create; + ifc_destroy_t *_ifc_destroy; + } A; + struct { /* simple cloner */ + ifcs_create_t *_ifcs_create; + ifcs_destroy_t *_ifcs_destroy; + int _ifcs_minifs; /* minimum ifs */ + + } S; + } U; +#define ifc_match U.A._ifc_match +#define ifc_create U.A._ifc_create +#define ifc_destroy U.A._ifc_destroy +#define ifcs_create U.S._ifcs_create +#define ifcs_destroy U.S._ifcs_destroy +#define ifcs_minifs U.S._ifcs_minifs + + LIST_ENTRY(if_clone) ifc_list; /* (e) On list of cloners */ +}; + static void if_clone_free(struct if_clone *ifc); static int if_clone_createif(struct if_clone *ifc, char *name, size_t len, caddr_t params); +static int ifc_simple_match(struct if_clone *, const char *); +static int ifc_simple_create(struct if_clone *, char *, size_t, caddr_t); +static int ifc_simple_destroy(struct if_clone *, struct ifnet *); + static struct mtx if_cloners_mtx; static VNET_DEFINE(int, if_cloners_count); VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); @@ -138,18 +185,25 @@ if_clone_create(char *name, size_t len, /* Try to find an applicable cloner for this request */ IF_CLONERS_LOCK(); - LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { - if (ifc->ifc_match(ifc, name)) { - break; + LIST_FOREACH(ifc, &V_if_cloners, ifc_list) + if (ifc->ifc_type == SIMPLE) { + if (ifc_simple_match(ifc, name)) + break; + } else { + if (ifc->ifc_match(ifc, name)) + break; } - } #ifdef VIMAGE if (ifc == NULL && !IS_DEFAULT_VNET(curvnet)) { CURVNET_SET_QUIET(vnet0); - LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { - if (ifc->ifc_match(ifc, name)) - break; - } + LIST_FOREACH(ifc, &V_if_cloners, ifc_list) + if (ifc->ifc_type == SIMPLE) { + if (ifc_simple_match(ifc, name)) + break; + } else { + if (ifc->ifc_match(ifc, name)) + break; + } CURVNET_RESTORE(); } #endif @@ -173,7 +227,10 @@ if_clone_createif(struct if_clone *ifc, if (ifunit(name) != NULL) return (EEXIST); - err = (*ifc->ifc_create)(ifc, name, len, params); + if (ifc->ifc_type == SIMPLE) + err = ifc_simple_create(ifc, name, len, params); + else + err = (*ifc->ifc_create)(ifc, name, len, params); if (!err) { ifp = ifunit(name); @@ -214,10 +271,14 @@ if_clone_destroy(const char *name) #ifdef VIMAGE if (ifc == NULL && !IS_DEFAULT_VNET(curvnet)) { CURVNET_SET_QUIET(vnet0); - LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { - if (ifc->ifc_match(ifc, name)) - break; - } + LIST_FOREACH(ifc, &V_if_cloners, ifc_list) + if (ifc->type == SIMPLE) { + if (ifc_simple_match(ifc, name)) + break; + } else { + if (ifc->ifc_match(ifc, name)) + break; + } CURVNET_RESTORE(); } #endif @@ -241,7 +302,7 @@ if_clone_destroyif(struct if_clone *ifc, int err; struct ifnet *ifcifp; - if (ifc->ifc_destroy == NULL) + if (ifc->ifc_type == ADVANCED && ifc->ifc_destroy == NULL) return(EOPNOTSUPP); /* @@ -266,7 +327,10 @@ if_clone_destroyif(struct if_clone *ifc, if_delgroup(ifp, ifc->ifc_name); - err = (*ifc->ifc_destroy)(ifc, ifp); + if (ifc->ifc_type == SIMPLE) + err = ifc_simple_destroy(ifc, ifp); + else + err = (*ifc->ifc_destroy)(ifc, ifp); if (err != 0) { if_addgroup(ifp, ifc->ifc_name); @@ -279,21 +343,29 @@ if_clone_destroyif(struct if_clone *ifc, return (err); } -/* - * Register a network interface cloner. - */ -int -if_clone_attach(struct if_clone *ifc) +static struct if_clone * +if_clone_alloc(const char *name, int maxunit) { - struct if_clone *ifc1; + struct if_clone *ifc; - KASSERT(ifc->ifc_name != NULL, ("%s: no name\n", __func__)); + KASSERT(name != NULL, ("%s: no name\n", __func__)); + ifc = malloc(sizeof(struct if_clone), M_CLONE, M_WAITOK | M_ZERO); + strncpy(ifc->ifc_name, name, IFCLOSIZ-1); IF_CLONE_LOCK_INIT(ifc); IF_CLONE_ADDREF(ifc); + ifc->ifc_maxunit = maxunit ? maxunit : IF_MAXUNIT; ifc->ifc_unrhdr = new_unrhdr(0, ifc->ifc_maxunit, &ifc->ifc_mtx); LIST_INIT(&ifc->ifc_iflist); + return (ifc); +} + +static int +if_clone_attach(struct if_clone *ifc) +{ + struct if_clone *ifc1; + IF_CLONERS_LOCK(); LIST_FOREACH(ifc1, &V_if_cloners, ifc_list) if (strcmp(ifc->ifc_name, ifc1->ifc_name) == 0) { @@ -305,11 +377,63 @@ if_clone_attach(struct if_clone *ifc) V_if_cloners_count++; IF_CLONERS_UNLOCK(); - if (ifc->ifc_attach != NULL) - (*ifc->ifc_attach)(ifc); + return (0); +} + +struct if_clone * +if_clone_advanced(const char *name, u_int maxunit, ifc_match_t match, + ifc_create_t create, ifc_destroy_t destroy) +{ + struct if_clone *ifc; + + ifc = if_clone_alloc(name, maxunit); + ifc->ifc_type = ADVANCED; + ifc->ifc_match = match; + ifc->ifc_create = create; + ifc->ifc_destroy = destroy; + + if (if_clone_attach(ifc) != 0) { + if_clone_free(ifc); + return (NULL); + } + EVENTHANDLER_INVOKE(if_clone_event, ifc); - return (0); + return (ifc); +} + +struct if_clone * +if_clone_simple(const char *name, ifcs_create_t create, ifcs_destroy_t destroy, + u_int minifs) +{ + struct if_clone *ifc; + u_int unit; + + ifc = if_clone_alloc(name, 0); + ifc->ifc_type = SIMPLE; + ifc->ifcs_create = create; + ifc->ifcs_destroy = destroy; + ifc->ifcs_minifs = minifs; + + if (if_clone_attach(ifc) != 0) { + if_clone_free(ifc); + return (NULL); + } + + for (unit = 0; unit < minifs; unit++) { + char name[IFNAMSIZ]; + int error; + + snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, unit); + error = if_clone_createif(ifc, name, IFNAMSIZ, NULL); + KASSERT(error == 0, + ("%s: failed to create required interface %s", + __func__, name)); + } + + EVENTHANDLER_INVOKE(if_clone_event, ifc); + + return (ifc); } /* @@ -318,7 +442,6 @@ if_clone_attach(struct if_clone *ifc) void if_clone_detach(struct if_clone *ifc) { - struct ifc_simple_data *ifcs = ifc->ifc_data; IF_CLONERS_LOCK(); LIST_REMOVE(ifc, ifc_list); @@ -326,8 +449,8 @@ if_clone_detach(struct if_clone *ifc) IF_CLONERS_UNLOCK(); /* Allow all simples to be destroyed */ - if (ifc->ifc_attach == ifc_simple_attach) - ifcs->ifcs_minifs = 0; + if (ifc->ifc_type == SIMPLE) + ifc->ifcs_minifs = 0; /* destroy all interfaces for this cloner */ while (!LIST_EMPTY(&ifc->ifc_iflist)) @@ -345,6 +468,7 @@ if_clone_free(struct if_clone *ifc) IF_CLONE_LOCK_DESTROY(ifc); delete_unrhdr(ifc->ifc_unrhdr); + free(ifc, M_CLONE); } /* @@ -483,29 +607,7 @@ ifc_free_unit(struct if_clone *ifc, int IF_CLONE_REMREF(ifc); } -void -ifc_simple_attach(struct if_clone *ifc) -{ - int err; - int unit; - char name[IFNAMSIZ]; - struct ifc_simple_data *ifcs = ifc->ifc_data; - - KASSERT(ifcs->ifcs_minifs - 1 <= ifc->ifc_maxunit, - ("%s: %s requested more units than allowed (%d > %d)", - __func__, ifc->ifc_name, ifcs->ifcs_minifs, - ifc->ifc_maxunit + 1)); - - for (unit = 0; unit < ifcs->ifcs_minifs; unit++) { - snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, unit); - err = if_clone_createif(ifc, name, IFNAMSIZ, NULL); - KASSERT(err == 0, - ("%s: failed to create required interface %s", - __func__, name)); - } -} - -int +static int ifc_simple_match(struct if_clone *ifc, const char *name) { const char *cp; @@ -526,14 +628,13 @@ ifc_simple_match(struct if_clone *ifc, c return (1); } -int +static int ifc_simple_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { char *dp; int wildcard; int unit; int err; - struct ifc_simple_data *ifcs = ifc->ifc_data; err = ifc_name2unit(name, &unit); if (err != 0) @@ -545,7 +646,7 @@ ifc_simple_create(struct if_clone *ifc, if (err != 0) return (err); - err = ifcs->ifcs_create(ifc, unit, params); + err = ifc->ifcs_create(ifc, unit, params); if (err != 0) { ifc_free_unit(ifc, unit); return (err); @@ -569,18 +670,17 @@ ifc_simple_create(struct if_clone *ifc, return (0); } -int +static int ifc_simple_destroy(struct if_clone *ifc, struct ifnet *ifp) { int unit; - struct ifc_simple_data *ifcs = ifc->ifc_data; unit = ifp->if_dunit; - if (unit < ifcs->ifcs_minifs) + if (unit < ifc->ifcs_minifs) return (EINVAL); - ifcs->ifcs_destroy(ifp); + ifc->ifcs_destroy(ifp); ifc_free_unit(ifc, unit); Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_clone.h Tue Oct 16 13:37:54 2012 (r241610) @@ -35,87 +35,42 @@ #ifdef _KERNEL -#define IFC_CLONE_INITIALIZER(name, data, maxunit, \ - attach, match, create, destroy) \ - { \ - .ifc_name = name, \ - .ifc_maxunit = maxunit, \ - .ifc_data = data, \ - .ifc_attach = attach, \ - .ifc_match = match, \ - .ifc_create = create, \ - .ifc_destroy = destroy, \ - } - -/* - * Structure describing a `cloning' interface. - * - * List of locks - * (c) const until freeing - * (d) driver specific data, may need external protection. - * (e) locked by if_cloners_mtx - * (i) locked by ifc_mtx mtx - */ -struct if_clone { - LIST_ENTRY(if_clone) ifc_list; /* (e) On list of cloners */ - const char *ifc_name; /* (c) Name of device, e.g. `gif' */ - int ifc_maxunit; /* (c) Maximum unit number */ - struct unrhdr *ifc_unrhdr; /* (c) alloc_unr(9) header */ - void *ifc_data; /* (*) Data for ifc_* functions. */ - - /* (c) Driver specific cloning functions. Called with no locks held. */ - void (*ifc_attach)(struct if_clone *); - int (*ifc_match)(struct if_clone *, const char *); - int (*ifc_create)(struct if_clone *, char *, size_t, caddr_t); - int (*ifc_destroy)(struct if_clone *, struct ifnet *); - - long ifc_refcnt; /* (i) Refrence count. */ - struct mtx ifc_mtx; /* Mutex to protect members. */ - LIST_HEAD(, ifnet) ifc_iflist; /* (i) List of cloned interfaces */ -}; +struct if_clone; -void if_clone_init(void); -int if_clone_attach(struct if_clone *); +/* Methods. */ +typedef int ifc_match_t(struct if_clone *, const char *); +typedef int ifc_create_t(struct if_clone *, char *, size_t, caddr_t); +typedef int ifc_destroy_t(struct if_clone *, struct ifnet *); + +typedef int ifcs_create_t(struct if_clone *, int, caddr_t); +typedef void ifcs_destroy_t(struct ifnet *); + +/* Interface cloner (de)allocating functions. */ +struct if_clone * + if_clone_advanced(const char *, u_int, ifc_match_t, ifc_create_t, + ifc_destroy_t); +struct if_clone * + if_clone_simple(const char *, ifcs_create_t, ifcs_destroy_t, u_int); void if_clone_detach(struct if_clone *); -void vnet_if_clone_init(void); - -int if_clone_create(char *, size_t, caddr_t); -int if_clone_destroy(const char *); -int if_clone_destroyif(struct if_clone *, struct ifnet *); -int if_clone_list(struct if_clonereq *); +/* Unit (de)allocating fucntions. */ int ifc_name2unit(const char *name, int *unit); int ifc_alloc_unit(struct if_clone *, int *); void ifc_free_unit(struct if_clone *, int); -/* - * The ifc_simple functions, structures, and macros implement basic - * cloning as in 5.[012]. - */ - -struct ifc_simple_data { - int ifcs_minifs; /* minimum number of interfaces */ - - int (*ifcs_create)(struct if_clone *, int, caddr_t); - void (*ifcs_destroy)(struct ifnet *); -}; - -/* interface clone event */ +/* Interface clone event. */ typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); -#define IFC_SIMPLE_DECLARE(name, minifs) \ -struct ifc_simple_data name##_cloner_data = \ - {minifs, name##_clone_create, name##_clone_destroy}; \ -struct if_clone name##_cloner = \ - IFC_CLONE_INITIALIZER(#name, &name##_cloner_data, IF_MAXUNIT, \ - ifc_simple_attach, ifc_simple_match, ifc_simple_create, ifc_simple_destroy) - -void ifc_simple_attach(struct if_clone *); -int ifc_simple_match(struct if_clone *, const char *); -int ifc_simple_create(struct if_clone *, char *, size_t, caddr_t); -int ifc_simple_destroy(struct if_clone *, struct ifnet *); +/* The below interfaces used only by net/if.c. */ +void if_clone_init(void); +void vnet_if_clone_init(void); +int if_clone_create(char *, size_t, caddr_t); +int if_clone_destroy(const char *); +int if_clone_list(struct if_clonereq *); -#endif /* _KERNEL */ +/* The below interface used only by epair(4). */ +int if_clone_destroyif(struct if_clone *, struct ifnet *); +#endif /* _KERNEL */ #endif /* !_NET_IF_CLONE_H_ */ Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_disc.c Tue Oct 16 13:37:54 2012 (r241610) @@ -59,8 +59,6 @@ #define DSMTU 65532 #endif -#define DISCNAME "disc" - struct disc_softc { struct ifnet *sc_ifp; }; @@ -72,9 +70,10 @@ static int discioctl(struct ifnet *, u_l static int disc_clone_create(struct if_clone *, int, caddr_t); static void disc_clone_destroy(struct ifnet *); -static MALLOC_DEFINE(M_DISC, DISCNAME, "Discard interface"); +static const char discname[] = "disc"; +static MALLOC_DEFINE(M_DISC, discname, "Discard interface"); -IFC_SIMPLE_DECLARE(disc, 0); +static struct if_clone *disc_cloner; static int disc_clone_create(struct if_clone *ifc, int unit, caddr_t params) @@ -90,7 +89,7 @@ disc_clone_create(struct if_clone *ifc, } ifp->if_softc = sc; - if_initname(ifp, ifc->ifc_name, unit); + if_initname(ifp, discname, unit); ifp->if_mtu = DSMTU; /* * IFF_LOOPBACK should not be removed from disc's flags because @@ -135,10 +134,11 @@ disc_modevent(module_t mod, int type, vo switch (type) { case MOD_LOAD: - if_clone_attach(&disc_cloner); + disc_cloner = if_clone_simple(discname, disc_clone_create, + disc_clone_destroy, 0); break; case MOD_UNLOAD: - if_clone_detach(&disc_cloner); + if_clone_detach(disc_cloner); break; default: return (EOPNOTSUPP); Modified: head/sys/net/if_edsc.c ============================================================================== --- head/sys/net/if_edsc.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_edsc.c Tue Oct 16 13:37:54 2012 (r241610) @@ -51,6 +51,8 @@ #include /* IFT_ETHER and friends */ #include /* kernel-only part of ifnet(9) */ +static const char edscname[] = "edsc"; + /* * Software configuration of an interface specific to this device type. */ @@ -64,9 +66,9 @@ struct edsc_softc { }; /* - * Simple cloning methods. - * IFC_SIMPLE_DECLARE() expects precisely these names. + * Attach to the interface cloning framework. */ +static struct if_clone *edsc_cloner; static int edsc_clone_create(struct if_clone *, int, caddr_t); static void edsc_clone_destroy(struct ifnet *); @@ -81,15 +83,7 @@ static void edsc_start(struct ifnet *ifp /* * We'll allocate softc instances from this. */ -static MALLOC_DEFINE(M_EDSC, "edsc", "Ethernet discard interface"); - -/* - * Attach to the interface cloning framework under the name of "edsc". - * The second argument is the number of units to be created from - * the outset. It's also the minimum number of units allowed. - * We don't want any units created as soon as the driver is loaded. - */ -IFC_SIMPLE_DECLARE(edsc, 0); +static MALLOC_DEFINE(M_EDSC, edscname, "Ethernet discard interface"); /* * Create an interface instance. @@ -116,7 +110,7 @@ edsc_clone_create(struct if_clone *ifc, /* * Get a name for this particular interface in its ifnet structure. */ - if_initname(ifp, ifc->ifc_name, unit); + if_initname(ifp, edscname, unit); /* * Typical Ethernet interface flags: we can do broadcast and @@ -323,8 +317,13 @@ edsc_modevent(module_t mod, int type, vo case MOD_LOAD: /* * Connect to the network interface cloning framework. + * The last argument is the number of units to be created + * from the outset. It's also the minimum number of units + * allowed. We don't want any units created as soon as the + * driver is loaded. */ - if_clone_attach(&edsc_cloner); + edsc_cloner = if_clone_simple(edscname, edsc_clone_create, + edsc_clone_destroy, 0); break; case MOD_UNLOAD: @@ -332,7 +331,7 @@ edsc_modevent(module_t mod, int type, vo * Disconnect from the cloning framework. * Existing interfaces will be disposed of properly. */ - if_clone_detach(&edsc_cloner); + if_clone_detach(edsc_cloner); break; default: Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_enc.c Tue Oct 16 13:37:54 2012 (r241610) @@ -91,8 +91,8 @@ static int enc_output(struct ifnet *ifp, struct sockaddr *dst, struct route *ro); static int enc_clone_create(struct if_clone *, int, caddr_t); static void enc_clone_destroy(struct ifnet *); - -IFC_SIMPLE_DECLARE(enc, 1); +static struct if_clone *enc_cloner; +static const char encname[] = "enc"; /* * Sysctls. @@ -143,7 +143,7 @@ enc_clone_create(struct if_clone *ifc, i return (ENOSPC); } - if_initname(ifp, ifc->ifc_name, unit); + if_initname(ifp, encname, unit); ifp->if_mtu = ENCMTU; ifp->if_ioctl = enc_ioctl; ifp->if_output = enc_output; @@ -167,7 +167,8 @@ enc_modevent(module_t mod, int type, voi switch (type) { case MOD_LOAD: mtx_init(&enc_mtx, "enc mtx", NULL, MTX_DEF); - if_clone_attach(&enc_cloner); + enc_cloner = if_clone_simple(encname, enc_clone_create, + enc_clone_destroy, 0); break; case MOD_UNLOAD: printf("enc module unload - not possible for this module\n"); Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_epair.c Tue Oct 16 13:37:54 2012 (r241610) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define EPAIRNAME "epair" - SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, epair, CTLFLAG_RW, 0, "epair sysctl"); @@ -100,9 +98,11 @@ static int epair_clone_match(struct if_c static int epair_clone_create(struct if_clone *, char *, size_t, caddr_t); static int epair_clone_destroy(struct if_clone *, struct ifnet *); +static const char epairname[] = "epair"; + /* Netisr realted definitions and sysctl. */ static struct netisr_handler epair_nh = { - .nh_name = EPAIRNAME, + .nh_name = epairname, .nh_proto = NETISR_EPAIR, .nh_policy = NETISR_POLICY_CPU, .nh_handler = epair_nh_sintr, @@ -168,12 +168,10 @@ STAILQ_HEAD(eid_list, epair_ifp_drain); #define EPAIR_REFCOUNT_ASSERT(a, p) #endif -static MALLOC_DEFINE(M_EPAIR, EPAIRNAME, +static MALLOC_DEFINE(M_EPAIR, epairname, "Pair of virtual cross-over connected Ethernet-like interfaces"); -static struct if_clone epair_cloner = IFC_CLONE_INITIALIZER( - EPAIRNAME, NULL, IF_MAXUNIT, - NULL, epair_clone_match, epair_clone_create, epair_clone_destroy); +static struct if_clone *epair_cloner; /* * DPCPU area and functions. @@ -692,10 +690,10 @@ epair_clone_match(struct if_clone *ifc, * - epair * but not the epair[ab] versions. */ - if (strncmp(EPAIRNAME, name, sizeof(EPAIRNAME)-1) != 0) + if (strncmp(epairname, name, sizeof(epairname)-1) != 0) return (0); - for (cp = name + sizeof(EPAIRNAME) - 1; *cp != '\0'; cp++) { + for (cp = name + sizeof(epairname) - 1; *cp != '\0'; cp++) { if (*cp < '0' || *cp > '9') return (0); } @@ -714,7 +712,7 @@ epair_clone_create(struct if_clone *ifc, /* * We are abusing params to create our second interface. - * Actually we already created it and called if_clone_createif() + * Actually we already created it and called if_clone_create() * for it to do the official insertion procedure the moment we knew * it cannot fail anymore. So just do attach it here. */ @@ -807,7 +805,7 @@ epair_clone_create(struct if_clone *ifc, ifp = sca->ifp; ifp->if_softc = sca; strlcpy(ifp->if_xname, name, IFNAMSIZ); - ifp->if_dname = ifc->ifc_name; + ifp->if_dname = epairname; ifp->if_dunit = unit; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_capabilities = IFCAP_VLAN_MTU; @@ -833,7 +831,7 @@ epair_clone_create(struct if_clone *ifc, ifp = scb->ifp; ifp->if_softc = scb; strlcpy(ifp->if_xname, name, IFNAMSIZ); - ifp->if_dname = ifc->ifc_name; + ifp->if_dname = epairname; ifp->if_dunit = unit; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_capabilities = IFCAP_VLAN_MTU; @@ -843,10 +841,10 @@ epair_clone_create(struct if_clone *ifc, ifp->if_init = epair_init; ifp->if_snd.ifq_maxlen = ifqmaxlen; /* We need to play some tricks here for the second interface. */ - strlcpy(name, EPAIRNAME, len); + strlcpy(name, epairname, len); error = if_clone_create(name, len, (caddr_t)scb); if (error) - panic("%s: if_clone_createif() for our 2nd iface failed: %d", + panic("%s: if_clone_create() for our 2nd iface failed: %d", __func__, error); scb->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; @@ -958,16 +956,17 @@ epair_modevent(module_t mod, int type, v if (TUNABLE_INT_FETCH("net.link.epair.netisr_maxqlen", &qlimit)) epair_nh.nh_qlimit = qlimit; netisr_register(&epair_nh); - if_clone_attach(&epair_cloner); + epair_cloner = if_clone_advanced(epairname, 0, + epair_clone_match, epair_clone_create, epair_clone_destroy); if (bootverbose) - printf("%s initialized.\n", EPAIRNAME); + printf("%s initialized.\n", epairname); break; case MOD_UNLOAD: - if_clone_detach(&epair_cloner); + if_clone_detach(epair_cloner); netisr_unregister(&epair_nh); epair_dpcpu_detach(); if (bootverbose) - printf("%s unloaded.\n", EPAIRNAME); + printf("%s unloaded.\n", epairname); break; default: return (EOPNOTSUPP); Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_faith.c Tue Oct 16 13:37:54 2012 (r241610) @@ -79,8 +79,6 @@ #include #endif -#define FAITHNAME "faith" - struct faith_softc { struct ifnet *sc_ifp; }; @@ -95,12 +93,12 @@ static int faithprefix(struct in6_addr * static int faithmodevent(module_t, int, void *); -static MALLOC_DEFINE(M_FAITH, FAITHNAME, "Firewall Assisted Tunnel Interface"); +static const char faithname[] = "faith"; +static MALLOC_DEFINE(M_FAITH, faithname, "Firewall Assisted Tunnel Interface"); static int faith_clone_create(struct if_clone *, int, caddr_t); static void faith_clone_destroy(struct ifnet *); - -IFC_SIMPLE_DECLARE(faith, 0); +static struct if_clone *faith_cloner; #define FAITHMTU 1500 @@ -113,8 +111,8 @@ faithmodevent(mod, type, data) switch (type) { case MOD_LOAD: - if_clone_attach(&faith_cloner); - + faith_cloner = if_clone_simple(faithname, faith_clone_create, + faith_clone_destroy, 0); #ifdef INET6 faithprefix_p = faithprefix; #endif @@ -125,7 +123,7 @@ faithmodevent(mod, type, data) faithprefix_p = NULL; #endif - if_clone_detach(&faith_cloner); + if_clone_detach(faith_cloner); break; default: return EOPNOTSUPP; @@ -159,7 +157,7 @@ faith_clone_create(ifc, unit, params) } ifp->if_softc = sc; - if_initname(sc->sc_ifp, ifc->ifc_name, unit); + if_initname(sc->sc_ifp, faithname, unit); ifp->if_mtu = FAITHMTU; /* Change to BROADCAST experimentaly to announce its prefix. */ Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Tue Oct 16 13:27:20 2012 (r241609) +++ head/sys/net/if_gif.c Tue Oct 16 13:37:54 2012 (r241610) @@ -88,7 +88,7 @@ #include -#define GIFNAME "gif" +static const char gifname[] = "gif"; /* * gif_mtx protects the global gif_softc_list. @@ -106,8 +106,7 @@ void (*ng_gif_detach_p)(struct ifnet *if static void gif_start(struct ifnet *); static int gif_clone_create(struct if_clone *, int, caddr_t); static void gif_clone_destroy(struct ifnet *); - -IFC_SIMPLE_DECLARE(gif, 0); +static struct if_clone *gif_cloner; static int gifmodevent(module_t, int, void *); @@ -171,7 +170,7 @@ gif_clone_create(ifc, unit, params) GIF_LOCK_INIT(sc); GIF2IFP(sc)->if_softc = sc; - if_initname(GIF2IFP(sc), ifc->ifc_name, unit); + if_initname(GIF2IFP(sc), gifname, unit); sc->encap_cookie4 = sc->encap_cookie6 = NULL; sc->gif_options = GIF_ACCEPT_REVETHIP; @@ -256,11 +255,12 @@ gifmodevent(mod, type, data) switch (type) { case MOD_LOAD: mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF); - if_clone_attach(&gif_cloner); + gif_cloner = if_clone_simple(gifname, gif_clone_create, + gif_clone_destroy, 0); break; case MOD_UNLOAD: - if_clone_detach(&gif_cloner); + if_clone_detach(gif_cloner); mtx_destroy(&gif_mtx); break; default: Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Tue Oct 16 13:27:20 2012 (r241609) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 15:25:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0376C05; Tue, 16 Oct 2012 15:25:04 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7DF78FC16; Tue, 16 Oct 2012 15:25:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GFP4WS066820; Tue, 16 Oct 2012 15:25:04 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GFP4um066818; Tue, 16 Oct 2012 15:25:04 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201210161525.q9GFP4um066818@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 16 Oct 2012 15:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241611 - head/sys/dev/aha X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 15:25:04 -0000 Author: pluknet Date: Tue Oct 16 15:25:04 2012 New Revision: 241611 URL: http://svn.freebsd.org/changeset/base/241611 Log: Fix aha(4) build with i386 LINT (which includes 'device mca'). Modified: head/sys/dev/aha/aha_mca.c Modified: head/sys/dev/aha/aha_mca.c ============================================================================== --- head/sys/dev/aha/aha_mca.c Tue Oct 16 13:37:54 2012 (r241610) +++ head/sys/dev/aha/aha_mca.c Tue Oct 16 15:25:04 2012 (r241611) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -191,7 +192,7 @@ aha_mca_attach (device_t dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY | - INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); + INTR_MPSAFE, NULL, aha_intr, sc, &sc->ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); aha_detach(sc); From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 15:43:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E41E62A2; Tue, 16 Oct 2012 15:43:16 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0E968FC16; Tue, 16 Oct 2012 15:43:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GFhGJQ069625; Tue, 16 Oct 2012 15:43:16 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GFhG5j069623; Tue, 16 Oct 2012 15:43:16 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201210161543.q9GFhG5j069623@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 16 Oct 2012 15:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241612 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 15:43:17 -0000 Author: obrien Date: Tue Oct 16 15:43:16 2012 New Revision: 241612 URL: http://svn.freebsd.org/changeset/base/241612 Log: Obey the value of "MK_BMAKE". Modified: head/usr.bin/bmake/Makefile.inc Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Tue Oct 16 15:25:04 2012 (r241611) +++ head/usr.bin/bmake/Makefile.inc Tue Oct 16 15:43:16 2012 (r241612) @@ -7,7 +7,7 @@ .export SRCTOP .endif -.if defined(MK_BMAKE) +.if ${MK_BMAKE} != "no" PROG= make .endif From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 17:49:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43A196C0; Tue, 16 Oct 2012 17:49:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8A38FC1A; Tue, 16 Oct 2012 17:49:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GHnFgo089619; Tue, 16 Oct 2012 17:49:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GHnEhB089617; Tue, 16 Oct 2012 17:49:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210161749.q9GHnEhB089617@svn.freebsd.org> From: Eitan Adler Date: Tue, 16 Oct 2012 17:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241613 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 17:49:15 -0000 Author: eadler Date: Tue Oct 16 17:49:14 2012 New Revision: 241613 URL: http://svn.freebsd.org/changeset/base/241613 Log: Add support for samsung HM250JI PR: usb/121474 Submitted by: Ben Stuyts Approved by: cperciva (implicit) MFC after: 3 days Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Oct 16 15:43:16 2012 (r241612) +++ head/sys/cam/scsi/scsi_da.c Tue Oct 16 17:49:14 2012 (r241613) @@ -844,6 +844,15 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "USB 2.0", "(HS) Flash Disk", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * LaCie external 250GB Hard drive des by Porsche + * Submitted by: Ben Stuyts + * PR: 121474 + */ + {T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HM250JI", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 20:18:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A624F51C; Tue, 16 Oct 2012 20:18:16 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 768068FC12; Tue, 16 Oct 2012 20:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GKIGDg013033; Tue, 16 Oct 2012 20:18:16 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GKIG9q013028; Tue, 16 Oct 2012 20:18:16 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201210162018.q9GKIG9q013028@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 16 Oct 2012 20:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241616 - in head/sys: dev/ixgbe net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 20:18:16 -0000 Author: emax Date: Tue Oct 16 20:18:15 2012 New Revision: 241616 URL: http://svn.freebsd.org/changeset/base/241616 Log: introduce concept of ifi_baudrate power factor. the idea is to work around the problem where high speed interfaces (such as ixgbe(4)) are not able to report real ifi_baudrate. bascially, take a spare byte from struct if_data and use it to store ifi_baudrate power factor. in other words, real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor this should be backwards compatible with old binaries. use ixgbe(4) as an example on how drivers would set ifi_baudrate power factor Discussed with: kib, scottl, glebius MFC after: 1 week Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/net/if.h head/sys/net/if_var.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Oct 16 19:59:13 2012 (r241615) +++ head/sys/dev/ixgbe/ixgbe.c Tue Oct 16 20:18:15 2012 (r241616) @@ -2597,7 +2597,8 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_baudrate = 1000000000; + ifp->if_baudrate = IF_Gbps(1); + ifp->if_baudrate_pf = 1; /* 1Gbps * 10^1 = 10Gbps */ ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Oct 16 19:59:13 2012 (r241615) +++ head/sys/net/if.h Tue Oct 16 20:18:15 2012 (r241616) @@ -86,7 +86,7 @@ struct if_data { u_char ifi_hdrlen; /* media header length */ u_char ifi_link_state; /* current link state */ u_char ifi_vhid; /* carp vhid */ - u_char ifi_spare_char2; /* spare byte */ + u_char ifi_baudrate_pf; /* baudrate power factor */ u_char ifi_datalen; /* length of this data struct */ u_long ifi_mtu; /* maximum transmission unit */ u_long ifi_metric; /* routing metric (external only) */ Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Oct 16 19:59:13 2012 (r241615) +++ head/sys/net/if_var.h Tue Oct 16 20:18:15 2012 (r241616) @@ -228,6 +228,7 @@ typedef void if_init_f_t(void *); #define if_metric if_data.ifi_metric #define if_link_state if_data.ifi_link_state #define if_baudrate if_data.ifi_baudrate +#define if_baudrate_pf if_data.ifi_baudrate_pf #define if_hwassist if_data.ifi_hwassist #define if_ipackets if_data.ifi_ipackets #define if_ierrors if_data.ifi_ierrors From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 21:02:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13708EF9; Tue, 16 Oct 2012 21:02:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id DA6E38FC08; Tue, 16 Oct 2012 21:02:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 48C9BB91C; Tue, 16 Oct 2012 17:02:45 -0400 (EDT) From: John Baldwin To: Maksim Yevmenkin Subject: Re: svn commit: r241616 - in head/sys: dev/ixgbe net Date: Tue, 16 Oct 2012 17:02:06 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210162018.q9GKIG9q013028@svn.freebsd.org> In-Reply-To: <201210162018.q9GKIG9q013028@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210161702.06330.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 16 Oct 2012 17:02:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 21:02:46 -0000 On Tuesday, October 16, 2012 4:18:16 pm Maksim Yevmenkin wrote: > Author: emax > Date: Tue Oct 16 20:18:15 2012 > New Revision: 241616 > URL: http://svn.freebsd.org/changeset/base/241616 > > Log: > introduce concept of ifi_baudrate power factor. the idea is to work > around the problem where high speed interfaces (such as ixgbe(4)) > are not able to report real ifi_baudrate. bascially, take a spare > byte from struct if_data and use it to store ifi_baudrate power > factor. in other words, > > real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor > > this should be backwards compatible with old binaries. use ixgbe(4) > as an example on how drivers would set ifi_baudrate power factor > > Discussed with: kib, scottl, glebius > MFC after: 1 week It would be a lot nicer if you could still allow one to use more readable things like IF_Gbps(10). Note that we do have a 40G driver (mlxen) as well. Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT. (It could be a static inline or some such). I would just like to keep the readability. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 21:10:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5154E28D; Tue, 16 Oct 2012 21:10:57 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0F5D48FC08; Tue, 16 Oct 2012 21:10:56 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so6841319pbb.13 for ; Tue, 16 Oct 2012 14:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=tHU1GIxNNW9HVlqBk5Em4bndEBKIwGBcL3RLqdb50G4=; b=sb5gAmxqTKCTg2AJoKGkElosbZ0OTIgN7iwON4Ty5wSwXp2Ek/5UQbXG4SXWP4f7UF Z3HY3F5JKS5ZCVQjLKPRFzMeJifiBSlKRzJ2n5MFjxVjvt7a2w7McSin/cXshoW7hLHI 1C/CLN9DGFBj+fT4Y1F9S94s3k0ogYWV33BvUdrW0PnhAAs1wNIg1h0m+k4vS4rml5oU x43QXdMkLkxrLes0Z7VPhhKv3k+NGv9REI6E1ak7ElqAkfKUwVMqGYp3omjH+5+8blkn pCYr5W4yXD2x+Dk0dKEtw+yg/05TsMCOvafPVsn7FNzZsWuch3qD95nEkp1RzIepJF59 2UJA== MIME-Version: 1.0 Received: by 10.68.222.234 with SMTP id qp10mr4370798pbc.127.1350421856418; Tue, 16 Oct 2012 14:10:56 -0700 (PDT) Sender: maksim.yevmenkin@gmail.com Received: by 10.68.240.38 with HTTP; Tue, 16 Oct 2012 14:10:56 -0700 (PDT) In-Reply-To: <201210161702.06330.jhb@freebsd.org> References: <201210162018.q9GKIG9q013028@svn.freebsd.org> <201210161702.06330.jhb@freebsd.org> Date: Tue, 16 Oct 2012 14:10:56 -0700 X-Google-Sender-Auth: S2-Hpd1lyVLKBcWoQdPI_j2Upm4 Message-ID: Subject: Re: svn commit: r241616 - in head/sys: dev/ixgbe net From: Maksim Yevmenkin To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 21:10:57 -0000 On Tue, Oct 16, 2012 at 2:02 PM, John Baldwin wrote: > On Tuesday, October 16, 2012 4:18:16 pm Maksim Yevmenkin wrote: >> Author: emax >> Date: Tue Oct 16 20:18:15 2012 >> New Revision: 241616 >> URL: http://svn.freebsd.org/changeset/base/241616 >> >> Log: >> introduce concept of ifi_baudrate power factor. the idea is to work >> around the problem where high speed interfaces (such as ixgbe(4)) >> are not able to report real ifi_baudrate. bascially, take a spare >> byte from struct if_data and use it to store ifi_baudrate power >> factor. in other words, >> >> real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor >> >> this should be backwards compatible with old binaries. use ixgbe(4) >> as an example on how drivers would set ifi_baudrate power factor >> >> Discussed with: kib, scottl, glebius >> MFC after: 1 week > > It would be a lot nicer if you could still allow one to use more > readable things like IF_Gbps(10). Note that we do have a 40G driver > (mlxen) as well. > > Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT. > (It could be a static inline or some such). I would just like to > keep the readability. well, yes, i thought about it, but decided not to do it right away. we could provide shortcuts/macros for "popular" baudrates, i.e. 1, 10, 40 and 100 Gbps. while ixgbe(4) example is not ideal, i thought it still was pretty readable :) thanks, max From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 21:34:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22DC18BE; Tue, 16 Oct 2012 21:34:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8698FC0C; Tue, 16 Oct 2012 21:34:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GLY2ew025124; Tue, 16 Oct 2012 21:34:02 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GLY2Uu025122; Tue, 16 Oct 2012 21:34:02 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201210162134.q9GLY2Uu025122@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 16 Oct 2012 21:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241618 - head/usr.sbin/cron/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 21:34:03 -0000 Author: sobomax Date: Tue Oct 16 21:34:02 2012 New Revision: 241618 URL: http://svn.freebsd.org/changeset/base/241618 Log: Properly handle non-keyword case by setting e->second to 0. Modified: head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Tue Oct 16 20:24:54 2012 (r241617) +++ head/usr.sbin/cron/lib/entry.c Tue Oct 16 21:34:02 2012 (r241618) @@ -222,6 +222,7 @@ load_entry(file, error_func, pw, envp) } } else { Debug(DPARS, ("load_entry()...about to parse numerics\n")) + bit_set(e->second, 0); ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE, PPC_NULL, ch, file); From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 22:43:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCD0FA20; Tue, 16 Oct 2012 22:43:14 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C532F8FC0A; Tue, 16 Oct 2012 22:43:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9GMhEtF036012; Tue, 16 Oct 2012 22:43:14 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9GMhElw036009; Tue, 16 Oct 2012 22:43:14 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201210162243.q9GMhElw036009@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 16 Oct 2012 22:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241619 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 22:43:14 -0000 Author: emax Date: Tue Oct 16 22:43:14 2012 New Revision: 241619 URL: http://svn.freebsd.org/changeset/base/241619 Log: report total number of ports for each lagg(4) interface via net.link.lagg.X.count sysctl MFC after: 1 week Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Oct 16 21:34:02 2012 (r241618) +++ head/sys/net/if_lagg.c Tue Oct 16 22:43:14 2012 (r241619) @@ -288,6 +288,9 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "count", CTLTYPE_INT|CTLFLAG_RO, &sc->sc_count, sc->sc_count, + "Total number of ports"); /* Hash all layers by default */ sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 23:43:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B37E0648; Tue, 16 Oct 2012 23:43:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 59E918FC0A; Tue, 16 Oct 2012 23:43:08 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so6900461pad.13 for ; Tue, 16 Oct 2012 16:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=H57FifpRnqh/2HZp/ltyu9dswOVCtXbgtvGIgoDz0y8=; b=M1y42KBwBbhztX1AfU1HIcWghx/UxfXUGo/w/n26C6TSaH9H5pofND19I2936Mpeny QPzLU4IvrGcEdXHymxSgobzJtP+qWqU14A56hEkY91P7/4/KORwwtGv9wN900dNISP8p k5x2lJQ5tNBllLGUcUYBgKy8YWZen2Tjbytil65az7Y0FFuXPiDMXF+6s8GSVvVJbBRZ uaMX/0arUbApn5On0uP9t48WPNvJreSnznUXqRSE+mhXYAufSAFZVN11ZsNy/r48Hst+ OMh+0fQv94QzarsSRErqsRIbgPtS+r2n6RrEn7MgErDtWhNMmQxZ2HbnPJ2ylYGv/6Jy cIaA== MIME-Version: 1.0 Received: by 10.68.223.37 with SMTP id qr5mr51413455pbc.101.1350430987564; Tue, 16 Oct 2012 16:43:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Tue, 16 Oct 2012 16:43:07 -0700 (PDT) In-Reply-To: <507D077C.6080108@FreeBSD.org> References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> <1350335891.1123.160.camel@revolution.hippie.lan> <20121016133233.I1358@besplex.bde.org> <507CD99D.1070606@FreeBSD.org> <507D077C.6080108@FreeBSD.org> Date: Tue, 16 Oct 2012 16:43:07 -0700 X-Google-Sender-Auth: t19FlB1uIfxIpyY0U20h_mgC2xw Message-ID: Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Adrian Chadd To: Maxim Sobolev Content-Type: text/plain; charset=ISO-8859-1 Cc: Ian Lepore , src-committers@freebsd.org, Pawel Jakub Dawidek , Garrett Cooper , svn-src-all@freebsd.org, Pedro Giffuni , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 23:43:08 -0000 On 16 October 2012 00:06, Maxim Sobolev wrote: > I am working on improved version, so that in the absence of @every_second it > would revert to the previous behavior. Even though I seriously doubt that > few thousand additional CPU cycles every second would make any measurable > differences in any practical application. Please don't assume that "a few thousand CPU cycles every second" translates to "nothing consequential." You have to wake the CPU up when it may not need to be waked up (which takes power and time just to do, before you run anything), all the scheduler stuff and VM code will get run, these consume cycles and power. Remember, CPU cycles doesn't not mean "power consumed" or "time taken." Some of us are becoming to increasingly care about how power efficient the base system is (both in terms of CPU used, wakeups done, code size, etc.) and this is honestly a step backwards in that direction. Thanks, Adrian From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 00:44:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3C45BD5; Wed, 17 Oct 2012 00:44:35 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1258FC0A; Wed, 17 Oct 2012 00:44:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9H0iZfM055979; Wed, 17 Oct 2012 00:44:35 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9H0iZHo055977; Wed, 17 Oct 2012 00:44:35 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201210170044.q9H0iZHo055977@svn.freebsd.org> From: Maxim Sobolev Date: Wed, 17 Oct 2012 00:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241625 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 00:44:35 -0000 Author: sobomax Date: Wed Oct 17 00:44:34 2012 New Revision: 241625 URL: http://svn.freebsd.org/changeset/base/241625 Log: o Use nanosleep(2) to sleep exact amount of time till the next second, not multiple of 1 second, which results in actual time to drift back and forth every run within 1 second of the actual action has been set for. Suggested by: Ian Lepore o Schedule the first run in 1 second after starting up, not on the boundary of the next minute, which results in the every_second jobs not being run. Modified: head/usr.sbin/cron/cron/cron.c Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Wed Oct 17 00:33:10 2012 (r241624) +++ head/usr.sbin/cron/cron/cron.c Wed Oct 17 00:44:34 2012 (r241625) @@ -341,37 +341,73 @@ cron_tick(db) */ static void cron_sync() { +#if 0 register struct tm *tm; +#endif - TargetTime = time((time_t*)0); + TargetTime = time((time_t*)0) + 1; +#if 0 tm = localtime(&TargetTime); TargetTime += (60 - tm->tm_sec); +#endif } +static int +timeval_subtract(struct timespec *result, struct timeval *x, struct timeval *y) +{ + int nsec; + + /* Perform the carry for the later subtraction by updating y. */ + if (x->tv_usec < y->tv_usec) { + nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; + y->tv_usec -= 1000000 * nsec; + y->tv_sec += nsec; + } + if (x->tv_usec - y->tv_usec > 1000000) { + nsec = (x->tv_usec - y->tv_usec) / 1000000; + y->tv_usec += 1000000 * nsec; + y->tv_sec -= nsec; + } + + /* tv_nsec is certainly positive. */ + result->tv_sec = x->tv_sec - y->tv_sec; + result->tv_nsec = (x->tv_usec - y->tv_usec) * 1000; + + /* Return difference in seconds */ + return (x->tv_sec - y->tv_sec); +} static void cron_sleep(db) cron_db *db; { - int seconds_to_wait = 0; + int seconds_to_wait; + int rval; + struct timeval ctime, ttime; + struct timespec stime, remtime; /* * Loop until we reach the top of the next minute, sleep when possible. */ for (;;) { - seconds_to_wait = (int) (TargetTime - time((time_t*)0)); + gettimeofday(&ctime, NULL); + ttime.tv_sec = TargetTime; + ttime.tv_usec = 0; + timeval_subtract(&stime, &ttime, &ctime); /* * If the seconds_to_wait value is insane, jump the cron */ - if (seconds_to_wait < -600 || seconds_to_wait > 600) { + if (stime.tv_sec < -600 || stime.tv_sec > 600) { cron_clean(db); cron_sync(); continue; } + seconds_to_wait = (stime.tv_nsec > 0) ? stime.tv_sec + 1 : stime.tv_sec; + Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n", getpid(), (long)TargetTime, seconds_to_wait)) @@ -380,13 +416,19 @@ cron_sleep(db) * to run, break */ - if (seconds_to_wait <= 0) + if (stime.tv_sec < 0) break; if (job_runqueue() == 0) { Debug(DSCH, ("[%d] sleeping for %d seconds\n", getpid(), seconds_to_wait)) - sleep(seconds_to_wait); + for (;;) { + rval = nanosleep(&stime, &remtime); + if (rval == 0 || errno != EINTR) + break; + stime.tv_sec = remtime.tv_sec; + stime.tv_nsec = remtime.tv_nsec; + } } } } From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 05:08:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C99B4BED; Wed, 17 Oct 2012 05:08:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0AF68FC14; Wed, 17 Oct 2012 05:08:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9H58ZhE098632; Wed, 17 Oct 2012 05:08:35 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9H58ZZR098629; Wed, 17 Oct 2012 05:08:35 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201210170508.q9H58ZZR098629@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 17 Oct 2012 05:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241626 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 05:08:36 -0000 Author: np Date: Wed Oct 17 05:08:35 2012 New Revision: 241626 URL: http://svn.freebsd.org/changeset/base/241626 Log: Whitespace cleanup. MFC after: 3 days Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Oct 17 00:44:34 2012 (r241625) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Oct 17 05:08:35 2012 (r241626) @@ -73,8 +73,8 @@ VNET_DECLARE(int, tcp_autorcvbuf_max); void send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) { - struct wrqe *wr; - struct fw_flowc_wr *flowc; + struct wrqe *wr; + struct fw_flowc_wr *flowc; unsigned int nparams = ftxp ? 8 : 4, flowclen; struct port_info *pi = toep->port; struct adapter *sc = pi->adapter; @@ -102,13 +102,13 @@ send_flowc_wr(struct toepcb *toep, struc V_FW_WR_FLOWID(toep->tid)); flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; - flowc->mnemval[0].val = htobe32(pfvf); - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; - flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); + flowc->mnemval[0].val = htobe32(pfvf); + flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; + flowc->mnemval[1].val = htobe32(pi->tx_chan); + flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; + flowc->mnemval[2].val = htobe32(pi->tx_chan); + flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; + flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); if (ftxp) { uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Oct 17 00:44:34 2012 (r241625) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Oct 17 05:08:35 2012 (r241626) @@ -271,8 +271,8 @@ send_reset_synqe(struct toedev *tod, str struct ifnet *ifp = m->m_pkthdr.rcvif; struct port_info *pi = ifp->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; - struct wrqe *wr; - struct fw_flowc_wr *flowc; + struct wrqe *wr; + struct fw_flowc_wr *flowc; struct cpl_abort_req *req; int txqid, rxqid, flowclen; struct sge_wrq *ofld_txq; @@ -312,13 +312,13 @@ send_reset_synqe(struct toedev *tod, str flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | V_FW_WR_FLOWID(synqe->tid)); flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; - flowc->mnemval[0].val = htobe32(pfvf); - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; - flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); + flowc->mnemval[0].val = htobe32(pfvf); + flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; + flowc->mnemval[1].val = htobe32(pi->tx_chan); + flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; + flowc->mnemval[2].val = htobe32(pi->tx_chan); + flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; + flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); synqe->flags |= TPF_FLOWC_WR_SENT; /* ... then ABORT request */ From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 07:25:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACCC5BA9; Wed, 17 Oct 2012 07:25:26 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 664318FC18; Wed, 17 Oct 2012 07:25:26 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so7294250pad.13 for ; Wed, 17 Oct 2012 00:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=SynJ28snDDKs60+wPbd9WYM/aMEa+S7wuNYuachyoVs=; b=0ZVGlcOy/+qb8aLPytm8rn98LP0WuV2p3cS0Q23PUVPF/D/LfbDGzxDq6lH3pEcLhk M5BPL3uKemw2vOe+JvEYvRT6CMsOPXgCxryTyC90rRIrwrGJ/+VZvsEHcrI0N7CwULc0 VynH5ksgcn1aId0o9k/+hEWaz7VmeRQP7pX7+VCbkTQFxj9bC2YqiOPAkozygDqeMk8p tBDxZuDOSWprfejQis8vYr4BKxvTQjTSL41+QQbfxhDRLeC2bQTzQ/UGvt3mbtbeVjbD nG2rQsMKwNA8ko/tFp0zrg0bCl8h6Xw5NOS9ld89E4Vfvxcm9ldyx21TueFmL44VEQfs 56Mw== Received: by 10.68.218.132 with SMTP id pg4mr54366690pbc.100.1350458726106; Wed, 17 Oct 2012 00:25:26 -0700 (PDT) Received: from [192.168.20.12] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id to8sm12084964pbc.11.2012.10.17.00.25.24 (version=SSLv3 cipher=OTHER); Wed, 17 Oct 2012 00:25:25 -0700 (PDT) References: <201210162243.q9GMhElw036009@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201210162243.q9GMhElw036009@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (10A403) From: Garrett Cooper Subject: Re: svn commit: r241619 - head/sys/net Date: Wed, 17 Oct 2012 00:25:23 -0700 To: Maksim Yevmenkin Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 07:25:26 -0000 This commit broke tinderbox; CTLFLAG_RO should be CTLFLAG_RD. Sent from my iPhone On Oct 16, 2012, at 3:43 PM, Maksim Yevmenkin wrote: > Author: emax > Date: Tue Oct 16 22:43:14 2012 > New Revision: 241619 > URL: http://svn.freebsd.org/changeset/base/241619 >=20 > Log: > report total number of ports for each lagg(4) interface > via net.link.lagg.X.count sysctl >=20 > MFC after: 1 week >=20 > Modified: > head/sys/net/if_lagg.c >=20 > Modified: head/sys/net/if_lagg.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/net/if_lagg.c Tue Oct 16 21:34:02 2012 (r241618) > +++ head/sys/net/if_lagg.c Tue Oct 16 22:43:14 2012 (r241619) > @@ -288,6 +288,9 @@ lagg_clone_create(struct if_clone *ifc,=20 > SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, > "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flow= id, > "Use flow id for load sharing"); > + SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, > + "count", CTLTYPE_INT|CTLFLAG_RO, &sc->sc_count, sc->sc_count, > + "Total number of ports"); > /* Hash all layers by default */ > sc->sc_flags =3D LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; >=20 > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 07:58:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D0F261D for ; Wed, 17 Oct 2012 07:58:28 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3F58FC19 for ; Wed, 17 Oct 2012 07:58:27 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so5917774lag.13 for ; Wed, 17 Oct 2012 00:58:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=7tmtnCXHQ4y5XeMNMHR6XJBiGcFR0X2u66nA/8NZYB0=; b=ojVCyHJ+t8cI5vlykFgXByBMJZ9rapmZKW9TWh4MZV1noH/mXJkuAQv7O4PC4Q8wiu eh027nToPSR2/ZTcccpAoc3YQCgm4jkJCC2tHxJVTc7Gip8mIJyXzqYBSIPpU9HRxO3u Z/1zvaDXZcthbsFVj7ff3ANKM5v4SZBfPJ5ic8usxBh1FgwR3SaGUBOG7qwaSJsG0s5b U+FkF7+TGDsgYFqSQAzrsuemMYf5wJ2cv+SzVVN+mC6QlD/7Clj8q3T0yWQQz9z2YVZC xb6wDw6gDSMS8cz7Nf3NcNNWkiO4i4FlYEfkESbqO/4YZJ3wa+AzePlH853yRfUH2BQK a2vg== Received: by 10.112.44.198 with SMTP id g6mr6300838lbm.66.1350460705124; Wed, 17 Oct 2012 00:58:25 -0700 (PDT) Received: from zont-osx.local (ppp95-165-155-241.pppoe.spdop.ru. [95.165.155.241]) by mx.google.com with ESMTPS id jk8sm6188649lab.7.2012.10.17.00.58.23 (version=SSLv3 cipher=OTHER); Wed, 17 Oct 2012 00:58:24 -0700 (PDT) Sender: Andrey Zonov Message-ID: <507E651D.2060809@FreeBSD.org> Date: Wed, 17 Oct 2012 11:58:21 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Maxim Sobolev Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron References: <201210170044.q9H0iZHo055977@svn.freebsd.org> In-Reply-To: <201210170044.q9H0iZHo055977@svn.freebsd.org> X-Enigmail-Version: 1.4.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig31F401DC21F5684E424370A8" X-Gm-Message-State: ALoCoQntfShXI/0Iqeb8SED1ijqOW4e5tcah1/MX1OML7ij1Ad4gsTWgod6RnF1taSWZEfw6wSpe Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 07:58:28 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig31F401DC21F5684E424370A8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/17/12 4:44 AM, Maxim Sobolev wrote: > Author: sobomax > Date: Wed Oct 17 00:44:34 2012 > New Revision: 241625 > URL: http://svn.freebsd.org/changeset/base/241625 >=20 > Log: > o Use nanosleep(2) to sleep exact amount of time till the next second= , > not multiple of 1 second, which results in actual time to drift back > and forth every run within 1 second of the actual action has > been set for. > =20 > Suggested by: Ian Lepore > =20 > o Schedule the first run in 1 second after starting up, not on the > boundary of the next minute, which results in the every_second jobs > not being run. >=20 > Modified: > head/usr.sbin/cron/cron/cron.c >=20 > Modified: head/usr.sbin/cron/cron/cron.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/cron/cron/cron.c Wed Oct 17 00:33:10 2012 (r241624) > +++ head/usr.sbin/cron/cron/cron.c Wed Oct 17 00:44:34 2012 (r241625) > @@ -341,37 +341,73 @@ cron_tick(db) > */ > static void > cron_sync() { > +#if 0 > register struct tm *tm; > +#endif > =20 > - TargetTime =3D time((time_t*)0); > + TargetTime =3D time((time_t*)0) + 1; > +#if 0 > tm =3D localtime(&TargetTime); > TargetTime +=3D (60 - tm->tm_sec); > +#endif > } > =20 > +static int This should be type of time_t. > +timeval_subtract(struct timespec *result, struct timeval *x, struct ti= meval *y) > +{ > + int nsec; And this should be suseconds_t. > + > + /* Perform the carry for the later subtraction by updating y. */ > + if (x->tv_usec < y->tv_usec) { > + nsec =3D (y->tv_usec - x->tv_usec) / 1000000 + 1; > + y->tv_usec -=3D 1000000 * nsec; > + y->tv_sec +=3D nsec; > + } > + if (x->tv_usec - y->tv_usec > 1000000) { > + nsec =3D (x->tv_usec - y->tv_usec) / 1000000; > + y->tv_usec +=3D 1000000 * nsec; > + y->tv_sec -=3D nsec; > + } > + =20 > + /* tv_nsec is certainly positive. */ > + result->tv_sec =3D x->tv_sec - y->tv_sec; > + result->tv_nsec =3D (x->tv_usec - y->tv_usec) * 1000; > + =20 > + /* Return difference in seconds */ > + return (x->tv_sec - y->tv_sec); > +} May be it's better to use timersub() and TIMEVAL_TO_TIMESPEC()? > =20 > static void > cron_sleep(db) > cron_db *db; > { > - int seconds_to_wait =3D 0; > + int seconds_to_wait; > + int rval; > + struct timeval ctime, ttime; > + struct timespec stime, remtime; > =20 > /* > * Loop until we reach the top of the next minute, sleep when possibl= e. > */ > =20 > for (;;) { > - seconds_to_wait =3D (int) (TargetTime - time((time_t*)0)); > + gettimeofday(&ctime, NULL); > + ttime.tv_sec =3D TargetTime; > + ttime.tv_usec =3D 0; > + timeval_subtract(&stime, &ttime, &ctime); > =20 > /* > * If the seconds_to_wait value is insane, jump the cron > */ > =20 > - if (seconds_to_wait < -600 || seconds_to_wait > 600) { > + if (stime.tv_sec < -600 || stime.tv_sec > 600) { > cron_clean(db); > cron_sync(); > continue; > } > =20 > + seconds_to_wait =3D (stime.tv_nsec > 0) ? stime.tv_sec + 1 : stime.t= v_sec; > + > Debug(DSCH, ("[%d] TargetTime=3D%ld, sec-to-wait=3D%d\n", > getpid(), (long)TargetTime, seconds_to_wait)) > =20 > @@ -380,13 +416,19 @@ cron_sleep(db) > * to run, break > */ > =20 > - if (seconds_to_wait <=3D 0) > + if (stime.tv_sec < 0) > break; > if (job_runqueue() =3D=3D 0) { > Debug(DSCH, ("[%d] sleeping for %d seconds\n", > getpid(), seconds_to_wait)) > =20 > - sleep(seconds_to_wait); > + for (;;) { > + rval =3D nanosleep(&stime, &remtime); > + if (rval =3D=3D 0 || errno !=3D EINTR) > + break; > + stime.tv_sec =3D remtime.tv_sec; > + stime.tv_nsec =3D remtime.tv_nsec; > + } > } > } > } >=20 --=20 Andrey Zonov --------------enig31F401DC21F5684E424370A8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQfmUhAAoJEBWLemxX/CvTiXkH/jqGbd/nVeCJw4h2yKvXhL8y 4SMPIWJ+mHwtgPm4uhYNJ0MrZzVpmt1VwOzgyCz1SKPVvLDFP5KF2RJDs2hQFJn7 uMTaazdK6zOirNWjXj2YsFSERz/LdvxEF4aOPOqe6qQYtlZE7L8cF7rMCWPgPhm0 RFFVqX7eUS3yJOMfSG/hInnyt0RSPXnhw3i3531mnQKJloq3G36sr9McS11IYsaC YhUn4h+/HIDeHi9UN2Nl4n1Obmm9zOiSyiZcn+8w/4wAsv7O7qsxqyq1Y0SLDQlL 2IuQ8GR1qCc/lfT9oQjLHH04u5hwmpcogyImojRXh/XZDXSpirIVG6mKmfoC+5A= =SufR -----END PGP SIGNATURE----- --------------enig31F401DC21F5684E424370A8-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 08:14:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3291CC67; Wed, 17 Oct 2012 08:14:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) by mx1.freebsd.org (Postfix) with ESMTP id 11BE88FC08; Wed, 17 Oct 2012 08:14:59 +0000 (UTC) Received: from Xins-MacBook-Pro.local (c-67-188-85-47.hsd1.ca.comcast.net [67.188.85.47]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 760051D65D; Wed, 17 Oct 2012 01:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1350461698; bh=hkkfELo1Bi4m5E5o60ArRD/xZAN9ysDOeP01a+4jAzA=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=lBIHWQj+spm9B/5arze5UNow5bVInaVddBJILGTjHpSEvkiBXZE21yqnlo+2I9Br+ 31UDBqaWPKmDmE7S8GJuUHcuT0JZCYGVVRvXD0nD6n/nQOt0MTe2oVsg1ifcdOhU1Z WZMey2srq8DARD1Twl5x+pTHu8wUjIfBLcOsDCWs= Message-ID: <507E6901.8040801@delphij.net> Date: Wed, 17 Oct 2012 01:14:57 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Maxim Sobolev Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron References: <201210170044.q9H0iZHo055977@svn.freebsd.org> In-Reply-To: <201210170044.q9H0iZHo055977@svn.freebsd.org> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 08:14:59 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, On 10/16/12 5:44 PM, Maxim Sobolev wrote: > Author: sobomax Date: Wed Oct 17 00:44:34 2012 New Revision: > 241625 URL: http://svn.freebsd.org/changeset/base/241625 > > Log: o Use nanosleep(2) to sleep exact amount of time till the next > second, not multiple of 1 second, which results in actual time to > drift back and forth every run within 1 second of the actual action > has been set for. > > Suggested by: Ian Lepore > > o Schedule the first run in 1 second after starting up, not on the > boundary of the next minute, which results in the every_second > jobs not being run. > > for (;;) { - seconds_to_wait = (int) (TargetTime - > time((time_t*)0)); + gettimeofday(&ctime, NULL); Could you please replace this with clock_gettime(CLOCK_REALTIME_FAST)? This also gives us time in timespec, suitable for use with nanosleep, plus save some code for the subtract helper. -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJQfmkBAAoJEG80Jeu8UPuz1QgH/2YALytmL6l6cTwzku7MqMjV 7JlYyje1GCJ5fnUUxyEl19ZSeHExGXCi8UWLHAvR3Y8uDqZ+NBY3iDRckKexbbfZ fWJhmrDUeon1i9BG4nYSWZQ/M2XvEAfr31hNgH7aEHVI81KBxaStBNi11HEQsR70 gdSBAdkB/SVgD76FgTuwPChcusJhf5egv28K6yWPUyzR2x3berS2h3eAmj1I1CDo buDi9HUQCSSrFSHNeKawPq9iOGkuDs/yvAUd1e+OWXPtD+RWBhuqIi0U141w6yRy hEE3wWUTjChg9e4r9oCsUx5tKPeNXbV136txj8LVZKahfOxyRF/Ac4H7C/6pFpI= =HdF2 -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 08:19:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED2FAE1D; Wed, 17 Oct 2012 08:19:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D679F8FC14; Wed, 17 Oct 2012 08:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9H8J8Lx027882; Wed, 17 Oct 2012 08:19:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9H8J8mU027880; Wed, 17 Oct 2012 08:19:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201210170819.q9H8J8mU027880@svn.freebsd.org> From: Xin LI Date: Wed, 17 Oct 2012 08:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241627 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 08:19:09 -0000 Author: delphij Date: Wed Oct 17 08:19:08 2012 New Revision: 241627 URL: http://svn.freebsd.org/changeset/base/241627 Log: Fix build. Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Oct 17 05:08:35 2012 (r241626) +++ head/sys/net/if_lagg.c Wed Oct 17 08:19:08 2012 (r241627) @@ -289,7 +289,7 @@ lagg_clone_create(struct if_clone *ifc, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "count", CTLTYPE_INT|CTLFLAG_RO, &sc->sc_count, sc->sc_count, + "count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count, "Total number of ports"); /* Hash all layers by default */ sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 10:58:53 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3990EA6; Wed, 17 Oct 2012 10:58:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id EB8128FC14; Wed, 17 Oct 2012 10:58:51 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9HAwjUV028693; Wed, 17 Oct 2012 21:58:45 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9HAwZ3L005592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Oct 2012 21:58:36 +1100 Date: Wed, 17 Oct 2012 21:58:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Zonov Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron In-Reply-To: <507E651D.2060809@FreeBSD.org> Message-ID: <20121017203303.S4043@besplex.bde.org> References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <507E651D.2060809@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-CMAE-Score: 0 X-CMAE-Analysis: v=2.0 cv=Oc3AlWvY c=1 sm=1 a=bSy518SJfeoA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=LxQcZHavKNQA:10 a=0fr1xYclyxO09Jf6mEsA:9 a=CjuIK1q_8ugA:10 a=9-zRq2cP1alhuPcL:21 a=1sfFR99HISt8Aj4a:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, Maxim Sobolev , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 10:58:53 -0000 On Wed, 17 Oct 2012, Andrey Zonov wrote: > On 10/17/12 4:44 AM, Maxim Sobolev wrote: >> Log: >> o Use nanosleep(2) to sleep exact amount of time till the next second, >> not multiple of 1 second, which results in actual time to drift back >> and forth every run within 1 second of the actual action has >> been set for. >> ... >> +static int > > This should be type of time_t. Actually void, since the value that it returns is especially useless for the only use of this function, and is in fact not used. The only use of this function needs more than seconds resolution. > >> +timeval_subtract(struct timespec *result, struct timeval *x, struct timeval *y) >> +{ >> + int nsec; > > And this should be suseconds_t. > >> + >> + /* Perform the carry for the later subtraction by updating y. */ >> + if (x->tv_usec < y->tv_usec) { >> + nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; >> + y->tv_usec -= 1000000 * nsec; >> + y->tv_sec += nsec; >> + } >> + if (x->tv_usec - y->tv_usec > 1000000) { >> + nsec = (x->tv_usec - y->tv_usec) / 1000000; >> + y->tv_usec += 1000000 * nsec; >> + y->tv_sec -= nsec; >> + } >> + >> + /* tv_nsec is certainly positive. */ >> + result->tv_sec = x->tv_sec - y->tv_sec; >> + result->tv_nsec = (x->tv_usec - y->tv_usec) * 1000; >> + >> + /* Return difference in seconds */ >> + return (x->tv_sec - y->tv_sec); >> +} > > May be it's better to use timersub() and TIMEVAL_TO_TIMESPEC()? I don't like them, but they somehow do things in half the space of the above (only 7 lines for timersub()). They are kernel internals that were originally intentionally left out in userland. Now they are NetBSD/OpenBSD compatibilty cruft. They only support timevals, and timevals should never be used after POSIX standardized timespecs and left out timevals in 1990. POSIX was broken in 2001 to support all the old timeval cruft. TIMEVAL_TO_TIMESPEC() should have been left out in the kernel too. cron is fairly portable and belong[ed] in contrib and shouldn't use unportable bad extensions. Applications can use floating point (FP), and taking the difference of timespecs especially simple in FP: /* Time difference of timespecs in nanoseconds. */ double difftimespec(struct timeval *x, struct timeval *y) { return ((x->tv_sec - y->tv_sec) * 1e9 + x->tv_nsec - y->tv_nsec); } Converting this back to a timespec may take a bit more work than working throughout with timespecs, but no more than the TIMEVAL_TO_TIMESPEC() mistake, especially when it does the same amount of error checking (none). It could easily be faster than TIMESPEC_TO_TIMEVAL(), since it only needs FP multiplication while TIMESPEC_TO_TIMEVAL() needs integer division. struct timespec nanosecondstotimespec(double nsec) { struct timespec ts; ts.tv_sec = nsec * 1e-9; /* Only support nsec >= 0. */ ts.tv_nsec = nsec - ts.tv_sec * 1e9; } >> static void >> cron_sleep(db) >> cron_db *db; >> { >> - int seconds_to_wait = 0; >> + int seconds_to_wait; >> + int rval; >> + struct timeval ctime, ttime; >> + struct timespec stime, remtime; >> >> /* >> * Loop until we reach the top of the next minute, sleep when possible. >> */ >> >> for (;;) { >> - seconds_to_wait = (int) (TargetTime - time((time_t*)0)); >> + gettimeofday(&ctime, NULL); It's just foot-shooting to use an old timeval API and then have to convert to timespecs to use the "new" nanosleep() API. It was new in 1990. Someone mentioned using clock_getttime(CLOCK_REALTIME_BROKEN). I might complain about that separately :-). >> + ttime.tv_sec = TargetTime; >> + ttime.tv_usec = 0; >> + timeval_subtract(&stime, &ttime, &ctime); This is especially easy in FP. I wouldn't make difftimespec() an actual function or obfuscate it as a macro, but would just open-code its 1 line. The timespec doesn't need to be initialized for this, and the 1 line is especially simple because 1 of the tv_nsec's is 0: /* stime now double. */ stime = (TargetTime - cttime.tv_sec) * 1e9 - ctime.tv_nsec; >> >> /* >> * If the seconds_to_wait value is insane, jump the cron >> */ >> >> - if (seconds_to_wait < -600 || seconds_to_wait > 600) { >> + if (stime.tv_sec < -600 || stime.tv_sec > 600) { Again simpler in FP using fabs(), but the above could have used abs(): if (fabs(stime) > 600e9) But maybe all negative stime's are insane. >> cron_clean(db); >> cron_sync(); >> continue; >> } >> >> + seconds_to_wait = (stime.tv_nsec > 0) ? stime.tv_sec + 1 : stime.tv_sec; >> + Again simpler in FP, using standard rounding functions: seconds_to_wait = ceil(stime * 1e-9); but probably, stime should be kept in nanoseconds throughout. It could also be in seconds, but keeping it in nansoseconds ensures that it is an integer and reduces rounding problems, and allows it to be copied to an int64_t or intmax_t. >> Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n", >> getpid(), (long)TargetTime, seconds_to_wait)) >> seconds_to_wait is now (in the FP version) used mainly in debugging printfs. These could print nanoseconds to avoid converting stime, and it is now a bug (in the non-FP version) for them to not print the nanoseconds part, since that part is what you might need to debug this change. Nanoseconds is really to much info though. I would try printing the value in microseconds in %.6f format. This is an ancient program which assumes that time_t is representable as a log. At least it casts TargetTime to long, so it doesn't assume that time_t is long here. Careful use of time_t and suseconds_t would mainly give more things to cast. The above assumes that seconds_to_wait is an int. More precisely the assumption was in the old code quoted above. It uses a first uses a subtraction of time_t's instead of the technically correct difftime(), and then uses a bogus cast to int to break warnings about overflow. Then it checks if seconds_to_wait is sane. An insane difference would have overflowed before the check. In the FP pseudo-code, I use the fact that 53 bits is enough for anyone to avoid overflow checks. 2**53 nanoseconds is actually only 104 days, so a 53-bit integer would not be enough. But FP also has exponents and infinities. Insane times will result in a difference that is either an infinity or not in the range of -600 to +600 seconds, so the insanity will be detected. Than the 53 bits are plenty for exact nanseconds over 600 seconds. Another bug in the timeval and timespec APIs are that they don't automatically avoid overflow problems like FP does. Overflow just occurs, and there are no infinities or fenv flags to record it. (Types in timespecs are correctly not required to be unsigned, so overflow gives undefined behaviour which may be to trap so as to report the problem.) Neither the timeval compatibility cruft APIs nor your code above have the complications to detect overflow. There are kernel bugs in nanosleep() from this -- pass any time interval which when added to the current time will give an unrepresentable time. nanosleep(9) will then overflow and do colaterally wrong things. Older timeval APIs like setitimer() used to avoid overflow by not permitting intervals of more than 100 million seconds (this works for current times up to 100 million seconds before the maximum time representable by a time_t, which is good enough until the current time reaches 2035). nanosleep() never had this restriction, and it was removed in the older timer APIs, although it is still documented for them. >> @@ -380,13 +416,19 @@ cron_sleep(db) >> * to run, break >> */ >> >> - if (seconds_to_wait <= 0) >> + if (stime.tv_sec < 0) Similar in FP. >> break; >> if (job_runqueue() == 0) { >> Debug(DSCH, ("[%d] sleeping for %d seconds\n", >> getpid(), seconds_to_wait)) >> >> - sleep(seconds_to_wait); >> + for (;;) { >> + rval = nanosleep(&stime, &remtime); The only thing that is not simpler in FP -- we have to convert our scalar variable back to a struct to use oldish kernelish APIs like nanosleep(). >> + if (rval == 0 || errno != EINTR) >> + break; >> + stime.tv_sec = remtime.tv_sec; >> + stime.tv_nsec = remtime.tv_nsec; >> + } >> } >> } >> } My interval-handling timeout code in ping doesn't use FP and is about as messy as the above :-). It has to use timevals to interface with select timeouts, and it uses gettimeofday() sicne clock_gettime() wasn't implemented when it was written. Oops, even nanosleep() is too new to have been in POSIX in 1990. ping has arbitrary intervals which take a bit more work to handle than seconds intervals. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 10:59:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 724CF1D3; Wed, 17 Oct 2012 10:59:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4111E8FC1D; Wed, 17 Oct 2012 10:59:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HAxvlj055205; Wed, 17 Oct 2012 10:59:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HAxvn9055203; Wed, 17 Oct 2012 10:59:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210171059.q9HAxvn9055203@svn.freebsd.org> From: Andriy Gapon Date: Wed, 17 Oct 2012 10:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 10:59:57 -0000 Author: avg Date: Wed Oct 17 10:59:56 2012 New Revision: 241628 URL: http://svn.freebsd.org/changeset/base/241628 Log: zfs: make use of getnewvnode_reserve in zfs_mknode and zfs_zget getnewvnode_reserve helps to avoid "recursing" back into zfs code via getnewvnode when that latter needs to reclaim some vnodes. zfs code may hold a number of locks around getnewvnode and doesn't expect any recursion to happen on those locks, because that never happens in solaris. I believe that this change also eleiminates a need for the delayed znode destruction via the taskqueue. Many thanks to kib for devising getnewvnode_reserve. Reported by: flo Tested by: bapt, kwm, swills MFC after: 2 weeks X-MFC after: r241556 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Oct 17 08:19:08 2012 (r241627) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Oct 17 10:59:56 2012 (r241628) @@ -856,6 +856,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } + getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1042,6 +1043,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); + getnewvnode_drop_reserve(); } /* @@ -1152,12 +1154,14 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_ *zpp = NULL; + getnewvnode_reserve(1); again: ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db); if (err) { ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (err); } @@ -1168,6 +1172,7 @@ again: doi.doi_bonus_size < sizeof (znode_phys_t)))) { sa_buf_rele(db, NULL); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (EINVAL); } @@ -1231,6 +1236,7 @@ again: sa_buf_rele(db, NULL); mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (err); } @@ -1266,6 +1272,7 @@ again: } } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (err); } From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 11:16:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 113DA681; Wed, 17 Oct 2012 11:16:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C738FC16; Wed, 17 Oct 2012 11:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HBGHtH057749; Wed, 17 Oct 2012 11:16:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HBGHHb057721; Wed, 17 Oct 2012 11:16:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210171116.q9HBGHHb057721@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Oct 2012 11:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 11:16:18 -0000 Author: attilio Date: Wed Oct 17 11:16:17 2012 New Revision: 241629 URL: http://svn.freebsd.org/changeset/base/241629 Log: Disconnect non-MPSAFE NWFS from the build in preparation for dropping GIANT from VFS. In addition, disconnect also netncp, which is a base requirement for NWFS. In the possibility of a future maintenance of the code and later readd to the FreeBSD base, maybe we should think about a better location for netncp. I'm not entirely sure the / top location is actually right, however I will let network people to comment on that more specifically. This is not targeted for MFC. Modified: head/MAINTAINERS head/etc/defaults/rc.conf head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.usr.dist head/include/Makefile head/lib/Makefile head/lib/libprocstat/Makefile head/lib/libprocstat/common_kvm.h head/lib/libprocstat/libprocstat.c head/rescue/rescue/Makefile head/sbin/mount/mount.8 head/sbin/mount/mount.c head/share/examples/Makefile head/share/man/man5/src.conf.5 head/share/man/man7/hier.7 head/share/mk/bsd.libnames.mk head/share/mk/bsd.own.mk head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/kern/Make.tags.inc head/sys/modules/Makefile head/usr.bin/Makefile.amd64 head/usr.bin/Makefile.i386 head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Oct 17 10:59:56 2012 (r241628) +++ head/MAINTAINERS Wed Oct 17 11:16:17 2012 (r241629) @@ -74,8 +74,6 @@ drm rnoland Just keep me informed of ch unifdef(1) fanf Pre-commit review requested. ntp roberto Pre-commit review requested. inetd dwmalone Recommends pre-commit review. -nwfs bp In case of functional changes pre-commit review - requested. contrib/smbfs bp Open for in-tree committs. In case of functional changes pre-commit review requested. contrib/pf mlaier Pre-commit review requested. Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Oct 17 10:59:56 2012 (r241628) +++ head/etc/defaults/rc.conf Wed Oct 17 11:16:17 2012 (r241629) @@ -92,7 +92,7 @@ fsck_y_enable="NO" # Set to YES to do fs fsck_y_flags="" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. -netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB nwfs:NWFS" # Net filesystems. +netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB" # Net filesystems. extra_netfs_types="NO" # List of network extra filesystem types for delayed # mount at startup (or NO). Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Wed Oct 17 10:59:56 2012 (r241628) +++ head/etc/mtree/BSD.include.dist Wed Oct 17 11:16:17 2012 (r241629) @@ -168,8 +168,6 @@ .. nullfs .. - nwfs - .. portalfs .. procfs @@ -287,8 +285,6 @@ sig .. .. - netncp - .. netsmb .. nfs Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Wed Oct 17 10:59:56 2012 (r241628) +++ head/etc/mtree/BSD.usr.dist Wed Oct 17 11:16:17 2012 (r241629) @@ -281,8 +281,6 @@ bluetooth .. .. - nwclient - .. pc-sysinstall .. perfmon Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Wed Oct 17 10:59:56 2012 (r241628) +++ head/include/Makefile Wed Oct 17 11:16:17 2012 (r241629) @@ -44,7 +44,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ - ${_fs_nwfs} fs/procfs fs/smbfs fs/udf fs/unionfs \ + fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ @@ -81,11 +81,6 @@ LSUBSUBDIRS+= netgraph/bluetooth/include _netipx= netipx #.endif -.if ${MK_NCP} != "no" -_netncp= netncp -_fs_nwfs= fs/nwfs -.endif - # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is # probably only useful for developers and should be avoided if you do not Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Oct 17 10:59:56 2012 (r241628) +++ head/lib/Makefile Wed Oct 17 11:16:17 2012 (r241629) @@ -89,7 +89,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libmilter} \ ${_libmp} \ ${_libnandfs} \ - ${_libncp} \ ${_libngatm} \ libopie \ libpam \ @@ -189,9 +188,6 @@ _libypclnt= libypclnt .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -.if ${MK_NCP} != "no" -_libncp= libncp -.endif _libsmb= libsmb _libvgl= libvgl _libproc= libproc Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Wed Oct 17 10:59:56 2012 (r241628) +++ head/lib/libprocstat/Makefile Wed Oct 17 11:16:17 2012 (r241629) @@ -24,11 +24,6 @@ LDADD= -lkvm -lutil MAN= libprocstat.3 -.if ${MK_NCP} != "no" -CFLAGS+= -DLIBPROCSTAT_NWFS -SRCS+= nwfs.c -.endif - # XXX This is a hack. .if ${MK_CDDL} != "no" CFLAGS+= -DLIBPROCSTAT_ZFS Modified: head/lib/libprocstat/common_kvm.h ============================================================================== --- head/lib/libprocstat/common_kvm.h Wed Oct 17 10:59:56 2012 (r241628) +++ head/lib/libprocstat/common_kvm.h Wed Oct 17 11:16:17 2012 (r241629) @@ -42,7 +42,6 @@ int isofs_filestat(kvm_t *kd, struct vno int msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int ntfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); -int nwfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int smbfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int udf_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed Oct 17 10:59:56 2012 (r241628) +++ head/lib/libprocstat/libprocstat.c Wed Oct 17 11:16:17 2012 (r241629) @@ -974,9 +974,6 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s FSTYPE(msdosfs), FSTYPE(nfs), FSTYPE(ntfs), -#ifdef LIBPROCSTAT_NWFS - FSTYPE(nwfs), -#endif FSTYPE(smbfs), FSTYPE(udf), FSTYPE(ufs), Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Wed Oct 17 10:59:56 2012 (r241628) +++ head/rescue/rescue/Makefile Wed Oct 17 11:16:17 2012 (r241629) @@ -130,10 +130,6 @@ CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv - .if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk CRUNCH_ALIAS_bsdlabel= disklabel -#.if ${MK_NCP} != "no" -#CRUNCH_PROGS+= mount_nwfs -#CRUNCH_LIBS+= -lncp -#.endif #CRUNCH_PROGS+= mount_smbfs #CRUNCH_LIBS+= -lsmb .endif Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Wed Oct 17 10:59:56 2012 (r241628) +++ head/sbin/mount/mount.8 Wed Oct 17 11:16:17 2012 (r241629) @@ -447,7 +447,6 @@ However, for the following file system t .Cm msdosfs , .Cm nfs , .Cm ntfs , -.Cm nwfs , .Cm nullfs , .Cm oldnfs , .Cm smbfs , @@ -546,7 +545,6 @@ support for a particular file system mig .Xr mount_nfs 8 , .Xr mount_ntfs 8 , .Xr mount_nullfs 8 , -.Xr mount_nwfs 8 , .Xr mount_smbfs 8 , .Xr mount_udf 8 , .Xr mount_unionfs 8 , Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Wed Oct 17 10:59:56 2012 (r241628) +++ head/sbin/mount/mount.c Wed Oct 17 11:16:17 2012 (r241629) @@ -143,7 +143,7 @@ use_mountprog(const char *vfstype) unsigned int i; const char *fs[] = { "cd9660", "mfs", "msdosfs", "nfs", "ntfs", - "nwfs", "nullfs", "oldnfs", "smbfs", "udf", "unionfs", + "nullfs", "oldnfs", "smbfs", "udf", "unionfs", NULL }; Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Wed Oct 17 10:59:56 2012 (r241628) +++ head/share/examples/Makefile Wed Oct 17 11:16:17 2012 (r241629) @@ -24,7 +24,6 @@ LDIRS= BSD_daemon \ libvgl \ mdoc \ netgraph \ - nwclient \ perfmon \ ppi \ ppp \ @@ -129,8 +128,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ netgraph/udp.tunnel \ netgraph/virtual.chain \ netgraph/virtual.lan \ - nwclient/dot.nwfsrc \ - nwclient/nwfs.sh.sample \ perfmon/Makefile \ perfmon/README \ perfmon/perfmon.c \ Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Oct 17 10:59:56 2012 (r241628) +++ head/share/man/man5/src.conf.5 Wed Oct 17 11:16:17 2012 (r241629) @@ -547,8 +547,6 @@ When set, it also enforces the following .Bl -item -compact .It .Va WITHOUT_IPX_SUPPORT -.It -.Va WITHOUT_NCP .El .It Va WITHOUT_IPX_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Wed Oct 17 10:59:56 2012 (r241628) +++ head/share/man/man7/hier.7 Wed Oct 17 11:16:17 2012 (r241629) @@ -256,8 +256,6 @@ C include files for NFS (Network File Sy NTFS file system .It Pa nullfs/ loopback file system -.It Pa nwfs/ -NetWare file system .It Pa procfs/ process file system .It Pa smbfs/ Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Wed Oct 17 10:59:56 2012 (r241628) +++ head/share/mk/bsd.libnames.mk Wed Oct 17 11:16:17 2012 (r241629) @@ -97,9 +97,6 @@ LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a .endif LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a -.if ${MK_NCP} != "no" -LIBNCP?= ${DESTDIR}${LIBDIR}/libncp.a -.endif LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Oct 17 10:59:56 2012 (r241628) +++ head/share/mk/bsd.own.mk Wed Oct 17 11:16:17 2012 (r241629) @@ -374,7 +374,6 @@ __DEFAULT_YES_OPTIONS = \ MAILWRAPPER \ MAKE \ MAN \ - NCP \ NDIS \ NETCAT \ NETGRAPH \ @@ -550,10 +549,6 @@ MK_CLANG:= no MK_GROFF:= no .endif -.if ${MK_IPX} == "no" -MK_NCP:= no -.endif - .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Oct 17 10:59:56 2012 (r241628) +++ head/sys/conf/NOTES Wed Oct 17 11:16:17 2012 (r241629) @@ -570,8 +570,6 @@ options IPSEC_NAT_T #NAT-T support, UD options IPX #IPX/SPX communications protocols -options NCP #NetWare Core protocol - options NETATALK #Appletalk communications protocols options NETATALKDEBUG #Appletalk debugging @@ -1014,8 +1012,6 @@ options KGSSAPI #Kernel GSSAPI implem options NTFS options NULLFS #NULL filesystem -# Broken (depends on NCP): -#options NWFS #NetWare filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework options PSEUDOFS_TRACE #Debugging support for PSEUDOFS Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 17 10:59:56 2012 (r241628) +++ head/sys/conf/files Wed Oct 17 11:16:17 2012 (r241629) @@ -2375,12 +2375,6 @@ fs/ntfs/ntfs_vnops.c optional ntfs fs/nullfs/null_subr.c optional nullfs fs/nullfs/null_vfsops.c optional nullfs fs/nullfs/null_vnops.c optional nullfs -fs/nwfs/nwfs_io.c optional nwfs -fs/nwfs/nwfs_ioctl.c optional nwfs -fs/nwfs/nwfs_node.c optional nwfs -fs/nwfs/nwfs_subr.c optional nwfs -fs/nwfs/nwfs_vfsops.c optional nwfs -fs/nwfs/nwfs_vnops.c optional nwfs fs/procfs/procfs.c optional procfs fs/procfs/procfs_ctl.c optional procfs fs/procfs/procfs_dbregs.c optional procfs @@ -3141,15 +3135,6 @@ netipx/spx_usrreq.c optional ipx netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm -netncp/ncp_conn.c optional ncp -netncp/ncp_crypt.c optional ncp -netncp/ncp_login.c optional ncp -netncp/ncp_mod.c optional ncp -netncp/ncp_ncp.c optional ncp -netncp/ncp_nls.c optional ncp -netncp/ncp_rq.c optional ncp -netncp/ncp_sock.c optional ncp -netncp/ncp_subr.c optional ncp netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Oct 17 10:59:56 2012 (r241628) +++ head/sys/conf/options Wed Oct 17 11:16:17 2012 (r241629) @@ -214,7 +214,6 @@ MSDOSFS opt_dontuse.h NANDFS opt_dontuse.h NTFS opt_dontuse.h NULLFS opt_dontuse.h -NWFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h REISERFS opt_dontuse.h @@ -423,7 +422,6 @@ LIBMCHAIN MBUF_PROFILING MBUF_STRESS_TEST MROUTING opt_mrouting.h -NCP NETATALK opt_atalk.h NFSLOCKD PCBGROUP opt_pcbgroup.h Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Wed Oct 17 10:59:56 2012 (r241628) +++ head/sys/kern/Make.tags.inc Wed Oct 17 11:16:17 2012 (r241629) @@ -30,7 +30,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ ${SYS}/fs/ntfs/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ - ${SYS}/fs/nwfs/*.[ch] \ ${SYS}/fs/procfs/*.[ch] \ ${SYS}/fs/smbfs/*.[ch] \ ${SYS}/fs/udf/*.[ch] \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Oct 17 10:59:56 2012 (r241628) +++ head/sys/modules/Makefile Wed Oct 17 11:16:17 2012 (r241629) @@ -247,7 +247,6 @@ SUBDIR= \ ${_nve} \ ${_nvme} \ ${_nvram} \ - ${_nwfs} \ ${_nxge} \ ${_opensolaris} \ oce \ @@ -504,15 +503,9 @@ _mlx4ib= mlx4ib _mlxen= mlxen _mthca= mthca .endif -.if ${MK_NCP} != "no" -_ncp= ncp -.endif _ncv= ncv _ndis= ndis _nsp= nsp -.if ${MK_NCP} != "no" -_nwfs= nwfs -.endif .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif Modified: head/usr.bin/Makefile.amd64 ============================================================================== --- head/usr.bin/Makefile.amd64 Wed Oct 17 10:59:56 2012 (r241628) +++ head/usr.bin/Makefile.amd64 Wed Oct 17 11:16:17 2012 (r241629) @@ -1,7 +1,3 @@ # $FreeBSD$ -.if ${MK_NCP} != "no" -SUBDIR+= ncplist -SUBDIR+= ncplogin -.endif SUBDIR+= smbutil Modified: head/usr.bin/Makefile.i386 ============================================================================== --- head/usr.bin/Makefile.i386 Wed Oct 17 10:59:56 2012 (r241628) +++ head/usr.bin/Makefile.i386 Wed Oct 17 11:16:17 2012 (r241629) @@ -1,7 +1,3 @@ # $FreeBSD$ -.if ${MK_NCP} != "no" -SUBDIR+= ncplist -SUBDIR+= ncplogin -.endif SUBDIR+= smbutil Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Wed Oct 17 10:59:56 2012 (r241628) +++ head/usr.sbin/Makefile.amd64 Wed Oct 17 11:16:17 2012 (r241629) @@ -17,9 +17,6 @@ SUBDIR+= btxld SUBDIR+= cpucontrol SUBDIR+= kgmon SUBDIR+= lptcontrol -.if ${MK_NCP} != "no" -SUBDIR+= mount_nwfs -.endif SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Wed Oct 17 10:59:56 2012 (r241628) +++ head/usr.sbin/Makefile.i386 Wed Oct 17 11:16:17 2012 (r241629) @@ -12,9 +12,6 @@ SUBDIR+= cpucontrol SUBDIR+= kgmon SUBDIR+= kgzip SUBDIR+= lptcontrol -.if ${MK_NCP} != "no" -SUBDIR+= mount_nwfs -.endif SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 11:21:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BB15A25; Wed, 17 Oct 2012 11:21:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id E6EAA8FC12; Wed, 17 Oct 2012 11:21:29 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9HBLH2f030730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Oct 2012 22:21:19 +1100 Date: Wed, 17 Oct 2012 22:21:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron In-Reply-To: <507E6901.8040801@delphij.net> Message-ID: <20121017215857.L4043@besplex.bde.org> References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <507E6901.8040801@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-CMAE-Score: 0 X-CMAE-Analysis: v=2.0 cv=G5JEiKY5 c=1 sm=1 a=bSy518SJfeoA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=LxQcZHavKNQA:10 a=6I5d2MoRAAAA:8 a=SNAVdp33c4qXQ2tJE_EA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, Maxim Sobolev , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 11:21:31 -0000 On Wed, 17 Oct 2012, Xin Li wrote: > On 10/16/12 5:44 PM, Maxim Sobolev wrote: >> Author: sobomax Date: Wed Oct 17 00:44:34 2012 New Revision: >> 241625 URL: http://svn.freebsd.org/changeset/base/241625 >> >> Log: o Use nanosleep(2) to sleep exact amount of time till the next >> second, not multiple of 1 second, which results in actual time to >> drift back and forth every run within 1 second of the actual action >> has been set for. >> >> Suggested by: Ian Lepore >> >> o Schedule the first run in 1 second after starting up, not on the >> boundary of the next minute, which results in the every_second >> jobs not being run. > >> >> for (;;) { - seconds_to_wait = (int) (TargetTime - >> time((time_t*)0)); + gettimeofday(&ctime, NULL); > > Could you please replace this with clock_gettime(CLOCK_REALTIME_FAST)? > This also gives us time in timespec, suitable for use with nanosleep, > plus save some code for the subtract helper. CLOCK_REALTIME_FAST_N_BROKEN should never be used. It isn't even fast on systems with fast timecounter hardware, since the syscall overhead dominates the time. It is broken since times read by it are not ordered relative to times read by CLOCK_REALTIME. Using CLOCK_REALTIME would be good. cron should also consider using CLOCK_MONOTONIC. cron is one of the few things that needs real time instead of monotonic time for most things, but perhaps it should check the monotonic time occasionally in case someone stepped the real time crazily. For checking things every second, monotonic time is probably best, but most things in crontabs want real time. nanosleep() is quite broken here, and use of CLOCK_REALTIME_BROKEN_OR_NOT is incompatible with use of the broken nanosleep(). POSIX specifies that nanosleep() sleeps in intervals measured by CLOCK_REALTIME, but in FreeBSD it sleeps in intervals measured by CLOCK_MONOTONIC. POSIX specifies clock_nanosleep(), which can sleep in on any clock, and is probably what is wanted (with CLOCK_MONOTONIC) in most cases, but FreeBSD doesn't implement this. FreeBSD does implement some other POSIX APIS that can get timeouts on any clock. Perhaps these can be used to implement clock_nanosleep() in a library, but I'm not familiar with them. sleep() uses nanosleep() so it sleeps on the same wrong clock as nanosleep(). sleep() existed before clock ids were dreamed of, so this is more broken for it than for nanosleep(). It originally had no option except to sleep in real time, so POSIX had to specify that it keep sleeping on the clock id for that time once clock ids for sleeping became available. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 11:30:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63B094BC; Wed, 17 Oct 2012 11:30:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42CB18FC12; Wed, 17 Oct 2012 11:30:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HBU1rp060273; Wed, 17 Oct 2012 11:30:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HBU0fH060245; Wed, 17 Oct 2012 11:30:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210171130.q9HBU0fH060245@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Oct 2012 11:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241636 - in head: etc/mtree include lib/libprocstat rescue/rescue sbin sbin/mount share/dict share/man/man7 sys/boot/forth sys/conf sys/geom/label sys/kern sys/mips/rmi sys/modules sys... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 11:30:01 -0000 Author: attilio Date: Wed Oct 17 11:30:00 2012 New Revision: 241636 URL: http://svn.freebsd.org/changeset/base/241636 Log: Disconnect non-MPSAFE NTFS from the build in preparation for dropping GIANT from VFS. This code is particulary broken and fragile and other in-kernel implementations around, found in other operating systems, don't really seem clean and solid enough to be imported at all. If someone wants to reconsider in-kernel NTFS implementation for inclusion again, a fair effort for completely fixing and cleaning it up is expected. In the while NTFS regular users can use FUSE interface and ntfs-3g port to work with their NTFS partitions. This is not targeted for MFC. Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/lib/libprocstat/Makefile head/lib/libprocstat/common_kvm.h head/lib/libprocstat/libprocstat.c head/rescue/rescue/Makefile head/sbin/Makefile head/sbin/mount/mount.8 head/sbin/mount/mount.c head/share/dict/freebsd head/share/man/man7/hier.7 head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h head/sys/kern/Make.tags.inc head/sys/mips/rmi/rootfs_list.txt head/sys/modules/Makefile head/sys/modules/geom/geom_label/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Wed Oct 17 11:28:44 2012 (r241635) +++ head/etc/mtree/BSD.include.dist Wed Oct 17 11:30:00 2012 (r241636) @@ -164,8 +164,6 @@ .. nfs .. - ntfs - .. nullfs .. portalfs Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Wed Oct 17 11:28:44 2012 (r241635) +++ head/include/Makefile Wed Oct 17 11:30:00 2012 (r241636) @@ -43,7 +43,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ - fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ + fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Wed Oct 17 11:28:44 2012 (r241635) +++ head/lib/libprocstat/Makefile Wed Oct 17 11:30:00 2012 (r241636) @@ -8,7 +8,6 @@ SRCS= cd9660.c \ common_kvm.c \ libprocstat.c \ msdosfs.c \ - ntfs.c \ smbfs.c \ udf.c Modified: head/lib/libprocstat/common_kvm.h ============================================================================== --- head/lib/libprocstat/common_kvm.h Wed Oct 17 11:28:44 2012 (r241635) +++ head/lib/libprocstat/common_kvm.h Wed Oct 17 11:30:00 2012 (r241636) @@ -41,7 +41,6 @@ int devfs_filestat(kvm_t *kd, struct vno int isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); -int ntfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int smbfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int udf_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed Oct 17 11:28:44 2012 (r241635) +++ head/lib/libprocstat/libprocstat.c Wed Oct 17 11:30:00 2012 (r241636) @@ -973,7 +973,6 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s FSTYPE(isofs), FSTYPE(msdosfs), FSTYPE(nfs), - FSTYPE(ntfs), FSTYPE(smbfs), FSTYPE(udf), FSTYPE(ufs), Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Wed Oct 17 11:28:44 2012 (r241635) +++ head/rescue/rescue/Makefile Wed Oct 17 11:30:00 2012 (r241636) @@ -93,7 +93,7 @@ CRUNCH_PROGS_sbin= atacontrol badsect fsirand gbde geom ifconfig init \ kldconfig kldload kldstat kldunload ldconfig \ md5 mdconfig mdmfs mknod mount mount_cd9660 \ - mount_msdosfs mount_nfs mount_ntfs mount_nullfs \ + mount_msdosfs mount_nfs mount_nullfs \ mount_udf mount_unionfs newfs \ newfs_msdos nos-tun ping reboot \ restore rcorder route routed rtquery rtsol savecore \ Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Wed Oct 17 11:28:44 2012 (r241635) +++ head/sbin/Makefile Wed Oct 17 11:30:00 2012 (r241636) @@ -52,7 +52,6 @@ SUBDIR=adjkerntz \ mount_fusefs \ mount_msdosfs \ mount_nfs \ - mount_ntfs \ mount_nullfs \ mount_udf \ mount_unionfs \ Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Wed Oct 17 11:28:44 2012 (r241635) +++ head/sbin/mount/mount.8 Wed Oct 17 11:30:00 2012 (r241636) @@ -446,7 +446,6 @@ However, for the following file system t .Cm mfs , .Cm msdosfs , .Cm nfs , -.Cm ntfs , .Cm nullfs , .Cm oldnfs , .Cm smbfs , @@ -543,7 +542,6 @@ support for a particular file system mig .Xr mount_cd9660 8 , .Xr mount_msdosfs 8 , .Xr mount_nfs 8 , -.Xr mount_ntfs 8 , .Xr mount_nullfs 8 , .Xr mount_smbfs 8 , .Xr mount_udf 8 , Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Wed Oct 17 11:28:44 2012 (r241635) +++ head/sbin/mount/mount.c Wed Oct 17 11:30:00 2012 (r241636) @@ -142,7 +142,7 @@ use_mountprog(const char *vfstype) */ unsigned int i; const char *fs[] = { - "cd9660", "mfs", "msdosfs", "nfs", "ntfs", + "cd9660", "mfs", "msdosfs", "nfs", "nullfs", "oldnfs", "smbfs", "udf", "unionfs", NULL }; Modified: head/share/dict/freebsd ============================================================================== --- head/share/dict/freebsd Wed Oct 17 11:28:44 2012 (r241635) +++ head/share/dict/freebsd Wed Oct 17 11:30:00 2012 (r241636) @@ -128,7 +128,6 @@ NNTP NSS NSSwitch NT -NTFS NTP Nasdaq NetBIOS Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Wed Oct 17 11:28:44 2012 (r241635) +++ head/share/man/man7/hier.7 Wed Oct 17 11:30:00 2012 (r241636) @@ -252,8 +252,6 @@ FIFOs file system MS-DOS file system .It Pa nfs/ C include files for NFS (Network File System) version 2, 3 and 4 -.It Pa ntfs/ -NTFS file system .It Pa nullfs/ loopback file system .It Pa procfs/ Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/boot/forth/loader.conf Wed Oct 17 11:30:00 2012 (r241636) @@ -168,8 +168,6 @@ linsysfs_load="NO" # Linux compatibilit msdosfs_load="NO" # FAT-12/16/32 nfsclient_load="NO" # NFS client nfsserver_load="NO" # NFS server -ntfs_load="NO" # NTFS -ntfs_iconv_load="NO" # NTFS iconv character support nullfs_load="NO" # Null filesystem procfs_load="NO" # Process filesystem reiserfs_load="NO" # ReiserFS Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/conf/NOTES Wed Oct 17 11:30:00 2012 (r241636) @@ -1006,11 +1006,6 @@ options NFSCL #experimental NFS clien options NFSD #experimental NFS server with NFSv4 options KGSSAPI #Kernel GSSAPI implementation -# NT File System. Read-mostly, see mount_ntfs(8) for details. -# For a full read-write NTFS support consider sysutils/fusefs-ntfs -# port/package. -options NTFS - options NULLFS #NULL filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework @@ -1116,7 +1111,6 @@ device ksyms # Each option requires their base file system and LIBICONV. options CD9660_ICONV options MSDOSFS_ICONV -options NTFS_ICONV options UDF_ICONV Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/conf/files Wed Oct 17 11:30:00 2012 (r241636) @@ -2366,12 +2366,6 @@ fs/nfsserver/nfs_nfsdkrpc.c optional nfs fs/nfsserver/nfs_nfsdserv.c optional nfsd inet fs/nfsserver/nfs_nfsdport.c optional nfsd inet fs/nfsserver/nfs_nfsdcache.c optional nfsd inet -fs/ntfs/ntfs_compr.c optional ntfs -fs/ntfs/ntfs_iconv.c optional ntfs_iconv -fs/ntfs/ntfs_ihash.c optional ntfs -fs/ntfs/ntfs_subr.c optional ntfs -fs/ntfs/ntfs_vfsops.c optional ntfs -fs/ntfs/ntfs_vnops.c optional ntfs fs/nullfs/null_subr.c optional nullfs fs/nullfs/null_vfsops.c optional nullfs fs/nullfs/null_vnops.c optional nullfs @@ -2458,7 +2452,6 @@ geom/label/g_label.c optional geom_labe geom/label/g_label_ext2fs.c optional geom_label geom/label/g_label_iso9660.c optional geom_label geom/label/g_label_msdosfs.c optional geom_label -geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_reiserfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label geom/label/g_label_gpt.c optional geom_label Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/conf/options Wed Oct 17 11:30:00 2012 (r241636) @@ -212,7 +212,6 @@ FFS opt_dontuse.h FUSE opt_dontuse.h MSDOSFS opt_dontuse.h NANDFS opt_dontuse.h -NTFS opt_dontuse.h NULLFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h @@ -246,7 +245,6 @@ NFSD opt_nfs.h # filesystems and libiconv bridge CD9660_ICONV opt_dontuse.h MSDOSFS_ICONV opt_dontuse.h -NTFS_ICONV opt_dontuse.h UDF_ICONV opt_dontuse.h # If you are following the conditions in the copyright, Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/geom/label/g_label.c Wed Oct 17 11:30:00 2012 (r241636) @@ -84,7 +84,6 @@ const struct g_label_desc *g_labels[] = &g_label_msdosfs, &g_label_ext2fs, &g_label_reiserfs, - &g_label_ntfs, &g_label_gpt, &g_label_gpt_uuid, NULL Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/geom/label/g_label.h Wed Oct 17 11:30:00 2012 (r241636) @@ -84,7 +84,6 @@ extern struct g_label_desc g_label_iso96 extern struct g_label_desc g_label_msdosfs; extern struct g_label_desc g_label_ext2fs; extern struct g_label_desc g_label_reiserfs; -extern struct g_label_desc g_label_ntfs; extern struct g_label_desc g_label_gpt; extern struct g_label_desc g_label_gpt_uuid; #endif /* _KERNEL */ Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/kern/Make.tags.inc Wed Oct 17 11:30:00 2012 (r241636) @@ -28,7 +28,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/fs/fdescfs/*.[ch] \ ${SYS}/fs/fifofs/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ - ${SYS}/fs/ntfs/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ ${SYS}/fs/procfs/*.[ch] \ ${SYS}/fs/smbfs/*.[ch] \ Modified: head/sys/mips/rmi/rootfs_list.txt ============================================================================== --- head/sys/mips/rmi/rootfs_list.txt Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/mips/rmi/rootfs_list.txt Wed Oct 17 11:30:00 2012 (r241636) @@ -530,7 +530,6 @@ ./sbin/mount_msdosfs ./sbin/mount_nfs ./sbin/mount_newnfs -./sbin/mount_ntfs ./sbin/mount_nullfs ./sbin/mount_udf ./sbin/mount_unionfs Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/modules/Makefile Wed Oct 17 11:30:00 2012 (r241636) @@ -240,8 +240,6 @@ SUBDIR= \ nge \ nmdm \ ${_nsp} \ - ntfs \ - ntfs_iconv \ nullfs \ ${_nvd} \ ${_nve} \ Modified: head/sys/modules/geom/geom_label/Makefile ============================================================================== --- head/sys/modules/geom/geom_label/Makefile Wed Oct 17 11:28:44 2012 (r241635) +++ head/sys/modules/geom/geom_label/Makefile Wed Oct 17 11:30:00 2012 (r241636) @@ -8,7 +8,6 @@ SRCS+= g_label_ext2fs.c SRCS+= g_label_gpt.c SRCS+= g_label_iso9660.c SRCS+= g_label_msdosfs.c -SRCS+= g_label_ntfs.c SRCS+= g_label_reiserfs.c SRCS+= g_label_ufs.c From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 13:04:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D77944A; Wed, 17 Oct 2012 13:04:06 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4676E8FC0C; Wed, 17 Oct 2012 13:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HD46sX075609; Wed, 17 Oct 2012 13:04:06 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HD46ov075607; Wed, 17 Oct 2012 13:04:06 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210171304.q9HD46ov075607@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Oct 2012 13:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241641 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 13:04:06 -0000 Author: attilio Date: Wed Oct 17 13:04:05 2012 New Revision: 241641 URL: http://svn.freebsd.org/changeset/base/241641 Log: Include a piece that was left out during r241629. Pointy hat to: me Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Wed Oct 17 11:35:06 2012 (r241640) +++ head/include/Makefile Wed Oct 17 13:04:05 2012 (r241641) @@ -34,7 +34,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set. ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ - netipsec ${_netipx} netnatm ${_netncp} netsmb \ + netipsec ${_netipx} netnatm netsmb \ nfs nfsclient nfsserver \ sys vm From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 13:46:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C88B9ECF; Wed, 17 Oct 2012 13:46:51 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 81C708FC16; Wed, 17 Oct 2012 13:46:51 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so7680983pad.13 for ; Wed, 17 Oct 2012 06:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=iTSN8L0y9dQk7Wv2YdnfHG8V+mf+v8faygqxHr0j5CE=; b=Q4tmm2l6OBedyJlVQjAqumS0diQkbcG+pEAON6QZ1/g02gGMG3hD3r3oT4QBrTqK1w pVqDfB5wg//MTwvOE29FdU6S+1EHmHIYwMasCMcFgckrEhOq7sIjxHTuAN3GiBi+WgXP GEJVwC9pyXqDesWoQk0WWC/knSqOLgNlzU1w+px8xxLc/6yPJBzkSIz+DNciTzanHwrt Zj/jfz9EUsHpDn7LHXJd3XIGWGuz+bpOluh73l4opq3v9tgGpYQVruDduI1W0pRT8Ep8 s5FCrGXHAlGKdo8nH7D3jN0vcjBI7VdFWk5+mbTEUsZcc76ORP6/NIEKk0+J5Fub7B+i lTTA== Received: by 10.68.226.167 with SMTP id rt7mr48105172pbc.94.1350481611147; Wed, 17 Oct 2012 06:46:51 -0700 (PDT) Received: from [172.16.5.33] (173-13-138-133-sfba.hfc.comcastbusiness.net. [173.13.138.133]) by mx.google.com with ESMTPS id pl2sm7038468pbb.66.2012.10.17.06.46.49 (version=SSLv3 cipher=OTHER); Wed, 17 Oct 2012 06:46:49 -0700 (PDT) References: <201210170819.q9H8J8mU027880@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201210170819.q9H8J8mU027880@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <01F59A91-F386-40B7-9B2C-5EC6CA304C8D@gmail.com> X-Mailer: iPhone Mail (10A405) From: maksim yevmenkin Subject: Re: svn commit: r241627 - head/sys/net Date: Wed, 17 Oct 2012 06:46:45 -0700 To: Xin LI Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 13:46:51 -0000 Thank you for fixing it. I have accidentally committed broken version from w= ork-in-progress tree :(=20 Thanks, Max On Oct 17, 2012, at 1:19 AM, Xin LI wrote: > Author: delphij > Date: Wed Oct 17 08:19:08 2012 > New Revision: 241627 > URL: http://svn.freebsd.org/changeset/base/241627 >=20 > Log: > Fix build. >=20 > Modified: > head/sys/net/if_lagg.c >=20 > Modified: head/sys/net/if_lagg.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/net/if_lagg.c Wed Oct 17 05:08:35 2012 (r241626) > +++ head/sys/net/if_lagg.c Wed Oct 17 08:19:08 2012 (r241627) > @@ -289,7 +289,7 @@ lagg_clone_create(struct if_clone *ifc,=20 > "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flow= id, > "Use flow id for load sharing"); > SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, > - "count", CTLTYPE_INT|CTLFLAG_RO, &sc->sc_count, sc->sc_count, > + "count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count, > "Total number of ports"); > /* Hash all layers by default */ > sc->sc_flags =3D LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 13:59:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 487E8343; Wed, 17 Oct 2012 13:59:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 180118FC14; Wed, 17 Oct 2012 13:59:10 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 501B2B96C; Wed, 17 Oct 2012 09:59:09 -0400 (EDT) From: John Baldwin To: Maksim Yevmenkin Subject: Re: svn commit: r241616 - in head/sys: dev/ixgbe net Date: Wed, 17 Oct 2012 09:51:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210162018.q9GKIG9q013028@svn.freebsd.org> <201210161702.06330.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201210170951.23800.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Oct 2012 09:59:09 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 13:59:10 -0000 On Tuesday, October 16, 2012 5:10:56 pm Maksim Yevmenkin wrote: > On Tue, Oct 16, 2012 at 2:02 PM, John Baldwin wrote: > > On Tuesday, October 16, 2012 4:18:16 pm Maksim Yevmenkin wrote: > >> Author: emax > >> Date: Tue Oct 16 20:18:15 2012 > >> New Revision: 241616 > >> URL: http://svn.freebsd.org/changeset/base/241616 > >> > >> Log: > >> introduce concept of ifi_baudrate power factor. the idea is to work > >> around the problem where high speed interfaces (such as ixgbe(4)) > >> are not able to report real ifi_baudrate. bascially, take a spare > >> byte from struct if_data and use it to store ifi_baudrate power > >> factor. in other words, > >> > >> real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor > >> > >> this should be backwards compatible with old binaries. use ixgbe(4) > >> as an example on how drivers would set ifi_baudrate power factor > >> > >> Discussed with: kib, scottl, glebius > >> MFC after: 1 week > > > > It would be a lot nicer if you could still allow one to use more > > readable things like IF_Gbps(10). Note that we do have a 40G driver > > (mlxen) as well. > > > > Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT. > > (It could be a static inline or some such). I would just like to > > keep the readability. > > well, yes, i thought about it, but decided not to do it right away. we > could provide shortcuts/macros for "popular" baudrates, i.e. 1, 10, 40 > and 100 Gbps. while ixgbe(4) example is not ideal, i thought it still > was pretty readable :) I don't really find it all that readable. IF_Gbps(1) looks like a typo to a casual reader. I really think you should have something like: static __inline void if_initbaudrate(struct ifnet *ifp, uintmax_t baud) { ifp->if_baudrate_pf = 0; while (baud > ULONG_MAX) { baud /= 10; ifp->if_baudrate_pf++; } ifp->if_baudrate = baud; } I tested and with -O the compiler inlines that completely: void foo(void) { if_initbaudrate(&i1g, IF_Gbps(1)); if_initbaudrate(&i10g, IF_Gbps(10)); if_initbaudrate(&i40g, IF_Gbps(40)); } Disassembly (when ULONG_MAX is changed to UINT_MAX to simulate a 32-bit platform): 0000000000000000 : 0: c6 05 00 00 00 00 00 movb $0x0,0(%rip) # 7 7: 48 c7 05 00 00 00 00 movq $0x3b9aca00,0(%rip) # 12 e: 00 ca 9a 3b 12: c6 05 00 00 00 00 01 movb $0x1,0(%rip) # 19 19: 48 c7 05 00 00 00 00 movq $0x3b9aca00,0(%rip) # 24 20: 00 ca 9a 3b 24: c6 05 00 00 00 00 01 movb $0x1,0(%rip) # 2b 2b: c7 05 00 00 00 00 00 movl $0xee6b2800,0(%rip) # 35 32: 28 6b ee 35: c7 05 00 00 00 00 00 movl $0x0,0(%rip) # 3f 3c: 00 00 00 3f: c3 retq One issue though is that currently using 'IF_Gbps(10)' triggers a warning on 32-bit platforms. I'd mitigate that by changing IF_Kbps to cast (x) to a uintmax_t: #define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 15:04:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE4293AB; Wed, 17 Oct 2012 15:04:54 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id DA1998FC18; Wed, 17 Oct 2012 15:04:53 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id 16so6068989wgi.31 for ; Wed, 17 Oct 2012 08:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=pYkewBOGkz9Hn49kXhmWDu65oi/S6dRYHtGwDN7CNnY=; b=RT+S7gKdI878MPNMnKH/i/gGcKN2KnPbJmunO7bp7Rzog34qJDXIW+8F2kZ8JtQc5v EQT/H833hD+vh/MopcnpzUNYZg9+CqiWp53iyj1rtFRiFityVXwWd5RJKDg0J5DHQizD c/wSqKaGHd/7rsNdVSii/WtwR89KNSlO6QQAr7494T3FDhZI1dIUJylWAhNacw7TGyyF 8PpPajrA3J5ArXAd7yCMNmTRexcthwG89B8Yq7fPwwNMvbKevPG7ISXg5APKSr40In9x FChIaS6GX00TCOt+7xac0CX6q5/G9EK3b/e8ztPh0267WapNnKAKnArUEZunMU2NuWMC qJqw== Received: by 10.180.100.35 with SMTP id ev3mr4769862wib.7.1350486293033; Wed, 17 Oct 2012 08:04:53 -0700 (PDT) Received: from ndenevsa.sf.moneybookers.net (g1.moneybookers.com. [217.18.249.148]) by mx.google.com with ESMTPS id p4sm28026361wix.0.2012.10.17.08.04.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 08:04:52 -0700 (PDT) Subject: Re: svn commit: r237656 - in head: contrib/top usr.bin/top Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201206271808.q5RI8m0d024853@svn.freebsd.org> Date: Wed, 17 Oct 2012 18:04:47 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <38E42006-48A5-4AF7-9892-EB81583FE5A9@gmail.com> References: <201206271808.q5RI8m0d024853@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1498) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 15:04:55 -0000 On Jun 27, 2012, at 9:08 PM, John Baldwin wrote: > Author: jhb > Date: Wed Jun 27 18:08:48 2012 > New Revision: 237656 > URL: http://svn.freebsd.org/changeset/base/237656 >=20 > Log: > Add a new line to top that provides a brief summary of the ZFS ARC = memory > usage on hosts using ZFS. The new line displays the total amount of = RAM > used by the ARC along with the size of MFU, MRU, anonymous (in = flight), > headers, and other (miscellaneous) sub-categories. The line is not > displayed on systems that are not using ZFS. >=20 > Reviewed by: avg, fs@ > MFC after: 3 days >=20 > Modified: > head/contrib/top/display.c > head/contrib/top/layout.h > head/contrib/top/machine.h > head/contrib/top/top.c > head/usr.bin/top/machine.c > head/usr.bin/top/top.local.1 >=20 >=20 > Modified: head/usr.bin/top/machine.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/top/machine.c Wed Jun 27 17:51:09 2012 = (r237655) > +++ head/usr.bin/top/machine.c Wed Jun 27 18:08:48 2012 = (r237656) > @@ -176,6 +176,12 @@ char *memorynames[] =3D { > "K Free", NULL > }; >=20 > +int arc_stats[7]; > +char *arcnames[] =3D { > + "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K = Other", > + NULL > +}; > + >=20 > + if (arc_enabled) { > + GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); > + arc_stats[0] =3D arc_stat >> 10; > + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > + arc_stats[1] =3D arc_stat >> 10; > + GETSYSCTL("vfs.zfs.mru_size", arc_stat); > + arc_stats[2] =3D arc_stat >> 10; > + GETSYSCTL("vfs.zfs.anon_size", arc_stat); > + arc_stats[3] =3D arc_stat >> 10; > + GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); > + GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", = arc_stat2); > + arc_stats[4] =3D arc_stat + arc_stat2 >> 10; > + GETSYSCTL("kstat.zfs.misc.arcstats.other_size", = arc_stat); > + arc_stats[5] =3D arc_stat >> 10; > + si->arc =3D arc_stats; > + } > + =20 Hi, It looks like MFU and MRU are swapped in top's display. I'm using this to correct the output: --- /usr/src/.zfs/snapshot/patches/usr.bin/top/machine.c = 2012-09-26 08:20:26.000000000 +0200 +++ usr.bin/top/machine.c 2012-10-17 17:00:14.988895167 +0200 @@ -515,9 +515,9 @@ if (arc_enabled) { GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); arc_stats[0] =3D arc_stat >> 10; - GETSYSCTL("vfs.zfs.mfu_size", arc_stat); - arc_stats[1] =3D arc_stat >> 10; GETSYSCTL("vfs.zfs.mru_size", arc_stat); + arc_stats[1] =3D arc_stat >> 10; + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); arc_stats[2] =3D arc_stat >> 10; GETSYSCTL("vfs.zfs.anon_size", arc_stat); arc_stats[3] =3D arc_stat >> 10; From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 15:19:38 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0AAE63D; Wed, 17 Oct 2012 15:19:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE398FC08; Wed, 17 Oct 2012 15:19:37 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA07253; Wed, 17 Oct 2012 18:19:34 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <507ECC86.4080503@FreeBSD.org> Date: Wed, 17 Oct 2012 18:19:34 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121012 Thunderbird/16.0.1 MIME-Version: 1.0 To: Nikolay Denev , John Baldwin Subject: Re: svn commit: r237656 - in head: contrib/top usr.bin/top References: <201206271808.q5RI8m0d024853@svn.freebsd.org> <38E42006-48A5-4AF7-9892-EB81583FE5A9@gmail.com> In-Reply-To: <38E42006-48A5-4AF7-9892-EB81583FE5A9@gmail.com> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 15:19:38 -0000 on 17/10/2012 18:04 Nikolay Denev said the following: > It looks like MFU and MRU are swapped in top's display. > > I'm using this to correct the output: > > --- /usr/src/.zfs/snapshot/patches/usr.bin/top/machine.c 2012-09-26 08:20:26.000000000 +0200 > +++ usr.bin/top/machine.c 2012-10-17 17:00:14.988895167 +0200 > @@ -515,9 +515,9 @@ > if (arc_enabled) { > GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); > arc_stats[0] = arc_stat >> 10; > - GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > - arc_stats[1] = arc_stat >> 10; > GETSYSCTL("vfs.zfs.mru_size", arc_stat); > + arc_stats[1] = arc_stat >> 10; > + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > arc_stats[2] = arc_stat >> 10; > GETSYSCTL("vfs.zfs.anon_size", arc_stat); > arc_stats[3] = arc_stat >> 10; Good catch! Indeed. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 15:26:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CA8D982; Wed, 17 Oct 2012 15:26:22 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 47AA38FC12; Wed, 17 Oct 2012 15:26:22 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so7798903pad.13 for ; Wed, 17 Oct 2012 08:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=o55VzB/mhX9F/hXhdrpeDWb2UW3n81GXXNlTTalLgoU=; b=tJJbsAbb1h6OkbK+eCqe3EgCPzHo4RH02SXS9e2pkj16RHkugFDDoyBAKcPITiAJb+ zO+yNPzHEMKS1Ua42gC8SZw5W8O3zxyzKmrs1FhpDzWEV1u90S8T35oQrlZsM53AYBDm J5dt/mNDTND/HGhLbsXZzkqvWMtB+HnmiERl+mCXLDi9CZxcObsQC93vRzuMXHpPSerB GAG7+D07WjgdMmOVAnvCzF0EkYr0EbG/P8+43egmCtIoBs0XoZ9J4Fg/YuIz3N6Z67f+ z1YR/CtVJv71K2aTCORc4vhdFI9sXfwjhWplnlpTRh/4Vqkv10WZ2d205pcN1hW+BXEB xpkA== MIME-Version: 1.0 Received: by 10.66.79.69 with SMTP id h5mr51644702pax.12.1350487581772; Wed, 17 Oct 2012 08:26:21 -0700 (PDT) Sender: maksim.yevmenkin@gmail.com Received: by 10.68.240.38 with HTTP; Wed, 17 Oct 2012 08:26:21 -0700 (PDT) In-Reply-To: <201210170951.23800.jhb@freebsd.org> References: <201210162018.q9GKIG9q013028@svn.freebsd.org> <201210161702.06330.jhb@freebsd.org> <201210170951.23800.jhb@freebsd.org> Date: Wed, 17 Oct 2012 08:26:21 -0700 X-Google-Sender-Auth: u_EM7A58mHEoQpskMPst1PnHGK0 Message-ID: Subject: Re: svn commit: r241616 - in head/sys: dev/ixgbe net From: Maksim Yevmenkin To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 15:26:22 -0000 On Wed, Oct 17, 2012 at 6:51 AM, John Baldwin wrote: [...] >> > Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT. >> > (It could be a static inline or some such). I would just like to >> > keep the readability. >> >> well, yes, i thought about it, but decided not to do it right away. we >> could provide shortcuts/macros for "popular" baudrates, i.e. 1, 10, 40 >> and 100 Gbps. while ixgbe(4) example is not ideal, i thought it still >> was pretty readable :) > > I don't really find it all that readable. IF_Gbps(1) looks like a typo > to a casual reader. I really think you should have something like: [...] very well :) would something like (please see below) work? Index: sys/dev/ixgbe/ixgbe.c =================================================================== --- sys/dev/ixgbe/ixgbe.c (revision 241641) +++ sys/dev/ixgbe/ixgbe.c (working copy) @@ -2597,8 +2597,7 @@ return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_baudrate = IF_Gbps(1); - ifp->if_baudrate_pf = 1; /* 1Gbps * 10^1 = 10Gbps */ + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Index: sys/net/if.h =================================================================== --- sys/net/if.h (revision 241641) +++ sys/net/if.h (working copy) @@ -179,7 +179,7 @@ * Some convenience macros used for setting ifi_baudrate. * XXX 1000 vs. 1024? --thorpej@netbsd.org */ -#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */ +#define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ Index: sys/net/if_var.h =================================================================== --- sys/net/if_var.h (revision 241641) +++ sys/net/if_var.h (working copy) @@ -591,6 +591,18 @@ } while (0) #ifdef _KERNEL +static __inline void +if_initbaudrate(struct ifnet *ifp, uintmax_t baud) +{ + + ifp->if_baudrate_pf = 0; + while (baud > (u_long)(~0UL)) { + baud /= 10; + ifp->if_baudrate_pf++; + } + ifp->if_baudrate = baud; +} + static __inline int drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) { == thanks, max From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 16:37:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2403719C; Wed, 17 Oct 2012 16:37:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21FF8FC12; Wed, 17 Oct 2012 16:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HGbGLh013658; Wed, 17 Oct 2012 16:37:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HGbGOF013655; Wed, 17 Oct 2012 16:37:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201210171637.q9HGbGOF013655@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 17 Oct 2012 16:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241642 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 16:37:17 -0000 Author: np Date: Wed Oct 17 16:37:16 2012 New Revision: 241642 URL: http://svn.freebsd.org/changeset/base/241642 Log: Always provide sndbuf and MSS values in a flowc command, even when the driver is going to abort the connection right after the flowc. MFC after: 3 days Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Oct 17 13:04:05 2012 (r241641) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Oct 17 16:37:16 2012 (r241642) @@ -75,7 +75,7 @@ send_flowc_wr(struct toepcb *toep, struc { struct wrqe *wr; struct fw_flowc_wr *flowc; - unsigned int nparams = ftxp ? 8 : 4, flowclen; + unsigned int nparams = ftxp ? 8 : 6, flowclen; struct port_info *pi = toep->port; struct adapter *sc = pi->adapter; unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN; @@ -120,6 +120,11 @@ send_flowc_wr(struct toepcb *toep, struc flowc->mnemval[6].val = htobe32(sndbuf); flowc->mnemval[7].mnemonic = FW_FLOWC_MNEM_MSS; flowc->mnemval[7].val = htobe32(ftxp->mss); + } else { + flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; + flowc->mnemval[4].val = htobe32(512); + flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; + flowc->mnemval[5].val = htobe32(512); } txsd->tx_credits = howmany(flowclen, 16); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Oct 17 13:04:05 2012 (r241641) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Oct 17 16:37:16 2012 (r241642) @@ -277,7 +277,7 @@ send_reset_synqe(struct toedev *tod, str int txqid, rxqid, flowclen; struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; - const int nparams = 4; + const int nparams = 6; unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN; INP_WLOCK_ASSERT(synqe->lctx->inp); @@ -319,6 +319,10 @@ send_reset_synqe(struct toedev *tod, str flowc->mnemval[2].val = htobe32(pi->tx_chan); flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); + flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; + flowc->mnemval[4].val = htobe32(512); + flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; + flowc->mnemval[5].val = htobe32(512); synqe->flags |= TPF_FLOWC_WR_SENT; /* ... then ABORT request */ From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 17:23:15 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C7CAD19; Wed, 17 Oct 2012 17:23:15 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9B18FC0C; Wed, 17 Oct 2012 17:23:14 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q9HHNBZJ006720; Wed, 17 Oct 2012 19:23:12 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <507EE97F.6010905@FreeBSD.org> Date: Wed, 17 Oct 2012 19:23:11 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Attilio Rao Subject: Re: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... References: <201210171116.q9HBGHHb057721@svn.freebsd.org> In-Reply-To: <201210171116.q9HBGHHb057721@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 17:23:15 -0000 On 17.10.12 13:16, Attilio Rao wrote: > Author: attilio > Date: Wed Oct 17 11:16:17 2012 > New Revision: 241629 > URL: http://svn.freebsd.org/changeset/base/241629 > > Log: > Disconnect non-MPSAFE NWFS from the build in preparation for dropping > GIANT from VFS. In addition, disconnect also netncp, which is a base > requirement for NWFS. > > In the possibility of a future maintenance of the code and later > readd to the FreeBSD base, maybe we should think about a better location > for netncp. I'm not entirely sure the / top location is actually right, > however I will let network people to comment on that more specifically. > > This is not targeted for MFC. Hi Attilio, I get the following error when running 'make delete-old': [root@tritium] /usr/src/> make delete-old "/export/devel/fbsd/src/tools/build/mk/OptionalObsoleteFiles.inc", line 3461: Malformed conditional (${MK_NCP} == no) "/export/devel/fbsd/src/Makefile.inc1", line 1566: if-less endif make: fatal errors encountered -- cannot continue *** [delete-old] Error code 1 Do we have to remove the stuff in tools/build/mk/OptionalObsoleteFiles.inc too where we have the .if ${MK_NCP} == no ... .endif If so I'm happy to prep a patch, test and commit it. TIA, Andreas From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 17:35:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C0BE3F7; Wed, 17 Oct 2012 17:35:51 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id B00698FC0A; Wed, 17 Oct 2012 17:35:50 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id v11so9703392vbm.13 for ; Wed, 17 Oct 2012 10:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=DLY8Y5j9/d+OevZU0X6wnpcRwAIrDgVAQyG/5kK94IQ=; b=Xz1a9g+Q4Ct6a+ahliygvVBhsg+vpFCK0C76y383/0BGJoqHPeu2f1Up/YcUIj9Tee UuI5BdMn07FQIxJ41NXs5vaEVRXN7fWkQurCM4EckDtg1sNXy6x8Dx6nvcEZEV8AGnW6 EU2Icy7Eb4LNhyaVcvJjkL+KJdHCaSOItHiXaVn6hBQZqKjZ9OeXQ55zMpRrdUzIqHBa aBo9TKAdvTNov8jZ/+m3ilQA+t2h0ks56WS9E+3ckshgu9dW1rdBj/WktjpeRuao6HJG jp35J8fu86C50JHTKv0w1vH1YLWQ+DhRTCGVTIp2tkmlV0y8L/DkdKvkiktZXoY6iZ6g 169w== MIME-Version: 1.0 Received: by 10.58.114.194 with SMTP id ji2mr10864958veb.22.1350495349650; Wed, 17 Oct 2012 10:35:49 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.150.197 with HTTP; Wed, 17 Oct 2012 10:35:49 -0700 (PDT) In-Reply-To: <507EE97F.6010905@FreeBSD.org> References: <201210171116.q9HBGHHb057721@svn.freebsd.org> <507EE97F.6010905@FreeBSD.org> Date: Wed, 17 Oct 2012 18:35:49 +0100 X-Google-Sender-Auth: BeDlF_YaO089ILghHzLWzVFianA Message-ID: Subject: Re: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... From: Attilio Rao To: Andreas Tobler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 17:35:51 -0000 On Wed, Oct 17, 2012 at 6:23 PM, Andreas Tobler wrote: > On 17.10.12 13:16, Attilio Rao wrote: >> >> Author: attilio >> Date: Wed Oct 17 11:16:17 2012 >> New Revision: 241629 >> URL: http://svn.freebsd.org/changeset/base/241629 >> >> Log: >> Disconnect non-MPSAFE NWFS from the build in preparation for dropping >> GIANT from VFS. In addition, disconnect also netncp, which is a base >> requirement for NWFS. >> >> In the possibility of a future maintenance of the code and later >> readd to the FreeBSD base, maybe we should think about a better >> location >> for netncp. I'm not entirely sure the / top location is actually right, >> however I will let network people to comment on that more specifically. >> >> This is not targeted for MFC. > > > Hi Attilio, > > I get the following error when running 'make delete-old': > > [root@tritium] /usr/src/> make delete-old > "/export/devel/fbsd/src/tools/build/mk/OptionalObsoleteFiles.inc", line > 3461: Malformed conditional (${MK_NCP} == no) > "/export/devel/fbsd/src/Makefile.inc1", line 1566: if-less endif > make: fatal errors encountered -- cannot continue > *** [delete-old] Error code 1 > > Do we have to remove the stuff in > tools/build/mk/OptionalObsoleteFiles.inc too where we have the > > .if ${MK_NCP} == no > ... > .endif > > If so I'm happy to prep a patch, test and commit it. You are indeed right. Please go ahead. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 17:41:05 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 431D373D; Wed, 17 Oct 2012 17:41:05 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 9906B8FC08; Wed, 17 Oct 2012 17:41:03 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q9HHf1Tk034934; Wed, 17 Oct 2012 19:41:01 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <507EEDAD.20201@FreeBSD.org> Date: Wed, 17 Oct 2012 19:41:01 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... References: <201210171116.q9HBGHHb057721@svn.freebsd.org> <507EE97F.6010905@FreeBSD.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030207090102060101010503" X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 17:41:05 -0000 This is a multi-part message in MIME format. --------------030207090102060101010503 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 17.10.12 19:35, Attilio Rao wrote: > On Wed, Oct 17, 2012 at 6:23 PM, Andreas Tobler wrote: >> On 17.10.12 13:16, Attilio Rao wrote: >>> >>> Author: attilio >>> Date: Wed Oct 17 11:16:17 2012 >>> New Revision: 241629 >>> URL: http://svn.freebsd.org/changeset/base/241629 >>> >>> Log: >>> Disconnect non-MPSAFE NWFS from the build in preparation for dropping >>> GIANT from VFS. In addition, disconnect also netncp, which is a base >>> requirement for NWFS. >>> >>> In the possibility of a future maintenance of the code and later >>> readd to the FreeBSD base, maybe we should think about a better >>> location >>> for netncp. I'm not entirely sure the / top location is actually right, >>> however I will let network people to comment on that more specifically. >>> >>> This is not targeted for MFC. >> >> >> Hi Attilio, >> >> I get the following error when running 'make delete-old': >> >> [root@tritium] /usr/src/> make delete-old >> "/export/devel/fbsd/src/tools/build/mk/OptionalObsoleteFiles.inc", line >> 3461: Malformed conditional (${MK_NCP} == no) >> "/export/devel/fbsd/src/Makefile.inc1", line 1566: if-less endif >> make: fatal errors encountered -- cannot continue >> *** [delete-old] Error code 1 >> >> Do we have to remove the stuff in >> tools/build/mk/OptionalObsoleteFiles.inc too where we have the >> >> .if ${MK_NCP} == no >> ... >> .endif >> >> If so I'm happy to prep a patch, test and commit it. > > You are indeed right. Please go ahead. Just to be sure, am I right to move the part from tools/build/mk/OptionalObsoleteFiles.inc enclosed in the if MK_NCP == no to the toplevel ObsoleteFiles.inc without any ifdefs. Iow, the netncp part should go away. Attached my trial. TIA, Andreas --------------030207090102060101010503 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="netncp_removal.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="netncp_removal.diff" SW5kZXg6IE9ic29sZXRlRmlsZXMuaW5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIE9ic29sZXRlRmls ZXMuaW5jCShyZXZpc2lvbiAyNDE2NDEpCisrKyBPYnNvbGV0ZUZpbGVzLmluYwkod29ya2lu ZyBjb3B5KQpAQCAtMzgsNiArMzgsNDIgQEAKICMgICB4YXJncyAtbjEgfCBzb3J0IHwgdW5p cSAtZDsKICMgZG9uZQogCisjIDIwMTIxMDE3OiByZW1vdmUgbmV0bmNwCitPTERfRklMRVMr PXVzci9iaW4vbmNwbGlzdAorT0xEX0ZJTEVTKz11c3IvYmluL25jcGxvZ2luCitPTERfRklM RVMrPXVzci9iaW4vbmNwbG9nb3V0CitPTERfRklMRVMrPXVzci9pbmNsdWRlL2ZzL253ZnMv bndmcy5oCitPTERfRklMRVMrPXVzci9pbmNsdWRlL2ZzL253ZnMvbndmc19tb3VudC5oCitP TERfRklMRVMrPXVzci9pbmNsdWRlL2ZzL253ZnMvbndmc19ub2RlLmgKK09MRF9GSUxFUys9 dXNyL2luY2x1ZGUvZnMvbndmcy9ud2ZzX3N1YnIuaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVk ZS9uZXRuY3AvbmNwLmgKK09MRF9GSUxFUys9dXNyL2luY2x1ZGUvbmV0bmNwL25jcF9jZmcu aAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX2Nvbm4uaAorT0xEX0ZJTEVT Kz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX2ZpbGUuaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVk ZS9uZXRuY3AvbmNwX2xpYi5oCitPTERfRklMRVMrPXVzci9pbmNsdWRlL25ldG5jcC9uY3Bf bmNwLmgKK09MRF9GSUxFUys9dXNyL2luY2x1ZGUvbmV0bmNwL25jcF9ubHMuaAorT0xEX0ZJ TEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX3JjZmlsZS5oCitPTERfRklMRVMrPXVzci9p bmNsdWRlL25ldG5jcC9uY3BfcnEuaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3Av bmNwX3NvY2suaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX3N1YnIuaAor T0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX3VzZXIuaAorT0xEX0ZJTEVTKz11 c3IvaW5jbHVkZS9uZXRuY3AvbmNwaW8uaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRu Y3AvbndlcnJvci5oCisjT0xEX0RJUlMrPXVzci9pbmNsdWRlL25ldG5jcAorT0xEX0ZJTEVT Kz11c3IvbGliL2xpYm5jcC5hCitPTERfRklMRVMrPXVzci9saWIvbGlibmNwLnNvCitPTERf TElCUys9dXNyL2xpYi9saWJuY3Auc28uNAorT0xEX0ZJTEVTKz11c3IvbGliL2xpYm5jcF9w LmEKK09MRF9GSUxFUys9dXNyL2xpYjMyL2xpYm5jcC5hCitPTERfRklMRVMrPXVzci9saWIz Mi9saWJuY3Auc28KK09MRF9MSUJTKz11c3IvbGliMzIvbGlibmNwLnNvLjQKK09MRF9GSUxF Uys9dXNyL2xpYjMyL2xpYm5jcF9wLmEKK09MRF9GSUxFUys9dXNyL3NiaW4vbW91bnRfbndm cworT0xEX0ZJTEVTKz11c3Ivc2hhcmUvbWFuL21hbjEvbmNwbGlzdC4xLmd6CitPTERfRklM RVMrPXVzci9zaGFyZS9tYW4vbWFuMS9uY3Bsb2dpbi4xLmd6CitPTERfRklMRVMrPXVzci9z aGFyZS9tYW4vbWFuMS9uY3Bsb2dvdXQuMS5negorT0xEX0ZJTEVTKz11c3Ivc2hhcmUvbWFu L21hbjgvbW91bnRfbndmcy44Lmd6CiAjIDIwMTIxMDA0OiByZW1vdmUgaW5jb21wbGV0ZSB1 bndpbmQuaAogT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjIvdW53aW5kLmgKICMg MjAxMjA5MDg6IHBmIGNsZWFudXAKSW5kZXg6IHRvb2xzL2J1aWxkL21rL09wdGlvbmFsT2Jz b2xldGVGaWxlcy5pbmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdG9vbHMvYnVpbGQvbWsvT3B0aW9u YWxPYnNvbGV0ZUZpbGVzLmluYwkocmV2aXNpb24gMjQxNjQyKQorKysgdG9vbHMvYnVpbGQv bWsvT3B0aW9uYWxPYnNvbGV0ZUZpbGVzLmluYwkod29ya2luZyBjb3B5KQpAQCAtMzQ1OCw0 NyArMzQ1OCw2IEBACiAjIExpc3RpbmcgYWxsIG9mIHRoZW0gaGVyZSBpcyBvdmVya2lsbC4K ICMuZW5kaWYKIAotLmlmICR7TUtfTkNQfSA9PSBubwotT0xEX0ZJTEVTKz11c3IvYmluL25j cGxpc3QKLU9MRF9GSUxFUys9dXNyL2Jpbi9uY3Bsb2dpbgotT0xEX0ZJTEVTKz11c3IvYmlu L25jcGxvZ291dAotT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9mcy9ud2ZzL253ZnMuaAotT0xE X0ZJTEVTKz11c3IvaW5jbHVkZS9mcy9ud2ZzL253ZnNfbW91bnQuaAotT0xEX0ZJTEVTKz11 c3IvaW5jbHVkZS9mcy9ud2ZzL253ZnNfbm9kZS5oCi1PTERfRklMRVMrPXVzci9pbmNsdWRl L2ZzL253ZnMvbndmc19zdWJyLmgKLSNPTERfRElSUys9dXNyL2luY2x1ZGUvZnMvbndmcwot T0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwLmgKLU9MRF9GSUxFUys9dXNyL2lu Y2x1ZGUvbmV0bmNwL25jcF9jZmcuaAotT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3Av bmNwX2Nvbm4uaAotT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX2ZpbGUuaAot T0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX2xpYi5oCi1PTERfRklMRVMrPXVz ci9pbmNsdWRlL25ldG5jcC9uY3BfbmNwLmgKLU9MRF9GSUxFUys9dXNyL2luY2x1ZGUvbmV0 bmNwL25jcF9ubHMuaAotT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX3JjZmls ZS5oCi1PTERfRklMRVMrPXVzci9pbmNsdWRlL25ldG5jcC9uY3BfcnEuaAotT0xEX0ZJTEVT Kz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwX3NvY2suaAotT0xEX0ZJTEVTKz11c3IvaW5jbHVk ZS9uZXRuY3AvbmNwX3N1YnIuaAotT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNw X3VzZXIuaAotT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbmNwaW8uaAotT0xEX0ZJ TEVTKz11c3IvaW5jbHVkZS9uZXRuY3AvbndlcnJvci5oCi0jT0xEX0RJUlMrPXVzci9pbmNs dWRlL25ldG5jcAotT0xEX0ZJTEVTKz11c3IvbGliL2xpYm5jcC5hCi1PTERfRklMRVMrPXVz ci9saWIvbGlibmNwLnNvCi1PTERfTElCUys9dXNyL2xpYi9saWJuY3Auc28uNAotT0xEX0ZJ TEVTKz11c3IvbGliL2xpYm5jcF9wLmEKLS5pZiAke1RBUkdFVF9BUkNIfSA9PSAiYW1kNjQi IHx8ICR7VEFSR0VUX0FSQ0h9ID09ICJwb3dlcnBjNjQiCi1PTERfRklMRVMrPXVzci9saWIz Mi9saWJuY3AuYQotT0xEX0ZJTEVTKz11c3IvbGliMzIvbGlibmNwLnNvCi1PTERfTElCUys9 dXNyL2xpYjMyL2xpYm5jcC5zby40Ci1PTERfRklMRVMrPXVzci9saWIzMi9saWJuY3BfcC5h Ci0uZW5kaWYKLU9MRF9GSUxFUys9dXNyL3NiaW4vbW91bnRfbndmcwotT0xEX0ZJTEVTKz11 c3Ivc2hhcmUvbWFuL21hbjEvbmNwbGlzdC4xLmd6Ci1PTERfRklMRVMrPXVzci9zaGFyZS9t YW4vbWFuMS9uY3Bsb2dpbi4xLmd6Ci1PTERfRklMRVMrPXVzci9zaGFyZS9tYW4vbWFuMS9u Y3Bsb2dvdXQuMS5negotT0xEX0ZJTEVTKz11c3Ivc2hhcmUvbWFuL21hbjgvbW91bnRfbndm cy44Lmd6Ci0uZW5kaWYKLQogLmlmICR7TUtfTkRJU30gPT0gbm8KIE9MRF9GSUxFUys9dXNy L3NiaW4vbmRpc2N2dAogT0xEX0ZJTEVTKz11c3Ivc2Jpbi9uZGlzZ2VuCg== --------------030207090102060101010503-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 17:48:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5150690A; Wed, 17 Oct 2012 17:48:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B8B468FC08; Wed, 17 Oct 2012 17:48:25 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q9HHmQwp013878; Wed, 17 Oct 2012 20:48:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q9HHmE4A098978; Wed, 17 Oct 2012 20:48:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q9HHmEHi098977; Wed, 17 Oct 2012 20:48:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Oct 2012 20:48:14 +0300 From: Konstantin Belousov To: Maxim Sobolev Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron Message-ID: <20121017174814.GN35915@deviant.kiev.zoral.com.ua> References: <201210170044.q9H0iZHo055977@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="abN2VRGcDj5Z284b" Content-Disposition: inline In-Reply-To: <201210170044.q9H0iZHo055977@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 17:48:27 -0000 --abN2VRGcDj5Z284b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 17, 2012 at 12:44:35AM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Wed Oct 17 00:44:34 2012 > New Revision: 241625 > URL: http://svn.freebsd.org/changeset/base/241625 >=20 > Log: > o Use nanosleep(2) to sleep exact amount of time till the next second, > not multiple of 1 second, which results in actual time to drift back > and forth every run within 1 second of the actual action has > been set for. > =20 > Suggested by: Ian Lepore > =20 > o Schedule the first run in 1 second after starting up, not on the > boundary of the next minute, which results in the every_second jobs > not being run. The cron daemon in HEAD is not functional, i.e. no jobs are executed at all. Reverting r241625 r241618 r241576 gives me the expected behaviour. P.S. I do not remember a single commit from you which did not failed on tinderbox, or was not found buggy later. --abN2VRGcDj5Z284b Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlB+714ACgkQC3+MBN1Mb4htKQCdGDYxyFfwWM3pinev/XmLuIu1 UicAniZT3H49jTVyzDFg+GR0hMZJZMqx =UAEW -----END PGP SIGNATURE----- --abN2VRGcDj5Z284b-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 18:18:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B3D6387; Wed, 17 Oct 2012 18:18:24 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id E1E4D8FC12; Wed, 17 Oct 2012 18:18:22 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so10315372oag.13 for ; Wed, 17 Oct 2012 11:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6Yv1QV3NujzC1PBMIYBlwrTTCWJnyeg5AW4qI3MSr3w=; b=0e3cDKxkIQStcUXUzorJYckna8isq3ryx3jNqP8W8deXR5SfFgBGRgZ1IC7DOzpjdT oCWEZdIBcqz487T0qYyUh2FxSYkC68rTZlOzAOyfIqGzo+MUnluZPBDHFNlwwgDHw0tc 4vKv8Y2b4mpr39BnxYTaJP674xB2wE+6QGcWV/MZZ5j5DQKuLlDJCO3yaSLaBZkLkBXE cAdigANU8IUlHBCTmJaFBSX3sPEKtaNnmUPh43B1LKUlzRFwv82w0ReIk0JSWGl+ZQkb J9uq3m2AxiMZIsemgrph8Z1WC84HRkDZDhzmo/4HExgkyOUnapwATqwaqw7JVLNFhPO4 cxjA== MIME-Version: 1.0 Received: by 10.182.54.103 with SMTP id i7mr15860000obp.62.1350497902511; Wed, 17 Oct 2012 11:18:22 -0700 (PDT) Received: by 10.76.167.202 with HTTP; Wed, 17 Oct 2012 11:18:22 -0700 (PDT) In-Reply-To: <507EEDAD.20201@FreeBSD.org> References: <201210171116.q9HBGHHb057721@svn.freebsd.org> <507EE97F.6010905@FreeBSD.org> <507EEDAD.20201@FreeBSD.org> Date: Wed, 17 Oct 2012 11:18:22 -0700 Message-ID: Subject: Re: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... From: Garrett Cooper To: Andreas Tobler Content-Type: text/plain; charset=ISO-8859-1 Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 18:18:24 -0000 On Wed, Oct 17, 2012 at 10:41 AM, Andreas Tobler wrote: ... > Just to be sure, am I right to move the part from > tools/build/mk/OptionalObsoleteFiles.inc enclosed in the if MK_NCP == no > to the toplevel ObsoleteFiles.inc without any ifdefs. > Iow, the netncp part should go away. > > Attached my trial. LGTM -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 18:21:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BD9756F; Wed, 17 Oct 2012 18:21:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02F0B8FC0C; Wed, 17 Oct 2012 18:21:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HILEGb032425; Wed, 17 Oct 2012 18:21:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HILEL4032423; Wed, 17 Oct 2012 18:21:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201210171821.q9HILEL4032423@svn.freebsd.org> From: Ed Maste Date: Wed, 17 Oct 2012 18:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241643 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 18:21:15 -0000 Author: emaste Date: Wed Oct 17 18:21:14 2012 New Revision: 241643 URL: http://svn.freebsd.org/changeset/base/241643 Log: Avoid panic when a netmap instance cannot obtain memory. A uint32_t is always >= 0. Sponsored by: ADARA Networks Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Wed Oct 17 16:37:16 2012 (r241642) +++ head/sys/dev/netmap/netmap_mem2.c Wed Oct 17 18:21:14 2012 (r241643) @@ -325,7 +325,8 @@ netmap_new_bufs(struct netmap_if *nifp, return; cleanup: - for (i--; i >= 0; i--) { + while (i > 0) { + i--; netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); } } From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 18:46:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91E62C5; Wed, 17 Oct 2012 18:46:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 612AE8FC18; Wed, 17 Oct 2012 18:46:13 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 811D3B9A3; Wed, 17 Oct 2012 14:46:12 -0400 (EDT) From: John Baldwin To: Maksim Yevmenkin Subject: Re: svn commit: r241616 - in head/sys: dev/ixgbe net Date: Wed, 17 Oct 2012 13:20:24 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210162018.q9GKIG9q013028@svn.freebsd.org> <201210170951.23800.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201210171320.24557.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Oct 2012 14:46:12 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 18:46:13 -0000 On Wednesday, October 17, 2012 11:26:21 am Maksim Yevmenkin wrote: > On Wed, Oct 17, 2012 at 6:51 AM, John Baldwin wrote: > > [...] > > >> > Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT. > >> > (It could be a static inline or some such). I would just like to > >> > keep the readability. > >> > >> well, yes, i thought about it, but decided not to do it right away. we > >> could provide shortcuts/macros for "popular" baudrates, i.e. 1, 10, 40 > >> and 100 Gbps. while ixgbe(4) example is not ideal, i thought it still > >> was pretty readable :) > > > > I don't really find it all that readable. IF_Gbps(1) looks like a typo > > to a casual reader. I really think you should have something like: > > [...] > > very well :) would something like (please see below) work? Looks good to me. Thank you. :) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 18:46:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 014B3C7; Wed, 17 Oct 2012 18:46:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C50C18FC19; Wed, 17 Oct 2012 18:46:13 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 26C62B9A4; Wed, 17 Oct 2012 14:46:13 -0400 (EDT) From: John Baldwin To: Nikolay Denev Subject: Re: svn commit: r237656 - in head: contrib/top usr.bin/top Date: Wed, 17 Oct 2012 13:21:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201206271808.q5RI8m0d024853@svn.freebsd.org> <38E42006-48A5-4AF7-9892-EB81583FE5A9@gmail.com> In-Reply-To: <38E42006-48A5-4AF7-9892-EB81583FE5A9@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201210171321.57083.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Oct 2012 14:46:13 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 18:46:14 -0000 On Wednesday, October 17, 2012 11:04:47 am Nikolay Denev wrote: > On Jun 27, 2012, at 9:08 PM, John Baldwin wrote: > > > Author: jhb > > Date: Wed Jun 27 18:08:48 2012 > > New Revision: 237656 > > URL: http://svn.freebsd.org/changeset/base/237656 > > > > Log: > > Add a new line to top that provides a brief summary of the ZFS ARC memory > > usage on hosts using ZFS. The new line displays the total amount of RAM > > used by the ARC along with the size of MFU, MRU, anonymous (in flight), > > headers, and other (miscellaneous) sub-categories. The line is not > > displayed on systems that are not using ZFS. > > > > Reviewed by: avg, fs@ > > MFC after: 3 days > > > > Modified: > > head/contrib/top/display.c > > head/contrib/top/layout.h > > head/contrib/top/machine.h > > head/contrib/top/top.c > > head/usr.bin/top/machine.c > > head/usr.bin/top/top.local.1 > > > > > > Modified: head/usr.bin/top/machine.c > > ============================================================================== > > --- head/usr.bin/top/machine.c Wed Jun 27 17:51:09 2012 (r237655) > > +++ head/usr.bin/top/machine.c Wed Jun 27 18:08:48 2012 (r237656) > > @@ -176,6 +176,12 @@ char *memorynames[] = { > > "K Free", NULL > > }; > > > > +int arc_stats[7]; > > +char *arcnames[] = { > > + "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other", > > + NULL > > +}; > > + > > > > + if (arc_enabled) { > > + GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); > > + arc_stats[0] = arc_stat >> 10; > > + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > > + arc_stats[1] = arc_stat >> 10; > > + GETSYSCTL("vfs.zfs.mru_size", arc_stat); > > + arc_stats[2] = arc_stat >> 10; > > + GETSYSCTL("vfs.zfs.anon_size", arc_stat); > > + arc_stats[3] = arc_stat >> 10; > > + GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); > > + GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc_stat2); > > + arc_stats[4] = arc_stat + arc_stat2 >> 10; > > + GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc_stat); > > + arc_stats[5] = arc_stat >> 10; > > + si->arc = arc_stats; > > + } > > + > > > Hi, > > It looks like MFU and MRU are swapped in top's display. > > I'm using this to correct the output: > > --- /usr/src/.zfs/snapshot/patches/usr.bin/top/machine.c 2012-09-26 08:20:26.000000000 +0200 > +++ usr.bin/top/machine.c 2012-10-17 17:00:14.988895167 +0200 > @@ -515,9 +515,9 @@ > if (arc_enabled) { > GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); > arc_stats[0] = arc_stat >> 10; > - GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > - arc_stats[1] = arc_stat >> 10; > GETSYSCTL("vfs.zfs.mru_size", arc_stat); > + arc_stats[1] = arc_stat >> 10; > + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > arc_stats[2] = arc_stat >> 10; > GETSYSCTL("vfs.zfs.anon_size", arc_stat); > arc_stats[3] = arc_stat >> 10; Doh! Good catch! I think I'd rather swap the display order so MFU is listed before MRU (alphabetical order). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 18:50:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 858948A7; Wed, 17 Oct 2012 18:50:52 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id E76D38FC0A; Wed, 17 Oct 2012 18:50:51 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id v11so9817524vbm.13 for ; Wed, 17 Oct 2012 11:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=jTALlLC9JptUyuog1i0brOeWIBgU7XbzFoFrfYwuhc8=; b=sry7qMOugYUzuq2Jk6bCNXRjG/W0GYJN9Bcs8qy05fEAZ0Dlvdx7LevVFkZ6fLKskR 2mDi9w5hBFnDE2FWxxBnfvH8AG+BTBFh8E9HNFbQXyPM0dvGxVi//xDiPqvk5emlCDK7 J6HZxRyVNVNcLaPbxvhwUaUD8W20dzLt7GorIp3wMIbsb7Frlh7MMFB2iGZX59UY/DF9 5iBSICWg5E+6t2QBB6ImzNeTq9y4gvceQGwhlJr8Dhx0x8crSbZwlzF9lWzRQ3LSh1cn jP9ASqeCRHQ8qfkOetijnvwQhOFK1T0R4I3ATE2BKG+Q8NqytrXuF+r5Vn6/Bdq1wwCu wEnA== MIME-Version: 1.0 Received: by 10.220.150.201 with SMTP id z9mr1252915vcv.70.1350499850165; Wed, 17 Oct 2012 11:50:50 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.150.197 with HTTP; Wed, 17 Oct 2012 11:50:50 -0700 (PDT) In-Reply-To: <507EEDAD.20201@FreeBSD.org> References: <201210171116.q9HBGHHb057721@svn.freebsd.org> <507EE97F.6010905@FreeBSD.org> <507EEDAD.20201@FreeBSD.org> Date: Wed, 17 Oct 2012 19:50:50 +0100 X-Google-Sender-Auth: AKHHHccX8uGrVBi2Ors_qTQHoZo Message-ID: Subject: Re: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... From: Attilio Rao To: Andreas Tobler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 18:50:52 -0000 On Wed, Oct 17, 2012 at 6:41 PM, Andreas Tobler wrote: > On 17.10.12 19:35, Attilio Rao wrote: >> >> On Wed, Oct 17, 2012 at 6:23 PM, Andreas Tobler >> wrote: >>> >>> On 17.10.12 13:16, Attilio Rao wrote: >>>> >>>> >>>> Author: attilio >>>> Date: Wed Oct 17 11:16:17 2012 >>>> New Revision: 241629 >>>> URL: http://svn.freebsd.org/changeset/base/241629 >>>> >>>> Log: >>>> Disconnect non-MPSAFE NWFS from the build in preparation for >>>> dropping >>>> GIANT from VFS. In addition, disconnect also netncp, which is a base >>>> requirement for NWFS. >>>> >>>> In the possibility of a future maintenance of the code and later >>>> readd to the FreeBSD base, maybe we should think about a better >>>> location >>>> for netncp. I'm not entirely sure the / top location is actually >>>> right, >>>> however I will let network people to comment on that more >>>> specifically. >>>> >>>> This is not targeted for MFC. >>> >>> >>> >>> Hi Attilio, >>> >>> I get the following error when running 'make delete-old': >>> >>> [root@tritium] /usr/src/> make delete-old >>> "/export/devel/fbsd/src/tools/build/mk/OptionalObsoleteFiles.inc", line >>> 3461: Malformed conditional (${MK_NCP} == no) >>> "/export/devel/fbsd/src/Makefile.inc1", line 1566: if-less endif >>> make: fatal errors encountered -- cannot continue >>> *** [delete-old] Error code 1 >>> >>> Do we have to remove the stuff in >>> tools/build/mk/OptionalObsoleteFiles.inc too where we have the >>> >>> .if ${MK_NCP} == no >>> ... >>> .endif >>> >>> If so I'm happy to prep a patch, test and commit it. >> >> >> You are indeed right. Please go ahead. > > > Just to be sure, am I right to move the part from > tools/build/mk/OptionalObsoleteFiles.inc enclosed in the if MK_NCP == no > to the toplevel ObsoleteFiles.inc without any ifdefs. > Iow, the netncp part should go away. For the moment we should not move the files yet into ObsoleteFiles.inc. This is done because all the FS removed code will make it into ObsoleteFiles.inc into a separate pass, in 3-4 months, giving people time to possibly fix and re-link a filesystem. What I suggest to do, then, is just axe the OptionalObsoleteFIles.inc part out. I will take care to do the proper ObsoleteFiles.inc move when needed. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 18:57:59 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06A89E35; Wed, 17 Oct 2012 18:57:59 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA7A8FC14; Wed, 17 Oct 2012 18:57:57 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q9HIvt2t059828; Wed, 17 Oct 2012 20:57:55 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <507EFFB3.7080702@FreeBSD.org> Date: Wed, 17 Oct 2012 20:57:55 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241629 - in head: . etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/man/man5 share/man/man7 share/mk sys/conf sys/kern sys/modules usr.... References: <201210171116.q9HBGHHb057721@svn.freebsd.org> <507EE97F.6010905@FreeBSD.org> <507EEDAD.20201@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 18:57:59 -0000 On 17.10.12 20:50, Attilio Rao wrote: > On Wed, Oct 17, 2012 at 6:41 PM, Andreas Tobler wrote: >> On 17.10.12 19:35, Attilio Rao wrote: >>> >>> On Wed, Oct 17, 2012 at 6:23 PM, Andreas Tobler >>> wrote: >>>> >>>> On 17.10.12 13:16, Attilio Rao wrote: >>>>> >>>>> >>>>> Author: attilio >>>>> Date: Wed Oct 17 11:16:17 2012 >>>>> New Revision: 241629 >>>>> URL: http://svn.freebsd.org/changeset/base/241629 >>>>> >>>>> Log: >>>>> Disconnect non-MPSAFE NWFS from the build in preparation for >>>>> dropping >>>>> GIANT from VFS. In addition, disconnect also netncp, which is a base >>>>> requirement for NWFS. >>>>> >>>>> In the possibility of a future maintenance of the code and later >>>>> readd to the FreeBSD base, maybe we should think about a better >>>>> location >>>>> for netncp. I'm not entirely sure the / top location is actually >>>>> right, >>>>> however I will let network people to comment on that more >>>>> specifically. >>>>> >>>>> This is not targeted for MFC. >>>> >>>> >>>> >>>> Hi Attilio, >>>> >>>> I get the following error when running 'make delete-old': >>>> >>>> [root@tritium] /usr/src/> make delete-old >>>> "/export/devel/fbsd/src/tools/build/mk/OptionalObsoleteFiles.inc", line >>>> 3461: Malformed conditional (${MK_NCP} == no) >>>> "/export/devel/fbsd/src/Makefile.inc1", line 1566: if-less endif >>>> make: fatal errors encountered -- cannot continue >>>> *** [delete-old] Error code 1 >>>> >>>> Do we have to remove the stuff in >>>> tools/build/mk/OptionalObsoleteFiles.inc too where we have the >>>> >>>> .if ${MK_NCP} == no >>>> ... >>>> .endif >>>> >>>> If so I'm happy to prep a patch, test and commit it. >>> >>> >>> You are indeed right. Please go ahead. >> >> >> Just to be sure, am I right to move the part from >> tools/build/mk/OptionalObsoleteFiles.inc enclosed in the if MK_NCP == no >> to the toplevel ObsoleteFiles.inc without any ifdefs. >> Iow, the netncp part should go away. > > For the moment we should not move the files yet into > ObsoleteFiles.inc. This is done because all the FS removed code will > make it into ObsoleteFiles.inc into a separate pass, in 3-4 months, > giving people time to possibly fix and re-link a filesystem. > > What I suggest to do, then, is just axe the OptionalObsoleteFIles.inc > part out. I will take care to do the proper ObsoleteFiles.inc move > when needed. Ok. I was testing the removal part. This fortunately delayed the commit ;) I will shortly commit the part from the OptionalObsoleteFiles.inc and leave the ObsoleteFiles.inc as is. Thanks! Andreas From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 19:21:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AAE8073E; Wed, 17 Oct 2012 19:21:53 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 782798FC14; Wed, 17 Oct 2012 19:21:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HJLrQ5044111; Wed, 17 Oct 2012 19:21:53 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HJLrpY044109; Wed, 17 Oct 2012 19:21:53 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201210171921.q9HJLrpY044109@svn.freebsd.org> From: Andreas Tobler Date: Wed, 17 Oct 2012 19:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241645 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 19:21:53 -0000 Author: andreast Date: Wed Oct 17 19:21:52 2012 New Revision: 241645 URL: http://svn.freebsd.org/changeset/base/241645 Log: Remove the netncp and nwfs files from here. They will be moved to the ObsoleteFiles.inc file later. Discussed with: attilio Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 17 19:16:24 2012 (r241644) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 17 19:21:52 2012 (r241645) @@ -3458,47 +3458,6 @@ OLD_FILES+=usr/share/man/man8/mailwrappe # Listing all of them here is overkill. #.endif -.if ${MK_NCP} == no -OLD_FILES+=usr/bin/ncplist -OLD_FILES+=usr/bin/ncplogin -OLD_FILES+=usr/bin/ncplogout -OLD_FILES+=usr/include/fs/nwfs/nwfs.h -OLD_FILES+=usr/include/fs/nwfs/nwfs_mount.h -OLD_FILES+=usr/include/fs/nwfs/nwfs_node.h -OLD_FILES+=usr/include/fs/nwfs/nwfs_subr.h -#OLD_DIRS+=usr/include/fs/nwfs -OLD_FILES+=usr/include/netncp/ncp.h -OLD_FILES+=usr/include/netncp/ncp_cfg.h -OLD_FILES+=usr/include/netncp/ncp_conn.h -OLD_FILES+=usr/include/netncp/ncp_file.h -OLD_FILES+=usr/include/netncp/ncp_lib.h -OLD_FILES+=usr/include/netncp/ncp_ncp.h -OLD_FILES+=usr/include/netncp/ncp_nls.h -OLD_FILES+=usr/include/netncp/ncp_rcfile.h -OLD_FILES+=usr/include/netncp/ncp_rq.h -OLD_FILES+=usr/include/netncp/ncp_sock.h -OLD_FILES+=usr/include/netncp/ncp_subr.h -OLD_FILES+=usr/include/netncp/ncp_user.h -OLD_FILES+=usr/include/netncp/ncpio.h -OLD_FILES+=usr/include/netncp/nwerror.h -#OLD_DIRS+=usr/include/netncp -OLD_FILES+=usr/lib/libncp.a -OLD_FILES+=usr/lib/libncp.so -OLD_LIBS+=usr/lib/libncp.so.4 -OLD_FILES+=usr/lib/libncp_p.a -.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" -OLD_FILES+=usr/lib32/libncp.a -OLD_FILES+=usr/lib32/libncp.so -OLD_LIBS+=usr/lib32/libncp.so.4 -OLD_FILES+=usr/lib32/libncp_p.a -.endif -OLD_FILES+=usr/sbin/mount_nwfs -OLD_FILES+=usr/share/man/man1/ncplist.1.gz -OLD_FILES+=usr/share/man/man1/ncplogin.1.gz -OLD_FILES+=usr/share/man/man1/ncplogout.1.gz -OLD_FILES+=usr/share/man/man8/mount_nwfs.8.gz -.endif - .if ${MK_NDIS} == no OLD_FILES+=usr/sbin/ndiscvt OLD_FILES+=usr/sbin/ndisgen From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 19:24:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1192FDF0; Wed, 17 Oct 2012 19:24:14 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D34E38FC08; Wed, 17 Oct 2012 19:24:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HJODoK044648; Wed, 17 Oct 2012 19:24:13 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HJODvL044644; Wed, 17 Oct 2012 19:24:13 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201210171924.q9HJODvL044644@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 17 Oct 2012 19:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241646 - in head/sys: dev/ixgbe net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 19:24:14 -0000 Author: emax Date: Wed Oct 17 19:24:13 2012 New Revision: 241646 URL: http://svn.freebsd.org/changeset/base/241646 Log: provide helper if_initbaudrate() to set if_baudrate_pf and if_baudrate_pf. again, use ixgbe(4) as an example of how to use new helper function. Reviewed by: jhb MFC after: 1 week Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/net/if.h head/sys/net/if_var.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Oct 17 19:21:52 2012 (r241645) +++ head/sys/dev/ixgbe/ixgbe.c Wed Oct 17 19:24:13 2012 (r241646) @@ -2597,8 +2597,7 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_baudrate = IF_Gbps(1); - ifp->if_baudrate_pf = 1; /* 1Gbps * 10^1 = 10Gbps */ + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Wed Oct 17 19:21:52 2012 (r241645) +++ head/sys/net/if.h Wed Oct 17 19:24:13 2012 (r241646) @@ -179,7 +179,7 @@ struct if_data { * Some convenience macros used for setting ifi_baudrate. * XXX 1000 vs. 1024? --thorpej@netbsd.org */ -#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */ +#define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Oct 17 19:21:52 2012 (r241645) +++ head/sys/net/if_var.h Wed Oct 17 19:24:13 2012 (r241646) @@ -591,6 +591,18 @@ do { \ } while (0) #ifdef _KERNEL +static __inline void +if_initbaudrate(struct ifnet *ifp, uintmax_t baud) +{ + + ifp->if_baudrate_pf = 0; + while (baud > (u_long)(~0UL)) { + baud /= 10; + ifp->if_baudrate_pf++; + } + ifp->if_baudrate = baud; +} + static __inline int drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) { From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:07:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C142F7E3; Wed, 17 Oct 2012 20:07:33 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 979BE8FC0A; Wed, 17 Oct 2012 20:07:33 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TOZtm-000F4E-T9; Wed, 17 Oct 2012 13:07:26 -0700 Message-ID: <507F0FF8.3090602@FreeBSD.org> Date: Wed, 17 Oct 2012 13:07:20 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <20121017174814.GN35915@deviant.kiev.zoral.com.ua> In-Reply-To: <20121017174814.GN35915@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:07:33 -0000 On 10/17/2012 10:48 AM, Konstantin Belousov wrote: > The cron daemon in HEAD is not functional, i.e. no jobs are executed > at all. Reverting r241625 r241618 r241576 gives me the expected behaviour. > > P.S. I do not remember a single commit from you which did not failed on > tinderbox, or was not found buggy later. Should be fixed already in the latest HEAD. Please check and let me know if you still have some issues (send crontab entry which is not getting executed). The particular issue has been fixed in the r241618. Thanks! -Maxim From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:12:22 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 202729BA; Wed, 17 Oct 2012 20:12:22 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id EB7198FC16; Wed, 17 Oct 2012 20:12:21 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TOZyP-000F5r-Vf; Wed, 17 Oct 2012 13:12:14 -0700 Message-ID: <507F111A.10801@FreeBSD.org> Date: Wed, 17 Oct 2012 13:12:10 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <507E6901.8040801@delphij.net> <20121017215857.L4043@besplex.bde.org> In-Reply-To: <20121017215857.L4043@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, d@delphij.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:12:22 -0000 OK, thanks guys for valuable suggestions. Am I correct that the general suggestion is to use clock_gettime(CLOCK_REALTIME) instead of the gettimeofday(), and fix few types here and there? -Maxim From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:15:13 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CEEEB79; Wed, 17 Oct 2012 20:15:13 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 53BB18FC0A; Wed, 17 Oct 2012 20:15:12 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TOa1D-000F9W-9A; Wed, 17 Oct 2012 13:15:07 -0700 Message-ID: <507F11C2.1060301@sippysoft.com> Date: Wed, 17 Oct 2012 13:14:58 -0700 From: Maxim Sobolev Organization: Sippy Software User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <507E6901.8040801@delphij.net> <20121017215857.L4043@besplex.bde.org> <507F111A.10801@FreeBSD.org> In-Reply-To: <507F111A.10801@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ssp-trusted: yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, d@delphij.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:15:13 -0000 Also, I have avoided using FP, since the old code doesn't, and some of the smaller systems we run on (arm, mips) might not have FPU unit, so it might have a problem with that. And I am still working on new version to revert to 60-seconds polling by default. -Maxim From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:18:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B8C3F1F; Wed, 17 Oct 2012 20:18:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 987A58FC0A; Wed, 17 Oct 2012 20:18:14 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q9HKINvF028677; Wed, 17 Oct 2012 23:18:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q9HKIBhh099737; Wed, 17 Oct 2012 23:18:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q9HKIBNZ099736; Wed, 17 Oct 2012 23:18:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Oct 2012 23:18:11 +0300 From: Konstantin Belousov To: Maxim Sobolev Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron Message-ID: <20121017201811.GO35915@deviant.kiev.zoral.com.ua> References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <20121017174814.GN35915@deviant.kiev.zoral.com.ua> <507F0FF8.3090602@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5+h/aC2rZ9d7r+wS" Content-Disposition: inline In-Reply-To: <507F0FF8.3090602@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:18:16 -0000 --5+h/aC2rZ9d7r+wS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 17, 2012 at 01:07:20PM -0700, Maxim Sobolev wrote: > On 10/17/2012 10:48 AM, Konstantin Belousov wrote: > > The cron daemon in HEAD is not functional, i.e. no jobs are executed > > at all. Reverting r241625 r241618 r241576 gives me the expected behavio= ur. > > > > P.S. I do not remember a single commit from you which did not failed on > > tinderbox, or was not found buggy later. >=20 > Should be fixed already in the latest HEAD. Please check and let me know= =20 > if you still have some issues (send crontab entry which is not getting=20 > executed). The particular issue has been fixed in the r241618. Well, as I noted above, I had r241618 applied, since I needed to revert it. For me, neither the standard entries from /etc/crontab, nor the following user crontab: * * * * * /usr/bin/limits -a >/tmp/1.txt are not executing. In particular, the /tmp/1.txt file was not created, and the cron.log was empty. As I said, a reversal of all three commits makes the cron(8) operate correctly. --5+h/aC2rZ9d7r+wS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlB/EoMACgkQC3+MBN1Mb4gBgQCgjKnt7MwLxNMNDBGvI1Sme1io 4PsAoIQz5ZHjiAS4yVJ9sOWvwQvLnnFK =f4MS -----END PGP SIGNATURE----- --5+h/aC2rZ9d7r+wS-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:23:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F151F163; Wed, 17 Oct 2012 20:23:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F348FC12; Wed, 17 Oct 2012 20:23:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HKN7Ur056120; Wed, 17 Oct 2012 20:23:07 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HKN7fX056117; Wed, 17 Oct 2012 20:23:07 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201210172023.q9HKN7fX056117@svn.freebsd.org> From: Ed Maste Date: Wed, 17 Oct 2012 20:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241648 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:23:08 -0000 Author: emaste Date: Wed Oct 17 20:23:07 2012 New Revision: 241648 URL: http://svn.freebsd.org/changeset/base/241648 Log: Avoid potential bad pointer dereference. Previously RuleAdd would leave entry->la unset for the first entry in the proxyList. Sponsored by: ADARA Networks MFC After: 1 week Modified: head/sys/netinet/libalias/alias_proxy.c Modified: head/sys/netinet/libalias/alias_proxy.c ============================================================================== --- head/sys/netinet/libalias/alias_proxy.c Wed Oct 17 20:17:56 2012 (r241647) +++ head/sys/netinet/libalias/alias_proxy.c Wed Oct 17 20:23:07 2012 (r241648) @@ -210,13 +210,13 @@ RuleAdd(struct libalias *la, struct prox LIBALIAS_LOCK_ASSERT(la); + entry->la = la; if (la->proxyList == NULL) { la->proxyList = entry; entry->last = NULL; entry->next = NULL; return; } - entry->la = la; rule_index = entry->rule_index; ptr = la->proxyList; From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:45:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2576D6E2; Wed, 17 Oct 2012 20:45:49 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3E68FC12; Wed, 17 Oct 2012 20:45:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HKjmMo060395; Wed, 17 Oct 2012 20:45:48 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HKjmVr060390; Wed, 17 Oct 2012 20:45:48 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201210172045.q9HKjmVr060390@svn.freebsd.org> From: Maxim Sobolev Date: Wed, 17 Oct 2012 20:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241649 - in head/usr.sbin/cron: cron crontab lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:45:49 -0000 Author: sobomax Date: Wed Oct 17 20:45:48 2012 New Revision: 241649 URL: http://svn.freebsd.org/changeset/base/241649 Log: Revert latest changes to cron, until better version is worked out (I hope). Requested by: few Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Wed Oct 17 20:23:07 2012 (r241648) +++ head/usr.sbin/cron/cron/cron.c Wed Oct 17 20:45:48 2012 (r241649) @@ -98,7 +98,6 @@ main(argc, argv) char *argv[]; { cron_db database; - int runnum; ProgramName = argv[0]; @@ -150,24 +149,21 @@ main(argc, argv) load_database(&database); run_reboot_jobs(&database); cron_sync(); - runnum = 0; while (TRUE) { # if DEBUGGING /* if (!(DebugFlags & DTEST)) */ # endif /*DEBUGGING*/ cron_sleep(&database); - if (runnum % 60 == 0) - load_database(&database); + load_database(&database); /* do this iteration */ cron_tick(&database); - /* sleep 1 second + /* sleep 1 minute */ - TargetTime += 1; - runnum += 1; + TargetTime += 60; } } @@ -198,23 +194,22 @@ cron_tick(db) static time_t diff = 0, /* time difference in seconds from the last offset change */ difflimit = 0; /* end point for the time zone correction */ struct tm otztm; /* time in the old time zone */ - int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; + int otzminute, otzhour, otzdom, otzmonth, otzdow; register struct tm *tm = localtime(&TargetTime); - register int second, minute, hour, dom, month, dow; + register int minute, hour, dom, month, dow; register user *u; register entry *e; /* make 0-based values out of these so we can use them as indicies */ - second = tm->tm_sec -FIRST_SECOND; minute = tm->tm_min -FIRST_MINUTE; hour = tm->tm_hour -FIRST_HOUR; dom = tm->tm_mday -FIRST_DOM; month = tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH; dow = tm->tm_wday -FIRST_DOW; - Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d,%d)\n", - getpid(), second, minute, hour, dom, month, dow)) + Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n", + getpid(), minute, hour, dom, month, dow)) if (dst_enabled && last_time != 0 && TargetTime > last_time /* exclude stepping back */ @@ -267,7 +262,6 @@ cron_tick(db) /* make 0-based values out of these so we can use them as indicies */ - otzsecond = otztm.tm_sec -FIRST_SECOND; otzminute = otztm.tm_min -FIRST_MINUTE; otzhour = otztm.tm_hour -FIRST_HOUR; otzdom = otztm.tm_mday -FIRST_DOM; @@ -289,8 +283,7 @@ cron_tick(db) e->uid, e->gid, e->cmd)) if ( diff != 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { - if (bit_test(e->second, otzsecond) - && bit_test(e->minute, otzminute) + if (bit_test(e->minute, otzminute) && bit_test(e->hour, otzhour) && bit_test(e->month, otzmonth) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) @@ -309,8 +302,7 @@ cron_tick(db) continue; } - if (bit_test(e->second, second) - && bit_test(e->minute, minute) + if (bit_test(e->minute, minute) && bit_test(e->hour, hour) && bit_test(e->month, month) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Wed Oct 17 20:23:07 2012 (r241648) +++ head/usr.sbin/cron/cron/cron.h Wed Oct 17 20:45:48 2012 (r241649) @@ -124,10 +124,6 @@ LineNumber = ln; \ } -#define FIRST_SECOND 0 -#define LAST_SECOND 59 -#define SECOND_COUNT (LAST_SECOND - FIRST_SECOND + 1) - #define FIRST_MINUTE 0 #define LAST_MINUTE 59 #define MINUTE_COUNT (LAST_MINUTE - FIRST_MINUTE + 1) @@ -169,7 +165,6 @@ typedef struct _entry { #endif char **envp; char *cmd; - bitstr_t bit_decl(second, SECOND_COUNT); bitstr_t bit_decl(minute, MINUTE_COUNT); bitstr_t bit_decl(hour, HOUR_COUNT); bitstr_t bit_decl(dom, DOM_COUNT); @@ -181,6 +176,7 @@ typedef struct _entry { #define WHEN_REBOOT 0x04 #define RUN_AT 0x08 #define NOT_UNTIL 0x10 +#define SECONDS_COUNT 0x20 time_t lastrun; } entry; Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Wed Oct 17 20:23:07 2012 (r241648) +++ head/usr.sbin/cron/crontab/crontab.5 Wed Oct 17 20:45:48 2012 (r241649) @@ -232,8 +232,6 @@ string meaning @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *". -@every_minute Run once a minute, "*/1 * * * *". -@every_second Run once a second. .Ed .Sh EXAMPLE CRON FILE .Bd -literal Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Wed Oct 17 20:23:07 2012 (r241648) +++ head/usr.sbin/cron/lib/entry.c Wed Oct 17 20:45:48 2012 (r241649) @@ -151,7 +151,6 @@ load_entry(file, error_func, pw, envp) e->flags |= WHEN_REBOOT; } else if (!strcmp("yearly", cmd) || !strcmp("annually", cmd)){ Debug(DPARS, ("load_entry()...yearly shortcut\n")) - bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_set(e->dom, 0); @@ -160,7 +159,6 @@ load_entry(file, error_func, pw, envp) e->flags |= DOW_STAR; } else if (!strcmp("monthly", cmd)) { Debug(DPARS, ("load_entry()...monthly shortcut\n")) - bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_set(e->dom, 0); @@ -169,7 +167,6 @@ load_entry(file, error_func, pw, envp) e->flags |= DOW_STAR; } else if (!strcmp("weekly", cmd)) { Debug(DPARS, ("load_entry()...weekly shortcut\n")) - bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); @@ -178,7 +175,6 @@ load_entry(file, error_func, pw, envp) bit_set(e->dow, 0); } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) { Debug(DPARS, ("load_entry()...daily shortcut\n")) - bit_set(e->second, 0); bit_set(e->minute, 0); bit_set(e->hour, 0); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); @@ -186,27 +182,11 @@ load_entry(file, error_func, pw, envp) bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else if (!strcmp("hourly", cmd)) { Debug(DPARS, ("load_entry()...hourly shortcut\n")) - bit_set(e->second, 0); bit_set(e->minute, 0); bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); - } else if (!strcmp("every_minute", cmd)) { - Debug(DPARS, ("load_entry()...every_minute shortcut\n")) - bit_set(e->second, 0); - bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); - bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); - bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); - bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); - bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); - } else if (!strcmp("every_second", cmd)) { - Debug(DPARS, ("load_entry()...every_second shortcut\n")) - bit_nset(e->second, 0, (LAST_SECOND-FIRST_SECOND+1)); - bit_nset(e->minute, 0, (LAST_MINUTE-FIRST_MINUTE+1)); - bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); - bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); - bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else { ecode = e_timespec; @@ -222,7 +202,6 @@ load_entry(file, error_func, pw, envp) } } else { Debug(DPARS, ("load_entry()...about to parse numerics\n")) - bit_set(e->second, 0); ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE, PPC_NULL, ch, file); From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 20:47:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B45C86C; Wed, 17 Oct 2012 20:47:05 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id 6227D8FC0A; Wed, 17 Oct 2012 20:47:05 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TOaW8-000FH8-AN; Wed, 17 Oct 2012 13:47:04 -0700 Message-ID: <507F1945.9070808@FreeBSD.org> Date: Wed, 17 Oct 2012 13:47:01 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <20121017174814.GN35915@deviant.kiev.zoral.com.ua> <507F0FF8.3090602@FreeBSD.org> <20121017201811.GO35915@deviant.kiev.zoral.com.ua> In-Reply-To: <20121017201811.GO35915@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 20:47:05 -0000 On 10/17/2012 1:18 PM, Konstantin Belousov wrote: > As I said, a reversal of all three commits makes the cron(8) operate > correctly. Done, sorry. Do you mind if I send you latest version of the patch later for testing? Thanks! -Maxim From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 21:02:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08332F6B; Wed, 17 Oct 2012 21:02:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 627498FC08; Wed, 17 Oct 2012 21:02:41 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q9HL2o8O033329; Thu, 18 Oct 2012 00:02:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q9HL2cMi000103; Thu, 18 Oct 2012 00:02:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q9HL2cDa000102; Thu, 18 Oct 2012 00:02:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Oct 2012 00:02:38 +0300 From: Konstantin Belousov To: Maxim Sobolev Subject: Re: svn commit: r241625 - head/usr.sbin/cron/cron Message-ID: <20121017210238.GP35915@deviant.kiev.zoral.com.ua> References: <201210170044.q9H0iZHo055977@svn.freebsd.org> <20121017174814.GN35915@deviant.kiev.zoral.com.ua> <507F0FF8.3090602@FreeBSD.org> <20121017201811.GO35915@deviant.kiev.zoral.com.ua> <507F1945.9070808@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rTCTeMwohXf/yKXV" Content-Disposition: inline In-Reply-To: <507F1945.9070808@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 21:02:43 -0000 --rTCTeMwohXf/yKXV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 17, 2012 at 01:47:01PM -0700, Maxim Sobolev wrote: > On 10/17/2012 1:18 PM, Konstantin Belousov wrote: > > As I said, a reversal of all three commits makes the cron(8) operate > > correctly. >=20 > Done, sorry. Do you mind if I send you latest version of the patch later= =20 > for testing? Thank you for doing the reversal. Yes, I can try to test your reworked changes later. --rTCTeMwohXf/yKXV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlB/HO4ACgkQC3+MBN1Mb4ieagCfWQNE4NAAQCUO48hSHKZusk62 C4UAoLuz+BXi0uf/O5+t7PtJBay5++Af =bQ5h -----END PGP SIGNATURE----- --rTCTeMwohXf/yKXV-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 21:19:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC110398; Wed, 17 Oct 2012 21:19:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F4478FC08; Wed, 17 Oct 2012 21:19:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HLJRvY066456; Wed, 17 Oct 2012 21:19:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HLJRQP066454; Wed, 17 Oct 2012 21:19:27 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210172119.q9HLJRQP066454@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 17 Oct 2012 21:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241650 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 21:19:27 -0000 Author: glebius Date: Wed Oct 17 21:19:27 2012 New Revision: 241650 URL: http://svn.freebsd.org/changeset/base/241650 Log: Fix VIMAGE build. Reported by: Nikolai Lifanov Pointy hat to: glebius Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Wed Oct 17 20:45:48 2012 (r241649) +++ head/sys/net/if_clone.c Wed Oct 17 21:19:27 2012 (r241650) @@ -272,7 +272,7 @@ if_clone_destroy(const char *name) if (ifc == NULL && !IS_DEFAULT_VNET(curvnet)) { CURVNET_SET_QUIET(vnet0); LIST_FOREACH(ifc, &V_if_cloners, ifc_list) - if (ifc->type == SIMPLE) { + if (ifc->ifc_type == SIMPLE) { if (ifc_simple_match(ifc, name)) break; } else { From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 21:26:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 510EC676; Wed, 17 Oct 2012 21:26:36 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 389C68FC12; Wed, 17 Oct 2012 21:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HLQae7067717; Wed, 17 Oct 2012 21:26:36 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HLQaTZ067715; Wed, 17 Oct 2012 21:26:36 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201210172126.q9HLQaTZ067715@svn.freebsd.org> From: Maxim Sobolev Date: Wed, 17 Oct 2012 21:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241651 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 21:26:36 -0000 Author: sobomax Date: Wed Oct 17 21:26:35 2012 New Revision: 241651 URL: http://svn.freebsd.org/changeset/base/241651 Log: Remove harmless, but superfluous local change that creeped in along with the r241649. Modified: head/usr.sbin/cron/cron/cron.h Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Wed Oct 17 21:19:27 2012 (r241650) +++ head/usr.sbin/cron/cron/cron.h Wed Oct 17 21:26:35 2012 (r241651) @@ -176,7 +176,6 @@ typedef struct _entry { #define WHEN_REBOOT 0x04 #define RUN_AT 0x08 #define NOT_UNTIL 0x10 -#define SECONDS_COUNT 0x20 time_t lastrun; } entry; From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 21:30:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B55A582A; Wed, 17 Oct 2012 21:30:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BAD28FC08; Wed, 17 Oct 2012 21:30:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HLUGEr068386; Wed, 17 Oct 2012 21:30:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HLUGHi068384; Wed, 17 Oct 2012 21:30:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210172130.q9HLUGHi068384@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 17 Oct 2012 21:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241652 - head/sys/dev/nve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 21:30:16 -0000 Author: glebius Date: Wed Oct 17 21:30:16 2012 New Revision: 241652 URL: http://svn.freebsd.org/changeset/base/241652 Log: Don't redefine macros defined in if.h and ethernet.h. Modified: head/sys/dev/nve/if_nvereg.h Modified: head/sys/dev/nve/if_nvereg.h ============================================================================== --- head/sys/dev/nve/if_nvereg.h Wed Oct 17 21:26:35 2012 (r241651) +++ head/sys/dev/nve/if_nvereg.h Wed Oct 17 21:30:16 2012 (r241652) @@ -186,10 +186,6 @@ struct nve_type { #define NVE_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) #define NVE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED) -#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */ -#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ -#define ETHER_ALIGN 2 - extern int ADAPTER_ReadPhy (PVOID pContext, ULONG ulPhyAddr, ULONG ulReg, ULONG *pulVal); extern int ADAPTER_WritePhy (PVOID pContext, ULONG ulPhyAddr, ULONG ulReg, ULONG ulVal); extern int ADAPTER_Init (PVOID pContext, USHORT usForcedSpeed, UCHAR ucForceDpx, UCHAR ucForceMode, UINT *puiLinkState); From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 21:48:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E317014E; Wed, 17 Oct 2012 21:48:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C97648FC12; Wed, 17 Oct 2012 21:48:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HLmjPO071583; Wed, 17 Oct 2012 21:48:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HLmjLf071580; Wed, 17 Oct 2012 21:48:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201210172148.q9HLmjLf071580@svn.freebsd.org> From: Devin Teske Date: Wed, 17 Oct 2012 21:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241653 - in head/usr.sbin/bsdconfig: include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 21:48:46 -0000 Author: dteske Date: Wed Oct 17 21:48:45 2012 New Revision: 241653 URL: http://svn.freebsd.org/changeset/base/241653 Log: Ask to become root via sudo(8) and give user ability to save this preference. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/mustberoot.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Wed Oct 17 21:30:16 2012 (r241652) +++ head/usr.sbin/bsdconfig/include/messages.subr Wed Oct 17 21:48:45 2012 (r241653) @@ -29,8 +29,12 @@ field_username="Username:" field_password="Password:" hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER" hline_arrows_tab_enter="Press arrows, TAB or ENTER" +msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" +msg_becoming_root_via_sudo="Becoming root via sudo(8)..." msg_cancel="Cancel" +msg_cancel_exit="Cancel/Exit" msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied" +msg_created_path="Created %s" msg_directory_not_found="%s: Directory not found." msg_exit="Exit" msg_exit_bsdconfig="Exit bsdconfig" @@ -51,6 +55,8 @@ msg_previous_syntax_errors="%s: Not over msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" msg_secure_mode_requires_root="Secure-mode requires root-access!" msg_sorry_try_again="Sorry, try again." +msg_try_sudo_only_this_once="Try sudo(8) only this once" msg_unknown_user="Unknown user: %s" msg_user_disallowed="User disallowed: %s" msg_yes="Yes" +msg_you_are_not_root_but="You are not root but %s can use sudo(8).\nWhat would you like to do?" Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Wed Oct 17 21:30:16 2012 (r241652) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Wed Oct 17 21:48:45 2012 (r241653) @@ -83,6 +83,65 @@ f_become_root_via_sudo() f_have sudo || f_die 1 "$msg_must_be_root_to_execute" "$pgm" # + # Ask the user if it's OK to become root via sudo(8) and give them + # the option to save this preference (by touch(1)ing a file in the + # user's $HOME directory). + # + local checkpath="${HOME%/}/.bsdconfig_uses_sudo" + if [ ! -e "$checkpath" ]; then + msg=$( printf "$msg_always_try_sudo_when_run_as" "$USER" ) + local menu_list=" + 'X' '$msg_cancel_exit' + '1' '$msg' + '2' '$msg_try_sudo_only_this_once' + " # END-QUOTE + msg=$( printf "$msg_you_are_not_root_but" bsdconfig ) + hline="$hline_arrows_tab_enter" + size=$( eval f_dialog_menu_size \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$msg\" \ + \"\$hline\" \ + $menu_list ) + + local dialog_menu mtag retval + dialog_menu=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --menu \"\$msg\" $size \ + $menu_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + mtag=$( f_dialog_menutag ) + + [ $retval -eq 0 ] || f_die + + case "$mtag" in + X) # Cancel/Exit + f_die ;; + 1) # Always try sudo(8) when run as $user + local err + if ! err=$( touch "$checkpath" 2>&1 ); then + f_show_msg "%s" "$err" + else + f_show_msg "$msg_created_path" "$checkpath" + fi + esac + else + # + # This user has created the path signing-off on sudo(8)-use + # but let's still give them a short/quick/unobtrusive reminder + # + f_dialog_info "$msg_becoming_root_via_sudo" + [ "$USE_XDIALOG" ] || sleep 0.6 + fi + + # # Check sudo(8) access before prompting for password. # :| sudo -S -v 2> /dev/null From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 21:53:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D84C33A8; Wed, 17 Oct 2012 21:53:38 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA8538FC14; Wed, 17 Oct 2012 21:53:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HLrcC2072456; Wed, 17 Oct 2012 21:53:38 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HLrc9v072454; Wed, 17 Oct 2012 21:53:38 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201210172153.q9HLrc9v072454@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 17 Oct 2012 21:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241654 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 21:53:39 -0000 Author: emax Date: Wed Oct 17 21:53:38 2012 New Revision: 241654 URL: http://svn.freebsd.org/changeset/base/241654 Log: fix build MFC after: 1 week Modified: head/contrib/bsnmp/snmp_mibII/mibII.h Modified: head/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.h Wed Oct 17 21:48:45 2012 (r241653) +++ head/contrib/bsnmp/snmp_mibII/mibII.h Wed Oct 17 21:53:38 2012 (r241654) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 22:14:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89EEEA68; Wed, 17 Oct 2012 22:14:10 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70BBF8FC0A; Wed, 17 Oct 2012 22:14:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9HMEA9e075830; Wed, 17 Oct 2012 22:14:10 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9HMEAQo075828; Wed, 17 Oct 2012 22:14:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201210172214.q9HMEAQo075828@svn.freebsd.org> From: Martin Matuska Date: Wed, 17 Oct 2012 22:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241655 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 22:14:10 -0000 Author: mm Date: Wed Oct 17 22:14:09 2012 New Revision: 241655 URL: http://svn.freebsd.org/changeset/base/241655 Log: Add missing initialization for do_prefix. Corrects porting error in r238391 Vendor issue and changeset reference: 2883 changing "canmount" property to "on" should not always remount dataset https://www.illumos.org/issues/2883 Changeset 13743:95aba6e49b9f Reported by: Guido Falsi , avg Obtained from: illumos (issue #2883) MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Oct 17 21:53:38 2012 (r241654) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Oct 17 22:14:09 2012 (r241655) @@ -1446,7 +1446,7 @@ zfs_prop_set(zfs_handle_t *zhp, const ch libzfs_handle_t *hdl = zhp->zfs_hdl; nvlist_t *nvl = NULL, *realprops; zfs_prop_t prop; - boolean_t do_prefix; + boolean_t do_prefix = B_TRUE; uint64_t idx; int added_resv; From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:20:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8932F777; Thu, 18 Oct 2012 00:20:03 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 707048FC08; Thu, 18 Oct 2012 00:20:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0K3nD097378; Thu, 18 Oct 2012 00:20:03 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0K3LU097376; Thu, 18 Oct 2012 00:20:03 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201210180020.q9I0K3LU097376@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 18 Oct 2012 00:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241656 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:20:03 -0000 Author: emax Date: Thu Oct 18 00:20:02 2012 New Revision: 241656 URL: http://svn.freebsd.org/changeset/base/241656 Log: put another bandaid on the build until i figure out bsnmp headers Modified: head/contrib/bsnmp/snmp_mibII/mibII_route.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_route.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_route.c Wed Oct 17 22:14:09 2012 (r241655) +++ head/contrib/bsnmp/snmp_mibII/mibII_route.c Thu Oct 18 00:20:02 2012 (r241656) @@ -30,7 +30,7 @@ * * Routing table */ -#include "support.h" +/*#include "support.h"*/ #ifdef HAVE_SYS_TREE_H #include From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:32:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76A7498B; Thu, 18 Oct 2012 00:32:08 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5309E8FC12; Thu, 18 Oct 2012 00:32:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0W8at099476; Thu, 18 Oct 2012 00:32:08 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0W80r099467; Thu, 18 Oct 2012 00:32:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180032.q9I0W80r099467@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241657 - in head/sys/dev: nvd nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:32:08 -0000 Author: jimharris Date: Thu Oct 18 00:32:07 2012 New Revision: 241657 URL: http://svn.freebsd.org/changeset/base/241657 Log: Add return codes to all functions used for submitting commands to I/O queues. Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ns.c head/sys/dev/nvme/nvme_ns_cmd.c head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_uio.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvd/nvd.c Thu Oct 18 00:32:07 2012 (r241657) @@ -214,9 +214,21 @@ nvd_bioq_process(void *arg, int pending) err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); + /* + * TODO: remove this loop and rely on GEOM's pacing once + * nvme(4) returns ENOMEM only for malloc() failures. + * Currently nvme(4) returns ENOMEM also for cases when + * the submission queue is completely full, and that case + * will be handled more elegantly in a future update. + */ + while (err == ENOMEM) { + pause("nvd enomem", 1); + err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); + } + if (err) { atomic_add_acq_int(&ndisk->cur_depth, -1); - bp->bio_error = EIO; + bp->bio_error = err; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; biodone(bp); Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvme/nvme.c Thu Oct 18 00:32:07 2012 (r241657) @@ -275,6 +275,9 @@ nvme_allocate_tracker(struct nvme_contro tr = nvme_qpair_allocate_tracker(qpair, alloc_prp_list); + if (tr == NULL) + return (NULL); + memset(&tr->cmd, 0, sizeof(tr->cmd)); tr->qpair = qpair; Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvme/nvme.h Thu Oct 18 00:32:07 2012 (r241657) @@ -704,16 +704,16 @@ enum nvme_namespace_flags { }; /* NVM I/O functions */ -void nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload, +int nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload, uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg); -void nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload, +int nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload, uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg); -void nvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload, +int nvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload, uint8_t num_ranges, nvme_cb_fn_t cb_fn, void *cb_arg); -void nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, +int nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg); /* Registration functions */ Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvme/nvme_ns.c Thu Oct 18 00:32:07 2012 (r241657) @@ -160,7 +160,7 @@ nvme_ns_strategy(struct bio *bp) err = nvme_ns_bio_process(ns, bp, nvme_ns_strategy_done); if (err) { - bp->bio_error = EIO; + bp->bio_error = err; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; biodone(bp); @@ -239,25 +239,26 @@ int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, nvme_cb_fn_t cb_fn) { - struct nvme_dsm_range *dsm_range; + struct nvme_dsm_range *dsm_range; + int err; bp->bio_driver1 = cb_fn; switch (bp->bio_cmd) { case BIO_READ: - nvme_ns_cmd_read(ns, bp->bio_data, - bp->bio_offset/nvme_ns_get_sector_size(ns), - bp->bio_bcount/nvme_ns_get_sector_size(ns), - nvme_ns_bio_done, bp); + err = nvme_ns_cmd_read(ns, bp->bio_data, + bp->bio_offset/nvme_ns_get_sector_size(ns), + bp->bio_bcount/nvme_ns_get_sector_size(ns), + nvme_ns_bio_done, bp); break; case BIO_WRITE: - nvme_ns_cmd_write(ns, bp->bio_data, - bp->bio_offset/nvme_ns_get_sector_size(ns), - bp->bio_bcount/nvme_ns_get_sector_size(ns), - nvme_ns_bio_done, bp); + err = nvme_ns_cmd_write(ns, bp->bio_data, + bp->bio_offset/nvme_ns_get_sector_size(ns), + bp->bio_bcount/nvme_ns_get_sector_size(ns), + nvme_ns_bio_done, bp); break; case BIO_FLUSH: - nvme_ns_cmd_flush(ns, nvme_ns_bio_done, bp); + err = nvme_ns_cmd_flush(ns, nvme_ns_bio_done, bp); break; case BIO_DELETE: /* @@ -272,13 +273,17 @@ nvme_ns_bio_process(struct nvme_namespac dsm_range->starting_lba = bp->bio_offset/nvme_ns_get_sector_size(ns); bp->bio_driver2 = dsm_range; - nvme_ns_cmd_deallocate(ns, dsm_range, 1, nvme_ns_bio_done, bp); + err = nvme_ns_cmd_deallocate(ns, dsm_range, 1, + nvme_ns_bio_done, bp); + if (err != 0) + free(dsm_range, M_NVME); break; default: - return (EIO); + err = EIO; + break; } - return (0); + return (err); } #ifdef CHATHAM2 Modified: head/sys/dev/nvme/nvme_ns_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:32:07 2012 (r241657) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" -void +int nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload, uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { @@ -40,6 +40,9 @@ nvme_ns_cmd_read(struct nvme_namespace * tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, lba_count*512, payload); + if (tr == NULL) + return (ENOMEM); + cmd = &tr->cmd; cmd->opc = NVME_OPC_READ; cmd->nsid = ns->id; @@ -52,9 +55,11 @@ nvme_ns_cmd_read(struct nvme_namespace * tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + + return (0); } -void +int nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload, uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { @@ -65,6 +70,9 @@ nvme_ns_cmd_write(struct nvme_namespace tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, lba_count*512, payload); + if (tr == NULL) + return (ENOMEM); + cmd = &tr->cmd; cmd->opc = NVME_OPC_WRITE; cmd->nsid = ns->id; @@ -77,9 +85,11 @@ nvme_ns_cmd_write(struct nvme_namespace tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + + return (0); } -void +int nvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload, uint8_t num_ranges, nvme_cb_fn_t cb_fn, void *cb_arg) { @@ -90,6 +100,9 @@ nvme_ns_cmd_deallocate(struct nvme_names tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, num_ranges * sizeof(struct nvme_dsm_range), payload); + if (tr == NULL) + return (ENOMEM); + cmd = &tr->cmd; cmd->opc = NVME_OPC_DATASET_MANAGEMENT; cmd->nsid = ns->id; @@ -102,9 +115,11 @@ nvme_ns_cmd_deallocate(struct nvme_names tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + + return (0); } -void +int nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_tracker *tr; @@ -112,9 +127,14 @@ nvme_ns_cmd_flush(struct nvme_namespace tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, 0, NULL); + if (tr == NULL) + return (ENOMEM); + cmd = &tr->cmd; cmd->opc = NVME_OPC_FLUSH; cmd->nsid = ns->id; nvme_qpair_submit_cmd(tr->qpair, tr); + + return (0); } Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:32:07 2012 (r241657) @@ -84,10 +84,24 @@ nvme_qpair_allocate_tracker(struct nvme_ tr = SLIST_FIRST(&qpair->free_tr); if (tr == NULL) { - /* TODO: fail if malloc returns NULL */ + /* + * We can't support more trackers than we have entries in + * our queue, because it would generate invalid indices + * into the qpair's active tracker array. + */ + if (qpair->num_tr == qpair->num_entries) { + mtx_unlock(&qpair->lock); + return (NULL); + } + tr = malloc(sizeof(struct nvme_tracker), M_NVME, M_ZERO | M_NOWAIT); + if (tr == NULL) { + mtx_unlock(&qpair->lock); + return (NULL); + } + bus_dmamap_create(qpair->dma_tag, 0, &tr->dma_map); callout_init_mtx(&tr->timer, &qpair->lock, 0); tr->cid = qpair->num_tr++; Modified: head/sys/dev/nvme/nvme_uio.c ============================================================================== --- head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:20:02 2012 (r241656) +++ head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:32:07 2012 (r241657) @@ -64,6 +64,9 @@ nvme_allocate_tracker_uio(struct nvme_co */ tr = nvme_qpair_allocate_tracker(qpair, TRUE /* alloc_prp_list */); + if (tr == NULL) + return (NULL); + memset(&tr->cmd, 0, sizeof(tr->cmd)); tr->qpair = qpair; @@ -80,7 +83,7 @@ nvme_payload_map_uio(void *arg, bus_dma_ nvme_payload_map(arg, seg, nseg, error); } -static void +static int nvme_read_uio(struct nvme_namespace *ns, struct uio *uio) { struct nvme_tracker *tr; @@ -90,6 +93,9 @@ nvme_read_uio(struct nvme_namespace *ns, tr = nvme_allocate_tracker_uio(ns->ctrlr, uio); + if (tr == NULL) + return (ENOMEM); + cmd = &tr->cmd; cmd->opc = NVME_OPC_READ; cmd->nsid = ns->id; @@ -107,9 +113,11 @@ nvme_read_uio(struct nvme_namespace *ns, nvme_payload_map_uio, tr, 0); KASSERT(err == 0, ("bus_dmamap_load_uio returned non-zero!\n")); + + return (0); } -static void +static int nvme_write_uio(struct nvme_namespace *ns, struct uio *uio) { struct nvme_tracker *tr; @@ -119,6 +127,9 @@ nvme_write_uio(struct nvme_namespace *ns tr = nvme_allocate_tracker_uio(ns->ctrlr, uio); + if (tr == NULL) + return (ENOMEM); + cmd = &tr->cmd; cmd->opc = NVME_OPC_WRITE; cmd->nsid = ns->id; @@ -136,6 +147,8 @@ nvme_write_uio(struct nvme_namespace *ns nvme_payload_map_uio, tr, 0); KASSERT(err == 0, ("bus_dmamap_load_uio returned non-zero!\n")); + + return (0); } int @@ -143,6 +156,7 @@ nvme_ns_physio(struct cdev *dev, struct { struct nvme_namespace *ns; struct mtx *mtx; + int err; #if __FreeBSD_version > 900017 int ref; #endif @@ -160,11 +174,12 @@ nvme_ns_physio(struct cdev *dev, struct mtx_lock(mtx); if (uio->uio_rw == UIO_READ) - nvme_read_uio(ns, uio); + err = nvme_read_uio(ns, uio); else - nvme_write_uio(ns, uio); + err = nvme_write_uio(ns, uio); - msleep(uio, mtx, PRIBIO, "nvme_physio", 0); + if (err == 0) + msleep(uio, mtx, PRIBIO, "nvme_physio", 0); mtx_unlock(mtx); #if __FreeBSD_version > 900017 @@ -173,7 +188,8 @@ nvme_ns_physio(struct cdev *dev, struct dev_relthread(dev); #endif - uio->uio_resid = 0; + if (err == 0) + uio->uio_resid = 0; PRELE(curproc); return (0); From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:37:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC83EB3A; Thu, 18 Oct 2012 00:37:11 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A91358FC0A; Thu, 18 Oct 2012 00:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0bBRx000520; Thu, 18 Oct 2012 00:37:11 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0bBLQ000511; Thu, 18 Oct 2012 00:37:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180037.q9I0bBLQ000511@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241658 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:37:11 -0000 Author: jimharris Date: Thu Oct 18 00:37:11 2012 New Revision: 241658 URL: http://svn.freebsd.org/changeset/base/241658 Log: Merge struct nvme_prp_list into struct nvme_tracker. This simplifies the driver significantly where it is constructing commands to be submitted to hardware. By reducing the number of PRPs (NVMe parlance for SGE) from 128 to 32, it ensures we do not allocate too much memory for more common smaller I/O sizes, while still supporting up to 128KB I/O sizes. This also paves the way for pre-allocation of nvme_tracker objects for each queue which will simplify the I/O path even further. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr_cmd.c head/sys/dev/nvme/nvme_ns_cmd.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_sysctl.c head/sys/dev/nvme/nvme_uio.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme.c Thu Oct 18 00:37:11 2012 (r241658) @@ -211,7 +211,6 @@ nvme_payload_map(void *arg, bus_dma_segm { struct nvme_tracker *tr; struct nvme_qpair *qpair; - struct nvme_prp_list *prp_list; uint32_t cur_nseg; KASSERT(error == 0, ("nvme_payload_map error != 0\n")); @@ -230,13 +229,10 @@ nvme_payload_map(void *arg, bus_dma_segm if (nseg == 2) { tr->cmd.prp2 = seg[1].ds_addr; } else if (nseg > 2) { - KASSERT(tr->prp_list, - ("prp_list needed but not attached to tracker\n")); cur_nseg = 1; - prp_list = tr->prp_list; - tr->cmd.prp2 = (uint64_t)prp_list->bus_addr; + tr->cmd.prp2 = (uint64_t)tr->prp_bus_addr; while (cur_nseg < nseg) { - prp_list->prp[cur_nseg-1] = + tr->prp[cur_nseg-1] = (uint64_t)seg[cur_nseg].ds_addr; cur_nseg++; } @@ -251,8 +247,6 @@ nvme_allocate_tracker(struct nvme_contro { struct nvme_tracker *tr; struct nvme_qpair *qpair; - uint32_t modulo, offset, num_prps; - boolean_t alloc_prp_list = FALSE; if (is_admin) { qpair = &ctrlr->adminq; @@ -263,17 +257,7 @@ nvme_allocate_tracker(struct nvme_contro qpair = &ctrlr->ioq[0]; } - num_prps = payload_size / PAGE_SIZE; - modulo = payload_size % PAGE_SIZE; - offset = (uint32_t)((uintptr_t)payload % PAGE_SIZE); - - if (modulo || offset) - num_prps += 1 + (modulo + offset - 1) / PAGE_SIZE; - - if (num_prps > 2) - alloc_prp_list = TRUE; - - tr = nvme_qpair_allocate_tracker(qpair, alloc_prp_list); + tr = nvme_qpair_allocate_tracker(qpair); if (tr == NULL) return (NULL); Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Thu Oct 18 00:37:11 2012 (r241658) @@ -49,7 +49,7 @@ nvme_ctrlr_cmd_identify_controller(struc */ cmd->cdw10 = 1; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -74,7 +74,7 @@ nvme_ctrlr_cmd_identify_namespace(struct */ cmd->nsid = nsid; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -189,8 +189,8 @@ nvme_ctrlr_cmd_set_feature(struct nvme_c cmd->cdw11 = cdw11; if (payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, - payload_size, nvme_payload_map, tr, 0); + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, + payload, payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); } else @@ -215,8 +215,8 @@ nvme_ctrlr_cmd_get_feature(struct nvme_c cmd->cdw11 = cdw11; if (payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, - payload_size, nvme_payload_map, tr, 0); + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, + payload, payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); } else @@ -305,7 +305,7 @@ nvme_ctrlr_cmd_get_health_information_pa cmd->cdw10 = ((sizeof(*payload)/sizeof(uint32_t)) - 1) << 16; cmd->cdw10 |= NVME_LOG_HEALTH_INFORMATION; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, sizeof(*payload), nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); Modified: head/sys/dev/nvme/nvme_ns_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:37:11 2012 (r241658) @@ -51,7 +51,7 @@ nvme_ns_cmd_read(struct nvme_namespace * *(uint64_t *)&cmd->cdw10 = lba; cmd->cdw12 = lba_count-1; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -81,7 +81,7 @@ nvme_ns_cmd_write(struct nvme_namespace *(uint64_t *)&cmd->cdw10 = lba; cmd->cdw12 = lba_count-1; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -111,7 +111,7 @@ nvme_ns_cmd_deallocate(struct nvme_names cmd->cdw10 = num_ranges; cmd->cdw11 = NVME_DSM_ATTR_DEALLOCATE; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->dma_map, payload, + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, tr->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:37:11 2012 (r241658) @@ -55,14 +55,14 @@ MALLOC_DECLARE(M_NVME); #define IDT_PCI_ID 0x80d0111d -#define NVME_MAX_PRP_LIST_ENTRIES (128) +#define NVME_MAX_PRP_LIST_ENTRIES (32) /* * For commands requiring more than 2 PRP entries, one PRP will be * embedded in the command (prp1), and the rest of the PRP entries * will be in a list pointed to by the command (prp2). This means - * that real max number of PRP entries we support is 128+1, which - * results in a max xfer size of 128*PAGE_SIZE. + * that real max number of PRP entries we support is 32+1, which + * results in a max xfer size of 32*PAGE_SIZE. */ #define NVME_MAX_XFER_SIZE NVME_MAX_PRP_LIST_ENTRIES * PAGE_SIZE @@ -92,25 +92,21 @@ MALLOC_DECLARE(M_NVME); #define CACHE_LINE_SIZE (64) #endif -struct nvme_prp_list { - uint64_t prp[NVME_MAX_PRP_LIST_ENTRIES]; - SLIST_ENTRY(nvme_prp_list) slist; - bus_addr_t bus_addr; - bus_dmamap_t dma_map; -}; - struct nvme_tracker { SLIST_ENTRY(nvme_tracker) slist; struct nvme_qpair *qpair; struct nvme_command cmd; struct callout timer; - bus_dmamap_t dma_map; + bus_dmamap_t payload_dma_map; nvme_cb_fn_t cb_fn; void *cb_arg; uint32_t payload_size; - struct nvme_prp_list *prp_list; uint16_t cid; + + uint64_t prp[NVME_MAX_PRP_LIST_ENTRIES]; + bus_addr_t prp_bus_addr; + bus_dmamap_t prp_dma_map; }; struct nvme_qpair { @@ -148,14 +144,11 @@ struct nvme_qpair { uint64_t cpl_bus_addr; uint32_t num_tr; - uint32_t num_prp_list; SLIST_HEAD(, nvme_tracker) free_tr; struct nvme_tracker **act_tr; - SLIST_HEAD(, nvme_prp_list) free_prp_list; - struct mtx lock __aligned(CACHE_LINE_SIZE); } __aligned(CACHE_LINE_SIZE); @@ -347,8 +340,7 @@ void nvme_qpair_construct(struct nvme_qp void nvme_qpair_submit_cmd(struct nvme_qpair *qpair, struct nvme_tracker *tr); void nvme_qpair_process_completions(struct nvme_qpair *qpair); -struct nvme_tracker * nvme_qpair_allocate_tracker(struct nvme_qpair *qpair, - boolean_t alloc_prp_list); +struct nvme_tracker * nvme_qpair_allocate_tracker(struct nvme_qpair *qpair); void nvme_admin_qpair_destroy(struct nvme_qpair *qpair); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:37:11 2012 (r241658) @@ -75,10 +75,9 @@ nvme_completion_check_retry(const struct } struct nvme_tracker * -nvme_qpair_allocate_tracker(struct nvme_qpair *qpair, boolean_t alloc_prp_list) +nvme_qpair_allocate_tracker(struct nvme_qpair *qpair) { struct nvme_tracker *tr; - struct nvme_prp_list *prp_list; mtx_lock(&qpair->lock); @@ -102,33 +101,17 @@ nvme_qpair_allocate_tracker(struct nvme_ return (NULL); } - bus_dmamap_create(qpair->dma_tag, 0, &tr->dma_map); + bus_dmamap_create(qpair->dma_tag, 0, &tr->payload_dma_map); + bus_dmamap_create(qpair->dma_tag, 0, &tr->prp_dma_map); + + bus_dmamap_load(qpair->dma_tag, tr->prp_dma_map, tr->prp, + sizeof(tr->prp), nvme_single_map, &tr->prp_bus_addr, 0); + callout_init_mtx(&tr->timer, &qpair->lock, 0); tr->cid = qpair->num_tr++; } else SLIST_REMOVE_HEAD(&qpair->free_tr, slist); - if (alloc_prp_list) { - prp_list = SLIST_FIRST(&qpair->free_prp_list); - - if (prp_list == NULL) { - prp_list = malloc(sizeof(struct nvme_prp_list), - M_NVME, M_ZERO | M_NOWAIT); - - bus_dmamap_create(qpair->dma_tag, 0, &prp_list->dma_map); - - bus_dmamap_load(qpair->dma_tag, prp_list->dma_map, - prp_list->prp, sizeof(struct nvme_prp_list), - nvme_single_map, &prp_list->bus_addr, 0); - - qpair->num_prp_list++; - } else { - SLIST_REMOVE_HEAD(&qpair->free_prp_list, slist); - } - - tr->prp_list = prp_list; - } - return (tr); } @@ -176,14 +159,9 @@ nvme_qpair_process_completions(struct nv /* nvme_qpair_submit_cmd() will release the lock. */ nvme_qpair_submit_cmd(qpair, tr); else { - if (tr->prp_list) { - SLIST_INSERT_HEAD(&qpair->free_prp_list, - tr->prp_list, slist); - tr->prp_list = NULL; - } - if (tr->payload_size > 0) - bus_dmamap_unload(qpair->dma_tag, tr->dma_map); + bus_dmamap_unload(qpair->dma_tag, + tr->payload_dma_map); SLIST_INSERT_HEAD(&qpair->free_tr, tr, slist); @@ -256,7 +234,6 @@ nvme_qpair_construct(struct nvme_qpair * qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; qpair->num_tr = 0; - qpair->num_prp_list = 0; qpair->sq_head = qpair->sq_tail = qpair->cq_head = 0; /* TODO: error checking on contigmalloc, bus_dmamap_load calls */ @@ -281,7 +258,6 @@ nvme_qpair_construct(struct nvme_qpair * qpair->cq_hdbl_off = nvme_mmio_offsetof(doorbell[id].cq_hdbl); SLIST_INIT(&qpair->free_tr); - SLIST_INIT(&qpair->free_prp_list); qpair->act_tr = malloc(sizeof(struct nvme_tracker *) * qpair->num_entries, M_NVME, M_ZERO | M_NOWAIT); @@ -291,7 +267,6 @@ static void nvme_qpair_destroy(struct nvme_qpair *qpair) { struct nvme_tracker *tr; - struct nvme_prp_list *prp_list; if (qpair->tag) bus_teardown_intr(qpair->ctrlr->dev, qpair->res, qpair->tag); @@ -309,16 +284,10 @@ nvme_qpair_destroy(struct nvme_qpair *qp while (!SLIST_EMPTY(&qpair->free_tr)) { tr = SLIST_FIRST(&qpair->free_tr); SLIST_REMOVE_HEAD(&qpair->free_tr, slist); - bus_dmamap_destroy(qpair->dma_tag, tr->dma_map); + bus_dmamap_destroy(qpair->dma_tag, tr->payload_dma_map); + bus_dmamap_destroy(qpair->dma_tag, tr->prp_dma_map); free(tr, M_NVME); } - - while (!SLIST_EMPTY(&qpair->free_prp_list)) { - prp_list = SLIST_FIRST(&qpair->free_prp_list); - SLIST_REMOVE_HEAD(&qpair->free_prp_list, slist); - bus_dmamap_destroy(qpair->dma_tag, prp_list->dma_map); - free(prp_list, M_NVME); - } } void Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme_sysctl.c Thu Oct 18 00:37:11 2012 (r241658) @@ -195,9 +195,6 @@ nvme_sysctl_initialize_queue(struct nvme SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "num_tr", CTLFLAG_RD, &qpair->num_tr, 0, "Number of trackers allocated"); - SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "num_prp_list", - CTLFLAG_RD, &qpair->num_prp_list, 0, - "Number of PRP lists allocated"); SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "sq_head", CTLFLAG_RD, &qpair->sq_head, 0, "Current head of submission queue (as observed by driver)"); Modified: head/sys/dev/nvme/nvme_uio.c ============================================================================== --- head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:32:07 2012 (r241657) +++ head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:37:11 2012 (r241658) @@ -58,11 +58,7 @@ nvme_allocate_tracker_uio(struct nvme_co else qpair = &ctrlr->ioq[0]; - /* - * For uio, always allocate a PRP list, rather than walking - * the iovecs. - */ - tr = nvme_qpair_allocate_tracker(qpair, TRUE /* alloc_prp_list */); + tr = nvme_qpair_allocate_tracker(qpair); if (tr == NULL) return (NULL); @@ -109,7 +105,7 @@ nvme_read_uio(struct nvme_namespace *ns, cmd->cdw12 = (iosize / nvme_ns_get_sector_size(ns))-1; - err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->dma_map, uio, + err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->payload_dma_map, uio, nvme_payload_map_uio, tr, 0); KASSERT(err == 0, ("bus_dmamap_load_uio returned non-zero!\n")); @@ -143,7 +139,7 @@ nvme_write_uio(struct nvme_namespace *ns cmd->cdw12 = (iosize / nvme_ns_get_sector_size(ns))-1; - err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->dma_map, uio, + err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->payload_dma_map, uio, nvme_payload_map_uio, tr, 0); KASSERT(err == 0, ("bus_dmamap_load_uio returned non-zero!\n")); From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:38:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10EBDD8E; Thu, 18 Oct 2012 00:38:29 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7B598FC17; Thu, 18 Oct 2012 00:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0cSZO000763; Thu, 18 Oct 2012 00:38:28 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0cSDT000756; Thu, 18 Oct 2012 00:38:28 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180038.q9I0cSDT000756@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241659 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:38:29 -0000 Author: jimharris Date: Thu Oct 18 00:38:28 2012 New Revision: 241659 URL: http://svn.freebsd.org/changeset/base/241659 Log: Add struct nvme_request object which contains all of the parameters passed from an NVMe consumer. This allows us to mostly build NVMe command buffers without holding the qpair lock, and also allows for future queueing of nvme_request objects in cases where the submission queue is full and no nvme_tracker objects are available. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr_cmd.c head/sys/dev/nvme/nvme_ns_cmd.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_uio.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Oct 18 00:37:11 2012 (r241658) +++ head/sys/dev/nvme/nvme.c Thu Oct 18 00:38:28 2012 (r241659) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -44,6 +46,8 @@ struct nvme_consumer { struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS]; +uma_zone_t nvme_request_zone; + MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) memory allocations"); static int nvme_probe(device_t); @@ -110,6 +114,23 @@ nvme_probe (device_t device) } static void +nvme_init(void) +{ + nvme_request_zone = uma_zcreate("nvme_request", + sizeof(struct nvme_request), NULL, NULL, NULL, NULL, 0, 0); +} + +SYSINIT(nvme_register, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_init, NULL); + +static void +nvme_uninit(void) +{ + uma_zdestroy(nvme_request_zone); +} + +SYSUNINIT(nvme_unregister, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_uninit, NULL); + +static void nvme_load(void) { } @@ -224,13 +245,13 @@ nvme_payload_map(void *arg, bus_dma_segm * we can safely just transfer each segment to its * associated PRP entry. */ - tr->cmd.prp1 = seg[0].ds_addr; + tr->req->cmd.prp1 = seg[0].ds_addr; if (nseg == 2) { - tr->cmd.prp2 = seg[1].ds_addr; + tr->req->cmd.prp2 = seg[1].ds_addr; } else if (nseg > 2) { cur_nseg = 1; - tr->cmd.prp2 = (uint64_t)tr->prp_bus_addr; + tr->req->cmd.prp2 = (uint64_t)tr->prp_bus_addr; while (cur_nseg < nseg) { tr->prp[cur_nseg-1] = (uint64_t)seg[cur_nseg].ds_addr; @@ -243,7 +264,7 @@ nvme_payload_map(void *arg, bus_dma_segm struct nvme_tracker * nvme_allocate_tracker(struct nvme_controller *ctrlr, boolean_t is_admin, - nvme_cb_fn_t cb_fn, void *cb_arg, uint32_t payload_size, void *payload) + struct nvme_request *req) { struct nvme_tracker *tr; struct nvme_qpair *qpair; @@ -262,12 +283,8 @@ nvme_allocate_tracker(struct nvme_contro if (tr == NULL) return (NULL); - memset(&tr->cmd, 0, sizeof(tr->cmd)); - tr->qpair = qpair; - tr->cb_fn = cb_fn; - tr->cb_arg = cb_arg; - tr->payload_size = payload_size; + tr->req = req; return (tr); } Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Thu Oct 18 00:37:11 2012 (r241658) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Thu Oct 18 00:38:28 2012 (r241659) @@ -33,14 +33,17 @@ void nvme_ctrlr_cmd_identify_controller(struct nvme_controller *ctrlr, void *payload, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, - sizeof(struct nvme_controller_data), payload); + req = nvme_allocate_request(payload, + sizeof(struct nvme_controller_data), cb_fn, cb_arg); - cmd = &tr->cmd; + tr = nvme_allocate_tracker(ctrlr, TRUE, req); + + cmd = &req->cmd; cmd->opc = NVME_OPC_IDENTIFY; /* @@ -50,7 +53,7 @@ nvme_ctrlr_cmd_identify_controller(struc cmd->cdw10 = 1; err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - tr->payload_size, nvme_payload_map, tr, 0); + req->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); } @@ -59,14 +62,17 @@ void nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, uint16_t nsid, void *payload, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, - sizeof(struct nvme_namespace_data), payload); + req = nvme_allocate_request(payload, + sizeof(struct nvme_namespace_data), cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_IDENTIFY; /* @@ -75,7 +81,7 @@ nvme_ctrlr_cmd_identify_namespace(struct cmd->nsid = nsid; err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - tr->payload_size, nvme_payload_map, tr, 0); + req->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); } @@ -85,12 +91,15 @@ nvme_ctrlr_cmd_create_io_cq(struct nvme_ struct nvme_qpair *io_que, uint16_t vector, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, 0, NULL); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_CREATE_IO_CQ; /* @@ -109,12 +118,15 @@ void nvme_ctrlr_cmd_create_io_sq(struct nvme_controller *ctrlr, struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, 0, NULL); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - cmd = &tr->cmd; + tr = nvme_allocate_tracker(ctrlr, TRUE, req); + + cmd = &req->cmd; cmd->opc = NVME_OPC_CREATE_IO_SQ; /* @@ -133,12 +145,15 @@ void nvme_ctrlr_cmd_delete_io_cq(struct nvme_controller *ctrlr, struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, 0, NULL); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_DELETE_IO_CQ; /* @@ -154,12 +169,15 @@ void nvme_ctrlr_cmd_delete_io_sq(struct nvme_controller *ctrlr, struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, 0, NULL); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - cmd = &tr->cmd; + tr = nvme_allocate_tracker(ctrlr, TRUE, req); + + cmd = &req->cmd; cmd->opc = NVME_OPC_DELETE_IO_SQ; /* @@ -176,14 +194,16 @@ nvme_ctrlr_cmd_set_feature(struct nvme_c uint32_t cdw11, void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, - payload_size, payload); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_SET_FEATURES; cmd->cdw10 = feature; cmd->cdw11 = cdw11; @@ -202,14 +222,16 @@ nvme_ctrlr_cmd_get_feature(struct nvme_c uint32_t cdw11, void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, - payload_size, payload); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_GET_FEATURES; cmd->cdw10 = feature; cmd->cdw11 = cdw11; @@ -276,12 +298,15 @@ void nvme_ctrlr_cmd_asynchronous_event_request(struct nvme_controller *ctrlr, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, 0, NULL); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - cmd = &tr->cmd; + tr = nvme_allocate_tracker(ctrlr, TRUE, req); + + cmd = &req->cmd; cmd->opc = NVME_OPC_ASYNC_EVENT_REQUEST; nvme_qpair_submit_cmd(tr->qpair, tr); @@ -292,14 +317,16 @@ nvme_ctrlr_cmd_get_health_information_pa uint32_t nsid, struct nvme_health_information_page *payload, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ctrlr, TRUE, cb_fn, cb_arg, - sizeof(*payload), payload); + req = nvme_allocate_request(payload, sizeof(*payload), cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_GET_LOG_PAGE; cmd->nsid = nsid; cmd->cdw10 = ((sizeof(*payload)/sizeof(uint32_t)) - 1) << 16; Modified: head/sys/dev/nvme/nvme_ns_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:37:11 2012 (r241658) +++ head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:38:28 2012 (r241659) @@ -33,17 +33,19 @@ int nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload, uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, - lba_count*512, payload); + req = nvme_allocate_request(payload, lba_count*512, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); if (tr == NULL) return (ENOMEM); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_READ; cmd->nsid = ns->id; @@ -52,7 +54,7 @@ nvme_ns_cmd_read(struct nvme_namespace * cmd->cdw12 = lba_count-1; err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - tr->payload_size, nvme_payload_map, tr, 0); + req->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -63,17 +65,19 @@ int nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload, uint64_t lba, uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, - lba_count*512, payload); + req = nvme_allocate_request(payload, lba_count*512, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); if (tr == NULL) return (ENOMEM); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_WRITE; cmd->nsid = ns->id; @@ -82,7 +86,7 @@ nvme_ns_cmd_write(struct nvme_namespace cmd->cdw12 = lba_count-1; err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - tr->payload_size, nvme_payload_map, tr, 0); + req->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -93,17 +97,20 @@ int nvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload, uint8_t num_ranges, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err; - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, - num_ranges * sizeof(struct nvme_dsm_range), payload); + req = nvme_allocate_request(payload, + num_ranges * sizeof(struct nvme_dsm_range), cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); if (tr == NULL) return (ENOMEM); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_DATASET_MANAGEMENT; cmd->nsid = ns->id; @@ -112,7 +119,7 @@ nvme_ns_cmd_deallocate(struct nvme_names cmd->cdw11 = NVME_DSM_ATTR_DEALLOCATE; err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - tr->payload_size, nvme_payload_map, tr, 0); + req->payload_size, nvme_payload_map, tr, 0); KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); @@ -122,15 +129,18 @@ nvme_ns_cmd_deallocate(struct nvme_names int nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, cb_fn, cb_arg, 0, NULL); + req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); + + tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); if (tr == NULL) return (ENOMEM); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_FLUSH; cmd->nsid = ns->id; Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:37:11 2012 (r241658) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:38:28 2012 (r241659) @@ -38,6 +38,8 @@ #include #include +#include + #include #include "nvme.h" @@ -92,16 +94,25 @@ MALLOC_DECLARE(M_NVME); #define CACHE_LINE_SIZE (64) #endif +extern uma_zone_t nvme_request_zone; + +struct nvme_request { + + struct nvme_command cmd; + void *payload; + uint32_t payload_size; + nvme_cb_fn_t cb_fn; + void *cb_arg; + SLIST_ENTRY(nvme_request) slist; +}; + struct nvme_tracker { SLIST_ENTRY(nvme_tracker) slist; + struct nvme_request *req; struct nvme_qpair *qpair; - struct nvme_command cmd; struct callout timer; bus_dmamap_t payload_dma_map; - nvme_cb_fn_t cb_fn; - void *cb_arg; - uint32_t payload_size; uint16_t cid; uint64_t prp[NVME_MAX_PRP_LIST_ENTRIES]; @@ -322,9 +333,7 @@ void nvme_ctrlr_cmd_asynchronous_event_r struct nvme_tracker * nvme_allocate_tracker(struct nvme_controller *ctrlr, boolean_t is_admin, - nvme_cb_fn_t cb_fn, void *cb_arg, - uint32_t payload_size, - void *payload); + struct nvme_request *request); void nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error); @@ -364,4 +373,24 @@ nvme_single_map(void *arg, bus_dma_segme *bus_addr = seg[0].ds_addr; } +static __inline struct nvme_request * +nvme_allocate_request(void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, + void *cb_arg) +{ + struct nvme_request *req; + + req = uma_zalloc(nvme_request_zone, M_NOWAIT | M_ZERO); + if (req == NULL) + return (NULL); + + req->payload = payload; + req->payload_size = payload_size; + req->cb_fn = cb_fn; + req->cb_arg = cb_arg; + + return (req); +} + +#define nvme_free_request(req) uma_zfree(nvme_request_zone, req) + #endif /* __NVME_PRIVATE_H__ */ Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:37:11 2012 (r241658) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:38:28 2012 (r241659) @@ -119,6 +119,7 @@ void nvme_qpair_process_completions(struct nvme_qpair *qpair) { struct nvme_tracker *tr; + struct nvme_request *req; struct nvme_completion *cpl; boolean_t retry, error; @@ -131,6 +132,8 @@ nvme_qpair_process_completions(struct nv break; tr = qpair->act_tr[cpl->cid]; + req = tr->req; + KASSERT(tr, ("completion queue has entries but no active trackers\n")); @@ -139,7 +142,7 @@ nvme_qpair_process_completions(struct nv if (error) { nvme_dump_completion(cpl); - nvme_dump_command(&tr->cmd); + nvme_dump_command(&tr->req->cmd); } qpair->act_tr[cpl->cid] = NULL; @@ -147,8 +150,8 @@ nvme_qpair_process_completions(struct nv KASSERT(cpl->cid == tr->cmd.cid, ("cpl cid does not match cmd cid\n")); - if (tr->cb_fn && !retry) - tr->cb_fn(tr->cb_arg, cpl); + if (req->cb_fn && !retry) + req->cb_fn(req->cb_arg, cpl); qpair->sq_head = cpl->sqhd; @@ -159,10 +162,11 @@ nvme_qpair_process_completions(struct nv /* nvme_qpair_submit_cmd() will release the lock. */ nvme_qpair_submit_cmd(qpair, tr); else { - if (tr->payload_size > 0) + if (req->payload_size > 0) bus_dmamap_unload(qpair->dma_tag, tr->payload_dma_map); + nvme_free_request(req); SLIST_INSERT_HEAD(&qpair->free_tr, tr, slist); mtx_unlock(&qpair->lock); @@ -373,8 +377,10 @@ nvme_timeout(void *arg) void nvme_qpair_submit_cmd(struct nvme_qpair *qpair, struct nvme_tracker *tr) { + struct nvme_request *req; - tr->cmd.cid = tr->cid; + req = tr->req; + req->cmd.cid = tr->cid; qpair->act_tr[tr->cid] = tr; /* @@ -393,7 +399,7 @@ nvme_qpair_submit_cmd(struct nvme_qpair callout_reset(&tr->timer, NVME_TIMEOUT_IN_SEC * hz, nvme_timeout, tr); /* Copy the command from the tracker to the submission queue. */ - memcpy(&qpair->cmd[qpair->sq_tail], &tr->cmd, sizeof(tr->cmd)); + memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); if (++qpair->sq_tail == qpair->num_entries) qpair->sq_tail = 0; Modified: head/sys/dev/nvme/nvme_uio.c ============================================================================== --- head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:37:11 2012 (r241658) +++ head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:38:28 2012 (r241659) @@ -48,7 +48,8 @@ nvme_uio_done(void *arg, const struct nv } static struct nvme_tracker * -nvme_allocate_tracker_uio(struct nvme_controller *ctrlr, struct uio *uio) +nvme_allocate_tracker_uio(struct nvme_controller *ctrlr, struct uio *uio, + struct nvme_request *req) { struct nvme_tracker *tr; struct nvme_qpair *qpair; @@ -63,11 +64,8 @@ nvme_allocate_tracker_uio(struct nvme_co if (tr == NULL) return (NULL); - memset(&tr->cmd, 0, sizeof(tr->cmd)); - tr->qpair = qpair; - tr->cb_fn = nvme_uio_done; - tr->cb_arg = uio; + tr->req = req; return (tr); } @@ -82,27 +80,30 @@ nvme_payload_map_uio(void *arg, bus_dma_ static int nvme_read_uio(struct nvme_namespace *ns, struct uio *uio) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err, i; uint64_t lba, iosize = 0; - tr = nvme_allocate_tracker_uio(ns->ctrlr, uio); + for (i = 0; i < uio->uio_iovcnt; i++) { + iosize += uio->uio_iov[i].iov_len; + } + + req = nvme_allocate_request(NULL, iosize, nvme_uio_done, uio); + + tr = nvme_allocate_tracker_uio(ns->ctrlr, uio, req); if (tr == NULL) return (ENOMEM); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_READ; cmd->nsid = ns->id; lba = uio->uio_offset / nvme_ns_get_sector_size(ns); *(uint64_t *)&cmd->cdw10 = lba; - for (i = 0; i < uio->uio_iovcnt; i++) { - iosize += uio->uio_iov[i].iov_len; - } - cmd->cdw12 = (iosize / nvme_ns_get_sector_size(ns))-1; err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->payload_dma_map, uio, @@ -116,27 +117,30 @@ nvme_read_uio(struct nvme_namespace *ns, static int nvme_write_uio(struct nvme_namespace *ns, struct uio *uio) { + struct nvme_request *req; struct nvme_tracker *tr; struct nvme_command *cmd; int err, i; uint64_t lba, iosize = 0; - tr = nvme_allocate_tracker_uio(ns->ctrlr, uio); + for (i = 0; i < uio->uio_iovcnt; i++) { + iosize += uio->uio_iov[i].iov_len; + } + + req = nvme_allocate_request(NULL, iosize, nvme_uio_done, uio); + + tr = nvme_allocate_tracker_uio(ns->ctrlr, uio, req); if (tr == NULL) return (ENOMEM); - cmd = &tr->cmd; + cmd = &req->cmd; cmd->opc = NVME_OPC_WRITE; cmd->nsid = ns->id; lba = uio->uio_offset / nvme_ns_get_sector_size(ns); *(uint64_t *)&cmd->cdw10 = lba; - for (i = 0; i < uio->uio_iovcnt; i++) { - iosize += uio->uio_iov[i].iov_len; - } - cmd->cdw12 = (iosize / nvme_ns_get_sector_size(ns))-1; err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->payload_dma_map, uio, From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:39:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5196BF05; Thu, 18 Oct 2012 00:39:30 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34E748FC08; Thu, 18 Oct 2012 00:39:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0dUcK000958; Thu, 18 Oct 2012 00:39:30 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0dU62000950; Thu, 18 Oct 2012 00:39:30 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180039.q9I0dU62000950@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241660 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:39:30 -0000 Author: jimharris Date: Thu Oct 18 00:39:29 2012 New Revision: 241660 URL: http://svn.freebsd.org/changeset/base/241660 Log: Add nvme_ctrlr_submit_[admin|io]_request functions which consolidates code for allocating nvme_tracker objects and making calls into bus_dmamap_load for commands which have payloads. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ctrlr_cmd.c head/sys/dev/nvme/nvme_ns_cmd.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Oct 18 00:38:28 2012 (r241659) +++ head/sys/dev/nvme/nvme.c Thu Oct 18 00:39:29 2012 (r241660) @@ -262,33 +262,6 @@ nvme_payload_map(void *arg, bus_dma_segm nvme_qpair_submit_cmd(qpair, tr); } -struct nvme_tracker * -nvme_allocate_tracker(struct nvme_controller *ctrlr, boolean_t is_admin, - struct nvme_request *req) -{ - struct nvme_tracker *tr; - struct nvme_qpair *qpair; - - if (is_admin) { - qpair = &ctrlr->adminq; - } else { - if (ctrlr->per_cpu_io_queues) - qpair = &ctrlr->ioq[curcpu]; - else - qpair = &ctrlr->ioq[0]; - } - - tr = nvme_qpair_allocate_tracker(qpair); - - if (tr == NULL) - return (NULL); - - tr->qpair = qpair; - tr->req = req; - - return (tr); -} - static int nvme_attach(device_t dev) { Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:38:28 2012 (r241659) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:39:29 2012 (r241660) @@ -791,3 +791,54 @@ intx: return (0); } + +void +nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr, + struct nvme_request *req) +{ + struct nvme_qpair *qpair; + struct nvme_tracker *tr; + int err; + + qpair = &ctrlr->adminq; + + tr = nvme_qpair_allocate_tracker(qpair); + + tr->req = req; + + if (req->payload_size > 0) { + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, + req->payload, req->payload_size, + nvme_payload_map, tr, 0); + if (err != 0) + panic("bus_dmamap_load returned non-zero!\n"); + } else + nvme_qpair_submit_cmd(tr->qpair, tr); +} + +void +nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr, + struct nvme_request *req) +{ + struct nvme_qpair *qpair; + struct nvme_tracker *tr; + int err; + + if (ctrlr->per_cpu_io_queues) + qpair = &ctrlr->ioq[curcpu]; + else + qpair = &ctrlr->ioq[0]; + + tr = nvme_qpair_allocate_tracker(qpair); + + tr->req = req; + + if (req->payload_size > 0) { + err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, + req->payload, req->payload_size, + nvme_payload_map, tr, 0); + if (err != 0) + panic("bus_dmamap_load returned non-zero!\n"); + } else + nvme_qpair_submit_cmd(tr->qpair, tr); +} Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Thu Oct 18 00:38:28 2012 (r241659) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Thu Oct 18 00:39:29 2012 (r241660) @@ -34,15 +34,11 @@ nvme_ctrlr_cmd_identify_controller(struc nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(payload, sizeof(struct nvme_controller_data), cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_IDENTIFY; @@ -52,10 +48,7 @@ nvme_ctrlr_cmd_identify_controller(struc */ cmd->cdw10 = 1; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - req->payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -63,15 +56,11 @@ nvme_ctrlr_cmd_identify_namespace(struct void *payload, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(payload, sizeof(struct nvme_namespace_data), cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_IDENTIFY; @@ -80,10 +69,7 @@ nvme_ctrlr_cmd_identify_namespace(struct */ cmd->nsid = nsid; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - req->payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -92,13 +78,10 @@ nvme_ctrlr_cmd_create_io_cq(struct nvme_ void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_CREATE_IO_CQ; @@ -111,7 +94,7 @@ nvme_ctrlr_cmd_create_io_cq(struct nvme_ cmd->cdw11 = (vector << 16) | 0x3; cmd->prp1 = io_que->cpl_bus_addr; - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -119,13 +102,10 @@ nvme_ctrlr_cmd_create_io_sq(struct nvme_ struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_CREATE_IO_SQ; @@ -138,7 +118,7 @@ nvme_ctrlr_cmd_create_io_sq(struct nvme_ cmd->cdw11 = (io_que->id << 16) | 0x1; cmd->prp1 = io_que->cmd_bus_addr; - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -146,13 +126,10 @@ nvme_ctrlr_cmd_delete_io_cq(struct nvme_ struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_DELETE_IO_CQ; @@ -162,7 +139,7 @@ nvme_ctrlr_cmd_delete_io_cq(struct nvme_ */ cmd->cdw10 = io_que->id; - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -170,13 +147,10 @@ nvme_ctrlr_cmd_delete_io_sq(struct nvme_ struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_DELETE_IO_SQ; @@ -186,7 +160,7 @@ nvme_ctrlr_cmd_delete_io_sq(struct nvme_ */ cmd->cdw10 = io_que->id; - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -195,26 +169,16 @@ nvme_ctrlr_cmd_set_feature(struct nvme_c nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_SET_FEATURES; cmd->cdw10 = feature; cmd->cdw11 = cdw11; - if (payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, - payload, payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); - } else - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -223,26 +187,16 @@ nvme_ctrlr_cmd_get_feature(struct nvme_c nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_GET_FEATURES; cmd->cdw10 = feature; cmd->cdw11 = cdw11; - if (payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, - payload, payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); - } else - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -299,17 +253,14 @@ nvme_ctrlr_cmd_asynchronous_event_reques nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_ASYNC_EVENT_REQUEST; - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_admin_request(ctrlr, req); } void @@ -318,22 +269,15 @@ nvme_ctrlr_cmd_get_health_information_pa nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(payload, sizeof(*payload), cb_fn, cb_arg); - tr = nvme_allocate_tracker(ctrlr, TRUE, req); - cmd = &req->cmd; cmd->opc = NVME_OPC_GET_LOG_PAGE; cmd->nsid = nsid; cmd->cdw10 = ((sizeof(*payload)/sizeof(uint32_t)) - 1) << 16; cmd->cdw10 |= NVME_LOG_HEALTH_INFORMATION; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - sizeof(*payload), nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + nvme_ctrlr_submit_admin_request(ctrlr, req); } Modified: head/sys/dev/nvme/nvme_ns_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:38:28 2012 (r241659) +++ head/sys/dev/nvme/nvme_ns_cmd.c Thu Oct 18 00:39:29 2012 (r241660) @@ -34,17 +34,12 @@ nvme_ns_cmd_read(struct nvme_namespace * uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(payload, lba_count*512, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); - - if (tr == NULL) + if (req == NULL) return (ENOMEM); - cmd = &req->cmd; cmd->opc = NVME_OPC_READ; cmd->nsid = ns->id; @@ -53,10 +48,7 @@ nvme_ns_cmd_read(struct nvme_namespace * *(uint64_t *)&cmd->cdw10 = lba; cmd->cdw12 = lba_count-1; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - req->payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); } @@ -66,15 +58,11 @@ nvme_ns_cmd_write(struct nvme_namespace uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(payload, lba_count*512, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); - - if (tr == NULL) + if (req == NULL) return (ENOMEM); cmd = &req->cmd; @@ -85,10 +73,7 @@ nvme_ns_cmd_write(struct nvme_namespace *(uint64_t *)&cmd->cdw10 = lba; cmd->cdw12 = lba_count-1; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - req->payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); } @@ -98,16 +83,12 @@ nvme_ns_cmd_deallocate(struct nvme_names uint8_t num_ranges, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err; req = nvme_allocate_request(payload, num_ranges * sizeof(struct nvme_dsm_range), cb_fn, cb_arg); - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); - - if (tr == NULL) + if (req == NULL) return (ENOMEM); cmd = &req->cmd; @@ -118,10 +99,7 @@ nvme_ns_cmd_deallocate(struct nvme_names cmd->cdw10 = num_ranges; cmd->cdw11 = NVME_DSM_ATTR_DEALLOCATE; - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, payload, - req->payload_size, nvme_payload_map, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load returned non-zero!\n")); + nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); } @@ -130,21 +108,18 @@ int nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; req = nvme_allocate_request(NULL, 0, cb_fn, cb_arg); - tr = nvme_allocate_tracker(ns->ctrlr, FALSE, req); - - if (tr == NULL) + if (req == NULL) return (ENOMEM); cmd = &req->cmd; cmd->opc = NVME_OPC_FLUSH; cmd->nsid = ns->id; - nvme_qpair_submit_cmd(tr->qpair, tr); + nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:38:28 2012 (r241659) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:39:29 2012 (r241660) @@ -331,9 +331,6 @@ void nvme_ctrlr_cmd_asynchronous_event_r nvme_cb_fn_t cb_fn, void *cb_arg); -struct nvme_tracker * nvme_allocate_tracker(struct nvme_controller *ctrlr, - boolean_t is_admin, - struct nvme_request *request); void nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error); @@ -341,6 +338,10 @@ int nvme_ctrlr_construct(struct nvme_con int nvme_ctrlr_reset(struct nvme_controller *ctrlr); /* ctrlr defined as void * to allow use with config_intrhook. */ void nvme_ctrlr_start(void *ctrlr_arg); +void nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr, + struct nvme_request *req); +void nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr, + struct nvme_request *req); void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:38:28 2012 (r241659) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:39:29 2012 (r241660) @@ -109,6 +109,7 @@ nvme_qpair_allocate_tracker(struct nvme_ callout_init_mtx(&tr->timer, &qpair->lock, 0); tr->cid = qpair->num_tr++; + tr->qpair = qpair; } else SLIST_REMOVE_HEAD(&qpair->free_tr, slist); From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:40:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E546DF2; Thu, 18 Oct 2012 00:40:41 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9E68FC08; Thu, 18 Oct 2012 00:40:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0efg1001235; Thu, 18 Oct 2012 00:40:41 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0efvo001229; Thu, 18 Oct 2012 00:40:41 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180040.q9I0efvo001229@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241661 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:40:42 -0000 Author: jimharris Date: Thu Oct 18 00:40:40 2012 New Revision: 241661 URL: http://svn.freebsd.org/changeset/base/241661 Log: Cleanup uio-related code to use struct nvme_request and nvme_ctrlr_submit_io_request(). While here, also fix case where a uio may have more than 1 iovec. NVMe's definition of SGEs (called PRPs) only allows for the first SGE to start on a non-page boundary. The simplest way to handle this is to construct a temporary uio for each iovec, and submit an NVMe request for each. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_uio.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Oct 18 00:39:29 2012 (r241660) +++ head/sys/dev/nvme/nvme.c Thu Oct 18 00:40:40 2012 (r241661) @@ -230,15 +230,11 @@ nvme_dump_completion(struct nvme_complet void nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) { - struct nvme_tracker *tr; - struct nvme_qpair *qpair; + struct nvme_tracker *tr = arg; uint32_t cur_nseg; KASSERT(error == 0, ("nvme_payload_map error != 0\n")); - tr = (struct nvme_tracker *)arg; - qpair = tr->qpair; - /* * Note that we specified PAGE_SIZE for alignment and max * segment size when creating the bus dma tags. So here @@ -259,7 +255,7 @@ nvme_payload_map(void *arg, bus_dma_segm } } - nvme_qpair_submit_cmd(qpair, tr); + nvme_qpair_submit_cmd(tr->qpair, tr); } static int Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:39:29 2012 (r241660) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:40:40 2012 (r241661) @@ -833,12 +833,21 @@ nvme_ctrlr_submit_io_request(struct nvme tr->req = req; - if (req->payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, - req->payload, req->payload_size, - nvme_payload_map, tr, 0); + if (req->uio == NULL) { + if (req->payload_size > 0) { + err = bus_dmamap_load(tr->qpair->dma_tag, + tr->payload_dma_map, req->payload, + req->payload_size, + nvme_payload_map, tr, 0); + if (err != 0) + panic("bus_dmamap_load returned non-zero!\n"); + } else + nvme_qpair_submit_cmd(tr->qpair, tr); + } else { + err = bus_dmamap_load_uio(tr->qpair->dma_tag, + tr->payload_dma_map, req->uio, + nvme_payload_map_uio, tr, 0); if (err != 0) panic("bus_dmamap_load returned non-zero!\n"); - } else - nvme_qpair_submit_cmd(tr->qpair, tr); + } } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:39:29 2012 (r241660) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:40:40 2012 (r241661) @@ -101,6 +101,7 @@ struct nvme_request { struct nvme_command cmd; void *payload; uint32_t payload_size; + struct uio *uio; nvme_cb_fn_t cb_fn; void *cb_arg; SLIST_ENTRY(nvme_request) slist; @@ -333,6 +334,8 @@ void nvme_ctrlr_cmd_asynchronous_event_r void nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error); +void nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, + bus_size_t mapsize, int error); int nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev); int nvme_ctrlr_reset(struct nvme_controller *ctrlr); @@ -392,6 +395,22 @@ nvme_allocate_request(void *payload, uin return (req); } +static __inline struct nvme_request * +nvme_allocate_request_uio(struct uio *uio, nvme_cb_fn_t cb_fn, void *cb_arg) +{ + struct nvme_request *req; + + req = uma_zalloc(nvme_request_zone, M_NOWAIT | M_ZERO); + if (req == NULL) + return (NULL); + + req->uio = uio; + req->cb_fn = cb_fn; + req->cb_arg = cb_arg; + + return (req); +} + #define nvme_free_request(req) uma_zfree(nvme_request_zone, req) #endif /* __NVME_PRIVATE_H__ */ Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:39:29 2012 (r241660) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:40:40 2012 (r241661) @@ -163,7 +163,7 @@ nvme_qpair_process_completions(struct nv /* nvme_qpair_submit_cmd() will release the lock. */ nvme_qpair_submit_cmd(qpair, tr); else { - if (req->payload_size > 0) + if (req->payload_size > 0 || req->uio != NULL) bus_dmamap_unload(qpair->dma_tag, tr->payload_dma_map); Modified: head/sys/dev/nvme/nvme_uio.c ============================================================================== --- head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:39:29 2012 (r241660) +++ head/sys/dev/nvme/nvme_uio.c Thu Oct 18 00:40:40 2012 (r241661) @@ -38,8 +38,10 @@ static void nvme_uio_done(void *arg, const struct nvme_completion *status) { struct mtx *mtx; + struct uio *uio = arg; - /* TODO: update uio flags based on status */ + if (status->sf_sc == 0 && status->sf_sct == 0) + uio->uio_resid = 0; mtx = mtx_pool_find(mtxpool_sleep, arg); mtx_lock(mtx); @@ -47,33 +49,17 @@ nvme_uio_done(void *arg, const struct nv mtx_unlock(mtx); } -static struct nvme_tracker * -nvme_allocate_tracker_uio(struct nvme_controller *ctrlr, struct uio *uio, - struct nvme_request *req) -{ - struct nvme_tracker *tr; - struct nvme_qpair *qpair; - - if (ctrlr->per_cpu_io_queues) - qpair = &ctrlr->ioq[curcpu]; - else - qpair = &ctrlr->ioq[0]; - - tr = nvme_qpair_allocate_tracker(qpair); - - if (tr == NULL) - return (NULL); - - tr->qpair = qpair; - tr->req = req; - - return (tr); -} - -static void +void nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, bus_size_t mapsize, int error) { + struct nvme_tracker *tr = arg; + + /* + * Now that we know the actual size of the uio, divide it by the + * sector size that we stored in cdw12. + */ + tr->req->cmd.cdw12 = (mapsize / tr->req->cmd.cdw12)-1; nvme_payload_map(arg, seg, nseg, error); } @@ -81,20 +67,12 @@ static int nvme_read_uio(struct nvme_namespace *ns, struct uio *uio) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err, i; - uint64_t lba, iosize = 0; - - for (i = 0; i < uio->uio_iovcnt; i++) { - iosize += uio->uio_iov[i].iov_len; - } - - req = nvme_allocate_request(NULL, iosize, nvme_uio_done, uio); + uint64_t lba; - tr = nvme_allocate_tracker_uio(ns->ctrlr, uio, req); + req = nvme_allocate_request_uio(uio, nvme_uio_done, uio); - if (tr == NULL) + if (req == NULL) return (ENOMEM); cmd = &req->cmd; @@ -103,13 +81,16 @@ nvme_read_uio(struct nvme_namespace *ns, lba = uio->uio_offset / nvme_ns_get_sector_size(ns); *(uint64_t *)&cmd->cdw10 = lba; + /* + * Store the sector size in cdw12 (where the LBA count normally goes). + * We'll adjust cdw12 in the map_uio callback based on the mapsize + * parameter. This allows us to not have to store the namespace + * in the request simply to get the sector size in the map_uio + * callback. + */ + cmd->cdw12 = nvme_ns_get_sector_size(ns); - cmd->cdw12 = (iosize / nvme_ns_get_sector_size(ns))-1; - - err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->payload_dma_map, uio, - nvme_payload_map_uio, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load_uio returned non-zero!\n")); + nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); } @@ -118,20 +99,12 @@ static int nvme_write_uio(struct nvme_namespace *ns, struct uio *uio) { struct nvme_request *req; - struct nvme_tracker *tr; struct nvme_command *cmd; - int err, i; - uint64_t lba, iosize = 0; + uint64_t lba; - for (i = 0; i < uio->uio_iovcnt; i++) { - iosize += uio->uio_iov[i].iov_len; - } - - req = nvme_allocate_request(NULL, iosize, nvme_uio_done, uio); - - tr = nvme_allocate_tracker_uio(ns->ctrlr, uio, req); + req = nvme_allocate_request_uio(uio, nvme_uio_done, uio); - if (tr == NULL) + if (req == NULL) return (ENOMEM); cmd = &req->cmd; @@ -140,13 +113,16 @@ nvme_write_uio(struct nvme_namespace *ns lba = uio->uio_offset / nvme_ns_get_sector_size(ns); *(uint64_t *)&cmd->cdw10 = lba; + /* + * Store the sector size in cdw12 (where the LBA count normally goes). + * We'll adjust cdw12 in the map_uio callback based on the mapsize + * parameter. This allows us to not have to store the namespace + * in the request simply to get the sector size in the map_uio + * callback. + */ + cmd->cdw12 = nvme_ns_get_sector_size(ns); - cmd->cdw12 = (iosize / nvme_ns_get_sector_size(ns))-1; - - err = bus_dmamap_load_uio(tr->qpair->dma_tag, tr->payload_dma_map, uio, - nvme_payload_map_uio, tr, 0); - - KASSERT(err == 0, ("bus_dmamap_load_uio returned non-zero!\n")); + nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); } @@ -154,9 +130,11 @@ nvme_write_uio(struct nvme_namespace *ns int nvme_ns_physio(struct cdev *dev, struct uio *uio, int ioflag) { + struct uio uio_tmp; + struct iovec uio_iov_tmp; struct nvme_namespace *ns; struct mtx *mtx; - int err; + int i, nvme_err, physio_err = 0; #if __FreeBSD_version > 900017 int ref; #endif @@ -164,7 +142,7 @@ nvme_ns_physio(struct cdev *dev, struct PHOLD(curproc); ns = dev->si_drv1; - mtx = mtx_pool_find(mtxpool_sleep, uio); + mtx = mtx_pool_find(mtxpool_sleep, &uio_tmp); #if __FreeBSD_version > 900017 dev_refthread(dev, &ref); @@ -172,15 +150,48 @@ nvme_ns_physio(struct cdev *dev, struct dev_refthread(dev); #endif - mtx_lock(mtx); - if (uio->uio_rw == UIO_READ) - err = nvme_read_uio(ns, uio); - else - err = nvme_write_uio(ns, uio); + /* + * NVM Express doesn't really support true SGLs. All SG elements + * must be PAGE_SIZE, except for the first and last element. + * Because of this, we need to break up each iovec into a separate + * NVMe command - otherwise we could end up with sub-PAGE_SIZE + * elements in the middle of an SGL which is not allowed. + */ + uio_tmp.uio_iov = &uio_iov_tmp; + uio_tmp.uio_iovcnt = 1; + uio_tmp.uio_offset = uio->uio_offset; + uio_tmp.uio_segflg = uio->uio_segflg; + uio_tmp.uio_rw = uio->uio_rw; + uio_tmp.uio_td = uio->uio_td; - if (err == 0) - msleep(uio, mtx, PRIBIO, "nvme_physio", 0); - mtx_unlock(mtx); + for (i = 0; i < uio->uio_iovcnt; i++) { + + uio_iov_tmp.iov_base = uio->uio_iov[i].iov_base; + uio_iov_tmp.iov_len = uio->uio_iov[i].iov_len; + uio_tmp.uio_resid = uio_iov_tmp.iov_len; + + mtx_lock(mtx); + + if (uio->uio_rw == UIO_READ) + nvme_err = nvme_read_uio(ns, &uio_tmp); + else + nvme_err = nvme_write_uio(ns, &uio_tmp); + + if (nvme_err == 0) + msleep(&uio_tmp, mtx, PRIBIO, "nvme_physio", 0); + + mtx_unlock(mtx); + + if (uio_tmp.uio_resid == 0) { + uio->uio_resid -= uio_iov_tmp.iov_len; + uio->uio_offset += uio_iov_tmp.iov_len; + } else { + physio_err = EFAULT; + break; + } + + uio_tmp.uio_offset += uio_iov_tmp.iov_len; + } #if __FreeBSD_version > 900017 dev_relthread(dev, ref); @@ -188,9 +199,6 @@ nvme_ns_physio(struct cdev *dev, struct dev_relthread(dev); #endif - if (err == 0) - uio->uio_resid = 0; - PRELE(curproc); - return (0); + return (physio_err); } From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:41:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36346262; Thu, 18 Oct 2012 00:41:32 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02DE88FC12; Thu, 18 Oct 2012 00:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0fVxT001420; Thu, 18 Oct 2012 00:41:31 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0fV2w001416; Thu, 18 Oct 2012 00:41:31 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180041.q9I0fV2w001416@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241662 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:41:32 -0000 Author: jimharris Date: Thu Oct 18 00:41:31 2012 New Revision: 241662 URL: http://svn.freebsd.org/changeset/base/241662 Log: Simplify how the qpair lock is acquired and released. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:40:40 2012 (r241661) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:41:31 2012 (r241662) @@ -802,6 +802,8 @@ nvme_ctrlr_submit_admin_request(struct n qpair = &ctrlr->adminq; + mtx_lock(&qpair->lock); + tr = nvme_qpair_allocate_tracker(qpair); tr->req = req; @@ -814,6 +816,8 @@ nvme_ctrlr_submit_admin_request(struct n panic("bus_dmamap_load returned non-zero!\n"); } else nvme_qpair_submit_cmd(tr->qpair, tr); + + mtx_unlock(&qpair->lock); } void @@ -829,6 +833,8 @@ nvme_ctrlr_submit_io_request(struct nvme else qpair = &ctrlr->ioq[0]; + mtx_lock(&qpair->lock); + tr = nvme_qpair_allocate_tracker(qpair); tr->req = req; @@ -850,4 +856,6 @@ nvme_ctrlr_submit_io_request(struct nvme if (err != 0) panic("bus_dmamap_load returned non-zero!\n"); } + + mtx_unlock(&qpair->lock); } Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:40:40 2012 (r241661) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:41:31 2012 (r241662) @@ -79,8 +79,6 @@ nvme_qpair_allocate_tracker(struct nvme_ { struct nvme_tracker *tr; - mtx_lock(&qpair->lock); - tr = SLIST_FIRST(&qpair->free_tr); if (tr == NULL) { /* @@ -89,7 +87,6 @@ nvme_qpair_allocate_tracker(struct nvme_ * into the qpair's active tracker array. */ if (qpair->num_tr == qpair->num_entries) { - mtx_unlock(&qpair->lock); return (NULL); } @@ -97,7 +94,6 @@ nvme_qpair_allocate_tracker(struct nvme_ M_ZERO | M_NOWAIT); if (tr == NULL) { - mtx_unlock(&qpair->lock); return (NULL); } @@ -160,7 +156,6 @@ nvme_qpair_process_completions(struct nv callout_stop(&tr->timer); if (retry) - /* nvme_qpair_submit_cmd() will release the lock. */ nvme_qpair_submit_cmd(qpair, tr); else { if (req->payload_size > 0 || req->uio != NULL) @@ -169,10 +164,10 @@ nvme_qpair_process_completions(struct nv nvme_free_request(req); SLIST_INSERT_HEAD(&qpair->free_tr, tr, slist); - - mtx_unlock(&qpair->lock); } + mtx_unlock(&qpair->lock); + if (++qpair->cq_head == qpair->num_entries) { qpair->cq_head = 0; qpair->phase = !qpair->phase; @@ -410,6 +405,4 @@ nvme_qpair_submit_cmd(struct nvme_qpair qpair->sq_tail); qpair->num_cmds++; - - mtx_unlock(&qpair->lock); } From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:43:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07B433E4; Thu, 18 Oct 2012 00:43:26 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12138FC0A; Thu, 18 Oct 2012 00:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0hPNm001771; Thu, 18 Oct 2012 00:43:25 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0hPhZ001767; Thu, 18 Oct 2012 00:43:25 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180043.q9I0hPhZ001767@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241663 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:43:26 -0000 Author: jimharris Date: Thu Oct 18 00:43:25 2012 New Revision: 241663 URL: http://svn.freebsd.org/changeset/base/241663 Log: Create nvme_qpair_submit_request() which eliminates all of the code duplication between the admin and io controller-level submit functions. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:41:31 2012 (r241662) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:43:25 2012 (r241663) @@ -796,28 +796,8 @@ void nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr, struct nvme_request *req) { - struct nvme_qpair *qpair; - struct nvme_tracker *tr; - int err; - - qpair = &ctrlr->adminq; - - mtx_lock(&qpair->lock); - - tr = nvme_qpair_allocate_tracker(qpair); - - tr->req = req; - if (req->payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, - req->payload, req->payload_size, - nvme_payload_map, tr, 0); - if (err != 0) - panic("bus_dmamap_load returned non-zero!\n"); - } else - nvme_qpair_submit_cmd(tr->qpair, tr); - - mtx_unlock(&qpair->lock); + nvme_qpair_submit_request(&ctrlr->adminq, req); } void @@ -825,37 +805,11 @@ nvme_ctrlr_submit_io_request(struct nvme struct nvme_request *req) { struct nvme_qpair *qpair; - struct nvme_tracker *tr; - int err; if (ctrlr->per_cpu_io_queues) qpair = &ctrlr->ioq[curcpu]; else qpair = &ctrlr->ioq[0]; - mtx_lock(&qpair->lock); - - tr = nvme_qpair_allocate_tracker(qpair); - - tr->req = req; - - if (req->uio == NULL) { - if (req->payload_size > 0) { - err = bus_dmamap_load(tr->qpair->dma_tag, - tr->payload_dma_map, req->payload, - req->payload_size, - nvme_payload_map, tr, 0); - if (err != 0) - panic("bus_dmamap_load returned non-zero!\n"); - } else - nvme_qpair_submit_cmd(tr->qpair, tr); - } else { - err = bus_dmamap_load_uio(tr->qpair->dma_tag, - tr->payload_dma_map, req->uio, - nvme_payload_map_uio, tr, 0); - if (err != 0) - panic("bus_dmamap_load returned non-zero!\n"); - } - - mtx_unlock(&qpair->lock); + nvme_qpair_submit_request(qpair, req); } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:41:31 2012 (r241662) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:43:25 2012 (r241663) @@ -354,6 +354,8 @@ void nvme_qpair_submit_cmd(struct nvme_q struct nvme_tracker *tr); void nvme_qpair_process_completions(struct nvme_qpair *qpair); struct nvme_tracker * nvme_qpair_allocate_tracker(struct nvme_qpair *qpair); +void nvme_qpair_submit_request(struct nvme_qpair *qpair, + struct nvme_request *req); void nvme_admin_qpair_destroy(struct nvme_qpair *qpair); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:41:31 2012 (r241662) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:43:25 2012 (r241663) @@ -406,3 +406,35 @@ nvme_qpair_submit_cmd(struct nvme_qpair qpair->num_cmds++; } + +void +nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) +{ + struct nvme_tracker *tr; + int err; + + mtx_lock(&qpair->lock); + + tr = nvme_qpair_allocate_tracker(qpair); + tr->req = req; + + if (req->uio == NULL) { + if (req->payload_size > 0) { + err = bus_dmamap_load(tr->qpair->dma_tag, + tr->payload_dma_map, req->payload, + req->payload_size, + nvme_payload_map, tr, 0); + if (err != 0) + panic("bus_dmamap_load returned non-zero!\n"); + } else + nvme_qpair_submit_cmd(tr->qpair, tr); + } else { + err = bus_dmamap_load_uio(tr->qpair->dma_tag, + tr->payload_dma_map, req->uio, + nvme_payload_map_uio, tr, 0); + if (err != 0) + panic("bus_dmamap_load returned non-zero!\n"); + } + + mtx_unlock(&qpair->lock); +} From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:44:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77406556; Thu, 18 Oct 2012 00:44:40 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B3A08FC0A; Thu, 18 Oct 2012 00:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0iewY002023; Thu, 18 Oct 2012 00:44:40 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0ieh7002017; Thu, 18 Oct 2012 00:44:40 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180044.q9I0ieh7002017@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241664 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:44:40 -0000 Author: jimharris Date: Thu Oct 18 00:44:39 2012 New Revision: 241664 URL: http://svn.freebsd.org/changeset/base/241664 Log: Preallocate a limited number of nvme_tracker objects per qpair, rather than dynamically creating them at runtime. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:43:25 2012 (r241663) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Oct 18 00:44:39 2012 (r241664) @@ -217,7 +217,13 @@ nvme_ctrlr_construct_admin_qpair(struct * The admin queue's max xfer size is treated differently than the * max I/O xfer size. 16KB is sufficient here - maybe even less? */ - nvme_qpair_construct(qpair, 0, 0, num_entries, 16*1024, ctrlr); + nvme_qpair_construct(qpair, + 0, /* qpair ID */ + 0, /* vector */ + num_entries, + NVME_ADMIN_TRACKERS, + 16*1024, /* max xfer size */ + ctrlr); } static int @@ -225,13 +231,11 @@ nvme_ctrlr_construct_io_qpairs(struct nv { struct nvme_qpair *qpair; union cap_lo_register cap_lo; - int i, num_entries; + int i, num_entries, num_trackers; num_entries = NVME_IO_ENTRIES; TUNABLE_INT_FETCH("hw.nvme.io_entries", &num_entries); - num_entries = max(num_entries, NVME_MIN_IO_ENTRIES); - /* * NVMe spec sets a hard limit of 64K max entries, but * devices may specify a smaller limit, so we need to check @@ -240,6 +244,18 @@ nvme_ctrlr_construct_io_qpairs(struct nv cap_lo.raw = nvme_mmio_read_4(ctrlr, cap_lo); num_entries = min(num_entries, cap_lo.bits.mqes+1); + num_trackers = NVME_IO_TRACKERS; + TUNABLE_INT_FETCH("hw.nvme.io_trackers", &num_trackers); + + num_trackers = max(num_trackers, NVME_MIN_IO_TRACKERS); + num_trackers = min(num_trackers, NVME_MAX_IO_TRACKERS); + /* + * No need to have more trackers than entries in the submit queue. + * Note also that for a queue size of N, we can only have (N-1) + * commands outstanding, hence the "-1" here. + */ + num_trackers = min(num_trackers, (num_entries-1)); + ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; TUNABLE_INT_FETCH("hw.nvme.max_xfer_size", &ctrlr->max_xfer_size); /* @@ -270,6 +286,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv i+1, /* qpair ID */ ctrlr->msix_enabled ? i+1 : 0, /* vector */ num_entries, + num_trackers, ctrlr->max_xfer_size, ctrlr); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:43:25 2012 (r241663) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:44:39 2012 (r241664) @@ -68,14 +68,25 @@ MALLOC_DECLARE(M_NVME); */ #define NVME_MAX_XFER_SIZE NVME_MAX_PRP_LIST_ENTRIES * PAGE_SIZE +#define NVME_ADMIN_TRACKERS (16) #define NVME_ADMIN_ENTRIES (128) /* min and max are defined in admin queue attributes section of spec */ #define NVME_MIN_ADMIN_ENTRIES (2) #define NVME_MAX_ADMIN_ENTRIES (4096) -#define NVME_IO_ENTRIES (1024) -/* min is a reasonable value picked for the nvme(4) driver */ -#define NVME_MIN_IO_ENTRIES (128) +/* + * NVME_IO_ENTRIES defines the size of an I/O qpair's submission and completion + * queues, while NVME_IO_TRACKERS defines the maximum number of I/O that we + * will allow outstanding on an I/O qpair at any time. The only advantage in + * having IO_ENTRIES > IO_TRACKERS is for debugging purposes - when dumping + * the contents of the submission and completion queues, it will show a longer + * history of data. + */ +#define NVME_IO_ENTRIES (256) +#define NVME_IO_TRACKERS (128) +#define NVME_MIN_IO_TRACKERS (16) +#define NVME_MAX_IO_TRACKERS (1024) + /* * NVME_MAX_IO_ENTRIES is not defined, since it is specified in CC.MQES * for each controller. @@ -134,6 +145,7 @@ struct nvme_qpair { uint32_t max_xfer_size; uint32_t num_entries; + uint32_t num_trackers; uint32_t sq_tdbl_off; uint32_t cq_hdbl_off; @@ -155,8 +167,6 @@ struct nvme_qpair { bus_dmamap_t cpl_dma_map; uint64_t cpl_bus_addr; - uint32_t num_tr; - SLIST_HEAD(, nvme_tracker) free_tr; struct nvme_tracker **act_tr; @@ -348,12 +358,11 @@ void nvme_ctrlr_submit_io_request(struct void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, - uint32_t max_xfer_size, + uint32_t num_trackers, uint32_t max_xfer_size, struct nvme_controller *ctrlr); void nvme_qpair_submit_cmd(struct nvme_qpair *qpair, struct nvme_tracker *tr); void nvme_qpair_process_completions(struct nvme_qpair *qpair); -struct nvme_tracker * nvme_qpair_allocate_tracker(struct nvme_qpair *qpair); void nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:43:25 2012 (r241663) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:44:39 2012 (r241664) @@ -74,42 +74,20 @@ nvme_completion_check_retry(const struct } } -struct nvme_tracker * -nvme_qpair_allocate_tracker(struct nvme_qpair *qpair) +static void +nvme_qpair_construct_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr, + uint16_t cid) { - struct nvme_tracker *tr; - - tr = SLIST_FIRST(&qpair->free_tr); - if (tr == NULL) { - /* - * We can't support more trackers than we have entries in - * our queue, because it would generate invalid indices - * into the qpair's active tracker array. - */ - if (qpair->num_tr == qpair->num_entries) { - return (NULL); - } - - tr = malloc(sizeof(struct nvme_tracker), M_NVME, - M_ZERO | M_NOWAIT); - - if (tr == NULL) { - return (NULL); - } - bus_dmamap_create(qpair->dma_tag, 0, &tr->payload_dma_map); - bus_dmamap_create(qpair->dma_tag, 0, &tr->prp_dma_map); + bus_dmamap_create(qpair->dma_tag, 0, &tr->payload_dma_map); + bus_dmamap_create(qpair->dma_tag, 0, &tr->prp_dma_map); - bus_dmamap_load(qpair->dma_tag, tr->prp_dma_map, tr->prp, - sizeof(tr->prp), nvme_single_map, &tr->prp_bus_addr, 0); - - callout_init_mtx(&tr->timer, &qpair->lock, 0); - tr->cid = qpair->num_tr++; - tr->qpair = qpair; - } else - SLIST_REMOVE_HEAD(&qpair->free_tr, slist); + bus_dmamap_load(qpair->dma_tag, tr->prp_dma_map, tr->prp, + sizeof(tr->prp), nvme_single_map, &tr->prp_bus_addr, 0); - return (tr); + callout_init_mtx(&tr->timer, &qpair->lock, 0); + tr->cid = cid; + tr->qpair = qpair; } void @@ -163,6 +141,10 @@ nvme_qpair_process_completions(struct nv tr->payload_dma_map); nvme_free_request(req); + + if (SLIST_EMPTY(&qpair->free_tr)) + wakeup(qpair); + SLIST_INSERT_HEAD(&qpair->free_tr, tr, slist); } @@ -188,9 +170,11 @@ nvme_qpair_msix_handler(void *arg) void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, - uint16_t vector, uint32_t num_entries, uint32_t max_xfer_size, - struct nvme_controller *ctrlr) + uint16_t vector, uint32_t num_entries, uint32_t num_trackers, + uint32_t max_xfer_size, struct nvme_controller *ctrlr) { + struct nvme_tracker *tr; + uint32_t i; qpair->id = id; qpair->vector = vector; @@ -233,7 +217,7 @@ nvme_qpair_construct(struct nvme_qpair * qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; - qpair->num_tr = 0; + qpair->num_trackers = num_trackers; qpair->sq_head = qpair->sq_tail = qpair->cq_head = 0; /* TODO: error checking on contigmalloc, bus_dmamap_load calls */ @@ -259,6 +243,18 @@ nvme_qpair_construct(struct nvme_qpair * SLIST_INIT(&qpair->free_tr); + for (i = 0; i < num_trackers; i++) { + tr = malloc(sizeof(*tr), M_NVME, M_ZERO | M_NOWAIT); + + if (tr == NULL) { + printf("warning: nvme tracker malloc failed\n"); + break; + } + + nvme_qpair_construct_tracker(qpair, tr, i); + SLIST_INSERT_HEAD(&qpair->free_tr, tr, slist); + } + qpair->act_tr = malloc(sizeof(struct nvme_tracker *) * qpair->num_entries, M_NVME, M_ZERO | M_NOWAIT); } @@ -379,19 +375,6 @@ nvme_qpair_submit_cmd(struct nvme_qpair req->cmd.cid = tr->cid; qpair->act_tr[tr->cid] = tr; - /* - * TODO: rather than spin until entries free up, put this tracker - * on a queue, and submit from the interrupt handler when - * entries free up. - */ - if ((qpair->sq_tail+1) % qpair->num_entries == qpair->sq_head) { - do { - mtx_unlock(&qpair->lock); - DELAY(5); - mtx_lock(&qpair->lock); - } while ((qpair->sq_tail+1) % qpair->num_entries == qpair->sq_head); - } - callout_reset(&tr->timer, NVME_TIMEOUT_IN_SEC * hz, nvme_timeout, tr); /* Copy the command from the tracker to the submission queue. */ @@ -415,7 +398,15 @@ nvme_qpair_submit_request(struct nvme_qp mtx_lock(&qpair->lock); - tr = nvme_qpair_allocate_tracker(qpair); + tr = SLIST_FIRST(&qpair->free_tr); + + while (tr == NULL) { + msleep(qpair, &qpair->lock, PRIBIO, "qpair_tr", 0); + printf("msleep\n"); + tr = SLIST_FIRST(&qpair->free_tr); + } + + SLIST_REMOVE_HEAD(&qpair->free_tr, slist); tr->req = req; if (req->uio == NULL) { Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Thu Oct 18 00:43:25 2012 (r241663) +++ head/sys/dev/nvme/nvme_sysctl.c Thu Oct 18 00:44:39 2012 (r241664) @@ -192,9 +192,9 @@ nvme_sysctl_initialize_queue(struct nvme SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "num_entries", CTLFLAG_RD, &qpair->num_entries, 0, "Number of entries in hardware queue"); - SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "num_tr", - CTLFLAG_RD, &qpair->num_tr, 0, - "Number of trackers allocated"); + SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "num_trackers", + CTLFLAG_RD, &qpair->num_trackers, 0, + "Number of trackers pre-allocated for this queue pair"); SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "sq_head", CTLFLAG_RD, &qpair->sq_head, 0, "Current head of submission queue (as observed by driver)"); From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 00:45:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7DB96CD; Thu, 18 Oct 2012 00:45:53 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD85E8FC0A; Thu, 18 Oct 2012 00:45:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I0jrj9002268; Thu, 18 Oct 2012 00:45:53 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I0jrCU002263; Thu, 18 Oct 2012 00:45:53 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210180045.q9I0jrCU002263@svn.freebsd.org> From: Jim Harris Date: Thu, 18 Oct 2012 00:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241665 - in head/sys/dev: nvd nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 00:45:53 -0000 Author: jimharris Date: Thu Oct 18 00:45:53 2012 New Revision: 241665 URL: http://svn.freebsd.org/changeset/base/241665 Log: Add ability to queue nvme_request objects if no nvme_trackers are available. This eliminates the need to manage queue depth at the nvd(4) level for Chatham prototype board workarounds, and also adds the ability to accept a number of requests on a single qpair that is much larger than the number of trackers allocated. Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Oct 18 00:44:39 2012 (r241664) +++ head/sys/dev/nvd/nvd.c Thu Oct 18 00:45:53 2012 (r241665) @@ -162,8 +162,7 @@ nvd_done(void *arg, const struct nvme_co ndisk = bp->bio_disk->d_drv1; - if (atomic_fetchadd_int(&ndisk->cur_depth, -1) == NVME_QD) - taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); + atomic_add_int(&ndisk->cur_depth, -1); /* * TODO: add more extensive translation of NVMe status codes @@ -187,9 +186,6 @@ nvd_bioq_process(void *arg, int pending) int err; for (;;) { - if (atomic_load_acq_int(&ndisk->cur_depth) >= NVME_QD) - break; - mtx_lock(&ndisk->bioqlock); bp = bioq_takefirst(&ndisk->bioq); mtx_unlock(&ndisk->bioqlock); @@ -210,24 +206,12 @@ nvd_bioq_process(void *arg, int pending) #endif bp->bio_driver1 = NULL; - atomic_add_acq_int(&ndisk->cur_depth, 1); + atomic_add_int(&ndisk->cur_depth, 1); err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); - /* - * TODO: remove this loop and rely on GEOM's pacing once - * nvme(4) returns ENOMEM only for malloc() failures. - * Currently nvme(4) returns ENOMEM also for cases when - * the submission queue is completely full, and that case - * will be handled more elegantly in a future update. - */ - while (err == ENOMEM) { - pause("nvd enomem", 1); - err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); - } - if (err) { - atomic_add_acq_int(&ndisk->cur_depth, -1); + atomic_add_int(&ndisk->cur_depth, -1); bp->bio_error = err; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Thu Oct 18 00:44:39 2012 (r241664) +++ head/sys/dev/nvme/nvme.h Thu Oct 18 00:45:53 2012 (r241665) @@ -689,9 +689,6 @@ enum nvme_io_test_flags { struct bio; -/* TODO: reassess this QD variable - its a workaround for Chatham2 issue */ -#define NVME_QD (200) - struct nvme_namespace; struct nvme_consumer; Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:44:39 2012 (r241664) +++ head/sys/dev/nvme/nvme_private.h Thu Oct 18 00:45:53 2012 (r241665) @@ -115,7 +115,7 @@ struct nvme_request { struct uio *uio; nvme_cb_fn_t cb_fn; void *cb_arg; - SLIST_ENTRY(nvme_request) slist; + STAILQ_ENTRY(nvme_request) stailq; }; struct nvme_tracker { @@ -168,6 +168,7 @@ struct nvme_qpair { uint64_t cpl_bus_addr; SLIST_HEAD(, nvme_tracker) free_tr; + STAILQ_HEAD(, nvme_request) queued_req; struct nvme_tracker **act_tr; Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:44:39 2012 (r241664) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 00:45:53 2012 (r241665) @@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "nvme_private.h" static boolean_t @@ -142,10 +144,13 @@ nvme_qpair_process_completions(struct nv nvme_free_request(req); - if (SLIST_EMPTY(&qpair->free_tr)) - wakeup(qpair); - SLIST_INSERT_HEAD(&qpair->free_tr, tr, slist); + + if (!STAILQ_EMPTY(&qpair->queued_req)) { + req = STAILQ_FIRST(&qpair->queued_req); + STAILQ_REMOVE_HEAD(&qpair->queued_req, stailq); + nvme_qpair_submit_request(qpair, req); + } } mtx_unlock(&qpair->lock); @@ -179,6 +184,16 @@ nvme_qpair_construct(struct nvme_qpair * qpair->id = id; qpair->vector = vector; qpair->num_entries = num_entries; +#ifdef CHATHAM2 + /* + * Chatham prototype board starts having issues at higher queue + * depths. So use a conservative estimate here of no more than 64 + * outstanding I/O per queue at any one point. + */ + if (pci_get_devid(ctrlr->dev) == CHATHAM_PCI_ID) + num_trackers = min(num_trackers, 64); +#endif + qpair->num_trackers = num_trackers; qpair->max_xfer_size = max_xfer_size; qpair->ctrlr = ctrlr; @@ -217,7 +232,6 @@ nvme_qpair_construct(struct nvme_qpair * qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; - qpair->num_trackers = num_trackers; qpair->sq_head = qpair->sq_tail = qpair->cq_head = 0; /* TODO: error checking on contigmalloc, bus_dmamap_load calls */ @@ -242,8 +256,9 @@ nvme_qpair_construct(struct nvme_qpair * qpair->cq_hdbl_off = nvme_mmio_offsetof(doorbell[id].cq_hdbl); SLIST_INIT(&qpair->free_tr); + STAILQ_INIT(&qpair->queued_req); - for (i = 0; i < num_trackers; i++) { + for (i = 0; i < qpair->num_trackers; i++) { tr = malloc(sizeof(*tr), M_NVME, M_ZERO | M_NOWAIT); if (tr == NULL) { @@ -400,10 +415,14 @@ nvme_qpair_submit_request(struct nvme_qp tr = SLIST_FIRST(&qpair->free_tr); - while (tr == NULL) { - msleep(qpair, &qpair->lock, PRIBIO, "qpair_tr", 0); - printf("msleep\n"); - tr = SLIST_FIRST(&qpair->free_tr); + if (tr == NULL) { + /* + * No tracker is available. Put the request on the qpair's + * request queue to be processed when a tracker frees up + * via a command completion. + */ + STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq); + goto ret; } SLIST_REMOVE_HEAD(&qpair->free_tr, slist); @@ -427,5 +446,6 @@ nvme_qpair_submit_request(struct nvme_qp panic("bus_dmamap_load returned non-zero!\n"); } +ret: mtx_unlock(&qpair->lock); } From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 03:02:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60028FE4; Thu, 18 Oct 2012 03:02:55 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 179018FC08; Thu, 18 Oct 2012 03:02:54 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so8427114pad.13 for ; Wed, 17 Oct 2012 20:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=0V6l1aEwhu1t0o+/z3X/zzMj94vt1UqAo9ttiedNqAI=; b=tprzs64uOG/MEjrwEbCUWEF/8BJuo66LPNJR22iSuEKCmiBoA+7AnU2JiX0igcbtOS qSIsXzik/HGaJRTSgZ5pJSh170YCOO7FJu0HgLdcgftrSOGOGxxz5HNkV9s//JA7RzBS 1485+vOWAMjrwbFZEt9Fw1G2lbYbbrmE65g84R2tjkNO9Yh5tfoPfmZ2HyxrHePAJtYP 6eco8xGMAGk5kqVoZ3byoptPFO4Nw4BymNQ8jSb8xLNB/sXfdnEl6p4wqztB4Jp+EXSK EvbrT3cjSkJDIzqJFvAhgNzn1PznqHXK2Y4B/yVKTbJ1JljHkU4RbNuQjWhd71OySRR9 fHPQ== Received: by 10.68.189.102 with SMTP id gh6mr37321822pbc.37.1350529374431; Wed, 17 Oct 2012 20:02:54 -0700 (PDT) Received: from localhost (c-76-21-78-68.hsd1.ca.comcast.net. [76.21.78.68]) by mx.google.com with ESMTPS id vw4sm13457229pbc.26.2012.10.17.20.02.53 (version=SSLv3 cipher=OTHER); Wed, 17 Oct 2012 20:02:53 -0700 (PDT) Date: Wed, 17 Oct 2012 20:03:12 -0700 From: Gleb Kurtsou To: Attilio Rao Subject: Re: svn commit: r241636 - in head: etc/mtree include lib/libprocstat rescue/rescue sbin sbin/mount share/dict share/man/man7 sys/boot/forth sys/conf sys/geom/label sys/kern sys/mips/rmi sys/modules sys... Message-ID: <20121018030312.GA1983@reks> References: <201210171130.q9HBU0fH060245@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201210171130.q9HBU0fH060245@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 03:02:55 -0000 On (17/10/2012 11:30), Attilio Rao wrote: > Author: attilio > Date: Wed Oct 17 11:30:00 2012 > New Revision: 241636 > URL: http://svn.freebsd.org/changeset/base/241636 > > Log: > Disconnect non-MPSAFE NTFS from the build in preparation for dropping > GIANT from VFS. This code is particulary broken and fragile and other > in-kernel implementations around, found in other operating systems, > don't really seem clean and solid enough to be imported at all. > If someone wants to reconsider in-kernel NTFS implementation for > inclusion again, a fair effort for completely fixing and cleaning it > up is expected. > [...] Why not to keep glabel ntfs support? I find it very useful on its own and it seems to require only a few constants and structs from ntfs.h Thanks, Gleb. > > Modified: head/sys/modules/geom/geom_label/Makefile > ============================================================================== > --- head/sys/modules/geom/geom_label/Makefile Wed Oct 17 11:28:44 2012 (r241635) > +++ head/sys/modules/geom/geom_label/Makefile Wed Oct 17 11:30:00 2012 (r241636) > @@ -8,7 +8,6 @@ SRCS+= g_label_ext2fs.c > SRCS+= g_label_gpt.c > SRCS+= g_label_iso9660.c > SRCS+= g_label_msdosfs.c > -SRCS+= g_label_ntfs.c > SRCS+= g_label_reiserfs.c > SRCS+= g_label_ufs.c > From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 06:27:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63ADB693; Thu, 18 Oct 2012 06:27:04 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4328FC12; Thu, 18 Oct 2012 06:27:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I6R44w065770; Thu, 18 Oct 2012 06:27:04 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I6R4GF065767; Thu, 18 Oct 2012 06:27:04 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201210180627.q9I6R4GF065767@svn.freebsd.org> From: Maxim Sobolev Date: Thu, 18 Oct 2012 06:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241672 - in head/usr.sbin/cron: cron lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 06:27:04 -0000 Author: sobomax Date: Thu Oct 18 06:27:03 2012 New Revision: 241672 URL: http://svn.freebsd.org/changeset/base/241672 Log: Fully backout latest changes. Pointy hat to: sobomax Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Thu Oct 18 01:14:22 2012 (r241671) +++ head/usr.sbin/cron/cron/cron.c Thu Oct 18 06:27:03 2012 (r241672) @@ -333,73 +333,37 @@ cron_tick(db) */ static void cron_sync() { -#if 0 register struct tm *tm; -#endif - TargetTime = time((time_t*)0) + 1; -#if 0 + TargetTime = time((time_t*)0); tm = localtime(&TargetTime); TargetTime += (60 - tm->tm_sec); -#endif } -static int -timeval_subtract(struct timespec *result, struct timeval *x, struct timeval *y) -{ - int nsec; - - /* Perform the carry for the later subtraction by updating y. */ - if (x->tv_usec < y->tv_usec) { - nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; - y->tv_usec -= 1000000 * nsec; - y->tv_sec += nsec; - } - if (x->tv_usec - y->tv_usec > 1000000) { - nsec = (x->tv_usec - y->tv_usec) / 1000000; - y->tv_usec += 1000000 * nsec; - y->tv_sec -= nsec; - } - - /* tv_nsec is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_nsec = (x->tv_usec - y->tv_usec) * 1000; - - /* Return difference in seconds */ - return (x->tv_sec - y->tv_sec); -} static void cron_sleep(db) cron_db *db; { - int seconds_to_wait; - int rval; - struct timeval ctime, ttime; - struct timespec stime, remtime; + int seconds_to_wait = 0; /* * Loop until we reach the top of the next minute, sleep when possible. */ for (;;) { - gettimeofday(&ctime, NULL); - ttime.tv_sec = TargetTime; - ttime.tv_usec = 0; - timeval_subtract(&stime, &ttime, &ctime); + seconds_to_wait = (int) (TargetTime - time((time_t*)0)); /* * If the seconds_to_wait value is insane, jump the cron */ - if (stime.tv_sec < -600 || stime.tv_sec > 600) { + if (seconds_to_wait < -600 || seconds_to_wait > 600) { cron_clean(db); cron_sync(); continue; } - seconds_to_wait = (stime.tv_nsec > 0) ? stime.tv_sec + 1 : stime.tv_sec; - Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n", getpid(), (long)TargetTime, seconds_to_wait)) @@ -408,19 +372,13 @@ cron_sleep(db) * to run, break */ - if (stime.tv_sec < 0) + if (seconds_to_wait <= 0) break; if (job_runqueue() == 0) { Debug(DSCH, ("[%d] sleeping for %d seconds\n", getpid(), seconds_to_wait)) - for (;;) { - rval = nanosleep(&stime, &remtime); - if (rval == 0 || errno != EINTR) - break; - stime.tv_sec = remtime.tv_sec; - stime.tv_nsec = remtime.tv_nsec; - } + sleep(seconds_to_wait); } } } Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Thu Oct 18 01:14:22 2012 (r241671) +++ head/usr.sbin/cron/lib/entry.c Thu Oct 18 06:27:03 2012 (r241672) @@ -187,7 +187,6 @@ load_entry(file, error_func, pw, envp) bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); - bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else { ecode = e_timespec; goto eof; From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 07:55:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCCD27B6; Thu, 18 Oct 2012 07:55:09 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B43948FC0A; Thu, 18 Oct 2012 07:55:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I7t9EQ083009; Thu, 18 Oct 2012 07:55:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I7t9el083007; Thu, 18 Oct 2012 07:55:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201210180755.q9I7t9el083007@svn.freebsd.org> From: Devin Teske Date: Thu, 18 Oct 2012 07:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241673 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 07:55:09 -0000 Author: dteske Date: Thu Oct 18 07:55:09 2012 New Revision: 241673 URL: http://svn.freebsd.org/changeset/base/241673 Log: Fix typo. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Thu Oct 18 06:27:03 2012 (r241672) +++ head/usr.sbin/bsdconfig/share/common.subr Thu Oct 18 07:55:09 2012 (r241673) @@ -156,7 +156,7 @@ f_include() # f_include_lang $file # # Include a language file. Automatically takes $LANG and $LC_ALL into -# considerationg when including $file (suffix ".$LC_ALL" or ".$LANG" will +# consideration when including $file (suffix ".$LC_ALL" or ".$LANG" will # automatically by added prior to loading the language file). # # No error is produced if (a) a language has been requested (by setting either From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 09:57:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37BDE24A; Thu, 18 Oct 2012 09:57:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E3B38FC08; Thu, 18 Oct 2012 09:57:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I9vuZB007966; Thu, 18 Oct 2012 09:57:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I9vuBh007964; Thu, 18 Oct 2012 09:57:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210180957.q9I9vuBh007964@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 18 Oct 2012 09:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241677 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 09:57:57 -0000 Author: glebius Date: Thu Oct 18 09:57:56 2012 New Revision: 241677 URL: http://svn.freebsd.org/changeset/base/241677 Log: Utilize new macro to initialize if_baudrate(). Modified: head/sys/net/if_epair.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Thu Oct 18 09:56:14 2012 (r241676) +++ head/sys/net/if_epair.c Thu Oct 18 09:57:56 2012 (r241677) @@ -823,7 +823,7 @@ epair_clone_create(struct if_clone *ifc, sca->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; - ifp->if_baudrate = IF_Gbps(10UL); /* arbitrary maximum */ + if_initbaudrate(ifp, IF_Gbps(10)); /* arbitrary maximum */ /* Swap the name and finish initialization of interface b. */ *dp = 'b'; @@ -849,7 +849,7 @@ epair_clone_create(struct if_clone *ifc, scb->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; - ifp->if_baudrate = IF_Gbps(10UL); /* arbitrary maximum */ + if_initbaudrate(ifp, IF_Gbps(10)); /* arbitrary maximum */ /* * Restore name to a as the ifp for this will go into the From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 09:59:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E35A3EC; Thu, 18 Oct 2012 09:59:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13BB48FC18; Thu, 18 Oct 2012 09:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9I9xokQ008362; Thu, 18 Oct 2012 09:59:50 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9I9xofO008360; Thu, 18 Oct 2012 09:59:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210180959.q9I9xofO008360@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 18 Oct 2012 09:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241678 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 09:59:51 -0000 Author: glebius Date: Thu Oct 18 09:59:50 2012 New Revision: 241678 URL: http://svn.freebsd.org/changeset/base/241678 Log: Utilize new macro to initialize if_baudrate. Modified: head/sys/dev/bxe/if_bxe.c Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Thu Oct 18 09:57:56 2012 (r241677) +++ head/sys/dev/bxe/if_bxe.c Thu Oct 18 09:59:50 2012 (r241678) @@ -2140,7 +2140,7 @@ bxe_attach(device_t dev) ifp->if_capabilities = BXE_IF_CAPABILITIES; /* TPA not enabled by default. */ ifp->if_capenable = BXE_IF_CAPABILITIES & ~IFCAP_LRO; - ifp->if_baudrate = IF_Gbps(10UL); + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_snd.ifq_drv_maxlen = sc->tx_ring_size; From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 10:29:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1296FAE2; Thu, 18 Oct 2012 10:29:17 +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 ED6E48FC18; Thu, 18 Oct 2012 10:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IATG1t012871; Thu, 18 Oct 2012 10:29:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IATG46012868; Thu, 18 Oct 2012 10:29:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210181029.q9IATG46012868@svn.freebsd.org> From: Marius Strobl Date: Thu, 18 Oct 2012 10:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241679 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 10:29:17 -0000 Author: marius Date: Thu Oct 18 10:29:16 2012 New Revision: 241679 URL: http://svn.freebsd.org/changeset/base/241679 Log: It turns out that as documented, PCF8563_R_SECOND_VL (i.e. battery low) doesn't automatically clear when VDD rises above Vlow again and needs to be cleared manually. However, apparently this needs all of the time registers to be set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in order for PCF8563_R_SECOND_VL to stick. Thus, we just issue a warning during pcf8563_attach() rather than failing with ENXIO in case it is set. MFC after: 3 days Modified: head/sys/dev/iicbus/pcf8563.c Modified: head/sys/dev/iicbus/pcf8563.c ============================================================================== --- head/sys/dev/iicbus/pcf8563.c Thu Oct 18 09:59:50 2012 (r241678) +++ head/sys/dev/iicbus/pcf8563.c Thu Oct 18 10:29:16 2012 (r241679) @@ -83,6 +83,16 @@ pcf8563_attach(device_t dev) if (sc->sc_addr == 0) sc->sc_addr = PCF8563_ADDR; + /* + * NB: PCF8563_R_SECOND_VL doesn't automatically clear when VDD + * rises above Vlow again and needs to be cleared manually. + * However, apparently this needs all of the time registers to be + * set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in + * order for PCF8563_R_SECOND_VL to stick. Thus, we just issue a + * warning here rather than failing with ENXIO in case it is set. + * Note that pcf8563_settime() will also clear PCF8563_R_SECOND_VL + * as a side-effect. + */ msgs[0].slave = msgs[1].slave = sc->sc_addr; error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / sizeof(*msgs)); @@ -90,10 +100,8 @@ pcf8563_attach(device_t dev) device_printf(dev, "%s: cannot read RTC\n", __func__); return (error); } - if ((val & PCF8563_R_SECOND_VL) != 0) { + if ((val & PCF8563_R_SECOND_VL) != 0) device_printf(dev, "%s: battery low\n", __func__); - return (ENXIO); - } sc->sc_year0 = 1900; clock_register(dev, 1000000); /* 1 second resolution */ From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 10:47:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F5AB43A; Thu, 18 Oct 2012 10:47:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 94A7A8FC18; Thu, 18 Oct 2012 10:47:55 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so7125227lbd.13 for ; Thu, 18 Oct 2012 03:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=EPV2xFrmP/BugZue57ueAkU0Y9EBCufhrVEMSUY7NXo=; b=OkgSZ6k+qcDbwBtlZc4cnQRyGKJ9iWXwEb/JLvleFV6tlaCUhOChlrHhdVS8LxsD7X DQ6byAGZLJfXl0HFOAlNQ3oNN+M+DA2mYRco+YrcV8BzsXuLCJtihAvyvkJFct28/VGv UaJYxVv2Xr7cr50Ku5AEoKyQtbzqFFS/xp6YdRHvvY6NyC56iJB6CWzY2K/k0fMTbgEt Lp3ub4UF67q6Hqo0kog0rKstB45PX7QSbC5Fbb6uOy0HryjkMebljJV9w6KgnKahtUZl G31lMtdXaHfQPe5vhbp+QsNYPVNW7aJxwnpMboyF4jkyxCug/c274vmgTG57QCPRSeZ4 FIig== MIME-Version: 1.0 Received: by 10.112.82.103 with SMTP id h7mr7678849lby.50.1350557274239; Thu, 18 Oct 2012 03:47:54 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 18 Oct 2012 03:47:54 -0700 (PDT) In-Reply-To: <20121018030312.GA1983@reks> References: <201210171130.q9HBU0fH060245@svn.freebsd.org> <20121018030312.GA1983@reks> Date: Thu, 18 Oct 2012 11:47:54 +0100 X-Google-Sender-Auth: pNhFx5NSA7euuXhj5AHDeGc_Fic Message-ID: Subject: Re: svn commit: r241636 - in head: etc/mtree include lib/libprocstat rescue/rescue sbin sbin/mount share/dict share/man/man7 sys/boot/forth sys/conf sys/geom/label sys/kern sys/mips/rmi sys/modules sys... From: Attilio Rao To: Gleb Kurtsou Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 10:47:56 -0000 On 10/18/12, Gleb Kurtsou wrote: > On (17/10/2012 11:30), Attilio Rao wrote: >> Author: attilio >> Date: Wed Oct 17 11:30:00 2012 >> New Revision: 241636 >> URL: http://svn.freebsd.org/changeset/base/241636 >> >> Log: >> Disconnect non-MPSAFE NTFS from the build in preparation for dropping >> GIANT from VFS. This code is particulary broken and fragile and other >> in-kernel implementations around, found in other operating systems, >> don't really seem clean and solid enough to be imported at all. >> If someone wants to reconsider in-kernel NTFS implementation for >> inclusion again, a fair effort for completely fixing and cleaning it >> up is expected. >> > [...] > > Why not to keep glabel ntfs support? I find it very useful on its own > and it seems to require only a few constants and structs from ntfs.h > I think that we just want to support FreeBSD specifically supported filesystems for this? I will talk to pjd and see what he thinks. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 12:04:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BB91305; Thu, 18 Oct 2012 12:04:57 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE328FC08; Thu, 18 Oct 2012 12:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IC4v9D029551; Thu, 18 Oct 2012 12:04:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IC4uZJ029510; Thu, 18 Oct 2012 12:04:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210181204.q9IC4uZJ029510@svn.freebsd.org> From: Attilio Rao Date: Thu, 18 Oct 2012 12:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241680 - in head: etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sys/modules sys/sys usr.bin u... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 12:04:57 -0000 Author: attilio Date: Thu Oct 18 12:04:56 2012 New Revision: 241680 URL: http://svn.freebsd.org/changeset/base/241680 Log: Disconnect non-MPSAFE SMBFS from the build in preparation for dropping GIANT from VFS. In addition, disconnect also netsmb, which is a base requirement for SMBFS. In the while SMBFS regular users can use FUSE interface and smbnetfs port to work with their SMBFS partitions. Also, there are ongoing efforts by vendor to support in-kernel smbfs, so there are good chances that it will get relinked once properly locked. This is not targeted for MFC. Modified: head/etc/defaults/rc.conf head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.usr.dist head/include/Makefile head/lib/Makefile head/lib/libprocstat/Makefile head/lib/libprocstat/common_kvm.h head/lib/libprocstat/libprocstat.c head/rescue/rescue/Makefile head/sbin/mount/mount.8 head/sbin/mount/mount.c head/share/examples/Makefile head/share/examples/etc/README.examples head/share/mk/bsd.libnames.mk head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.ia64 head/sys/conf/files.mips head/sys/conf/files.pc98 head/sys/conf/files.powerpc head/sys/conf/files.sparc64 head/sys/conf/options head/sys/kern/Make.tags.inc head/sys/kern/sys_generic.c head/sys/modules/Makefile head/sys/sys/socketvar.h head/usr.bin/Makefile.amd64 head/usr.bin/Makefile.i386 head/usr.bin/Makefile.ia64 head/usr.bin/Makefile.powerpc head/usr.bin/Makefile.sparc64 head/usr.bin/kdump/kdump.c head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 head/usr.sbin/Makefile.ia64 head/usr.sbin/Makefile.powerpc head/usr.sbin/Makefile.sparc64 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Oct 18 10:29:16 2012 (r241679) +++ head/etc/defaults/rc.conf Thu Oct 18 12:04:56 2012 (r241680) @@ -92,7 +92,7 @@ fsck_y_enable="NO" # Set to YES to do fs fsck_y_flags="" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. -netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB" # Net filesystems. +netfs_types="nfs:NFS oldnfs:OLDNFS" # Net filesystems. extra_netfs_types="NO" # List of network extra filesystem types for delayed # mount at startup (or NO). Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Oct 18 10:29:16 2012 (r241679) +++ head/etc/mtree/BSD.include.dist Thu Oct 18 12:04:56 2012 (r241680) @@ -170,8 +170,6 @@ .. procfs .. - smbfs - .. udf .. unionfs Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Oct 18 10:29:16 2012 (r241679) +++ head/etc/mtree/BSD.usr.dist Thu Oct 18 12:04:56 2012 (r241680) @@ -307,10 +307,6 @@ srcs .. .. - smbfs - print - .. - .. sunrpc dir .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Thu Oct 18 10:29:16 2012 (r241679) +++ head/include/Makefile Thu Oct 18 12:04:56 2012 (r241680) @@ -34,7 +34,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set. ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ - netipsec ${_netipx} netnatm netsmb \ + netipsec ${_netipx} netnatm \ nfs nfsclient nfsserver \ sys vm @@ -44,7 +44,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ - fs/procfs fs/smbfs fs/udf fs/unionfs \ + fs/procfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ @@ -76,7 +76,6 @@ INCS+= iconv.h LSUBSUBDIRS+= netgraph/bluetooth/include .endif -# XXX unconditionally needed by #.if ${MK_IPX} != "no" _netipx= netipx #.endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Oct 18 10:29:16 2012 (r241679) +++ head/lib/Makefile Thu Oct 18 12:04:56 2012 (r241680) @@ -100,7 +100,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_librtld_db} \ ${_libsdp} \ ${_libsm} \ - ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} \ libstand \ @@ -188,7 +187,6 @@ _libypclnt= libypclnt .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_libsmb= libsmb _libvgl= libvgl _libproc= libproc _librtld_db= librtld_db @@ -196,7 +194,6 @@ _librtld_db= librtld_db .if ${MACHINE_CPUARCH} == "ia64" _libefi= libefi -_libsmb= libsmb .endif .if ${MACHINE_CPUARCH} == "mips" @@ -204,14 +201,6 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_CPUARCH} == "powerpc" -_libsmb= libsmb -.endif - -.if ${MACHINE_CPUARCH} == "sparc64" -_libsmb= libsmb -.endif - .if ${MK_OPENSSL} != "no" _libmp= libmp .endif Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Thu Oct 18 10:29:16 2012 (r241679) +++ head/lib/libprocstat/Makefile Thu Oct 18 12:04:56 2012 (r241680) @@ -8,7 +8,6 @@ SRCS= cd9660.c \ common_kvm.c \ libprocstat.c \ msdosfs.c \ - smbfs.c \ udf.c VERSION_DEF= ${.CURDIR}/Versions.def Modified: head/lib/libprocstat/common_kvm.h ============================================================================== --- head/lib/libprocstat/common_kvm.h Thu Oct 18 10:29:16 2012 (r241679) +++ head/lib/libprocstat/common_kvm.h Thu Oct 18 12:04:56 2012 (r241680) @@ -41,7 +41,6 @@ int devfs_filestat(kvm_t *kd, struct vno int isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); -int smbfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int udf_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); int zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu Oct 18 10:29:16 2012 (r241679) +++ head/lib/libprocstat/libprocstat.c Thu Oct 18 12:04:56 2012 (r241680) @@ -973,7 +973,6 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s FSTYPE(isofs), FSTYPE(msdosfs), FSTYPE(nfs), - FSTYPE(smbfs), FSTYPE(udf), FSTYPE(ufs), #ifdef LIBPROCSTAT_ZFS Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Thu Oct 18 10:29:16 2012 (r241679) +++ head/rescue/rescue/Makefile Thu Oct 18 12:04:56 2012 (r241680) @@ -130,8 +130,6 @@ CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv - .if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk CRUNCH_ALIAS_bsdlabel= disklabel -#CRUNCH_PROGS+= mount_smbfs -#CRUNCH_LIBS+= -lsmb .endif .if ${MACHINE} == "pc98" Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Thu Oct 18 10:29:16 2012 (r241679) +++ head/sbin/mount/mount.8 Thu Oct 18 12:04:56 2012 (r241680) @@ -448,7 +448,6 @@ However, for the following file system t .Cm nfs , .Cm nullfs , .Cm oldnfs , -.Cm smbfs , .Cm udf , and .Cm unionfs . @@ -543,7 +542,6 @@ support for a particular file system mig .Xr mount_msdosfs 8 , .Xr mount_nfs 8 , .Xr mount_nullfs 8 , -.Xr mount_smbfs 8 , .Xr mount_udf 8 , .Xr mount_unionfs 8 , .Xr umount 8 , Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Thu Oct 18 10:29:16 2012 (r241679) +++ head/sbin/mount/mount.c Thu Oct 18 12:04:56 2012 (r241680) @@ -143,7 +143,7 @@ use_mountprog(const char *vfstype) unsigned int i; const char *fs[] = { "cd9660", "mfs", "msdosfs", "nfs", - "nullfs", "oldnfs", "smbfs", "udf", "unionfs", + "nullfs", "oldnfs", "udf", "unionfs", NULL }; Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Thu Oct 18 10:29:16 2012 (r241679) +++ head/share/examples/Makefile Thu Oct 18 12:04:56 2012 (r241680) @@ -242,7 +242,6 @@ etc-examples: .endif .if ${SHARED} != "symlinks" -SUBDIR= smbfs .if ${MK_IPFILTER} != "no" SUBDIR+=ipfilter .endif Modified: head/share/examples/etc/README.examples ============================================================================== --- head/share/examples/etc/README.examples Thu Oct 18 10:29:16 2012 (r241679) +++ head/share/examples/etc/README.examples Thu Oct 18 12:04:56 2012 (r241680) @@ -40,7 +40,6 @@ netstart - network startup script run fr network.subr - routines for network configuration scripts networks - see networks(5) newsyslog.conf - configuration for system log file rotator newsyslog(8) -nsmb.conf - smbfs lookups configuration file opieaccess - OPIE database of trusted networks pf.conf - pf(4) example configuration file pf.os - SYN fingerprint database Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Oct 18 10:29:16 2012 (r241679) +++ head/share/mk/bsd.libnames.mk Thu Oct 18 12:04:56 2012 (r241680) @@ -143,7 +143,6 @@ LIBRT?= ${DESTDIR}${LIBDIR}/librt.a LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a LIBSDP?= ${DESTDIR}${LIBDIR}/libsdp.a -LIBSMB?= ${DESTDIR}${LIBDIR}/libsmb.a LIBSSH?= ${DESTDIR}${LIBDIR}/libssh.a LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/NOTES Thu Oct 18 12:04:56 2012 (r241680) @@ -573,12 +573,6 @@ options IPX #IPX/SPX communications p options NETATALK #Appletalk communications protocols options NETATALKDEBUG #Appletalk debugging -# -# SMB/CIFS requester -# NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV -# options. -options NETSMB #SMB/CIFS requester - # mchain library. It can be either loaded as KLD or compiled into kernel options LIBMCHAIN @@ -1010,7 +1004,6 @@ options NULLFS #NULL filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework options PSEUDOFS_TRACE #Debugging support for PSEUDOFS -options SMBFS #SMB/CIFS filesystem options TMPFS #Efficient memory filesystem options UDF #Universal Disk Format options UNIONFS #Union filesystem Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files Thu Oct 18 12:04:56 2012 (r241680) @@ -517,8 +517,8 @@ crypto/blowfish/bf_ecb.c optional ipsec crypto/blowfish/bf_skey.c optional crypto | ipsec crypto/camellia/camellia.c optional crypto | ipsec crypto/camellia/camellia-api.c optional crypto | ipsec -crypto/des/des_ecb.c optional crypto | ipsec | netsmb -crypto/des/des_setkey.c optional crypto | ipsec | netsmb +crypto/des/des_ecb.c optional crypto | ipsec +crypto/des/des_setkey.c optional crypto | ipsec crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \ ipsec | random | wlan_ccmp @@ -2386,12 +2386,6 @@ fs/pseudofs/pseudofs.c optional pseudof fs/pseudofs/pseudofs_fileno.c optional pseudofs fs/pseudofs/pseudofs_vncache.c optional pseudofs fs/pseudofs/pseudofs_vnops.c optional pseudofs -fs/smbfs/smbfs_io.c optional smbfs -fs/smbfs/smbfs_node.c optional smbfs -fs/smbfs/smbfs_smb.c optional smbfs -fs/smbfs/smbfs_subr.c optional smbfs -fs/smbfs/smbfs_vfsops.c optional smbfs -fs/smbfs/smbfs_vnops.c optional smbfs fs/udf/osta.c optional udf fs/udf/udf_iconv.c optional udf_iconv fs/udf/udf_vfsops.c optional udf @@ -2626,7 +2620,6 @@ kern/kern_uuid.c standard kern/kern_xxx.c standard kern/link_elf.c standard kern/linker_if.m standard -kern/md4c.c optional netsmb kern/md5c.c standard kern/p1003_1b.c standard kern/posix4_mib.c standard @@ -3155,15 +3148,6 @@ netpfil/pf/pf_osfp.c optional pf inet netpfil/pf/pf_ruleset.c optional pf inet netpfil/pf/pf_table.c optional pf inet netpfil/pf/in4_cksum.c optional pf inet -netsmb/smb_conn.c optional netsmb -netsmb/smb_crypt.c optional netsmb -netsmb/smb_dev.c optional netsmb -netsmb/smb_iod.c optional netsmb -netsmb/smb_rq.c optional netsmb -netsmb/smb_smb.c optional netsmb -netsmb/smb_subr.c optional netsmb -netsmb/smb_trantcp.c optional netsmb -netsmb/smb_usr.c optional netsmb nfs/bootp_subr.c optional bootp nfsclient | bootp nfscl nfs/krpc_subr.c optional bootp nfsclient | bootp nfscl nfs/nfs_common.c optional nfsclient | nfsserver Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.amd64 Thu Oct 18 12:04:56 2012 (r241680) @@ -136,7 +136,7 @@ crypto/aesni/aeskeys_amd64.S optional ae crypto/aesni/aesni.c optional aesni crypto/aesni/aesni_wrap.c optional aesni crypto/blowfish/bf_enc.c optional crypto | ipsec -crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/des/des_enc.c optional crypto | ipsec crypto/via/padlock.c optional padlock crypto/via/padlock_cipher.c optional padlock crypto/via/padlock_hash.c optional padlock Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.arm Thu Oct 18 12:04:56 2012 (r241680) @@ -5,7 +5,7 @@ font.h optional sc \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" crypto/blowfish/bf_enc.c optional crypto | ipsec -crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/des/des_enc.c optional crypto | ipsec arm/arm/autoconf.c standard arm/arm/bcopy_page.S standard arm/arm/bcopyinout.S standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.i386 Thu Oct 18 12:04:56 2012 (r241680) @@ -122,7 +122,7 @@ crypto/aesni/aesencdec_i386.S optional a crypto/aesni/aeskeys_i386.S optional aesni crypto/aesni/aesni.c optional aesni crypto/aesni/aesni_wrap.c optional aesni -crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb +crypto/des/arch/i386/des_enc.S optional crypto | ipsec crypto/via/padlock.c optional padlock crypto/via/padlock_cipher.c optional padlock crypto/via/padlock_hash.c optional padlock Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.ia64 Thu Oct 18 12:04:56 2012 (r241680) @@ -45,7 +45,7 @@ contrib/ia64/libuwx/src/uwx_trace.c sta contrib/ia64/libuwx/src/uwx_uinfo.c standard contrib/ia64/libuwx/src/uwx_utable.c standard crypto/blowfish/bf_enc.c optional crypto | ipsec -crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/des/des_enc.c optional crypto | ipsec dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc dev/atkbdc/atkbdc.c optional atkbdc Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.mips Thu Oct 18 12:04:56 2012 (r241680) @@ -65,7 +65,7 @@ mips/mips/swtch.S standard mips/mips/uio_machdep.c standard mips/mips/uma_machdep.c standard crypto/blowfish/bf_enc.c optional crypto | ipsec -crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/des/des_enc.c optional crypto | ipsec geom/geom_bsd.c optional geom_bsd geom/geom_bsd_enc.c optional geom_bsd geom/geom_mbr.c optional geom_mbr Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.pc98 Thu Oct 18 12:04:56 2012 (r241680) @@ -77,7 +77,7 @@ bf_enc.o optional crypto | ipsec \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule -crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb +crypto/des/arch/i386/des_enc.S optional crypto | ipsec dev/agp/agp_ali.c optional agp dev/agp/agp_amd.c optional agp dev/agp/agp_i810.c optional agp Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.powerpc Thu Oct 18 12:04:56 2012 (r241680) @@ -18,7 +18,7 @@ font.h optional sc \ cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/atomic/powerpc64/opensolaris_atomic.S optional zfs powerpc64 compile-with "${ZFS_S}" crypto/blowfish/bf_enc.c optional crypto | ipsec -crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/des/des_enc.c optional crypto | ipsec dev/bm/if_bm.c optional bm powermac dev/adb/adb_bus.c optional adb dev/adb/adb_kbd.c optional adb Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/files.sparc64 Thu Oct 18 12:04:56 2012 (r241680) @@ -24,7 +24,7 @@ ukbdmap.h optional ukbd_dflt_keymap \ # cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}" crypto/blowfish/bf_enc.c optional crypto | ipsec -crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/des/des_enc.c optional crypto | ipsec dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc dev/atkbdc/atkbdc.c optional atkbdc Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/conf/options Thu Oct 18 12:04:56 2012 (r241680) @@ -216,7 +216,6 @@ NULLFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h REISERFS opt_dontuse.h -SMBFS opt_dontuse.h TMPFS opt_dontuse.h UDF opt_dontuse.h UNIONFS opt_dontuse.h @@ -282,9 +281,6 @@ UFS_GJOURNAL opt_ufs.h # they won't make any difference yet). NFS_ROOT opt_nfsroot.h -# SMB/CIFS requester -NETSMB opt_netsmb.h - # Options used only in subr_param.c. HZ opt_param.h MAXFILES opt_param.h Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/kern/Make.tags.inc Thu Oct 18 12:04:56 2012 (r241680) @@ -30,7 +30,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ ${SYS}/fs/procfs/*.[ch] \ - ${SYS}/fs/smbfs/*.[ch] \ ${SYS}/fs/udf/*.[ch] \ ${SYS}/fs/unionfs/*.[ch] \ ${SYS}/geom/*.[ch] \ Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/kern/sys_generic.c Thu Oct 18 12:04:56 2012 (r241680) @@ -1474,62 +1474,6 @@ sys_openbsd_poll(td, uap) } /* - * XXX This was created specifically to support netncp and netsmb. This - * allows the caller to specify a socket to wait for events on. It returns - * 0 if any events matched and an error otherwise. There is no way to - * determine which events fired. - */ -int -selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td) -{ - struct timeval atv, rtv, ttv; - int error, timo; - - if (tvp != NULL) { - atv = *tvp; - if (itimerfix(&atv)) - return (EINVAL); - getmicrouptime(&rtv); - timevaladd(&atv, &rtv); - } else { - atv.tv_sec = 0; - atv.tv_usec = 0; - } - - timo = 0; - seltdinit(td); - /* - * Iterate until the timeout expires or the socket becomes ready. - */ - for (;;) { - selfdalloc(td, NULL); - error = sopoll(so, events, NULL, td); - /* error here is actually the ready events. */ - if (error) - return (0); - if (atv.tv_sec || atv.tv_usec) { - getmicrouptime(&rtv); - if (timevalcmp(&rtv, &atv, >=)) { - seltdclear(td); - return (EWOULDBLOCK); - } - ttv = atv; - timevalsub(&ttv, &rtv); - timo = ttv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&ttv); - } - error = seltdwait(td, timo); - seltdclear(td); - if (error) - break; - } - /* XXX Duplicates ncp/smb behavior. */ - if (error == ERESTART) - error = 0; - return (error); -} - -/* * Preallocate two selfds associated with 'cookie'. Some fo_poll routines * have two select sets, one for read and another for write. */ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/modules/Makefile Thu Oct 18 12:04:56 2012 (r241680) @@ -295,7 +295,6 @@ SUBDIR= \ siis \ sis \ sk \ - ${_smbfs} \ ${_sn} \ ${_snc} \ snp \ @@ -514,7 +513,6 @@ _rdma= rdma _safe= safe _sbni= sbni _scsi_low= scsi_low -_smbfs= smbfs _sound= sound _speaker= speaker _splash= splash @@ -712,7 +710,6 @@ _s3= s3 _safe= safe _scsi_low= scsi_low _sfxge= sfxge -_smbfs= smbfs _sound= sound _speaker= speaker _splash= splash @@ -768,7 +765,6 @@ _ips= ips _mly= mly _pccard= pccard _scsi_low= scsi_low -_smbfs= smbfs _sound= sound _splash= splash _sppp= sppp @@ -790,7 +786,6 @@ _cpufreq= cpufreq _exca= exca _nvram= powermac_nvram _pccard= pccard -_smbfs= smbfs _sound= sound .endif @@ -812,7 +807,6 @@ _igb= igb .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif -_smbfs= smbfs _sound= sound .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Thu Oct 18 10:29:16 2012 (r241679) +++ head/sys/sys/socketvar.h Thu Oct 18 12:04:56 2012 (r241680) @@ -368,8 +368,6 @@ void soupcall_clear(struct socket *so, i void soupcall_set(struct socket *so, int which, int (*func)(struct socket *, void *, int), void *arg); void sowakeup(struct socket *so, struct sockbuf *sb); -int selsocket(struct socket *so, int events, struct timeval *tv, - struct thread *td); /* * Accept filter functions (duh). Modified: head/usr.bin/Makefile.amd64 ============================================================================== --- head/usr.bin/Makefile.amd64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.bin/Makefile.amd64 Thu Oct 18 12:04:56 2012 (r241680) @@ -1,3 +1,2 @@ # $FreeBSD$ -SUBDIR+= smbutil Modified: head/usr.bin/Makefile.i386 ============================================================================== --- head/usr.bin/Makefile.i386 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.bin/Makefile.i386 Thu Oct 18 12:04:56 2012 (r241680) @@ -1,3 +1,2 @@ # $FreeBSD$ -SUBDIR+= smbutil Modified: head/usr.bin/Makefile.ia64 ============================================================================== --- head/usr.bin/Makefile.ia64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.bin/Makefile.ia64 Thu Oct 18 12:04:56 2012 (r241680) @@ -1,3 +1,2 @@ # $FreeBSD$ -SUBDIR+= smbutil Modified: head/usr.bin/Makefile.powerpc ============================================================================== --- head/usr.bin/Makefile.powerpc Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.bin/Makefile.powerpc Thu Oct 18 12:04:56 2012 (r241680) @@ -1,3 +1,2 @@ # $FreeBSD$ -SUBDIR+= smbutil Modified: head/usr.bin/Makefile.sparc64 ============================================================================== --- head/usr.bin/Makefile.sparc64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.bin/Makefile.sparc64 Thu Oct 18 12:04:56 2012 (r241680) @@ -1,3 +1,2 @@ # $FreeBSD$ -SUBDIR+= smbutil Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.bin/kdump/kdump.c Thu Oct 18 12:04:56 2012 (r241680) @@ -1420,8 +1420,6 @@ ktrsockaddr(struct sockaddr *sa) TODO: Support additional address families #include struct sockaddr_natm *natm; - #include - struct sockaddr_nb *nb; */ char addr[64]; Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.sbin/Makefile.amd64 Thu Oct 18 12:04:56 2012 (r241680) @@ -17,7 +17,6 @@ SUBDIR+= btxld SUBDIR+= cpucontrol SUBDIR+= kgmon SUBDIR+= lptcontrol -SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.sbin/Makefile.i386 Thu Oct 18 12:04:56 2012 (r241680) @@ -12,7 +12,6 @@ SUBDIR+= cpucontrol SUBDIR+= kgmon SUBDIR+= kgzip SUBDIR+= lptcontrol -SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt Modified: head/usr.sbin/Makefile.ia64 ============================================================================== --- head/usr.sbin/Makefile.ia64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.sbin/Makefile.ia64 Thu Oct 18 12:04:56 2012 (r241680) @@ -4,6 +4,5 @@ SUBDIR+= acpi .endif SUBDIR+= kgmon -SUBDIR+= mount_smbfs SUBDIR:= ${SUBDIR:Nuathload} SUBDIR+= zzz Modified: head/usr.sbin/Makefile.powerpc ============================================================================== --- head/usr.sbin/Makefile.powerpc Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.sbin/Makefile.powerpc Thu Oct 18 12:04:56 2012 (r241680) @@ -1,5 +1,4 @@ # $FreeBSD$ -SUBDIR+= mount_smbfs SUBDIR+= nvram SUBDIR+= ofwdump Modified: head/usr.sbin/Makefile.sparc64 ============================================================================== --- head/usr.sbin/Makefile.sparc64 Thu Oct 18 10:29:16 2012 (r241679) +++ head/usr.sbin/Makefile.sparc64 Thu Oct 18 12:04:56 2012 (r241680) @@ -1,7 +1,6 @@ # $FreeBSD$ SUBDIR+= eeprom -SUBDIR+= mount_smbfs SUBDIR+= ofwdump .if ${MK_SYSINSTALL} != "no" SUBDIR+= sade From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 12:08:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BBD46A9; Thu, 18 Oct 2012 12:08:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7B0958FC12; Thu, 18 Oct 2012 12:08:10 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so7082724lag.13 for ; Thu, 18 Oct 2012 05:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=pKKPgZxXC3LWW7ngGGOl5xuC6xuckQdozxrBE8O4Zd8=; b=YnIFLBC3K6OpMz9PvnpfH0J47sXLuwpmiKOx9GZkHQ81K1aK3qMMHk4wVp+hRXpiYf /1NwShvIklvpXqfMu3cW2ruHZlqq68ECHpe4pRGUbn1uoIRfY4YcxrKhKU8ewPhKhA9f iPs1VtHB2PqzFEyLLs25qYY0OilZ/dEJDlvK3+Q9RFtvXbIUeS8oGEyoOvrfXbKuiNRX WDk4p55BrzYvppGn0d3i8Ir3pfuXrKq/b/Q0usVM8gG3+MLJi86XOOr3wAuKvfSVLfCh PR2KTTMS39P9uh+IVjRioINFFehMblzmfT4ul2dbjzX7OQ/b6a3UgFKXfWj/Vtxaj1y9 2d7A== MIME-Version: 1.0 Received: by 10.112.28.98 with SMTP id a2mr7680239lbh.110.1350562089223; Thu, 18 Oct 2012 05:08:09 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 18 Oct 2012 05:08:09 -0700 (PDT) In-Reply-To: <201210181204.q9IC4uZJ029510@svn.freebsd.org> References: <201210181204.q9IC4uZJ029510@svn.freebsd.org> Date: Thu, 18 Oct 2012 13:08:09 +0100 X-Google-Sender-Auth: WfXPKoDUC4JRDAljeBc52fk1Fe0 Message-ID: Subject: Re: svn commit: r241680 - in head: etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sys/modules sys/sys usr.bin u... From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 12:08:11 -0000 On Thu, Oct 18, 2012 at 1:04 PM, Attilio Rao wrote: > Author: attilio > Date: Thu Oct 18 12:04:56 2012 > New Revision: 241680 > URL: http://svn.freebsd.org/changeset/base/241680 > > Log: > Disconnect non-MPSAFE SMBFS from the build in preparation for dropping > GIANT from VFS. In addition, disconnect also netsmb, which is a base > requirement for SMBFS. > > In the while SMBFS regular users can use FUSE interface and smbnetfs > port to work with their SMBFS partitions. > > Also, there are ongoing efforts by vendor to support in-kernel smbfs, > so there are good chances that it will get relinked once properly locked. > > This is not targeted for MFC. > > Modified: > head/etc/defaults/rc.conf > head/etc/mtree/BSD.include.dist > head/etc/mtree/BSD.usr.dist > head/include/Makefile > head/lib/Makefile > head/lib/libprocstat/Makefile > head/lib/libprocstat/common_kvm.h > head/lib/libprocstat/libprocstat.c > head/rescue/rescue/Makefile > head/sbin/mount/mount.8 > head/sbin/mount/mount.c > head/share/examples/Makefile > head/share/examples/etc/README.examples > head/share/mk/bsd.libnames.mk > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/files.amd64 > head/sys/conf/files.arm > head/sys/conf/files.i386 > head/sys/conf/files.ia64 > head/sys/conf/files.mips > head/sys/conf/files.pc98 > head/sys/conf/files.powerpc > head/sys/conf/files.sparc64 > head/sys/conf/options > head/sys/kern/Make.tags.inc > head/sys/kern/sys_generic.c > head/sys/modules/Makefile > head/sys/sys/socketvar.h > head/usr.bin/Makefile.amd64 As a related note, please note that usr.bin/Makefile.XXX are kept in order to fully support tbemd. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 12:11:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EA5B8F7; Thu, 18 Oct 2012 12:11:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172148FC0C; Thu, 18 Oct 2012 12:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ICBDMJ030849; Thu, 18 Oct 2012 12:11:13 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ICBDkm030847; Thu, 18 Oct 2012 12:11:13 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210181211.q9ICBDkm030847@svn.freebsd.org> From: Attilio Rao Date: Thu, 18 Oct 2012 12:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241682 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 12:11:14 -0000 Author: attilio Date: Thu Oct 18 12:11:13 2012 New Revision: 241682 URL: http://svn.freebsd.org/changeset/base/241682 Log: Record the full non-MPSAFE pack filesystem disconnect. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 18 12:06:26 2012 (r241681) +++ head/UPDATING Thu Oct 18 12:11:13 2012 (r241682) @@ -24,6 +24,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20121018: + All the non-MPSAFE filesystems have been disconnected from + the build. The full list includes: codafs, hpfs, ntfs, nwfs, + portalfs, smbfs, xfs. + 20121016: The interface cloning API and ABI has changed. The following modules need to be recompiled together with kernel: From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 12:32:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B71631F; Thu, 18 Oct 2012 12:32:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 298488FC19; Thu, 18 Oct 2012 12:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ICWqdI035083; Thu, 18 Oct 2012 12:32:52 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ICWpht035081; Thu, 18 Oct 2012 12:32:51 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201210181232.q9ICWpht035081@svn.freebsd.org> From: Brooks Davis Date: Thu, 18 Oct 2012 12:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241684 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 12:32:52 -0000 Author: brooks Date: Thu Oct 18 12:32:51 2012 New Revision: 241684 URL: http://svn.freebsd.org/changeset/base/241684 Log: Allow LOCAL_(DIRS,LIBS) to install files in directories not found in the system mtree files via a LOCAL_MTREE variable which contains a list of mtree files to be applyed along with the base mtree files to the tmp root and DESTDIR. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 18 12:22:12 2012 (r241683) +++ head/Makefile.inc1 Thu Oct 18 12:32:51 2012 (r241684) @@ -16,6 +16,8 @@ # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target +# LOCAL_MTREE="list of mtree files" to process to allow local directories +# to be created before files are installed # LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools # list # TARGET="machine" to crossbuild world for a different machine type @@ -407,6 +409,9 @@ _worldtmp: mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ -p ${WORLDTMP}/usr/include >/dev/null .endif +.for _mtree in ${LOCAL_MTREE} + mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null +.endfor _legacy: @echo @echo "--------------------------------------------------------------" @@ -724,7 +729,8 @@ reinstall: @echo "--------------------------------------------------------------" @echo ">>> Making hierarchy" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ + LOCAL_MTREE=${LOCAL_MTREE} hierarchy @echo @echo "--------------------------------------------------------------" @echo ">>> Installing everything" @@ -1221,6 +1227,10 @@ cross-tools: # hierarchy hier: cd ${.CURDIR}/etc; ${MAKE} distrib-dirs +.for _mtree in ${LOCAL_MTREE} + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/${_mtree} \ + -p ${DESTDIR}/ +.endfor # # libraries - build all libraries, and install them under ${DESTDIR}. From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 13:46:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA91562E; Thu, 18 Oct 2012 13:46:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2B9A8FC0C; Thu, 18 Oct 2012 13:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IDkQcV049879; Thu, 18 Oct 2012 13:46:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IDkQTu049877; Thu, 18 Oct 2012 13:46:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210181346.q9IDkQTu049877@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 18 Oct 2012 13:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241685 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 13:46:26 -0000 Author: glebius Date: Thu Oct 18 13:46:26 2012 New Revision: 241685 URL: http://svn.freebsd.org/changeset/base/241685 Log: Looks like support.h is really not needed here. Modified: head/contrib/bsnmp/snmp_mibII/mibII_route.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_route.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_route.c Thu Oct 18 12:32:51 2012 (r241684) +++ head/contrib/bsnmp/snmp_mibII/mibII_route.c Thu Oct 18 13:46:26 2012 (r241685) @@ -30,7 +30,6 @@ * * Routing table */ -/*#include "support.h"*/ #ifdef HAVE_SYS_TREE_H #include From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 13:47:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA49F7AE; Thu, 18 Oct 2012 13:47:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6BB268FC0C; Thu, 18 Oct 2012 13:47:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C38B5B91A; Thu, 18 Oct 2012 09:47:32 -0400 (EDT) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r241636 - in head: etc/mtree include lib/libprocstat rescue/rescue sbin sbin/mount share/dict share/man/man7 sys/boot/forth sys/conf sys/geom/label sys/kern sys/mips/rmi sys/modules sys... Date: Thu, 18 Oct 2012 08:30:00 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210171130.q9HBU0fH060245@svn.freebsd.org> <20121018030312.GA1983@reks> In-Reply-To: X-KMail-Markup: true MIME-Version: 1.0 Message-Id: <201210180830.00463.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 18 Oct 2012 09:47:32 -0400 (EDT) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Gleb Kurtsou , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 13:47:34 -0000 On Thursday, October 18, 2012 6:47:54 am Attilio Rao wrote: > On 10/18/12, Gleb Kurtsou wrote: > > On (17/10/2012 11:30), Attilio Rao wrote: > >> Author: attilio > >> Date: Wed Oct 17 11:30:00 2012 > >> New Revision: 241636 > >> URL: http://svn.freebsd.org/changeset/base/241636 > >> > >> Log: > >> Disconnect non-MPSAFE NTFS from the build in preparation for dropping > >> GIANT from VFS. This code is particulary broken and fragile and other > >> in-kernel implementations around, found in other operating systems, > >> don't really seem clean and solid enough to be imported at all. > >> If someone wants to reconsider in-kernel NTFS implementation for > >> inclusion again, a fair effort for completely fixing and cleaning it > >> up is expected. > >> > > [...] > > > > Why not to keep glabel ntfs support? I find it very useful on its own > > and it seems to require only a few constants and structs from ntfs.h > > > > I think that we just want to support FreeBSD specifically supported > filesystems for this? > I will talk to pjd and see what he thinks. Eh, I think handling volume labels for other filesystems is not a bad idea. For example, we support labels from ISO-9660 filesystems which isn't a FreeBSD-specific filesystem. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 13:57:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CA56E13; Thu, 18 Oct 2012 13:57:25 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F3B8FC12; Thu, 18 Oct 2012 13:57:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IDvPTg051694; Thu, 18 Oct 2012 13:57:25 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IDvOtC051673; Thu, 18 Oct 2012 13:57:24 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210181357.q9IDvOtC051673@svn.freebsd.org> From: Andre Oppermann Date: Thu, 18 Oct 2012 13:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241686 - in head/sys: net netgraph netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netinet netinet6 netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 13:57:25 -0000 Author: andre Date: Thu Oct 18 13:57:24 2012 New Revision: 241686 URL: http://svn.freebsd.org/changeset/base/241686 Log: Mechanically remove the last stray remains of spl* calls from net*/*. They have been Noop's for a long time now. Modified: head/sys/net/if.c head/sys/net/if_ef.c head/sys/net/if_gre.c head/sys/net/if_spppsubr.c head/sys/net/if_var.h head/sys/net/rtsock.c head/sys/netgraph/atm/ccatm/ng_ccatm.c head/sys/netgraph/atm/sscfu/ng_sscfu.c head/sys/netgraph/atm/sscop/ng_sscop.c head/sys/netgraph/atm/uni/ng_uni.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_fec.c head/sys/netgraph/ng_gif.c head/sys/netgraph/ng_ksocket.c head/sys/netgraph/ng_source.c head/sys/netinet/ip_ipsec.c head/sys/netinet6/in6.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/key.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/net/if.c Thu Oct 18 13:57:24 2012 (r241686) @@ -691,12 +691,9 @@ static void if_attachdomain(void *dummy) { struct ifnet *ifp; - int s; - s = splnet(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) if_attachdomain1(ifp); - splx(s); } SYSINIT(domainifattach, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_SECOND, if_attachdomain, NULL); @@ -705,21 +702,15 @@ static void if_attachdomain1(struct ifnet *ifp) { struct domain *dp; - int s; - - s = splnet(); /* * Since dp->dom_ifattach calls malloc() with M_WAITOK, we * cannot lock ifp->if_afdata initialization, entirely. */ - if (IF_AFDATA_TRYLOCK(ifp) == 0) { - splx(s); + if (IF_AFDATA_TRYLOCK(ifp) == 0) return; - } if (ifp->if_afdata_initialized >= domain_init_status) { IF_AFDATA_UNLOCK(ifp); - splx(s); printf("if_attachdomain called more than once on %s\n", ifp->if_xname); return; @@ -734,8 +725,6 @@ if_attachdomain1(struct ifnet *ifp) ifp->if_afdata[dp->dom_family] = (*dp->dom_ifattach)(ifp); } - - splx(s); } /* @@ -1825,7 +1814,6 @@ link_rtrequest(int cmd, struct rtentry * /* * Mark an interface down and notify protocols of * the transition. - * NOTE: must be called at splnet or eqivalent. */ static void if_unroute(struct ifnet *ifp, int flag, int fam) @@ -1849,7 +1837,6 @@ if_unroute(struct ifnet *ifp, int flag, /* * Mark an interface up and notify protocols of * the transition. - * NOTE: must be called at splnet or eqivalent. */ static void if_route(struct ifnet *ifp, int flag, int fam) @@ -1935,7 +1922,6 @@ do_link_state_change(void *arg, int pend /* * Mark an interface down and notify protocols of * the transition. - * NOTE: must be called at splnet or eqivalent. */ void if_down(struct ifnet *ifp) @@ -1947,7 +1933,6 @@ if_down(struct ifnet *ifp) /* * Mark an interface up and notify protocols of * the transition. - * NOTE: must be called at splnet or eqivalent. */ void if_up(struct ifnet *ifp) @@ -2150,14 +2135,10 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, /* Smart drivers twiddle their own routes */ } else if (ifp->if_flags & IFF_UP && (new_flags & IFF_UP) == 0) { - int s = splimp(); if_down(ifp); - splx(s); } else if (new_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) { - int s = splimp(); if_up(ifp); - splx(s); } /* See if permanently promiscuous mode bit is about to flip */ if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) { @@ -2605,11 +2586,8 @@ ifioctl(struct socket *so, u_long cmd, c if ((oif_flags ^ ifp->if_flags) & IFF_UP) { #ifdef INET6 - if (ifp->if_flags & IFF_UP) { - int s = splimp(); + if (ifp->if_flags & IFF_UP) in6_if_up(ifp); - splx(s); - } #endif } if_rele(ifp); Modified: head/sys/net/if_ef.c ============================================================================== --- head/sys/net/if_ef.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/net/if_ef.c Thu Oct 18 13:57:24 2012 (r241686) @@ -151,14 +151,10 @@ static int ef_detach(struct efnet *sc) { struct ifnet *ifp = sc->ef_ifp; - int s; - - s = splimp(); ether_ifdetach(ifp); if_free(ifp); - splx(s); return 0; } @@ -172,11 +168,10 @@ ef_ioctl(struct ifnet *ifp, u_long cmd, { struct efnet *sc = ifp->if_softc; struct ifaddr *ifa = (struct ifaddr*)data; - int s, error; + int error; EFDEBUG("IOCTL %ld for %s\n", cmd, ifp->if_xname); error = 0; - s = splimp(); switch (cmd) { case SIOCSIFFLAGS: error = 0; @@ -193,7 +188,6 @@ ef_ioctl(struct ifnet *ifp, u_long cmd, error = ether_ioctl(ifp, cmd, data); break; } - splx(s); return error; } Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/net/if_gre.c Thu Oct 18 13:57:24 2012 (r241686) @@ -518,7 +518,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, struct if_laddrreq *lifr = (struct if_laddrreq *)data; struct in_aliasreq *aifr = (struct in_aliasreq *)data; struct gre_softc *sc = ifp->if_softc; - int s; struct sockaddr_in si; struct sockaddr *sa = NULL; int error, adj; @@ -528,7 +527,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, error = 0; adj = 0; - s = splnet(); switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -848,7 +846,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, break; } - splx(s); return (error); } Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/net/if_spppsubr.c Thu Oct 18 13:57:24 2012 (r241686) @@ -791,13 +791,12 @@ sppp_output(struct ifnet *ifp, struct mb struct sppp *sp = IFP2SP(ifp); struct ppp_header *h; struct ifqueue *ifq = NULL; - int s, error, rv = 0; + int error, rv = 0; #ifdef INET int ipproto = PPP_IP; #endif int debug = ifp->if_flags & IFF_DEBUG; - s = splimp(); SPPP_LOCK(sp); if (!(ifp->if_flags & IFF_UP) || @@ -808,7 +807,6 @@ sppp_output(struct ifnet *ifp, struct mb #endif m_freem (m); SPPP_UNLOCK(sp); - splx (s); return (ENETDOWN); } @@ -832,9 +830,7 @@ sppp_output(struct ifnet *ifp, struct mb * to start LCP for it. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; - splx(s); lcp.Open(sp); - s = splimp(); } #ifdef INET @@ -858,7 +854,6 @@ sppp_output(struct ifnet *ifp, struct mb { m_freem(m); SPPP_UNLOCK(sp); - splx(s); if(ip->ip_p == IPPROTO_TCP) return(EADDRNOTAVAIL); else @@ -903,7 +898,6 @@ sppp_output(struct ifnet *ifp, struct mb default: m_freem(m); SPPP_UNLOCK(sp); - splx(s); return (EINVAL); } } @@ -933,7 +927,6 @@ nobufs: if (debug) SPP_ARGS(ifp)); ++ifp->if_oerrors; SPPP_UNLOCK(sp); - splx (s); return (ENOBUFS); } /* @@ -1000,7 +993,6 @@ nobufs: if (debug) m_freem (m); ++ifp->if_oerrors; SPPP_UNLOCK(sp); - splx (s); return (EAFNOSUPPORT); } @@ -1016,11 +1008,9 @@ out: if (error) { ++ifp->if_oerrors; SPPP_UNLOCK(sp); - splx (s); return (rv? rv: ENOBUFS); } SPPP_UNLOCK(sp); - splx (s); /* * Unlike in sppp_input(), we can always bump the timestamp * here since sppp_output() is only called on behalf of @@ -1137,14 +1127,12 @@ int sppp_isempty(struct ifnet *ifp) { struct sppp *sp = IFP2SP(ifp); - int empty, s; + int empty; - s = splimp(); SPPP_LOCK(sp); empty = !sp->pp_fastq.ifq_head && !sp->pp_cpq.ifq_head && !SP2IFP(sp)->if_snd.ifq_head; SPPP_UNLOCK(sp); - splx(s); return (empty); } @@ -1156,9 +1144,7 @@ sppp_dequeue(struct ifnet *ifp) { struct sppp *sp = IFP2SP(ifp); struct mbuf *m; - int s; - s = splimp(); SPPP_LOCK(sp); /* * Process only the control protocol queue until we have at @@ -1175,7 +1161,6 @@ sppp_dequeue(struct ifnet *ifp) IF_DEQUEUE (&SP2IFP(sp)->if_snd, m); } SPPP_UNLOCK(sp); - splx(s); return m; } @@ -1187,9 +1172,7 @@ sppp_pick(struct ifnet *ifp) { struct sppp *sp = IFP2SP(ifp); struct mbuf *m; - int s; - s = splimp (); SPPP_LOCK(sp); m = sp->pp_cpq.ifq_head; @@ -1200,7 +1183,6 @@ sppp_pick(struct ifnet *ifp) if ((m = sp->pp_fastq.ifq_head) == NULL) m = SP2IFP(sp)->if_snd.ifq_head; SPPP_UNLOCK(sp); - splx (s); return (m); } @@ -1212,9 +1194,8 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_ { struct ifreq *ifr = (struct ifreq*) data; struct sppp *sp = IFP2SP(ifp); - int s, rv, going_up, going_down, newmode; + int rv, going_up, going_down, newmode; - s = splimp(); SPPP_LOCK(sp); rv = 0; switch (cmd) { @@ -1320,7 +1301,6 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_ rv = ENOTTY; } SPPP_UNLOCK(sp); - splx(s); return rv; } @@ -2070,9 +2050,7 @@ static void sppp_to_event(const struct cp *cp, struct sppp *sp) { STDDCL; - int s; - s = splimp(); SPPP_LOCK(sp); if (debug) log(LOG_DEBUG, SPP_FMT "%s TO(%s) rst_counter = %d\n", @@ -2122,7 +2100,6 @@ sppp_to_event(const struct cp *cp, struc } SPPP_UNLOCK(sp); - splx(s); } /* @@ -4025,7 +4002,7 @@ sppp_chap_input(struct sppp *sp, struct { STDDCL; struct lcp_header *h; - int len, x; + int len; u_char *value, *name, digest[AUTHKEYLEN], dsize; int value_len, name_len; MD5_CTX ctx; @@ -4102,7 +4079,6 @@ sppp_chap_input(struct sppp *sp, struct } log(-1, "\n"); } - x = splimp(); SPPP_LOCK(sp); sp->pp_flags &= ~PP_NEEDAUTH; if (sp->myauth.proto == PPP_CHAP && @@ -4114,11 +4090,9 @@ sppp_chap_input(struct sppp *sp, struct * to network phase. */ SPPP_UNLOCK(sp); - splx(x); break; } SPPP_UNLOCK(sp); - splx(x); sppp_phase_network(sp); break; @@ -4280,9 +4254,7 @@ sppp_chap_TO(void *cookie) { struct sppp *sp = (struct sppp *)cookie; STDDCL; - int s; - s = splimp(); SPPP_LOCK(sp); if (debug) log(LOG_DEBUG, SPP_FMT "chap TO(%s) rst_counter = %d\n", @@ -4313,14 +4285,13 @@ sppp_chap_TO(void *cookie) } SPPP_UNLOCK(sp); - splx(s); } static void sppp_chap_tlu(struct sppp *sp) { STDDCL; - int i, x; + int i; i = 0; sp->rst_counter[IDX_CHAP] = sp->lcp.max_configure; @@ -4351,7 +4322,6 @@ sppp_chap_tlu(struct sppp *sp) log(-1, "re-challenging supressed\n"); } - x = splimp(); SPPP_LOCK(sp); /* indicate to LCP that we need to be closed down */ sp->lcp.protos |= (1 << IDX_CHAP); @@ -4363,11 +4333,9 @@ sppp_chap_tlu(struct sppp *sp) * phase. */ SPPP_UNLOCK(sp); - splx(x); return; } SPPP_UNLOCK(sp); - splx(x); /* * If we are already in phase network, we are done here. This @@ -4436,7 +4404,7 @@ sppp_pap_input(struct sppp *sp, struct m { STDDCL; struct lcp_header *h; - int len, x; + int len; u_char *name, *passwd, mlen; int name_len, passwd_len; @@ -4523,7 +4491,6 @@ sppp_pap_input(struct sppp *sp, struct m } log(-1, "\n"); } - x = splimp(); SPPP_LOCK(sp); sp->pp_flags &= ~PP_NEEDAUTH; if (sp->myauth.proto == PPP_PAP && @@ -4535,11 +4502,9 @@ sppp_pap_input(struct sppp *sp, struct m * to network phase. */ SPPP_UNLOCK(sp); - splx(x); break; } SPPP_UNLOCK(sp); - splx(x); sppp_phase_network(sp); break; @@ -4620,9 +4585,7 @@ sppp_pap_TO(void *cookie) { struct sppp *sp = (struct sppp *)cookie; STDDCL; - int s; - s = splimp(); SPPP_LOCK(sp); if (debug) log(LOG_DEBUG, SPP_FMT "pap TO(%s) rst_counter = %d\n", @@ -4648,7 +4611,6 @@ sppp_pap_TO(void *cookie) } SPPP_UNLOCK(sp); - splx(s); } /* @@ -4675,7 +4637,6 @@ static void sppp_pap_tlu(struct sppp *sp) { STDDCL; - int x; sp->rst_counter[IDX_PAP] = sp->lcp.max_configure; @@ -4683,7 +4644,6 @@ sppp_pap_tlu(struct sppp *sp) log(LOG_DEBUG, SPP_FMT "%s tlu\n", SPP_ARGS(ifp), pap.name); - x = splimp(); SPPP_LOCK(sp); /* indicate to LCP that we need to be closed down */ sp->lcp.protos |= (1 << IDX_PAP); @@ -4695,11 +4655,9 @@ sppp_pap_tlu(struct sppp *sp) * phase. */ SPPP_UNLOCK(sp); - splx(x); return; } SPPP_UNLOCK(sp); - splx(x); sppp_phase_network(sp); } @@ -4837,9 +4795,7 @@ sppp_keepalive(void *dummy) { struct sppp *sp = (struct sppp*)dummy; struct ifnet *ifp = SP2IFP(sp); - int s; - s = splimp(); SPPP_LOCK(sp); /* Keepalive mode disabled or channel down? */ if (! (sp->pp_flags & PP_KEEPALIVE) || @@ -4882,7 +4838,6 @@ sppp_keepalive(void *dummy) } out: SPPP_UNLOCK(sp); - splx(s); callout_reset(&sp->keepalive_callout, hz * 10, sppp_keepalive, (void *)sp); } @@ -4932,7 +4887,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_lon #ifdef INET /* - * Set my IP address. Must be called at splimp. + * Set my IP address. */ static void sppp_set_ip_addr(struct sppp *sp, u_long src) @@ -5049,7 +5004,7 @@ sppp_gen_ip6_addr(struct sppp *sp, struc } /* - * Set my IPv6 address. Must be called at splimp. + * Set my IPv6 address. */ static void sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/net/if_var.h Thu Oct 18 13:57:24 2012 (r241686) @@ -274,7 +274,7 @@ void if_maddr_runlock(struct ifnet *ifp) * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq) * are queues of messages stored on ifqueue structures * (defined above). Entries are added to and deleted from these structures - * by these macros, which should be called with ipl raised to splimp(). + * by these macros. */ #define IF_LOCK(ifq) mtx_lock(&(ifq)->ifq_mtx) #define IF_UNLOCK(ifq) mtx_unlock(&(ifq)->ifq_mtx) Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/net/rtsock.c Thu Oct 18 13:57:24 2012 (r241686) @@ -302,7 +302,7 @@ static int rts_attach(struct socket *so, int proto, struct thread *td) { struct rawcb *rp; - int s, error; + int error; KASSERT(so->so_pcb == NULL, ("rts_attach: so_pcb != NULL")); @@ -311,20 +311,11 @@ rts_attach(struct socket *so, int proto, if (rp == NULL) return ENOBUFS; - /* - * The splnet() is necessary to block protocols from sending - * error notifications (like RTM_REDIRECT or RTM_LOSING) while - * this PCB is extant but incompletely initialized. - * Probably we should try to do more of this work beforehand and - * eliminate the spl. - */ - s = splnet(); so->so_pcb = (caddr_t)rp; so->so_fibnum = td->td_proc->p_fibnum; error = raw_attach(so, proto); rp = sotorawcb(so); if (error) { - splx(s); so->so_pcb = NULL; free(rp, M_PCB); return error; @@ -345,7 +336,6 @@ rts_attach(struct socket *so, int proto, RTSOCK_UNLOCK(); soisconnected(so); so->so_options |= SO_USELOOPBACK; - splx(s); return 0; } Modified: head/sys/netgraph/atm/ccatm/ng_ccatm.c ============================================================================== --- head/sys/netgraph/atm/ccatm/ng_ccatm.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/atm/ccatm/ng_ccatm.c Thu Oct 18 13:57:24 2012 (r241686) @@ -1178,10 +1178,8 @@ ng_ccatm_log(const char *fmt, ...) static int ng_ccatm_mod_event(module_t mod, int event, void *data) { - int s; int error = 0; - s = splnet(); switch (event) { case MOD_LOAD: @@ -1194,6 +1192,5 @@ ng_ccatm_mod_event(module_t mod, int eve error = EOPNOTSUPP; break; } - splx(s); return (error); } Modified: head/sys/netgraph/atm/sscfu/ng_sscfu.c ============================================================================== --- head/sys/netgraph/atm/sscfu/ng_sscfu.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/atm/sscfu/ng_sscfu.c Thu Oct 18 13:57:24 2012 (r241686) @@ -587,10 +587,8 @@ sscfu_verbose(struct sscfu *sscfu, void static int ng_sscfu_mod_event(module_t mod, int event, void *data) { - int s; int error = 0; - s = splnet(); switch (event) { case MOD_LOAD: @@ -603,6 +601,5 @@ ng_sscfu_mod_event(module_t mod, int eve error = EOPNOTSUPP; break; } - splx(s); return (error); } Modified: head/sys/netgraph/atm/sscop/ng_sscop.c ============================================================================== --- head/sys/netgraph/atm/sscop/ng_sscop.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/atm/sscop/ng_sscop.c Thu Oct 18 13:57:24 2012 (r241686) @@ -861,10 +861,8 @@ sscop_send_manage(struct sscop *sscop, v static int ng_sscop_mod_event(module_t mod, int event, void *data) { - int s; int error = 0; - s = splnet(); switch (event) { case MOD_LOAD: @@ -877,6 +875,5 @@ ng_sscop_mod_event(module_t mod, int eve error = EOPNOTSUPP; break; } - splx(s); return (error); } Modified: head/sys/netgraph/atm/uni/ng_uni.c ============================================================================== --- head/sys/netgraph/atm/uni/ng_uni.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/atm/uni/ng_uni.c Thu Oct 18 13:57:24 2012 (r241686) @@ -907,10 +907,8 @@ ng_uni_free(enum unimem type, void *ptr, static int ng_uni_mod_event(module_t mod, int event, void *data) { - int s; int error = 0; - s = splnet(); switch(event) { case MOD_LOAD: @@ -925,6 +923,5 @@ ng_uni_mod_event(module_t mod, int event error = EOPNOTSUPP; break; } - splx(s); return (error); } Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/ng_eiface.c Thu Oct 18 13:57:24 2012 (r241686) @@ -132,12 +132,11 @@ ng_eiface_ioctl(struct ifnet *ifp, u_lon { const priv_p priv = (priv_p)ifp->if_softc; struct ifreq *const ifr = (struct ifreq *)data; - int s, error = 0; + int error = 0; #ifdef DEBUG ng_eiface_print_ioctl(ifp, command, data); #endif - s = splimp(); switch (command) { /* These two are mostly handled at a higher layer */ @@ -193,7 +192,6 @@ ng_eiface_ioctl(struct ifnet *ifp, u_lon error = EINVAL; break; } - splx(s); return (error); } @@ -202,14 +200,9 @@ ng_eiface_init(void *xsc) { priv_p sc = xsc; struct ifnet *ifp = sc->ifp; - int s; - - s = splimp(); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - - splx(s); } /* Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/ng_ether.c Thu Oct 18 13:57:24 2012 (r241686) @@ -220,8 +220,6 @@ NETGRAPH_INIT(ether, &ng_ether_typestruc /* * Handle a packet that has come in on an interface. We get to * look at it here before any upper layer protocols do. - * - * NOTE: this function will get called at splimp() */ static void ng_ether_input(struct ifnet *ifp, struct mbuf **mp) @@ -239,8 +237,6 @@ ng_ether_input(struct ifnet *ifp, struct /* * Handle a packet that has come in on an interface, and which * does not match any of our known protocols (an ``orphan''). - * - * NOTE: this function will get called at splimp() */ static void ng_ether_input_orphan(struct ifnet *ifp, struct mbuf *m) @@ -759,9 +755,7 @@ static int ng_ether_mod_event(module_t mod, int event, void *data) { int error = 0; - int s; - s = splnet(); switch (event) { case MOD_LOAD: @@ -802,7 +796,6 @@ ng_ether_mod_event(module_t mod, int eve error = EOPNOTSUPP; break; } - splx(s); return (error); } Modified: head/sys/netgraph/ng_fec.c ============================================================================== --- head/sys/netgraph/ng_fec.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/ng_fec.c Thu Oct 18 13:57:24 2012 (r241686) @@ -753,7 +753,7 @@ static int ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct ifreq *const ifr = (struct ifreq *) data; - int s, error = 0; + int error = 0; struct ng_fec_private *priv; struct ng_fec_bundle *b; @@ -763,7 +763,6 @@ ng_fec_ioctl(struct ifnet *ifp, u_long c #ifdef DEBUG ng_fec_print_ioctl(ifp, command, data); #endif - s = splimp(); switch (command) { /* These two are mostly handled at a higher layer */ @@ -843,7 +842,6 @@ ng_fec_ioctl(struct ifnet *ifp, u_long c error = EINVAL; break; } - (void) splx(s); return (error); } Modified: head/sys/netgraph/ng_gif.c ============================================================================== --- head/sys/netgraph/ng_gif.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/ng_gif.c Thu Oct 18 13:57:24 2012 (r241686) @@ -163,8 +163,6 @@ NETGRAPH_INIT(gif, &ng_gif_typestruct); /* * Handle a packet that has come in on an interface. We get to * look at it here before any upper layer protocols do. - * - * NOTE: this function will get called at splimp() */ static void ng_gif_input(struct ifnet *ifp, struct mbuf **mp, int af) @@ -181,8 +179,6 @@ ng_gif_input(struct ifnet *ifp, struct m /* * Handle a packet that has come in on an interface, and which * does not match any of our known protocols (an ``orphan''). - * - * NOTE: this function will get called at splimp() */ static void ng_gif_input_orphan(struct ifnet *ifp, struct mbuf *m, int af) @@ -203,8 +199,6 @@ ng_gif_input_orphan(struct ifnet *ifp, s /* * Handle a packet that has come in on a gif interface. * Attach the address family to the mbuf for later use. - * - * NOTE: this function will get called at splimp() */ static void ng_gif_input2(node_p node, struct mbuf **mp, int af) @@ -543,9 +537,7 @@ ng_gif_mod_event(module_t mod, int event VNET_ITERATOR_DECL(vnet_iter); struct ifnet *ifp; int error = 0; - int s; - s = splnet(); switch (event) { case MOD_LOAD: @@ -597,7 +589,6 @@ ng_gif_mod_event(module_t mod, int event error = EOPNOTSUPP; break; } - splx(s); return (error); } Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/ng_ksocket.c Thu Oct 18 13:57:24 2012 (r241686) @@ -1045,9 +1045,7 @@ ng_ksocket_incoming2(node_p node, hook_p struct mbuf *m; struct ng_mesg *response; struct uio auio; - int s, flags, error; - - s = splnet(); + int flags, error; /* so = priv->so; *//* XXX could have derived this like so */ KASSERT(so == priv->so, ("%s: wrong socket", __func__)); @@ -1094,10 +1092,8 @@ ng_ksocket_incoming2(node_p node, hook_p * the hook gets created and is connected, this upcall function * will be called again. */ - if (priv->hook == NULL) { - splx(s); + if (priv->hook == NULL) return; - } /* Read and forward available mbuf's */ auio.uio_td = NULL; @@ -1165,7 +1161,6 @@ sendit: /* Forward data with optional p } priv->flags |= KSF_EOFSEEN; } - splx(s); } /* Modified: head/sys/netgraph/ng_source.c ============================================================================== --- head/sys/netgraph/ng_source.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netgraph/ng_source.c Thu Oct 18 13:57:24 2012 (r241686) @@ -608,7 +608,6 @@ static int ng_source_store_output_ifp(sc_p sc, char *ifname) { struct ifnet *ifp; - int s; ifp = ifunit(ifname); @@ -624,13 +623,11 @@ ng_source_store_output_ifp(sc_p sc, char * interface with small packets. * XXX we should restore the original value at stop or disconnect */ - s = splimp(); /* XXX is this required? */ if (ifp->if_snd.ifq_maxlen < NG_SOURCE_DRIVER_IFQ_MAXLEN) { printf("ng_source: changing ifq_maxlen from %d to %d\n", ifp->if_snd.ifq_maxlen, NG_SOURCE_DRIVER_IFQ_MAXLEN); ifp->if_snd.ifq_maxlen = NG_SOURCE_DRIVER_IFQ_MAXLEN; } - splx(s); #endif return (0); } Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netinet/ip_ipsec.c Thu Oct 18 13:57:24 2012 (r241686) @@ -117,10 +117,9 @@ ip_ipsec_fwd(struct mbuf *m) struct m_tag *mtag; struct tdb_ident *tdbi; struct secpolicy *sp; - int s, error; + int error; mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL); - s = splnet(); if (mtag != NULL) { tdbi = (struct tdb_ident *)(mtag + 1); sp = ipsec_getpolicy(tdbi, IPSEC_DIR_INBOUND); @@ -129,7 +128,6 @@ ip_ipsec_fwd(struct mbuf *m) IP_FORWARDING, &error); } if (sp == NULL) { /* NB: can happen if error */ - splx(s); /*XXX error stat???*/ DPRINTF(("ip_input: no SP for forwarding\n")); /*XXX*/ return 1; @@ -140,7 +138,6 @@ ip_ipsec_fwd(struct mbuf *m) */ error = ipsec_in_reject(sp, m); KEY_FREESP(&sp); - splx(s); if (error) { IPSTAT_INC(ips_cantforward); return 1; @@ -164,7 +161,7 @@ ip_ipsec_input(struct mbuf *m) struct m_tag *mtag; struct tdb_ident *tdbi; struct secpolicy *sp; - int s, error; + int error; /* * enforce IPsec policy checking if we are seeing last header. * note that we do not visit this with protocols with pcb layer @@ -178,7 +175,6 @@ ip_ipsec_input(struct mbuf *m) * packet is returned to the ip input queue for delivery. */ mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL); - s = splnet(); if (mtag != NULL) { tdbi = (struct tdb_ident *)(mtag + 1); sp = ipsec_getpolicy(tdbi, IPSEC_DIR_INBOUND); @@ -198,7 +194,6 @@ ip_ipsec_input(struct mbuf *m) DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ return 1; } - splx(s); if (error) return 1; } @@ -267,7 +262,6 @@ ip_ipsec_output(struct mbuf **m, struct struct ip *ip = mtod(*m, struct ip *); struct tdb_ident *tdbi; struct m_tag *mtag; - int s; /* * Check the security policy (SP) for the packet and, if * required, do IPsec-related processing. There are two @@ -278,7 +272,6 @@ ip_ipsec_output(struct mbuf **m, struct * the lookup and related policy checking. */ mtag = m_tag_find(*m, PACKET_TAG_IPSEC_PENDING_TDB, NULL); - s = splnet(); if (mtag != NULL) { tdbi = (struct tdb_ident *)(mtag + 1); sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); @@ -327,7 +320,6 @@ ip_ipsec_output(struct mbuf **m, struct * done: below. */ KEY_FREESP(&sp), sp = NULL; - splx(s); goto done; } } @@ -372,10 +364,8 @@ ip_ipsec_output(struct mbuf **m, struct */ if (*error == ENOENT) *error = 0; - splx(s); goto reinjected; } else { /* sp == NULL */ - splx(s); if (*error != 0) { /* Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Thu Oct 18 13:46:26 2012 (r241685) +++ head/sys/netinet6/in6.c Thu Oct 18 13:57:24 2012 (r241686) @@ -995,7 +995,6 @@ cleanup: * Update parameters of an IPv6 interface address. * If necessary, a new entry is created and linked into address chains. * This function is separated from in6_control(). - * XXX: should this be performed under splnet()? */ int in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, @@ -1522,7 +1521,6 @@ in6_purgeaddr(struct ifaddr *ifa) static void in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp) { - int s = splnet(); IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); @@ -1560,7 +1558,6 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st pfxlist_onlink_check(); } ifa_free(&ia->ia_ifa); /* in6_ifaddrhead */ - splx(s); } void @@ -1856,7 +1853,6 @@ in6_ifinit(struct ifnet *ifp, struct in6 struct sockaddr_in6 *sin6, int newhost) { int error = 0, plen, ifacount = 0; - int s = splimp(); struct ifaddr *ifa; /* @@ -1876,12 +1872,9 @@ in6_ifinit(struct ifnet *ifp, struct in6 if (ifacount <= 1 && ifp->if_ioctl) { error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); - if (error) { - splx(s); + if (error) return (error); - } } - splx(s); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 13:57:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBC3FE18; Thu, 18 Oct 2012 13:57:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3AB38FC16; Thu, 18 Oct 2012 13:57:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IDvSfw051740; Thu, 18 Oct 2012 13:57:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IDvSrU051738; Thu, 18 Oct 2012 13:57:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210181357.q9IDvSrU051738@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 18 Oct 2012 13:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241687 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 13:57:28 -0000 Author: glebius Date: Thu Oct 18 13:57:28 2012 New Revision: 241687 URL: http://svn.freebsd.org/changeset/base/241687 Log: Utilize new macro to initialize if_baudrate. Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Oct 18 13:57:24 2012 (r241686) +++ head/sys/dev/mxge/if_mxge.c Thu Oct 18 13:57:28 2012 (r241687) @@ -3017,7 +3017,7 @@ mxge_intr(void *arg) sc->link_state = stats->link_up; if (sc->link_state) { if_link_state_change(sc->ifp, LINK_STATE_UP); - sc->ifp->if_baudrate = IF_Gbps(10UL); + if_initbaudrate(sc->ifp, IF_Gbps(10)); if (mxge_verbose) device_printf(sc->dev, "link up\n"); } else { @@ -4773,7 +4773,7 @@ mxge_attach(device_t dev) goto abort_with_rings; } - ifp->if_baudrate = IF_Gbps(10UL); + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 | IFCAP_VLAN_MTU | IFCAP_LINKSTATE; #ifdef INET From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 14:08:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29FAD234; Thu, 18 Oct 2012 14:08:27 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1054E8FC17; Thu, 18 Oct 2012 14:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IE8Q19053497; Thu, 18 Oct 2012 14:08:26 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IE8QwE053495; Thu, 18 Oct 2012 14:08:26 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210181408.q9IE8QwE053495@svn.freebsd.org> From: Andre Oppermann Date: Thu, 18 Oct 2012 14:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241688 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 14:08:27 -0000 Author: andre Date: Thu Oct 18 14:08:26 2012 New Revision: 241688 URL: http://svn.freebsd.org/changeset/base/241688 Log: Use LOG_WARNING level in in_attachdomain1() instead of printf(). Submitted by: vijju.singh-at-gmail.com Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Oct 18 13:57:28 2012 (r241687) +++ head/sys/net/if.c Thu Oct 18 14:08:26 2012 (r241688) @@ -711,8 +711,8 @@ if_attachdomain1(struct ifnet *ifp) return; if (ifp->if_afdata_initialized >= domain_init_status) { IF_AFDATA_UNLOCK(ifp); - printf("if_attachdomain called more than once on %s\n", - ifp->if_xname); + log(LOG_WARNING, "if_attachdomain called more than once " + "on %s\n", ifp->if_xname); return; } ifp->if_afdata_initialized = domain_init_status; From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 14:11:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16300451; Thu, 18 Oct 2012 14:11:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 8126A8FC16; Thu, 18 Oct 2012 14:11:27 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9IEBKv4049459; Thu, 18 Oct 2012 18:11:20 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9IEBKqg049458; Thu, 18 Oct 2012 18:11:20 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 18 Oct 2012 18:11:20 +0400 From: Gleb Smirnoff To: Andre Oppermann Subject: Re: svn commit: r241688 - head/sys/net Message-ID: <20121018141120.GJ89655@FreeBSD.org> References: <201210181408.q9IE8QwE053495@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210181408.q9IE8QwE053495@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 14:11:28 -0000 On Thu, Oct 18, 2012 at 02:08:26PM +0000, Andre Oppermann wrote: A> Author: andre A> Date: Thu Oct 18 14:08:26 2012 A> New Revision: 241688 A> URL: http://svn.freebsd.org/changeset/base/241688 A> A> Log: A> Use LOG_WARNING level in in_attachdomain1() instead of printf(). A> A> Submitted by: vijju.singh-at-gmail.com A> A> Modified: A> head/sys/net/if.c A> A> Modified: head/sys/net/if.c A> ============================================================================== A> --- head/sys/net/if.c Thu Oct 18 13:57:28 2012 (r241687) A> +++ head/sys/net/if.c Thu Oct 18 14:08:26 2012 (r241688) A> @@ -711,8 +711,8 @@ if_attachdomain1(struct ifnet *ifp) A> return; A> if (ifp->if_afdata_initialized >= domain_init_status) { A> IF_AFDATA_UNLOCK(ifp); A> - printf("if_attachdomain called more than once on %s\n", A> - ifp->if_xname); A> + log(LOG_WARNING, "if_attachdomain called more than once " A> + "on %s\n", ifp->if_xname); A> return; A> } A> ifp->if_afdata_initialized = domain_init_status; It'll be even more perfect if done as "%s called more than once on %s\n", __func__, ifp->if_xname And do we need "\n" for log(9)? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 14:25:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBAC36B8; Thu, 18 Oct 2012 14:25:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1F058FC08; Thu, 18 Oct 2012 14:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IEPXIq056178; Thu, 18 Oct 2012 14:25:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IEPX6o056176; Thu, 18 Oct 2012 14:25:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210181425.q9IEPX6o056176@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 18 Oct 2012 14:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241689 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 14:25:33 -0000 Author: glebius Date: Thu Oct 18 14:25:33 2012 New Revision: 241689 URL: http://svn.freebsd.org/changeset/base/241689 Log: Fix build after r241659. Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 14:08:26 2012 (r241688) +++ head/sys/dev/nvme/nvme_qpair.c Thu Oct 18 14:25:33 2012 (r241689) @@ -124,7 +124,7 @@ nvme_qpair_process_completions(struct nv qpair->act_tr[cpl->cid] = NULL; - KASSERT(cpl->cid == tr->cmd.cid, + KASSERT(cpl->cid == req->cmd.cid, ("cpl cid does not match cmd cid\n")); if (req->cb_fn && !retry) From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:14:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08C02859; Thu, 18 Oct 2012 15:14:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E51B68FC14; Thu, 18 Oct 2012 15:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IFEDAo064241; Thu, 18 Oct 2012 15:14:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IFEDMq064239; Thu, 18 Oct 2012 15:14:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210181514.q9IFEDMq064239@svn.freebsd.org> From: John Baldwin Date: Thu, 18 Oct 2012 15:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241691 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:14:14 -0000 Author: jhb Date: Thu Oct 18 15:14:13 2012 New Revision: 241691 URL: http://svn.freebsd.org/changeset/base/241691 Log: Use if_initbaudrate(). Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Thu Oct 18 14:57:11 2012 (r241690) +++ head/sys/dev/oce/oce_if.c Thu Oct 18 15:14:13 2012 (r241691) @@ -1652,7 +1652,7 @@ oce_attach_ifp(POCE_SOFTC sc) #endif sc->ifp->if_capenable = sc->ifp->if_capabilities; - sc->ifp->if_baudrate = IF_Gbps(10UL); + if_initbaudrate(sc->ifp, IF_Gbps(10)); ether_ifattach(sc->ifp, sc->macaddr.mac_addr); From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:39:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C29E471C; Thu, 18 Oct 2012 15:39:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A902D8FC0A; Thu, 18 Oct 2012 15:39:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IFdTAJ068668; Thu, 18 Oct 2012 15:39:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IFdTgW068664; Thu, 18 Oct 2012 15:39:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210181539.q9IFdTgW068664@svn.freebsd.org> From: Ed Schouten Date: Thu, 18 Oct 2012 15:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241695 - in head: lib/libstdbuf usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:39:29 -0000 Author: ed Date: Thu Oct 18 15:39:29 2012 New Revision: 241695 URL: http://svn.freebsd.org/changeset/base/241695 Log: Remove WARNS=6 lines. WARNS=6 is already implied at this point. Modified: head/lib/libstdbuf/Makefile head/usr.bin/sort/Makefile Modified: head/lib/libstdbuf/Makefile ============================================================================== --- head/lib/libstdbuf/Makefile Thu Oct 18 15:24:58 2012 (r241694) +++ head/lib/libstdbuf/Makefile Thu Oct 18 15:39:29 2012 (r241695) @@ -7,6 +7,4 @@ SRCS= stdbuf.c SHLIB_MAJOR= 1 MAN= libstdbuf.3 -WARNS?= 6 - .include Modified: head/usr.bin/sort/Makefile ============================================================================== --- head/usr.bin/sort/Makefile Thu Oct 18 15:24:58 2012 (r241694) +++ head/usr.bin/sort/Makefile Thu Oct 18 15:39:29 2012 (r241695) @@ -6,8 +6,6 @@ PROG= sort SRCS= bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c -WARNS= 6 - sort.1: sort.1.in /usr/bin/sed ${MAN_SUB} ${.ALLSRC} >${.TARGET} From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:40:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA3258D1; Thu, 18 Oct 2012 15:40:36 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id A185A8FC16; Thu, 18 Oct 2012 15:40:36 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so9072254pad.13 for ; Thu, 18 Oct 2012 08:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=UXKA+EatUQu6xkKUCXxGRFZmyUhjv0tt9vSwat5Ob5M=; b=duxSuVh/gfCbx2OfQM/nP3KHKQ+eN04Zot4EpAHQ1NaVKrK8DQS5Tp4qmzrHeRQYPs A2cqXIClvwd5Moi7XXNWANn2jOhIoarh1KFAy7HHug1naeWhJ/2+2aufshl9rZlV6Jd9 vUWKs2kpUgloQNIZ6oJz+UuuFJPpkA0BdIHWfycw4LIcVoOA2+n1buhlQIBkQAwv1usR ioAMXp1LkQV/HmQ99ziLbYk5T2wj00WyvQtSVvTxEZqH3wpm3eoxeckT9XrJj3wIdAV0 QWKxtLwPe/15G/AE+yyhPc233QV3UCaStq07bQslbLo88jr6mzbz8pyM00hFCI8TVHTe N7IA== MIME-Version: 1.0 Received: by 10.68.136.138 with SMTP id qa10mr67927443pbb.142.1350574836089; Thu, 18 Oct 2012 08:40:36 -0700 (PDT) Sender: maksim.yevmenkin@gmail.com Received: by 10.68.240.38 with HTTP; Thu, 18 Oct 2012 08:40:36 -0700 (PDT) In-Reply-To: <201210181514.q9IFEDMq064239@svn.freebsd.org> References: <201210181514.q9IFEDMq064239@svn.freebsd.org> Date: Thu, 18 Oct 2012 08:40:36 -0700 X-Google-Sender-Auth: mLL0Pu-P2d12hbhQPWb4Pg0B3yA Message-ID: Subject: Re: svn commit: r241691 - head/sys/dev/oce From: Maksim Yevmenkin To: John Baldwin , Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:40:37 -0000 On Thu, Oct 18, 2012 at 8:14 AM, John Baldwin wrote: > Author: jhb > Date: Thu Oct 18 15:14:13 2012 > New Revision: 241691 > URL: http://svn.freebsd.org/changeset/base/241691 > > Log: > Use if_initbaudrate(). thank you for fixing this. i did not realize that there would be so much fallout form this :( next time i would make universe first :( sorry about this max From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:42:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FDF2A71; Thu, 18 Oct 2012 15:42:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6EBE18FC14; Thu, 18 Oct 2012 15:42:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D2BB0B972; Thu, 18 Oct 2012 11:42:20 -0400 (EDT) From: John Baldwin To: Maksim Yevmenkin Subject: Re: svn commit: r241691 - head/sys/dev/oce Date: Thu, 18 Oct 2012 11:42:06 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210181514.q9IFEDMq064239@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201210181142.06218.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 18 Oct 2012 11:42:20 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:42:21 -0000 On Thursday, October 18, 2012 11:40:36 am Maksim Yevmenkin wrote: > On Thu, Oct 18, 2012 at 8:14 AM, John Baldwin wrote: > > Author: jhb > > Date: Thu Oct 18 15:14:13 2012 > > New Revision: 241691 > > URL: http://svn.freebsd.org/changeset/base/241691 > > > > Log: > > Use if_initbaudrate(). > > thank you for fixing this. i did not realize that there would be so > much fallout form this :( next time i would make universe first :( > > sorry about this It's ok, I didn't realize either. I am still testing some changes in the InfiBand code as well. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:43:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63C5EBE5; Thu, 18 Oct 2012 15:43:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 494958FC0A; Thu, 18 Oct 2012 15:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IFhKh0069329; Thu, 18 Oct 2012 15:43:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IFhKBN069327; Thu, 18 Oct 2012 15:43:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210181543.q9IFhKBN069327@svn.freebsd.org> From: John Baldwin Date: Thu, 18 Oct 2012 15:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241696 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:43:20 -0000 Author: jhb Date: Thu Oct 18 15:43:19 2012 New Revision: 241696 URL: http://svn.freebsd.org/changeset/base/241696 Log: Use if_initbaudrate(). Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Oct 18 15:39:29 2012 (r241695) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Oct 18 15:43:19 2012 (r241696) @@ -876,7 +876,7 @@ ipoib_intf_alloc(const char *name) dev->if_output = ipoib_output; dev->if_input = ipoib_input; dev->if_resolvemulti = ipoib_resolvemulti; - dev->if_baudrate = IF_Gbps(10UL); + if_initbaudrate(dev, IF_Gbps(10)); dev->if_broadcastaddr = priv->broadcastaddr; dev->if_snd.ifq_maxlen = ipoib_sendq_size * 2; sdl = (struct sockaddr_dl *)dev->if_addr->ifa_addr; From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:44:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB852D59; Thu, 18 Oct 2012 15:44:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF60B8FC08; Thu, 18 Oct 2012 15:44:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IFiR80069561; Thu, 18 Oct 2012 15:44:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IFiRkZ069559; Thu, 18 Oct 2012 15:44:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210181544.q9IFiRkZ069559@svn.freebsd.org> From: John Baldwin Date: Thu, 18 Oct 2012 15:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241697 - head/sys/ofed/include/rdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:44:28 -0000 Author: jhb Date: Thu Oct 18 15:44:27 2012 New Revision: 241697 URL: http://svn.freebsd.org/changeset/base/241697 Log: Take advantage of if_baudrate_pf and calculate an effective baud rate on all platforms (not just amd64) to compute an equivalent IB rate. Modified: head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Thu Oct 18 15:43:19 2012 (r241696) +++ head/sys/ofed/include/rdma/ib_addr.h Thu Oct 18 15:44:27 2012 (r241697) @@ -247,17 +247,21 @@ static inline int iboe_get_rate(struct n #else static inline int iboe_get_rate(struct net_device *dev) { -#ifdef __amd64__ - if (dev->if_baudrate >= IF_Gbps(40ULL)) + uintmax_t baudrate; + int exp; + + baudrate = dev->if_baudrate; + for (exp = dev->if_baudrate_pf; exp > 0; exp--) + baudrate *= 10; + if (baudrate >= IF_Gbps(40)) return IB_RATE_40_GBPS; - else if (dev->if_baudrate >= IF_Gbps(30ULL)) + else if (baudrate >= IF_Gbps(30)) return IB_RATE_30_GBPS; - else if (dev->if_baudrate >= IF_Gbps(20ULL)) + else if (baudrate >= IF_Gbps(20)) return IB_RATE_20_GBPS; - else if (dev->if_baudrate >= IF_Gbps(10ULL)) + else if (baudrate >= IF_Gbps(10)) return IB_RATE_10_GBPS; else -#endif return IB_RATE_PORT_CURRENT; } #endif From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 15:52:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47FC7F73; Thu, 18 Oct 2012 15:52:01 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3042D8FC12; Thu, 18 Oct 2012 15:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IFq1qb070819; Thu, 18 Oct 2012 15:52:01 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IFq0jO070815; Thu, 18 Oct 2012 15:52:00 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201210181552.q9IFq0jO070815@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 18 Oct 2012 15:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241698 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 15:52:01 -0000 Author: pluknet Date: Thu Oct 18 15:52:00 2012 New Revision: 241698 URL: http://svn.freebsd.org/changeset/base/241698 Log: Document NetBSD 6.0 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Oct 18 15:44:27 2012 (r241697) +++ head/share/misc/bsd-family-tree Thu Oct 18 15:52:00 2012 (r241698) @@ -256,6 +256,8 @@ FreeBSD 5.2 | | | 8.3 | | OpenBSD 5.1 | | Mac OS X | | | | 10.8 | | | + | | NetBSD 6.0 | | + | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -549,6 +551,7 @@ DragonFly 3.0.1 2012-02-21 [DFB] FreeBSD 8.3 2012-04-18 [FBD] OpenBSD 5.1 2012-05-01 [OBD] Mac OS X 10.8 2012-07-25 [APL] +NetBSD 6.0 2012-10-17 [NBD] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 16:34:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 048FBF27; Thu, 18 Oct 2012 16:34:01 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82608FC16; Thu, 18 Oct 2012 16:34:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IGY0XB077538; Thu, 18 Oct 2012 16:34:00 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IGY0lI077535; Thu, 18 Oct 2012 16:34:00 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201210181634.q9IGY0lI077535@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 18 Oct 2012 16:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241699 - head/usr.sbin/bluetooth/btpand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 16:34:01 -0000 Author: emax Date: Thu Oct 18 16:34:00 2012 New Revision: 241699 URL: http://svn.freebsd.org/changeset/base/241699 Log: make sure that socket's send and receive buffers are properly sized Submitted by: Iain Hibbert plunky at rya-online dot net MFC after: 3 weeks Modified: head/usr.sbin/bluetooth/btpand/client.c head/usr.sbin/bluetooth/btpand/server.c Modified: head/usr.sbin/bluetooth/btpand/client.c ============================================================================== --- head/usr.sbin/bluetooth/btpand/client.c Thu Oct 18 15:52:00 2012 (r241698) +++ head/usr.sbin/bluetooth/btpand/client.c Thu Oct 18 16:34:00 2012 (r241699) @@ -47,7 +47,7 @@ client_init(void) struct sockaddr_l2cap sa; channel_t *chan; socklen_t len; - int fd; + int fd, n; uint16_t mru, mtu; if (bdaddr_any(&remote_bdaddr)) @@ -97,6 +97,17 @@ client_init(void) exit(EXIT_FAILURE); } + len = sizeof(n); + if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) { + log_err("Could not read SO_RCVBUF"); + exit(EXIT_FAILURE); + } + if (n < (mru * 10)) { + n = mru * 10; + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1) + log_info("Could not increase SO_RCVBUF (from %d)", n); + } + len = sizeof(mtu); if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_OMTU, &mtu, &len) == -1) { log_err("Could not get L2CAP OMTU: %m"); @@ -107,6 +118,27 @@ client_init(void) exit(EXIT_FAILURE); } + len = sizeof(n); + if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, &len) == -1) { + log_err("Could not get socket send buffer size: %m"); + close(fd); + return; + } + if (n < (mtu * 2)) { + n = mtu * 2; + if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) == -1) { + log_err("Could not set socket send buffer size (%d): %m", n); + close(fd); + return; + } + } + n = mtu; + if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, &n, sizeof(n)) == -1) { + log_err("Could not set socket low water mark (%d): %m", n); + close(fd); + return; + } + chan = channel_alloc(); if (chan == NULL) exit(EXIT_FAILURE); Modified: head/usr.sbin/bluetooth/btpand/server.c ============================================================================== --- head/usr.sbin/bluetooth/btpand/server.c Thu Oct 18 15:52:00 2012 (r241698) +++ head/usr.sbin/bluetooth/btpand/server.c Thu Oct 18 16:34:00 2012 (r241699) @@ -177,6 +177,18 @@ server_read(int s, short ev, void *arg) return; } + len = sizeof(n); + if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) { + log_err("Could not read SO_RCVBUF"); + close(fd); + return; + } + if (n < (mru * 10)) { + n = mru * 10; + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1) + log_info("Could not increase SO_RCVBUF (from %d)", n); + } + len = sizeof(mtu); if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_OMTU, &mtu, &len) == -1) { log_err("Could not get L2CAP OMTU: %m"); From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 17:09:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 794D8EF9; Thu, 18 Oct 2012 17:09:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 612BA8FC0C; Thu, 18 Oct 2012 17:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IH9kJi083169; Thu, 18 Oct 2012 17:09:46 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IH9k28083167; Thu, 18 Oct 2012 17:09:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201210181709.q9IH9k28083167@svn.freebsd.org> From: Devin Teske Date: Thu, 18 Oct 2012 17:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241700 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 17:09:46 -0000 Author: dteske Date: Thu Oct 18 17:09:45 2012 New Revision: 241700 URL: http://svn.freebsd.org/changeset/base/241700 Log: Fix a bug where blank lines were not being counted (because awk's split() function returns zero when $0 is the NULL string). Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Thu Oct 18 16:34:00 2012 (r241699) +++ head/usr.sbin/bsdconfig/share/strings.subr Thu Oct 18 17:09:45 2012 (r241700) @@ -75,7 +75,7 @@ f_longest_line_length() f_number_of_lines_awk=' BEGIN { num_lines = 0 } { - num_lines += split($0, unused, /\\n/) + num_lines += split(" "$0, unused, /\\n/) } END { print num_lines } ' From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 18:43:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3EE4F97; Thu, 18 Oct 2012 18:43:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA6728FC1A; Thu, 18 Oct 2012 18:43:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IIhsOx099627; Thu, 18 Oct 2012 18:43:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IIhs6N099621; Thu, 18 Oct 2012 18:43:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201210181843.q9IIhs6N099621@svn.freebsd.org> From: Devin Teske Date: Thu, 18 Oct 2012 18:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 18:43:54 -0000 Author: dteske Date: Thu Oct 18 18:43:54 2012 New Revision: 241701 URL: http://svn.freebsd.org/changeset/base/241701 Log: More-accurately replicate the help system from sysinstall(8). However, also improve upon the system by giving the user a "Help" button instead of requiring the user to press F1. NOTE: In FreeBSD-9 and higher, dialog(1) does not support the F1 hook, so the mechanism for providing help to the user had to be changed to a button. This now means we can resurrect *.hlp files from usr.sbin/sysinstall/help/ as- is and reusing them as-needed in bsdconfig (holding to the goal of losing as little functionality from sysinstall as possible). Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Added: head/usr.sbin/bsdconfig/include/bsdconfig.hlp (contents, props changed) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/include/Makefile head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Thu Oct 18 17:09:45 2012 (r241700) +++ head/usr.sbin/bsdconfig/bsdconfig Thu Oct 18 18:43:54 2012 (r241701) @@ -37,6 +37,7 @@ f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" f_include_lang $BSDCFG_LIBE/include/messages.subr +f_include_help $BSDCFG_LIBE/include/bsdconfig.hlp ############################################################ FUNCTIONS @@ -185,6 +186,8 @@ dialog_menu_main() --item-help \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_exit_bsdconfig\" \ + --help-button \ + ${USE_XDIALOG:+--help \"\$( f_include_help )\"} \ --menu \"\$prompt\" $size $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -286,8 +289,6 @@ if [ "$1" ]; then exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 fi -[ -f "$HOME/.bsdconfigrc" ] || f_dialog_msgbox "$msg_help_text" - # # Launch application main menu # @@ -297,7 +298,13 @@ while :; do mtag=$( f_dialog_menutag ) f_dprintf "retval=$retval mtag=[$mtag]" - [ $retval -eq 0 ] || f_die + if [ $retval -eq 2 ]; then + # The Help button was pressed + f_show_msg "%s" "$( f_include_help )" + continue + elif [ $retval -ne 0 ]; then + f_die + fi case "$mtag" in X) # Exit Modified: head/usr.sbin/bsdconfig/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/include/Makefile Thu Oct 18 17:09:45 2012 (r241700) +++ head/usr.sbin/bsdconfig/include/Makefile Thu Oct 18 18:43:54 2012 (r241701) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/include -FILES= messages.subr +FILES= bsdconfig.hlp messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/include/bsdconfig.hlp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/include/bsdconfig.hlp Thu Oct 18 18:43:54 2012 (r241701) @@ -0,0 +1,12 @@ +This menu allows you to configure your system after the installation +process is complete. At the minimum, you should probably set the root +password and the system time zone. + +For extra goodies like bash, emacs, firefox, etc., you should look at +the Packages item in this menu. + +For setting the timezone after the system is installed, use the 'Time +Zone' item in this menu. + +For more information on the overall general system configuration, see +the /etc/rc.conf and /etc/defaults/rc.conf files. Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Thu Oct 18 17:09:45 2012 (r241700) +++ head/usr.sbin/bsdconfig/include/messages.subr Thu Oct 18 18:43:54 2012 (r241701) @@ -38,7 +38,6 @@ msg_created_path="Created %s" msg_directory_not_found="%s: Directory not found." msg_exit="Exit" msg_exit_bsdconfig="Exit bsdconfig" -msg_help_text="This menu allows you to configure your system after the installation\nprocess is complete. At the minimum, you should probably set the root\npassword and the system time zone.\n\nFor extra goodies like bash, emacs, firefox, etc., you should look at the\n'Packages' item in this menu.\n\nFor setting the timezone after the system is installed, use the 'Time\nZone' item in this menu.\n\nFor more information on the overall general system configuration, see the\n/etc/rc.conf and /etc/defaults/rc.conf files. (Note: to inhibit displaying\nof this message, create an empty file: \$HOME/.bsdconfigrc or copy it from\n/usr/share/examples/bsdconfig/bsdconfigrc)" msg_main_menu="Main Menu" msg_menu_text="If you've already installed FreeBSD, you may use\nthis menu to customize it somewhat to suit your\nparticular configuration. Most importantly, you\ncan use the Packages utility to load extra '3rd\nparty' software not provided in the base\ndistributions." msg_must_be_root_to_execute="%s: must be root to execute" Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Thu Oct 18 17:09:45 2012 (r241700) +++ head/usr.sbin/bsdconfig/share/common.subr Thu Oct 18 18:43:54 2012 (r241701) @@ -179,6 +179,44 @@ f_include_lang() fi } +# f_include_help [$file] +# +# When given an argument, cache the contents of a language help-file (to later +# be retrieved by executing again without arguments). +# +# Automatically takes $LANG and $LC_ALL into consideration when reading $file +# (suffix ".$LC_ALL" or ".$LANG" will automatically be added prior to loading +# the language help-file). +# +# No error is produced if (a) a language has been requested (by setting either +# $LANG or $LC_ALL in the environment) and (b) the language help-file does not +# exist -- in which case we will fall back to loading $file without-suffix. +# +# If the language help-file does not exist, an error is cached in place of the +# help-file contents. +# +# When called without arguments, the cached value (if any) is produced. Each +# time this function is called, the cache is overwritten with the newly loaded +# contents. +# +f_include_help() +{ + local file="$1" + + if [ "$file" ]; then + local lang="${LANG:-$LC_ALL}" + + f_dprintf "lang=[$lang]" + if [ -f "$file.$lang" ]; then + setvar HELP_$$ "$( cat "$file.$lang" 2>&1 )" + else + setvar HELP_$$ "$( cat "$file" 2>&1 )" + fi + else + eval echo \"\$HELP_$$\" + fi +} + # f_usage $file [ $key1 $value1 ... ] # # Display USAGE file with optional pre-processor macro definitions. The first From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 19:28:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19D2D31B; Thu, 18 Oct 2012 19:28:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01CCE8FC08; Thu, 18 Oct 2012 19:28:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IJSV8M007576; Thu, 18 Oct 2012 19:28:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IJSVhe007574; Thu, 18 Oct 2012 19:28:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210181928.q9IJSVhe007574@svn.freebsd.org> From: Ed Schouten Date: Thu, 18 Oct 2012 19:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241702 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 19:28:32 -0000 Author: ed Date: Thu Oct 18 19:28:31 2012 New Revision: 241702 URL: http://svn.freebsd.org/changeset/base/241702 Log: Remove unneeded D_NEEDMINOR. This is only needed when using clonelists. This got remove in r238693. Modified: head/sys/fs/fuse/fuse_device.c Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Thu Oct 18 18:43:54 2012 (r241701) +++ head/sys/fs/fuse/fuse_device.c Thu Oct 18 19:28:31 2012 (r241702) @@ -99,7 +99,6 @@ static struct cdevsw fuse_device_cdevsw .d_read = fuse_device_read, .d_write = fuse_device_write, .d_version = D_VERSION, - .d_flags = D_NEEDMINOR, }; /**************************** From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 20:22:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E52DD56B; Thu, 18 Oct 2012 20:22:17 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95618FC0C; Thu, 18 Oct 2012 20:22:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IKMHPM016362; Thu, 18 Oct 2012 20:22:17 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IKMHFa016360; Thu, 18 Oct 2012 20:22:17 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210182022.q9IKMHFa016360@svn.freebsd.org> From: Andre Oppermann Date: Thu, 18 Oct 2012 20:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241703 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 20:22:18 -0000 Author: andre Date: Thu Oct 18 20:22:17 2012 New Revision: 241703 URL: http://svn.freebsd.org/changeset/base/241703 Log: Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within zero copy specialized sosend_copyin() helper function. Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Oct 18 19:28:31 2012 (r241702) +++ head/sys/kern/uipc_socket.c Thu Oct 18 20:22:17 2012 (r241703) @@ -890,9 +890,7 @@ sosend_copyin(struct uio *uio, struct mb long len; ssize_t resid; int error; -#ifdef ZERO_COPY_SOCKETS int cow_send; -#endif *retmp = top = NULL; mp = ⊤ @@ -900,11 +898,8 @@ sosend_copyin(struct uio *uio, struct mb resid = uio->uio_resid; error = 0; do { -#ifdef ZERO_COPY_SOCKETS cow_send = 0; -#endif /* ZERO_COPY_SOCKETS */ if (resid >= MINCLSIZE) { -#ifdef ZERO_COPY_SOCKETS if (top == NULL) { m = m_gethdr(M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; @@ -924,15 +919,6 @@ sosend_copyin(struct uio *uio, struct mb m_clget(m, M_WAITOK); len = min(min(MCLBYTES, resid), *space); } -#else /* ZERO_COPY_SOCKETS */ - if (top == NULL) { - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); - m->m_pkthdr.len = 0; - m->m_pkthdr.rcvif = NULL; - } else - m = m_getcl(M_WAIT, MT_DATA, 0); - len = min(min(MCLBYTES, resid), *space); -#endif /* ZERO_COPY_SOCKETS */ } else { if (top == NULL) { m = m_gethdr(M_WAIT, MT_DATA); @@ -957,11 +943,9 @@ sosend_copyin(struct uio *uio, struct mb } *space -= len; -#ifdef ZERO_COPY_SOCKETS if (cow_send) error = 0; else -#endif /* ZERO_COPY_SOCKETS */ error = uiomove(mtod(m, void *), (int)len, uio); resid = uio->uio_resid; m->m_len = len; @@ -980,7 +964,7 @@ out: *retmp = top; return (error); } -#endif /*ZERO_COPY_SOCKETS*/ +#endif /* ZERO_COPY_SOCKETS */ #define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 20:44:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28679CED for ; Thu, 18 Oct 2012 20:44:06 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8E78FC1A for ; Thu, 18 Oct 2012 20:44:05 +0000 (UTC) Received: (qmail 14857 invoked from network); 18 Oct 2012 22:22:56 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Oct 2012 22:22:56 -0000 Message-ID: <50806A10.4070703@freebsd.org> Date: Thu, 18 Oct 2012 22:44:00 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r241703 - head/sys/kern References: <201210182022.q9IKMHFa016360@svn.freebsd.org> In-Reply-To: <201210182022.q9IKMHFa016360@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 20:44:06 -0000 On 18.10.2012 22:22, Andre Oppermann wrote: > Author: andre > Date: Thu Oct 18 20:22:17 2012 > New Revision: 241703 > URL: http://svn.freebsd.org/changeset/base/241703 > > Log: > Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within > zero copy specialized sosend_copyin() helper function. Note that I'm not saying zero copy should be used or is even more performant than the optimized m_uiotombuf() function. Actually there may be some real bit-rot to zero copy sockets. I've just started looking into it. Note that zero copy isn't entirely true either as it marks the page as COW. So when the userspace application reuses the memory it is copied anyway. Also the overhead of doing the VM magic and mbuf attachment of a VM page isn't free either. To really benefit from it an application has to be written with COW in mind and not reuse the memory that was just written to the socket. For non-aware applications it may be a net performance loss overall. Also I don't like the name zero-copy-socket as it promises too much for those not into socket, mbuf and VM magic. I'd rather call it cow-socket or something like that as it describes much better what is actually happening behind the scenes. -- Andre From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 21:04:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79789453; Thu, 18 Oct 2012 21:04:31 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 608378FC12; Thu, 18 Oct 2012 21:04:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IL4VIA022759; Thu, 18 Oct 2012 21:04:31 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IL4Vpi022757; Thu, 18 Oct 2012 21:04:31 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210182104.q9IL4Vpi022757@svn.freebsd.org> From: Andre Oppermann Date: Thu, 18 Oct 2012 21:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241704 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 21:04:31 -0000 Author: andre Date: Thu Oct 18 21:04:30 2012 New Revision: 241704 URL: http://svn.freebsd.org/changeset/base/241704 Log: Remove unnecessary includes from sosend_copyin() and fix a couple of style issues. Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Oct 18 20:22:17 2012 (r241703) +++ head/sys/kern/uipc_socket.c Thu Oct 18 21:04:30 2012 (r241704) @@ -860,12 +860,6 @@ struct so_zerocopy_stats{ int found_ifp; }; struct so_zerocopy_stats so_zerocp_stats = {0,0,0}; -#include -#include -#include -#include -#include -#include /* * sosend_copyin() is only used if zero copy sockets are enabled. Otherwise @@ -907,9 +901,9 @@ sosend_copyin(struct uio *uio, struct mb } else m = m_get(M_WAITOK, MT_DATA); if (so_zero_copy_send && - resid>=PAGE_SIZE && - *space>=PAGE_SIZE && - uio->uio_iov->iov_len>=PAGE_SIZE) { + resid >= PAGE_SIZE && + *space >= PAGE_SIZE && + uio->uio_iov->iov_len >= PAGE_SIZE) { so_zerocp_stats.size_ok++; so_zerocp_stats.align_ok++; cow_send = socow_setup(m, uio); @@ -946,7 +940,7 @@ sosend_copyin(struct uio *uio, struct mb if (cow_send) error = 0; else - error = uiomove(mtod(m, void *), (int)len, uio); + error = uiomove(mtod(m, void *), (int)len, uio); resid = uio->uio_resid; m->m_len = len; *mp = m; From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 21:07:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3838E5E3; Thu, 18 Oct 2012 21:07:00 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id E58138FC0A; Thu, 18 Oct 2012 21:06:59 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so9359796pad.13 for ; Thu, 18 Oct 2012 14:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=zg2TMwREQXPfreK/8ma6cRbZe6Zah0kwhFBj7qX62SY=; b=ntwSq7rFM9pi4i1Jn1UND1KcaRgA2Qq6N9ITp1kmHjIeNijRkvCNk36m8XM+PHHlub yqjB+2egVSiYtDK6yuzajmX5XkEf/gA9Jd1uEUVwel7RSOvZOim2u3Jh7QV6A5+L0EMM Y/qLzkLtMdqoecSrux7bgRWR8lEW51CUJlcJf8ynM/ebrcGZnKCpEhvGeqnqj+pRxQqA XX/7aCR4SvJ/j0eLR9w4yi+31pnpOzN2UoFbas5Qwz+9WyyKIfNfNqjqlu6BU3Z63auH eRpKVIg3hgj6BKdyOA80SET6S0Ajbdp4+n9hVlpNHQmhtGJIHxpH6YXipyCuOgLxvEVb E+uw== Received: by 10.66.76.231 with SMTP id n7mr62913237paw.68.1350594419385; Thu, 18 Oct 2012 14:06:59 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id nm2sm35686pbc.43.2012.10.18.14.06.57 (version=SSLv3 cipher=OTHER); Thu, 18 Oct 2012 14:06:58 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <50806F6F.60109@FreeBSD.org> Date: Thu, 18 Oct 2012 14:06:55 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121012 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r241703 - head/sys/kern References: <201210182022.q9IKMHFa016360@svn.freebsd.org> <50806A10.4070703@freebsd.org> In-Reply-To: <50806A10.4070703@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 21:07:00 -0000 Hello Andre, A couple of things if you're poking around in this area... On 10/18/12 13:44, Andre Oppermann wrote: > On 18.10.2012 22:22, Andre Oppermann wrote: >> Author: andre >> Date: Thu Oct 18 20:22:17 2012 >> New Revision: 241703 >> URL: http://svn.freebsd.org/changeset/base/241703 >> >> Log: >> Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within >> zero copy specialized sosend_copyin() helper function. > > Note that I'm not saying zero copy should be used or is even > more performant than the optimized m_uiotombuf() function. Some time back I played around with a modified m_uiotombuf() that was aware of the mbuf_jumbo_16K zone (instead of limiting itself to 4K mbufs). In some cases it performed better than the stock m_uiotombuf. I suspect this change would also help drivers that are unable to deal with long gather lists when doing TSO. But my testing wasn't rigorous enough (I was merely playing around), and the drivers I work with can mostly cope with whatever the kernel throws at them. So nothing came out of it. > Actually there may be some real bit-rot to zero copy sockets. > I've just started looking into it. I have a cxgbe(4)-specific true zero-copy implementation. The rx side is in head, the tx side works only for blocking sockets (the "easy" case) and I haven't checked it in anywhere. Take a look at t4_soreceive_ddp() and m_mbuftouio_ddp() in sys/dev/cxgbe/t4_ddp.c. They're mostly identical to the kernel routines they're based on (read: copy-pasted from). You may find them of some interest if you're working in this area and are thinking of adding zero-copy hooks to the socket implementation. Regards, Navdeep From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 22:03:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C063480 for ; Thu, 18 Oct 2012 22:03:47 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 9BAFF8FC19 for ; Thu, 18 Oct 2012 22:03:46 +0000 (UTC) Received: (qmail 15201 invoked from network); 18 Oct 2012 23:42:36 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Oct 2012 23:42:36 -0000 Message-ID: <50807CBD.8080703@freebsd.org> Date: Fri, 19 Oct 2012 00:03:41 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r241703 - head/sys/kern References: <201210182022.q9IKMHFa016360@svn.freebsd.org> <50806A10.4070703@freebsd.org> <50806F6F.60109@FreeBSD.org> In-Reply-To: <50806F6F.60109@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 22:03:47 -0000 On 18.10.2012 23:06, Navdeep Parhar wrote: > Hello Andre, > > A couple of things if you're poking around in this area... I didn't really mean to dive too deep into COW socket writes. > On 10/18/12 13:44, Andre Oppermann wrote: >> On 18.10.2012 22:22, Andre Oppermann wrote: >>> Author: andre >>> Date: Thu Oct 18 20:22:17 2012 >>> New Revision: 241703 >>> URL: http://svn.freebsd.org/changeset/base/241703 >>> >>> Log: >>> Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within >>> zero copy specialized sosend_copyin() helper function. >> >> Note that I'm not saying zero copy should be used or is even >> more performant than the optimized m_uiotombuf() function. > > Some time back I played around with a modified m_uiotombuf() that was aware of the mbuf_jumbo_16K > zone (instead of limiting itself to 4K mbufs). In some cases it performed better than the stock > m_uiotombuf. I suspect this change would also help drivers that are unable to deal with long gather > lists when doing TSO. But my testing wasn't rigorous enough (I was merely playing around), and the > drivers I work with can mostly cope with whatever the kernel throws at them. So nothing came out of > it. The jumbo 16K zone is special in that the memory is actually allocated by contigmalloc to get physically contiguous RAM. After some uptime and heavy use this may become difficult to obtain. Also contigmalloc has to hunt for it which may cause quite a bit of overhead. 4K mbufs, actually PAGE_SIZE mbufs, are very easily obtainable and fast. To be honest I'm not really happy about > PAGE_SIZE mbufs. They were introduced at a time when DMA engines were more limited and couldn't do S/G DMA on receive. So performance with > PAGE_SIZE mbufs may be a little bit better but when you approach memory fragmentation after some heavy system usage it sucks up to the point where it fails most of the time. PAGE_SIZE mbufs always perform the same with very little deviation. In an ideal scenario I'd like to see 9K and 16K mbufs go away and have the RX DMA ring stitch a packet up out of PAGE_SIZE mbufs. >> Actually there may be some real bit-rot to zero copy sockets. >> I've just started looking into it. > > I have a cxgbe(4)-specific true zero-copy implementation. The rx side is in head, the tx side works > only for blocking sockets (the "easy" case) and I haven't checked it in anywhere. Take a look at > t4_soreceive_ddp() and m_mbuftouio_ddp() in sys/dev/cxgbe/t4_ddp.c. They're mostly identical to the > kernel routines they're based on (read: copy-pasted from). You may find them of some interest if > you're working in this area and are thinking of adding zero-copy hooks to the socket implementation. I'm going to have a look at it think about how to generically support DDP either way with our socket buffer layout. Actually that may end up as the golden path. Do away with > PAGE_SIZE mbufs, sink page flipping COW (incorrectly named ZERO_COPY) and use DDP for those who need utmost performance (as I said only COW aware applications gain a bit of speed, unaware may end up much worse). -- Andre From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 22:18:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA8CA9B4; Thu, 18 Oct 2012 22:18:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98F698FC19; Thu, 18 Oct 2012 22:18:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IMIBIm033578; Thu, 18 Oct 2012 22:18:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IMIBjl033573; Thu, 18 Oct 2012 22:18:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210182218.q9IMIBjl033573@svn.freebsd.org> From: Attilio Rao Date: Thu, 18 Oct 2012 22:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241706 - in head/sys: conf geom/label modules/geom/geom_label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 22:18:11 -0000 Author: attilio Date: Thu Oct 18 22:18:11 2012 New Revision: 241706 URL: http://svn.freebsd.org/changeset/base/241706 Log: It seems that it is preferable to keep support for glabel also for filesystems that we don't support natively. Revert part of r241636 to do so. This patch is not targeted for MFC. Requested by: gleb, jhb Modified: head/sys/conf/files head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h head/sys/modules/geom/geom_label/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 18 22:16:52 2012 (r241705) +++ head/sys/conf/files Thu Oct 18 22:18:11 2012 (r241706) @@ -2446,6 +2446,7 @@ geom/label/g_label.c optional geom_labe geom/label/g_label_ext2fs.c optional geom_label geom/label/g_label_iso9660.c optional geom_label geom/label/g_label_msdosfs.c optional geom_label +geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_reiserfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label geom/label/g_label_gpt.c optional geom_label Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Thu Oct 18 22:16:52 2012 (r241705) +++ head/sys/geom/label/g_label.c Thu Oct 18 22:18:11 2012 (r241706) @@ -84,6 +84,7 @@ const struct g_label_desc *g_labels[] = &g_label_msdosfs, &g_label_ext2fs, &g_label_reiserfs, + &g_label_ntfs, &g_label_gpt, &g_label_gpt_uuid, NULL Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Thu Oct 18 22:16:52 2012 (r241705) +++ head/sys/geom/label/g_label.h Thu Oct 18 22:18:11 2012 (r241706) @@ -84,6 +84,7 @@ extern struct g_label_desc g_label_iso96 extern struct g_label_desc g_label_msdosfs; extern struct g_label_desc g_label_ext2fs; extern struct g_label_desc g_label_reiserfs; +extern struct g_label_desc g_label_ntfs; extern struct g_label_desc g_label_gpt; extern struct g_label_desc g_label_gpt_uuid; #endif /* _KERNEL */ Modified: head/sys/modules/geom/geom_label/Makefile ============================================================================== --- head/sys/modules/geom/geom_label/Makefile Thu Oct 18 22:16:52 2012 (r241705) +++ head/sys/modules/geom/geom_label/Makefile Thu Oct 18 22:18:11 2012 (r241706) @@ -8,6 +8,7 @@ SRCS+= g_label_ext2fs.c SRCS+= g_label_gpt.c SRCS+= g_label_iso9660.c SRCS+= g_label_msdosfs.c +SRCS+= g_label_ntfs.c SRCS+= g_label_reiserfs.c SRCS+= g_label_ufs.c From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 22:20:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3607D02; Thu, 18 Oct 2012 22:20:02 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC2EA8FC0A; Thu, 18 Oct 2012 22:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IMK29E033981; Thu, 18 Oct 2012 22:20:02 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IMK2xP033979; Thu, 18 Oct 2012 22:20:02 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201210182220.q9IMK2xP033979@svn.freebsd.org> From: Peter Jeremy Date: Thu, 18 Oct 2012 22:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241708 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 22:20:03 -0000 Author: peterj Date: Thu Oct 18 22:20:02 2012 New Revision: 241708 URL: http://svn.freebsd.org/changeset/base/241708 Log: Explicitly specify 'np' so that getty(8) does not simulate even parity on local.9600. Whilst the actual binary termios(4) definitions and preceeding comments for local.9600 indicate that parity is disabled, getty(8) internally simulates parity based on the presence or absence of the 'np' flag. PR: conf/76226 Submitted by: peter Approved by: grog (co-mentor) MFC after: 1 month Modified: head/etc/gettytab Modified: head/etc/gettytab ============================================================================== --- head/etc/gettytab Thu Oct 18 22:19:00 2012 (r241707) +++ head/etc/gettytab Thu Oct 18 22:20:02 2012 (r241708) @@ -96,7 +96,7 @@ local.9600|CLOCAL tty @ 9600 Bd:\ :o0#0x00000007:o1#0x00000002:o2#0x00000007:\ :i0#0x00000704:i1#0x00000000:i2#0x00000704:\ :l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\ - :sp#9600: + :sp#9600:np: # # Dial in rotary tables, speed selection via 'break' From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 22:22:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA14CFF8; Thu, 18 Oct 2012 22:22:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 883718FC08; Thu, 18 Oct 2012 22:22:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9IMM2Lw034368; Thu, 18 Oct 2012 22:22:02 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9IMM2h8034365; Thu, 18 Oct 2012 22:22:02 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201210182222.q9IMM2h8034365@svn.freebsd.org> From: Sean Bruno Date: Thu, 18 Oct 2012 22:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241710 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 22:22:02 -0000 Author: sbruno Date: Thu Oct 18 22:22:01 2012 New Revision: 241710 URL: http://svn.freebsd.org/changeset/base/241710 Log: est(4) man page update to document the exposed sysctl r/o variables available to the user. Should be applicable to all branches and versions where est(4) exists. thanks to gjb for reviewing and suggesting nits Reviewed by: gjb@ MFC after: 2 weeks Modified: head/share/man/man4/est.4 Modified: head/share/man/man4/est.4 ============================================================================== --- head/share/man/man4/est.4 Thu Oct 18 22:21:18 2012 (r241709) +++ head/share/man/man4/est.4 Thu Oct 18 22:22:01 2012 (r241710) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 12, 2012 +.Dd October 18 , 2012 .Dt EST 4 .Os .Sh NAME @@ -63,13 +63,36 @@ behavior. .Bl -tag -width indent .It hw.est.msr_info Attempt to infer information from direct probing of the msr. -Should only be used in diagnostic cases +Should only be used in diagnostic cases. .Pq default 0 .It hw.est.strict Validate frequency requested is accepted by the cpu when set. It appears that this will only work on single core cpus. .Pq default 0 .El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +values are available +.Bl -tag -width indent +.It Va dev.est.%d.\%desc +Description of support, almost always Enhanced SpeedStep Frequency Control. +.It dev.est.0.%desc: Enhanced SpeedStep Frequency Control +.It Va dev.est.%d.\%driver +Driver in use, always est. +.It dev.est.0.%driver: est +.It Va dev.est.%d.\%parent +.It dev.est.0.%parent: cpu0 +The cpu that is exposing these frequencies. +For example +.Va cpu0 . +.It Va dev.est.%d.freq_settings . +The valid frequencies that are allowed by this CPU and their step values. +.It dev.est.0.freq_settings: 2201/45000 2200/45000 2000/39581 1900/37387 +1800/34806 1700/32703 1600/30227 1500/28212 1400/25828 1300/23900 1200/21613 +1100/19775 1000/17582 900/15437 800/13723 +.Pp +.El .Sh DIAGNOSTICS .Bl -diag .It "est%d: on cpu%d" From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 23:39:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6A4D340; Thu, 18 Oct 2012 23:39:42 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF2F8FC1A; Thu, 18 Oct 2012 23:39:42 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so9516169pbb.13 for ; Thu, 18 Oct 2012 16:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/jOBjjCO816ZdX/701N3c7/T8ne9CEa7Ww2xOxDKpt8=; b=hvEs9g/tSaA0HxTiSVLDSume7Nkvqug68gsKvbz1jNmPmVtZQbcKbnqIY4jURQfbDI iHDKp85uU7eVKLe3hKyi4j5705HAtAgHsD3tzOdo2IAizsUhFepjJpm79B7ywKVt5iex BNgKPKdU8SMUxF7TlJtt5wbfmOHJYt70P7Aax7hH4XopfvhnmJOkmHFgd+bCbLEov/1e I0T20bdtMQYDsjijkwtMaDjsS4RGuoGELR306nWIoqGgRhQGxAg5nYTba0IPelaNRRqq cjzgtaUc2fnHbiP1hI8AzC6ceoaci21UPHejYd8uCQ3gyndAo5GDLABafV9PHVPX76XK 9cbA== Received: by 10.68.218.132 with SMTP id pg4mr71768494pbc.100.1350603581957; Thu, 18 Oct 2012 16:39:41 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id ox5sm192241pbc.75.2012.10.18.16.39.39 (version=SSLv3 cipher=OTHER); Thu, 18 Oct 2012 16:39:40 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <5080933A.9040404@FreeBSD.org> Date: Thu, 18 Oct 2012 16:39:38 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121012 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r241703 - head/sys/kern References: <201210182022.q9IKMHFa016360@svn.freebsd.org> <50806A10.4070703@freebsd.org> <50806F6F.60109@FreeBSD.org> <50807CBD.8080703@freebsd.org> In-Reply-To: <50807CBD.8080703@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 23:39:43 -0000 On 10/18/12 15:03, Andre Oppermann wrote: > On 18.10.2012 23:06, Navdeep Parhar wrote: >> Hello Andre, >> >> A couple of things if you're poking around in this area... > > I didn't really mean to dive too deep into COW socket writes. > >> On 10/18/12 13:44, Andre Oppermann wrote: >>> On 18.10.2012 22:22, Andre Oppermann wrote: >>>> Author: andre >>>> Date: Thu Oct 18 20:22:17 2012 >>>> New Revision: 241703 >>>> URL: http://svn.freebsd.org/changeset/base/241703 >>>> >>>> Log: >>>> Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within >>>> zero copy specialized sosend_copyin() helper function. >>> >>> Note that I'm not saying zero copy should be used or is even >>> more performant than the optimized m_uiotombuf() function. >> >> Some time back I played around with a modified m_uiotombuf() that was >> aware of the mbuf_jumbo_16K >> zone (instead of limiting itself to 4K mbufs). In some cases it >> performed better than the stock >> m_uiotombuf. I suspect this change would also help drivers that are >> unable to deal with long gather >> lists when doing TSO. But my testing wasn't rigorous enough (I was >> merely playing around), and the >> drivers I work with can mostly cope with whatever the kernel throws at >> them. So nothing came out of >> it. > > The jumbo 16K zone is special in that the memory is actually allocated > by contigmalloc to get physically contiguous RAM. After some uptime and > heavy use this may become difficult to obtain. Also contigmalloc has to > hunt for it which may cause quite a bit of overhead. > > 4K mbufs, actually PAGE_SIZE mbufs, are very easily obtainable and fast. > > To be honest I'm not really happy about > PAGE_SIZE mbufs. They were > introduced at a time when DMA engines were more limited and couldn't > do S/G DMA on receive. > > So performance with > PAGE_SIZE mbufs may be a little bit better but > when you approach memory fragmentation after some heavy system usage > it sucks up to the point where it fails most of the time. PAGE_SIZE > mbufs always perform the same with very little deviation. > > In an ideal scenario I'd like to see 9K and 16K mbufs go away and > have the RX DMA ring stitch a packet up out of PAGE_SIZE mbufs. Sure, when the backend allocator gets called it's easier for it to find a single page than multiple contiguous pages. But if the system's workload keeps the 16K zone warm then the zone allocator doesn't have to reach out to the backend allocator all the time. The large clusters do have their advantages. I guess cluster consumers that prefer 16K but are willing to fall back to PAGE_SIZE when the larger zone is depleted will do well no matter what the memory situation is. Regards, Navdeep > >>> Actually there may be some real bit-rot to zero copy sockets. >>> I've just started looking into it. >> >> I have a cxgbe(4)-specific true zero-copy implementation. The rx side >> is in head, the tx side works >> only for blocking sockets (the "easy" case) and I haven't checked it >> in anywhere. Take a look at >> t4_soreceive_ddp() and m_mbuftouio_ddp() in sys/dev/cxgbe/t4_ddp.c. >> They're mostly identical to the >> kernel routines they're based on (read: copy-pasted from). You may >> find them of some interest if >> you're working in this area and are thinking of adding zero-copy hooks >> to the socket implementation. > > I'm going to have a look at it think about how to generically support > DDP either way with our socket buffer layout. > > Actually that may end up as the golden path. Do away with > PAGE_SIZE > mbufs, sink page flipping COW (incorrectly named ZERO_COPY) and use > DDP for those who need utmost performance (as I said only COW aware > applications gain a bit of speed, unaware may end up much worse). > From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 04:13:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D19C58D6; Fri, 19 Oct 2012 04:13:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B778D8FC08; Fri, 19 Oct 2012 04:13:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9J4DCNv091488; Fri, 19 Oct 2012 04:13:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9J4DC0V091484; Fri, 19 Oct 2012 04:13:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201210190413.q9J4DC0V091484@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 19 Oct 2012 04:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241719 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 04:13:12 -0000 Author: luigi Date: Fri Oct 19 04:13:12 2012 New Revision: 241719 URL: http://svn.freebsd.org/changeset/base/241719 Log: This is an import of code, mostly from Giuseppe Lettieri, that revises the netmap memory allocator so that the various parameters (number and size of buffers, rings, descriptors) can be modified at runtime through sysctl variables. The changes become effective when no netmap clients are active. The API is mostly unchanged, although the NIOCUNREGIF ioctl now does not bring the interface back to normal mode: and you need to close the file descriptor for that. This change was necessary to track who is using the mapped region, and since it is a simplification of the API there was no incentive in trying to preserve NIOCUNREGIF. We will remove the ioctl from the kernel next time we need a real API change (and version bump). Among other things, buffer allocation when opening devices is now much faster: it used to take O(N^2) time, now it is linear. Submitted by: Giuseppe Lettieri Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Oct 19 03:01:25 2012 (r241718) +++ head/sys/dev/netmap/netmap.c Fri Oct 19 04:13:12 2012 (r241719) @@ -98,15 +98,8 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo #include #include -/* - * lock and unlock for the netmap memory allocator - */ -#define NMA_LOCK() mtx_lock(&nm_mem->nm_mtx); -#define NMA_UNLOCK() mtx_unlock(&nm_mem->nm_mtx); -struct netmap_mem_d; -static struct netmap_mem_d *nm_mem; /* Our memory allocator. */ - u_int netmap_total_buffers; +u_int netmap_buf_size; char *netmap_buffer_base; /* address of an invalid buffer */ /* user-controlled variables */ @@ -119,10 +112,6 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, verbos CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); -u_int netmap_buf_size = 2048; -TUNABLE_INT("hw.netmap.buf_size", (u_int *)&netmap_buf_size); -SYSCTL_INT(_dev_netmap, OID_AUTO, buf_size, - CTLFLAG_RD, &netmap_buf_size, 0, "Size of packet buffers"); int netmap_mitigate = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); int netmap_no_pendintr = 1; @@ -294,23 +283,62 @@ nm_find_bridge(const char *name) #endif /* !NETMAP_MEM2 */ /*------------ end of memory allocator ----------*/ -/* Structure associated to each thread which registered an interface. */ + +/* Structure associated to each thread which registered an interface. + * + * The first 4 fields of this structure are written by NIOCREGIF and + * read by poll() and NIOC?XSYNC. + * There is low contention among writers (actually, a correct user program + * should have no contention among writers) and among writers and readers, + * so we use a single global lock to protect the structure initialization. + * Since initialization involves the allocation of memory, we reuse the memory + * allocator lock. + * Read access to the structure is lock free. Readers must check that + * np_nifp is not NULL before using the other fields. + * If np_nifp is NULL initialization has not been performed, so they should + * return an error to userlevel. + * + * The ref_done field is used to regulate access to the refcount in the + * memory allocator. The refcount must be incremented at most once for + * each open("/dev/netmap"). The increment is performed by the first + * function that calls netmap_get_memory() (currently called by + * mmap(), NIOCGINFO and NIOCREGIF). + * If the refcount is incremented, it is then decremented when the + * private structure is destroyed. + */ struct netmap_priv_d { - struct netmap_if *np_nifp; /* netmap interface descriptor. */ + struct netmap_if * volatile np_nifp; /* netmap interface descriptor. */ struct ifnet *np_ifp; /* device for which we hold a reference */ int np_ringid; /* from the ioctl */ u_int np_qfirst, np_qlast; /* range of rings to scan */ uint16_t np_txpoll; + + unsigned long ref_done; /* use with NMA_LOCK held */ }; +static int +netmap_get_memory(struct netmap_priv_d* p) +{ + int error = 0; + NMA_LOCK(); + if (!p->ref_done) { + error = netmap_memory_finalize(); + if (!error) + p->ref_done = 1; + } + NMA_UNLOCK(); + return error; +} + /* * File descriptor's private data destructor. * * Call nm_register(ifp,0) to stop netmap mode on the interface and * revert to normal operation. We expect that np_ifp has not gone. */ +/* call with NMA_LOCK held */ static void netmap_dtor_locked(void *data) { @@ -350,7 +378,6 @@ netmap_dtor_locked(void *data) selwakeuppri(&na->tx_si, PI_NET); selwakeuppri(&na->rx_si, PI_NET); /* release all buffers */ - NMA_LOCK(); for (i = 0; i < na->num_tx_rings + 1; i++) { struct netmap_ring *ring = na->tx_rings[i].ring; lim = na->tx_rings[i].nkr_num_slots; @@ -370,7 +397,6 @@ netmap_dtor_locked(void *data) /* XXX kqueue(9) needed; these will mirror knlist_init. */ /* knlist_destroy(&na->tx_si.si_note); */ /* knlist_destroy(&na->rx_si.si_note); */ - NMA_UNLOCK(); netmap_free_rings(na); wakeup(na); } @@ -403,7 +429,7 @@ nm_if_rele(struct ifnet *ifp) bzero(ifp, sizeof(*ifp)); free(ifp, M_DEVBUF); break; - } + } else if (b->bdg_ports[i] != NULL) full = 1; } @@ -423,17 +449,83 @@ netmap_dtor(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; - struct netmap_adapter *na = NA(ifp); + struct netmap_adapter *na; - na->nm_lock(ifp, NETMAP_REG_LOCK, 0); - netmap_dtor_locked(data); - na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + NMA_LOCK(); + if (ifp) { + na = NA(ifp); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); + netmap_dtor_locked(data); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - nm_if_rele(ifp); + nm_if_rele(ifp); + } + if (priv->ref_done) { + netmap_memory_deref(); + } + NMA_UNLOCK(); bzero(priv, sizeof(*priv)); /* XXX for safety */ free(priv, M_DEVBUF); } +#ifdef __FreeBSD__ +#include +#include +#include +#include +#include +#include + +static struct cdev_pager_ops saved_cdev_pager_ops; + +static int +netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + D("first mmap for %p", handle); + return saved_cdev_pager_ops.cdev_pg_ctor(handle, + size, prot, foff, cred, color); +} + +static void +netmap_dev_pager_dtor(void *handle) +{ + saved_cdev_pager_ops.cdev_pg_dtor(handle); + D("ready to release memory for %p", handle); +} + + +static struct cdev_pager_ops netmap_cdev_pager_ops = { + .cdev_pg_ctor = netmap_dev_pager_ctor, + .cdev_pg_dtor = netmap_dev_pager_dtor, + .cdev_pg_fault = NULL, +}; + +static int +netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, + vm_size_t objsize, vm_object_t *objp, int prot) +{ + vm_object_t obj; + + D("cdev %p foff %d size %d objp %p prot %d", cdev, *foff, + objsize, objp, prot); + obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, + curthread->td_ucred); + ND("returns obj %p", obj); + if (obj == NULL) + return EINVAL; + if (saved_cdev_pager_ops.cdev_pg_fault == NULL) { + D("initialize cdev_pager_ops"); + saved_cdev_pager_ops = *(obj->un_pager.devp.ops); + netmap_cdev_pager_ops.cdev_pg_fault = + saved_cdev_pager_ops.cdev_pg_fault; + }; + obj->un_pager.devp.ops = &netmap_cdev_pager_ops; + *objp = obj; + return 0; +} +#endif /* __FreeBSD__ */ + /* * mmap(2) support for the "netmap" device. @@ -456,13 +548,50 @@ netmap_mmap(__unused struct cdev *dev, #endif ) { + int error = 0; + struct netmap_priv_d *priv; + if (nprot & PROT_EXEC) return (-1); // XXX -1 or EINVAL ? + error = devfs_get_cdevpriv((void **)&priv); + if (error == EBADF) { /* called on fault, memory is initialized */ + ND(5, "handling fault at ofs 0x%x", offset); + error = 0; + } else if (error == 0) /* make sure memory is set */ + error = netmap_get_memory(priv); + if (error) + return (error); + ND("request for offset 0x%x", (uint32_t)offset); *paddr = netmap_ofstophys(offset); - return (0); + return (*paddr ? 0 : ENOMEM); +} + +static int +netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + D("dev %p fflag 0x%x devtype %d td %p", dev, fflag, devtype, td); + return 0; +} + +static int +netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct netmap_priv_d *priv; + int error; + + priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (priv == NULL) + return ENOMEM; + + error = devfs_set_cdevpriv(priv, netmap_dtor); + if (error) + return error; + + return 0; } #endif /* __FreeBSD__ */ @@ -650,7 +779,7 @@ no_port: /* can do this if the capability exists and if_pspare[0] * points to the netmap descriptor. */ - if ((*ifp)->if_capabilities & IFCAP_NETMAP && NA(*ifp)) + if (NETMAP_CAPABLE(*ifp)) return 0; /* valid pointer, we hold the refcount */ nm_if_rele(*ifp); return EINVAL; // not NETMAP capable @@ -676,7 +805,7 @@ netmap_ring_reinit(struct netmap_kring * u_int i, lim = kring->nkr_num_slots - 1; int errors = 0; - D("called for %s", kring->na->ifp->if_xname); + RD(10, "called for %s", kring->na->ifp->if_xname); if (ring->cur > lim) errors++; for (i = 0; i <= lim; i++) { @@ -698,9 +827,9 @@ netmap_ring_reinit(struct netmap_kring * int pos = kring - kring->na->tx_rings; int n = kring->na->num_tx_rings + 1; - D("total %d errors", errors); + RD(10, "total %d errors", errors); errors++; - D("%s %s[%d] reinit, cur %d -> %d avail %d -> %d", + RD(10, "%s %s[%d] reinit, cur %d -> %d avail %d -> %d", kring->na->ifp->if_xname, pos < n ? "TX" : "RX", pos < n ? pos : pos - n, ring->cur, kring->nr_hwcur, @@ -803,20 +932,16 @@ netmap_ioctl(struct cdev *dev, u_long cm CURVNET_SET(TD_TO_VNET(td)); error = devfs_get_cdevpriv((void **)&priv); - if (error != ENOENT && error != 0) { + if (error) { CURVNET_RESTORE(); - return (error); + /* XXX ENOENT should be impossible, since the priv + * is now created in the open */ + return (error == ENOENT ? ENXIO : error); } - error = 0; /* Could be ENOENT */ nmr->nr_name[sizeof(nmr->nr_name) - 1] = '\0'; /* truncate name */ switch (cmd) { case NIOCGINFO: /* return capabilities etc */ - /* memsize is always valid */ - nmr->nr_memsize = nm_mem->nm_totalsize; - nmr->nr_offset = 0; - nmr->nr_rx_rings = nmr->nr_tx_rings = 0; - nmr->nr_rx_slots = nmr->nr_tx_slots = 0; if (nmr->nr_version != NETMAP_API) { D("API mismatch got %d have %d", nmr->nr_version, NETMAP_API); @@ -824,6 +949,16 @@ netmap_ioctl(struct cdev *dev, u_long cm error = EINVAL; break; } + /* update configuration */ + error = netmap_get_memory(priv); + ND("get_memory returned %d", error); + if (error) + break; + /* memsize is always valid */ + nmr->nr_memsize = nm_mem.nm_totalsize; + nmr->nr_offset = 0; + nmr->nr_rx_rings = nmr->nr_tx_rings = 0; + nmr->nr_rx_slots = nmr->nr_tx_slots = 0; if (nmr->nr_name[0] == '\0') /* just get memory info */ break; error = get_ifp(nmr->nr_name, &ifp); /* get a refcount */ @@ -843,26 +978,26 @@ netmap_ioctl(struct cdev *dev, u_long cm error = EINVAL; break; } - if (priv != NULL) { /* thread already registered */ + /* ensure allocators are ready */ + error = netmap_get_memory(priv); + ND("get_memory returned %d", error); + if (error) + break; + + /* protect access to priv from concurrent NIOCREGIF */ + NMA_LOCK(); + if (priv->np_ifp != NULL) { /* thread already registered */ error = netmap_set_ringid(priv, nmr->nr_ringid); + NMA_UNLOCK(); break; } /* find the interface and a reference */ error = get_ifp(nmr->nr_name, &ifp); /* keep reference */ - if (error) - break; - na = NA(ifp); /* retrieve netmap adapter */ - /* - * Allocate the private per-thread structure. - * XXX perhaps we can use a blocking malloc ? - */ - priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (priv == NULL) { - error = ENOMEM; - nm_if_rele(ifp); /* return the refcount */ + if (error) { + NMA_UNLOCK(); break; } + na = NA(ifp); /* retrieve netmap adapter */ for (i = 10; i > 0; i--) { na->nm_lock(ifp, NETMAP_REG_LOCK, 0); @@ -874,8 +1009,8 @@ netmap_ioctl(struct cdev *dev, u_long cm if (i == 0) { D("too many NIOCREGIF attempts, give up"); error = EINVAL; - free(priv, M_DEVBUF); nm_if_rele(ifp); /* return the refcount */ + NMA_UNLOCK(); break; } @@ -883,7 +1018,7 @@ netmap_ioctl(struct cdev *dev, u_long cm error = netmap_set_ringid(priv, nmr->nr_ringid); if (error) goto error; - priv->np_nifp = nifp = netmap_if_new(nmr->nr_name, na); + nifp = netmap_if_new(nmr->nr_name, na); if (nifp == NULL) { /* allocation failed */ error = ENOMEM; } else if (ifp->if_capenable & IFCAP_NETMAP) { @@ -898,57 +1033,66 @@ netmap_ioctl(struct cdev *dev, u_long cm mtx_init(&na->rx_rings[i].q_lock, "nm_rxq_lock", MTX_NETWORK_LOCK, MTX_DEF); } error = na->nm_register(ifp, 1); /* mode on */ - if (error) + if (error) { netmap_dtor_locked(priv); + netmap_if_free(nifp); + } } if (error) { /* reg. failed, release priv and ref */ error: na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); nm_if_rele(ifp); /* return the refcount */ - bzero(priv, sizeof(*priv)); - free(priv, M_DEVBUF); + priv->np_ifp = NULL; + priv->np_nifp = NULL; + NMA_UNLOCK(); break; } na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - error = devfs_set_cdevpriv(priv, netmap_dtor); - if (error != 0) { - /* could not assign the private storage for the - * thread, call the destructor explicitly. - */ - netmap_dtor(priv); - break; - } + /* the following assignment is a commitment. + * Readers (i.e., poll and *SYNC) check for + * np_nifp != NULL without locking + */ + wmb(); /* make sure previous writes are visible to all CPUs */ + priv->np_nifp = nifp; + NMA_UNLOCK(); /* return the offset of the netmap_if object */ nmr->nr_rx_rings = na->num_rx_rings; nmr->nr_tx_rings = na->num_tx_rings; nmr->nr_rx_slots = na->num_rx_desc; nmr->nr_tx_slots = na->num_tx_desc; - nmr->nr_memsize = nm_mem->nm_totalsize; + nmr->nr_memsize = nm_mem.nm_totalsize; nmr->nr_offset = netmap_if_offset(nifp); break; case NIOCUNREGIF: - if (priv == NULL) { + // XXX we have no data here ? + D("deprecated, data is %p", nmr); + error = EINVAL; + break; + + case NIOCTXSYNC: + case NIOCRXSYNC: + nifp = priv->np_nifp; + + if (nifp == NULL) { error = ENXIO; break; } + rmb(); /* make sure following reads are not from cache */ - /* the interface is unregistered inside the - destructor of the private data. */ - devfs_clear_cdevpriv(); - break; - case NIOCTXSYNC: - case NIOCRXSYNC: - if (priv == NULL) { + ifp = priv->np_ifp; /* we have a reference */ + + if (ifp == NULL) { + D("Internal error: nifp != NULL && ifp == NULL"); error = ENXIO; break; } - ifp = priv->np_ifp; /* we have a reference */ + na = NA(ifp); /* retrieve netmap adapter */ if (priv->np_qfirst == NETMAP_SW_RING) { /* host rings */ if (cmd == NIOCTXSYNC) @@ -1047,6 +1191,12 @@ netmap_poll(struct cdev *dev, int events if (devfs_get_cdevpriv((void **)&priv) != 0 || priv == NULL) return POLLERR; + if (priv->np_nifp == NULL) { + D("No if registered"); + return POLLERR; + } + rmb(); /* make sure following reads are not from cache */ + ifp = priv->np_ifp; // XXX check for deleting() ? if ( (ifp->if_capenable & IFCAP_NETMAP) == 0) @@ -1322,7 +1472,7 @@ netmap_attach(struct netmap_adapter *na, na->tx_rings = (void *)((char *)buf + sizeof(*na)); na->rx_rings = na->tx_rings + na->num_tx_rings + 1; bcopy(na, buf, sizeof(*na)); - ifp->if_capabilities |= IFCAP_NETMAP; + NETMAP_SET_CAPABLE(ifp); na = buf; /* Core lock initialized here. Others are initialized after @@ -1337,7 +1487,7 @@ netmap_attach(struct netmap_adapter *na, } #ifdef linux if (ifp->netdev_ops) { - D("netdev_ops %p", ifp->netdev_ops); + ND("netdev_ops %p", ifp->netdev_ops); /* prepare a clone of the netdev ops */ na->nm_ndo = *ifp->netdev_ops; } @@ -1440,9 +1590,13 @@ netmap_reset(struct netmap_adapter *na, return NULL; /* nothing to reinitialize */ if (tx == NR_TX) { + if (n >= na->num_tx_rings) + return NULL; kring = na->tx_rings + n; new_hwofs = kring->nr_hwcur - new_cur; } else { + if (n >= na->num_rx_rings) + return NULL; kring = na->rx_rings + n; new_hwofs = kring->nr_hwcur + kring->nr_hwavail - new_cur; } @@ -1454,7 +1608,7 @@ netmap_reset(struct netmap_adapter *na, kring->nkr_hwofs = new_hwofs; if (tx == NR_TX) kring->nr_hwavail = kring->nkr_num_slots - 1; - D("new hwofs %d on %s %s[%d]", + ND(10, "new hwofs %d on %s %s[%d]", kring->nkr_hwofs, na->ifp->if_xname, tx == NR_TX ? "TX" : "RX", n); @@ -1501,12 +1655,22 @@ netmap_rx_irq(struct ifnet *ifp, int q, if (!(ifp->if_capenable & IFCAP_NETMAP)) return 0; + ND(5, "received %s queue %d", work_done ? "RX" : "TX" , q); na = NA(ifp); + if (na->na_flags & NAF_SKIP_INTR) { + ND("use regular interrupt"); + return 0; + } + if (work_done) { /* RX path */ + if (q >= na->num_rx_rings) + return 0; // regular queue r = na->rx_rings + q; r->nr_kflags |= NKR_PENDINTR; main_wq = (na->num_rx_rings > 1) ? &na->rx_si : NULL; } else { /* tx path */ + if (q >= na->num_tx_rings) + return 0; // regular queue r = na->tx_rings + q; main_wq = (na->num_tx_rings > 1) ? &na->tx_si : NULL; work_done = &q; /* dummy */ @@ -1560,38 +1724,65 @@ linux_netmap_mmap(struct file *f, struct int lut_skip, i, j; int user_skip = 0; struct lut_entry *l_entry; - const struct netmap_obj_pool *p[] = { - nm_mem->nm_if_pool, - nm_mem->nm_ring_pool, - nm_mem->nm_buf_pool }; + int error = 0; + unsigned long off, tomap; /* * vma->vm_start: start of mapping user address space * vma->vm_end: end of the mapping user address space + * vma->vm_pfoff: offset of first page in the device */ - (void)f; /* UNUSED */ // XXX security checks - for (i = 0; i < 3; i++) { /* loop through obj_pools */ + error = netmap_get_memory(f->private_data); + ND("get_memory returned %d", error); + if (error) + return -error; + + off = vma->vm_pgoff << PAGE_SHIFT; /* offset in bytes */ + tomap = vma->vm_end - vma->vm_start; + for (i = 0; i < NETMAP_POOLS_NR; i++) { /* loop through obj_pools */ + const struct netmap_obj_pool *p = &nm_mem.pools[i]; /* * In each pool memory is allocated in clusters - * of size _clustsize , each containing clustentries + * of size _clustsize, each containing clustentries * entries. For each object k we already store the - * vtophys malling in lut[k] so we use that, scanning + * vtophys mapping in lut[k] so we use that, scanning * the lut[] array in steps of clustentries, * and we map each cluster (not individual pages, * it would be overkill). */ - for (lut_skip = 0, j = 0; j < p[i]->_numclusters; j++) { - l_entry = &p[i]->lut[lut_skip]; + + /* + * We interpret vm_pgoff as an offset into the whole + * netmap memory, as if all clusters where contiguous. + */ + for (lut_skip = 0, j = 0; j < p->_numclusters; j++, lut_skip += p->clustentries) { + unsigned long paddr, mapsize; + if (p->_clustsize <= off) { + off -= p->_clustsize; + continue; + } + l_entry = &p->lut[lut_skip]; /* first obj in the cluster */ + paddr = l_entry->paddr + off; + mapsize = p->_clustsize - off; + off = 0; + if (mapsize > tomap) + mapsize = tomap; + ND("remap_pfn_range(%lx, %lx, %lx)", + vma->vm_start + user_skip, + paddr >> PAGE_SHIFT, mapsize); if (remap_pfn_range(vma, vma->vm_start + user_skip, - l_entry->paddr >> PAGE_SHIFT, p[i]->_clustsize, + paddr >> PAGE_SHIFT, mapsize, vma->vm_page_prot)) return -EAGAIN; // XXX check return value - lut_skip += p[i]->clustentries; - user_skip += p[i]->_clustsize; + user_skip += mapsize; + tomap -= mapsize; + if (tomap == 0) + goto done; } } +done: return 0; } @@ -1636,8 +1827,24 @@ netmap_release(struct inode *inode, stru return (0); } +static int +linux_netmap_open(struct inode *inode, struct file *file) +{ + struct netmap_priv_d *priv; + (void)inode; /* UNUSED */ + + priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (priv == NULL) + return -ENOMEM; + + file->private_data = priv; + + return (0); +} static struct file_operations netmap_fops = { + .open = linux_netmap_open, .mmap = linux_netmap_mmap, LIN_IOCTL_NAME = linux_netmap_ioctl, .poll = linux_netmap_poll, @@ -1683,9 +1890,12 @@ MODULE_LICENSE("Dual BSD/GPL"); /* the c static struct cdevsw netmap_cdevsw = { .d_version = D_VERSION, .d_name = "netmap", + .d_open = netmap_open, .d_mmap = netmap_mmap, + .d_mmap_single = netmap_mmap_single, .d_ioctl = netmap_ioctl, .d_poll = netmap_poll, + .d_close = netmap_close, }; #endif /* __FreeBSD__ */ @@ -2048,8 +2258,7 @@ netmap_init(void) printf("netmap: unable to initialize the memory allocator.\n"); return (error); } - printf("netmap: loaded module with %d Mbytes\n", - (int)(nm_mem->nm_totalsize >> 20)); + printf("netmap: loaded module\n"); netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "netmap"); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Oct 19 03:01:25 2012 (r241718) +++ head/sys/dev/netmap/netmap_kern.h Fri Oct 19 04:13:12 2012 (r241719) @@ -1,6 +1,6 @@ /* * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -9,7 +9,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -25,7 +25,7 @@ /* * $FreeBSD$ - * $Id: netmap_kern.h 11343 2012-07-03 09:08:38Z luigi $ + * $Id: netmap_kern.h 11829 2012-09-26 04:06:34Z luigi $ * * The header contains the definitions of constants and function * prototypes used only in kernelspace. @@ -55,11 +55,10 @@ #endif /* - * IFCAP_NETMAP goes into net_device's flags (if_capabilities) - * and priv_flags (if_capenable). The latter used to be 16 bits - * up to linux 2.6.36, so we need to use a 16 bit value on older + * IFCAP_NETMAP goes into net_device's priv_flags (if_capenable). + * This was 16 bits up to linux 2.6.36, so we need a 16 bit value on older * platforms and tolerate the clash with IFF_DYNAMIC and IFF_BRIDGE_PORT. - * For the 32-bit value, 0x100000 (bit 20) has no clashes up to 3.3.1 + * For the 32-bit value, 0x100000 has no clashes until at least 3.5.1 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) #define IFCAP_NETMAP 0x8000 @@ -68,7 +67,7 @@ #endif #elif defined (__APPLE__) -#warning apple support is experimental +#warning apple support is incomplete. #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #define NM_LOCK_T IOLock * @@ -89,7 +88,19 @@ (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \ __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) - + +/* rate limited, lps indicates how many per second */ +#define RD(lps, format, ...) \ + do { \ + static int t0, __cnt; \ + if (t0 != time_second) { \ + t0 = time_second; \ + __cnt = 0; \ + } \ + if (__cnt++ < lps) \ + D(format, ##__VA_ARGS__); \ + } while (0) + struct netmap_adapter; /* @@ -129,6 +140,18 @@ struct netmap_kring { * support netmap operation. */ struct netmap_adapter { + /* + * On linux we do not have a good way to tell if an interface + * is netmap-capable. So we use the following trick: + * NA(ifp) points here, and the first entry (which hopefully + * always exists and is at least 32 bits) contains a magic + * value which we can use to detect that the interface is good. + */ + uint32_t magic; + uint32_t na_flags; /* future place for IFCAP_NETMAP */ +#define NAF_SKIP_INTR 1 /* use the regular interrupt handler. + * useful during initialization + */ int refcount; /* number of user-space descriptors using this interface, which is equal to the number of struct netmap_if objs in the mapped region. */ @@ -149,7 +172,6 @@ struct netmap_adapter { u_int num_tx_desc; /* number of descriptor in each queue */ u_int num_rx_desc; - //u_int buff_size; // XXX deprecate, use NETMAP_BUF_SIZE /* tx_rings and rx_rings are private but allocated * as a contiguous chunk of memory. Each array has @@ -185,7 +207,7 @@ struct netmap_adapter { }; /* - * The combination of "enable" (ifp->if_capabilities &IFCAP_NETMAP) + * The combination of "enable" (ifp->if_capenable & IFCAP_NETMAP) * and refcount gives the status of the interface, namely: * * enable refcount Status @@ -268,6 +290,36 @@ enum { #endif #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) +/* + * Macros to determine if an interface is netmap capable or netmap enabled. + * See the magic field in struct netmap_adapter. + */ +#ifdef __FreeBSD__ +/* + * on FreeBSD just use if_capabilities and if_capenable. + */ +#define NETMAP_CAPABLE(ifp) (NA(ifp) && \ + (ifp)->if_capabilities & IFCAP_NETMAP ) + +#define NETMAP_SET_CAPABLE(ifp) \ + (ifp)->if_capabilities |= IFCAP_NETMAP + +#else /* linux */ + +/* + * on linux: + * we check if NA(ifp) is set and its first element has a related + * magic value. The capenable is within the struct netmap_adapter. + */ +#define NETMAP_MAGIC 0x52697a7a + +#define NETMAP_CAPABLE(ifp) (NA(ifp) && \ + ((uint32_t)(uintptr_t)NA(ifp) ^ NA(ifp)->magic) == NETMAP_MAGIC ) + +#define NETMAP_SET_CAPABLE(ifp) \ + NA(ifp)->magic = ((uint32_t)(uintptr_t)NA(ifp)) ^ NETMAP_MAGIC + +#endif /* linux */ #ifdef __FreeBSD__ /* Callback invoked by the dma machinery after a successfull dmamap_load */ Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri Oct 19 03:01:25 2012 (r241718) +++ head/sys/dev/netmap/netmap_mem2.c Fri Oct 19 04:13:12 2012 (r241719) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2012 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,19 +25,19 @@ /* * $FreeBSD$ - * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $ + * $Id: netmap_mem2.c 11881 2012-10-18 23:24:15Z luigi $ * - * New memory allocator for netmap + * (New) memory allocator for netmap */ /* - * The new version allocates three regions: - * nm_if_pool for the struct netmap_if - * nm_ring_pool for the struct netmap_ring - * nm_buf_pool for the packet buffers. + * This allocator creates three memory regions: + * nm_if_pool for the struct netmap_if + * nm_ring_pool for the struct netmap_ring + * nm_buf_pool for the packet buffers. * - * All regions need to be page-sized as we export them to - * userspace through mmap. Only the latter need to be dma-able, + * All regions need to be multiple of a page size as we export them to + * userspace through mmap. Only the latter needs to be dma-able, * but for convenience use the same type of allocator for all. * * Once mapped, the three regions are exported to userspace @@ -51,58 +51,97 @@ * of the object, and from there locate the offset from the beginning * of the region. * - * Allocator for a pool of memory objects of the same size. + * The invididual allocators manage a pool of memory for objects of + * the same size. * The pool is split into smaller clusters, whose size is a * multiple of the page size. The cluster size is chosen * to minimize the waste for a given max cluster size * (we do it by brute force, as we have relatively few object * per cluster). * - * To be polite with the cache, objects are aligned to - * the cache line, or 64 bytes. Sizes are rounded to multiple of 64. - * For each object we have - * one entry in the bitmap to signal the state. Allocation scans - * the bitmap, but since this is done only on attach, we are not + * Objects are aligned to the cache line (64 bytes) rounding up object + * sizes when needed. A bitmap contains the state of each object. + * Allocation scans the bitmap; this is done only on attach, so we are not * too worried about performance - */ - -/* - * MEMORY SIZES: * - * (all the parameters below will become tunables) - * - * struct netmap_if is variable size but small. - * Assuming each NIC has 8+2 rings, (4+1 tx, 4+1 rx) the netmap_if - * uses 120 bytes on a 64-bit machine. - * We allocate NETMAP_IF_MAX_SIZE (1024) which should work even for - * cards with 48 ring pairs. - * The total number of 'struct netmap_if' could be slightly larger - * that the total number of rings on all interfaces on the system. + * For each allocator we can define (thorugh sysctl) the size and + * number of each object. Memory is allocated at the first use of a + * netmap file descriptor, and can be freed when all such descriptors + * have been released (including unmapping the memory). + * If memory is scarce, the system tries to get as much as possible + * and the sysctl values reflect the actual allocation. + * Together with desired values, the sysctl export also absolute + * min and maximum values that cannot be overridden. + * + * struct netmap_if: + * variable size, max 16 bytes per ring pair plus some fixed amount. + * 1024 bytes should be large enough in practice. + * + * In the worst case we have one netmap_if per ring in the system. + * + * struct netmap_ring + * variable too, 8 byte per slot plus some fixed amount. + * Rings can be large (e.g. 4k slots, or >32Kbytes). + * We default to 36 KB (9 pages), and a few hundred rings. + * + * struct netmap_buffer + * The more the better, both because fast interfaces tend to have + * many slots, and because we may want to use buffers to store + * packets in userspace avoiding copies. + * Must contain a full frame (eg 1518, or more for vlans, jumbo + * frames etc.) plus be nicely aligned, plus some NICs restrict + * the size to multiple of 1K or so. Default to 2K */ -#define NETMAP_IF_MAX_SIZE 1024 -#define NETMAP_IF_MAX_NUM 512 -/* - * netmap rings are up to 2..4k descriptors, 8 bytes each, - * plus some glue at the beginning (32 bytes). - * We set the default ring size to 9 pages (36K) and enable - * a few hundreds of them. - */ -#define NETMAP_RING_MAX_SIZE (9*PAGE_SIZE) -#define NETMAP_RING_MAX_NUM 200 /* approx 8MB */ - -/* - * Buffers: the more the better. Buffer size is NETMAP_BUF_SIZE, - * 2k or slightly less, aligned to 64 bytes. - * A large 10G interface can have 2k*18 = 36k buffers per interface, - * or about 72MB of memory. Up to us to use more. - */ #ifndef CONSERVATIVE -#define NETMAP_BUF_MAX_NUM 100000 /* 200MB */ +#define NETMAP_BUF_MAX_NUM 20*4096*2 /* large machine */ #else /* CONSERVATIVE */ #define NETMAP_BUF_MAX_NUM 20000 /* 40MB */ #endif +#ifdef linux +#define NMA_LOCK_T struct semaphore +#define NMA_LOCK_INIT() sema_init(&nm_mem.nm_mtx, 1) +#define NMA_LOCK_DESTROY() +#define NMA_LOCK() down(&nm_mem.nm_mtx) +#define NMA_UNLOCK() up(&nm_mem.nm_mtx) +#else /* !linux */ +#define NMA_LOCK_T struct mtx +#define NMA_LOCK_INIT() mtx_init(&nm_mem.nm_mtx, "netmap memory allocator lock", NULL, MTX_DEF) +#define NMA_LOCK_DESTROY() mtx_destroy(&nm_mem.nm_mtx) +#define NMA_LOCK() mtx_lock(&nm_mem.nm_mtx) +#define NMA_UNLOCK() mtx_unlock(&nm_mem.nm_mtx) +#endif /* linux */ + +enum { + NETMAP_IF_POOL = 0, + NETMAP_RING_POOL, + NETMAP_BUF_POOL, + NETMAP_POOLS_NR +}; + + +struct netmap_obj_params { + u_int size; + u_int num; +}; + + +struct netmap_obj_params netmap_params[NETMAP_POOLS_NR] = { + [NETMAP_IF_POOL] = { + .size = 1024, + .num = 100, + }, + [NETMAP_RING_POOL] = { + .size = 9*PAGE_SIZE, + .num = 200, + }, + [NETMAP_BUF_POOL] = { + .size = 2048, + .num = NETMAP_BUF_MAX_NUM, + }, +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 05:43:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 131C8289; Fri, 19 Oct 2012 05:43:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC3038FC12; Fri, 19 Oct 2012 05:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9J5hdLX006401; Fri, 19 Oct 2012 05:43:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9J5hdUS006370; Fri, 19 Oct 2012 05:43:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210190543.q9J5hdUS006370@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Oct 2012 05:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241720 - in head: bin/ed bin/getfacl bin/pax bin/rcp bin/setfacl lib/libdwarf lib/libelf lib/librpcsec_gss lib/libthread_db libexec/tftpd sbin/etherswitchcfg sbin/ggate/ggatec sbin/gga... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 05:43:40 -0000 Author: ed Date: Fri Oct 19 05:43:38 2012 New Revision: 241720 URL: http://svn.freebsd.org/changeset/base/241720 Log: Fix warnings found by -Wmising-variable-declarations. This self-written compiler warning, which is hopefully going to be committed into LLVM sources soon, warns about potentially missing `static' keywords, similar to -Wmissing-prototypes. - bin/pax: Move external declaration of chdname and s_mask into extern.h. - bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h. - sbin/mount_fusefs: Remove char *progname; use getprogname(). - others: add `static' where possible. Modified: head/bin/ed/buf.c head/bin/ed/cbc.c head/bin/ed/glbl.c head/bin/ed/io.c head/bin/ed/main.c head/bin/ed/sub.c head/bin/ed/undo.c head/bin/getfacl/getfacl.c head/bin/pax/ar_io.c head/bin/pax/ar_subs.c head/bin/pax/extern.h head/bin/pax/options.c head/bin/rcp/rcp.c head/bin/setfacl/setfacl.c head/bin/setfacl/setfacl.h head/lib/libdwarf/dwarf_errmsg.c head/lib/libelf/elf_errmsg.c head/lib/librpcsec_gss/svc_rpcsec_gss.c head/lib/libthread_db/libpthread_db.c head/lib/libthread_db/libthr_db.c head/libexec/tftpd/tftp-io.c head/libexec/tftpd/tftp-utils.c head/libexec/tftpd/tftpd.c head/sbin/etherswitchcfg/etherswitchcfg.c head/sbin/etherswitchcfg/ifmedia.c head/sbin/ggate/ggatec/ggatec.c head/sbin/ggate/ggated/ggated.c head/sbin/ggate/ggatel/ggatel.c head/sbin/mount_fusefs/mount_fusefs.c head/sbin/rcorder/rcorder.c Modified: head/bin/ed/buf.c ============================================================================== --- head/bin/ed/buf.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/buf.c Fri Oct 19 05:43:38 2012 (r241720) @@ -35,10 +35,10 @@ __FBSDID("$FreeBSD$"); #include "ed.h" -FILE *sfp; /* scratch file pointer */ -off_t sfseek; /* scratch file position */ -int seek_write; /* seek before writing */ -line_t buffer_head; /* incore buffer */ +static FILE *sfp; /* scratch file pointer */ +static off_t sfseek; /* scratch file position */ +static int seek_write; /* seek before writing */ +static line_t buffer_head; /* incore buffer */ /* get_sbuf_line: get a line of text from the scratch file; return pointer to the text */ @@ -188,7 +188,7 @@ get_addressed_line_node(long n) extern int newline_added; -char sfn[15] = ""; /* scratch file name */ +static char sfn[15] = ""; /* scratch file name */ /* open_sbuf: open scratch file */ int @@ -244,7 +244,7 @@ quit(int n) } -unsigned char ctab[256]; /* character translation table */ +static unsigned char ctab[256]; /* character translation table */ /* init_buffers: open scratch buffer; initialize line queue */ void Modified: head/bin/ed/cbc.c ============================================================================== --- head/bin/ed/cbc.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/cbc.c Fri Oct 19 05:43:38 2012 (r241720) @@ -68,28 +68,24 @@ __FBSDID("$FreeBSD$"); * global variables and related macros */ -enum { /* encrypt, decrypt, authenticate */ - MODE_ENCRYPT, MODE_DECRYPT, MODE_AUTHENTICATE -} mode = MODE_ENCRYPT; - #ifdef DES -DES_cblock ivec; /* initialization vector */ -DES_cblock pvec; /* padding vector */ +static DES_cblock ivec; /* initialization vector */ +static DES_cblock pvec; /* padding vector */ #endif -char bits[] = { /* used to extract bits from a char */ +static char bits[] = { /* used to extract bits from a char */ '\200', '\100', '\040', '\020', '\010', '\004', '\002', '\001' }; -int pflag; /* 1 to preserve parity bits */ +static int pflag; /* 1 to preserve parity bits */ #ifdef DES -DES_key_schedule schedule; /* expanded DES key */ +static DES_key_schedule schedule; /* expanded DES key */ #endif -unsigned char des_buf[8]; /* shared buffer for get_des_char/put_des_char */ -int des_ct = 0; /* count for get_des_char/put_des_char */ -int des_n = 0; /* index for put_des_char/get_des_char */ +static unsigned char des_buf[8];/* shared buffer for get_des_char/put_des_char */ +static int des_ct = 0; /* count for get_des_char/put_des_char */ +static int des_n = 0; /* index for put_des_char/get_des_char */ /* init_des_cipher: initialize DES */ void Modified: head/bin/ed/glbl.c ============================================================================== --- head/bin/ed/glbl.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/glbl.c Fri Oct 19 05:43:38 2012 (r241720) @@ -135,11 +135,11 @@ exec_global(int interact, int gflag) } -line_t **active_list; /* list of lines active in a global command */ -long active_last; /* index of last active line in active_list */ -long active_size; /* size of active_list */ -long active_ptr; /* active_list index (non-decreasing) */ -long active_ndx; /* active_list index (modulo active_last) */ +static line_t **active_list; /* list of lines active in a global command */ +static long active_last; /* index of last active line in active_list */ +static long active_size; /* size of active_list */ +static long active_ptr; /* active_list index (non-decreasing) */ +static long active_ndx; /* active_list index (modulo active_last) */ /* set_active_node: add a line node to the global-active list */ int Modified: head/bin/ed/io.c ============================================================================== --- head/bin/ed/io.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/io.c Fri Oct 19 05:43:38 2012 (r241720) @@ -61,8 +61,8 @@ read_file(char *fn, long n) extern int des; -char *sbuf; /* file i/o buffer */ -int sbufsz; /* file i/o buffer size */ +static char *sbuf; /* file i/o buffer */ +static int sbufsz; /* file i/o buffer size */ int newline_added; /* if set, newline appended to input file */ /* read_stream: read a stream into the editor buffer; return status */ Modified: head/bin/ed/main.c ============================================================================== --- head/bin/ed/main.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/main.c Fri Oct 19 05:43:38 2012 (r241720) @@ -66,40 +66,40 @@ __FBSDID("$FreeBSD$"); #ifdef _POSIX_SOURCE -sigjmp_buf env; +static sigjmp_buf env; #else -jmp_buf env; +static jmp_buf env; #endif /* static buffers */ char stdinbuf[1]; /* stdin buffer */ -char *shcmd; /* shell command buffer */ -int shcmdsz; /* shell command buffer size */ -int shcmdi; /* shell command buffer index */ +static char *shcmd; /* shell command buffer */ +static int shcmdsz; /* shell command buffer size */ +static int shcmdi; /* shell command buffer index */ char *ibuf; /* ed command-line buffer */ int ibufsz; /* ed command-line buffer size */ char *ibufp; /* pointer to ed command-line buffer */ /* global flags */ int des = 0; /* if set, use crypt(3) for i/o */ -int garrulous = 0; /* if set, print all error messages */ +static int garrulous = 0; /* if set, print all error messages */ int isbinary; /* if set, buffer contains ASCII NULs */ int isglobal; /* if set, doing a global command */ int modified; /* if set, buffer modified since last write */ int mutex = 0; /* if set, signals set "sigflags" */ -int red = 0; /* if set, restrict shell/directory access */ +static int red = 0; /* if set, restrict shell/directory access */ int scripted = 0; /* if set, suppress diagnostics */ int sigflags = 0; /* if set, signals received while mutex set */ -int sigactive = 0; /* if set, signal handlers are enabled */ +static int sigactive = 0; /* if set, signal handlers are enabled */ -char old_filename[PATH_MAX] = ""; /* default filename */ +static char old_filename[PATH_MAX] = ""; /* default filename */ long current_addr; /* current address in editor buffer */ long addr_last; /* last address in editor buffer */ int lineno; /* script line number */ -const char *prompt; /* command-line prompt */ -const char *dps = "*"; /* default command-line prompt */ +static const char *prompt; /* command-line prompt */ +static const char *dps = "*"; /* default command-line prompt */ -const char usage[] = "usage: %s [-] [-sx] [-p string] [file]\n"; +static const char *usage = "usage: %s [-] [-sx] [-p string] [file]\n"; /* ed: line editor */ int @@ -254,7 +254,8 @@ top: /*NOTREACHED*/ } -long first_addr, second_addr, addr_cnt; +long first_addr, second_addr; +static long addr_cnt; /* extract_addr_range: get line addresses from the command buffer until an illegal address is seen; return status */ @@ -1241,8 +1242,8 @@ display_lines(long from, long to, int gf #define MAXMARK 26 /* max number of marks */ -line_t *mark[MAXMARK]; /* line markers */ -int markno; /* line marker count */ +static line_t *mark[MAXMARK]; /* line markers */ +static int markno; /* line marker count */ /* mark_line_node: set a line node mark */ int Modified: head/bin/ed/sub.c ============================================================================== --- head/bin/ed/sub.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/sub.c Fri Oct 19 05:43:38 2012 (r241720) @@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$"); #include "ed.h" -char *rhbuf; /* rhs substitution buffer */ -int rhbufsz; /* rhs substitution buffer size */ -int rhbufi; /* rhs substitution buffer index */ +static char *rhbuf; /* rhs substitution buffer */ +static int rhbufsz; /* rhs substitution buffer size */ +static int rhbufi; /* rhs substitution buffer index */ /* extract_subst_tail: extract substitution tail from the command buffer */ int @@ -105,8 +105,8 @@ extract_subst_template(void) } -char *rbuf; /* substitute_matching_text buffer */ -int rbufsz; /* substitute_matching_text buffer size */ +static char *rbuf; /* substitute_matching_text buffer */ +static int rbufsz; /* substitute_matching_text buffer size */ /* search_and_replace: for each line in a range, change text matching a pattern according to a substitution template; return status */ Modified: head/bin/ed/undo.c ============================================================================== --- head/bin/ed/undo.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/ed/undo.c Fri Oct 19 05:43:38 2012 (r241720) @@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$"); #define USIZE 100 /* undo stack size */ -undo_t *ustack = NULL; /* undo stack */ -long usize = 0; /* stack size variable */ -long u_p = 0; /* undo stack pointer */ +static undo_t *ustack = NULL; /* undo stack */ +static long usize = 0; /* stack size variable */ +static long u_p = 0; /* undo stack pointer */ /* push_undo_stack: return pointer to initialized undo node */ undo_t * Modified: head/bin/getfacl/getfacl.c ============================================================================== --- head/bin/getfacl/getfacl.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/getfacl/getfacl.c Fri Oct 19 05:43:38 2012 (r241720) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -int more_than_one = 0; +static int more_than_one = 0; static void usage(void) Modified: head/bin/pax/ar_io.c ============================================================================== --- head/bin/pax/ar_io.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/pax/ar_io.c Fri Oct 19 05:43:38 2012 (r241720) @@ -85,7 +85,6 @@ const char *gzip_program; /* name of gz static pid_t zpid = -1; /* pid of child process */ static int get_phys(void); -extern sigset_t s_mask; static void ar_start_gzip(int, const char *, int); /* Modified: head/bin/pax/ar_subs.c ============================================================================== --- head/bin/pax/ar_subs.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/pax/ar_subs.c Fri Oct 19 05:43:38 2012 (r241720) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); static void wr_archive(ARCHD *, int is_app); static int get_arc(void); static int next_head(ARCHD *); -extern sigset_t s_mask; /* * Routines which control the overall operation modes of pax as specified by Modified: head/bin/pax/extern.h ============================================================================== --- head/bin/pax/extern.h Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/pax/extern.h Fri Oct 19 05:43:38 2012 (r241720) @@ -186,7 +186,7 @@ void options(int, char **); OPLIST * opt_next(void); int opt_add(const char *); int bad_opt(void); -char *chdname; +extern char *chdname; /* * pat_rep.c @@ -231,6 +231,7 @@ extern int exit_val; extern int docrc; extern char *dirptr; extern const char *argv0; +extern sigset_t s_mask; extern FILE *listf; extern char *tempfile; extern char *tempbase; Modified: head/bin/pax/options.c ============================================================================== --- head/bin/pax/options.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/pax/options.c Fri Oct 19 05:43:38 2012 (r241720) @@ -81,6 +81,7 @@ static void cpio_usage(void); #define GETLINE_OUT_OF_MEM 2 static int getline_error; +char *chdname; #define GZIP_CMD "gzip" /* command to run as gzip */ #define COMPRESS_CMD "compress" /* command to run as compress */ Modified: head/bin/rcp/rcp.c ============================================================================== --- head/bin/rcp/rcp.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/rcp/rcp.c Fri Oct 19 05:43:38 2012 (r241720) @@ -76,12 +76,13 @@ __FBSDID("$FreeBSD$"); #define OPTIONS "46dfprt" -struct passwd *pwd; -u_short port; -uid_t userid; -int errs, rem; -int pflag, iamremote, iamrecursive, targetshouldbedirectory; -int family = PF_UNSPEC; +static struct passwd *pwd; +static u_short port; +static uid_t userid; +static int errs, rem; +int iamremote; +static int pflag, iamrecursive, targetshouldbedirectory; +static int family = PF_UNSPEC; static int argc_copy; static const char **argv_copy; @@ -89,7 +90,7 @@ static const char **argv_copy; static char period[] = "."; #define CMDNEEDS 64 -char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ +static char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ int response(void); void rsource(char *, struct stat *); Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/setfacl/setfacl.c Fri Oct 19 05:43:38 2012 (r241720) @@ -42,6 +42,35 @@ __FBSDID("$FreeBSD$"); #include "setfacl.h" +/* file operations */ +#define OP_MERGE_ACL 0x00 /* merge acl's (-mM) */ +#define OP_REMOVE_DEF 0x01 /* remove default acl's (-k) */ +#define OP_REMOVE_EXT 0x02 /* remove extended acl's (-b) */ +#define OP_REMOVE_ACL 0x03 /* remove acl's (-xX) */ +#define OP_REMOVE_BY_NUMBER 0x04 /* remove acl's (-xX) by acl entry number */ +#define OP_ADD_ACL 0x05 /* add acls entries at a given position */ + +/* TAILQ entry for acl operations */ +struct sf_entry { + uint op; + acl_t acl; + uint entry_number; + TAILQ_ENTRY(sf_entry) next; +}; +static TAILQ_HEAD(, sf_entry) entrylist; + +/* TAILQ entry for files */ +struct sf_file { + const char *filename; + TAILQ_ENTRY(sf_file) next; +}; +static TAILQ_HEAD(, sf_file) filelist; + +uint have_mask; +uint need_mask; +uint have_stdin; +uint n_flag; + static void add_filename(const char *filename); static void usage(void); Modified: head/bin/setfacl/setfacl.h ============================================================================== --- head/bin/setfacl/setfacl.h Fri Oct 19 04:13:12 2012 (r241719) +++ head/bin/setfacl/setfacl.h Fri Oct 19 05:43:38 2012 (r241720) @@ -33,30 +33,6 @@ #include #include -/* file operations */ -#define OP_MERGE_ACL 0x00 /* merge acl's (-mM) */ -#define OP_REMOVE_DEF 0x01 /* remove default acl's (-k) */ -#define OP_REMOVE_EXT 0x02 /* remove extended acl's (-b) */ -#define OP_REMOVE_ACL 0x03 /* remove acl's (-xX) */ -#define OP_REMOVE_BY_NUMBER 0x04 /* remove acl's (-xX) by acl entry number */ -#define OP_ADD_ACL 0x05 /* add acls entries at a given position */ - -/* TAILQ entry for acl operations */ -struct sf_entry { - uint op; - acl_t acl; - uint entry_number; - TAILQ_ENTRY(sf_entry) next; -}; -TAILQ_HEAD(, sf_entry) entrylist; - -/* TAILQ entry for files */ -struct sf_file { - const char *filename; - TAILQ_ENTRY(sf_file) next; -}; -TAILQ_HEAD(, sf_file) filelist; - /* files.c */ acl_t get_acl_from_file(const char *filename); /* merge.c */ @@ -74,9 +50,9 @@ void *zmalloc(size_t size); const char *brand_name(int brand); int branding_mismatch(int brand1, int brand2); -uint have_mask; -uint need_mask; -uint have_stdin; -uint n_flag; +extern uint have_mask; +extern uint need_mask; +extern uint have_stdin; +extern uint n_flag; #endif /* _SETFACL_H */ Modified: head/lib/libdwarf/dwarf_errmsg.c ============================================================================== --- head/lib/libdwarf/dwarf_errmsg.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/lib/libdwarf/dwarf_errmsg.c Fri Oct 19 05:43:38 2012 (r241720) @@ -29,7 +29,7 @@ #include #include "_libdwarf.h" -const char *_libdwarf_errors[] = { +static const char *_libdwarf_errors[] = { #define DEFINE_ERROR(N,S) [DWARF_E_##N] = S DEFINE_ERROR(NONE, "No Error"), DEFINE_ERROR(ERROR, "An error"), Modified: head/lib/libelf/elf_errmsg.c ============================================================================== --- head/lib/libelf/elf_errmsg.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/lib/libelf/elf_errmsg.c Fri Oct 19 05:43:38 2012 (r241720) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); * Retrieve a human readable translation for an error message. */ -const char *_libelf_errors[] = { +static const char *_libelf_errors[] = { #define DEFINE_ERROR(N,S) [ELF_E_##N] = S DEFINE_ERROR(NONE, "No Error"), DEFINE_ERROR(ARCHIVE, "Malformed ar(1) archive"), Modified: head/lib/librpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/lib/librpcsec_gss/svc_rpcsec_gss.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/lib/librpcsec_gss/svc_rpcsec_gss.c Fri Oct 19 05:43:38 2012 (r241720) @@ -140,8 +140,8 @@ TAILQ_HEAD(svc_rpc_gss_client_list, svc_ #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 -struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; -struct svc_rpc_gss_client_list svc_rpc_gss_clients; +static struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; +static struct svc_rpc_gss_client_list svc_rpc_gss_clients; static size_t svc_rpc_gss_client_count; static uint32_t svc_rpc_gss_next_clientid = 1; Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/lib/libthread_db/libpthread_db.c Fri Oct 19 05:43:38 2012 (r241720) @@ -1107,7 +1107,7 @@ pt_thr_tls_get_addr(const td_thrhandle_t return (TD_OK); } -struct ta_ops libpthread_db_ops = { +static struct ta_ops libpthread_db_ops = { .to_init = pt_init, .to_ta_clear_event = pt_ta_clear_event, .to_ta_delete = pt_ta_delete, Modified: head/lib/libthread_db/libthr_db.c ============================================================================== --- head/lib/libthread_db/libthr_db.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/lib/libthread_db/libthr_db.c Fri Oct 19 05:43:38 2012 (r241720) @@ -765,7 +765,7 @@ pt_thr_tls_get_addr(const td_thrhandle_t return (TD_OK); } -struct ta_ops libthr_db_ops = { +static struct ta_ops libthr_db_ops = { .to_init = pt_init, .to_ta_clear_event = pt_ta_clear_event, .to_ta_delete = pt_ta_delete, Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/libexec/tftpd/tftp-io.c Fri Oct 19 05:43:38 2012 (r241720) @@ -53,7 +53,7 @@ struct sockaddr_storage me_sock; static int send_packet(int peer, uint16_t block, char *pkt, int size); -struct errmsg { +static struct errmsg { int e_code; const char *e_msg; } errmsgs[] = { @@ -375,7 +375,7 @@ send_data(int peer, uint16_t block, char /* * Receive a packet */ -jmp_buf timeoutbuf; +static jmp_buf timeoutbuf; static void timeout(int sig __unused) Modified: head/libexec/tftpd/tftp-utils.c ============================================================================== --- head/libexec/tftpd/tftp-utils.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/libexec/tftpd/tftp-utils.c Fri Oct 19 05:43:38 2012 (r241720) @@ -121,7 +121,7 @@ get_field(int peer, char *buffer, ssize_ /* * Logging functions */ -int _tftp_logtostdout = 1; +static int _tftp_logtostdout = 1; void tftp_openlog(const char *ident, int logopt, int facility) Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/libexec/tftpd/tftpd.c Fri Oct 19 05:43:38 2012 (r241720) @@ -107,9 +107,9 @@ static void tftp_xmitfile(int peer, cons static int validate_access(int peer, char **, int); static char peername[NI_MAXHOST]; -FILE *file; +static FILE *file; -struct formats { +static struct formats { const char *f_mode; int f_convert; } formats[] = { Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Fri Oct 19 05:43:38 2012 (r241720) @@ -79,7 +79,7 @@ struct cmds { int args; void (*f)(struct cfg *, char *argv[]); }; -struct cmds cmds[]; +static struct cmds cmds[]; static void usage(void); @@ -501,7 +501,7 @@ main(int argc, char *argv[]) return (0); } -struct cmds cmds[] = { +static struct cmds cmds[] = { { MODE_PORT, "vlangroup", 1, set_port_vlangroup }, { MODE_PORT, "media", 1, set_port_media }, { MODE_PORT, "mediaopt", 1, set_port_mediaopt }, Modified: head/sbin/etherswitchcfg/ifmedia.c ============================================================================== --- head/sbin/etherswitchcfg/ifmedia.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/etherswitchcfg/ifmedia.c Fri Oct 19 05:43:38 2012 (r241720) @@ -396,10 +396,10 @@ static struct ifmedia_description ifm_su static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] = IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS; -struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = +static struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS; -struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = +static struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = IFM_SUBTYPE_IEEE80211_MODE_ALIASES; static struct ifmedia_description ifm_subtype_atm_descriptions[] = Modified: head/sbin/ggate/ggatec/ggatec.c ============================================================================== --- head/sbin/ggate/ggatec/ggatec.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/ggate/ggatec/ggatec.c Fri Oct 19 05:43:38 2012 (r241720) @@ -55,7 +55,7 @@ #include "ggate.h" -enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; +static enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; static const char *host = NULL; Modified: head/sbin/ggate/ggated/ggated.c ============================================================================== --- head/sbin/ggate/ggated/ggated.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/ggate/ggated/ggated.c Fri Oct 19 05:43:38 2012 (r241720) @@ -92,12 +92,12 @@ struct ggd_export { static const char *exports_file = GGATED_EXPORT_FILE; static int got_sighup = 0; -in_addr_t bindaddr; +static in_addr_t bindaddr; static TAILQ_HEAD(, ggd_request) inqueue = TAILQ_HEAD_INITIALIZER(inqueue); static TAILQ_HEAD(, ggd_request) outqueue = TAILQ_HEAD_INITIALIZER(outqueue); -pthread_mutex_t inqueue_mtx, outqueue_mtx; -pthread_cond_t inqueue_cond, outqueue_cond; +static pthread_mutex_t inqueue_mtx, outqueue_mtx; +static pthread_cond_t inqueue_cond, outqueue_cond; static SLIST_HEAD(, ggd_export) exports = SLIST_HEAD_INITIALIZER(exports); static LIST_HEAD(, ggd_connection) connections = LIST_HEAD_INITIALIZER(connections); Modified: head/sbin/ggate/ggatel/ggatel.c ============================================================================== --- head/sbin/ggate/ggatel/ggatel.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/ggate/ggatel/ggatel.c Fri Oct 19 05:43:38 2012 (r241720) @@ -47,7 +47,7 @@ #include "ggate.h" -enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; +static enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; static int unit = G_GATE_UNIT_AUTO; Modified: head/sbin/mount_fusefs/mount_fusefs.c ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/mount_fusefs/mount_fusefs.c Fri Oct 19 05:43:38 2012 (r241720) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -61,7 +60,7 @@ void helpmsg(void); void showversion(void); int init_backgrounded(void); -struct mntopt mopts[] = { +static struct mntopt mopts[] = { #define ALTF_PRIVATE 0x01 { "private", 0, ALTF_PRIVATE, 1 }, { "neglect_shares", 0, 0x02, 1 }, @@ -93,14 +92,12 @@ struct mntval { int mv_len; }; -struct mntval mvals[] = { +static struct mntval mvals[] = { { ALTF_MAXREAD, NULL, 0 }, { ALTF_SUBTYPE, NULL, 0 }, { 0, NULL, 0 } }; -char *progname; - #define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE | ALTF_SYNC_UNMOUNT int @@ -133,8 +130,6 @@ main(int argc, char *argv[]) char *ep; char *daemon_str = NULL, *daemon_opts = NULL; - progname = argv[0]; - /* * We want a parsing routine which is not sensitive to * the position of args/opts; it should extract the @@ -432,7 +427,7 @@ void __usage_short(void) { fprintf(stderr, "usage:\n%s [-A|-S|-v|-V|-h|-D daemon|-O args|-s special|-m node|-o option...] special node [daemon args...]\n\n", - basename(progname)); + getprogname()); } void Modified: head/sbin/rcorder/rcorder.c ============================================================================== --- head/sbin/rcorder/rcorder.c Fri Oct 19 04:13:12 2012 (r241719) +++ head/sbin/rcorder/rcorder.c Fri Oct 19 05:43:38 2012 (r241720) @@ -84,7 +84,7 @@ typedef bool flag; #define SET TRUE #define RESET FALSE -Hash_Table provide_hash_s, *provide_hash; +static Hash_Table provide_hash_s, *provide_hash; typedef struct provnode provnode; typedef struct filenode filenode; From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 05:50:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0F9F475; Fri, 19 Oct 2012 05:50:56 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 896308FC0A; Fri, 19 Oct 2012 05:50:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9J5ouEG007630; Fri, 19 Oct 2012 05:50:56 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9J5ouwI007628; Fri, 19 Oct 2012 05:50:56 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201210190550.q9J5ouwI007628@svn.freebsd.org> From: Tim Kientzle Date: Fri, 19 Oct 2012 05:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241721 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 05:50:56 -0000 Author: kientzle Date: Fri Oct 19 05:50:56 2012 New Revision: 241721 URL: http://svn.freebsd.org/changeset/base/241721 Log: Replace deprecated M_DONTWAIT with M_NOWAIT. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Oct 19 05:43:38 2012 (r241720) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Oct 19 05:50:56 2012 (r241721) @@ -522,7 +522,7 @@ cpsw_new_rxbuf(struct cpsw_softc *sc, ui int error; int nsegs; - sc->rx_mbuf[i] = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sc->rx_mbuf[i] = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (sc->rx_mbuf[i] == NULL) return (ENOBUFS); @@ -628,7 +628,7 @@ cpsw_start_locked(struct ifnet *ifp) if (m0 == NULL) break; - mtmp = m_defrag(m0, M_DONTWAIT); + mtmp = m_defrag(m0, M_NOWAIT); if (mtmp) m0 = mtmp; From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 05:54:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 02BC95FD; Fri, 19 Oct 2012 05:54:43 +0000 (UTC) Date: Fri, 19 Oct 2012 05:54:42 +0000 From: Alexey Dokuchaev To: Devin Teske Subject: Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share Message-ID: <20121019055442.GA9108@FreeBSD.org> References: <201210181843.q9IIhs6N099621@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210181843.q9IIhs6N099621@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 05:54:43 -0000 On Thu, Oct 18, 2012 at 06:43:54PM +0000, Devin Teske wrote: > NOTE: In FreeBSD-9 and higher, dialog(1) does not support the F1 hook, so > the mechanism for providing help to the user had to be changed to a button. How come that new dialog(1) lacks functionality of the old one? ./danfe From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 09:41:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40D479A8; Fri, 19 Oct 2012 09:41:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27EB18FC0A; Fri, 19 Oct 2012 09:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9J9fkw6053120; Fri, 19 Oct 2012 09:41:46 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9J9fjrd053118; Fri, 19 Oct 2012 09:41:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210190941.q9J9fjrd053118@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 19 Oct 2012 09:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241723 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 09:41:46 -0000 Author: glebius Date: Fri Oct 19 09:41:45 2012 New Revision: 241723 URL: http://svn.freebsd.org/changeset/base/241723 Log: Fix build. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Oct 19 08:53:07 2012 (r241722) +++ head/sys/dev/netmap/netmap.c Fri Oct 19 09:41:45 2012 (r241723) @@ -507,8 +507,8 @@ netmap_mmap_single(struct cdev *cdev, vm { vm_object_t obj; - D("cdev %p foff %d size %d objp %p prot %d", cdev, *foff, - objsize, objp, prot); + D("cdev %p foff %jd size %jd objp %p prot %d", cdev, + (intmax_t )*foff, (intmax_t )objsize, objp, prot); obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, curthread->td_ucred); ND("returns obj %p", obj); From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 10:04:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6D81224; Fri, 19 Oct 2012 10:04:44 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75ACC8FC08; Fri, 19 Oct 2012 10:04:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JA4ied057934; Fri, 19 Oct 2012 10:04:44 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JA4iDO057932; Fri, 19 Oct 2012 10:04:44 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210191004.q9JA4iDO057932@svn.freebsd.org> From: Andre Oppermann Date: Fri, 19 Oct 2012 10:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241724 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 10:04:44 -0000 Author: andre Date: Fri Oct 19 10:04:43 2012 New Revision: 241724 URL: http://svn.freebsd.org/changeset/base/241724 Log: Remove splimp() comment from sysinit table and attribute SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END to VNET related initializations. MFC after: 3 days Modified: head/sys/sys/kernel.h Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Fri Oct 19 09:41:45 2012 (r241723) +++ head/sys/sys/kernel.h Fri Oct 19 10:04:43 2012 (r241724) @@ -84,12 +84,6 @@ extern int ticks; * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent * order to support porting. - * - * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of - * initializations to take place at splimp(). This is a historical - * wart that should be removed -- probably running everything at - * splimp() until the first init that doesn't want it is the correct - * fix. They are currently present to ensure historical behavior. */ enum sysinit_sub_id { SI_SUB_DUMMY = 0x0000000, /* not executed; for linker*/ @@ -147,12 +141,12 @@ enum sysinit_sub_id { SI_SUB_P1003_1B = 0x6E00000, /* P1003.1B realtime */ SI_SUB_PSEUDO = 0x7000000, /* pseudo devices*/ SI_SUB_EXEC = 0x7400000, /* execve() handlers */ - SI_SUB_PROTO_BEGIN = 0x8000000, /* XXX: set splimp (kludge)*/ + SI_SUB_PROTO_BEGIN = 0x8000000, /* VNET initialization */ SI_SUB_PROTO_IF = 0x8400000, /* interfaces*/ SI_SUB_PROTO_DOMAININIT = 0x8600000, /* domain registration system */ SI_SUB_PROTO_DOMAIN = 0x8800000, /* domains (address families?)*/ SI_SUB_PROTO_IFATTACHDOMAIN = 0x8800001, /* domain dependent data init*/ - SI_SUB_PROTO_END = 0x8ffffff, /* XXX: set splx (kludge)*/ + SI_SUB_PROTO_END = 0x8ffffff, /* VNET helper functions */ SI_SUB_KPROF = 0x9000000, /* kernel profiling*/ SI_SUB_KICK_SCHEDULER = 0xa000000, /* start the timeout events*/ SI_SUB_INT_CONFIG_HOOKS = 0xa800000, /* Interrupts enabled config */ From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 10:07:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E615159A; Fri, 19 Oct 2012 10:07:55 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEC028FC1A; Fri, 19 Oct 2012 10:07:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JA7tOC058611; Fri, 19 Oct 2012 10:07:55 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JA7tiZ058609; Fri, 19 Oct 2012 10:07:55 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210191007.q9JA7tiZ058609@svn.freebsd.org> From: Andre Oppermann Date: Fri, 19 Oct 2012 10:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241725 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 10:07:56 -0000 Author: andre Date: Fri Oct 19 10:07:55 2012 New Revision: 241725 URL: http://svn.freebsd.org/changeset/base/241725 Log: Update to previous r241688 to use __func__ instead of spelled out function name in log(9) message. Suggested by: glebius Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Oct 19 10:04:43 2012 (r241724) +++ head/sys/net/if.c Fri Oct 19 10:07:55 2012 (r241725) @@ -711,8 +711,8 @@ if_attachdomain1(struct ifnet *ifp) return; if (ifp->if_afdata_initialized >= domain_init_status) { IF_AFDATA_UNLOCK(ifp); - log(LOG_WARNING, "if_attachdomain called more than once " - "on %s\n", ifp->if_xname); + log(LOG_WARNING, "%s called more than once on %s\n", + __func__, ifp->if_xname); return; } ifp->if_afdata_initialized = domain_init_status; From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 10:08:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60B45718 for ; Fri, 19 Oct 2012 10:08:48 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id BE4748FC1A for ; Fri, 19 Oct 2012 10:08:47 +0000 (UTC) Received: (qmail 33722 invoked from network); 19 Oct 2012 11:47:32 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 19 Oct 2012 11:47:32 -0000 Message-ID: <508126A9.9090500@freebsd.org> Date: Fri, 19 Oct 2012 12:08:41 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r241688 - head/sys/net References: <201210181408.q9IE8QwE053495@svn.freebsd.org> <20121018141120.GJ89655@FreeBSD.org> In-Reply-To: <20121018141120.GJ89655@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 10:08:48 -0000 On 18.10.2012 16:11, Gleb Smirnoff wrote: > On Thu, Oct 18, 2012 at 02:08:26PM +0000, Andre Oppermann wrote: > A> Author: andre > A> Date: Thu Oct 18 14:08:26 2012 > A> New Revision: 241688 > A> URL: http://svn.freebsd.org/changeset/base/241688 > A> > A> Log: > A> Use LOG_WARNING level in in_attachdomain1() instead of printf(). > A> > A> Submitted by: vijju.singh-at-gmail.com > A> > A> Modified: > A> head/sys/net/if.c > A> > A> Modified: head/sys/net/if.c > A> ============================================================================== > A> --- head/sys/net/if.c Thu Oct 18 13:57:28 2012 (r241687) > A> +++ head/sys/net/if.c Thu Oct 18 14:08:26 2012 (r241688) > A> @@ -711,8 +711,8 @@ if_attachdomain1(struct ifnet *ifp) > A> return; > A> if (ifp->if_afdata_initialized >= domain_init_status) { > A> IF_AFDATA_UNLOCK(ifp); > A> - printf("if_attachdomain called more than once on %s\n", > A> - ifp->if_xname); > A> + log(LOG_WARNING, "if_attachdomain called more than once " > A> + "on %s\n", ifp->if_xname); > A> return; > A> } > A> ifp->if_afdata_initialized = domain_init_status; > > It'll be even more perfect if done as > > "%s called more than once on %s\n", __func__, ifp->if_xname Thanks, done in r241725. > And do we need "\n" for log(9)? Yes. -- Andre From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 10:15:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E905F991; Fri, 19 Oct 2012 10:15:32 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7C3C8FC08; Fri, 19 Oct 2012 10:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JAFWfs060264; Fri, 19 Oct 2012 10:15:32 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JAFWm5060261; Fri, 19 Oct 2012 10:15:32 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210191015.q9JAFWm5060261@svn.freebsd.org> From: Andre Oppermann Date: Fri, 19 Oct 2012 10:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241726 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 10:15:33 -0000 Author: andre Date: Fri Oct 19 10:15:32 2012 New Revision: 241726 URL: http://svn.freebsd.org/changeset/base/241726 Log: Move UMA socket zone initialization from uipc_domain.c to uipc_socket.c into one place next to its other related functions to avoid confusion. Modified: head/sys/kern/uipc_domain.c head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Fri Oct 19 10:07:55 2012 (r241725) +++ head/sys/kern/uipc_domain.c Fri Oct 19 10:15:32 2012 (r241726) @@ -239,28 +239,11 @@ domain_add(void *data) mtx_unlock(&dom_mtx); } -static void -socket_zone_change(void *tag) -{ - - uma_zone_set_max(socket_zone, maxsockets); -} - /* ARGSUSED*/ static void domaininit(void *dummy) { - /* - * Before we do any setup, make sure to initialize the - * zone allocator we get struct sockets from. - */ - socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(socket_zone, maxsockets); - EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL, - EVENTHANDLER_PRI_FIRST); - if (max_linkhdr < 16) /* XXX */ max_linkhdr = 16; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Oct 19 10:07:55 2012 (r241725) +++ head/sys/kern/uipc_socket.c Fri Oct 19 10:15:32 2012 (r241726) @@ -227,6 +227,29 @@ MTX_SYSINIT(so_global_mtx, &so_global_mt SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC"); /* + * Initialize the socket subsystem and set up the socket + * memory allocator. + */ +static void +socket_zone_change(void *tag) +{ + + uma_zone_set_max(socket_zone, maxsockets); +} + +static void +socket_init(void *tag) +{ + + socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL, + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(socket_zone, maxsockets); + EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL, + EVENTHANDLER_PRI_FIRST); +} +SYSINIT(socket, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, socket_init, NULL); + +/* * Sysctl to get and set the maximum global sockets limit. Notify protocols * of the change so that they can update their dependent limits as required. */ From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 10:38:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 800A0F0D; Fri, 19 Oct 2012 10:38:33 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68AFD8FC16; Fri, 19 Oct 2012 10:38:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JAcXTO065144; Fri, 19 Oct 2012 10:38:33 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JAcXV9065142; Fri, 19 Oct 2012 10:38:33 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210191038.q9JAcXV9065142@svn.freebsd.org> From: Joel Dahl Date: Fri, 19 Oct 2012 10:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241727 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 10:38:33 -0000 Author: joel (doc committer) Date: Fri Oct 19 10:38:32 2012 New Revision: 241727 URL: http://svn.freebsd.org/changeset/base/241727 Log: Fix minor whitespace issues. Modified: head/share/man/man4/est.4 Modified: head/share/man/man4/est.4 ============================================================================== --- head/share/man/man4/est.4 Fri Oct 19 10:15:32 2012 (r241726) +++ head/share/man/man4/est.4 Fri Oct 19 10:38:32 2012 (r241727) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 18 , 2012 +.Dd October 18, 2012 .Dt EST 4 .Os .Sh NAME @@ -88,8 +88,8 @@ For example .Va cpu0 . .It Va dev.est.%d.freq_settings . The valid frequencies that are allowed by this CPU and their step values. -.It dev.est.0.freq_settings: 2201/45000 2200/45000 2000/39581 1900/37387 -1800/34806 1700/32703 1600/30227 1500/28212 1400/25828 1300/23900 1200/21613 +.It dev.est.0.freq_settings: 2201/45000 2200/45000 2000/39581 1900/37387 +1800/34806 1700/32703 1600/30227 1500/28212 1400/25828 1300/23900 1200/21613 1100/19775 1000/17582 900/15437 800/13723 .Pp .El From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 12:16:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4B2BC9D; Fri, 19 Oct 2012 12:16:29 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A06FC8FC0A; Fri, 19 Oct 2012 12:16:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JCGTaL086270; Fri, 19 Oct 2012 12:16:29 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JCGTCe086268; Fri, 19 Oct 2012 12:16:29 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210191216.q9JCGTCe086268@svn.freebsd.org> From: Andre Oppermann Date: Fri, 19 Oct 2012 12:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241729 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 12:16:30 -0000 Author: andre Date: Fri Oct 19 12:16:29 2012 New Revision: 241729 URL: http://svn.freebsd.org/changeset/base/241729 Log: Move socket UMA zone initialization functionality together into one place. Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Oct 19 11:01:39 2012 (r241728) +++ head/sys/kern/uipc_socket.c Fri Oct 19 12:16:29 2012 (r241729) @@ -173,11 +173,8 @@ static struct filterops sowrite_filtops .f_event = filt_sowrite, }; -uma_zone_t socket_zone; so_gen_t so_gencnt; /* generation count for sockets */ -int maxsockets; - MALLOC_DEFINE(M_SONAME, "soname", "socket name"); MALLOC_DEFINE(M_PCB, "pcb", "protocol control block"); @@ -230,6 +227,9 @@ SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLA * Initialize the socket subsystem and set up the socket * memory allocator. */ +uma_zone_t socket_zone; +int maxsockets; + static void socket_zone_change(void *tag) { @@ -250,6 +250,19 @@ socket_init(void *tag) SYSINIT(socket, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, socket_init, NULL); /* + * Initialise maxsockets. This SYSINIT must be run after + * tunable_mbinit(). + */ +static void +init_maxsockets(void *ignored) +{ + + TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); + maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); +} +SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL); + +/* * Sysctl to get and set the maximum global sockets limit. Notify protocols * of the change so that they can update their dependent limits as required. */ @@ -273,25 +286,11 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) } return (error); } - SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW, &maxsockets, 0, sysctl_maxsockets, "IU", "Maximum number of sockets avaliable"); /* - * Initialise maxsockets. This SYSINIT must be run after - * tunable_mbinit(). - */ -static void -init_maxsockets(void *ignored) -{ - - TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); - maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); -} -SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL); - -/* * Socket operation routines. These routines are called by the routines in * sys_socket.c or from a system process, and implement the semantics of * socket operations by switching out to the protocol specific routines. From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 12:28:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 932B427F; Fri, 19 Oct 2012 12:28:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 785CC8FC14; Fri, 19 Oct 2012 12:28:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JCSRWn088662; Fri, 19 Oct 2012 12:28:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JCSR3c088660; Fri, 19 Oct 2012 12:28:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210191228.q9JCSR3c088660@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Oct 2012 12:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241730 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 12:28:27 -0000 Author: jhb Date: Fri Oct 19 12:28:26 2012 New Revision: 241730 URL: http://svn.freebsd.org/changeset/base/241730 Log: Correct the order of the MFU and MRU labels. I had reversed them. Submitted by: Nikolay Denev ndenev gmail Pointy hat to: jhb MFC after: 3 days Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Oct 19 12:16:29 2012 (r241729) +++ head/usr.bin/top/machine.c Fri Oct 19 12:28:26 2012 (r241730) @@ -178,7 +178,7 @@ char *memorynames[] = { int arc_stats[7]; char *arcnames[] = { - "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other", + "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", NULL }; From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 12:44:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5318E767; Fri, 19 Oct 2012 12:44:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 306AC8FC12; Fri, 19 Oct 2012 12:44:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JCiNIp091887; Fri, 19 Oct 2012 12:44:23 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JCiMMl091879; Fri, 19 Oct 2012 12:44:22 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201210191244.q9JCiMMl091879@svn.freebsd.org> From: Brooks Davis Date: Fri, 19 Oct 2012 12:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241731 - in head: contrib/libc-pwcache include lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 12:44:23 -0000 Author: brooks Date: Fri Oct 19 12:44:22 2012 New Revision: 241731 URL: http://svn.freebsd.org/changeset/base/241731 Log: Replace our version of the pwcache(3) API with NetBSD's implementation. This adds two features: * uid_from_user() and gid_from_group() as the reverse of user_from_uid() and groups_from_gid(). * pwcache_userdb() and pwcache_groupdb() which allow alternative lookup functions to be used. For example lookups from passwd and group databases in a non-standard location. Added: head/contrib/libc-pwcache/ - copied from r241235, vendor/NetBSD/libc-pwcache/dist/ Deleted: head/lib/libc/gen/pwcache.3 head/lib/libc/gen/pwcache.c Modified: head/contrib/libc-pwcache/pwcache.3 (contents, props changed) head/contrib/libc-pwcache/pwcache.c (contents, props changed) head/contrib/libc-pwcache/pwcache.h (contents, props changed) head/include/grp.h head/include/pwd.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map Modified: head/contrib/libc-pwcache/pwcache.3 ============================================================================== --- vendor/NetBSD/libc-pwcache/dist/pwcache.3 Fri Oct 5 20:19:28 2012 (r241235) +++ head/contrib/libc-pwcache/pwcache.3 Fri Oct 19 12:44:22 2012 (r241731) @@ -1,4 +1,5 @@ .\" $NetBSD: pwcache.3,v 1.17 2008/05/02 18:11:04 martin Exp $ +.\" $FreeBSD$ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -55,7 +56,7 @@ .\" .\" @(#)pwcache.3 8.1 (Berkeley) 6/9/93 .\" -.Dd January 24, 2002 +.Dd October 19, 2012 .Dt PWCACHE 3 .Os .Sh NAME @@ -217,4 +218,6 @@ The and .Fn pwcache_groupdb functions first appeared in -.Nx 1.6 . +.Nx 1.6 +and +.Fx 10.0 . Modified: head/contrib/libc-pwcache/pwcache.c ============================================================================== --- vendor/NetBSD/libc-pwcache/dist/pwcache.c Fri Oct 5 20:19:28 2012 (r241235) +++ head/contrib/libc-pwcache/pwcache.c Fri Oct 19 12:44:22 2012 (r241731) @@ -77,6 +77,7 @@ static char sccsid[] = "@(#)cache.c 8.1 __RCSID("$NetBSD: pwcache.c,v 1.31 2010/03/23 20:28:59 drochner Exp $"); #endif #endif /* LIBC_SCCS and not lint */ +__FBSDID("$FreeBSD$"); #include "namespace.h" @@ -91,6 +92,8 @@ __RCSID("$NetBSD: pwcache.c,v 1.31 2010/ #include #include +#define _DIAGASSERT(x) assert((x)) + #if HAVE_NBTOOL_CONFIG_H /* XXX Now, re-apply the renaming that we undid above. */ #define group_from_gid __nbcompat_group_from_gid Modified: head/contrib/libc-pwcache/pwcache.h ============================================================================== --- vendor/NetBSD/libc-pwcache/dist/pwcache.h Fri Oct 5 20:19:28 2012 (r241235) +++ head/contrib/libc-pwcache/pwcache.h Fri Oct 19 12:44:22 2012 (r241731) @@ -1,4 +1,5 @@ /* $NetBSD: pwcache.h,v 1.5 2003/11/10 08:51:51 wiz Exp $ */ +/* $FreeBSD$ */ /*- * Copyright (c) 1992 Keith Muller. Modified: head/include/grp.h ============================================================================== --- head/include/grp.h Fri Oct 19 12:28:26 2012 (r241730) +++ head/include/grp.h Fri Oct 19 12:44:22 2012 (r241731) @@ -69,6 +69,10 @@ struct group *getgrgid(gid_t); struct group *getgrnam(const char *); #if __BSD_VISIBLE const char *group_from_gid(gid_t, int); +int gid_from_group(const char *, gid_t *); +int pwcache_groupdb(int (*)(int), void (*)(void), + struct group * (*)(const char *), + struct group * (*)(gid_t)); #endif #if __BSD_VISIBLE || __XSI_VISIBLE /* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ Modified: head/include/pwd.h ============================================================================== --- head/include/pwd.h Fri Oct 19 12:28:26 2012 (r241730) +++ head/include/pwd.h Fri Oct 19 12:44:22 2012 (r241731) @@ -165,6 +165,10 @@ int getpwuid_r(uid_t, struct passwd *, int getpwent_r(struct passwd *, char *, size_t, struct passwd **); int setpassent(int); const char *user_from_uid(uid_t, int); +int uid_from_user(const char *, uid_t *); +int pwcache_userdb(int (*)(int), void (*)(void), + struct passwd * (*)(const char *), + struct passwd * (*)(uid_t)); #endif __END_DECLS Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Oct 19 12:28:26 2012 (r241730) +++ head/lib/libc/gen/Makefile.inc Fri Oct 19 12:44:22 2012 (r241731) @@ -24,7 +24,7 @@ SRCS+= __getosreldate.c __xuname.c \ lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ pause.c pmadvise.c popen.c posix_spawn.c \ - psignal.c pututxline.c pw_scan.c pwcache.c \ + psignal.c pututxline.c pw_scan.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ scandir.c seed48.c seekdir.c semctl.c \ setdomainname.c sethostname.c setjmperr.c setmode.c \ @@ -36,6 +36,9 @@ SRCS+= __getosreldate.c __xuname.c \ usleep.c utime.c utxdb.c valloc.c vis.c wait.c wait3.c waitpid.c \ wordexp.c +.PATH: ${.CURDIR}/../../contrib/libc-pwcache +SRCS+= pwcache.c pwcache.h + MISRCS+=modf.c CANCELPOINTS_SRCS=sem.c sem_new.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Fri Oct 19 12:28:26 2012 (r241730) +++ head/lib/libc/gen/Symbol.map Fri Oct 19 12:44:22 2012 (r241731) @@ -387,6 +387,10 @@ FBSD_1.3 { fdlopen; __FreeBSD_libc_enter_restricted_mode; getcontextx; + gid_from_group; + pwcache_userdb; + pwcache_groupdb; + uid_from_user; }; FBSDprivate_1.0 { From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 13:26:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8428B4BE; Fri, 19 Oct 2012 13:26:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611CB8FC0A; Fri, 19 Oct 2012 13:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JDQfA6000953; Fri, 19 Oct 2012 13:26:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JDQfGu000947; Fri, 19 Oct 2012 13:26:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210191326.q9JDQfGu000947@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Oct 2012 13:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241733 - in head/sys/dev: cxgb/ulp/tom cxgbe cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 13:26:41 -0000 Author: ed Date: Fri Oct 19 13:26:40 2012 New Revision: 241733 URL: http://svn.freebsd.org/changeset/base/241733 Log: Prefer __containerof() over __member2struct(). The former works better with qualifiers, but also properly type checks the input pointer. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.h head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_l2t.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.h ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom.h Fri Oct 19 13:05:51 2012 (r241732) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom.h Fri Oct 19 13:26:40 2012 (r241733) @@ -142,7 +142,8 @@ void t3_process_tid_release_list(void *d static inline struct tom_data * t3_tomdata(struct toedev *tod) { - return (member2struct(tom_data, tod, tod)); + + return (__containerof(tod, struct tom_data, tod)); } union listen_entry { Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Oct 19 13:05:51 2012 (r241732) +++ head/sys/dev/cxgbe/adapter.h Fri Oct 19 13:26:40 2012 (r241733) @@ -435,7 +435,7 @@ static inline struct sge_rxq * iq_to_rxq(struct sge_iq *iq) { - return (member2struct(sge_rxq, iq, iq)); + return (__containerof(iq, struct sge_rxq, iq)); } @@ -450,7 +450,7 @@ static inline struct sge_ofld_rxq * iq_to_ofld_rxq(struct sge_iq *iq) { - return (member2struct(sge_ofld_rxq, iq, iq)); + return (__containerof(iq, struct sge_ofld_rxq, iq)); } #endif Modified: head/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.h Fri Oct 19 13:05:51 2012 (r241732) +++ head/sys/dev/cxgbe/t4_l2t.h Fri Oct 19 13:26:40 2012 (r241733) @@ -94,7 +94,7 @@ int do_l2t_write_rpl(struct sge_iq *, co static inline void t4_l2t_release(struct l2t_entry *e) { - struct l2t_data *d = member2struct(l2t_data, l2tab[e->idx], e); + struct l2t_data *d = __containerof(e, struct l2t_data, l2tab[e->idx]); if (atomic_fetchadd_int(&e->refcnt, -1) == 1) atomic_add_int(&d->nfree, 1); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Oct 19 13:05:51 2012 (r241732) +++ head/sys/dev/cxgbe/t4_main.c Fri Oct 19 13:26:40 2012 (r241733) @@ -3057,8 +3057,8 @@ t4_register_an_handler(struct adapter *s static int fw_msg_not_handled(struct adapter *sc, const __be64 *rpl) { - __be64 *r = __DECONST(__be64 *, rpl); - struct cpl_fw6_msg *cpl = member2struct(cpl_fw6_msg, data, r); + const struct cpl_fw6_msg *cpl = + __containerof(rpl, struct cpl_fw6_msg, data[0]); #ifdef INVARIANTS panic("%s: fw_msg type %d", __func__, cpl->type); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Oct 19 13:05:51 2012 (r241732) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Oct 19 13:26:40 2012 (r241733) @@ -205,7 +205,7 @@ static inline struct tom_data * tod_td(struct toedev *tod) { - return (member2struct(tom_data, tod, tod)); + return (__containerof(tod, struct tom_data, tod)); } static inline struct adapter * From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 13:32:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A917A27; Fri, 19 Oct 2012 13:32:38 +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 224938FC14; Fri, 19 Oct 2012 13:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JDWbvg002393; Fri, 19 Oct 2012 13:32:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JDWb5H002390; Fri, 19 Oct 2012 13:32:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210191332.q9JDWb5H002390@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Oct 2012 13:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241734 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 13:32:38 -0000 Author: marius Date: Fri Oct 19 13:32:37 2012 New Revision: 241734 URL: http://svn.freebsd.org/changeset/base/241734 Log: Let SCHED_ULE give affinity to the CPU the tick interrupt triggered on when running tick_process(), similarly to what the x86 equivalents of this function do, however employing the less racy sequence also used in intr_event_handle(). MFC after: 3 days Modified: head/sys/sparc64/sparc64/tick.c Modified: head/sys/sparc64/sparc64/tick.c ============================================================================== --- head/sys/sparc64/sparc64/tick.c Fri Oct 19 13:26:40 2012 (r241733) +++ head/sys/sparc64/sparc64/tick.c Fri Oct 19 13:32:37 2012 (r241734) @@ -245,14 +245,16 @@ tick_process(struct trapframe *tf) struct trapframe *oldframe; struct thread *td; + td = curthread; + td->td_intr_nesting_level++; critical_enter(); if (tick_et.et_active) { - td = curthread; oldframe = td->td_intr_frame; td->td_intr_frame = tf; tick_et.et_event_cb(&tick_et, tick_et.et_arg); td->td_intr_frame = oldframe; } + td->td_intr_nesting_level--; critical_exit(); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 14:00:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B288B159; Fri, 19 Oct 2012 14:00:04 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8140A8FC12; Fri, 19 Oct 2012 14:00:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JE04n7007393; Fri, 19 Oct 2012 14:00:04 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JE04qt007391; Fri, 19 Oct 2012 14:00:04 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201210191400.q9JE04qt007391@svn.freebsd.org> From: Andrey Zonov Date: Fri, 19 Oct 2012 14:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241735 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 14:00:04 -0000 Author: zont Date: Fri Oct 19 14:00:03 2012 New Revision: 241735 URL: http://svn.freebsd.org/changeset/base/241735 Log: - Update cachelimit after hashsize and bucketlimit were set. Reported by: az Reviewed by: melifaro Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/netinet/tcp_hostcache.c Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Fri Oct 19 13:32:37 2012 (r241734) +++ head/sys/netinet/tcp_hostcache.c Fri Oct 19 14:00:03 2012 (r241735) @@ -174,6 +174,7 @@ static MALLOC_DEFINE(M_HOSTCACHE, "hostc void tcp_hc_init(void) { + u_int cache_limit; int i; /* @@ -182,23 +183,27 @@ tcp_hc_init(void) V_tcp_hostcache.cache_count = 0; V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE; V_tcp_hostcache.bucket_limit = TCP_HOSTCACHE_BUCKETLIMIT; - V_tcp_hostcache.cache_limit = - V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit; V_tcp_hostcache.expire = TCP_HOSTCACHE_EXPIRE; V_tcp_hostcache.prune = TCP_HOSTCACHE_PRUNE; TUNABLE_INT_FETCH("net.inet.tcp.hostcache.hashsize", &V_tcp_hostcache.hashsize); - TUNABLE_INT_FETCH("net.inet.tcp.hostcache.cachelimit", - &V_tcp_hostcache.cache_limit); - TUNABLE_INT_FETCH("net.inet.tcp.hostcache.bucketlimit", - &V_tcp_hostcache.bucket_limit); if (!powerof2(V_tcp_hostcache.hashsize)) { printf("WARNING: hostcache hash size is not a power of 2.\n"); V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE; /* default */ } V_tcp_hostcache.hashmask = V_tcp_hostcache.hashsize - 1; + TUNABLE_INT_FETCH("net.inet.tcp.hostcache.bucketlimit", + &V_tcp_hostcache.bucket_limit); + + cache_limit = V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit; + V_tcp_hostcache.cache_limit = cache_limit; + TUNABLE_INT_FETCH("net.inet.tcp.hostcache.cachelimit", + &V_tcp_hostcache.cache_limit); + if (V_tcp_hostcache.cache_limit > cache_limit) + V_tcp_hostcache.cache_limit = cache_limit; + /* * Allocate the hash table. */ From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 14:29:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64A5DB7E; Fri, 19 Oct 2012 14:29:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 329268FC12; Fri, 19 Oct 2012 14:29:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JET4ID012242; Fri, 19 Oct 2012 14:29:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JET361012238; Fri, 19 Oct 2012 14:29:03 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210191429.q9JET361012238@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Oct 2012 14:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241736 - in head: sbin/natd usr.bin/logger usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 14:29:04 -0000 Author: ed Date: Fri Oct 19 14:29:03 2012 New Revision: 241736 URL: http://svn.freebsd.org/changeset/base/241736 Log: Add missing const keywords. Modified: head/sbin/natd/natd.c head/usr.bin/logger/logger.c head/usr.sbin/syslogd/syslogd.c Modified: head/sbin/natd/natd.c ============================================================================== --- head/sbin/natd/natd.c Fri Oct 19 14:00:03 2012 (r241735) +++ head/sbin/natd/natd.c Fri Oct 19 14:29:03 2012 (r241736) @@ -1330,7 +1330,7 @@ static void ParseOption (const char* opt struct in_addr addrValue; int max; char* end; - CODE* fac_record = NULL; + const CODE* fac_record = NULL; /* * Find option from table. */ Modified: head/usr.bin/logger/logger.c ============================================================================== --- head/usr.bin/logger/logger.c Fri Oct 19 14:00:03 2012 (r241735) +++ head/usr.bin/logger/logger.c Fri Oct 19 14:29:03 2012 (r241736) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -static int decode(char *, CODE *); +static int decode(char *, const CODE *); static int pencode(char *); static void logmessage(int, const char *, const char *, const char *, const char *); @@ -271,9 +271,9 @@ pencode(char *s) } static int -decode(char *name, CODE *codetab) +decode(char *name, const CODE *codetab) { - CODE *c; + const CODE *c; if (isdigit(*name)) return (atoi(name)); Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Oct 19 14:00:03 2012 (r241735) +++ head/usr.sbin/syslogd/syslogd.c Fri Oct 19 14:29:03 2012 (r241736) @@ -312,7 +312,7 @@ static void cfline(const char *, struct static const char *cvthname(struct sockaddr *); static void deadq_enter(pid_t, const char *); static int deadq_remove(pid_t); -static int decode(const char *, CODE *); +static int decode(const char *, const CODE *); static void die(int); static void dodie(int); static void dofsync(void); @@ -1123,7 +1123,7 @@ fprintlog(struct filed *f, int flags, co char p_n[5]; /* Hollow laugh */ if (LogFacPri > 1) { - CODE *c; + const CODE *c; for (c = facilitynames; c->c_name; c++) { if (c->c_val == fac) { @@ -2029,9 +2029,9 @@ cfline(const char *line, struct filed *f * Decode a symbolic name to a numeric value */ static int -decode(const char *name, CODE *codetab) +decode(const char *name, const CODE *codetab) { - CODE *c; + const CODE *c; char *p, buf[40]; if (isdigit(*name)) From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 14:49:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB854A04; Fri, 19 Oct 2012 14:49:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF908FC14; Fri, 19 Oct 2012 14:49:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JEnhl2015539; Fri, 19 Oct 2012 14:49:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JEnhfn015510; Fri, 19 Oct 2012 14:49:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210191449.q9JEnhfn015510@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Oct 2012 14:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241737 - in head: bin/date bin/ed libexec/rtld-aout sbin/camcontrol sbin/geom/core usr.bin/at usr.bin/calendar usr.bin/chat usr.bin/ctlstat usr.bin/elfdump usr.bin/fetch usr.bin/finger... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 14:49:43 -0000 Author: ed Date: Fri Oct 19 14:49:42 2012 New Revision: 241737 URL: http://svn.freebsd.org/changeset/base/241737 Log: More -Wmissing-variable-declarations fixes. In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'. Modified: head/bin/date/extern.h head/bin/date/netdate.c head/bin/ed/buf.c head/bin/ed/ed.h head/bin/ed/io.c head/bin/ed/re.c head/libexec/rtld-aout/shlib.c head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sbin/camcontrol/fwdownload.c head/sbin/camcontrol/modeedit.c head/sbin/geom/core/geom.c head/usr.bin/at/privs.h head/usr.bin/calendar/calendar.c head/usr.bin/calendar/dates.c head/usr.bin/calendar/day.c head/usr.bin/calendar/io.c head/usr.bin/chat/chat.c head/usr.bin/ctlstat/ctlstat.c head/usr.bin/elfdump/elfdump.c head/usr.bin/fetch/fetch.c head/usr.bin/finger/finger.c head/usr.bin/gencat/gencat.c head/usr.bin/grep/grep.c head/usr.bin/grep/regex/xmalloc.c head/usr.bin/gzip/zuncompress.c head/usr.bin/msgs/msgs.c head/usr.bin/ncal/ncal.c head/usr.bin/rlogin/rlogin.c head/usr.bin/rpcgen/rpc_main.c head/usr.bin/rpcgen/rpc_svcout.c head/usr.bin/rpcgen/rpc_util.c head/usr.bin/sort/sort.c head/usr.bin/stat/stat.c head/usr.bin/tftp/main.c head/usr.bin/tset/extern.h head/usr.bin/tset/map.c head/usr.bin/tset/term.c head/usr.sbin/acpi/acpidump/acpi.c head/usr.sbin/acpi/acpidump/acpi_user.c head/usr.sbin/cpucontrol/cpucontrol.c head/usr.sbin/ctladm/ctladm.c head/usr.sbin/ctladm/util.c head/usr.sbin/gpioctl/gpioctl.c head/usr.sbin/ip6addrctl/ip6addrctl.c head/usr.sbin/mfiutil/mfi_flash.c head/usr.sbin/mfiutil/mfi_show.c head/usr.sbin/mfiutil/mfiutil.c head/usr.sbin/mfiutil/mfiutil.h head/usr.sbin/nfscbd/nfscbd.c head/usr.sbin/nfsd/nfsd.c head/usr.sbin/pkg/elf_tables.h head/usr.sbin/pkg_install/version/perform.c head/usr.sbin/pmccontrol/pmccontrol.c head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat_log.c head/usr.sbin/pmcstat/pmcstat_log.h head/usr.sbin/quotaon/quotaon.c head/usr.sbin/repquota/repquota.c head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/bin/date/extern.h ============================================================================== --- head/bin/date/extern.h Fri Oct 19 14:29:03 2012 (r241736) +++ head/bin/date/extern.h Fri Oct 19 14:49:42 2012 (r241737) @@ -30,4 +30,6 @@ * $FreeBSD$ */ +extern int retval; + int netsettime(time_t); Modified: head/bin/date/netdate.c ============================================================================== --- head/bin/date/netdate.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/bin/date/netdate.c Fri Oct 19 14:49:42 2012 (r241737) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #define WAITACK 2 /* seconds */ #define WAITDATEACK 5 /* seconds */ -extern int retval; - /* * Set the date in the machines controlled by timedaemons by communicating the * new date to the local timedaemon. If the timedaemon is in the master state, Modified: head/bin/ed/buf.c ============================================================================== --- head/bin/ed/buf.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/bin/ed/buf.c Fri Oct 19 14:49:42 2012 (r241737) @@ -185,9 +185,6 @@ get_addressed_line_node(long n) return lp; } - -extern int newline_added; - static char sfn[15] = ""; /* scratch file name */ /* open_sbuf: open scratch file */ Modified: head/bin/ed/ed.h ============================================================================== --- head/bin/ed/ed.h Fri Oct 19 14:29:03 2012 (r241736) +++ head/bin/ed/ed.h Fri Oct 19 14:49:42 2012 (r241737) @@ -277,3 +277,9 @@ extern int lineno; extern long second_addr; extern long u_addr_last; extern long u_current_addr; +extern long rows; +extern int cols; +extern int newline_added; +extern int des; +extern int scripted; +extern int patlock; Modified: head/bin/ed/io.c ============================================================================== --- head/bin/ed/io.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/bin/ed/io.c Fri Oct 19 14:49:42 2012 (r241737) @@ -30,9 +30,6 @@ __FBSDID("$FreeBSD$"); #include "ed.h" - -extern int scripted; - /* read_file: read a named file/pipe into the buffer; return line count */ long read_file(char *fn, long n) @@ -58,9 +55,6 @@ read_file(char *fn, long n) return current_addr - n; } - -extern int des; - static char *sbuf; /* file i/o buffer */ static int sbufsz; /* file i/o buffer size */ int newline_added; /* if set, newline appended to input file */ @@ -298,9 +292,6 @@ get_tty_line(void) #define ESCAPES "\a\b\f\n\r\t\v\\" #define ESCCHARS "abfnrtv\\" -extern int rows; -extern int cols; - /* put_tty_line: print text to stdout */ int put_tty_line(const char *s, int l, long n, int gflag) Modified: head/bin/ed/re.c ============================================================================== --- head/bin/ed/re.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/bin/ed/re.c Fri Oct 19 14:49:42 2012 (r241737) @@ -31,9 +31,6 @@ __FBSDID("$FreeBSD$"); #include "ed.h" - -extern int patlock; - const char *errmsg = ""; /* get_compiled_pattern: return pointer to compiled pattern from command Modified: head/libexec/rtld-aout/shlib.c ============================================================================== --- head/libexec/rtld-aout/shlib.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/libexec/rtld-aout/shlib.c Fri Oct 19 14:49:42 2012 (r241737) @@ -62,7 +62,7 @@ char **search_dirs; int n_search_dirs; -const char *standard_search_dirs[] = { +static const char *standard_search_dirs[] = { STANDARD_SEARCH_DIRS }; Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/sbin/camcontrol/camcontrol.c Fri Oct 19 14:49:42 2012 (r241737) @@ -5783,9 +5783,10 @@ bailout: #endif /* MINIMALISTIC */ void -usage(int verbose) +usage(int printlong) { - fprintf(verbose ? stdout : stderr, + + fprintf(printlong ? stdout : stderr, "usage: camcontrol [device id][generic args][command args]\n" " camcontrol devlist [-v]\n" #ifndef MINIMALISTIC @@ -5834,7 +5835,7 @@ usage(int verbose) " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); - if (!verbose) + if (!printlong) return; #ifndef MINIMALISTIC fprintf(stdout, Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Fri Oct 19 14:29:03 2012 (r241736) +++ head/sbin/camcontrol/camcontrol.h Fri Oct 19 14:49:42 2012 (r241737) @@ -40,8 +40,10 @@ struct get_hook int got; }; +extern int verbose; + int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char */*type*/); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, @@ -58,5 +60,5 @@ char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); int get_confirmation(void); -void usage(int verbose); +void usage(int printlong); #endif /* _CAMCONTROL_H */ Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/sbin/camcontrol/fwdownload.c Fri Oct 19 14:49:42 2012 (r241737) @@ -131,7 +131,7 @@ static char *fw_read_img(const char *fw_ const struct fw_vendor *vp, int *num_bytes); static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, char *buf, int img_size, - int sim_mode, int verbose, int retry_count, int timeout, + int sim_mode, int printerrors, int retry_count, int timeout, const char */*name*/, const char */*type*/); /* @@ -238,7 +238,7 @@ bailout1: */ static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, - char *buf, int img_size, int sim_mode, int verbose, int retry_count, + char *buf, int img_size, int sim_mode, int printerrors, int retry_count, int timeout, const char *imgname, const char *type) { struct scsi_write_buffer cdb; @@ -290,7 +290,7 @@ fw_download_img(struct cam_device *cam_d ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error sending identify/test unit ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -298,7 +298,7 @@ fw_download_img(struct cam_device *cam_d } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("Device is not ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -372,7 +372,7 @@ fw_download_img(struct cam_device *cam_d /* Execute the command. */ if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error writing image to device"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); goto bailout; @@ -398,7 +398,7 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char *type) { const struct fw_vendor *vp; @@ -450,7 +450,7 @@ fwdownload(struct cam_device *device, in if (sim_mode) fprintf(stdout, "Running in simulation mode\n"); - if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose, + if (fw_download_img(device, vp, buf, img_size, sim_mode, printerrors, retry_count, timeout, fw_img_path, type) != 0) { fprintf(stderr, "Firmware download failed\n"); goto fail; Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/sbin/camcontrol/modeedit.c Fri Oct 19 14:49:42 2012 (r241737) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include "camcontrol.h" -int verbose = 0; - #define DEFAULT_SCSI_MODE_DB "/usr/share/misc/scsi_modes" #define DEFAULT_EDITOR "vi" #define MAX_FORMAT_SPEC 4096 /* Max CDB format specifier. */ Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/sbin/geom/core/geom.c Fri Oct 19 14:49:42 2012 (r241737) @@ -74,7 +74,7 @@ static void std_status(struct gctl_req * static void std_load(struct gctl_req *req, unsigned flags); static void std_unload(struct gctl_req *req, unsigned flags); -struct g_command std_commands[] = { +static struct g_command std_commands[] = { { "help", 0, std_help, G_NULL_OPTS, NULL }, { "list", 0, std_list, { Modified: head/usr.bin/at/privs.h ============================================================================== --- head/usr.bin/at/privs.h Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/at/privs.h Fri Oct 19 14:49:42 2012 (r241737) @@ -59,15 +59,13 @@ * to the real userid before calling any of them. */ -#ifndef MAIN -extern -#endif -uid_t real_uid, effective_uid; +extern uid_t real_uid, effective_uid; +extern gid_t real_gid, effective_gid; -#ifndef MAIN -extern -#endif +#ifdef MAIN +uid_t real_uid, effective_uid; gid_t real_gid, effective_gid; +#endif #define RELINQUISH_PRIVS { \ real_uid = getuid(); \ Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/calendar/calendar.c Fri Oct 19 14:49:42 2012 (r241737) @@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$"); struct passwd *pw; int doall = 0; int debug = 0; -char *DEBUG = NULL; -time_t f_time = 0; +static char *DEBUG = NULL; +static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; int EastLongitude = LONGITUDE_NOTSET; Modified: head/usr.bin/calendar/dates.c ============================================================================== --- head/usr.bin/calendar/dates.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/calendar/dates.c Fri Oct 19 14:49:42 2012 (r241737) @@ -43,7 +43,7 @@ struct cal_year { int firstdayofweek; /* 0 .. 6 */ struct cal_month *months; struct cal_year *nextyear; -} cal_year; +}; struct cal_month { int month; /* 01 .. 12 */ @@ -52,7 +52,7 @@ struct cal_month { struct cal_year *year; /* points back */ struct cal_day *days; struct cal_month *nextmonth; -} cal_month; +}; struct cal_day { int dayofmonth; /* 01 .. 31 */ @@ -62,19 +62,18 @@ struct cal_day { struct cal_month *month; /* points back */ struct cal_year *year; /* points back */ struct event *events; -} cal_day; +}; int debug_remember = 0; -struct cal_year *hyear = NULL; +static struct cal_year *hyear = NULL; /* 1-based month, 0-based days, cumulative */ -int *cumdays; int cumdaytab[][14] = { {0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364}, {0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, }; /* 1-based month, individual */ -int *mondays; +static int *mondays; int mondaytab[][14] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/calendar/day.c Fri Oct 19 14:49:42 2012 (r241737) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" -time_t time1, time2; +static time_t time1, time2; const struct tm tm0; char dayname[100]; int year1, year2; Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/calendar/io.c Fri Oct 19 14:49:42 2012 (r241737) @@ -60,10 +60,10 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" const char *calendarFile = "calendar"; /* default calendar file */ -const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ -const char *calendarNoMail = "nomail"; /* don't sent mail if this file exist */ +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ +static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ -char path[MAXPATHLEN]; +static char path[MAXPATHLEN]; struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon; struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; Modified: head/usr.bin/chat/chat.c ============================================================================== --- head/usr.bin/chat/chat.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/chat/chat.c Fri Oct 19 14:49:42 2012 (r241737) @@ -109,40 +109,39 @@ __FBSDID("$FreeBSD$"); #define MAX_REPORTS 50 #define DEFAULT_CHAT_TIMEOUT 45 -int echo = 0; -int verbose = 0; -int to_log = 1; -int to_stderr = 0; -int Verbose = 0; -int quiet = 0; -int exit_code = 0; -FILE* report_fp = (FILE *) 0; -char *report_file = (char *) 0; -char *chat_file = (char *) 0; -char *phone_num = (char *) 0; -char *phone_num2 = (char *) 0; -int timeout = DEFAULT_CHAT_TIMEOUT; +static int echo; +static int verbose; +static int to_log; +static int to_stderr; +static int Verbose; +static int quiet; +static int exit_code; +static FILE* report_fp; +static char *report_file; +static char *chat_file; +static char *phone_num; +static char *phone_num2; +static int timeout = DEFAULT_CHAT_TIMEOUT; static char blank[] = ""; -int have_tty_parameters = 0; +static int have_tty_parameters; #define term_parms struct termios #define get_term_param(param) tcgetattr(0, param) #define set_term_param(param) tcsetattr(0, TCSANOW, param) -struct termios saved_tty_parameters; +static struct termios saved_tty_parameters; -char *abort_string[MAX_ABORTS], *fail_reason = (char *)0, - fail_buffer[50]; -int n_aborts = 0, abort_next = 0, timeout_next = 0, echo_next = 0; -int clear_abort_next = 0; - -char *report_string[MAX_REPORTS] ; -char report_buffer[50] ; -int n_reports = 0, report_next = 0, report_gathering = 0 ; -int clear_report_next = 0; +static char *abort_string[MAX_ABORTS], *fail_reason, fail_buffer[50]; +static int n_aborts, abort_next, timeout_next, echo_next; +static int clear_abort_next; + +static char *report_string[MAX_REPORTS]; +static char report_buffer[50]; +static int n_reports, report_next, report_gathering; +static int clear_report_next; -int say_next = 0, hup_next = 0; +static int say_next, hup_next; void *dup_mem(void *b, size_t c); void *copy_of(char *s); @@ -396,14 +395,13 @@ usage(void) exit(1); } -char line[1024]; - /* * Send a message to syslog and/or stderr. */ void chat_logf(const char *fmt, ...) { + char line[1024]; va_list args; va_start(args, fmt); @@ -422,6 +420,7 @@ chat_logf(const char *fmt, ...) void fatal(int code, const char *fmt, ...) { + char line[1024]; va_list args; va_start(args, fmt); @@ -434,7 +433,7 @@ fatal(int code, const char *fmt, ...) terminate(code); } -int alarmed = 0; +static int alarmed; SIGTYPE sigalrm(int signo __unused) { Modified: head/usr.bin/ctlstat/ctlstat.c ============================================================================== --- head/usr.bin/ctlstat/ctlstat.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/ctlstat/ctlstat.c Fri Oct 19 14:49:42 2012 (r241737) @@ -329,7 +329,7 @@ compute_stats(struct ctl_lun_io_stats *c #define PRINT_BINTIME(prefix, bt) \ printf("%s %jd s %ju frac\n", prefix, (intmax_t)(bt).sec, \ (uintmax_t)(bt).frac) -const char *iotypes[] = {"NO IO", "READ", "WRITE"}; +static const char *iotypes[] = {"NO IO", "READ", "WRITE"}; static void ctlstat_dump(struct ctlstat_context *ctx) { Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/elfdump/elfdump.c Fri Oct 19 14:49:42 2012 (r241737) @@ -83,7 +83,7 @@ enum elf_member { typedef enum elf_member elf_member_t; -int elf32_offsets[] = { +static int elf32_offsets[] = { 0, offsetof(Elf32_Dyn, d_tag), offsetof(Elf32_Dyn, d_un.d_ptr), @@ -124,7 +124,7 @@ int elf32_offsets[] = { offsetof(Elf32_Rela, r_addend) }; -int elf64_offsets[] = { +static int elf64_offsets[] = { 0, offsetof(Elf64_Dyn, d_tag), offsetof(Elf64_Dyn, d_un.d_ptr), @@ -266,23 +266,23 @@ e_machines(u_int mach) return (machdesc); } -const char *e_types[] = { +static const char *e_types[] = { "ET_NONE", "ET_REL", "ET_EXEC", "ET_DYN", "ET_CORE" }; -const char *ei_versions[] = { +static const char *ei_versions[] = { "EV_NONE", "EV_CURRENT" }; -const char *ei_classes[] = { +static const char *ei_classes[] = { "ELFCLASSNONE", "ELFCLASS32", "ELFCLASS64" }; -const char *ei_data[] = { +static const char *ei_data[] = { "ELFDATANONE", "ELFDATA2LSB", "ELFDATA2MSB" }; -const char *ei_abis[256] = { +static const char *ei_abis[256] = { "ELFOSABI_SYSV", "ELFOSABI_HPUX", "ELFOSABI_NETBSD", "ELFOSABI_LINUX", "ELFOSABI_HURD", "ELFOSABI_86OPEN", "ELFOSABI_SOLARIS", "ELFOSABI_AIX", "ELFOSABI_IRIX", "ELFOSABI_FREEBSD", "ELFOSABI_TRU64", @@ -290,12 +290,12 @@ const char *ei_abis[256] = { [255] = "ELFOSABI_STANDALONE" }; -const char *p_types[] = { +static const char *p_types[] = { "PT_NULL", "PT_LOAD", "PT_DYNAMIC", "PT_INTERP", "PT_NOTE", "PT_SHLIB", "PT_PHDR", "PT_TLS" }; -const char *p_flags[] = { +static const char *p_flags[] = { "", "PF_X", "PF_W", "PF_X|PF_W", "PF_R", "PF_X|PF_R", "PF_W|PF_R", "PF_X|PF_W|PF_R" }; @@ -339,44 +339,47 @@ sh_types(u_int64_t sht) { } } -const char *sh_flags[] = { +static const char *sh_flags[] = { "", "SHF_WRITE", "SHF_ALLOC", "SHF_WRITE|SHF_ALLOC", "SHF_EXECINSTR", "SHF_WRITE|SHF_EXECINSTR", "SHF_ALLOC|SHF_EXECINSTR", "SHF_WRITE|SHF_ALLOC|SHF_EXECINSTR" }; -const char *st_types[] = { +static const char *st_types[] = { "STT_NOTYPE", "STT_OBJECT", "STT_FUNC", "STT_SECTION", "STT_FILE" }; -const char *st_bindings[] = { +static const char *st_bindings[] = { "STB_LOCAL", "STB_GLOBAL", "STB_WEAK" }; -char *dynstr; -char *shstrtab; -char *strtab; -FILE *out; - -u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member); - -void elf_print_ehdr(Elf32_Ehdr *e); -void elf_print_phdr(Elf32_Ehdr *e, void *p); -void elf_print_shdr(Elf32_Ehdr *e, void *sh); -void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str); -void elf_print_dynamic(Elf32_Ehdr *e, void *sh); -void elf_print_rel(Elf32_Ehdr *e, void *r); -void elf_print_rela(Elf32_Ehdr *e, void *ra); -void elf_print_interp(Elf32_Ehdr *e, void *p); -void elf_print_got(Elf32_Ehdr *e, void *sh); -void elf_print_hash(Elf32_Ehdr *e, void *sh); -void elf_print_note(Elf32_Ehdr *e, void *sh); +static char *dynstr; +static char *shstrtab; +static char *strtab; +static FILE *out; + +static u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member); +static u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, + elf_member_t member); +#if 0 +static u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member); +#endif +static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member); +static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member); + +static void elf_print_ehdr(Elf32_Ehdr *e); +static void elf_print_phdr(Elf32_Ehdr *e, void *p); +static void elf_print_shdr(Elf32_Ehdr *e, void *sh); +static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str); +static void elf_print_dynamic(Elf32_Ehdr *e, void *sh); +static void elf_print_rel(Elf32_Ehdr *e, void *r); +static void elf_print_rela(Elf32_Ehdr *e, void *ra); +static void elf_print_interp(Elf32_Ehdr *e, void *p); +static void elf_print_got(Elf32_Ehdr *e, void *sh); +static void elf_print_hash(Elf32_Ehdr *e, void *sh); +static void elf_print_note(Elf32_Ehdr *e, void *sh); -void usage(void); +static void usage(void); int main(int ac, char **av) @@ -551,7 +554,7 @@ main(int ac, char **av) return 0; } -void +static void elf_print_ehdr(Elf32_Ehdr *e) { u_int64_t class; @@ -606,7 +609,7 @@ elf_print_ehdr(Elf32_Ehdr *e) fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx); } -void +static void elf_print_phdr(Elf32_Ehdr *e, void *p) { u_int64_t phentsize; @@ -648,7 +651,7 @@ elf_print_phdr(Elf32_Ehdr *e, void *p) } } -void +static void elf_print_shdr(Elf32_Ehdr *e, void *sh) { u_int64_t shentsize; @@ -696,7 +699,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str) { u_int64_t offset; @@ -735,7 +738,7 @@ elf_print_symtab(Elf32_Ehdr *e, void *sh } } -void +static void elf_print_dynamic(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -795,7 +798,7 @@ elf_print_dynamic(Elf32_Ehdr *e, void *s } } -void +static void elf_print_rela(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -827,7 +830,7 @@ elf_print_rela(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_rel(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -856,7 +859,7 @@ elf_print_rel(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_interp(Elf32_Ehdr *e, void *p) { u_int64_t offset; @@ -868,7 +871,7 @@ elf_print_interp(Elf32_Ehdr *e, void *p) fprintf(out, "\t%s\n", s); } -void +static void elf_print_got(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -891,12 +894,12 @@ elf_print_got(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_hash(Elf32_Ehdr *e __unused, void *sh __unused) { } -void +static void elf_print_note(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -922,7 +925,7 @@ elf_print_note(Elf32_Ehdr *e, void *sh) } } -u_int64_t +static u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -942,7 +945,7 @@ elf_get_byte(Elf32_Ehdr *e, void *base, return val; } -u_int64_t +static u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -982,7 +985,8 @@ elf_get_quarter(Elf32_Ehdr *e, void *bas return val; } -u_int64_t +#if 0 +static u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -1021,8 +1025,9 @@ elf_get_half(Elf32_Ehdr *e, void *base, return val; } +#endif -u_int64_t +static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -1062,7 +1067,7 @@ elf_get_word(Elf32_Ehdr *e, void *base, return val; } -u_int64_t +static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -1102,7 +1107,7 @@ elf_get_quad(Elf32_Ehdr *e, void *base, return val; } -void +static void usage(void) { fprintf(stderr, "usage: elfdump -a | -cdeGhinprs [-w file] file\n"); Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/fetch/fetch.c Fri Oct 19 14:49:42 2012 (r241737) @@ -51,47 +51,47 @@ __FBSDID("$FreeBSD$"); #define TIMEOUT 120 /* Option flags */ -int A_flag; /* -A: do not follow 302 redirects */ -int a_flag; /* -a: auto retry */ -off_t B_size; /* -B: buffer size */ -int b_flag; /*! -b: workaround TCP bug */ -char *c_dirname; /* -c: remote directory */ -int d_flag; /* -d: direct connection */ -int F_flag; /* -F: restart without checking mtime */ -char *f_filename; /* -f: file to fetch */ -char *h_hostname; /* -h: host to fetch from */ -int i_flag; /* -i: specify input file for mtime comparison */ -char *i_filename; /* name of input file */ -int l_flag; /* -l: link rather than copy file: URLs */ -int m_flag; /* -[Mm]: mirror mode */ -char *N_filename; /* -N: netrc file name */ -int n_flag; /* -n: do not preserve modification time */ -int o_flag; /* -o: specify output file */ -int o_directory; /* output file is a directory */ -char *o_filename; /* name of output file */ -int o_stdout; /* output file is stdout */ -int once_flag; /* -1: stop at first successful file */ -int p_flag; /* -[Pp]: use passive FTP */ -int R_flag; /* -R: don't delete partially transferred files */ -int r_flag; /* -r: restart previously interrupted transfer */ -off_t S_size; /* -S: require size to match */ -int s_flag; /* -s: show size, don't fetch */ -long T_secs; /* -T: transfer timeout in seconds */ -int t_flag; /*! -t: workaround TCP bug */ -int U_flag; /* -U: do not use high ports */ -int v_level = 1; /* -v: verbosity level */ -int v_tty; /* stdout is a tty */ -pid_t pgrp; /* our process group */ -long w_secs; /* -w: retry delay */ -int family = PF_UNSPEC; /* -[46]: address family to use */ - -int sigalrm; /* SIGALRM received */ -int siginfo; /* SIGINFO received */ -int sigint; /* SIGINT received */ - -long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ -long http_timeout = TIMEOUT; /* default timeout for HTTP transfers */ -char *buf; /* transfer buffer */ +static int A_flag; /* -A: do not follow 302 redirects */ +static int a_flag; /* -a: auto retry */ +static off_t B_size; /* -B: buffer size */ +static int b_flag; /*! -b: workaround TCP bug */ +static char *c_dirname; /* -c: remote directory */ +static int d_flag; /* -d: direct connection */ +static int F_flag; /* -F: restart without checking mtime */ +static char *f_filename; /* -f: file to fetch */ +static char *h_hostname; /* -h: host to fetch from */ +static int i_flag; /* -i: specify file for mtime comparison */ +static char *i_filename; /* name of input file */ +static int l_flag; /* -l: link rather than copy file: URLs */ +static int m_flag; /* -[Mm]: mirror mode */ +static char *N_filename; /* -N: netrc file name */ +static int n_flag; /* -n: do not preserve modification time */ +static int o_flag; /* -o: specify output file */ +static int o_directory; /* output file is a directory */ +static char *o_filename; /* name of output file */ +static int o_stdout; /* output file is stdout */ +static int once_flag; /* -1: stop at first successful file */ +static int p_flag; /* -[Pp]: use passive FTP */ +static int R_flag; /* -R: don't delete partial files */ +static int r_flag; /* -r: restart previous transfer */ +static off_t S_size; /* -S: require size to match */ +static int s_flag; /* -s: show size, don't fetch */ +static long T_secs; /* -T: transfer timeout in seconds */ +static int t_flag; /*! -t: workaround TCP bug */ +static int U_flag; /* -U: do not use high ports */ +static int v_level = 1; /* -v: verbosity level */ +static int v_tty; /* stdout is a tty */ +static pid_t pgrp; /* our process group */ +static long w_secs; /* -w: retry delay */ +static int family = PF_UNSPEC; /* -[46]: address family to use */ + +static int sigalrm; /* SIGALRM received */ +static int siginfo; /* SIGINFO received */ +static int sigint; /* SIGINT received */ + +static long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ +static long http_timeout = TIMEOUT;/* default timeout for HTTP transfers */ +static char *buf; /* transfer buffer */ /* Modified: head/usr.bin/finger/finger.c ============================================================================== --- head/usr.bin/finger/finger.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/finger/finger.c Fri Oct 19 14:49:42 2012 (r241737) @@ -87,7 +87,8 @@ __FBSDID("$FreeBSD$"); DB *db; time_t now; -int entries, gflag, kflag, lflag, mflag, pplan, sflag, oflag; +static int kflag, mflag, sflag; +int entries, gflag, lflag, pplan, oflag; sa_family_t family = PF_UNSPEC; int d_first = -1; char tbuf[1024]; Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/gencat/gencat.c Fri Oct 19 14:49:42 2012 (r241737) @@ -96,7 +96,7 @@ struct _setT { LIST_ENTRY(_setT) entries; }; -LIST_HEAD(sethead, _setT) sethead; +static LIST_HEAD(sethead, _setT) sethead; static struct _setT *curSet; static char *curline = NULL; Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/grep/grep.c Fri Oct 19 14:49:42 2012 (r241737) @@ -82,14 +82,15 @@ int eflags = REG_STARTEND; bool matchall; /* Searching patterns */ -unsigned int patterns, pattern_sz; +unsigned int patterns; +static unsigned int pattern_sz; struct pat *pattern; regex_t *r_pattern; fastmatch_t *fg_pattern; /* Filename exclusion/inclusion patterns */ -unsigned int fpatterns, fpattern_sz; -unsigned int dpatterns, dpattern_sz; +unsigned int fpatterns, dpatterns; +static unsigned int fpattern_sz, dpattern_sz; struct epat *dpattern, *fpattern; /* For regex errors */ Modified: head/usr.bin/grep/regex/xmalloc.c ============================================================================== --- head/usr.bin/grep/regex/xmalloc.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/grep/regex/xmalloc.c Fri Oct 19 14:49:42 2012 (r241737) @@ -39,9 +39,9 @@ typedef struct { } hashTable; static int xmalloc_peak; -int xmalloc_current; +static int xmalloc_current; static int xmalloc_peak_blocks; -int xmalloc_current_blocks; +static int xmalloc_current_blocks; static int xmalloc_fail_after; #define TABLE_BITS 8 Modified: head/usr.bin/gzip/zuncompress.c ============================================================================== --- head/usr.bin/gzip/zuncompress.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/gzip/zuncompress.c Fri Oct 19 14:49:42 2012 (r241737) @@ -77,10 +77,9 @@ static char_type magic_header[] = static char_type rmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; -/* XXX zuncompress global */ -off_t total_compressed_bytes; -size_t compressed_prelen; -char *compressed_pre; +static off_t total_compressed_bytes; +static size_t compressed_prelen; +static char *compressed_pre; struct s_zstate { FILE *zs_fp; /* File stream for I/O */ Modified: head/usr.bin/msgs/msgs.c ============================================================================== --- head/usr.bin/msgs/msgs.c Fri Oct 19 14:29:03 2012 (r241736) +++ head/usr.bin/msgs/msgs.c Fri Oct 19 14:49:42 2012 (r241737) @@ -105,47 +105,47 @@ __FBSDID("$FreeBSD$"); typedef char bool; -FILE *msgsrc; -FILE *newmsg; -const char *sep = "-"; -char inbuf[BUFSIZ]; -char fname[MAXPATHLEN]; -char cmdbuf[MAXPATHLEN + MAXPATHLEN]; -char subj[128]; -char from[128]; -char date[128]; -char *ptr; -char *in; -bool local; -bool ruptible; -bool totty; -bool seenfrom; -bool seensubj; -bool blankline; -bool printing = NO; -bool mailing = NO; -bool quitit = NO; -bool sending = NO; -bool intrpflg = NO; -uid_t uid; -int msg; -int prevmsg; -int lct; -int nlines; -int Lpp = 0; -time_t t; -time_t keep; +static FILE *msgsrc; +static FILE *newmsg; +static const char *sep = "-"; +static char inbuf[BUFSIZ]; +static char fname[MAXPATHLEN]; +static char cmdbuf[MAXPATHLEN + MAXPATHLEN]; +static char subj[128]; +static char from[128]; +static char date[128]; +static char *ptr; +static char *in; +static bool local; +static bool ruptible; +static bool totty; +static bool seenfrom; +static bool seensubj; +static bool blankline; +static bool printing = NO; +static bool mailing = NO; +static bool quitit = NO; +static bool sending = NO; +static bool intrpflg = NO; +static uid_t uid; +static int msg; +static int prevmsg; +static int lct; +static int nlines; +static int Lpp = 0; +static time_t t; +static time_t keep; /* option initialization */ -bool hdrs = NO; -bool qopt = NO; -bool hush = NO; -bool send_msg = NO; -bool locomode = NO; -bool use_pager = NO; -bool clean = NO; -bool lastcmd = NO; -jmp_buf tstpbuf; +static bool hdrs = NO; +static bool qopt = NO; +static bool hush = NO; +static bool send_msg = NO; +static bool locomode = NO; +static bool use_pager = NO; +static bool clean = NO; +static bool lastcmd = NO; +static jmp_buf tstpbuf; static void ask(const char *); static void gfrsub(FILE *); @@ -155,7 +155,7 @@ static char *nxtfld(char *); static void onsusp(int); static void onintr(int); static void prmesg(int); -static void usage(void); +static void usage(void); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 15:22:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B6F79A3; Fri, 19 Oct 2012 15:22:56 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0A44E8FC12; Fri, 19 Oct 2012 15:22:55 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa01.fnfis.com (8.14.4/8.14.4) with ESMTP id q9JFMlAL022237 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 19 Oct 2012 10:22:47 -0500 Received: from [10.0.0.101] (10.14.152.61) by smtp.fisglobal.com (10.132.206.16) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 19 Oct 2012 10:22:46 -0500 Subject: Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share MIME-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset="koi8-r" From: Devin Teske In-Reply-To: <20121019055442.GA9108@FreeBSD.org> Date: Fri, 19 Oct 2012 08:22:36 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: References: <201210181843.q9IIhs6N099621@svn.freebsd.org> <20121019055442.GA9108@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1283) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855, 1.0.431, 0.0.0000 definitions=2012-10-19_03:2012-10-19,2012-10-19,1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Devin Teske , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 15:22:56 -0000 On Oct 18, 2012, at 10:54 PM, Alexey Dokuchaev wrote: > On Thu, Oct 18, 2012 at 06:43:54PM +0000, Devin Teske wrote: >> NOTE: In FreeBSD-9 and higher, dialog(1) does not support the F1 hook, so >> the mechanism for providing help to the user had to be changed to a butt= on. >=20 > How come that new dialog(1) lacks functionality of the old one? >=20 SVN r217309 brought in cdialog to replace our the [unmaintained] dialog. cdialog is different, but mostly compatible with its predecessor. The benefits of cdialog far out-weigh the few problems that were reported (= and then quickly fixed). Most importantly, cdialog is actively maintained while its predecessor (in = FreeBSD-8.x and older) is not. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 15:32:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63677D5; Fri, 19 Oct 2012 15:32:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA1B8FC1A; Fri, 19 Oct 2012 15:32:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 75C60B993; Fri, 19 Oct 2012 11:32:33 -0400 (EDT) From: John Baldwin To: Ed Schouten Subject: Re: svn commit: r241737 - in head: bin/date bin/ed libexec/rtld-aout sbin/camcontrol sbin/geom/core usr.bin/at usr.bin/calendar usr.bin/chat usr.bin/ctlstat usr.bin/elfdump usr.bin/fetch usr.bin/finger... Date: Fri, 19 Oct 2012 11:18:42 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210191449.q9JEnhfn015510@svn.freebsd.org> In-Reply-To: <201210191449.q9JEnhfn015510@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210191118.42722.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Oct 2012 11:32:33 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 15:32:34 -0000 On Friday, October 19, 2012 10:49:43 am Ed Schouten wrote: > Author: ed > Date: Fri Oct 19 14:49:42 2012 > New Revision: 241737 > URL: http://svn.freebsd.org/changeset/base/241737 > > Log: > More -Wmissing-variable-declarations fixes. > > In addition to adding `static' where possible: > > - usr.sbin/mfiutil: Put global variables in mfiutil.h. The fw_* changes here probably wasn't the right way to fix this. The variables should be static. The problem is that 'scan_firmware()' is duplicated and should probably be reduced to a single copy. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 17:01:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96C08C66; Fri, 19 Oct 2012 17:01:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA8C8FC08; Fri, 19 Oct 2012 17:01:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JH1S4Z037807; Fri, 19 Oct 2012 17:01:28 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JH1S5G037802; Fri, 19 Oct 2012 17:01:28 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201210191701.q9JH1S5G037802@svn.freebsd.org> From: Sean Bruno Date: Fri, 19 Oct 2012 17:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241738 - in head: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 17:01:28 -0000 Author: sbruno Date: Fri Oct 19 17:01:27 2012 New Revision: 241738 URL: http://svn.freebsd.org/changeset/base/241738 Log: Update hwpmc to support the Xeon class of Sandybridge processors. (Model 0x2D /* Per Intel document 253669-044US 08/2012. */) Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Submitted by: hiren panchasara Reviewed by: jimharris@ fabient@ Obtained from: Yahoo! Inc. MFC after: 2 weeks Added: head/lib/libpmc/pmc.sandybridgexeon.3 (contents, props changed) Modified: head/lib/libpmc/Makefile head/lib/libpmc/libpmc.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Fri Oct 19 14:49:42 2012 (r241737) +++ head/lib/libpmc/Makefile Fri Oct 19 17:01:27 2012 (r241738) @@ -39,6 +39,7 @@ MAN+= pmc.corei7.3 MAN+= pmc.corei7uc.3 MAN+= pmc.sandybridge.3 MAN+= pmc.sandybridgeuc.3 +MAN+= pmc.sandybridgexeon.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 MAN+= pmc.tsc.3 Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Fri Oct 19 14:49:42 2012 (r241737) +++ head/lib/libpmc/libpmc.c Fri Oct 19 17:01:27 2012 (r241738) @@ -193,6 +193,11 @@ static const struct pmc_event_descr sand __PMC_EV_ALIAS_SANDYBRIDGE() }; +static const struct pmc_event_descr sandybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_SANDYBRIDGE_XEON() +}; + static const struct pmc_event_descr westmere_event_table[] = { __PMC_EV_ALIAS_WESTMERE() @@ -229,6 +234,7 @@ PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOF PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -267,6 +273,7 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); +PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); @@ -572,6 +579,8 @@ static struct pmc_event_alias core2_alia #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf +#define sandybridge_xeon_aliases core2_aliases +#define sandybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define westmere_aliases core2_aliases #define westmere_aliases_without_iaf core2_aliases_without_iaf @@ -691,7 +700,7 @@ static struct pmc_masks iap_rsp_mask_i7_ NULLMASK }; -static struct pmc_masks iap_rsp_mask_sb_ib[] = { +static struct pmc_masks iap_rsp_mask_sb_sbx_ib[] = { PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), PMCMASK(REQ_DMND_RFO, (1ULL << 1)), PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), @@ -797,9 +806,10 @@ iap_allocate_pmc(enum pmc_event pe, char } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { - n = pmc_parse_mask(iap_rsp_mask_sb_ib, p, &rsp); + n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); } else @@ -2678,6 +2688,10 @@ pmc_event_names_of_class(enum pmc_class ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + ev = sandybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: ev = westmere_event_table; count = PMC_EVENT_TABLE_SIZE(westmere); @@ -2974,6 +2988,9 @@ pmc_init(void) pmc_class_table[n++] = &sandybridgeuc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &westmereuc_class_table_descr; @@ -3112,6 +3129,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + ev = sandybridge_xeon_event_table; + evfence = sandybridge_xeon_event_table + PMC_EVENT_TABLE_SIZE(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: ev = westmere_event_table; evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); Added: head/lib/libpmc/pmc.sandybridgexeon.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmc.sandybridgexeon.3 Fri Oct 19 17:01:27 2012 (r241738) @@ -0,0 +1,1023 @@ +.\" Copyright (c) 2012 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 18, 2012 +.Dt PMC.SANDYBRIDGEXEON 3 +.Os +.Sh NAME +.Nm pmc.sandybridgexeon +.Nd measurement events for +.Tn Intel +.Tn Sandy Bridge Xeon +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Sandy Bridge Xeon" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to two classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Sandy Bridge Xeon PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%T "Volume 3B: System Programming Guide, Part 2" +.%N "Order Number: 253669-043US" +.%D August 2012 +.%Q "Intel Corporation" +.Re +.Ss SANDYBRIDGE XEON FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss SANDYBRIDGE XEON PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li REQ_DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full and partial +cachelines as well as demand data page table entry cacheline reads. Does not +count L2 data read prefetches or instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNPI_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Sandy Bridge Xeon programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.DATA_UNKNOWN +.Pq Event 03H , Umask 01H +blocked loads due to store buffer blocks with unknown data. +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +loads blocked by overlapping with store buffer that cannot +be forwarded . +.It Li LD_BLOCKS.NO_SR +.Pq Event 03H , Umask 08H +# of Split loads blocked due to resource not available. +.It Li LD_BLOCKS.ALL_BLOCK +.Pq Event 03H , Umask 10H +Number of cases where any load is blocked but has no +DCU miss. +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to +L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store- address uops +dispatchedto L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare on +address. +.It Li LD_BLOCKS_PARTIAL.ALL_STALL_BLOCK +.Pq Event 07H , Umask 08H +The number of times that load operations are temporarily +blocked because of older stores, with addresses that are +not yet known. A load operation may incur more than one +block of this type. +.It Li TLB_LOAD_MISSES.MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 01H +Misses in all TLB levels that cause a page walk of any +page size. +.It Li TLB_LOAD_MISSES.WALK_COMPLETED +.Pq Event 08H , Umask 02H +Misses in all TLB levels that caused page walk completed +of any size. +.It Li DTLB_LOAD_MISSES.WALK_DURATION +.Pq Event 08H , Umask 04H +Cycle PMH is busy with a walk. +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 08H , Umask 10H +Number of cache load STLB hits. No page walk. +.It Li INT_MISC.RECOVERY_CYCLES +.Pq Event 0DH , Umask 03H +Cycles waiting to recover after Machine Clears or EClear. +Set Cmask= 1. +.It Li INT_MISC.RAT_STALL_CYCLES +.Pq Event 0DH , Umask 40H +Cycles RAT external stall is sent to IDQ for this thread. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +Increments each cycle the # of Uops issued by the +RAT to RS. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles +of this core. +.It Li FP_COMP_OPS_EXE.X87 +.Pq Event 10H , Umask 01H +Counts number of X87 uops executed. +.It Li FP_COMP_OPS_EXE.SSE_FP_PACKED_DOUBLE +.Pq Event 10H , Umask 10H +Counts number of SSE* double precision FP packed +uops executed. +.It Li FP_COMP_OPS_EXE.SSE_FP_SCALAR_SINGLE +.Pq Event 10H , Umask 20H +Counts number of SSE* single precision FP scalar +uops executed. +.It Li FP_COMP_OPS_EXE.SSE_PACKED_SINGLE +.Pq Event 10H , Umask 40H +Counts number of SSE* single precision FP packed +uops executed. +.It Li FP_COMP_OPS_EXE.SSE_SCALAR_DOUBLE +.Pq Event 10H , Umask 80H +Counts number of SSE* double precision FP scalar +uops executed. +.It Li SIMD_FP_256.PACKED_SINGLE +.Pq Event 11H , Umask 01H +Counts 256-bit packed single-precision floating- +point instructions. +.It Li SIMD_FP_256.PACKED_DOUBLE +.Pq Event 11H , Umask 02H +Counts 256-bit packed double-precision floating- +point instructions. +.It Li ARITH.FPU_DIV_ACTIVE +.Pq Event 14H , Umask 01H +Cycles that the divider is active, includes INT and FP. +Set 'edge =1, cmask=1' to count the number of +divides. +.It Li INSTS_WRITTEN_TO_IQ.INSTS +.Pq Event 17H , Umask 01H +Counts the number of instructions written into the +IQ every cycle. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 01H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask 03H +Counts any demand and L1 HW prefetch data load +requests to L2. +.It Li L2_RQSTS.RFO_HITS +.Pq Event 24H , Umask 04H +Counts the number of store RFO requests that +hit the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 08H +Counts the number of store RFO requests that +miss the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask 0CH +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 10H +Number of instruction fetches that hit the L2 +cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 20H +Number of instruction fetches that missed the L2 +cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask 30H +Counts all L2 code requests. +.It Li L2_RQSTS.PF_HIT +.Pq Event 24H , Umask 40H +Requests from L2 Hardware prefetcher that hit L2. +.It Li L2_RQSTS.PF_MISS +.Pq Event 24H , Umask 80H +Requests from L2 Hardware prefetcher that missed +L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask C0H +Any requests from L2 Hardware prefetchers. +.It Li L2_STORE_LOCK_RQSTS.MISS +.Pq Event 27H , Umask 01H +ROs that miss cache lines. +.It Li L2_STORE_LOCK_RQSTS.HIT_E +.Pq Event 27H , Umask 04H +RFOs that hit cache lines in E state. +.It Li L2_STORE_LOCK_RQSTS.HIT_M +.Pq Event 27H , Umask 08H +RFOs that hit cache lines in M state. +.It Li L2_STORE_LOCK_RQSTS.ALL +.Pq Event 27H , Umask 0FH +RFOs that access cache lines in any state. +.It Li L2_L1D_WB_RQSTS.MISS +.Pq Event 28H , Umask 01H +Not rejected writebacks from L1D to L2 cache lines +that missed L2. +.It Li L2_L1D_WB_RQSTS.HIT_S +.Pq Event 28H , Umask 02H +Not rejected writebacks from L1D to L2 cache lines +in S state. +.It Li L2_L1D_WB_RQSTS.HIT_E +.Pq Event 28H , Umask 04H +Not rejected writebacks from L1D to L2 cache lines +in E state. +.It Li L2_L1D_WB_RQSTS.HIT_M +.Pq Event 28H , Umask 08H +Not rejected writebacks from L1D to L2 cache lines +in M state. +.It Li L2_L1D_WB_RQSTS.ALL +.Pq Event 28H , Umask 0FH +Not rejected writebacks from L1D to L2 cache. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the +core that reference +a cache line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for +references to the last level cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the +thread is not in a halt state. The thread enters +the halt state when it is running the HLT +instruction. The core frequency may change from +time to time due to power or thermal throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) +when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses +every cycle. +Set Cmaks = 1 and Edge =1 to count occurrences. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of +any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 02H +Miss in all TLB levels causes a page walk that +completes of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 04H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 10H +Store operations that miss the first TLB level +but hit the second and do not cause page walks. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Not SW-prefetch load dispatches that hit fill +buffer allocated for S/W prefetch. +.It Li LOAD_HIT_PER.HW_PF +.Pq Event 4CH , Umask 02H +Not SW-prefetch load dispatches that hit fill +buffer allocated for H/W prefetch. +.It Li HW_PRE_REQ.DL1_MISS +.Pq Event 4EH , Umask 02H +Hardware Prefetch requests that miss the L1D +cache. A request is being counted each time +it access the cache & miss it, including if +a block is applicable or if hit the Fill +Buffer for example. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the +L1 data cache. +.It Li L1D.ALLOCATED_IN_M +.Pq Event 51H , Umask 02H +Counts the number of allocations of modified +L1D cache lines. +.It Li L1D.EVICTION +.Pq Event 51H , Umask 04H +Counts the number of modified lines evicted +from the L1 data cache due to replacement. +.It Li L1D.ALL_M_REPLACEMENT +.Pq Event 51H , Umask 08H +Cache lines in M state evicted out of L1D due +to Snoop HitM or dirty line replacement. +.It Li PARTIAL_RAT_STALLS.FLAGS_MERGE_UOP +.Pq Event 59H , Umask 0CH +Increments the number of flags-merge uops in +flight each cycle. +Set Cmask = 1 to count cycles. +.It Li PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW +.Pq Event 59H , Umask 0FH +Cycles with at least one slow LEA uop allocated. +.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP +.Pq Event 59H , Umask 40H +Number of Multiply packed/scalar single precision +uops allocated. +.It Li RESOURCE_STALLS2.ALL_FL_EMPTY +.Pq Event 5BH , Umask 0CH +Cycles stalled due to free list empty. +.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL +.Pq Event 5BH , Umask 0FH +Cycles stalled due to control structures full for +physical registers. +.It Li RESOURCE_STALLS2.BOB_FULL +.Pq Event 5BH , Umask 40H +Cycles Allocator is stalled due Branch Order Buffer. +.It Li RESOURCE_STALLS2.OOO_RSRC +.Pq Event 5BH , Umask 4FH +Cycles stalled due to out of order resources full. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is not in ring +0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read +transactions in SQ to uncore. Set Cmask=1 to count +cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to +uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read +transactions in SQ to uncore. Set Cmask=1 to count +cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a +UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ +from MITE path. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ +from DSB path. +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ +when MS busy by DSB. Set Cmask = 1 to count +cycles MS is busy. Set Cmask=1 and Edge =1 to +count MS activations. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +Increment each cycle # of uops delivered to IDQ +when MS is busy by MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ +from MS by either DSB or MITE. Set Cmask = 1 to +count cycles. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and +Victim Cache Misses. Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 02H +Misses in all ITLB levels that cause completed page +walks. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 04H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 10H +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the +instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions +executed, but not necessarily retired. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions +excluding calls and indirect branches. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions +that are not calls nor returns. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return +mnemonic. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, +excluding non call branch, executed. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register +and memory indirect, executed. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must +combine with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_INST_EXE.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions +mispredicted. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch +instructions that are not calls nor returns. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that +have a return mnemonic. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch +instructions, excluding non call branch, executed. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including +both register and memory indirect, executed. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches +executed,. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. +Must combine with 01H,02H, 04H, 08H, 10H, 20H +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per +thread. +.It Li UOPS_DISPATCHED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0. +.It Li UOPS_DISPATCHED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +.Pq Event A1H , Umask 04H +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +.Pq Event A1H , Umask 08H +Cycles which a store address uop is dispatched on +port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2 +.Pq Event A1H , Umask 0CH +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +.Pq Event A1H , Umask 10H +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +.Pq Event A1H , Umask 20H +Cycles which a store address uop is dispatched on +port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3 +.Pq Event A1H , Umask 30H +Cycles which a Uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_4 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 4. +.It Li UOPS_DISPATCHED_PORT.PORT_5 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related +reason. +.It Li RESOURCE_STALLS.LB +.Pq Event A2H , Umask 01H +Counts the cycles of stall due to lack of load buffers. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available. (not +including draining form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li RESOURCE_STALLS.FCSW +.Pq Event A2H , Umask 20H +Cycles stalled due to writing the FPU control word. +.It Li RESOURCE_STALLS.MXCSR +.Pq Event A2H , Umask 40H +Cycles stalled due to the MXCSR register rename +occurring to close to a previous MXCSR rename. +.It Li RESOURCE_STALLS.OTHER +.Pq Event A2H , Umask 80H +Cycles stalled while execution was stalled due to +other resource issues. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set AnyThread +to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending L1 cache miss loads.Set +AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH +.Pq Event A3H , Umask 04H +Cycles of dispatch stalls. Set AnyThread to count per +core. +.It Li DSB2MITE_SWITCHES.COUNT +.Pq Event ABH , Umask 01H +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +.Pq Event ABH , Umask 02H +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.OTHER_CANCEL +.Pq Event ACH , Umask 02H +Cases of cancelling valid DSB fill not because of +exceeding way limit. +.It Li DSB_FILL.EXCEED_DSB_LINES +.Pq Event ACH , Umask 08H +DSB Fill encountered > 3 DSB lines. +.It Li DSB_FILL.ALL_CANCEL +.Pq Event ACH , Umask 0AH +Cases of cancelling valid Decode Stream Buffer +(DSB) fill not because of exceeding way limit. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes +4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including +regular RFOs, locks, ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and +prefetch). +.It Li UOPS_DISPATCHED.THREAD +.Pq Event B1H , Umask 01H +Counts total number of uops to be dispatched per- +thread each cycle. Set Cmask = 1, INV =1 to count +stall cycles. +.It Li UOPS_DISPATCHED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be dispatched per- +core each cycle. +.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL +.Pq Event B2H , Umask 01H +Offcore requests buffer cannot take more entries +for this thread core. +.It Li AGU_BYPASS_CANCEL.COUNT +.Pq Event B6H , Umask 01H +Counts executed load operations with all the +following traits: 1. addressing of the format [base + +offset], 2. the offset is between 1 and 2047, 3. the +address specified in the base register is in one page +and the address [base+offset] is in another page. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +(Event B7H, Umask 01H) Off-core Response Performance +Monitoring; PMC0 only. Requires programming MSR 01A6H +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +(Event BBH, Umask 01H) Off-core Response Performance +Monitoring; PMC3 only. Requires programming MSR 01A7H +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES +.Pq Event BFH , Umask 05H +Cycles when dispatched loads are cancelled due to +L1D bank conflicts with other load ports. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce +effect of PEBS shadow in IP distribution. +.It Li OTHER_ASSISTS.ITLB_MISS_RETIRED +.Pq Event C1H , Umask 02H +Instructions that experienced an ITLB miss. +.It Li OTHER_ASSISTS.AVX_STORE +.Pq Event C1H , Umask 08H +Number of assists associated with 256-bit AVX +store operations. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 10H +Number of transitions from AVX-256 to legacy SSE +when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 20H +Number of transitions from SSE to AVX-256 when +penalty applicable. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use +cmask=1 and invert to count active cycles or stalled +cycles. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each +cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to +memory order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Counts the number of times that a program writes +to a code section. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load +operations that refer to an illegal address range +with the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCH +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch +instructions retired. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions +retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions +retired. +.It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +.It Li BR_MISP_RETIRED.NEAR_CALL +.Pq Event C5H , Umask 02H +Direct and indirect mispredicted near call +instructions retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li BR_MISP_RETIRED.NOT_TAKEN +.Pq Event C5H , Umask 10H +Mispredicted not taken branch instructions retired. +.It Li BR_MISP_RETIRED.TAKEN +.Pq Event C5H , Umask 20H +Mispredicted taken branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 assists due to output value. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 assists due to input value. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H + Number of SIMD FP assists due to output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY 1EH +.Pq Event CAH , Umask +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by +hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Sample loads with specified latency threshold. +PMC3 only. +.It Li MEM_TRANS_RETIRED.PRECISE_STORE +.Pq Event CDH , Umask 02H +Sample stores and collect precise store operation +via PEBS record. PMC3 only. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 10H +Qualify retired memory uops that are loads. +Combine with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. +Combine with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask +Qualify retired memory uops with STLB miss. Must +combine with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask +Qualify retired memory uops with lock. Must +combine with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.SPLIT +.Pq Event D0H , Umask +Qualify retired memory uops with line split. Must *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 17:02:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 51F63ECE; Fri, 19 Oct 2012 17:02:16 +0000 (UTC) Date: Fri, 19 Oct 2012 17:02:16 +0000 From: Alexey Dokuchaev To: Devin Teske Subject: Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share Message-ID: <20121019170216.GB92674@FreeBSD.org> References: <201210181843.q9IIhs6N099621@svn.freebsd.org> <20121019055442.GA9108@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 17:02:16 -0000 On Fri, Oct 19, 2012 at 08:22:36AM -0700, Devin Teske wrote: > On Oct 18, 2012, at 10:54 PM, Alexey Dokuchaev wrote: > > How come that new dialog(1) lacks functionality of the old one? > > SVN r217309 brought in cdialog to replace our the [unmaintained] dialog. > > cdialog is different, but mostly compatible with its predecessor. Ah, I guess it might explain the shitty colors I see on newish FreeBSD screenshots of dialog(1). > The benefits of cdialog far out-weigh the few problems that were reported > (and then quickly fixed). OK, but do we plan to retain the look of original dialog(1)? ./danfe From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 17:03:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 186D615F; Fri, 19 Oct 2012 17:03:51 +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 F3B2F8FC08; Fri, 19 Oct 2012 17:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JH3obT038208; Fri, 19 Oct 2012 17:03:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JH3ohF038206; Fri, 19 Oct 2012 17:03:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210191703.q9JH3ohF038206@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Oct 2012 17:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241739 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 17:03:51 -0000 Author: marius Date: Fri Oct 19 17:03:50 2012 New Revision: 241739 URL: http://svn.freebsd.org/changeset/base/241739 Log: Fix kernel build with options ZFS after r240868. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 19 17:01:27 2012 (r241738) +++ head/sys/conf/files Fri Oct 19 17:03:50 2012 (r241739) @@ -214,6 +214,7 @@ cddl/contrib/opensolaris/uts/common/fs/z cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c optional zfs compile-with "${ZFS_C}" From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 17:12:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF8F463B; Fri, 19 Oct 2012 17:12:55 +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 9751B8FC12; Fri, 19 Oct 2012 17:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JHCtGo039736; Fri, 19 Oct 2012 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JHCtFq039734; Fri, 19 Oct 2012 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210191712.q9JHCtFq039734@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Oct 2012 17:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241740 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 17:12:55 -0000 Author: marius Date: Fri Oct 19 17:12:55 2012 New Revision: 241740 URL: http://svn.freebsd.org/changeset/base/241740 Log: - Remove an unused header. - Don't waste a delay slot. MFC after: 3 days Modified: head/sys/sparc64/sparc64/interrupt.S Modified: head/sys/sparc64/sparc64/interrupt.S ============================================================================== --- head/sys/sparc64/sparc64/interrupt.S Fri Oct 19 17:03:50 2012 (r241739) +++ head/sys/sparc64/sparc64/interrupt.S Fri Oct 19 17:12:55 2012 (r241740) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -84,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,pt %g3, 1f + brnz,a,pt %g3, 1f + srlx %g3, 60, %g6 /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - and %g3, IV_MAX - 1, %g3 jmpl %g4, %g0 - nop + and %g3, IV_MAX - 1, %g3 /* NOTREACHED */ /* @@ -99,8 +98,7 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: srlx %g3, 60, %g6 - brnz,a,pn %g6, 2f +1: brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 17:21:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 782AA9FD; Fri, 19 Oct 2012 17:21:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4575D8FC08; Fri, 19 Oct 2012 17:21:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JHLBuA041090; Fri, 19 Oct 2012 17:21:11 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JHLBRB041086; Fri, 19 Oct 2012 17:21:11 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201210191721.q9JHLBRB041086@svn.freebsd.org> From: Sean Bruno Date: Fri, 19 Oct 2012 17:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241741 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 17:21:11 -0000 Author: sbruno Date: Fri Oct 19 17:21:10 2012 New Revision: 241741 URL: http://svn.freebsd.org/changeset/base/241741 Log: Update man page crossreferences to sandybridge xeon class MFC after: 2 weeks Modified: head/lib/libpmc/pmc.ivybridge.3 head/lib/libpmc/pmc.sandybridge.3 head/lib/libpmc/pmc.sandybridgeuc.3 Modified: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridge.3 Fri Oct 19 17:12:55 2012 (r241740) +++ head/lib/libpmc/pmc.ivybridge.3 Fri Oct 19 17:21:10 2012 (r241741) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2012 +.Dd October 19, 2012 .Dt PMC.IVYBRIDGE 3 .Os .Sh NAME @@ -855,6 +855,7 @@ Dirty L2 cache lines evicted by the MLC .Xr pmc.corei7uc 3 , .Xr pmc.sandybridge 3 , .Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.westmere 3 , .Xr pmc.westmereuc 3 , .Xr pmc.soft 3 , Modified: head/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridge.3 Fri Oct 19 17:12:55 2012 (r241740) +++ head/lib/libpmc/pmc.sandybridge.3 Fri Oct 19 17:21:10 2012 (r241741) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2012 +.Dd October 19, 2012 .Dt PMC.SANDYBRIDGE 3 .Os .Sh NAME @@ -932,6 +932,7 @@ Split locks in SQ. .Xr pmc.p5 3 , .Xr pmc.p6 3 , .Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , .Xr pmc.ucf 3 , Modified: head/lib/libpmc/pmc.sandybridgeuc.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridgeuc.3 Fri Oct 19 17:12:55 2012 (r241740) +++ head/lib/libpmc/pmc.sandybridgeuc.3 Fri Oct 19 17:21:10 2012 (r241741) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2012 +.Dd October 19, 2012 .Dt PMC.SANDYBRIDGEUC 3 .Os .Sh NAME @@ -208,6 +208,7 @@ Counts the number of core-outgoing entri .Xr pmc.p5 3 , .Xr pmc.p6 3 , .Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , .Xr pmc.ucf 3 , From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 18:30:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61D36DF2; Fri, 19 Oct 2012 18:30:51 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 476928FC0C; Fri, 19 Oct 2012 18:30:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JIUpKn052169; Fri, 19 Oct 2012 18:30:51 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JIUpJ7052167; Fri, 19 Oct 2012 18:30:51 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210191830.q9JIUpJ7052167@svn.freebsd.org> From: Joel Dahl Date: Fri, 19 Oct 2012 18:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241745 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 18:30:51 -0000 Author: joel (doc committer) Date: Fri Oct 19 18:30:50 2012 New Revision: 241745 URL: http://svn.freebsd.org/changeset/base/241745 Log: Remove trailing whitespace. Modified: head/lib/libpmc/pmc.sandybridgexeon.3 Modified: head/lib/libpmc/pmc.sandybridgexeon.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridgexeon.3 Fri Oct 19 18:11:17 2012 (r241744) +++ head/lib/libpmc/pmc.sandybridgexeon.3 Fri Oct 19 18:30:50 2012 (r241745) @@ -442,147 +442,147 @@ Set Cmask = 1 to count cycles. .It Li PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW .Pq Event 59H , Umask 0FH Cycles with at least one slow LEA uop allocated. -.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP +.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP .Pq Event 59H , Umask 40H Number of Multiply packed/scalar single precision uops allocated. -.It Li RESOURCE_STALLS2.ALL_FL_EMPTY +.It Li RESOURCE_STALLS2.ALL_FL_EMPTY .Pq Event 5BH , Umask 0CH -Cycles stalled due to free list empty. -.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL +Cycles stalled due to free list empty. +.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL .Pq Event 5BH , Umask 0FH Cycles stalled due to control structures full for physical registers. -.It Li RESOURCE_STALLS2.BOB_FULL +.It Li RESOURCE_STALLS2.BOB_FULL .Pq Event 5BH , Umask 40H -Cycles Allocator is stalled due Branch Order Buffer. -.It Li RESOURCE_STALLS2.OOO_RSRC +Cycles Allocator is stalled due Branch Order Buffer. +.It Li RESOURCE_STALLS2.OOO_RSRC .Pq Event 5BH , Umask 4FH -Cycles stalled due to out of order resources full. -.It Li CPL_CYCLES.RING0 +Cycles stalled due to out of order resources full. +.It Li CPL_CYCLES.RING0 .Pq Event 5CH , Umask 01H -Unhalted core cycles when the thread is in ring 0. -.It Li CPL_CYCLES.RING123 +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 .Pq Event 5CH , Umask 02H Unhalted core cycles when the thread is not in ring 0. .It Li RS_EVENTS.EMPTY_CYCLES .Pq Event 5EH , Umask 01H -Cycles the RS is empty for the thread. -.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD .Pq Event 60H , Umask 01H Offcore outstanding Demand Data Read transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO .Pq Event 60H , Umask 04H Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD .Pq Event 60H , Umask 08H Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION .Pq Event 63H , Umask 01H Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. -.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION .Pq Event 63H , Umask 02H -Cycles in which the L1D is locked. -.It Li IDQ.EMPTY +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY .Pq Event 79H , Umask 02H Counts cycles the IDQ is empty. -.It Li IDQ.MITE_UOPS +.It Li IDQ.MITE_UOPS .Pq Event 79H , Umask 04H Increment each cycle # of uops delivered to IDQ from MITE path. Set Cmask = 1 to count cycles. -.It Li IDQ.DSB_UOPS +.It Li IDQ.DSB_UOPS .Pq Event 79H , Umask 08H Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles. -.It Li IDQ.MS_DSB_UOPS +.It Li IDQ.MS_DSB_UOPS .Pq Event 79H , Umask 10H Increment each cycle # of uops delivered to IDQ when MS busy by DSB. Set Cmask = 1 to count cycles MS is busy. Set Cmask=1 and Edge =1 to count MS activations. -.It Li IDQ.MS_MITE_UOPS +.It Li IDQ.MS_MITE_UOPS .Pq Event 79H , Umask 20H Increment each cycle # of uops delivered to IDQ when MS is busy by MITE. Set Cmask = 1 to count cycles. -.It Li IDQ.MS_UOPS +.It Li IDQ.MS_UOPS .Pq Event 79H , Umask 30H Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles. -.It Li ICACHE.MISSES +.It Li ICACHE.MISSES .Pq Event 80H , Umask 02H Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. Includes UC accesses. -.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK .Pq Event 85H , Umask 01H -Misses in all ITLB levels that cause page walks. -.It Li ITLB_MISSES.WALK_COMPLETED +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED .Pq Event 85H , Umask 02H Misses in all ITLB levels that cause completed page walks. -.It Li ITLB_MISSES.WALK_DURATION +.It Li ITLB_MISSES.WALK_DURATION .Pq Event 85H , Umask 04H -Cycle PMH is busy with a walk. -.It Li ITLB_MISSES.STLB_HIT +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT .Pq Event 85H , Umask 10H -Number of cache load STLB hits. No page walk. -.It Li ILD_STALL.LCP +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP .Pq Event 87H , Umask 01H Stalls caused by changing prefix length of the instruction. -.It Li ILD_STALL.IQ_FULL +.It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H -Stall cycles due to IQ is full. +Stall cycles due to IQ is full. .It Li BR_INST_EXEC.COND .Pq Event 88H , Umask 01H Qualify conditional near branch instructions executed, but not necessarily retired. -.It Li BR_INST_EXEC.DIRECT_JMP +.It Li BR_INST_EXEC.DIRECT_JMP .Pq Event 88H , Umask 02H Qualify all unconditional near branch instructions excluding calls and indirect branches. -.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET .Pq Event 88H , Umask 04H Qualify executed indirect near branch instructions that are not calls nor returns. -.It Li BR_INST_EXEC.RETURN_NEAR +.It Li BR_INST_EXEC.RETURN_NEAR .Pq Event 88H , Umask 08H Qualify indirect near branches that have a return mnemonic. -.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL .Pq Event 88H , Umask 10H Qualify unconditional near call branch instructions, excluding non call branch, executed. -.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL .Pq Event 88H , Umask 20H Qualify indirect near calls, including both register and memory indirect, executed. -.It Li BR_INST_EXEC.NONTAKEN +.It Li BR_INST_EXEC.NONTAKEN .Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -.It Li BR_INST_EXEC.TAKEN +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN .Pq Event 88H , Umask 80H Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, 10H, 20H. -.It Li BR_INST_EXE.ALL_BRANCHES +.It Li BR_INST_EXE.ALL_BRANCHES .Pq Event 88H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li BR_MISP_EXEC.COND +.It Li BR_MISP_EXEC.COND .Pq Event 89H , Umask 01H Qualify conditional near branch instructions mispredicted. -.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET .Pq Event 89H , Umask 04H Qualify mispredicted indirect near branch instructions that are not calls nor returns. @@ -590,144 +590,144 @@ instructions that are not calls nor retu .Pq Event 89H , Umask 08H Qualify mispredicted indirect near branches that have a return mnemonic. -.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL .Pq Event 89H , Umask 10H Qualify mispredicted unconditional near call branch instructions, excluding non call branch, executed. -.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL .Pq Event 89H , Umask 20H Qualify mispredicted indirect near calls, including both register and memory indirect, executed. -.It Li BR_MISP_EXEC.NONTAKEN +.It Li BR_MISP_EXEC.NONTAKEN .Pq Event 89H , Umask 40H Qualify mispredicted non-taken near branches executed,. -.It Li BR_MISP_EXEC.TAKEN +.It Li BR_MISP_EXEC.TAKEN .Pq Event 89H , Umask 80H Qualify mispredicted taken near branches executed. Must combine with 01H,02H, 04H, 08H, 10H, 20H -.It Li BR_MISP_EXEC.ALL_BRANCHES +.It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per thread. -.It Li UOPS_DISPATCHED_PORT.PORT_0 +.It Li UOPS_DISPATCHED_PORT.PORT_0 .Pq Event A1H , Umask 01H -Cycles which a Uop is dispatched on port 0. +Cycles which a Uop is dispatched on port 0. .It Li UOPS_DISPATCHED_PORT.PORT_1 .Pq Event A1H , Umask 02H -Cycles which a Uop is dispatched on port 1. -.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD .Pq Event A1H , Umask 04H -Cycles which a load uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA .Pq Event A1H , Umask 08H Cycles which a store address uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_2 +.It Li UOPS_DISPATCHED_PORT.PORT_2 .Pq Event A1H , Umask 0CH -Cycles which a Uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD .Pq Event A1H , Umask 10H -Cycles which a load uop is dispatched on port 3. -.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA .Pq Event A1H , Umask 20H Cycles which a store address uop is dispatched on port 3. -.It Li UOPS_DISPATCHED_PORT.PORT_3 +.It Li UOPS_DISPATCHED_PORT.PORT_3 .Pq Event A1H , Umask 30H -Cycles which a Uop is dispatched on port 3. +Cycles which a Uop is dispatched on port 3. .It Li UOPS_DISPATCHED_PORT.PORT_4 .Pq Event A1H , Umask 40H Cycles which a Uop is dispatched on port 4. -.It Li UOPS_DISPATCHED_PORT.PORT_5 +.It Li UOPS_DISPATCHED_PORT.PORT_5 .Pq Event A1H , Umask 80H -Cycles which a Uop is dispatched on port 5. -.It Li RESOURCE_STALLS.ANY +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY .Pq Event A2H , Umask 01H Cycles Allocation is stalled due to Resource Related reason. -.It Li RESOURCE_STALLS.LB +.It Li RESOURCE_STALLS.LB .Pq Event A2H , Umask 01H -Counts the cycles of stall due to lack of load buffers. -.It Li RESOURCE_STALLS.RS +Counts the cycles of stall due to lack of load buffers. +.It Li RESOURCE_STALLS.RS .Pq Event A2H , Umask 04H -Cycles stalled due to no eligible RS entry available. -.It Li RESOURCE_STALLS.SB +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB .Pq Event A2H , Umask 08H Cycles stalled due to no store buffers available. (not including draining form sync). -.It Li RESOURCE_STALLS.ROB +.It Li RESOURCE_STALLS.ROB .Pq Event A2H , Umask 10H -Cycles stalled due to re-order buffer full. -.It Li RESOURCE_STALLS.FCSW +Cycles stalled due to re-order buffer full. +.It Li RESOURCE_STALLS.FCSW .Pq Event A2H , Umask 20H -Cycles stalled due to writing the FPU control word. -.It Li RESOURCE_STALLS.MXCSR +Cycles stalled due to writing the FPU control word. +.It Li RESOURCE_STALLS.MXCSR .Pq Event A2H , Umask 40H Cycles stalled due to the MXCSR register rename occurring to close to a previous MXCSR rename. -.It Li RESOURCE_STALLS.OTHER +.It Li RESOURCE_STALLS.OTHER .Pq Event A2H , Umask 80H Cycles stalled while execution was stalled due to other resource issues. -.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING .Pq Event A3H , Umask 01H Cycles with pending L2 miss loads. Set AnyThread to count per core. -.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING .Pq Event A3H , Umask 02H Cycles with pending L1 cache miss loads.Set AnyThread to count per core. -.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH +.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH .Pq Event A3H , Umask 04H -Cycles of dispatch stalls. Set AnyThread to count per +Cycles of dispatch stalls. Set AnyThread to count per core. -.It Li DSB2MITE_SWITCHES.COUNT +.It Li DSB2MITE_SWITCHES.COUNT .Pq Event ABH , Umask 01H -Number of DSB to MITE switches. -.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES .Pq Event ABH , Umask 02H -Cycles DSB to MITE switches caused delay. -.It Li DSB_FILL.OTHER_CANCEL +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.OTHER_CANCEL .Pq Event ACH , Umask 02H Cases of cancelling valid DSB fill not because of exceeding way limit. -.It Li DSB_FILL.EXCEED_DSB_LINES +.It Li DSB_FILL.EXCEED_DSB_LINES .Pq Event ACH , Umask 08H -DSB Fill encountered > 3 DSB lines. -.It Li DSB_FILL.ALL_CANCEL +DSB Fill encountered > 3 DSB lines. +.It Li DSB_FILL.ALL_CANCEL .Pq Event ACH , Umask 0AH Cases of cancelling valid Decode Stream Buffer (DSB) fill not because of exceeding way limit. -.It Li ITLB.ITLB_FLUSH +.It Li ITLB.ITLB_FLUSH .Pq Event AEH , Umask 01H Counts the number of ITLB flushes, includes 4k/2M/4M pages. -.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD .Pq Event B0H , Umask 01H Demand data read requests sent to uncore. -.It Li OFFCORE_REQUESTS.DEMAND_RFO +.It Li OFFCORE_REQUESTS.DEMAND_RFO .Pq Event B0H , Umask 04H Demand RFO read requests sent to uncore, including regular RFOs, locks, ItoM. -.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.It Li OFFCORE_REQUESTS.ALL_DATA_RD .Pq Event B0H , Umask 08H Data read requests sent to uncore (demand and prefetch). -.It Li UOPS_DISPATCHED.THREAD +.It Li UOPS_DISPATCHED.THREAD .Pq Event B1H , Umask 01H Counts total number of uops to be dispatched per- thread each cycle. Set Cmask = 1, INV =1 to count stall cycles. -.It Li UOPS_DISPATCHED.CORE +.It Li UOPS_DISPATCHED.CORE .Pq Event B1H , Umask 02H Counts total number of uops to be dispatched per- core each cycle. -.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL +.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL .Pq Event B2H , Umask 01H Offcore requests buffer cannot take more entries for this thread core. @@ -738,47 +738,47 @@ following traits: 1. addressing of the f offset], 2. the offset is between 1 and 2047, 3. the address specified in the base register is in one page and the address [base+offset] is in another page. -.It Li OFF_CORE_RESPONSE_0 +.It Li OFF_CORE_RESPONSE_0 .Pq Event B7H , Umask 01H (Event B7H, Umask 01H) Off-core Response Performance Monitoring; PMC0 only. Requires programming MSR 01A6H -.It Li OFF_CORE_RESPONSE_1 +.It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H (Event BBH, Umask 01H) Off-core Response Performance Monitoring; PMC3 only. Requires programming MSR 01A7H -.It Li TLB_FLUSH.DTLB_THREAD +.It Li TLB_FLUSH.DTLB_THREAD .Pq Event BDH , Umask 01H -DTLB flush attempts of the thread-specific entries. -.It Li TLB_FLUSH.STLB_ANY +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY .Pq Event BDH , Umask 20H -Count number of STLB flush attempts. -.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES +Count number of STLB flush attempts. +.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES .Pq Event BFH , Umask 05H Cycles when dispatched loads are cancelled due to L1D bank conflicts with other load ports. -.It Li INST_RETIRED.ANY_P +.It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -Number of instructions at retirement. -.It Li INST_RETIRED.ALL +Number of instructions at retirement. +.It Li INST_RETIRED.ALL .Pq Event C0H , Umask 01H Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution. .It Li OTHER_ASSISTS.ITLB_MISS_RETIRED .Pq Event C1H , Umask 02H -Instructions that experienced an ITLB miss. -.It Li OTHER_ASSISTS.AVX_STORE +Instructions that experienced an ITLB miss. +.It Li OTHER_ASSISTS.AVX_STORE .Pq Event C1H , Umask 08H Number of assists associated with 256-bit AVX store operations. -.It Li OTHER_ASSISTS.AVX_TO_SSE +.It Li OTHER_ASSISTS.AVX_TO_SSE .Pq Event C1H , Umask 10H Number of transitions from AVX-256 to legacy SSE when penalty applicable. -.It Li OTHER_ASSISTS.SSE_TO_AVX +.It Li OTHER_ASSISTS.SSE_TO_AVX .Pq Event C1H , Umask 20H Number of transitions from SSE to AVX-256 when penalty applicable. -.It Li UOPS_RETIRED.ALL +.It Li UOPS_RETIRED.ALL .Pq Event C2H , Umask 01H Counts the number of micro-ops retired, Use cmask=1 and invert to count active cycles or stalled @@ -787,7 +787,7 @@ cycles. .Pq Event C2H , Umask 02H Counts the number of retirement slots used each cycle. -.It Li MACHINE_CLEARS.MEMORY_ORDERING +.It Li MACHINE_CLEARS.MEMORY_ORDERING .Pq Event C3H , Umask 02H Counts the number of machine clears due to memory order conflicts. @@ -795,25 +795,25 @@ memory order conflicts. .Pq Event C3H , Umask 04H Counts the number of times that a program writes to a code section. -.It Li MACHINE_CLEARS.MASKMOV +.It Li MACHINE_CLEARS.MASKMOV .Pq Event C3H , Umask 20H Counts the number of executed AVX masked load operations that refer to an illegal address range with the mask bits set to 0. -.It Li BR_INST_RETIRED.ALL_BRANCH +.It Li BR_INST_RETIRED.ALL_BRANCH .Pq Event C4H , Umask 00H -Branch instructions at retirement. -.It Li BR_INST_RETIRED.CONDITIONAL +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. -.It Li BR_INST_RETIRED.NEAR_CALL +.It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Direct and indirect near call instructions retired. -.It Li BR_INST_RETIRED.ALL_BRANCHES +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired. -.It Li BR_INST_RETIRED.NEAR_RETURN +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN .Pq Event C4H , Umask 08H Counts the number of near return instructions retired. @@ -823,16 +823,16 @@ Counts the number of not taken branch in retired. .It Li BR_INST_RETIRED.NEAR_TAKEN .Pq Event C4H , Umask 20H -Number of near taken branches retired. +Number of near taken branches retired. .It Li BR_INST_RETIRED.FAR_BRANCH .Pq Event C4H , Umask 40H -Number of far branches retired. +Number of far branches retired. .It Li BR_MISP_RETIRED.ALL_BRANCHES .Pq Event C5H , Umask 00H -Mispredicted branch instructions at retirement. +Mispredicted branch instructions at retirement. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H -Mispredicted conditional branch instructions retired. +Mispredicted conditional branch instructions retired. .It Li BR_MISP_RETIRED.NEAR_CALL .Pq Event C5H , Umask 02H Direct and indirect mispredicted near call @@ -842,25 +842,25 @@ instructions retired. Mispredicted macro branch instructions retired. .It Li BR_MISP_RETIRED.NOT_TAKEN .Pq Event C5H , Umask 10H -Mispredicted not taken branch instructions retired. +Mispredicted not taken branch instructions retired. .It Li BR_MISP_RETIRED.TAKEN .Pq Event C5H , Umask 20H -Mispredicted taken branch instructions retired. +Mispredicted taken branch instructions retired. .It Li FP_ASSIST.X87_OUTPUT .Pq Event CAH , Umask 02H -Number of X87 assists due to output value. +Number of X87 assists due to output value. .It Li FP_ASSIST.X87_INPUT .Pq Event CAH , Umask 04H -Number of X87 assists due to input value. +Number of X87 assists due to input value. .It Li FP_ASSIST.SIMD_OUTPUT .Pq Event CAH , Umask 08H - Number of SIMD FP assists due to output values. + Number of SIMD FP assists due to output values. .It Li FP_ASSIST.SIMD_INPUT .Pq Event CAH , Umask 10H -Number of SIMD FP assists due to input values. +Number of SIMD FP assists due to input values. .It Li FP_ASSIST.ANY 1EH .Pq Event CAH , Umask -Cycles with any input/output SSE* or FP assists. +Cycles with any input/output SSE* or FP assists. .It Li ROB_MISC_EVENTS.LBR_INSERTS .Pq Event CCH , Umask 20H Count cases of saving new LBR records by @@ -893,27 +893,27 @@ combine with umask 01H, 02H, to produce .Pq Event D0H , Umask Qualify retired memory uops with line split. Must combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED_ALL +.It Li MEM_UOP_RETIRED_ALL .Pq Event D0H , Umask Qualify any retired memory uops. Must combine with umask 01H, 02H, to produce counts. -.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. -.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT .Pq Event D1H , Umask 02H Retired load uops with L2 cache hits as data sources. -.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT .Pq Event D1H , Umask 04H -Retired load uops which data sources were data hits +Retired load uops which data sources were data hits in LLC without snoops required. .It Li MEM_LOAD_UOPS_RETIRED.LLC_MISS .Pq Event D1H , Umask 20H Retired load uops which data sources were data missed LLC (excluding unknown data source). -.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB .Pq Event D1H , Umask 40H Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to @@ -930,58 +930,58 @@ correct prediction and this is corrected branch handling mechanisms at the front end. .It Li L2_TRANS.DEMAND_DATA_RD .Pq Event F0H , Umask 01H -Demand Data Read requests that access L2 cache. +Demand Data Read requests that access L2 cache. .It Li L2_TRANS.RFO .Pq Event F0H , Umask 02H -RFO requests that access L2 cache. +RFO requests that access L2 cache. .It Li L2_TRANS.CODE_RD .Pq Event F0H , Umask 04H -L2 cache accesses when fetching instructions. +L2 cache accesses when fetching instructions. .It Li L2_TRANS.ALL_PF .Pq Event F0H , Umask 08H -L2 or LLC HW prefetches that access L2 cache. +L2 or LLC HW prefetches that access L2 cache. .It Li L2_TRANS.L1D_WB .Pq Event F0H , Umask 10H -L1D writebacks that access L2 cache. +L1D writebacks that access L2 cache. .It Li L2_TRANS.L2_FILL .Pq Event F0H , Umask 20H -L2 fill requests that access L2 cache. +L2 fill requests that access L2 cache. .It Li L2_TRANS.L2_WB .Pq Event F0H , Umask 40H -L2 writebacks that access L2 cache. +L2 writebacks that access L2 cache. .It Li L2_TRANS.ALL_REQUESTS .Pq Event F0H , Umask 80H -Transactions accessing L2 pipe. +Transactions accessing L2 pipe. .It Li L2_LINES_IN.I .Pq Event F1H , Umask 01H -L2 cache lines in I state filling L2. +L2 cache lines in I state filling L2. .It Li L2_LINES_IN.S .Pq Event F1H , Umask 02H -L2 cache lines in S state filling L2. -.It Li L2_LINES_IN.E +L2 cache lines in S state filling L2. +.It Li L2_LINES_IN.E .Pq Event F1H , Umask 04H -L2 cache lines in E state filling L2. +L2 cache lines in E state filling L2. .It Li L2_LINES-IN.ALL .Pq Event F1H , Umask 07H -L2 cache lines filling L2. +L2 cache lines filling L2. .It Li L2_LINES_OUT.DEMAND_CLEAN .Pq Event F2H , Umask 01H -Clean L2 cache lines evicted by demand. +Clean L2 cache lines evicted by demand. .It Li L2_LINES_OUT.DEMAND_DIRTY .Pq Event F2H , Umask 02H -Dirty L2 cache lines evicted by demand. +Dirty L2 cache lines evicted by demand. .It Li L2_LINES_OUT.PF_CLEAN .Pq Event F2H , Umask 04H -Clean L2 cache lines evicted by L2 prefetch. +Clean L2 cache lines evicted by L2 prefetch. .It Li L2_LINES_OUT.PF_DIRTY .Pq Event F2H , Umask 08H -Dirty L2 cache lines evicted by L2 prefetch. +Dirty L2 cache lines evicted by L2 prefetch. .It Li L2_LINES_OUT.DIRTY_ALL .Pq Event F2H , Umask 0AH -Dirty L2 cache lines filling the L2. +Dirty L2 cache lines filling the L2. .It Li SQ_MISC.SPLIT_LOCK .Pq Event F4H , Umask 10H -Split locks in SQ. +Split locks in SQ. .El .Sh SEE ALSO .Xr pmc 3 , From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 18:36:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84F22257; Fri, 19 Oct 2012 18:36:47 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8A88FC16; Fri, 19 Oct 2012 18:36:46 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa03.fnfis.com (8.14.4/8.14.4) with ESMTP id q9JIaKdM004247 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 19 Oct 2012 13:36:43 -0500 Received: from [10.0.0.101] (10.14.152.61) by smtp.fisglobal.com (10.132.206.16) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 19 Oct 2012 13:36:06 -0500 Subject: Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share MIME-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset="koi8-r" From: Devin Teske In-Reply-To: <20121019170216.GB92674@FreeBSD.org> Date: Fri, 19 Oct 2012 11:36:04 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: <44662B32-966F-4573-987D-EEE8A07C5A16@fisglobal.com> References: <201210181843.q9IIhs6N099621@svn.freebsd.org> <20121019055442.GA9108@FreeBSD.org> <20121019170216.GB92674@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1283) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855, 1.0.431, 0.0.0000 definitions=2012-10-19_04:2012-10-19,2012-10-19,1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Devin Teske , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 18:36:47 -0000 On Oct 19, 2012, at 10:02 AM, Alexey Dokuchaev wrote: > On Fri, Oct 19, 2012 at 08:22:36AM -0700, Devin Teske wrote: >> On Oct 18, 2012, at 10:54 PM, Alexey Dokuchaev wrote: >>> How come that new dialog(1) lacks functionality of the old one? >>=20 >> SVN r217309 brought in cdialog to replace our the [unmaintained] dialog. >>=20 >> cdialog is different, but mostly compatible with its predecessor. >=20 > Ah, I guess it might explain the shitty colors I see on newish FreeBSD > screenshots of dialog(1). >=20 I actually prefer the colors in cdialog (more specifically, I prefer the la= ck-of-yellow!). Whenever I want a reminder of bad colors, I run "sade" (which links against= the old libdialog now named lib*o*dialog). When I'm on the physical console, I don't have nearly as much trouble with = the yellow color used both for the title bar and for the hline at the botto= m, but when I'm (say) ssh'd from Mac OS X, that text is just completely unr= eadable to me. I'm curious about how others feel about the use of yellow (specifically tha= t old dialog(1)/libdialog used it a lot and new cdialog-based dialog(1)/lib= dialog doesn't use it hardly at all). I for one embrace my new cdialog overlord. >> The benefits of cdialog far out-weigh the few problems that were reported >> (and then quickly fixed). >=20 > OK, but do we plan to retain the look of original dialog(1)? >=20 It is possible to change the colorings by first creating (if you don't alre= ady have one) a ~/.dialogrc by executing the below command: dialog --create-rc ~/.dialogrc followed by editing said file. So while the default look and feel has changed, it's possible to customize = it to your liking. HINT: I bet if you ran the above command on FreeBSD-8 or lower, it would ma= ke dialog(1) in FreeBSD-9 and higher look like its predecessor. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 19:17:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A425BC54; Fri, 19 Oct 2012 19:17:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C1A8FC0C; Fri, 19 Oct 2012 19:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JJHiUt059370; Fri, 19 Oct 2012 19:17:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JJHi5l059368; Fri, 19 Oct 2012 19:17:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210191917.q9JJHi5l059368@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Oct 2012 19:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241748 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 19:17:44 -0000 Author: jhb Date: Fri Oct 19 19:17:43 2012 New Revision: 241748 URL: http://svn.freebsd.org/changeset/base/241748 Log: When checking to see if a video output's _ADR matches an entry in the parent adapter's _DOD list, only check the low 16 bits of both _ADR and _DOD. The language in the ACPI spec seems to indicate that the _ADR values should exactly match the entries in _DOD. However, I assume that the masking added to _DOD values was added to work around some known busted machines (the commit history doesn't indicate either way), and the ACPI spec does require that the low 16 bits are unique for all video outputs, so only check the low 16 bits should be fine. This fixes recognition of video outputs that use the new standardized device ID scheme in ACPI 3.0 that set bit 31 such as certain Dell laptops. Tested by: Juergen Lock nox jelal kn-bremen de MFC after: 3 days Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Fri Oct 19 18:50:19 2012 (r241747) +++ head/sys/dev/acpica/acpi_video.c Fri Oct 19 19:17:43 2012 (r241748) @@ -906,7 +906,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle for (i = 0; i < argset->dod_pkg->Package.Count; i++) { if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && - (val & DOD_DEVID_MASK_FULL) == adr) { + (val & DOD_DEVID_MASK_FULL) == + (adr & DOD_DEVID_MASK_FULL)) { argset->callback(handle, val, argset->context); argset->count++; } From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 19:28:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 448E111E; Fri, 19 Oct 2012 19:28:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 256488FC0C; Fri, 19 Oct 2012 19:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JJSa2F061411; Fri, 19 Oct 2012 19:28:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JJSZtu061409; Fri, 19 Oct 2012 19:28:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201210191928.q9JJSZtu061409@svn.freebsd.org> From: Ed Maste Date: Fri, 19 Oct 2012 19:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241750 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 19:28:36 -0000 Author: emaste Date: Fri Oct 19 19:28:35 2012 New Revision: 241750 URL: http://svn.freebsd.org/changeset/base/241750 Log: Use M_NOWAIT when calling malloc with a lock held. The check for a NULL return was already in place so I assume this was just an oversight. Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri Oct 19 19:27:33 2012 (r241749) +++ head/sys/dev/netmap/netmap_mem2.c Fri Oct 19 19:28:35 2012 (r241750) @@ -595,7 +595,7 @@ netmap_finalize_obj_allocator(struct net #ifdef linux p->lut = vmalloc(n); #else - p->lut = malloc(n, M_NETMAP, M_WAITOK | M_ZERO); + p->lut = malloc(n, M_NETMAP, M_NOWAIT | M_ZERO); #endif if (p->lut == NULL) { D("Unable to create lookup table (%d bytes) for '%s'", n, p->name); @@ -604,7 +604,7 @@ netmap_finalize_obj_allocator(struct net /* Allocate the bitmap */ n = (p->objtotal + 31) / 32; - p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_WAITOK | M_ZERO); + p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_NOWAIT | M_ZERO); if (p->bitmap == NULL) { D("Unable to create bitmap (%d entries) for allocator '%s'", n, p->name); From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 19:56:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BFF157D; Fri, 19 Oct 2012 19:56:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6403F8FC08; Fri, 19 Oct 2012 19:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JJuIET066609; Fri, 19 Oct 2012 19:56:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JJuIV0066607; Fri, 19 Oct 2012 19:56:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201210191956.q9JJuIV0066607@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 19 Oct 2012 19:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241751 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 19:56:18 -0000 Author: marcel Date: Fri Oct 19 19:56:17 2012 New Revision: 241751 URL: http://svn.freebsd.org/changeset/base/241751 Log: Fix a bootstrapping problem where the first bmake (built by FreeBSD's make) ended up being built with -DFORCE_MACHINE. This broke the lib32 built for amd64 & powerpc64. This fix is comes with the next import of bmake, but is committed here and now to minimize the exposure to the bug. Submitted by: Simon Gerraty Modified: head/usr.bin/bmake/Makefile Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Fri Oct 19 19:28:35 2012 (r241750) +++ head/usr.bin/bmake/Makefile Fri Oct 19 19:56:17 2012 (r241751) @@ -81,10 +81,9 @@ SUBDIR= PSD.doc .endif .endif +.if defined(.PARSEDIR) +# we cannot rely on anything but bmake to parse this correctly. .if empty(isBSD44:M${OS}) -# XXX not sure if we still want this given that configure -# lets us force or not the definition of MACHINE. -CFLAGS_main.o+= "-DFORCE_MACHINE=\"${MACHINE}\"" MANTARGET=cat INSTALL?=${srcdir}/install-sh .if (${MACHINE} == "sun386") @@ -95,7 +94,7 @@ SRCS+= sigcompat.c CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART .endif .endif -.if defined(.PARSEDIR) + .if make(obj) || make(clean) SUBDIR+= unit-tests .endif From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 20:13:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7BF5956; Fri, 19 Oct 2012 20:13:08 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0198FC0C; Fri, 19 Oct 2012 20:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JKD8uW069348; Fri, 19 Oct 2012 20:13:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JKD8si069344; Fri, 19 Oct 2012 20:13:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201210192013.q9JKD8si069344@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 19 Oct 2012 20:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241752 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 20:13:08 -0000 Author: marcel Date: Fri Oct 19 20:13:08 2012 New Revision: 241752 URL: http://svn.freebsd.org/changeset/base/241752 Log: Improve upon the previous commit to fix the yacc rule. 1. Have the resulting C file depend on the resulting H file as it should be. Touch the C file to make sure the C file is newer than the H file to keep make happy. 2. Apply the same fix to the other instance of .ORDER, missed in the previous commit. Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Oct 19 19:56:17 2012 (r241751) +++ head/share/mk/bsd.dep.mk Fri Oct 19 20:13:08 2012 (r241752) @@ -95,16 +95,17 @@ CLEANFILES+= ${_LC} SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES+= ${_YC} .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) -.ORDER: ${_YC} y.tab.h -${_YC} y.tab.h: ${_YSRC} +y.tab.h: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} +${_YC}: y.tab.h cp y.tab.c ${_YC} CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h -${_YH}: ${_YC} -${_YC}: ${_YSRC} +${_YH}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} +${_YC}: ${_YH} + @touch ${.TARGET} SRCS+= ${_YH} CLEANFILES+= ${_YH} .endfor From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:05:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C73BC565; Fri, 19 Oct 2012 22:05:52 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 55E3D8FC0A; Fri, 19 Oct 2012 22:05:52 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so1202776oag.13 for ; Fri, 19 Oct 2012 15:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=pPwWkzthmuZsPIkcjySkHz3n6Ck2/pMx/kyqgTvElws=; b=Sah5QFs63NyzmvxHVpB0L0zh8MWisFrgNaK93hrHFaz2d+NrhJyVL0bnxph6MBeJci TNaCZWOac/ZrvlEbhXkWagTGD+dVOr+4O7Uk+EYI/nG8OKCkDufkhhhp2qfpsPIhEL6+ gTJjPzIS2HaCA/vka0BIbFaP4mPVab303iTYsC49fXAPZBpppYHjY1UY3Ou9jLcXJhiK fDh8iYPaOBxZ+2SDYkKCgPugtOWGUa33mF6D8cWSqWq87LqcwlS4nCN+0DMtQ0YrmO4h R/oj/YZABCDxhfGUgGFqNEue0jnuj/Eb+xTw4a60gsBCGbtEly++CcL4gfUIhGheB6BX KLDQ== MIME-Version: 1.0 Received: by 10.60.32.243 with SMTP id m19mr2837813oei.21.1350684350469; Fri, 19 Oct 2012 15:05:50 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.76.151.39 with HTTP; Fri, 19 Oct 2012 15:05:50 -0700 (PDT) In-Reply-To: <201210191118.42722.jhb@freebsd.org> References: <201210191449.q9JEnhfn015510@svn.freebsd.org> <201210191118.42722.jhb@freebsd.org> Date: Sat, 20 Oct 2012 00:05:50 +0200 X-Google-Sender-Auth: HNP17diJK2Pht7S2jFmNteNpMyo Message-ID: Subject: Re: svn commit: r241737 - in head: bin/date bin/ed libexec/rtld-aout sbin/camcontrol sbin/geom/core usr.bin/at usr.bin/calendar usr.bin/chat usr.bin/ctlstat usr.bin/elfdump usr.bin/fetch usr.bin/finger... From: Ed Schouten To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:05:52 -0000 Hi John, 2012/10/19 John Baldwin : > The fw_* changes here probably wasn't the right way to fix this. The > variables should be static. The problem is that 'scan_firmware()' is > duplicated and should probably be reduced to a single copy. Good catch! Will fix! -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:07:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96BFE6E1; Fri, 19 Oct 2012 22:07:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4658FC0C; Fri, 19 Oct 2012 22:07:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JM7f7g086723; Fri, 19 Oct 2012 22:07:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JM7faf086717; Fri, 19 Oct 2012 22:07:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201210192207.q9JM7faf086717@svn.freebsd.org> From: Xin LI Date: Fri, 19 Oct 2012 22:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241753 - head/sys/dev/tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:07:41 -0000 Author: delphij Date: Fri Oct 19 22:07:40 2012 New Revision: 241753 URL: http://svn.freebsd.org/changeset/base/241753 Log: Integrate changes from LSI vendor driver 10.80.00.005 to FreeBSD. PR: kern/172833 Submitted by: "Charles O'Donnell" MFC after: 1 week Modified: head/sys/dev/tws/tws.c head/sys/dev/tws/tws.h head/sys/dev/tws/tws_cam.c head/sys/dev/tws/tws_hdm.h head/sys/dev/tws/tws_user.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Fri Oct 19 20:13:08 2012 (r241752) +++ head/sys/dev/tws/tws.c Fri Oct 19 22:07:40 2012 (r241753) @@ -405,6 +405,8 @@ tws_detach(device_t dev) free(sc->reqs, M_TWS); free(sc->sense_bufs, M_TWS); free(sc->scan_ccb, M_TWS); + if (sc->ioctl_data_mem) + bus_dmamem_free(sc->data_tag, sc->ioctl_data_mem, sc->ioctl_data_map); free(sc->aen_q.q, M_TWS); free(sc->trace_q.q, M_TWS); mtx_destroy(&sc->q_lock); @@ -609,6 +611,11 @@ tws_init(struct tws_softc *sc) TWS_TRACE_DEBUG(sc, "ccb malloc failed", 0, sc->is64bit); return(ENOMEM); } + if (bus_dmamem_alloc(sc->data_tag, (void **)&sc->ioctl_data_mem, + (BUS_DMA_NOWAIT | BUS_DMA_ZERO), &sc->ioctl_data_map)) { + device_printf(sc->tws_dev, "Cannot allocate ioctl data mem\n"); + return(ENOMEM); + } if ( !tws_ctlr_ready(sc) ) if( !tws_ctlr_reset(sc) ) Modified: head/sys/dev/tws/tws.h ============================================================================== --- head/sys/dev/tws/tws.h Fri Oct 19 20:13:08 2012 (r241752) +++ head/sys/dev/tws/tws.h Fri Oct 19 22:07:40 2012 (r241753) @@ -65,7 +65,7 @@ MALLOC_DECLARE(M_TWS); extern int tws_queue_depth; -#define TWS_DRIVER_VERSION_STRING "10.80.00.003" +#define TWS_DRIVER_VERSION_STRING "10.80.00.005" #define TWS_MAX_NUM_UNITS 65 #define TWS_MAX_NUM_LUNS 16 #define TWS_MAX_IRQS 2 @@ -247,7 +247,7 @@ struct tws_softc { struct mtx io_lock; /* IO lock */ struct tws_ioctl_lock ioctl_lock; /* ioctl lock */ u_int32_t seq_id; /* Sequence id */ - int chan; /* wait channel */ + void *chan; /* IOCTL req wait channel */ struct tws_circular_q aen_q; /* aen q */ struct tws_circular_q trace_q; /* trace q */ struct tws_stats stats; /* I/O stats */ @@ -260,6 +260,8 @@ struct tws_softc { void *dma_mem; /* pointer to dmable memory */ u_int64_t dma_mem_phys; /* phy addr */ bus_dma_tag_t data_tag; /* data DMA tag */ + void *ioctl_data_mem; /* ioctl dmable memory */ + bus_dmamap_t ioctl_data_map; /* ioctl data map */ struct tws_request *reqs; /* pointer to requests */ struct tws_sense *sense_bufs; /* pointer to sense buffers */ boolean obfl_q_overrun; /* OBFL overrun flag */ Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Fri Oct 19 20:13:08 2012 (r241752) +++ head/sys/dev/tws/tws_cam.c Fri Oct 19 22:07:40 2012 (r241753) @@ -970,6 +970,7 @@ tws_map_request(struct tws_softc *sc, st if (error == EINPROGRESS) { TWS_TRACE(sc, "in progress", 0, error); tws_freeze_simq(sc, req); + error = 0; // EINPROGRESS is not a fatal error. } } else { /* no data involved */ error = tws_submit_command(sc, req); @@ -989,6 +990,10 @@ tws_dmamap_data_load_cbfn(void *arg, bus struct tws_cmd_generic *gcmd; + if ( error ) { + TWS_TRACE(sc, "SOMETHING BAD HAPPENED! error = %d\n", error, 0); + } + if ( error == EFBIG ) { TWS_TRACE(sc, "not enough data segs", 0, nseg); req->error_code = error; @@ -1010,12 +1015,12 @@ tws_dmamap_data_load_cbfn(void *arg, bus gcmd = &req->cmd_pkt->cmd.pkt_g.generic; sgl_ptr = (u_int32_t *)(gcmd) + gcmd->size; gcmd->size += sgls * - ((req->sc->is64bit && !tws_use_32bit_sgls) ? 4 :2 ); + ((req->sc->is64bit && !tws_use_32bit_sgls) ? 4 : 2 ); tws_fill_sg_list(req->sc, (void *)segs, sgl_ptr, sgls); } else { tws_fill_sg_list(req->sc, (void *)segs, - (void *)req->cmd_pkt->cmd.pkt_a.sg_list, sgls); + (void *)&(req->cmd_pkt->cmd.pkt_a.sg_list), sgls); req->cmd_pkt->cmd.pkt_a.lun_h4__sgl_entries |= sgls ; } } @@ -1318,10 +1323,7 @@ tws_reinit(void *arg) tws_turn_on_interrupts(sc); - if ( sc->chan ) { - sc->chan = 0; - wakeup_one((void *)&sc->chan); - } + wakeup_one(sc->chan); } Modified: head/sys/dev/tws/tws_hdm.h ============================================================================== --- head/sys/dev/tws/tws_hdm.h Fri Oct 19 20:13:08 2012 (r241752) +++ head/sys/dev/tws/tws_hdm.h Fri Oct 19 22:07:40 2012 (r241753) @@ -174,7 +174,7 @@ enum tws_sense_severity { #define TWS_FW_CMD_INIT_CONNECTION 0x01 #define TWS_FW_CMD_EXECUTE_SCSI 0x10 -#define TWS_FW_CMD_ATA_PASSTHROUGH 0x11 +#define TWS_FW_CMD_ATA_PASSTHROUGH 0x11 // This is really a PASSTHROUGH for both ATA and SCSI commands. #define TWS_FW_CMD_GET_PARAM 0x12 #define TWS_FW_CMD_SET_PARAM 0x13 Modified: head/sys/dev/tws/tws_user.c ============================================================================== --- head/sys/dev/tws/tws_user.c Fri Oct 19 20:13:08 2012 (r241752) +++ head/sys/dev/tws/tws_user.c Fri Oct 19 22:07:40 2012 (r241753) @@ -94,41 +94,46 @@ tws_passthru(struct tws_softc *sc, void int error; u_int16_t lun4; + if ( tws_get_state(sc) != TWS_ONLINE) { return(EBUSY); } + //============================================================================================== + // Get a command + // do { req = tws_get_request(sc, TWS_REQ_TYPE_PASSTHRU); if ( !req ) { - sc->chan = 1; - error = tsleep((void *)&sc->chan, 0, - "tws_sleep", TWS_IOCTL_TIMEOUT*hz); + sc->chan = (void *)sc; + error = tsleep(sc->chan, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz); if ( error == EWOULDBLOCK ) { return(ETIMEDOUT); } } else { + // Make sure we are still ready for new commands... + if ( tws_get_state(sc) != TWS_ONLINE) { + return(EBUSY); + } break; } - }while(1); + } while(1); - req->length = ubuf->driver_pkt.buffer_length; + req->length = (ubuf->driver_pkt.buffer_length + 511) & ~511; TWS_TRACE_DEBUG(sc, "datal,rid", req->length, req->request_id); if ( req->length ) { - req->data = malloc(req->length, M_TWS, M_WAITOK | M_ZERO); - if ( !req->data ) { - TWS_TRACE_DEBUG(sc, "malloc failed", 0, req->request_id); - req->state = TWS_REQ_STATE_FREE; - ubuf->driver_pkt.os_status = ENOMEM; - if ( sc->chan ) { - sc->chan = 0; - wakeup_one((void *)&sc->chan); - } - return(ENOMEM); - } - bzero(req->data, req->length); + req->data = sc->ioctl_data_mem; + req->dma_map = sc->ioctl_data_map; + + //========================================================================================== + // Copy data in from user space + // error = copyin(ubuf->pdata, req->data, req->length); } + + //============================================================================================== + // Set command fields + // req->flags = TWS_DIR_IN | TWS_DIR_OUT; req->cb = tws_passthru_complete; @@ -141,16 +146,22 @@ tws_passthru(struct tws_softc *sc, void req->cmd_pkt->cmd.pkt_a.lun_l4__req_id = lun4 | req->request_id; } else { req->cmd_pkt->cmd.pkt_g.generic.request_id = (u_int8_t) req->request_id; - } + //============================================================================================== + // Send command to controller + // error = tws_map_request(sc, req); if (error) { ubuf->driver_pkt.os_status = error; - goto out; + goto out_data; + } + + if ( req->state == TWS_REQ_STATE_COMPLETE ) { + ubuf->driver_pkt.os_status = req->error_code; + goto out_unmap; } -//================================================================================================== mtx_lock(&sc->gen_lock); error = mtx_sleep(req, &sc->gen_lock, 0, "tws_passthru", TWS_IOCTL_TIMEOUT*hz); mtx_unlock(&sc->gen_lock); @@ -159,6 +170,7 @@ tws_passthru(struct tws_softc *sc, void tws_timeout((void*) req); } +out_unmap: if ( req->error_code == TWS_REQ_RET_RESET ) { error = EBUSY; req->error_code = EBUSY; @@ -167,15 +179,20 @@ tws_passthru(struct tws_softc *sc, void tws_unmap_request(sc, req); + //============================================================================================== + // Return command status to user space + // memcpy(&ubuf->cmd_pkt.hdr, &req->cmd_pkt->hdr, sizeof(struct tws_command_apache)); memcpy(&ubuf->cmd_pkt.cmd, &req->cmd_pkt->cmd, sizeof(struct tws_command_apache)); - if ( !error && req->length ) { - error = copyout(req->data, ubuf->pdata, req->length); - } -//================================================================================================== -out: - free(req->data, M_TWS); +out_data: + if ( req->length ) { + //========================================================================================== + // Copy data out to user space + // + if ( !error ) + error = copyout(req->data, ubuf->pdata, ubuf->driver_pkt.buffer_length); + } if ( error ) TWS_TRACE_DEBUG(sc, "errored", error, 0); @@ -183,12 +200,13 @@ out: if ( req->error_code != TWS_REQ_RET_SUBMIT_SUCCESS ) ubuf->driver_pkt.os_status = error; + //============================================================================================== + // Free command + // req->state = TWS_REQ_STATE_FREE; - if ( sc->chan && (tws_get_state(sc) == TWS_ONLINE) ) { - sc->chan = 0; - wakeup_one((void *)&sc->chan); - } + wakeup_one(sc->chan); + return(error); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:21:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B51CDA90; Fri, 19 Oct 2012 22:21:02 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9145B8FC08; Fri, 19 Oct 2012 22:21:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JML21s088826; Fri, 19 Oct 2012 22:21:02 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JML2Wg088821; Fri, 19 Oct 2012 22:21:02 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201210192221.q9JML2Wg088821@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 19 Oct 2012 22:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241754 - in head: contrib/mdocml etc/mtree lib/libmandoc usr.bin/mandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:21:02 -0000 Author: uqs Date: Fri Oct 19 22:21:01 2012 New Revision: 241754 URL: http://svn.freebsd.org/changeset/base/241754 Log: Merge mandoc from vendor into contrib and provide the necessary Makefile glue. It's not yet connected to the build. Added: head/contrib/mdocml/ - copied from r241675, vendor/mdocml/dist/ head/contrib/mdocml/config.h (contents, props changed) head/lib/libmandoc/ head/lib/libmandoc/Makefile (contents, props changed) head/usr.bin/mandoc/ head/usr.bin/mandoc/Makefile (contents, props changed) Deleted: head/contrib/mdocml/Makefile head/contrib/mdocml/TODO head/contrib/mdocml/apropos.1 head/contrib/mdocml/apropos.c head/contrib/mdocml/apropos_db.c head/contrib/mdocml/apropos_db.h head/contrib/mdocml/catman.8 head/contrib/mdocml/catman.c head/contrib/mdocml/cgi.c head/contrib/mdocml/config.h.post head/contrib/mdocml/config.h.pre head/contrib/mdocml/demandoc.1 head/contrib/mdocml/demandoc.c head/contrib/mdocml/index.css head/contrib/mdocml/index.sgml head/contrib/mdocml/man-cgi.css head/contrib/mdocml/man.cgi.7 head/contrib/mdocml/mandocdb.8 head/contrib/mdocml/mandocdb.c head/contrib/mdocml/mandocdb.h head/contrib/mdocml/manpath.c head/contrib/mdocml/manpath.h head/contrib/mdocml/preconv.1 head/contrib/mdocml/preconv.c head/contrib/mdocml/test-fgetln.c head/contrib/mdocml/test-getsubopt.c head/contrib/mdocml/test-mmap.c head/contrib/mdocml/test-strlcat.c head/contrib/mdocml/test-strlcpy.c head/contrib/mdocml/test-strptime.c head/contrib/mdocml/whatis.1 Modified: head/etc/mtree/BSD.usr.dist Added: head/contrib/mdocml/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/config.h Fri Oct 19 22:21:01 2012 (r241754) @@ -0,0 +1,58 @@ +#ifndef MANDOC_CONFIG_H +#define MANDOC_CONFIG_H + +#if defined(__linux__) || defined(__MINT__) +# define _GNU_SOURCE /* strptime(), getsubopt() */ +#endif + +#include + +#define HAVE_FGETLN +#define HAVE_STRPTIME +#define HAVE_GETSUBOPT +#define HAVE_STRLCAT +#define HAVE_MMAP +#define HAVE_STRLCPY + +#include + +#if !defined(__BEGIN_DECLS) +# ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# else +# define __BEGIN_DECLS +# endif +#endif +#if !defined(__END_DECLS) +# ifdef __cplusplus +# define __END_DECLS } +# else +# define __END_DECLS +# endif +#endif + +#if defined(__APPLE__) +# define htobe32(x) OSSwapHostToBigInt32(x) +# define betoh32(x) OSSwapBigToHostInt32(x) +# define htobe64(x) OSSwapHostToBigInt64(x) +# define betoh64(x) OSSwapBigToHostInt64(x) +#elif defined(__linux__) +# define betoh32(x) be32toh(x) +# define betoh64(x) be64toh(x) +#endif + +#ifndef HAVE_STRLCAT +extern size_t strlcat(char *, const char *, size_t); +#endif +#ifndef HAVE_STRLCPY +extern size_t strlcpy(char *, const char *, size_t); +#endif +#ifndef HAVE_GETSUBOPT +extern int getsubopt(char **, char * const *, char **); +extern char *suboptarg; +#endif +#ifndef HAVE_FGETLN +extern char *fgetln(FILE *, size_t *); +#endif + +#endif /* MANDOC_CONFIG_H */ Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri Oct 19 22:07:40 2012 (r241753) +++ head/etc/mtree/BSD.usr.dist Fri Oct 19 22:21:01 2012 (r241754) @@ -944,6 +944,8 @@ man9 .. .. + mdocml + .. misc fonts .. Added: head/lib/libmandoc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libmandoc/Makefile Fri Oct 19 22:21:01 2012 (r241754) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml +.PATH: ${MDOCMLDIR} + +LIB= mandoc +#NO_PIC= +INTERNALLIB= +MAN= mandoc.3 +SRCS= arch.c att.c chars.c \ + compat_fgetln.c compat_getsubopt.c compat_strlcat.c compat_strlcpy.c \ + eqn.c lib.c man.c man_hash.c man_macro.c man_validate.c mandoc.c \ + mdoc.c mdoc_argv.c mdoc_hash.c mdoc_macro.c mdoc_validate.c \ + msec.c read.c roff.c st.c \ + tbl.c tbl_data.c tbl_layout.c tbl_opts.c vol.c + +WARNS?= 3 +CFLAGS+= -DHAVE_CONFIG_H -DVERSION="\"1.12.1\"" + +.include Added: head/usr.bin/mandoc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mandoc/Makefile Fri Oct 19 22:21:01 2012 (r241754) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml +LIBMANDOC= ${.OBJDIR}/../../lib/libmandoc/libmandoc.a +.PATH: ${MDOCMLDIR} + +PROG= mandoc +FILES= example.style.css external.png style.css +FILESDIR= ${SHAREDIR}/mdocml +LINKS= mdocml +MAN= mandoc.1 eqn.7 mandoc_char.7 tbl.7 # man.7 mdoc.7 roff.7 +MLINKS= mandoc.1 mdocml.1 +SRCS= eqn_html.c eqn_term.c html.c main.c man_html.c man_term.c mdoc_html.c \ + mdoc_man.c mdoc_term.c out.c tbl_html.c tbl_term.c term.c \ + term_ascii.c term_ps.c tree.c + +WARNS?= 3 +CFLAGS+= -DHAVE_CONFIG_H -DVERSION="\"1.12.1\"" +DPADD= ${LIBMANDOC} +LDADD= ${LIBMANDOC} + +.include From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:43:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFC83FB9; Fri, 19 Oct 2012 22:43:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id A6AD28FC12; Fri, 19 Oct 2012 22:43:11 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:0:100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 6544123F645; Fri, 19 Oct 2012 18:43:08 -0400 (EDT) Date: Fri, 19 Oct 2012 18:43:05 -0400 From: Glen Barber To: Ulrich Spoerlein Subject: Re: svn commit: r241754 - in head: contrib/mdocml etc/mtree lib/libmandoc usr.bin/mandoc Message-ID: <20121019224305.GN1393@glenbarber.us> References: <201210192221.q9JML2Wg088821@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4KXkm8CArhzjwJ+m" Content-Disposition: inline In-Reply-To: <201210192221.q9JML2Wg088821@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:43:12 -0000 --4KXkm8CArhzjwJ+m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 19, 2012 at 10:21:02PM +0000, Ulrich Spoerlein wrote: > Author: uqs > Date: Fri Oct 19 22:21:01 2012 > New Revision: 241754 > URL: http://svn.freebsd.org/changeset/base/241754 >=20 > Log: > Merge mandoc from vendor into contrib and provide the necessary Makefil= e glue. > =20 This is fantastic! Thank you! Glen --4KXkm8CArhzjwJ+m Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQgdd5AAoJEFJPDDeguUaj+2MH/RvZ6u2BDdKNnz9n2qt7bSj4 +fzeM3wkXZOLul5pItobLeqCxtQAgKkIG1E8QCXqh+/8NeXjAOIyDb8CHv7eCh+U p2cnogt6Er9yXWGn/AqyPC522ObNEZOSXqyoSkJ89t5HBooyO3gz/JmKtsldR16S Ez67nYNLA0qWCm4zvMrcB3UhyZYF/rqTfRzyu6NrqUUCqRJeUaSI/81olFRGQEva +yptMeCQzIFrzwKdRpJWSKS/y9PKaHvidPGJVxjMgQZGKeATYT+2Ydr7A+Qo0snO /z185YXcoVHQd5V3iYb9fcxAPpm3f6q1dTweZqtiLneccLtfjbOqXuBGTx7Dbas= =P31g -----END PGP SIGNATURE----- --4KXkm8CArhzjwJ+m-- From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:46:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD9D72C5; Fri, 19 Oct 2012 22:46:48 +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 AC2718FC08; Fri, 19 Oct 2012 22:46:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JMkmZx092931; Fri, 19 Oct 2012 22:46:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JMkm4R092929; Fri, 19 Oct 2012 22:46:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201210192246.q9JMkm4R092929@svn.freebsd.org> From: Warner Losh Date: Fri, 19 Oct 2012 22:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241755 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:46:48 -0000 Author: imp Date: Fri Oct 19 22:46:48 2012 New Revision: 241755 URL: http://svn.freebsd.org/changeset/base/241755 Log: Document the methods used to compute logf. Taken and edited from the double version, with adaptations for the differences between it and the float version. Modified: head/lib/msun/src/e_logf.c Modified: head/lib/msun/src/e_logf.c ============================================================================== --- head/lib/msun/src/e_logf.c Fri Oct 19 22:21:01 2012 (r241754) +++ head/lib/msun/src/e_logf.c Fri Oct 19 22:46:48 2012 (r241755) @@ -19,6 +19,57 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" +/* __ieee754_log(x) + * Return the logrithm of x + * + * Method : + * 1. Argument Reduction: find k and f such that + * x = 2^k * (1+f), + * where sqrt(2)/2 < 1+f < sqrt(2) . + * + * 2. Approximation of log(1+f). + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., + * = 2s + s*R + * We use a special Reme algorithm on [0,0.1716] to generate + * a polynomial of degree 8 to approximate R The maximum error + * of this polynomial approximation is bounded by 2**-34.24. In + * other words, + * 2 4 6 8 + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s + * (the values of Lg1 to Lg7 are listed in the program) + * and + * | 2 8 | -34.24 + * | Lg1*s +...+Lg4*s - R(z) | <= 2 + * | | + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. + * In order to guarantee error in log below 1ulp, we compute log + * by + * log(1+f) = f - s*(f - R) (if f is not too large) + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) + * + * 3. Finally, log(x) = k*ln2 + log(1+f). + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) + * Here ln2 is split into two floating point number: + * ln2_hi + ln2_lo, + * where n*ln2_hi is always exact for |n| < 2000. + * + * Special cases: + * log(x) is NaN with signal if x < 0 (including -INF) ; + * log(+INF) is +INF; log(0) is -INF with signal; + * log(NaN) is that NaN with no signal. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + static const float ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:47:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DD69430; Fri, 19 Oct 2012 22:47:45 +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 3CF788FC08; Fri, 19 Oct 2012 22:47:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JMlj1O093100; Fri, 19 Oct 2012 22:47:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JMljL4093098; Fri, 19 Oct 2012 22:47:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201210192247.q9JMljL4093098@svn.freebsd.org> From: Warner Losh Date: Fri, 19 Oct 2012 22:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241756 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:47:45 -0000 Author: imp Date: Fri Oct 19 22:47:44 2012 New Revision: 241756 URL: http://svn.freebsd.org/changeset/base/241756 Log: Document the method used to compute expf. Taken from exp, with changes to reflect differences in computation between the two. Modified: head/lib/msun/src/e_expf.c Modified: head/lib/msun/src/e_expf.c ============================================================================== --- head/lib/msun/src/e_expf.c Fri Oct 19 22:46:48 2012 (r241755) +++ head/lib/msun/src/e_expf.c Fri Oct 19 22:47:44 2012 (r241756) @@ -21,6 +21,68 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" +/* __ieee754_expf + * Returns the exponential of x. + * + * Method + * 1. Argument reduction: + * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658. + * Given x, find r and integer k such that + * + * x = k*ln2 + r, |r| <= 0.5*ln2. + * + * Here r will be represented as r = hi-lo for better + * accuracy. + * + * 2. Approximation of exp(r) by a special rational function on + * the interval [0,0.34658]: + * Write + * R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ... + * We use a special Remes algorithm on [0,0.34658] to generate + * a polynomial of degree 2 to approximate R. The maximum error + * of this polynomial approximation is bounded by 2**-27. In + * other words, + * R(z) ~ 2.0 + P1*z + P2*z*z + * (where z=r*r, and the values of P1 and P2 are listed below) + * and + * | 2 | -27 + * | 2.0+P1*z+P2*z - R(z) | <= 2 + * | | + * The computation of expf(r) thus becomes + * 2*r + * expf(r) = 1 + ------- + * R - r + * r*R1(r) + * = 1 + r + ----------- (for better accuracy) + * 2 - R1(r) + * where + * 2 4 + * R1(r) = r - (P1*r + P2*r) + * + * 3. Scale back to obtain expf(x): + * From step 1, we have + * expf(x) = 2^k * expf(r) + * + * Special cases: + * expf(INF) is INF, exp(NaN) is NaN; + * expf(-INF) is 0, and + * for finite argument, only exp(0)=1 is exact. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 0.5013 ulp (unit in the last place). + * + * Misc. info. + * For IEEE float + * if x > 8.8721679688e+01 then exp(x) overflow + * if x < -1.0397208405e+02 then exp(x) underflow + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ static const float one = 1.0, halF[2] = {0.5,-0.5,}, From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 22:48:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA19759B; Fri, 19 Oct 2012 22:48:22 +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 B249B8FC08; Fri, 19 Oct 2012 22:48:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JMmMxk093236; Fri, 19 Oct 2012 22:48:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JMmMpt093234; Fri, 19 Oct 2012 22:48:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201210192248.q9JMmMpt093234@svn.freebsd.org> From: Warner Losh Date: Fri, 19 Oct 2012 22:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241757 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 22:48:22 -0000 Author: imp Date: Fri Oct 19 22:48:22 2012 New Revision: 241757 URL: http://svn.freebsd.org/changeset/base/241757 Log: Indent ecaps the same way we indent caps. MFC after: 3 days Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Oct 19 22:47:44 2012 (r241756) +++ head/usr.sbin/pciconf/cap.c Fri Oct 19 22:48:22 2012 (r241757) @@ -660,7 +660,7 @@ list_ecaps(int fd, struct pci_conf *p) if (ecap == 0xffffffff || ecap == 0) return; for (;;) { - printf("ecap %04x[%03x] = ", PCI_EXTCAP_ID(ecap), ptr); + printf(" ecap %04x[%03x] = ", PCI_EXTCAP_ID(ecap), ptr); switch (PCI_EXTCAP_ID(ecap)) { case PCIZ_AER: ecap_aer(fd, p, ptr, PCI_EXTCAP_VER(ecap)); From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 23:10:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37809AD1; Fri, 19 Oct 2012 23:10:56 +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 06E3B8FC08; Fri, 19 Oct 2012 23:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JNAtr0096896; Fri, 19 Oct 2012 23:10:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JNAt7n096894; Fri, 19 Oct 2012 23:10:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201210192310.q9JNAt7n096894@svn.freebsd.org> From: Warner Losh Date: Fri, 19 Oct 2012 23:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241758 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 23:10:56 -0000 Author: imp Date: Fri Oct 19 23:10:55 2012 New Revision: 241758 URL: http://svn.freebsd.org/changeset/base/241758 Log: Add missing Extended Capability ID Numbers from PCIe 3.0. Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Fri Oct 19 22:48:22 2012 (r241757) +++ head/sys/dev/pci/pcireg.h Fri Oct 19 23:10:55 2012 (r241758) @@ -132,25 +132,35 @@ /* Extended Capability Identification Numbers */ #define PCIZ_AER 0x0001 /* Advanced Error Reporting */ -#define PCIZ_VC 0x0002 /* Virtual Channel */ +#define PCIZ_VC 0x0002 /* Virtual Channel if MFVC Ext Cap not set */ #define PCIZ_SERNUM 0x0003 /* Device Serial Number */ #define PCIZ_PWRBDGT 0x0004 /* Power Budgeting */ #define PCIZ_RCLINK_DCL 0x0005 /* Root Complex Link Declaration */ #define PCIZ_RCLINK_CTL 0x0006 /* Root Complex Internal Link Control */ #define PCIZ_RCEC_ASSOC 0x0007 /* Root Complex Event Collector Association */ #define PCIZ_MFVC 0x0008 /* Multi-Function Virtual Channel */ +#define PCIZ_VC2 0x0009 /* Virtual Channel if MFVC Ext Cap set */ #define PCIZ_RCRB 0x000a /* RCRB Header */ #define PCIZ_VENDOR 0x000b /* Vendor Unique */ +#define PCIZ_CAC 0x000c /* Configuration Access Correction -- obsolete */ #define PCIZ_ACS 0x000d /* Access Control Services */ #define PCIZ_ARI 0x000e /* Alternative Routing-ID Interpretation */ #define PCIZ_ATS 0x000f /* Address Translation Services */ #define PCIZ_SRIOV 0x0010 /* Single Root IO Virtualization */ +#define PCIZ_MRIOV 0x0011 /* Multiple Root IO Virtualization */ #define PCIZ_MULTICAST 0x0012 /* Multicast */ +#define PCIZ_PAGE_REQ 0x0013 /* Page Request */ +#define PCIZ_AMD 0x0014 /* Reserved for AMD */ #define PCIZ_RESIZE_BAR 0x0015 /* Resizable BAR */ #define PCIZ_DPA 0x0016 /* Dynamic Power Allocation */ #define PCIZ_TPH_REQ 0x0017 /* TPH Requester */ #define PCIZ_LTR 0x0018 /* Latency Tolerance Reporting */ #define PCIZ_SEC_PCIE 0x0019 /* Secondary PCI Express */ +#define PCIZ_PMUX 0x001a /* Protocol Multiplexing */ +#define PCIZ_PASID 0x001b /* Process Address Space ID */ +#define PCIZ_LN_REQ 0x001c /* LN Requester */ +#define PCIZ_DPC 0x001d /* Downstream Porto Containment */ +#define PCIZ_L1PM 0x001e /* L1 PM Substates */ /* config registers for header type 0 devices */ @@ -183,7 +193,7 @@ #define PCIM_CIS_ASI_ROM 7 #define PCIM_CIS_ADDR_MASK 0x0ffffff8 #define PCIM_CIS_ROM_MASK 0xf0000000 -#define PCIM_CIS_CONFIG_MASK 0xff +#define PCIM_CIS_CONFIG_MASK 0xff #define PCIR_SUBVEND_0 0x2c #define PCIR_SUBDEV_0 0x2e #define PCIR_BIOS 0x30 From owner-svn-src-head@FreeBSD.ORG Fri Oct 19 23:42:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3692F23; Fri, 19 Oct 2012 23:42:45 +0000 (UTC) (envelope-from jwd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABFD28FC12; Fri, 19 Oct 2012 23:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9JNgjaC001684; Fri, 19 Oct 2012 23:42:45 GMT (envelope-from jwd@svn.freebsd.org) Received: (from jwd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9JNgjVH001681; Fri, 19 Oct 2012 23:42:45 GMT (envelope-from jwd@svn.freebsd.org) Message-Id: <201210192342.q9JNgjVH001681@svn.freebsd.org> From: "John W. De Boskey" Date: Fri, 19 Oct 2012 23:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241759 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 23:42:45 -0000 Author: jwd Date: Fri Oct 19 23:42:45 2012 New Revision: 241759 URL: http://svn.freebsd.org/changeset/base/241759 Log: Don't lose the 255'th disk behind the initiator. Reviewed by: ken@ MFC after: 1 month Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Oct 19 23:10:55 2012 (r241758) +++ head/sys/dev/mps/mps_sas.c Fri Oct 19 23:42:45 2012 (r241759) @@ -918,7 +918,7 @@ mpssas_action(struct cam_sim *sim, union cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; cpi->max_lun = 255; - cpi->initiator_id = 255; + cpi->initiator_id = sassc->sc->facts->MaxTargets - 1; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 05:43:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C14E58B; Sat, 20 Oct 2012 05:43:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id 24F498FC08; Sat, 20 Oct 2012 05:43:18 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9K5h6C9027918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Oct 2012 16:43:09 +1100 Date: Sat, 20 Oct 2012 16:43:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r241755 - head/lib/msun/src In-Reply-To: <201210192246.q9JMkm4R092929@svn.freebsd.org> Message-ID: <20121020150917.I1095@besplex.bde.org> References: <201210192246.q9JMkm4R092929@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=eLtLFwV1 c=1 sm=1 a=xI64QrV9ptIA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Aet6fyW9sl8A:10 a=cvw0RnjcknDQsnrTvV4A:9 a=CjuIK1q_8ugA:10 a=V4IsmBEFW7KwAuKY:21 a=eyMMwmjJ-5K38dzR:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 05:43:20 -0000 On Fri, 19 Oct 2012, Warner Losh wrote: > Log: > Document the methods used to compute logf. Taken and edited from the > double version, with adaptations for the differences between it and > the float version. Please back this out. This was intentionally left out. It is painful to maintain large comments that should be identical for all precisions. Double precision is primary, and only comments that depend on the precision should be given in other precisions, except for short comments to to right of coulde whose non-duplication would just give larger diffs. If you want to duplicate them, then they would often have to be quadruplicated in 4 files for the 4 supported precisions: - double precision - float precision - long double with MANT_DIG = 64 and 16 other bits - long double with MANT_DIG = 113 and 15 other bits Only 4 now, but there could easily be variations for long doubles. log* will be replaced by my version soon. One of the organizational things that I'm currently struggling with is how not to duplicate the comments in them. Currently I duplicate then in 4 files, and don't quite duplicate then in a 5th file for optimized float precision. Maintaining them has been very painful. They are about 3 times as large as the comments here, and have more and more-delicate precision-dependent details, so trimming them is harder than here. They do cover all of log*(), log1p*(), log2*() and log10*() in the same file, so there is not as much duplication as for the different e_log*.c files. Another organizational problem is how to organize the functions. I currently have 4 primary interfaces per file (should have a couple more for kernels), and 1 file for each precision, and currently use inlines and ifdefs to avoid these inlines, but the inlines are not properly optimized for all cases of interest, and break debugging in most cases, so I plan to switch to more macro hackery (like multiple #include __FILE__'s with ifdefs to select what is compiled for each #include) . Even more macro hackery would let me put support for all precisions in the same files, so duplicated comments would be even less useful, but the precision-dependent ones would be even harder to write and read. We are developing inverse trig functions, and handle the comments and other things by generating code for all precisions from the double precision case. Large comments are stripped as part of the generation. This is easier to write but not so good to read. This is only feasible because the code is not very precision-dependent. > Modified: head/lib/msun/src/e_logf.c > ============================================================================== > --- head/lib/msun/src/e_logf.c Fri Oct 19 22:21:01 2012 (r241754) > +++ head/lib/msun/src/e_logf.c Fri Oct 19 22:46:48 2012 (r241755) > @@ -19,6 +19,57 @@ __FBSDID("$FreeBSD$"); > #include "math.h" > #include "math_private.h" > > +/* __ieee754_log(x) Here the comment doesn't even match the code. This is __ieee754_logf(x), not __ieee754_log(). Technically, this is a comment that depends on the precision, so it should be given separately, but the differences for type suffixes are especially painful to maintain in comments and especially useless to document in comments. > + * Return the logrithm of x This duplicates e_log.c to a fault. Fixing this spelling error would require touching multiple files. > + * > + * Method : > + * 1. Argument Reduction: find k and f such that > + * x = 2^k * (1+f), > + * where sqrt(2)/2 < 1+f < sqrt(2) . > + * > + * 2. Approximation of log(1+f). > + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) > + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., > + * = 2s + s*R Nothing new here. I don't want to see it again. > + * We use a special Reme algorithm on [0,0.1716] to generate > + * a polynomial of degree 8 to approximate R The maximum error > + * of this polynomial approximation is bounded by 2**-34.24. In > + * other words, Lots more spelling and grammar errors. I'm not sure if the correct spelling is Remez or Remes, but I'm sure it isn't Reme. One sentence break is missing a "." and the others are consistently too short. The 2**-34.24 number is precision-dependent and is documented in more completely below using my automatically generated comment that gives a consistent format. (I haven't merged this improvement back into e_log.c.) Now there is duplication even within the same file :-(. > + * 2 4 6 8 > + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s The number of coeffs is indeed precision-dependent, but uninteresting. My constent format for poly coeffs doesn't mention them in comments. It is enough to spell the constants for them in a consistent way (consistent across all sources, not just log*). > + * (the values of Lg1 to Lg7 are listed in the program) Here the comment doesn't even match the code. There is no Lg5 to Lg7 for float precision. > + * and > + * | 2 8 | -34.24 > + * | Lg1*s +...+Lg4*s - R(z) | <= 2 > + * | | Another excessively verbose comment duplicated. It has the magic number -34.24 again, so this number is now triplicated. > + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. > + * In order to guarantee error in log below 1ulp, we compute log > + * by > + * log(1+f) = f - s*(f - R) (if f is not too large) > + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) > + * > + * 3. Finally, log(x) = k*ln2 + log(1+f). > + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) > + * Here ln2 is split into two floating point number: > + * ln2_hi + ln2_lo, Nothing new here. I don't want to see it again. > + * where n*ln2_hi is always exact for |n| < 2000. Now just wrong. 2000 is for double precision. 2048 would be better there. It is what we arrange for, to go slightly above 1024.) Here we need to go slightly above 128, and arrange for < 256. This is one of the points documented better in my log*. Its documentation belongs closer to the declaration of ln2_hi where you can see the bits being left out of it. But my comments for this grew too large. They describe complications like using the same splitting for double precision as for long double precision (go slightly above 16384 instead of slightly abive 1024, at an insignificant cost of precision), and sharing ln2_hi/lo with a table value where even more bits sometimes have to be left out of ln2_hi, depending on complicated options and the precision. They described the details of why the number of bits chosen is needed, and gave the acceptable ranges but have been reduced a bit closer to saying something like "ln2_hi is rounded to a number of bits that works [to satisfy constraints explained elsewhere". > + * > + * Special cases: > + * log(x) is NaN with signal if x < 0 (including -INF) ; > + * log(+INF) is +INF; log(0) is -INF with signal; > + * log(NaN) is that NaN with no signal. Nothing new here. I don't want to see it again. > + * > + * Accuracy: > + * according to an error analysis, the error is always less than > + * 1 ulp (unit in the last place). Actually, expf() has been exhaustively tested, so its error is known much more precisely than the error analysis can give. The details are too MD and unimportant to give here. e_log.c is not the place to describe what an ulp is. Garbage should be removed before duplicating things. > + * > + * Constants: > + * The hexadecimal values are the intended ones for the following > + * constants. The decimal values may be used, provided that the > + * compiler will convert from decimal to binary accurately enough > + * to produce the hexadecimal values shown. > + */ More non-useful boilerplate. This comment is FUD about pre-C90 compilers, since compilers couldn't be trusted to round correctly long ago. After C99, we could use hex constants to reduce rounding problems, but I don't want to churn the sources for this, and prefer decimal constants in most cases, with hex values in comments (mainly for debugging -- hex constants tend to be more usefull iff you are looking at hex values in a register). > + > static const float > ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ > ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ > This still uses fdlibm's old format in which the hex values are given as pseudo-literals in hex in comments. The couldn't use C99 hex literals because C99 didn't exist. They are more readable in this form, since C99 hex literals handle exponents poorly, so it is hard to see what they are in bits and you just can't express the special cases where hex is most needed (Infs and NaNs) as C99 hex literals. But when I optimized and otherwise improved the LgN* contants, I had not settled on a format and didn't even translate to the above format like I did in some other places, so my LgN* declarations are of the form '; /* */'. I was also sloppy with the -34.24 constant when I did that. It seems to be rounded in the wrong direction. I now get -34.22 (rounded to nearest) and round it in a safe direction to -34.2. Note that this constant doesn't quite allow the accuracy in the poly to be read off as 34.2 bits. It is scaled relative to s, but the accuracy in bits should be scaled relative to |log(1+s)-log(1-s)| rounded down to a power of 2. This is ~2*s. Normally for such estimates, scaling by s is off by a factor of at most 2 so we can read off an accuracy of 33.2 bits, but here the factor of 2 in 2*s means that we can read off an accuracy of 33.2 +- 1 bits. Anyway, the -34.24 has lots of spare bits, so its minor inaccuracies don't matter and can be be found by exhaustive checking. But it is strictly wrong when its value is given in constants. e_log.c gives the related bound of 2**-58.45. This is scaled by s, so it takes minor interpretation too. It seems to be correctly rounded. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 07:18:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C17926D4; Sat, 20 Oct 2012 07:18:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id DEE238FC12; Sat, 20 Oct 2012 07:18:33 +0000 (UTC) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9K7BjlW015608; Sat, 20 Oct 2012 18:11:45 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9K7BZSx028185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Oct 2012 18:11:36 +1100 Date: Sat, 20 Oct 2012 18:11:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r241756 - head/lib/msun/src In-Reply-To: <201210192247.q9JMljL4093098@svn.freebsd.org> Message-ID: <20121020164315.Q1095@besplex.bde.org> References: <201210192247.q9JMljL4093098@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=fLlhRume c=1 sm=1 a=hNMMERRCccEA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Aet6fyW9sl8A:10 a=cYv7yatJ9UkkMbrVvNAA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 07:18:34 -0000 On Fri, 19 Oct 2012, Warner Losh wrote: > Log: > Document the method used to compute expf. Taken from exp, with > changes to reflect differences in computation between the two. Please back this out, as for logf. We are a bit further from replacing fdlibm exp* by better versions than for log*(). We have a better expl() that is faster and much more accuract than exp() and almost faster than expf(), but lower-precision of our expl() implementation are incomplete. > Modified: head/lib/msun/src/e_expf.c > ============================================================================== > --- head/lib/msun/src/e_expf.c Fri Oct 19 22:46:48 2012 (r241755) > +++ head/lib/msun/src/e_expf.c Fri Oct 19 22:47:44 2012 (r241756) > @@ -21,6 +21,68 @@ __FBSDID("$FreeBSD$"); > #include "math.h" > #include "math_private.h" > > +/* __ieee754_expf Here the comment matches the code, unlike for logf. > + * Returns the exponential of x. Banal comment which does less than echo the code. The function name tells us that it returns the exponential of x in float precision. > ... > + * 2. Approximation of exp(r) by a special rational function on > + * the interval [0,0.34658]: > + * Write > + * R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ... > + * We use a special Remes algorithm on [0,0.34658] to generate > + * a polynomial of degree 2 to approximate R. The maximum error > + * of this polynomial approximation is bounded by 2**-27. In > + * other words, The last 3 sentences are missing the spelling and punctuation errors in log*. The magic 2**-27 is better decomented as 2**-27.74 in my changes, except possibly for the rounding. > + * R(z) ~ 2.0 + P1*z + P2*z*z > + * (where z=r*r, and the values of P1 and P2 are listed below) > + * and > + * | 2 | -27 > + * | 2.0+P1*z+P2*z - R(z) | <= 2 > + * | | -27 duplicated again. This part of the approximation is routine and shouldn't be documented using verbose pretty-printing. > + * The computation of expf(r) thus becomes > + * 2*r > + * expf(r) = 1 + ------- > + * R - r > + * r*R1(r) > + * = 1 + r + ----------- (for better accuracy) > + * 2 - R1(r) > + * where > + * 2 4 > + * R1(r) = r - (P1*r + P2*r) This part is not routine, so it is good to verbosely pretty-print it. But only once. > + * Accuracy: > + * according to an error analysis, the error is always less than > + * 0.5013 ulp (unit in the last place). Just wrong. An error of 2**-27 can't possibly get close to 0.5013. It gives a theoretical error of at least 0.5 + 2**(-27 - -24) = 0.625. We intentional don't try form more since the algorithm has even larger fundamental errors elsewhere. 2**-27 wouldn't be good enough if we couldn't do exhaustive testing to check that the other errors really do dominate. Exhaustive testing shows the following errors: - i386 (old version with gcc -O): 0.5092 - i386 (cur version with clang): <0.5092 - i386 (cur version with gcc -O): 0.5807 - i386 (cur version with clang): <0.5807 - i386 (with gcc -O0 and/or -ffloat-store): larger, much like amd64 - amd64 (al versions): 0.9101 With amd64 or -O0, we just get the larger errors elsewhere. With the old version, the errors were smaller due to a bug that normally gave extra precision accidentally, but which could just give wrong results in theory, so I fixed it. The fix unfortunately lost some of the accidental extra precision. The bug showed up as clang giving different accidental extra precision. It still gives some, but not as much as before. The sources could be modified to the more than the accidental extra precision non-accidentally by using float_t in float precision and double_t plus FP_PE rounding precision in double precision. This requires care with types mainly at the place where non-accidental extra precision gives bugs unless handled carefully. Otherwise, the changes are simply s/float/float_t/ for local variables, etc. plus fixing float_t for clang... > + * > + * Misc. info. > + * For IEEE float > + * if x > 8.8721679688e+01 then exp(x) overflow > + * if x < -1.0397208405e+02 then exp(x) underflow These constants are better documented in the code that declares them as o_threshold and u_threshold. This gives the values, so the values shouldn't be repeated here. There are perhaps not quite enough comments attached to the code. In s_expl.c, there are larger comments giving the expressions for calculating these constants. But the trickiest details for using these constants are not commented on at all. For efficiency, classification involves a mixture of fuzzy classification using bits and precise classification using these constants > + * > + * Constants: > + * The hexadecimal values are the intended ones for the following > + * constants. The decimal values may be used, provided that the > + * compiler will convert from decimal to binary accurately enough > + * to produce the hexadecimal values shown. > + */ Boilerplate FUD for pre-C90 duplicated ad nauseum more than before. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 07:32:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D49CDA81; Sat, 20 Oct 2012 07:32:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id DA70E8FC0A; Sat, 20 Oct 2012 07:32:24 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9K7WEfu001705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Oct 2012 18:32:15 +1100 Date: Sat, 20 Oct 2012 18:32:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r241755 - head/lib/msun/src In-Reply-To: <20121020150917.I1095@besplex.bde.org> Message-ID: <20121020181443.X1561@besplex.bde.org> References: <201210192246.q9JMkm4R092929@svn.freebsd.org> <20121020150917.I1095@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=eLtLFwV1 c=1 sm=1 a=xI64QrV9ptIA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Aet6fyW9sl8A:10 a=tlCQwBxB1yNg7U1qZQkA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 07:32:26 -0000 On Sat, 20 Oct 2012, Bruce Evans wrote: > On Fri, 19 Oct 2012, Warner Losh wrote: > >> Log: >> Document the methods used to compute logf. Taken and edited from the >> double version, with adaptations for the differences between it and >> the float version. > > Please back this out. > > This was intentionally left out. It is painful to maintain large > comments that should be identical for all precisions. Double precision > is primary, and only comments that depend on the precision should be > given in other precisions, except for short comments to to right of > coulde whose non-duplication would just give larger diffs. If you > want to duplicate them, then they would often have to be quadruplicated > in 4 files for the 4 supported precisions: > - double precision > - float precision > - long double with MANT_DIG = 64 and 16 other bits > - long double with MANT_DIG = 113 and 15 other bits > Only 4 now, but there could easily be variations for long doubles. PS: in long double trig functions, I handle this carefully by giving references to the file containing the main description of the algorithm. Old Cygnus float functions are no so careful, and I didn't want to churn them for this. Example from k_cosl.c: % #include % __FBSDID("$FreeBSD: src/lib/msun/ld80/k_cosl.c,v 1.1 2008/02/17 07:32:14 das Exp $"); % % /* % * ld80 version of k_cos.c. See ../src/k_cos.c for most comments. % */ Most details are here. They are described in the same style as the e_log.c comments that you duplicated. Here they are in the kernel instead of in the main file. Another problem is that they really do belong in the kernel, but are harder to read there. We already have kernels for log and logf (k_log.h and k_logf.c). These unfortunately have to duplicate the code, but they are careful to not duplicate comments and carefully point to the main file for the comments. The kernels are only used for log10*() and log2*(), so strictly whatever the kernels do doesn't affect log() and logf(). You didn't duplicate the comments into these files. If you did, there would already be 4 or 6 copies of them without even long double precision: - e_log.c, e_logf.c - k_log.h, k_logf.c - e_log10.c, e_log10f.c, e_log2.c, e_log2f.c (if we don't use kernels and/or don't put the comments in the kernels). % % #include "math_private.h" % % /* % * Domain [-0.7854, 0.7854], range ~[-2.43e-23, 2.425e-23]: % * |cos(x) - c(x)| < 2**-75.1 % * % * The coefficients of c(x) were generated by a pari-gp script using % * a Remez algorithm that searches for the best higher coefficients % * after rounding leading coefficients to a specified precision. This documents some precision-dependent details too verbosely. It goes without saying that we generate minimax polynomials by some method. If we want to document the method(s), then it should be once per method and not placed in the source files whose polynomials happened to be generated using the methods. % * % * Simpler methods like Chebyshev or basic Remez barely suffice for % * cos() in 64-bit precision, because we want the coefficient of x^2 % * to be precisely -0.5 so that multiplying by it is exact, and plain % * rounding of the coefficients of a good polynomial approximation only % * gives this up to about 64-bit precision. Plain rounding also gives % * a mediocre approximation for the coefficient of x^4, but a rounding % * error of 0.5 ulps for this coefficient would only contribute ~0.01 % * ulps to the final error, so this is unimportant. Rounding errors in % * higher coefficients are even less important. % * % * In fact, coefficients above the x^4 one only need to have 53-bit % * precision, and this is more efficient. We get this optimization % * almost for free from the complications needed to search for the best % * higher coefficients. % */ This documents in excessive detail the limits of some methods. When it was written, I didn't know the limits very well. This is essentially a way of saying "don't document your methods here, else it would expand to be as verbose as this comment, if not to a book. I don't want to read this book in every source file". Bruce From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 08:06:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88D4C811; Sat, 20 Oct 2012 08:06:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B20F8FC0A; Sat, 20 Oct 2012 08:06:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9K86WVo083420; Sat, 20 Oct 2012 08:06:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9K86WCq083418; Sat, 20 Oct 2012 08:06:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201210200806.q9K86WCq083418@svn.freebsd.org> From: Kevin Lo Date: Sat, 20 Oct 2012 08:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241765 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 08:06:32 -0000 Author: kevlo Date: Sat Oct 20 08:06:31 2012 New Revision: 241765 URL: http://svn.freebsd.org/changeset/base/241765 Log: - KTR_ENTRIES may be an arbitrary number, remove the sentence about power of two. - Mention the run time mask is set to block any tracing by default. Reviewed by: jhb Modified: head/share/man/man4/ktr.4 Modified: head/share/man/man4/ktr.4 ============================================================================== --- head/share/man/man4/ktr.4 Sat Oct 20 07:39:47 2012 (r241764) +++ head/share/man/man4/ktr.4 Sat Oct 20 08:06:31 2012 (r241765) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2005 +.Dd October 19, 2012 .Dt KTR 4 .Os .Sh NAME @@ -52,7 +52,6 @@ is The .Dv KTR_ENTRIES option sets the size of the buffer of events. -It must be a power of two. The size of the buffer in the currently running kernel can be found via the read-only sysctl .Va debug.ktr.entries . @@ -78,9 +77,7 @@ environment variable. It can also be examined and set after booting via the .Va debug.ktr.mask sysctl. -By default the run time mask is set to log only -.Dv KTR_GEN -events. +By default the run time mask is set to block any tracing. The definitions of the event mask bits can be found in .In sys/ktr.h . .Pp From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 09:40:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B60D8B4; Sat, 20 Oct 2012 09:40:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C17E8FC0A; Sat, 20 Oct 2012 09:40:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9K9eZh0098827; Sat, 20 Oct 2012 09:40:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9K9eYpj098825; Sat, 20 Oct 2012 09:40:34 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210200940.q9K9eYpj098825@svn.freebsd.org> From: Andriy Gapon Date: Sat, 20 Oct 2012 09:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241772 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 09:40:35 -0000 Author: avg Date: Sat Oct 20 09:40:34 2012 New Revision: 241772 URL: http://svn.freebsd.org/changeset/base/241772 Log: document acpi_cpu devd notification about _CST change Based on prodding and a submission by Lars Engels . MFC after: 5 days Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Sat Oct 20 09:28:37 2012 (r241771) +++ head/sbin/devd/devd.conf.5 Sat Oct 20 09:40:34 2012 (r241772) @@ -323,6 +323,8 @@ Button state ($notify=0x00 is power, 0x0 Battery events. .It Li Lid Lid state ($notify=0x00 is closed, 0x01 is open). +.It Li PROCESSOR +Processor state/configuration ($notify=0x81 is a change in available Cx states). .It Li Thermal Thermal zone events. .El From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 09:49:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4A4ABDC; Sat, 20 Oct 2012 09:49:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by mx1.freebsd.org (Postfix) with ESMTP id 216BE8FC0A; Sat, 20 Oct 2012 09:49:34 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail28.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9K9nOAX028369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Oct 2012 20:49:25 +1100 Date: Sat, 20 Oct 2012 20:49:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar Subject: Re: svn commit: r241752 - head/share/mk In-Reply-To: <201210192013.q9JKD8si069344@svn.freebsd.org> Message-ID: <20121020190530.P1781@besplex.bde.org> References: <201210192013.q9JKD8si069344@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=eLtLFwV1 c=1 sm=1 a=G4OYDFaBhWUA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=wq_FEnq2wwYA:10 a=gTo0me_kf_mI2cbFT1wA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 09:49:35 -0000 On Fri, 19 Oct 2012, Marcel Moolenaar wrote: > Log: > Improve upon the previous commit to fix the yacc rule. Sorry I didn't complete replying to the previous thread on this. You never said what behaviour in bmake causes more problems than before. There are certainly race cases, but the only ones that I'm sure are not just bugs in make(1) are for exotic cases which were just completely broken without my rules. One of these cases is when someone deletes y.tab.h (where it is used without renaming it). The make sees y.tab.c (or parse.c etc.) and y.tab.h both depending on parse.y. y.tab.c is up to date, so make doesn't rebuild it, and may run a command that uses it. y.tab.h is out of date since it doesn't exist, so make rebuilds it. This rebuilding clobbers y.tab.c, unknown to make, and any concurrent use of y.tab.c sees the clobbered copy. The ordering requirement is '.ORDER: y.tab.c y.tab.h' so it is satisified by y.tab.c being up to date before y.tab.h is built. The reverse order might work accidentally, but would cause the same problem if someone deletes y.tab.h instead y.tab.c. y.tab.o should depend on y.tab.h via .depend, and this should prevent the 'cc -c' concurrent use of y.tab.c in some cases, so even this exotic case will usually not race. > 1. Have the resulting C file depend on the resulting H > file as it should be. Touch the C file to make sure As it shouldn't be. The C file doesn't depend on the H file. > the C file is newer than the H file to keep make > happy. The .ORDER sort of asks for the reverse. It says that y.tab.c must be build before y.tab.h. If they were built separately then it would always be older and timestamps might be find-grained enough to see the difference. When they are built together, their timestamps are determined by the order in which yacc writes them and the order in which make or something else stat()s them. The order could be anything. Perhaps this is the problem. Old make seems to still only use mtimes in seconds. Any make that uses mtimes with finer granularity would find the times different more often and then do bad things if they are different in a certain order. This depends on the filesystem actually supporting mtimes in finer granularity than seconds. Some versions of this support are broken and the breakage may matter here (see below). My rule depends on the .ORDER statement actually working, and this involves delicacies with timestamps and with not starting jobs before old ones have finished. For it to work, it is necessary for yacc to create both files and to not be run again, and for make to not look at the files' timestamps until the yacc job has finished (this is geenrally necessary, since writes to the files before the job has finished will make the files up to date according to a simple timestamp check, bit of course they are not up to date until the rule that builds them has finished). The above shows that there is a problem even when the job has finished. Writes normally make mtimes for update, but don't normally update them. The update normally occurs on close() or stat(). close() usually applies here, so make usually can't decide the order accidentally by looking at the times using stat(). But we get random times for y.tab.c and y.tab.h depending on which order yacc closes them. The rule that creates parse.c by copying y.tab.c to it is a bit more deterministic. After yacc finishes, y.tab.c and y.tab.h have times in indeterminate order. Then cp'ing y.tab.c gives it an mtime later than or equal to that of both, modulo fs bugs (see below). Touching the C file doesn't actually make it newer: (1) With seconds granularity, it will usually make the C file have the same time. (2) In exotic situations, the C file may be on a different file system with different timestamp granularity. Since y.tab.* are in the same directory, this probably doesn't affect them. It is less clear that it doesn't affect parse.c cp'ed from y.tab.c. Times are usually rounded down. With limited granularity, this normally results in a time that is older than the current time. It may also be older than the time of the original copy if the original copy is on a file system with less limited granularity. (3) In non-exotic situations, touch(1) and utimes(2) can easily have a different timestamp granularity than the file system. It is now easy to arrange a setup in which touch(1)ing a file sets its timestamp backwards: - timestamps set by touch(1) are the current time rounded down to microseconds - use sysctl vfs.timestamp.precision to nanoseconds. Fortunately, CLOCK_REALTIME_FAST_N_BROKEN is not an option for this, so we don't have to worry about the additional problems caused by it. It uses CLOCK_REALTIME and gives timestamps in nanoseconds. - write and close a file, setting its timestamp in nanoseconds, with the last 3 digits in tv_nanoseconds fairly large (say 999) - use a fast system that can touch(1) the file in less than 999 nanosecond. Since gettimeofday() uses the coherent clock CLOCK_REALTIME, it gives the current time rounded down to nanseconds. It is only necessary to execute the kernel part of this in less than 999 nanoseconds (but I guess there are no systems fast enough to cause problems for make yet, since none are fast enough to start up the touch binary in 999 nanoseconds). utimes() is limited to microseconds too, but this is not an additional restriction. After rounding down, the time goes backwards relative to the current time, and with sufficient speed, also relative to the file's old timestamp. (4) If the .h file hasn't been closed or stat'ed after the final write to it (not a problem here), then its time may be in advance of the time set by touch, since it hasn't been updated yet. About file system coherency bugs. touch(1) still uses gettimeofday(), so it is as non-broken as above. Very broken file systems hard-code their timestamp function as something like getnanotime(), giving the coherency bugs described below. Most use vfs_timestamp(). This uses time_second for seconds granularity and getnanotime() for 1/HZ granularity. These are based on CLOCK_REALTIME_FAST_N_BROKEN, so they don't even round down. They times that are incoherent relative to CLOCK_REALTIME, at least if both are rounded down. CLOCK_REALTIME_FAST_N_BROKEN returns a time in the past relative to CLOCK_REALTIME. This if we use more accurate times that are possible to see using clock_gettime(CLOCK_REALTIME, ...) or even gettimeofday(), we can read and write incoherent timestamps. E.g., - watch the time using clock_gettime(CLOCK_REALTIME, ...) until tv_nsec rolls over - touch the file using this time (doesn't matter that we have to go back to microseconds resolution provided timestamp precision is lower) - write and close or stat the file. Its mtime will often goes backwards because it is set from time_second or getnanotime() which are in the past. We have up to about 1/HZ seconds to lose this race, so even slow 1990's machines can exec a few binaries in time to see it. This is a general problem with rounding down times, but if file timestamps are rounded down consistently then it causes fewer problems. Touching a file might leave it in the past relative to the current file but not relative to another file, and make(1) mainly cares about the latter. For this, utimes() must round down the current time in the same way that normal file timestamps do, and it doesn't. It would first have to round at all. It does does this accidentally to microseconds as part of its API, so everything is accidentally consistent if vfs.timestamp.precision gives microseconds for the file times. If vfs_timestamp.precision gave nanoseconds, then clock_gettime() can be used to get coherent times, but utimes() just can't handle the nanoseconds. At lower precisions, the kernel could round to the current vfs.timestamp_precision, but it is hard for it to know if utimes() is asking for the correct timestamp, since there are so many incoherent clocks to choose from. > 2. Apply the same fix to the other instance of .ORDER, > missed in the previous commit. I didn't point out this bug since I don't agree with removing it. With the dubious touch, it is needed to avoid endless dependency, > Modified: head/share/mk/bsd.dep.mk > ============================================================================== > --- head/share/mk/bsd.dep.mk Fri Oct 19 19:56:17 2012 (r241751) > +++ head/share/mk/bsd.dep.mk Fri Oct 19 20:13:08 2012 (r241752) > @@ -95,16 +95,17 @@ CLEANFILES+= ${_LC} > SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} > CLEANFILES+= ${_YC} > .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) > -.ORDER: ${_YC} y.tab.h > -${_YC} y.tab.h: ${_YSRC} > +y.tab.h: ${_YSRC} > ${YACC} ${YFLAGS} ${.ALLSRC} > +${_YC}: y.tab.h > cp y.tab.c ${_YC} There is no touch in this case. It depends on cp updating the timestamp. Now there is more chance of getting coherent timestamps and ones that are actually different, because the touching is within the file system. Hmm, old versions of touch that didn't depend on utimes() but had to write the file would have actually worked with nanoseconds timestamps. touch(1) also has a fallback to using utimes(pathname, NULL) to set the current time. With that, the kernel decides the time and nanoseconds might actually work. But normally utimes(pathname, tv) succeeds and doesn't report loss of nanoseconds. > CLEANFILES+= y.tab.c y.tab.h > .elif !empty(YFLAGS:M-d) > .for _YH in ${_YC:R}.h > -${_YH}: ${_YC} > -${_YC}: ${_YSRC} > +${_YH}: ${_YSRC} > ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} > +${_YC}: ${_YH} > + @touch ${.TARGET} The important touch step is obfuscated with an @, unlike the cp step. > SRCS+= ${_YH} > CLEANFILES+= ${_YH} > .endfor > Summary: this doesn't really fix the problem, and I don't like it. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:02:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 411C8C3; Sat, 20 Oct 2012 10:02:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3948FC0A; Sat, 20 Oct 2012 10:02:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KA2IVi002527; Sat, 20 Oct 2012 10:02:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KA2I1n002525; Sat, 20 Oct 2012 10:02:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210201002.q9KA2I1n002525@svn.freebsd.org> From: Andriy Gapon Date: Sat, 20 Oct 2012 10:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241773 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:02:19 -0000 Author: avg Date: Sat Oct 20 10:02:18 2012 New Revision: 241773 URL: http://svn.freebsd.org/changeset/base/241773 Log: zfs: wait in arc_lowmem only if curproc == pageproc ... otherwise the current thread might be holding ARC locks and thus run into a deadlock. This happens, for example, when a thread does memory allocation in the ARC code and runs into KVA shortage. Also, it really makes the most sense to wait in pageproc, so that the results of ARC reclamation are seen before the page cache is acted upon. In other cases where vm_lowmem is invoked, e.g. on KVA space shortage, the callers perform multiple attempts (up to 8) and wait for rather long intervals between them (up to 4 seconds), so ARC reclaim results should become visible even without explicit waiting on the ARC thread. Note that this is not a critical issue for typical ZFS usages where KVA space should already be large enough. On amd64 systems setting KVA size to twice the physical memory size is known to mitigate KVA fragmentation issues in practice. Side note: perhaps vm_lowmem 'how' parameter should be used to differentiate between causes of the event. Reported by: Nikolay Denev MFC after: 19 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 20 09:40:34 2012 (r241772) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 20 10:02:18 2012 (r241773) @@ -3792,8 +3792,16 @@ arc_lowmem(void *arg __unused, int howto mutex_enter(&arc_reclaim_thr_lock); needfree = 1; cv_signal(&arc_reclaim_thr_cv); - while (needfree) - msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + + /* + * It is unsafe to block here in arbitrary threads, because we can come + * here from ARC itself and may hold ARC locks and thus risk a deadlock + * with ARC reclaim thread. + */ + if (curproc == pageproc) { + while (needfree) + msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + } mutex_exit(&arc_reclaim_thr_lock); mutex_exit(&arc_lowmem_lock); } From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:06:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE56E277; Sat, 20 Oct 2012 10:06:38 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACB718FC0A; Sat, 20 Oct 2012 10:06:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KA6ciR003179; Sat, 20 Oct 2012 10:06:38 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KA6cmp003172; Sat, 20 Oct 2012 10:06:38 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201210201006.q9KA6cmp003172@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 20 Oct 2012 10:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241774 - in head: contrib/mdocml lib share/man/man7 usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:06:39 -0000 Author: uqs Date: Sat Oct 20 10:06:38 2012 New Revision: 241774 URL: http://svn.freebsd.org/changeset/base/241774 Log: Apply local patches to mandoc and connect it to the build. - adds a couple more library strings used in the tree - changes some more to the current groff spelling - changes page footer to match groff style Modified: head/contrib/mdocml/lib.in head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/msec.in head/lib/Makefile head/share/man/man7/hier.7 head/usr.bin/Makefile Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Sat Oct 20 10:02:18 2012 (r241773) +++ head/contrib/mdocml/lib.in Sat Oct 20 10:06:38 2012 (r241774) @@ -23,12 +23,12 @@ * Be sure to escape strings. */ -LINE("libarchive", "Reading and Writing Streaming Archives Library (libarchive, \\-larchive)") +LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") -LINE("libbsm", "Basic Security Module User Library (libbsm, \\-lbsm)") -LINE("libc", "Standard C Library (libc, \\-lc)") +LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)") +LINE("libc", "Standard C\\~Library (libc, \\-lc)") LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") @@ -42,6 +42,7 @@ LINE("libdevstat", "Device Statistics Li LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") +LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") LINE("libelf", "ELF Access Library (libelf, \\-lelf)") LINE("libevent", "Event Notification Library (libevent, \\-levent)") LINE("libfetch", "File Transfer Library for URLs (libfetch, \\-lfetch)") @@ -68,11 +69,13 @@ LINE("libnetgraph", "Netgraph User Libra LINE("libnetpgp", "Netpgp signing, verification, encryption and decryption (libnetpgp, \\-lnetpgp)") LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)") LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") -LINE("libpcap", "Capture Library (libpcap, \\-lpcap)") +LINE("libpcap", "Packet Capture Library (libpcap, \\-lpcap)") LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") +LINE("libproc", "Processor Monitoring and Analysis Library (libproc, \\-lproc)") +LINE("libprocstat", "Process and Files Information Retrieval (libprocstat, \\-lprocstat)") LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") LINE("libpthread", "POSIX Threads Library (libpthread, \\-lpthread)") LINE("libpuffs", "puffs Convenience Library (libpuffs, \\-lpuffs)") @@ -82,9 +85,12 @@ LINE("libresolv", "DNS Resolver Library LINE("librpcsec_gss", "RPC GSS-API Authentication Library (librpcsec_gss, \\-lrpcsec_gss)") LINE("librpcsvc", "RPC Service Library (librpcsvc, \\-lrpcsvc)") LINE("librt", "POSIX Real\\-time Library (librt, \\-lrt)") +LINE("librtld_db", "Run-time Linker Debugging Library (librtld_db, \\-lrtld_db)") LINE("libsaslc", "Simple Authentication and Security Layer client library (libsaslc, \\-lsaslc)") +LINE("libsbuf", "Safe String Composition Library (libsbuf, \\-lsbuf)") LINE("libsdp", "Bluetooth Service Discovery Protocol User Library (libsdp, \\-lsdp)") LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") +LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") LINE("libSystem", "System Library (libSystem, \\-lSystem)") LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)") LINE("libterminfo", "Terminal Information Library (libterminfo, \\-lterminfo)") Modified: head/contrib/mdocml/mdoc_validate.c ============================================================================== --- head/contrib/mdocml/mdoc_validate.c Sat Oct 20 10:02:18 2012 (r241773) +++ head/contrib/mdocml/mdoc_validate.c Sat Oct 20 10:06:38 2012 (r241774) @@ -2234,6 +2234,8 @@ post_os(POST_ARGS) mdoc_nmsg(mdoc, n, MANDOCERR_MEM); return(0); } + if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) + strtok(utsname.release, "-"); if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { mdoc_nmsg(mdoc, n, MANDOCERR_MEM); return(0); Modified: head/contrib/mdocml/msec.in ============================================================================== --- head/contrib/mdocml/msec.in Sat Oct 20 10:02:18 2012 (r241773) +++ head/contrib/mdocml/msec.in Sat Oct 20 10:06:38 2012 (r241774) @@ -22,16 +22,16 @@ * Be sure to escape strings. */ -LINE("1", "General Commands Manual") -LINE("2", "System Calls Manual") -LINE("3", "Library Functions Manual") +LINE("1", "FreeBSD General Commands Manual") +LINE("2", "FreeBSD System Calls Manual") +LINE("3", "FreeBSD Library Functions Manual") LINE("3p", "Perl Library Functions Manual") -LINE("4", "Kernel Interfaces Manual") -LINE("5", "File Formats Manual") -LINE("6", "Games Manual") -LINE("7", "Miscellaneous Information Manual") -LINE("8", "System Manager\'s Manual") -LINE("9", "Kernel Developer\'s Manual") +LINE("4", "FreeBSD Kernel Interfaces Manual") +LINE("5", "FreeBSD File Formats Manual") +LINE("6", "FreeBSD Games Manual") +LINE("7", "FreeBSD Miscellaneous Information Manual") +LINE("8", "FreeBSD System Manager\'s Manual") +LINE("9", "FreeBSD Kernel Developer\'s Manual") LINE("X11", "X11 Developer\'s Manual") LINE("X11R6", "X11 Developer\'s Manual") LINE("unass", "Unassociated") Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Oct 20 10:02:18 2012 (r241773) +++ head/lib/Makefile Sat Oct 20 10:06:38 2012 (r241774) @@ -85,6 +85,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libkiconv \ liblzma \ libmagic \ + libmandoc \ libmemstat \ ${_libmilter} \ ${_libmp} \ Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Sat Oct 20 10:02:18 2012 (r241773) +++ head/share/man/man7/hier.7 Sat Oct 20 10:06:38 2012 (r241774) @@ -546,6 +546,8 @@ see .Xr setlocale 3 .It Pa man/ manual pages +.It Pa mdocml/ +data files used by mdocml .It Pa me/ macros for use with the me macro package; see Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Oct 20 10:02:18 2012 (r241773) +++ head/usr.bin/Makefile Sat Oct 20 10:06:38 2012 (r241774) @@ -96,6 +96,7 @@ SUBDIR= alias \ m4 \ ${_makewhatis} \ ${_man} \ + mandoc \ mesg \ minigzip \ ministat \ From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:13:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA20F5B1; Sat, 20 Oct 2012 10:13:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id 535268FC0A; Sat, 20 Oct 2012 10:13:47 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9KADaJI028962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Oct 2012 21:13:38 +1100 Date: Sat, 20 Oct 2012 21:13:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar Subject: Re: svn commit: r241298 - in head: . gnu/usr.bin/cc/cc_int gnu/usr.bin/cc/include kerberos5 kerberos5/tools/asn1_compile kerberos5/tools/slc lib/clang/include share/mk tools/build/make_check usr.sbin/c... In-Reply-To: <965E2363-6866-4A10-A7B1-C428B3C78925@xcllnt.net> Message-ID: <20121020205008.C1781@besplex.bde.org> References: <201210062001.q96K16Or030755@svn.freebsd.org> <20121007161440.C7605@besplex.bde.org> <81CB9A3A-4BFF-41B2-A1F9-3721A40F6260@xcllnt.net> <20121008165228.F7997@besplex.bde.org> <965E2363-6866-4A10-A7B1-C428B3C78925@xcllnt.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=IbXfwhWa c=1 sm=1 a=LFdMy-NRfKoA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Qs8lTao0p00A:10 a=XOAjjx_bbgUN_Qp3UXcA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Bruce Evans , Simon Gerraty X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:13:49 -0000 On Mon, 8 Oct 2012, Marcel Moolenaar wrote: > On Oct 8, 2012, at 1:08 AM, Bruce Evans wrote: > >> On Sun, 7 Oct 2012, Marcel Moolenaar wrote: >> >>> On Oct 6, 2012, at 10:31 PM, Bruce Evans wrote: >>> >>>> On Sat, 6 Oct 2012, Marcel Moolenaar wrote: Back to the old thread. Followup to the new commit thread. >>>>> Log: >>>>> Add support for bmake. This includes: >>>>> .... >>>>> Modified: head/share/mk/bsd.dep.mk >>>>> ============================================================================== >>>>> --- head/share/mk/bsd.dep.mk Sat Oct 6 19:57:27 2012 (r241297) >>>>> +++ head/share/mk/bsd.dep.mk Sat Oct 6 20:01:05 2012 (r241298) >>>>> @@ -102,8 +102,8 @@ ${_YC} y.tab.h: ${_YSRC} >>>>> CLEANFILES+= y.tab.c y.tab.h >>>>> .elif !empty(YFLAGS:M-d) >>>>> .for _YH in ${_YC:R}.h >>>>> -.ORDER: ${_YC} ${_YH} >>>>> -${_YC} ${_YH}: ${_YSRC} >>>>> +${_YH}: ${_YC} >>>>> +${_YC}: ${_YSRC} >>>>> ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} >>>>> SRCS+= ${_YH} >>>>> CLEANFILES+= ${_YH} >>>> >>>> This is broken. Yacc headers don't depend on generated yacc .c files. >>>> Now there is only a null rule to create the headers. One broken case >>>> is when the header somehow gets deleted. It bcomes out of date, but >>>> running make to update it only runs the null rule, so it remains >>>> nonexistent. >>> >>> The problem with the old rule is that it's broken as well. The >>> change attempts to fix a real parallel build problem. Your >>> comment is valid though. What about the following (possibly >>> white-space corrupted) patch from Simon: >> >> What's wrong with the old rule? It uses the .ORDER directive to force >> creation of the 2 generated files in sequential order, so that parallel >> builds can't happen. > > Since the source file is re-created when the header is created, > any parallel work done with the C file is a problem. Yes, but the old rule uses .ORDER to try to prevent parallel work, and you never explained why it stopped working. I think I expmained the problem in the later thread as finer-grained timestamps exposing old races more. > At HP, where we used clearcase & clearmake, we had to create > an intermediate tarfile, the result of the yacc(1) rule and > then have the .h and .c file depend on the tarfile. Each got > unique created by extracting only ${.TARGET}. > > Roughly and loosely speaking: > > .tar: .y > yacc and create tar file > > .c: .tar > tar x y.tab.c > > .h: .tar > tar x y.tab.h > > I think something like this is the only way to get something > that's 100% correct. Probably. Using temporary files seems to be messier. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:16:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3C0B7D9; Sat, 20 Oct 2012 10:16:55 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9ACB8FC0A; Sat, 20 Oct 2012 10:16:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KAGtBA004945; Sat, 20 Oct 2012 10:16:55 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KAGtjV004943; Sat, 20 Oct 2012 10:16:55 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201210201016.q9KAGtjV004943@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 20 Oct 2012 10:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241775 - head/contrib/mdocml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:16:55 -0000 Author: uqs Date: Sat Oct 20 10:16:55 2012 New Revision: 241775 URL: http://svn.freebsd.org/changeset/base/241775 Log: strcmp(3) will suffice here, also follow the style of the remaining file more closely. Prodded by: ed Modified: head/contrib/mdocml/mdoc_validate.c Modified: head/contrib/mdocml/mdoc_validate.c ============================================================================== --- head/contrib/mdocml/mdoc_validate.c Sat Oct 20 10:06:38 2012 (r241774) +++ head/contrib/mdocml/mdoc_validate.c Sat Oct 20 10:16:55 2012 (r241775) @@ -2234,7 +2234,7 @@ post_os(POST_ARGS) mdoc_nmsg(mdoc, n, MANDOCERR_MEM); return(0); } - if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) + if (0 == strcmp(utsname.sysname, "FreeBSD")) strtok(utsname.release, "-"); if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { mdoc_nmsg(mdoc, n, MANDOCERR_MEM); From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:20:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A1C497A; Sat, 20 Oct 2012 10:20:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 306308FC08; Sat, 20 Oct 2012 10:20:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KAK75Q005476; Sat, 20 Oct 2012 10:20:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KAK6dh005471; Sat, 20 Oct 2012 10:20:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210201020.q9KAK6dh005471@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Oct 2012 10:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241776 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:20:07 -0000 Author: ed Date: Sat Oct 20 10:20:06 2012 New Revision: 241776 URL: http://svn.freebsd.org/changeset/base/241776 Log: Remove redundant code. Both mfi_flash.c and mfi_show.c contain very similar functions to print a list of firmwares. Move these routines into mfiutil.c. Reported by: jhb Modified: head/usr.sbin/mfiutil/mfi_flash.c head/usr.sbin/mfiutil/mfi_show.c head/usr.sbin/mfiutil/mfiutil.c head/usr.sbin/mfiutil/mfiutil.h Modified: head/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_flash.c Sat Oct 20 10:16:55 2012 (r241775) +++ head/usr.sbin/mfiutil/mfi_flash.c Sat Oct 20 10:20:06 2012 (r241776) @@ -42,34 +42,6 @@ #define FLASH_BUF_SIZE (64 * 1024) -static void -scan_firmware(struct mfi_info_component *comp) -{ - int len; - - len = strlen(comp->name); - if (fw_name_width < len) - fw_name_width = len; - len = strlen(comp->version); - if (fw_version_width < len) - fw_version_width = len; - len = strlen(comp->build_date); - if (fw_date_width < len) - fw_date_width = len; - len = strlen(comp->build_time); - if (fw_time_width < len) - fw_time_width = len; -} - -static void -display_firmware(struct mfi_info_component *comp) -{ - - printf("%-*s %-*s %-*s %-*s\n", fw_name_width, comp->name, - fw_version_width, comp->version, fw_date_width, comp->build_date, - fw_time_width, comp->build_time); -} - static int display_pending_firmware(int fd) { @@ -94,9 +66,9 @@ display_pending_firmware(int fd) info.pending_image_component_count = 8; for (i = 0; i < info.pending_image_component_count; i++) scan_firmware(&info.pending_image_component[i]); - display_firmware(&header); + display_firmware(&header, ""); for (i = 0; i < info.pending_image_component_count; i++) - display_firmware(&info.pending_image_component[i]); + display_firmware(&info.pending_image_component[i], ""); return (0); } Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Sat Oct 20 10:16:55 2012 (r241775) +++ head/usr.sbin/mfiutil/mfi_show.c Sat Oct 20 10:20:06 2012 (r241776) @@ -570,34 +570,6 @@ error: } MFI_COMMAND(show, drives, show_drives); -static void -scan_firmware(struct mfi_info_component *comp) -{ - int len; - - len = strlen(comp->name); - if (fw_name_width < len) - fw_name_width = len; - len = strlen(comp->version); - if (fw_version_width < len) - fw_version_width = len; - len = strlen(comp->build_date); - if (fw_date_width < len) - fw_date_width = len; - len = strlen(comp->build_time); - if (fw_time_width < len) - fw_time_width = len; -} - -static void -display_firmware(struct mfi_info_component *comp, const char *tag) -{ - - printf("%-*s %-*s %-*s %-*s %s\n", fw_name_width, comp->name, - fw_version_width, comp->version, fw_date_width, comp->build_date, - fw_time_width, comp->build_time, tag); -} - static int show_firmware(int ac, char **av __unused) { Modified: head/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.c Sat Oct 20 10:16:55 2012 (r241775) +++ head/usr.sbin/mfiutil/mfiutil.c Sat Oct 20 10:20:06 2012 (r241776) @@ -45,7 +45,7 @@ MFI_TABLE(top, abort); int mfi_unit; u_int mfi_opts; -int fw_name_width, fw_version_width, fw_date_width, fw_time_width; +static int fw_name_width, fw_version_width, fw_date_width, fw_time_width; static void usage(void) @@ -144,3 +144,31 @@ main(int ac, char **av) warnx("Unknown command %s.", av[0]); return (1); } + +void +scan_firmware(struct mfi_info_component *comp) +{ + int len; + + len = strlen(comp->name); + if (fw_name_width < len) + fw_name_width = len; + len = strlen(comp->version); + if (fw_version_width < len) + fw_version_width = len; + len = strlen(comp->build_date); + if (fw_date_width < len) + fw_date_width = len; + len = strlen(comp->build_time); + if (fw_time_width < len) + fw_time_width = len; +} + +void +display_firmware(struct mfi_info_component *comp, const char *tag) +{ + + printf("%-*s %-*s %-*s %-*s %s\n", fw_name_width, comp->name, + fw_version_width, comp->version, fw_date_width, comp->build_date, + fw_time_width, comp->build_time, tag); +} Modified: head/usr.sbin/mfiutil/mfiutil.h ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.h Sat Oct 20 10:16:55 2012 (r241775) +++ head/usr.sbin/mfiutil/mfiutil.h Sat Oct 20 10:20:06 2012 (r241776) @@ -121,8 +121,8 @@ struct mfiutil_command { #define MFI_DNAME_HONOR_OPTS 0x8000 /* Allow cmd line to override default */ extern int mfi_unit; + extern u_int mfi_opts; -extern int fw_name_width, fw_version_width, fw_date_width, fw_time_width; void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref); void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref); @@ -153,4 +153,7 @@ const char *mfi_status(u_int status_code const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def); +void scan_firmware(struct mfi_info_component *comp); +void display_firmware(struct mfi_info_component *comp, const char *tag); + #endif /* !__MFIUTIL_H__ */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:24:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9F2DB09; Sat, 20 Oct 2012 10:24:28 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id B739B8FC0A; Sat, 20 Oct 2012 10:24:27 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hq12so858061wib.13 for ; Sat, 20 Oct 2012 03:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=7JJSyMxMFPknyNOarM0nQXb8qcGY+WD7+L0/MLxHII4=; b=ymxO9uhIsG7H+tyE8SsdxpReA8F73OfxA0L5SwD6axrVSfb6URFELPpHAMgix+pcTD maXYhIX0d7a6x5SXGz2qxZFGl0VBCg5WS0T6FD75Hm7ZmlUTiw7AKmJ4+FyTosSfO1Hp UMXEGdIr8XUjUJU65dllRBAyPbx/dXLEP0uklMvDLY01VbV2L8oUcopBjBnefsmo+FRW sgrZH26rjmRZfpP2WS18BWJo6NOhyjbY6OjpsKKaot+ih1bxF2fH/Rz180vrFDb+LIX5 vhmakt1P88rqCRsIDzJoxy18XOepIOR3XzX0C8rMph1XE9Bg/4Z3xmZuVTRfeEGvDwpd m1aQ== Received: by 10.216.145.9 with SMTP id o9mr2211303wej.107.1350728661540; Sat, 20 Oct 2012 03:24:21 -0700 (PDT) Received: from [10.0.0.86] ([93.152.184.10]) by mx.google.com with ESMTPS id dt9sm39431990wib.1.2012.10.20.03.24.19 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 20 Oct 2012 03:24:20 -0700 (PDT) Subject: Re: svn commit: r241773 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201210201002.q9KA2I1n002525@svn.freebsd.org> Date: Sat, 20 Oct 2012 13:24:18 +0300 Content-Transfer-Encoding: 7bit Message-Id: References: <201210201002.q9KA2I1n002525@svn.freebsd.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1498) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:24:28 -0000 On Oct 20, 2012, at 1:02 PM, Andriy Gapon wrote: > Author: avg > Date: Sat Oct 20 10:02:18 2012 > New Revision: 241773 > URL: http://svn.freebsd.org/changeset/base/241773 > > Log: > zfs: wait in arc_lowmem only if curproc == pageproc > > ... otherwise the current thread might be holding ARC locks and thus run > into a deadlock. This happens, for example, when a thread does memory > allocation in the ARC code and runs into KVA shortage. > Also, it really makes the most sense to wait in pageproc, so that the > results of ARC reclamation are seen before the page cache is acted upon. > In other cases where vm_lowmem is invoked, e.g. on KVA space shortage, > the callers perform multiple attempts (up to 8) and wait for rather > long intervals between them (up to 4 seconds), so ARC reclaim results > should become visible even without explicit waiting on the ARC thread. > > Note that this is not a critical issue for typical ZFS usages where KVA > space should already be large enough. On amd64 systems setting KVA size > to twice the physical memory size is known to mitigate KVA fragmentation > issues in practice. > > Side note: perhaps vm_lowmem 'how' parameter should be used to > differentiate between causes of the event. > > Reported by: Nikolay Denev > MFC after: 19 days > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thanks! From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:33:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C74B171; Sat, 20 Oct 2012 10:33:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAC678FC0C; Sat, 20 Oct 2012 10:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KAXGs3007606; Sat, 20 Oct 2012 10:33:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KAXGRm007583; Sat, 20 Oct 2012 10:33:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210201033.q9KAXGRm007583@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Oct 2012 10:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241777 - in head: bin/dd libexec/rpc.rusersd libexec/talkd usr.bin/cksum usr.bin/m4 usr.sbin/mtree usr.sbin/newsyslog usr.sbin/services_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:33:16 -0000 Author: ed Date: Sat Oct 20 10:33:15 2012 New Revision: 241777 URL: http://svn.freebsd.org/changeset/base/241777 Log: More -Wmissing-variable-declarations fixes. In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h. Added: head/libexec/rpc.rusersd/extern.h (contents, props changed) head/usr.sbin/services_mkdb/extern.h (contents, props changed) Modified: head/bin/dd/conv_tab.c head/libexec/rpc.rusersd/Makefile head/libexec/rpc.rusersd/rusers_proc.c head/libexec/rpc.rusersd/rusersd.c head/libexec/talkd/announce.c head/libexec/talkd/extern.h head/libexec/talkd/process.c head/libexec/talkd/table.c head/libexec/talkd/talkd.c head/usr.bin/cksum/extern.h head/usr.bin/m4/expr.c head/usr.bin/m4/extern.h head/usr.bin/m4/gnum4.c head/usr.bin/m4/main.c head/usr.bin/m4/parser.y head/usr.sbin/mtree/mtree.c head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/services_mkdb/Makefile head/usr.sbin/services_mkdb/services_mkdb.c head/usr.sbin/services_mkdb/uniq.c Modified: head/bin/dd/conv_tab.c ============================================================================== --- head/bin/dd/conv_tab.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/bin/dd/conv_tab.c Sat Oct 20 10:33:15 2012 (r241777) @@ -41,6 +41,11 @@ __FBSDID("$FreeBSD$"); #include +#include + +#include "dd.h" +#include "extern.h" + /* * There are currently six tables: * Modified: head/libexec/rpc.rusersd/Makefile ============================================================================== --- head/libexec/rpc.rusersd/Makefile Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/rpc.rusersd/Makefile Sat Oct 20 10:33:15 2012 (r241777) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG = rpc.rusersd -SRCS = rusersd.c rusers_proc.c +SRCS = rusersd.c rusers_proc.c extern.h MAN = rpc.rusersd.8 DPADD= ${LIBRPCSVC} ${LIBUTIL} Added: head/libexec/rpc.rusersd/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rpc.rusersd/extern.h Sat Oct 20 10:33:15 2012 (r241777) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 1993, John Brezak + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +extern int from_inetd; + +void rusers_service(struct svc_req *, SVCXPRT *); Modified: head/libexec/rpc.rusersd/rusers_proc.c ============================================================================== --- head/libexec/rpc.rusersd/rusers_proc.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/rpc.rusersd/rusers_proc.c Sat Oct 20 10:33:15 2012 (r241777) @@ -53,6 +53,8 @@ static const char rcsid[] = #endif #include +#include "extern.h" + #ifndef _PATH_DEV #define _PATH_DEV "/dev" #endif @@ -61,10 +63,6 @@ static utmpidle utmp_idle[MAXUSERS]; static utmp old_utmp[MAXUSERS]; static struct utmpx utmp_list[MAXUSERS]; -extern int from_inetd; - -void rusers_service(struct svc_req *, SVCXPRT *); - #ifdef XIDLE static Display *dpy; Modified: head/libexec/rpc.rusersd/rusersd.c ============================================================================== --- head/libexec/rpc.rusersd/rusersd.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/rpc.rusersd/rusersd.c Sat Oct 20 10:33:15 2012 (r241777) @@ -43,7 +43,7 @@ static const char rcsid[] = #include #include -extern void rusers_service(struct svc_req *, SVCXPRT *); +#include "extern.h" int from_inetd = 1; Modified: head/libexec/talkd/announce.c ============================================================================== --- head/libexec/talkd/announce.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/talkd/announce.c Sat Oct 20 10:33:15 2012 (r241777) @@ -60,8 +60,6 @@ static const char rcsid[] = #include "ttymsg.h" #include "extern.h" -extern char hostname[]; - /* * Announce an invitation to talk. */ Modified: head/libexec/talkd/extern.h ============================================================================== --- head/libexec/talkd/extern.h Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/talkd/extern.h Sat Oct 20 10:33:15 2012 (r241777) @@ -25,6 +25,9 @@ * $FreeBSD$ */ +extern int debug; +extern char hostname[]; + int announce(CTL_MSG *, const char *); int delete_invite(u_int32_t); void do_announce(CTL_MSG *, CTL_RESPONSE *); Modified: head/libexec/talkd/process.c ============================================================================== --- head/libexec/talkd/process.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/talkd/process.c Sat Oct 20 10:33:15 2012 (r241777) @@ -63,8 +63,6 @@ static const char rcsid[] = #include "extern.h" -extern int debug; - void process_request(CTL_MSG *mp, CTL_RESPONSE *rp) { Modified: head/libexec/talkd/table.c ============================================================================== --- head/libexec/talkd/table.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/talkd/table.c Sat Oct 20 10:33:15 2012 (r241777) @@ -64,8 +64,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -extern int debug; -struct timeval tp; +static struct timeval tp; typedef struct table_entry TABLE_ENTRY; @@ -78,7 +77,7 @@ struct table_entry { static void delete(TABLE_ENTRY *); -TABLE_ENTRY *table = NIL; +static TABLE_ENTRY *table = NIL; /* * Look in the table for an invitation that matches the current Modified: head/libexec/talkd/talkd.c ============================================================================== --- head/libexec/talkd/talkd.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/libexec/talkd/talkd.c Sat Oct 20 10:33:15 2012 (r241777) @@ -69,13 +69,13 @@ static const char rcsid[] = #include "extern.h" -CTL_MSG request; -CTL_RESPONSE response; +static CTL_MSG request; +static CTL_RESPONSE response; -int debug = 0; -long lastmsgtime; +int debug = 0; +static long lastmsgtime; -char hostname[MAXHOSTNAMELEN]; +char hostname[MAXHOSTNAMELEN]; #define TIMEOUT 30 #define MAXIDLE 120 Modified: head/usr.bin/cksum/extern.h ============================================================================== --- head/usr.bin/cksum/extern.h Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.bin/cksum/extern.h Sat Oct 20 10:33:15 2012 (r241777) @@ -32,6 +32,9 @@ #include +extern uint32_t crc_total; +extern uint32_t crc32_total; + __BEGIN_DECLS int crc(int, uint32_t *, off_t *); void pcrc(char *, uint32_t, off_t); Modified: head/usr.bin/m4/expr.c ============================================================================== --- head/usr.bin/m4/expr.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.bin/m4/expr.c Sat Oct 20 10:33:15 2012 (r241777) @@ -24,7 +24,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" int32_t end_result; -const char *copy_toeval; +static const char *copy_toeval; int yyerror(const char *msg); extern void yy_scan_string(const char *); Modified: head/usr.bin/m4/extern.h ============================================================================== --- head/usr.bin/m4/extern.h Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.bin/m4/extern.h Sat Oct 20 10:33:15 2012 (r241777) @@ -43,6 +43,7 @@ extern unsigned long expansion_id; /* expr.c */ extern int expr(const char *); +extern int32_t end_result; /* gnum4.c */ extern void addtoincludepath(const char *); Modified: head/usr.bin/m4/gnum4.c ============================================================================== --- head/usr.bin/m4/gnum4.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.bin/m4/gnum4.c Sat Oct 20 10:33:15 2012 (r241777) @@ -59,7 +59,7 @@ int mimic_gnu = 0; * Then M4PATH env variable */ -struct path_entry { +static struct path_entry { char *name; struct path_entry *next; } *first, *last; Modified: head/usr.bin/m4/main.c ============================================================================== --- head/usr.bin/m4/main.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.bin/m4/main.c Sat Oct 20 10:33:15 2012 (r241777) @@ -85,7 +85,7 @@ struct keyblk { int ktyp; /* keyword type */ }; -struct keyblk keywrds[] = { /* m4 keywords to be installed */ +static struct keyblk keywrds[] = { /* m4 keywords to be installed */ { "include", INCLTYPE }, { "sinclude", SINCTYPE }, { "define", DEFITYPE }, Modified: head/usr.bin/m4/parser.y ============================================================================== --- head/usr.bin/m4/parser.y Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.bin/m4/parser.y Sat Oct 20 10:33:15 2012 (r241777) @@ -17,10 +17,17 @@ * * $FreeBSD$ */ + #include +#include +#include #include + +#include "mdef.h" +#include "extern.h" + #define YYSTYPE int32_t -extern int32_t end_result; + extern int yylex(void); extern int yyerror(const char *); %} Modified: head/usr.sbin/mtree/mtree.c ============================================================================== --- head/usr.sbin/mtree/mtree.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.sbin/mtree/mtree.c Sat Oct 20 10:33:15 2012 (r241777) @@ -52,7 +52,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" int ftsoptions = FTS_PHYSICAL; -int cflag, dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, Uflag, wflag; +int dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, wflag; +static int cflag, Uflag; u_int keys; char fullpath[MAXPATHLEN]; Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.sbin/newsyslog/newsyslog.c Sat Oct 20 10:33:15 2012 (r241777) @@ -145,7 +145,7 @@ struct compress_types { const char *path; /* Path to compression program */ }; -const struct compress_types compress_type[COMPRESS_TYPES] = { +static const struct compress_types compress_type[COMPRESS_TYPES] = { { "", "", "" }, /* no compression */ { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP }, /* gzip compression */ { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2 }, /* bzip2 compression */ @@ -206,42 +206,44 @@ typedef enum { } fk_entry; STAILQ_HEAD(cflist, conf_entry); -SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); -SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); +static SLIST_HEAD(swlisthead, sigwork_entry) swhead = + SLIST_HEAD_INITIALIZER(swhead); +static SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = + SLIST_HEAD_INITIALIZER(zwhead); STAILQ_HEAD(ilist, include_entry); int dbg_at_times; /* -D Show details of 'trim_at' code */ -int archtodir = 0; /* Archive old logfiles to other directory */ -int createlogs; /* Create (non-GLOB) logfiles which do not */ +static int archtodir = 0; /* Archive old logfiles to other directory */ +static int createlogs; /* Create (non-GLOB) logfiles which do not */ /* already exist. 1=='for entries with */ /* C flag', 2=='for all entries'. */ int verbose = 0; /* Print out what's going on */ -int needroot = 1; /* Root privs are necessary */ +static int needroot = 1; /* Root privs are necessary */ int noaction = 0; /* Don't do anything, just show it */ -int norotate = 0; /* Don't rotate */ -int nosignal; /* Do not send any signals */ -int enforcepid = 0; /* If PID file does not exist or empty, do nothing */ -int force = 0; /* Force the trim no matter what */ -int rotatereq = 0; /* -R = Always rotate the file(s) as given */ +static int norotate = 0; /* Don't rotate */ +static int nosignal; /* Do not send any signals */ +static int enforcepid = 0; /* If PID file does not exist or empty, do nothing */ +static int force = 0; /* Force the trim no matter what */ +static int rotatereq = 0; /* -R = Always rotate the file(s) as given */ /* on the command (this also requires */ /* that a list of files *are* given on */ /* the run command). */ -char *requestor; /* The name given on a -R request */ -char *timefnamefmt = NULL; /* Use time based filenames instead of .0 etc */ -char *archdirname; /* Directory path to old logfiles archive */ -char *destdir = NULL; /* Directory to treat at root for logs */ -const char *conf; /* Configuration file to use */ +static char *requestor; /* The name given on a -R request */ +static char *timefnamefmt = NULL;/* Use time based filenames instead of .0 */ +static char *archdirname; /* Directory path to old logfiles archive */ +static char *destdir = NULL; /* Directory to treat at root for logs */ +static const char *conf; /* Configuration file to use */ struct ptime_data *dbg_timenow; /* A "timenow" value set via -D option */ -struct ptime_data *timenow; /* The time to use for checking at-fields */ +static struct ptime_data *timenow; /* The time to use for checking at-fields */ #define DAYTIME_LEN 16 -char daytime[DAYTIME_LEN]; /* The current time in human readable form, - * used for rotation-tracking messages. */ -char hostname[MAXHOSTNAMELEN]; /* hostname */ +static char daytime[DAYTIME_LEN];/* The current time in human readable form, + * used for rotation-tracking messages. */ +static char hostname[MAXHOSTNAMELEN]; /* hostname */ -const char *path_syslogpid = _PATH_SYSLOGPID; +static const char *path_syslogpid = _PATH_SYSLOGPID; static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, Modified: head/usr.sbin/services_mkdb/Makefile ============================================================================== --- head/usr.sbin/services_mkdb/Makefile Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.sbin/services_mkdb/Makefile Sat Oct 20 10:33:15 2012 (r241777) @@ -2,7 +2,7 @@ PROG= services_mkdb MAN= services_mkdb.8 -SRCS= services_mkdb.c uniq.c +SRCS= services_mkdb.c uniq.c extern.h DPADD+= ${LIBUTIL} LDADD+= -lutil Added: head/usr.sbin/services_mkdb/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/services_mkdb/extern.h Sat Oct 20 10:33:15 2012 (r241777) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +extern const HASHINFO hinfo; Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.sbin/services_mkdb/services_mkdb.c Sat Oct 20 10:33:15 2012 (r241777) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "extern.h" + static char tname[MAXPATHLEN]; #define PMASK 0xffff Modified: head/usr.sbin/services_mkdb/uniq.c ============================================================================== --- head/usr.sbin/services_mkdb/uniq.c Sat Oct 20 10:20:06 2012 (r241776) +++ head/usr.sbin/services_mkdb/uniq.c Sat Oct 20 10:33:15 2012 (r241777) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -extern const HASHINFO hinfo; +#include "extern.h" void uniq(const char *); static int comp(const char *, char **, size_t *); From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:34:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF5751F0; Sat, 20 Oct 2012 10:34:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D64B48FC0C; Sat, 20 Oct 2012 10:34:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KAYtQl009260; Sat, 20 Oct 2012 10:34:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KAYtR6009256; Sat, 20 Oct 2012 10:34:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210201034.q9KAYtR6009256@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Oct 2012 10:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241778 - head/usr.sbin/services_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:34:56 -0000 Author: ed Date: Sat Oct 20 10:34:55 2012 New Revision: 241778 URL: http://svn.freebsd.org/changeset/base/241778 Log: Move uniq() prototype into extern.h. Modified: head/usr.sbin/services_mkdb/extern.h head/usr.sbin/services_mkdb/services_mkdb.c head/usr.sbin/services_mkdb/uniq.c Modified: head/usr.sbin/services_mkdb/extern.h ============================================================================== --- head/usr.sbin/services_mkdb/extern.h Sat Oct 20 10:33:15 2012 (r241777) +++ head/usr.sbin/services_mkdb/extern.h Sat Oct 20 10:34:55 2012 (r241778) @@ -30,3 +30,5 @@ */ extern const HASHINFO hinfo; + +void uniq(const char *); Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sat Oct 20 10:33:15 2012 (r241777) +++ head/usr.sbin/services_mkdb/services_mkdb.c Sat Oct 20 10:34:55 2012 (r241778) @@ -56,8 +56,6 @@ static char tname[MAXPATHLEN]; #define PMASK 0xffff #define PROTOMAX 5 -extern void uniq(const char *); - static void add(DB *, StringList *, size_t, const char *, size_t *, int); static StringList ***parseservices(const char *, StringList *); static void cleanup(void); Modified: head/usr.sbin/services_mkdb/uniq.c ============================================================================== --- head/usr.sbin/services_mkdb/uniq.c Sat Oct 20 10:33:15 2012 (r241777) +++ head/usr.sbin/services_mkdb/uniq.c Sat Oct 20 10:34:55 2012 (r241778) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -void uniq(const char *); static int comp(const char *, char **, size_t *); /* From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 10:51:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D8A3536; Sat, 20 Oct 2012 10:51:33 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4088FC08; Sat, 20 Oct 2012 10:51:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KApX94011949; Sat, 20 Oct 2012 10:51:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KApXsq011947; Sat, 20 Oct 2012 10:51:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210201051.q9KApXsq011947@svn.freebsd.org> From: Andre Oppermann Date: Sat, 20 Oct 2012 10:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241779 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 10:51:33 -0000 Author: andre Date: Sat Oct 20 10:51:32 2012 New Revision: 241779 URL: http://svn.freebsd.org/changeset/base/241779 Log: Tidy up somaxconn (accept queue limit) and related functions and move it together into one place. Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Oct 20 10:34:55 2012 (r241778) +++ head/sys/kern/uipc_socket.c Sat Oct 20 10:51:32 2012 (r241779) @@ -182,15 +182,37 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol co VNET_ASSERT(curvnet != NULL, \ ("%s:%d curvnet is NULL, so=%p", __func__, __LINE__, (so))); +/* + * Limit on the number of connections in the listen queue waiting + * for accept(2). + */ static int somaxconn = SOMAXCONN; -static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS); -/* XXX: we dont have SYSCTL_USHORT */ + +static int +sysctl_somaxconn(SYSCTL_HANDLER_ARGS) +{ + int error; + int val; + + val = somaxconn; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr ) + return (error); + + if (val < 1 || val > USHRT_MAX) + return (EINVAL); + + somaxconn = val; + return (0); +} SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(int), sysctl_somaxconn, "I", "Maximum pending socket connection " - "queue size"); + 0, sizeof(int), sysctl_somaxconn, "I", + "Maximum listen socket pending connection accept queue size"); + static int numopensockets; SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, &numopensockets, 0, "Number of open sockets"); + #ifdef ZERO_COPY_SOCKETS /* These aren't static because they're used in other files. */ int so_zero_copy_send = 1; @@ -3269,24 +3291,6 @@ socheckuid(struct socket *so, uid_t uid) return (0); } -static int -sysctl_somaxconn(SYSCTL_HANDLER_ARGS) -{ - int error; - int val; - - val = somaxconn; - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr ) - return (error); - - if (val < 1 || val > USHRT_MAX) - return (EINVAL); - - somaxconn = val; - return (0); -} - /* * These functions are used by protocols to notify the socket layer (and its * consumers) of state changes in the sockets driven by protocol-side events. From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 12:07:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A560555; Sat, 20 Oct 2012 12:07:49 +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 5259A8FC0C; Sat, 20 Oct 2012 12:07:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KC7nPx023825; Sat, 20 Oct 2012 12:07:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KC7nWF023822; Sat, 20 Oct 2012 12:07:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210201207.q9KC7nWF023822@svn.freebsd.org> From: Marius Strobl Date: Sat, 20 Oct 2012 12:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241780 - in head/sys/sparc64: include sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 12:07:49 -0000 Author: marius Date: Sat Oct 20 12:07:48 2012 New Revision: 241780 URL: http://svn.freebsd.org/changeset/base/241780 Log: - Give PIL_PREEMPT the lowest priority just above low/stray interrupts. The reason for this is that the SPARC v9 architecture allows nested interrupts of higher priority/level than that of the current interrupt to occur (and we can't just entirely bypass this model, also, at least for tick interrupts, this also wouldn't be wise). However, when a preemption interrupt interrupts another interrupt of lower priority, f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt, f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(), which is responsible for restoring the state of the CPU prior to entry to the interrupt based on the (also migrated) trap frame, then is run on a CPU which actually didn't receive the interrupt in question, causing an inappropriate processor interrupt level to be "restored". In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD in the above scenario, to be blocked on the target of the migration until the correct PIL happens to be restored again on that CPU again. Making PIL_PREEMPT the lowest real priority, this effectively prevents this scenario from happening, as preemption interrupts no longer can interrupt any other interrupt besides stray ones (which is no issue). Thanks to attilio@ and especially mav@ for helping me to understand this problem at the 201208DevSummit. - Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's no real equivalent to NMIs on SPARC v9) the highest possible priority just below the hardwired PIL_TICK, so it has a chance to interrupt more things. MFC after: 1 week Modified: head/sys/sparc64/include/intr_machdep.h head/sys/sparc64/sparc64/intr_machdep.c Modified: head/sys/sparc64/include/intr_machdep.h ============================================================================== --- head/sys/sparc64/include/intr_machdep.h Sat Oct 20 10:51:32 2012 (r241779) +++ head/sys/sparc64/include/intr_machdep.h Sat Oct 20 12:07:48 2012 (r241780) @@ -41,14 +41,14 @@ #define IV_SHIFT 6 #define PIL_LOW 1 /* stray interrupts */ -#define PIL_ITHREAD 2 /* interrupts that use ithreads */ -#define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */ -#define PIL_AST 4 /* ast ipi */ -#define PIL_STOP 5 /* stop cpu ipi */ -#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ -#define PIL_HARDCLOCK 7 /* hardclock broadcast */ -#define PIL_FILTER 12 /* filter interrupts */ -#define PIL_BRIDGE 13 /* bridge interrupts */ +#define PIL_PREEMPT 2 /* preempt idle thread CPU IPI */ +#define PIL_ITHREAD 3 /* interrupts that use ithreads */ +#define PIL_RENDEZVOUS 4 /* SMP rendezvous IPI */ +#define PIL_AST 5 /* asynchronous trap IPI */ +#define PIL_HARDCLOCK 6 /* hardclock broadcast */ +#define PIL_FILTER 11 /* filter interrupts */ +#define PIL_BRIDGE 12 /* bridge interrupts */ +#define PIL_STOP 13 /* stop CPU IPI */ #define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Sat Oct 20 10:51:32 2012 (r241779) +++ head/sys/sparc64/sparc64/intr_machdep.c Sat Oct 20 12:07:48 2012 (r241780) @@ -92,15 +92,15 @@ static uint16_t intr_stray_count[IV_MAX] static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ + "preempt", /* PIL_PREEMPT */ "ithrd", /* PIL_ITHREAD */ "rndzvs", /* PIL_RENDEZVOUS */ "ast", /* PIL_AST */ - "stop", /* PIL_STOP */ - "preempt", /* PIL_PREEMPT */ "hardclock", /* PIL_HARDCLOCK */ "stray", "stray", "stray", "stray", "filter", /* PIL_FILTER */ "bridge", /* PIL_BRIDGE */ + "stop", /* PIL_STOP */ "tick", /* PIL_TICK */ }; From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 12:53:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58341EA5; Sat, 20 Oct 2012 12:53:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABBD8FC0A; Sat, 20 Oct 2012 12:53:02 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 62435B948; Sat, 20 Oct 2012 08:53:01 -0400 (EDT) From: John Baldwin To: Warner Losh Subject: Re: svn commit: r241757 - head/usr.sbin/pciconf Date: Sat, 20 Oct 2012 08:30:26 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <201210192248.q9JMmMpt093234@svn.freebsd.org> In-Reply-To: <201210192248.q9JMmMpt093234@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210200830.26755.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Oct 2012 08:53:01 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 12:53:02 -0000 On Friday, October 19, 2012 06:48:22 PM Warner Losh wrote: > Author: imp > Date: Fri Oct 19 22:48:22 2012 > New Revision: 241757 > URL: http://svn.freebsd.org/changeset/base/241757 > > Log: > Indent ecaps the same way we indent caps. This was on purpose so the '=' signs line up. In fact, prior to this change, all of the equal signs line up: igb0@pci0:8:0:0: class=0x020000 card=0x10a715d9 chip=0x10a78086 rev=0x02 hdr=0x00 vendor = 'Intel Corporation' device = '82575EB Gigabit Network Connection' class = network subclass = ethernet bar [10] = type Memory, range 32, base 0xda020000, size 131072, enabled bar [14] = type Memory, range 32, base 0xda000000, size 131072, enabled bar [18] = type I/O Port, range 32, base 0x3000, size 32, enabled bar [1c] = type Memory, range 32, base 0xda080000, size 16384, enabled cap 01[40] = powerspec 2 supports D0 D3 current D0 cap 05[50] = MSI supports 1 message, 64 bit cap 11[60] = MSI-X supports 10 messages in map 0x1c enabled cap 10[a0] = PCI-Express 2 endpoint max data 128(256) link x4(x4) ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected ecap 0003[140] = Serial 1 003048ffff5f9170 PCI-e errors = Correctable Error Detected Unsupported Request Detected Corrected = Advisory Non-Fatal Error -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 12:53:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 818C6EA7; Sat, 20 Oct 2012 12:53:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 55A778FC0C; Sat, 20 Oct 2012 12:53:03 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AF991B93B; Sat, 20 Oct 2012 08:53:02 -0400 (EDT) From: John Baldwin To: Warner Losh Subject: Re: svn commit: r241758 - head/sys/dev/pci Date: Sat, 20 Oct 2012 08:33:08 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <201210192310.q9JNAt7n096894@svn.freebsd.org> In-Reply-To: <201210192310.q9JNAt7n096894@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210200833.08542.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Oct 2012 08:53:02 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 12:53:03 -0000 On Friday, October 19, 2012 07:10:55 PM Warner Losh wrote: > Author: imp > Date: Fri Oct 19 23:10:55 2012 > New Revision: 241758 > URL: http://svn.freebsd.org/changeset/base/241758 > > Log: > Add missing Extended Capability ID Numbers from PCIe 3.0. Can you add these names to the switch in pciconf's cap.c? > +#define PCIZ_DPC 0x001d /* Downstream Porto Containment */ s/Porto/Port/? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 12:53:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1138EA9; Sat, 20 Oct 2012 12:53:03 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B42088FC12; Sat, 20 Oct 2012 12:53:02 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 12BB6B958; Sat, 20 Oct 2012 08:53:02 -0400 (EDT) From: John Baldwin To: Ed Schouten Subject: Re: svn commit: r241776 - head/usr.sbin/mfiutil Date: Sat, 20 Oct 2012 08:31:37 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <201210201020.q9KAK6dh005471@svn.freebsd.org> In-Reply-To: <201210201020.q9KAK6dh005471@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210200831.37535.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Oct 2012 08:53:02 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 12:53:04 -0000 On Saturday, October 20, 2012 06:20:06 AM Ed Schouten wrote: > Author: ed > Date: Sat Oct 20 10:20:06 2012 > New Revision: 241776 > URL: http://svn.freebsd.org/changeset/base/241776 > > Log: > Remove redundant code. > > Both mfi_flash.c and mfi_show.c contain very similar functions to print > a list of firmwares. Move these routines into mfiutil.c. > > Reported by: jhb Thanks. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 12:53:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B8E02EB; Sat, 20 Oct 2012 12:53:15 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB85F8FC1D; Sat, 20 Oct 2012 12:53:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KCrE10030457; Sat, 20 Oct 2012 12:53:14 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KCrEFf030454; Sat, 20 Oct 2012 12:53:14 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210201253.q9KCrEFf030454@svn.freebsd.org> From: Andre Oppermann Date: Sat, 20 Oct 2012 12:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241781 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 12:53:16 -0000 Author: andre Date: Sat Oct 20 12:53:14 2012 New Revision: 241781 URL: http://svn.freebsd.org/changeset/base/241781 Log: Hide the unfortunate named sysctl kern.ipc.somaxconn from sysctl -a output and replace it with a new visible sysctl kern.ipc.acceptqueue of the same functionality. It specifies the maximum length of the accept queue on a listen socket. The old kern.ipc.somaxconn remains available for reading and writing for compatibility reasons so that existing programs, scripts and configurations continue to work. There no plans to ever remove the orginal and now hidden kern.ipc.somaxconn. Modified: head/lib/libc/sys/listen.2 head/sys/kern/uipc_socket.c Modified: head/lib/libc/sys/listen.2 ============================================================================== --- head/lib/libc/sys/listen.2 Sat Oct 20 12:07:48 2012 (r241780) +++ head/lib/libc/sys/listen.2 Sat Oct 20 12:53:14 2012 (r241781) @@ -28,7 +28,7 @@ .\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 29, 2005 +.Dd October 20, 2012 .Dt LISTEN 2 .Os .Sh NAME @@ -102,15 +102,15 @@ of service attacks are no longer necessa The .Xr sysctl 3 MIB variable -.Va kern.ipc.somaxconn +.Va kern.ipc.soacceptqueue specifies a hard limit on .Fa backlog ; if a value greater than -.Va kern.ipc.somaxconn +.Va kern.ipc.soacceptqueue or less than zero is specified, .Fa backlog is silently forced to -.Va kern.ipc.somaxconn . +.Va kern.ipc.soacceptqueue . .Sh INTERACTION WITH ACCEPT FILTERS When accept filtering is used on a socket, a second queue will be used to hold sockets that have connected, but have not yet @@ -168,3 +168,17 @@ at run-time, and to use a negative .Fa backlog to request the maximum allowable value, was introduced in .Fx 2.2 . +The +.Va kern.ipc.somaxconn +.Xr sysctl 3 +has been replaced with +.Va kern.ipc.soacceptqueue +in +.Fx 10.0 +to prevent confusion its actual functionality. +The original +.Xr sysctl 3 +.Va kern.ipc.somaxconn +is still available but hidden from a +.Xr sysctl 3 +-a output so that existing applications and scripts continue to work. Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Oct 20 12:07:48 2012 (r241780) +++ head/sys/kern/uipc_socket.c Sat Oct 20 12:53:14 2012 (r241781) @@ -185,6 +185,8 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol co /* * Limit on the number of connections in the listen queue waiting * for accept(2). + * NB: The orginal sysctl somaxconn is still available but hidden + * to prevent confusion about the actually purpose of this number. */ static int somaxconn = SOMAXCONN; @@ -205,9 +207,13 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS) somaxconn = val; return (0); } -SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, CTLTYPE_UINT | CTLFLAG_RW, 0, sizeof(int), sysctl_somaxconn, "I", "Maximum listen socket pending connection accept queue size"); +SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP, + 0, sizeof(int), sysctl_somaxconn, "I", + "Maximum listen socket pending connection accept queue size (compat)"); static int numopensockets; SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 14:54:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BE30458; Sat, 20 Oct 2012 14:54:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54FAC8FC0A; Sat, 20 Oct 2012 14:54:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KEsoKK049564; Sat, 20 Oct 2012 14:54:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KEsoMS049562; Sat, 20 Oct 2012 14:54:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210201454.q9KEsoMS049562@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 20 Oct 2012 14:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241783 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 14:54:50 -0000 Author: bapt Date: Sat Oct 20 14:54:49 2012 New Revision: 241783 URL: http://svn.freebsd.org/changeset/base/241783 Log: pkg_add is no more the default tool, make motd recommand using pkg install instead of pkg_add Modified: head/etc/motd Modified: head/etc/motd ============================================================================== --- head/etc/motd Sat Oct 20 14:21:24 2012 (r241782) +++ head/etc/motd Sat Oct 20 14:54:49 2012 (r241783) @@ -11,7 +11,7 @@ o Security advisories and updated errat o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to http://www.FreeBSD.org/search/. If the doc package has been installed - (or fetched via pkg_add -r lang-freebsd-doc, where lang is the + (or fetched via pkg install lang-freebsd-doc, where lang is the 2-letter language code, e.g. en), they are also available formatted in /usr/local/share/doc/freebsd. From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 15:30:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47AD85BE; Sat, 20 Oct 2012 15:30:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F09D8FC0A; Sat, 20 Oct 2012 15:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KFUFcF055644; Sat, 20 Oct 2012 15:30:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KFUEGG055641; Sat, 20 Oct 2012 15:30:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210201530.q9KFUEGG055641@svn.freebsd.org> From: Eitan Adler Date: Sat, 20 Oct 2012 15:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241784 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 15:30:15 -0000 Author: eadler Date: Sat Oct 20 15:30:14 2012 New Revision: 241784 URL: http://svn.freebsd.org/changeset/base/241784 Log: Adds 4K quirks for the some SSD's which all perform better when 4K aligned and only except 4K deletes (TRIM). PR: kern/169974 Submitted by: Steven Hartland Tested by: ak Reviewed by: mav Approved by: cperciva (implicit) MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Oct 20 14:54:49 2012 (r241783) +++ head/sys/cam/ata/ata_da.c Sat Oct 20 15:30:14 2012 (r241784) @@ -269,6 +269,116 @@ static struct ada_quirk_entry ada_quirk_ /*quirks*/ADA_Q_4K }, { + /* + * Corsair Force 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair CSSD-F*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Corsair Force 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force 3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Agility 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 2 SSDs (inc pro series) + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Crucial RealSSD C300 SSDs + * 4k optimised + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/ADA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Intel 330 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2ct*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Deneva R Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "DENRSTE251M45*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Kingston HyperX 3k SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { /* Default */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 15:39:10 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB4F6BB5; Sat, 20 Oct 2012 15:39:10 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 698A28FC08; Sat, 20 Oct 2012 15:39:09 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q9KFd1fi057382; Sat, 20 Oct 2012 17:39:01 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <5082C595.3040504@FreeBSD.org> Date: Sat, 20 Oct 2012 17:39:01 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r241777 - in head: bin/dd libexec/rpc.rusersd libexec/talkd usr.bin/cksum usr.bin/m4 usr.sbin/mtree usr.sbin/newsyslog usr.sbin/services_mkdb References: <201210201033.q9KAXGRm007583@svn.freebsd.org> In-Reply-To: <201210201033.q9KAXGRm007583@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 15:39:10 -0000 On 20.10.12 12:33, Ed Schouten wrote: > Author: ed > Date: Sat Oct 20 10:33:15 2012 > New Revision: 241777 > URL: http://svn.freebsd.org/changeset/base/241777 > > Log: > More -Wmissing-variable-declarations fixes. > > In addition to adding missing `static' keywords: > - bin/dd: Pull in `extern.h' to guarantee consistency with source file. > - libexec/rpc.rusersd: Move shared globals into an extern.h. > - libexec/talkd: Move `debug' and `hostname' into extern.h. > - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. > - usr.bin/m4: Move `end_result' into extern.h. > - usr.sbin/services_mkdb: Move shared globals into an extern.h. Hi Ed, I get the same failures (on amd64/powerpc64) as the TB on mips for example: /src/usr.bin/m4/parser.y:26:18: error: mdef.h: No such file or directory /src/usr.bin/m4/parser.y:27:20: error: extern.h: No such file or directory Is this the right fix? TIA, Andreas Index: Makefile =================================================================== --- Makefile (revision 241783) +++ Makefile (working copy) @@ -5,7 +5,7 @@ # if you want the paste & spaste macros. PROG= m4 -CFLAGS+=-DEXTENDED -I${.CURDIR}/lib +CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib LDADD= -ly -ll -lm # clang needs 1 while with gcc we can use 2 #WARNS= 1 From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 16:57:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F4B01FB; Sat, 20 Oct 2012 16:57:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172F48FC0A; Sat, 20 Oct 2012 16:57:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KGvNVR070183; Sat, 20 Oct 2012 16:57:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KGvNX5070177; Sat, 20 Oct 2012 16:57:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210201657.q9KGvNX5070177@svn.freebsd.org> From: Andriy Gapon Date: Sat, 20 Oct 2012 16:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241785 - in head/sys/boot: efi ficl i386 userboot/ficl zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 16:57:24 -0000 Author: avg Date: Sat Oct 20 16:57:23 2012 New Revision: 241785 URL: http://svn.freebsd.org/changeset/base/241785 Log: boot: use -march=i386 for both i386 and amd64 builds .. so that consistent compilation algorithms are used for both architectures as in practice the binaries are expected to be interchangeable (for time being). Previously i386 used default setting which were equivalent to -march=i486 -mtune=generic. The only difference is using smaller but slower "leave" instructions. Discussed with: jhb, dim MFC after: 29 days Modified: head/sys/boot/efi/Makefile.inc head/sys/boot/ficl/Makefile head/sys/boot/i386/Makefile.inc head/sys/boot/userboot/ficl/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/efi/Makefile.inc ============================================================================== --- head/sys/boot/efi/Makefile.inc Sat Oct 20 15:30:14 2012 (r241784) +++ head/sys/boot/efi/Makefile.inc Sat Oct 20 16:57:23 2012 (r241785) @@ -2,8 +2,12 @@ BINDIR?= /boot +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 +.endif + .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Sat Oct 20 15:30:14 2012 (r241784) +++ head/sys/boot/ficl/Makefile Sat Oct 20 16:57:23 2012 (r241785) @@ -8,6 +8,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -39,7 +40,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 -I. +CFLAGS+= -m32 -I. .endif .if ${MACHINE_ARCH} == "powerpc64" Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Sat Oct 20 15:30:14 2012 (r241784) +++ head/sys/boot/i386/Makefile.inc Sat Oct 20 16:57:23 2012 (r241785) @@ -5,12 +5,12 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: head/sys/boot/userboot/ficl/Makefile ============================================================================== --- head/sys/boot/userboot/ficl/Makefile Sat Oct 20 15:30:14 2012 (r241784) +++ head/sys/boot/userboot/ficl/Makefile Sat Oct 20 16:57:23 2012 (r241785) @@ -12,6 +12,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -fPIC .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +#CFLAGS+= -march=i386 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif .if ${MACHINE_CPUARCH} == "i386" @@ -46,7 +47,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr #.if ${MACHINE_CPUARCH} == "amd64" -#CFLAGS+= -m32 -march=i386 -I. +#CFLAGS+= -m32 -I. #.endif .if ${MACHINE_ARCH} == "powerpc64" Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Sat Oct 20 15:30:14 2012 (r241784) +++ head/sys/boot/zfs/Makefile Sat Oct 20 16:57:23 2012 (r241785) @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -19,7 +20,7 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -m CFLAGS+= -msoft-float .endif .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 17:28:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05A83B84; Sat, 20 Oct 2012 17:28:23 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id BE57B8FC12; Sat, 20 Oct 2012 17:28:22 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 945B84C0275; Sat, 20 Oct 2012 12:23:04 -0500 (CDT) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 92BFA4C0274; Sat, 20 Oct 2012 12:23:04 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id R5UvkuFyh4t3; Sat, 20 Oct 2012 12:23:04 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 1B7C94C0245; Sat, 20 Oct 2012 12:23:04 -0500 (CDT) Message-ID: <5082DDF6.9010901@rice.edu> Date: Sat, 20 Oct 2012 12:23:02 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r241781 - in head: lib/libc/sys sys/kern References: <201210201253.q9KCrEFf030454@svn.freebsd.org> In-Reply-To: <201210201253.q9KCrEFf030454@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 17:28:23 -0000 There are couple minor grammar issues in the text. See below. Alan On 10/20/2012 07:53, Andre Oppermann wrote: > Author: andre > Date: Sat Oct 20 12:53:14 2012 > New Revision: 241781 > URL: http://svn.freebsd.org/changeset/base/241781 > > Log: > Hide the unfortunate named sysctl kern.ipc.somaxconn from sysctl -a > output and replace it with a new visible sysctl kern.ipc.acceptqueue > of the same functionality. It specifies the maximum length of the > accept queue on a listen socket. > > The old kern.ipc.somaxconn remains available for reading and writing > for compatibility reasons so that existing programs, scripts and > configurations continue to work. There no plans to ever remove the > orginal and now hidden kern.ipc.somaxconn. > > Modified: > head/lib/libc/sys/listen.2 > head/sys/kern/uipc_socket.c > > Modified: head/lib/libc/sys/listen.2 > ============================================================================== > --- head/lib/libc/sys/listen.2 Sat Oct 20 12:07:48 2012 (r241780) > +++ head/lib/libc/sys/listen.2 Sat Oct 20 12:53:14 2012 (r241781) > @@ -28,7 +28,7 @@ > .\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93 > .\" $FreeBSD$ > .\" > -.Dd August 29, 2005 > +.Dd October 20, 2012 > .Dt LISTEN 2 > .Os > .Sh NAME > @@ -102,15 +102,15 @@ of service attacks are no longer necessa > The > .Xr sysctl 3 > MIB variable > -.Va kern.ipc.somaxconn > +.Va kern.ipc.soacceptqueue > specifies a hard limit on > .Fa backlog ; > if a value greater than > -.Va kern.ipc.somaxconn > +.Va kern.ipc.soacceptqueue > or less than zero is specified, > .Fa backlog > is silently forced to > -.Va kern.ipc.somaxconn . > +.Va kern.ipc.soacceptqueue . > .Sh INTERACTION WITH ACCEPT FILTERS > When accept filtering is used on a socket, a second queue will > be used to hold sockets that have connected, but have not yet > @@ -168,3 +168,17 @@ at run-time, and to use a negative > .Fa backlog > to request the maximum allowable value, was introduced in > .Fx 2.2 . > +The > +.Va kern.ipc.somaxconn > +.Xr sysctl 3 > +has been replaced with > +.Va kern.ipc.soacceptqueue > +in > +.Fx 10.0 > +to prevent confusion its actual functionality. There is a missing word here: "... confusion about its ..." > +The original > +.Xr sysctl 3 > +.Va kern.ipc.somaxconn > +is still available but hidden from a > +.Xr sysctl 3 > +-a output so that existing applications and scripts continue to work. > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Sat Oct 20 12:07:48 2012 (r241780) > +++ head/sys/kern/uipc_socket.c Sat Oct 20 12:53:14 2012 (r241781) > @@ -185,6 +185,8 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol co > /* > * Limit on the number of connections in the listen queue waiting > * for accept(2). > + * NB: The orginal sysctl somaxconn is still available but hidden > + * to prevent confusion about the actually purpose of this number. "actually" should be "actual". > */ > static int somaxconn = SOMAXCONN; > > @@ -205,9 +207,13 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS) > somaxconn = val; > return (0); > } > -SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLTYPE_UINT | CTLFLAG_RW, > +SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, CTLTYPE_UINT | CTLFLAG_RW, > 0, sizeof(int), sysctl_somaxconn, "I", > "Maximum listen socket pending connection accept queue size"); > +SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, > + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP, > + 0, sizeof(int), sysctl_somaxconn, "I", > + "Maximum listen socket pending connection accept queue size (compat)"); > > static int numopensockets; > SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, > From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 17:36:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D882AF26; Sat, 20 Oct 2012 17:36:19 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id AE5028FC0C; Sat, 20 Oct 2012 17:36:19 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:b891:a049:b30d:2379] (unknown [IPv6:2601:9:4d00:85:b891:a049:b30d:2379]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 6D4B739827; Sat, 20 Oct 2012 10:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1350754573; bh=s/s+gqlX0Kx6XfMhVfmMUydtCAI3JA6+APW/C2MNcck=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Px+1nqk4JeWnJ5dmWGRGaYplGWkNQxVJIiL+AkdfgY7L8jmpKJ+1JKjDmiOLVgkLq bLczS/ZuJQaz1XG5gfHb8L8jtXEgvKT6LZxNJzAnJr1hnFJ+v9AZSfO4Lq7weIJBM+ uXAO0LrLKB3czPE8UkeDqdLLNcbcdaInhkZvQUBY= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r241758 - head/sys/dev/pci From: Rui Paulo In-Reply-To: <201210200833.08542.jhb@freebsd.org> Date: Sat, 20 Oct 2012 10:36:12 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201210192310.q9JNAt7n096894@svn.freebsd.org> <201210200833.08542.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 17:36:19 -0000 On 20 Oct 2012, at 05:33, John Baldwin wrote: > On Friday, October 19, 2012 07:10:55 PM Warner Losh wrote: >> Author: imp >> Date: Fri Oct 19 23:10:55 2012 >> New Revision: 241758 >> URL: http://svn.freebsd.org/changeset/base/241758 >> >> Log: >> Add missing Extended Capability ID Numbers from PCIe 3.0. > > Can you add these names to the switch in pciconf's cap.c? > >> +#define PCIZ_DPC 0x001d /* Downstream Porto Containment */ > > s/Porto/Port/? Warner was thinking of booze... :-) -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 18:05:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6578914; Sat, 20 Oct 2012 18:05:27 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE01E8FC12; Sat, 20 Oct 2012 18:05:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KI5RIS080860; Sat, 20 Oct 2012 18:05:27 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KI5RPt080858; Sat, 20 Oct 2012 18:05:27 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201210201805.q9KI5RPt080858@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 20 Oct 2012 18:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241787 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 18:05:28 -0000 Author: ume Date: Sat Oct 20 18:05:27 2012 New Revision: 241787 URL: http://svn.freebsd.org/changeset/base/241787 Log: Use correct INDEX on 10-CURRENT. Modified: head/etc/defaults/periodic.conf Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Sat Oct 20 17:27:57 2012 (r241786) +++ head/etc/defaults/periodic.conf Sat Oct 20 18:05:27 2012 (r241787) @@ -245,7 +245,7 @@ weekly_noid_dirs="/" # Look here # 400.status-pkg weekly_status_pkg_enable="NO" # Find out-of-date pkgs pkg_version=pkg_version # Use this program -pkg_version_index=/usr/ports/INDEX-9 # Use this index file +pkg_version_index=/usr/ports/INDEX-10 # Use this index file # 999.local weekly_local="/etc/weekly.local" # Local scripts From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 18:13:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80410CFC; Sat, 20 Oct 2012 18:13:21 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68AF88FC08; Sat, 20 Oct 2012 18:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KIDLj2082055; Sat, 20 Oct 2012 18:13:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KIDLte082053; Sat, 20 Oct 2012 18:13:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201210201813.q9KIDLte082053@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 20 Oct 2012 18:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241788 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 18:13:21 -0000 Author: ume Date: Sat Oct 20 18:13:20 2012 New Revision: 241788 URL: http://svn.freebsd.org/changeset/base/241788 Log: Set default for ${pkg_info} like ${pkg_version}. MFC after: 1 week Modified: head/etc/defaults/periodic.conf Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Sat Oct 20 18:05:27 2012 (r241787) +++ head/etc/defaults/periodic.conf Sat Oct 20 18:13:20 2012 (r241788) @@ -144,6 +144,7 @@ daily_status_ntpd_enable="NO" # Check # 490.status-pkg-changes daily_status_pkg_changes_enable="NO" # Show package changes +pkg_info="pkg_info" # Use this program # 500.queuerun daily_queuerun_enable="YES" # Run mail queue From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 18:24:23 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 810BF16C; Sat, 20 Oct 2012 18:24:23 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mx1.freebsd.org (Postfix) with ESMTP id 9DC3A8FC12; Sat, 20 Oct 2012 18:24:16 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKUILsT02uGc9YTnr38S64+MMMI8V0eluq@postini.com; Sat, 20 Oct 2012 11:24:23 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Sat, 20 Oct 2012 11:18:23 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q9KIIMh90987; Sat, 20 Oct 2012 11:18:22 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id A6C6C58094; Sat, 20 Oct 2012 11:18:22 -0700 (PDT) To: Bruce Evans Subject: Re: svn commit: r241298 - in head: . gnu/usr.bin/cc/cc_int gnu/usr.bin/cc/include kerberos5 kerberos5/tools/asn1_compile kerberos5/tools/slc lib/clang/include share/mk tools/build/make_check usr.sbin/c... In-Reply-To: <20121020205008.C1781@besplex.bde.org> References: <201210062001.q96K16Or030755@svn.freebsd.org> <20121007161440.C7605@besplex.bde.org> <81CB9A3A-4BFF-41B2-A1F9-3721A40F6260@xcllnt.net> <20121008165228.F7997@besplex.bde.org> <965E2363-6866-4A10-A7B1-C428B3C78925@xcllnt.net> <20121020205008.C1781@besplex.bde.org> Comments: In-reply-to: Bruce Evans message dated "Sat, 20 Oct 2012 21:13:36 +1100." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Sat, 20 Oct 2012 11:18:22 -0700 Message-ID: <20121020181822.A6C6C58094@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , Marcel Moolenaar , "src-committers@FreeBSD.org" , sjg@juniper.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 18:24:23 -0000 On Sat, 20 Oct 2012 21:13:36 +1100 (EST), Bruce Evans writes: >Back to the old thread. Followup to the new commit thread. I seem to have missed a bit of the conversation, so sorry if some of this has been done to death already. First some background: I believe the reason for the original change (which was wrong btw, I had stared at that diff many times and saw it as what I expected it to be - which I think Marcel has now committed), is that .ORDER does not work in jobs mode in the presence of explicit dependencies (see below). Since we auto collect dependencies during the build, we've learned to avoid .ORDER, it is often responsible for introducing cycles in the dependency graph. Given the makefile: --------------------8<-------------------- .MAIN: all ALPHA=a b c d e f g h i j k l m n o p q r s t u v w x y z SECS?=1 ${ALPHA}: @echo "`date +%s` $@..."; sleep ${SECS} .NOPATH: ${ALPHA} .PHONY: ${ALPHA} ALL=r a l p h i s g i t .ifdef ORDER x!= echo .ORDER: r a l p h >&2; echo .ORDER: r a l p h .endif all: ${ALL} .ifdef DEPS_A x!= echo a: p e >&2; echo a: p e .endif --------------------8<-------------------- The following is using FreeBSD make from 10.x (though it doesn't make any difference): First compat mode: $ fmake -r -f /home/sjg/make-tests/order 1350755164 r... 1350755165 a... 1350755166 l... 1350755168 p... 1350755169 h... 1350755170 i... 1350755171 s... 1350755172 g... 1350755173 t... $ Looks as you would expect, as does jobs mode: $ fmake -r -f /home/sjg/make-tests/order -j3 1350755240 r... 1350755240 l... 1350755240 a... 1350755241 p... 1350755241 h... 1350755241 i... 1350755242 s... 1350755242 g... 1350755242 t... $ Ie. the order is no longer as listed, but we haven't introduce .ORDER yet. When we throw .ORDER in: $ fmake -r -f /home/sjg/make-tests/order -j3 -DORDER .ORDER: r a l p h 1350755270 s... 1350755270 i... 1350755270 r... 1350755271 g... 1350755271 t... 1350755271 a... 1350755272 l... 1350755273 p... 1350755275 h... $ This is again what we should expect, the order is not as listed but the sequence r a l p h is correctly ordered. However, as soon as we thrown in an explicit dependency - not even one that would conflict: $ fmake -r -f /home/sjg/make-tests/order -j3 -DORDER -DDEPS_A .ORDER: r a l p h a: p e 1350755349 r... 1350755350 i... 1350755350 s... 1350755351 g... 1350755351 t... 1350755351 e... $ That is simply incorrect. Even if we go back to compat mode: $ fmake -r -f /home/sjg/make-tests/order -DORDER -DDEPS_A .ORDER: r a l p h a: p e 1350755881 r... 1350755882 p... 1350755883 e... 1350755884 a... 1350755885 l... 1350755887 h... 1350755888 i... 1350755889 s... 1350755890 g... 1350755891 t... $ This is not correct either, but you can see that the dependency takes precedence over .ORDER. The results with bmake are more spectaclular since it detects that it is lost a spews its complaints: $ bmake -r -f /home/sjg/make-tests/order -DORDER -DDEPS_A -j3 .ORDER: r a l p h a: p e --- r --- 1350756420 r... `p' was not built (made 1, flags 2009, type b030001)! `p' has .ORDER dependency against l (made 0, flags 9, type b030001) `e' was not built (made 0, flags 2009, type b030001)! `l' was not built (made 0, flags 2009, type b030001)! `l' has .ORDER dependency against a (made 1, flags 3019, type b030001) `h' was not built (made 0, flags 2009, type b030001)! `h' has .ORDER dependency against p (made 1, flags 2009, type b030001) `i' was not built (made 0, flags 2009, type b030001)! `s' was not built (made 0, flags 2009, type b030001)! `g' was not built (made 0, flags 2009, type b030001)! `t' was not built (made 0, flags 2009, type b030001)! $ This is actually handy since you can check build logs for that sort of thing and know you have an issue. The current logic does (for the interesting case - assuming yacc -d etc) parser.h: parser.y yacc etc parser.c: parser.h touch ${.TARGET} the only downside of this, is that if parser.c is removed but parser.h is left alone, and empty parser.c will be produced. This is actually a safe failure mode (build will fail), for what is essentially a corner case. In all other respects the above is preferable because it works reliably in jobs mode and it avoids any risk of running yacc multiple times to do the same thing, and will not conflict with any auto collected dependencies (assuming parser.c includes parser.h) --sjg From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 19:38:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30B78C6F; Sat, 20 Oct 2012 19:38:23 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18C4C8FC18; Sat, 20 Oct 2012 19:38:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KJcMnp094833; Sat, 20 Oct 2012 19:38:22 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KJcMoG094830; Sat, 20 Oct 2012 19:38:22 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210201938.q9KJcMoG094830@svn.freebsd.org> From: Andre Oppermann Date: Sat, 20 Oct 2012 19:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241789 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 19:38:23 -0000 Author: andre Date: Sat Oct 20 19:38:22 2012 New Revision: 241789 URL: http://svn.freebsd.org/changeset/base/241789 Log: Grammar fixes to r241781. Submitted by: alc Modified: head/lib/libc/sys/listen.2 head/sys/kern/uipc_socket.c Modified: head/lib/libc/sys/listen.2 ============================================================================== --- head/lib/libc/sys/listen.2 Sat Oct 20 18:13:20 2012 (r241788) +++ head/lib/libc/sys/listen.2 Sat Oct 20 19:38:22 2012 (r241789) @@ -175,7 +175,7 @@ has been replaced with .Va kern.ipc.soacceptqueue in .Fx 10.0 -to prevent confusion its actual functionality. +to prevent confusion about its actual functionality. The original .Xr sysctl 3 .Va kern.ipc.somaxconn Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Oct 20 18:13:20 2012 (r241788) +++ head/sys/kern/uipc_socket.c Sat Oct 20 19:38:22 2012 (r241789) @@ -186,7 +186,7 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol co * Limit on the number of connections in the listen queue waiting * for accept(2). * NB: The orginal sysctl somaxconn is still available but hidden - * to prevent confusion about the actually purpose of this number. + * to prevent confusion about the actual purpose of this number. */ static int somaxconn = SOMAXCONN; From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 19:40:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A48EDF2 for ; Sat, 20 Oct 2012 19:40:33 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id A33E08FC16 for ; Sat, 20 Oct 2012 19:40:32 +0000 (UTC) Received: (qmail 45225 invoked from network); 20 Oct 2012 21:18:56 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 20 Oct 2012 21:18:56 -0000 Message-ID: <5082FE1E.9070500@freebsd.org> Date: Sat, 20 Oct 2012 21:40:14 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r241781 - in head: lib/libc/sys sys/kern References: <201210201253.q9KCrEFf030454@svn.freebsd.org> <5082DDF6.9010901@rice.edu> In-Reply-To: <5082DDF6.9010901@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 19:40:33 -0000 On 20.10.2012 19:23, Alan Cox wrote: > There are couple minor grammar issues in the text. See below. Thank you. Fixed in r241789. -- Andre > Alan > > On 10/20/2012 07:53, Andre Oppermann wrote: >> Author: andre >> Date: Sat Oct 20 12:53:14 2012 >> New Revision: 241781 >> URL: http://svn.freebsd.org/changeset/base/241781 >> >> Log: >> Hide the unfortunate named sysctl kern.ipc.somaxconn from sysctl -a >> output and replace it with a new visible sysctl kern.ipc.acceptqueue >> of the same functionality. It specifies the maximum length of the >> accept queue on a listen socket. >> >> The old kern.ipc.somaxconn remains available for reading and writing >> for compatibility reasons so that existing programs, scripts and >> configurations continue to work. There no plans to ever remove the >> orginal and now hidden kern.ipc.somaxconn. >> >> Modified: >> head/lib/libc/sys/listen.2 >> head/sys/kern/uipc_socket.c >> >> Modified: head/lib/libc/sys/listen.2 >> ============================================================================== >> --- head/lib/libc/sys/listen.2 Sat Oct 20 12:07:48 2012 (r241780) >> +++ head/lib/libc/sys/listen.2 Sat Oct 20 12:53:14 2012 (r241781) >> @@ -28,7 +28,7 @@ >> .\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93 >> .\" $FreeBSD$ >> .\" >> -.Dd August 29, 2005 >> +.Dd October 20, 2012 >> .Dt LISTEN 2 >> .Os >> .Sh NAME >> @@ -102,15 +102,15 @@ of service attacks are no longer necessa >> The >> .Xr sysctl 3 >> MIB variable >> -.Va kern.ipc.somaxconn >> +.Va kern.ipc.soacceptqueue >> specifies a hard limit on >> .Fa backlog ; >> if a value greater than >> -.Va kern.ipc.somaxconn >> +.Va kern.ipc.soacceptqueue >> or less than zero is specified, >> .Fa backlog >> is silently forced to >> -.Va kern.ipc.somaxconn . >> +.Va kern.ipc.soacceptqueue . >> .Sh INTERACTION WITH ACCEPT FILTERS >> When accept filtering is used on a socket, a second queue will >> be used to hold sockets that have connected, but have not yet >> @@ -168,3 +168,17 @@ at run-time, and to use a negative >> .Fa backlog >> to request the maximum allowable value, was introduced in >> .Fx 2.2 . >> +The >> +.Va kern.ipc.somaxconn >> +.Xr sysctl 3 >> +has been replaced with >> +.Va kern.ipc.soacceptqueue >> +in >> +.Fx 10.0 >> +to prevent confusion its actual functionality. > > There is a missing word here: "... confusion about its ..." > >> +The original >> +.Xr sysctl 3 >> +.Va kern.ipc.somaxconn >> +is still available but hidden from a >> +.Xr sysctl 3 >> +-a output so that existing applications and scripts continue to work. >> >> Modified: head/sys/kern/uipc_socket.c >> ============================================================================== >> --- head/sys/kern/uipc_socket.c Sat Oct 20 12:07:48 2012 (r241780) >> +++ head/sys/kern/uipc_socket.c Sat Oct 20 12:53:14 2012 (r241781) >> @@ -185,6 +185,8 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol co >> /* >> * Limit on the number of connections in the listen queue waiting >> * for accept(2). >> + * NB: The orginal sysctl somaxconn is still available but hidden >> + * to prevent confusion about the actually purpose of this number. > > "actually" should be "actual". > >> */ >> static int somaxconn = SOMAXCONN; >> >> @@ -205,9 +207,13 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS) >> somaxconn = val; >> return (0); >> } >> -SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLTYPE_UINT | CTLFLAG_RW, >> +SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, CTLTYPE_UINT | CTLFLAG_RW, >> 0, sizeof(int), sysctl_somaxconn, "I", >> "Maximum listen socket pending connection accept queue size"); >> +SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, >> + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP, >> + 0, sizeof(int), sysctl_somaxconn, "I", >> + "Maximum listen socket pending connection accept queue size (compat)"); >> >> static int numopensockets; >> SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, >> > > > From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 22:44:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C8AD1BE; Sat, 20 Oct 2012 22:44:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32D9B8FC14; Sat, 20 Oct 2012 22:44:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KMiNAQ023525; Sat, 20 Oct 2012 22:44:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KMiMer023523; Sat, 20 Oct 2012 22:44:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201210202244.q9KMiMer023523@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 20 Oct 2012 22:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241790 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 22:44:23 -0000 Author: marcel Date: Sat Oct 20 22:44:22 2012 New Revision: 241790 URL: http://svn.freebsd.org/changeset/base/241790 Log: Revert r241752. The claim that it's more correct while at the same time causing a build breakage is interesting to say the least. Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Oct 20 19:38:22 2012 (r241789) +++ head/share/mk/bsd.dep.mk Sat Oct 20 22:44:22 2012 (r241790) @@ -95,17 +95,16 @@ CLEANFILES+= ${_LC} SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES+= ${_YC} .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) -y.tab.h: ${_YSRC} +.ORDER: ${_YC} y.tab.h +${_YC} y.tab.h: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} -${_YC}: y.tab.h cp y.tab.c ${_YC} CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h -${_YH}: ${_YSRC} +${_YH}: ${_YC} +${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} -${_YC}: ${_YH} - @touch ${.TARGET} SRCS+= ${_YH} CLEANFILES+= ${_YH} .endfor From owner-svn-src-head@FreeBSD.ORG Sat Oct 20 23:13:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6C9BC3E; Sat, 20 Oct 2012 23:13:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BBF48FC08; Sat, 20 Oct 2012 23:13:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9KNDAiK028138; Sat, 20 Oct 2012 23:13:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9KNDAbc028136; Sat, 20 Oct 2012 23:13:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201210202313.q9KNDAbc028136@svn.freebsd.org> From: Glen Barber Date: Sat, 20 Oct 2012 23:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241791 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 23:13:10 -0000 Author: gjb (doc,ports committer) Date: Sat Oct 20 23:13:09 2012 New Revision: 241791 URL: http://svn.freebsd.org/changeset/base/241791 Log: Update ktr(4) to reflect changes from r239923. Reviewed by: attilio Modified: head/share/man/man4/ktr.4 Modified: head/share/man/man4/ktr.4 ============================================================================== --- head/share/man/man4/ktr.4 Sat Oct 20 22:44:22 2012 (r241790) +++ head/share/man/man4/ktr.4 Sat Oct 20 23:13:09 2012 (r241791) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2012 +.Dd October 20, 2012 .Dt KTR 4 .Os .Sh NAME @@ -85,6 +85,9 @@ Furthermore, there is a CPU event mask w the .Dv KTR_CPUMASK option. +When two or more parameters to +.Dv KTR_CPUMASK , +are used, it is important they are not separated by whitespace. A CPU must have the bit corresponding to its logical id set in this bitmask for events that occur on it to be logged. This mask can be set by the @@ -95,7 +98,12 @@ environment variable. It can also be examined and set after booting via the .Va debug.ktr.cpumask sysctl. -By default events on all CPUs are enabled. +By default, only CPUs specified in +.Dv KTR_CPUMASK +will log events. +See +.Pa sys/conf/NOTES +for more information. .Ss Verbose Mode By default, events are only logged to the internal buffer for examination later, but if the verbose flag is set then they are dumped to the kernel