From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 8 07:34:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05EC21065673; Sun, 8 Aug 2010 07:34:38 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E83E88FC20; Sun, 8 Aug 2010 07:34:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o787YbTn097005; Sun, 8 Aug 2010 07:34:37 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o787YbnZ097002; Sun, 8 Aug 2010 07:34:37 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008080734.o787YbnZ097002@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 8 Aug 2010 07:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211060 - stable/8/contrib/nvi/vi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 07:34:38 -0000 Author: jh Date: Sun Aug 8 07:34:37 2010 New Revision: 211060 URL: http://svn.freebsd.org/changeset/base/211060 Log: MFC r208612: Fixes from NetBSD for nvi visual mode PR: bin/21089, bin/136393 Modified: stable/8/contrib/nvi/vi/v_ex.c stable/8/contrib/nvi/vi/v_txt.c Directory Properties: stable/8/contrib/nvi/ (props changed) Modified: stable/8/contrib/nvi/vi/v_ex.c ============================================================================== --- stable/8/contrib/nvi/vi/v_ex.c Sun Aug 8 07:04:27 2010 (r211059) +++ stable/8/contrib/nvi/vi/v_ex.c Sun Aug 8 07:34:37 2010 (r211060) @@ -428,6 +428,10 @@ v_ex(sp, vp) if (tp->term == TERM_BS) break; + /* If the user changed their mind, return. */ + if (tp->term != TERM_OK) + break; + /* Log the command. */ if (O_STR(sp, O_CEDIT) != NULL && v_ecl_log(sp, tp)) return (1); Modified: stable/8/contrib/nvi/vi/v_txt.c ============================================================================== --- stable/8/contrib/nvi/vi/v_txt.c Sun Aug 8 07:04:27 2010 (r211059) +++ stable/8/contrib/nvi/vi/v_txt.c Sun Aug 8 07:34:37 2010 (r211060) @@ -510,15 +510,6 @@ next: if (v_event_get(sp, evp, 0, ec_fla case E_EOF: F_SET(sp, SC_EXIT_FORCE); return (1); - case E_INTERRUPT: - /* - * !!! - * Historically, exited the user from text input - * mode or cancelled a colon command, and returned to command - * mode. It also beeped the terminal, but that seems a bit - * excessive. - */ - goto k_escape; case E_REPAINT: if (vs_repaint(sp, &ev)) return (1); @@ -526,10 +517,37 @@ next: if (v_event_get(sp, evp, 0, ec_fla case E_WRESIZE: /* interrupts the input mode. */ v_emsg(sp, NULL, VIM_WRESIZE); - goto k_escape; + /* FALLTHROUGH */ default: - v_event_err(sp, evp); - goto k_escape; + if (evp->e_event != E_INTERRUPT && evp->e_event != E_WRESIZE) + v_event_err(sp, evp); + /* + * !!! + * Historically, exited the user from text input + * mode or cancelled a colon command, and returned to command + * mode. It also beeped the terminal, but that seems a bit + * excessive. + */ + /* + * If we are recording, morph into key so that + * we can repeat the command safely: there is no way to + * invalidate the repetition of an instance of a command, + * which would be the alternative possibility. + * If we are not recording (most likely on the command line), + * simply discard the input and return to command mode + * so that an INTERRUPT doesn't become for example a file + * completion request. -aymeric + */ + if (LF_ISSET(TXT_RECORD)) { + evp->e_event = E_CHARACTER; + evp->e_c = 033; + evp->e_flags = 0; + evp->e_value = K_ESCAPE; + break; + } else { + tp->term = TERM_ESC; + goto k_escape; + } } /* @@ -539,7 +557,7 @@ next: if (v_event_get(sp, evp, 0, ec_fla * This was not documented as far as I know, and is a great test of vi * clones. */ - if (rcol == 0 && !LF_ISSET(TXT_REPLAY) && evp->e_c == '\0') { + if (LF_ISSET(TXT_RECORD) && rcol == 0 && evp->e_c == '\0') { if (vip->rep == NULL) goto done; @@ -1456,6 +1474,7 @@ done: /* Leave input mode. */ err: alloc_err: + F_CLR(sp, SC_TINPUT); txt_err(sp, &sp->tiq); return (1); } @@ -2216,8 +2235,8 @@ txt_fc_col(sp, argc, argv) /* If the largest file name is too large, just print them. */ if (colwidth > sp->cols) { - p = msg_print(sp, av[0]->bp + prefix, &nf); for (ac = argc, av = argv; ac > 0; --ac, ++av) { + p = msg_print(sp, av[0]->bp + prefix, &nf); (void)ex_printf(sp, "%s\n", p); if (F_ISSET(gp, G_INTERRUPTED)) break; From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 8 09:06:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7ED01065676; Sun, 8 Aug 2010 09:06:59 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6E388FC22; Sun, 8 Aug 2010 09:06:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7896xUq017801; Sun, 8 Aug 2010 09:06:59 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7896xOv017799; Sun, 8 Aug 2010 09:06:59 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008080906.o7896xOv017799@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 8 Aug 2010 09:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211064 - stable/8/sys/geom/zero X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 09:07:00 -0000 Author: jh Date: Sun Aug 8 09:06:59 2010 New Revision: 211064 URL: http://svn.freebsd.org/changeset/base/211064 Log: MFC r207877: In g_zero_destroy_geom(), return 0 instead of EBUSY in the success case. EBUSY was probably used as a workaround for the deadlock fixed in r207671. Modified: stable/8/sys/geom/zero/g_zero.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/zero/g_zero.c ============================================================================== --- stable/8/sys/geom/zero/g_zero.c Sun Aug 8 08:43:01 2010 (r211063) +++ stable/8/sys/geom/zero/g_zero.c Sun Aug 8 09:06:59 2010 (r211064) @@ -104,7 +104,7 @@ g_zero_destroy_geom(struct gctl_req *req if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) return (EBUSY); g_wither_geom(gp, ENXIO); - return (EBUSY); + return (0); } static struct g_class g_zero_class = { From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 8 09:12:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E7781065670; Sun, 8 Aug 2010 09:12:30 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8E58FC1D; Sun, 8 Aug 2010 09:12:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o789CUBv019058; Sun, 8 Aug 2010 09:12:30 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o789CUpd019053; Sun, 8 Aug 2010 09:12:30 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008080912.o789CUpd019053@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 8 Aug 2010 09:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211065 - stable/8/sys/geom/vinum X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 09:12:30 -0000 Author: jh Date: Sun Aug 8 09:12:30 2010 New Revision: 211065 URL: http://svn.freebsd.org/changeset/base/211065 Log: MFC r207878: - Don't return EAGAIN from gv_unload(). It was used to work around the deadlock fixed in r207671. - Wait for worker process to exit at class unload. The worker process was not guaranteed to exit before the linker unloaded the module. - Use 0 as the worker process exit status instead of ENXIO and style the NOTREACHED comment. Modified: stable/8/sys/geom/vinum/geom_vinum.c stable/8/sys/geom/vinum/geom_vinum.h stable/8/sys/geom/vinum/geom_vinum_events.c stable/8/sys/geom/vinum/geom_vinum_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/vinum/geom_vinum.c ============================================================================== --- stable/8/sys/geom/vinum/geom_vinum.c Sun Aug 8 09:06:59 2010 (r211064) +++ stable/8/sys/geom/vinum/geom_vinum.c Sun Aug 8 09:12:30 2010 (r211065) @@ -187,7 +187,7 @@ gv_init(struct g_class *mp) mtx_init(&sc->config_mtx, "gv_config", NULL, MTX_DEF); mtx_init(&sc->equeue_mtx, "gv_equeue", NULL, MTX_DEF); mtx_init(&sc->bqueue_mtx, "gv_bqueue", NULL, MTX_DEF); - kproc_create(gv_worker, sc, NULL, 0, 0, "gv_worker"); + kproc_create(gv_worker, sc, &sc->worker, 0, 0, "gv_worker"); } static int @@ -201,10 +201,9 @@ gv_unload(struct gctl_req *req, struct g sc = gp->softc; if (sc != NULL) { - gv_post_event(sc, GV_EVENT_THREAD_EXIT, NULL, NULL, 0, 0); + gv_worker_exit(sc); gp->softc = NULL; g_wither_geom(gp, ENXIO); - return (EAGAIN); } return (0); @@ -970,8 +969,8 @@ gv_worker(void *arg) g_free(sc->bqueue_down); g_free(sc->bqueue_up); g_free(sc); - kproc_exit(ENXIO); - break; /* not reached */ + kproc_exit(0); + /* NOTREACHED */ default: G_VINUM_DEBUG(1, "unknown event %d", ev->type); Modified: stable/8/sys/geom/vinum/geom_vinum.h ============================================================================== --- stable/8/sys/geom/vinum/geom_vinum.h Sun Aug 8 09:06:59 2010 (r211064) +++ stable/8/sys/geom/vinum/geom_vinum.h Sun Aug 8 09:12:30 2010 (r211065) @@ -122,6 +122,7 @@ int gv_detach_sd(struct gv_sd *, int) void gv_worker(void *); void gv_post_event(struct gv_softc *, int, void *, void *, intmax_t, intmax_t); +void gv_worker_exit(struct gv_softc *); struct gv_event *gv_get_event(struct gv_softc *); void gv_remove_event(struct gv_softc *, struct gv_event *); void gv_drive_tasted(struct gv_softc *, struct g_provider *); Modified: stable/8/sys/geom/vinum/geom_vinum_events.c ============================================================================== --- stable/8/sys/geom/vinum/geom_vinum_events.c Sun Aug 8 09:06:59 2010 (r211064) +++ stable/8/sys/geom/vinum/geom_vinum_events.c Sun Aug 8 09:12:30 2010 (r211065) @@ -58,6 +58,20 @@ gv_post_event(struct gv_softc *sc, int e mtx_unlock(&sc->equeue_mtx); } +void +gv_worker_exit(struct gv_softc *sc) +{ + struct gv_event *ev; + + ev = g_malloc(sizeof(*ev), M_WAITOK | M_ZERO); + ev->type = GV_EVENT_THREAD_EXIT; + + mtx_lock(&sc->equeue_mtx); + TAILQ_INSERT_TAIL(&sc->equeue, ev, events); + wakeup(sc); + msleep(sc->worker, &sc->equeue_mtx, PDROP, "gv_wor", 0); +} + struct gv_event * gv_get_event(struct gv_softc *sc) { Modified: stable/8/sys/geom/vinum/geom_vinum_var.h ============================================================================== --- stable/8/sys/geom/vinum/geom_vinum_var.h Sun Aug 8 09:06:59 2010 (r211064) +++ stable/8/sys/geom/vinum/geom_vinum_var.h Sun Aug 8 09:12:30 2010 (r211065) @@ -238,6 +238,7 @@ struct gv_softc { struct bio_queue_head *bqueue_up; /* BIO queue for completed requests. */ struct g_geom *geom; /* Pointer to our VINUM geom. */ + struct proc *worker; /* Worker process. */ }; #endif From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 8 12:19:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74CD7106566B; Sun, 8 Aug 2010 12:19:50 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 636A48FC28; Sun, 8 Aug 2010 12:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o78CJoCc061930; Sun, 8 Aug 2010 12:19:50 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o78CJojS061929; Sun, 8 Aug 2010 12:19:50 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008081219.o78CJojS061929@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 8 Aug 2010 12:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211067 - stable/8/sys/fs/devfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 12:19:50 -0000 Author: jh Date: Sun Aug 8 12:19:49 2010 New Revision: 211067 URL: http://svn.freebsd.org/changeset/base/211067 Log: MFC r208717: Don't try to call cdevsw d_close() method when devfs_close() is called because of insmntque1() failure. Modified: stable/8/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Sun Aug 8 09:40:09 2010 (r211066) +++ stable/8/sys/fs/devfs/devfs_vnops.c Sun Aug 8 12:19:49 2010 (r211067) @@ -459,6 +459,13 @@ devfs_close(struct vop_close_args *ap) int vp_locked, error; /* + * XXX: Don't call d_close() if we were called because of + * XXX: insmntque1() failure. + */ + if (vp->v_data == NULL) + return (0); + + /* * Hack: a tty device that is a controlling terminal * has a reference from the session structure. * We cannot easily tell that a character device is From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 8 13:43:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 319961065676; Sun, 8 Aug 2010 13:43:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 200E28FC1A; Sun, 8 Aug 2010 13:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o78DhLdA080942; Sun, 8 Aug 2010 13:43:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o78DhLVn080940; Sun, 8 Aug 2010 13:43:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008081343.o78DhLVn080940@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 8 Aug 2010 13:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211069 - stable/8/etc/rc.d X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 13:43:21 -0000 Author: jilles Date: Sun Aug 8 13:43:20 2010 New Revision: 211069 URL: http://svn.freebsd.org/changeset/base/211069 Log: MFC r210734: Allow starting ipmon if ipnat is enabled but ipfilter is not (in /etc/rc.conf). This fixes an apparent confusion between test(1) and sh(1) syntax for AND/OR. PR: conf/149036 Submitted by: pluknet Modified: stable/8/etc/rc.d/ipmon Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/ipmon ============================================================================== --- stable/8/etc/rc.d/ipmon Sun Aug 8 12:23:02 2010 (r211068) +++ stable/8/etc/rc.d/ipmon Sun Aug 8 13:43:20 2010 (r211069) @@ -20,7 +20,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 8 15:29:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F04E1065676; Sun, 8 Aug 2010 15:29:28 +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 F204A8FC1F; Sun, 8 Aug 2010 15:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o78FTRD6004919; Sun, 8 Aug 2010 15:29:27 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o78FTRM0004917; Sun, 8 Aug 2010 15:29:27 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201008081529.o78FTRM0004917@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 8 Aug 2010 15:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211074 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 15:29:28 -0000 Author: ume Date: Sun Aug 8 15:29:27 2010 New Revision: 211074 URL: http://svn.freebsd.org/changeset/base/211074 Log: MFC r210861: /etc/rc.d/ip6fw was deprecated. Modified: stable/8/etc/netstart Modified: stable/8/etc/netstart ============================================================================== --- stable/8/etc/netstart Sun Aug 8 14:37:16 2010 (r211073) +++ stable/8/etc/netstart Sun Aug 8 15:29:27 2010 (r211074) @@ -55,7 +55,6 @@ _start=quietstart /etc/rc.d/dhclient ${_start} /etc/rc.d/ppp ${_start} /etc/rc.d/ipfw ${_start} -/etc/rc.d/ip6fw ${_start} /etc/rc.d/network_ipv6 ${_start} /etc/rc.d/routing ${_start} /etc/rc.d/mroute6d ${_start} From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 9 07:58:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 396871065674; Mon, 9 Aug 2010 07:58:33 +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 1E0078FC16; Mon, 9 Aug 2010 07:58:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o797wXYw022630; Mon, 9 Aug 2010 07:58:33 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o797wXKP022628; Mon, 9 Aug 2010 07:58:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008090758.o797wXKP022628@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 9 Aug 2010 07:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211092 - stable/8/usr.sbin/fifolog/lib X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2010 07:58:33 -0000 Author: uqs Date: Mon Aug 9 07:58:32 2010 New Revision: 211092 URL: http://svn.freebsd.org/changeset/base/211092 Log: MFC r210930: Typo fixes PR: docs/149314 Submitted by: olgeni ------------------------------------------------------------------------ Modified: stable/8/usr.sbin/fifolog/lib/fifolog.h Directory Properties: stable/8/usr.sbin/fifolog/ (props changed) Modified: stable/8/usr.sbin/fifolog/lib/fifolog.h ============================================================================== --- stable/8/usr.sbin/fifolog/lib/fifolog.h Mon Aug 9 06:36:11 2010 (r211091) +++ stable/8/usr.sbin/fifolog/lib/fifolog.h Mon Aug 9 07:58:32 2010 (r211092) @@ -33,15 +33,15 @@ * Definitions for fifolog "protocol": the on-media layout. * * The fifolog on-media record has three layers: - * The outher timestamping and synchronization layer. - * The zlib implemented data compression + * The outer timestamping and synchronization layer. + * The zlib implemented data compression. * The inner sequencing and identification layer. * - * All three layers are synchronized at a subset of the outher layer + * All three layers are synchronized at a subset of the outer layer * record boundaries, from where reading can be initiated. * * - * The outher layer: + * The outer layer: * ----------------- * The first record in a fifolog contains a magic string and version * information along with a 32be encoded recordsize for all records @@ -55,7 +55,7 @@ * 0 32be sequence_number * The sequence number is randomly chosen for the * fifolog and increments once for each record written. - * It's precense allow quick identification of the next + * It's presence allow quick identification of the next * record to be written using a binary search for the * first place where a discontinuity in the sequence * numbers occur. @@ -89,14 +89,14 @@ * In most cases, the timer will expire before zlib has filled an entire * record in which case Z_SYNC_FLUSH will be used to force as much as * possible into the buffer before it is written. This is not marked - * in outher layer (apart from a natural correlation with padding) since + * in outer layer (apart from a natural correlation with padding) since * zlibs data stream handles this without help. * * * The inner layer: * ---------------- - * The inner layer contains data indentification and to the second - * timestamping (the timestamp in the outherlayer only marks the + * The inner layer contains data identification and to the second + * timestamping (the timestamp in the outer layer only marks the * first possible timestamp for content in the SYNC record). * * offset type contents @@ -113,7 +113,7 @@ * 4 32be time_t containing POSIX's understanding of UTC. * * Then follows the content, either as a NUL terminated string or as - * a lenght encoded binary sequence: + * a length encoded binary sequence: * * If (ident & FIFOLOG_LENGTH) the record is prefixed by: * {0|4} 8 length of binary data From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 9 14:25:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D478106567B; Mon, 9 Aug 2010 14:25:58 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9E28FC14; Mon, 9 Aug 2010 14:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o79EPw9K015191; Mon, 9 Aug 2010 14:25:58 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o79EPwx3015189; Mon, 9 Aug 2010 14:25:58 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201008091425.o79EPwx3015189@svn.freebsd.org> From: Fabien Thomas Date: Mon, 9 Aug 2010 14:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211096 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2010 14:25:58 -0000 Author: fabient Date: Mon Aug 9 14:25:58 2010 New Revision: 211096 URL: http://svn.freebsd.org/changeset/base/211096 Log: MFC r210766: Fix the calltree top view that incorrectly filter out some nodes. Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Mon Aug 9 12:36:36 2010 (r211095) +++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Mon Aug 9 14:25:58 2010 (r211096) @@ -354,6 +354,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct struct pmcpl_ct_sample *rsamples, int x, int *y) { int i, terminal; + struct pmcpl_ct_arc *arc; if (ct->pct_flags & PMCPL_PCT_TAG) return 0; @@ -372,12 +373,17 @@ pmcpl_ct_node_dumptop(int pmcin, struct * for at least one arc for that PMC. */ terminal = 1; - for (i = 0; i < ct->pct_narc; i++) + for (i = 0; i < ct->pct_narc; i++) { + arc = &ct->pct_arc[i]; if (PMCPL_CT_SAMPLE(pmcin, - &ct->pct_arc[i].pcta_samples) != 0) { + &arc->pcta_samples) != 0 && + PMCPL_CT_SAMPLEP(pmcin, + &arc->pcta_samples) > pmcstat_threshold && + (arc->pcta_child->pct_flags & PMCPL_PCT_TAG) == 0) { terminal = 0; break; } + } if (ct->pct_narc == 0 || terminal) { pmcpl_ct_topscreen[x+1][*y] = NULL; From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 9 14:29:23 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CD53106566C; Mon, 9 Aug 2010 14:29:23 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0128FC16; Mon, 9 Aug 2010 14:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o79ETNFE016056; Mon, 9 Aug 2010 14:29:23 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o79ETNuj016053; Mon, 9 Aug 2010 14:29:23 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201008091429.o79ETNuj016053@svn.freebsd.org> From: Fabien Thomas Date: Mon, 9 Aug 2010 14:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211098 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2010 14:29:23 -0000 Author: fabient Date: Mon Aug 9 14:29:23 2010 New Revision: 211098 URL: http://svn.freebsd.org/changeset/base/211098 Log: MFC r210794: Allow file as a top source, it works with socket now. This will allow top monitoring using socket/ssh tunnelling of system without local symbols. client: pmcstat -R : -T -r monitored device: pmcstat -Sinstructions -O : - Move the file read in the event loop - Initialize and clean log in all cases - Preserve global stats value during top refresh - Fix the rtld/line resolver that ignore '-r' prefix - Support socket for '-R' (server mode) - Display the statistics when exiting top mode Modified: stable/8/usr.sbin/pmcstat/pmcstat.c stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.c Mon Aug 9 14:26:52 2010 (r211097) +++ stable/8/usr.sbin/pmcstat/pmcstat.c Mon Aug 9 14:29:23 2010 (r211098) @@ -169,8 +169,7 @@ pmcstat_cleanup(void) args.pa_logparser = NULL; } - if (args.pa_flags & (FLAG_HAS_PIPE | FLAG_HAS_OUTPUT_LOGFILE)) - pmcstat_shutdown_logging(); + pmcstat_shutdown_logging(); } void @@ -559,7 +558,7 @@ main(int argc, char **argv) int do_print; size_t dummy; int graphdepth; - int pipefd[2]; + int pipefd[2], rfd; int use_cumulative_counts; short cf, cb; uint32_t cpumask; @@ -1001,11 +1000,6 @@ main(int argc, char **argv) (args.pa_flags & FLAG_READ_LOGFILE) == 0) errx(EX_USAGE, "ERROR: option -M is only used with -g/-R."); - /* -T is incompatible with -R (replay logfile is a TODO) */ - if ((args.pa_flags & FLAG_DO_TOP) && - (args.pa_flags & FLAG_READ_LOGFILE)) - errx(EX_USAGE, "ERROR: option -T is incompatible with -R."); - /* * Disallow textual output of sampling PMCs if counting PMCs * have also been asked for, mostly because the combined output @@ -1066,7 +1060,22 @@ main(int argc, char **argv) graphfilename); } - /* if we've been asked to process a log file, do that and exit */ + /* if we've been asked to process a log file, skip init */ + if ((args.pa_flags & FLAG_READ_LOGFILE) == 0) { + if (pmc_init() < 0) + err(EX_UNAVAILABLE, + "ERROR: Initialization of the pmc(3) library failed"); + + if ((npmc = pmc_npmc(0)) < 0) /* assume all CPUs are identical */ + err(EX_OSERR, "ERROR: Cannot determine the number of PMCs " + "on CPU %d", 0); + } + + /* Allocate a kqueue */ + if ((pmcstat_kq = kqueue()) < 0) + err(EX_OSERR, "ERROR: Cannot allocate kqueue"); + + /* Setup the logfile as the source. */ if (args.pa_flags & FLAG_READ_LOGFILE) { /* * Print the log in textual form if we haven't been @@ -1076,28 +1085,17 @@ main(int argc, char **argv) args.pa_flags |= FLAG_DO_PRINT; pmcstat_initialize_logging(); - args.pa_logfd = pmcstat_open_log(args.pa_inputpath, + rfd = pmcstat_open_log(args.pa_inputpath, PMCSTAT_OPEN_FOR_READ); - if ((args.pa_logparser = pmclog_open(args.pa_logfd)) == NULL) + if ((args.pa_logparser = pmclog_open(rfd)) == NULL) err(EX_OSERR, "ERROR: Cannot create parser"); - pmcstat_process_log(); - pmcstat_shutdown_logging(); - exit(EX_OK); + if (fcntl(rfd, F_SETFL, O_NONBLOCK) < 0) + err(EX_OSERR, "ERROR: fcntl(2) failed"); + EV_SET(&kev, rfd, EVFILT_READ, EV_ADD, + 0, 0, NULL); + if (kevent(pmcstat_kq, &kev, 1, NULL, 0, NULL) < 0) + err(EX_OSERR, "ERROR: Cannot register kevent"); } - - /* otherwise, we've been asked to collect data */ - if (pmc_init() < 0) - err(EX_UNAVAILABLE, - "ERROR: Initialization of the pmc(3) library failed"); - - if ((npmc = pmc_npmc(0)) < 0) /* assume all CPUs are identical */ - err(EX_OSERR, "ERROR: Cannot determine the number of PMCs " - "on CPU %d", 0); - - /* Allocate a kqueue */ - if ((pmcstat_kq = kqueue()) < 0) - err(EX_OSERR, "ERROR: Cannot allocate kqueue"); - /* * Configure the specified log file or setup a default log * consumer via a pipe. @@ -1140,6 +1138,7 @@ main(int argc, char **argv) (args.pa_flags & FLAG_HAS_OUTPUT_LOGFILE); /* + if (args.pa_flags & FLAG_READ_LOGFILE) { * Allocate PMCs. */ @@ -1272,10 +1271,8 @@ main(int argc, char **argv) if (args.pa_flags & FLAG_HAS_COMMANDLINE) pmcstat_start_process(); - /* initialize logging if printing the configured log */ - if ((args.pa_flags & (FLAG_DO_PRINT | FLAG_DO_TOP)) && - (args.pa_flags & (FLAG_HAS_PIPE | FLAG_HAS_OUTPUT_LOGFILE))) - pmcstat_initialize_logging(); + /* initialize logging */ + pmcstat_initialize_logging(); /* Handle SIGINT using the kqueue loop */ sa.sa_handler = SIG_IGN; @@ -1338,16 +1335,13 @@ main(int argc, char **argv) switch (kev.filter) { case EVFILT_PROC: /* target has exited */ - if (args.pa_flags & (FLAG_HAS_OUTPUT_LOGFILE | - FLAG_HAS_PIPE)) - runstate = pmcstat_close_log(); - else - runstate = PMCSTAT_FINISHED; + runstate = pmcstat_close_log(); do_print = 1; break; case EVFILT_READ: /* log file data is present */ - if (kev.ident == (unsigned)fileno(stdin)) { + if (kev.ident == (unsigned)fileno(stdin) && + (args.pa_flags & FLAG_DO_TOP)) { if (pmcstat_keypress_log()) runstate = pmcstat_close_log(); } else @@ -1370,15 +1364,8 @@ main(int argc, char **argv) * of its targets, or if logfile * writes encounter an error. */ - if (args.pa_flags & (FLAG_HAS_OUTPUT_LOGFILE | - FLAG_HAS_PIPE)) { - runstate = pmcstat_close_log(); - if (args.pa_flags & - (FLAG_DO_PRINT|FLAG_DO_ANALYSIS)) - pmcstat_process_log(); - } + runstate = pmcstat_close_log(); do_print = 1; /* print PMCs at exit */ - runstate = PMCSTAT_FINISHED; } else if (kev.ident == SIGINT) { /* Kill the child process if we started it */ if (args.pa_flags & FLAG_HAS_COMMANDLINE) @@ -1386,7 +1373,7 @@ main(int argc, char **argv) /* Close the pipe to self, if present. */ if (args.pa_flags & FLAG_HAS_PIPE) (void) close(pipefd[READPIPEFD]); - runstate = PMCSTAT_FINISHED; + runstate = pmcstat_close_log(); } else if (kev.ident == SIGWINCH) { if (ioctl(fileno(args.pa_printfile), TIOCGWINSZ, &ws) < 0) Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Mon Aug 9 14:26:52 2010 (r211097) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Mon Aug 9 14:29:23 2010 (r211098) @@ -141,6 +141,7 @@ struct pmcstat_image_hash_list pmcstat_i struct pmcstat_process_hash_list pmcstat_process_hash[PMCSTAT_NHASH]; struct pmcstat_stats pmcstat_stats; /* statistics */ +int ps_samples_period; /* samples count between top refresh. */ struct pmcstat_process *pmcstat_kernproc; /* kernel 'process' */ @@ -247,7 +248,7 @@ static int pmcstat_string_compute_hash(c static void pmcstat_string_initialize(void); static int pmcstat_string_lookup_hash(pmcstat_interned_string _is); static void pmcstat_string_shutdown(void); -static void pmcstat_stats_reset(void); +static void pmcstat_stats_reset(int _reset_global); /* * A simple implementation of interned strings. Each interned string @@ -276,7 +277,7 @@ int pmcstat_npmcs; int pmcstat_pause; static void -pmcstat_stats_reset(void) +pmcstat_stats_reset(int reset_global) { struct pmcstat_pmcrecord *pr; @@ -285,9 +286,11 @@ pmcstat_stats_reset(void) pr->pr_samples = 0; pr->pr_dubious_frames = 0; } + ps_samples_period = 0; /* Flush global stats. */ - bzero(&pmcstat_stats, sizeof(struct pmcstat_stats)); + if (reset_global) + bzero(&pmcstat_stats, sizeof(struct pmcstat_stats)); } /* @@ -606,7 +609,7 @@ pmcstat_image_get_elf_params(struct pmcs GElf_Phdr ph; GElf_Shdr sh; enum pmcstat_image_type image_type; - char buffer[PATH_MAX]; + char buffer[PATH_MAX], rtldpath[PATH_MAX]; assert(image->pi_type == PMCSTAT_IMAGE_UNKNOWN); @@ -686,9 +689,10 @@ pmcstat_image_get_elf_params(struct pmcs buffer, elf_errmsg(-1)); goto done; } + snprintf(rtldpath, sizeof(rtldpath), "%s%s", + args.pa_fsroot, elfbase + ph.p_offset); image->pi_dynlinkerpath = - pmcstat_string_intern(elfbase + - ph.p_offset); + pmcstat_string_intern(rtldpath); break; case PT_LOAD: if (ph.p_offset == 0) @@ -944,11 +948,13 @@ pmcstat_image_addr2line(struct pmcstat_i int fd; if (image->pi_addr2line == NULL) { - snprintf(imagepath, sizeof(imagepath), "%s.symbols", + snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", + args.pa_fsroot, pmcstat_string_unintern(image->pi_fullpath)); fd = open(imagepath, O_RDONLY); if (fd < 0) { - snprintf(imagepath, sizeof(imagepath), "%s", + snprintf(imagepath, sizeof(imagepath), "%s%s", + args.pa_fsroot, pmcstat_string_unintern(image->pi_fullpath)); } else close(fd); @@ -1399,6 +1405,7 @@ pmcstat_analyze_log(void) * bin inside this. */ pmcstat_stats.ps_samples_total++; + ps_samples_period++; pc = ev.pl_u.pl_s.pl_pc; pp = pmcstat_process_lookup(ev.pl_u.pl_s.pl_pid, @@ -1425,6 +1432,7 @@ pmcstat_analyze_log(void) case PMCLOG_TYPE_CALLCHAIN: pmcstat_stats.ps_samples_total++; + ps_samples_period++; cpuflags = ev.pl_u.pl_cc.pl_cpuflags; cpu = PMC_CALLCHAIN_CPUFLAGS_TO_CPU(cpuflags); @@ -1691,8 +1699,15 @@ pmcstat_print_log(void) int pmcstat_close_log(void) { - if (pmc_flush_logfile() < 0) - err(EX_OSERR, "ERROR: logging failed"); + /* If a local logfile is configured ask the kernel to stop + * and flush data. Kernel will close the file when data is flushed + * so keep the status to EXITING. + */ + if (args.pa_logfd != -1) { + if (pmc_flush_logfile() < 0) + err(EX_OSERR, "ERROR: logging failed"); + } + return (args.pa_flags & FLAG_HAS_PIPE ? PMCSTAT_EXITING : PMCSTAT_FINISHED); } @@ -1709,7 +1724,7 @@ pmcstat_close_log(void) int pmcstat_open_log(const char *path, int mode) { - int error, fd; + int error, fd, cfd; size_t hlen; const char *p, *errstr; struct addrinfo hints, *res, *res0; @@ -1730,7 +1745,7 @@ pmcstat_open_log(const char *path, int m */ if (path[0] == '-' && path[1] == '\0') fd = (mode == PMCSTAT_OPEN_FOR_READ) ? 0 : 1; - else if (mode == PMCSTAT_OPEN_FOR_WRITE && path[0] != '/' && + else if (path[0] != '/' && path[0] != '.' && strchr(path, ':') != NULL) { p = strrchr(path, ':'); @@ -1759,11 +1774,29 @@ pmcstat_open_log(const char *path, int m errstr = strerror(errno); continue; } - if (connect(fd, res->ai_addr, res->ai_addrlen) < 0) { - errstr = strerror(errno); + if (mode == PMCSTAT_OPEN_FOR_READ) { + if (bind(fd, res->ai_addr, res->ai_addrlen) < 0) { + errstr = strerror(errno); + (void) close(fd); + fd = -1; + continue; + } + listen(fd, 1); + cfd = accept(fd, NULL, NULL); (void) close(fd); - fd = -1; - continue; + if (cfd < 0) { + errstr = strerror(errno); + fd = -1; + break; + } + fd = cfd; + } else { + if (connect(fd, res->ai_addr, res->ai_addrlen) < 0) { + errstr = strerror(errno); + (void) close(fd); + fd = -1; + continue; + } } errstr = NULL; break; @@ -1833,9 +1866,8 @@ pmcstat_refresh_top(void) pmcstat_pmcinfilter); /* Format samples count. */ - if (pmcstat_stats.ps_samples_total > 0) - v = (pmcpr->pr_samples * 100.0) / - pmcstat_stats.ps_samples_total; + if (ps_samples_period > 0) + v = (pmcpr->pr_samples * 100.0) / ps_samples_period; else v = 0.; v_attrs = PMCSTAT_ATTRPERCENT(v); @@ -1872,7 +1904,7 @@ pmcstat_changefilter(void) do { pmcr = pmcstat_pmcindex_to_pmcr(pmcstat_pmcinfilter); - if (pmcr == pmcr->pr_merge) + if (pmcr == NULL || pmcr == pmcr->pr_merge) break; pmcstat_pmcinfilter++; @@ -1915,7 +1947,7 @@ pmcstat_keypress_log(void) */ if (plugins[args.pa_plugin].pl_shutdown != NULL) plugins[args.pa_plugin].pl_shutdown(NULL); - pmcstat_stats_reset(); + pmcstat_stats_reset(0); if (plugins[args.pa_plugin].pl_init != NULL) plugins[args.pa_plugin].pl_init(); @@ -1936,7 +1968,7 @@ pmcstat_keypress_log(void) } while (plugins[args.pa_plugin].pl_topdisplay == NULL); /* Open new plugin. */ - pmcstat_stats_reset(); + pmcstat_stats_reset(0); if (plugins[args.pa_plugin].pl_init != NULL) plugins[args.pa_plugin].pl_init(); wprintw(w, "switching to plugin %s", @@ -1986,7 +2018,7 @@ pmcstat_display_log(void) if (args.pa_topmode == PMCSTAT_TOP_DELTA) { if (plugins[args.pa_plugin].pl_shutdown != NULL) plugins[args.pa_plugin].pl_shutdown(NULL); - pmcstat_stats_reset(); + pmcstat_stats_reset(0); if (plugins[args.pa_plugin].pl_init != NULL) plugins[args.pa_plugin].pl_init(); } @@ -2130,8 +2162,7 @@ pmcstat_shutdown_logging(void) N, pmcstat_stats.ps_##V); \ } while (0) - if (args.pa_verbosity >= 1 && (args.pa_flags & FLAG_DO_ANALYSIS) && - (args.pa_flags & FLAG_DO_TOP) == 0) { + if (args.pa_verbosity >= 1 && (args.pa_flags & FLAG_DO_ANALYSIS)) { (void) fprintf(args.pa_printfile, "CONVERSION STATISTICS:\n"); PRINT("#exec/a.out", exec_aout); PRINT("#exec/elf", exec_elf); From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 9 14:32:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA4791065672; Mon, 9 Aug 2010 14:32:45 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5418FC1E; Mon, 9 Aug 2010 14:32:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o79EWjEF016888; Mon, 9 Aug 2010 14:32:45 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o79EWjAR016884; Mon, 9 Aug 2010 14:32:45 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201008091432.o79EWjAR016884@svn.freebsd.org> From: Fabien Thomas Date: Mon, 9 Aug 2010 14:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211100 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2010 14:32:45 -0000 Author: fabient Date: Mon Aug 9 14:32:45 2010 New Revision: 211100 URL: http://svn.freebsd.org/changeset/base/211100 Log: MFC r210797: - Do not use the runtime mask when logfile is specified. - Revert the fix on rtld path that is not necessary. Modified: stable/8/usr.sbin/pmcstat/pmcstat.c stable/8/usr.sbin/pmcstat/pmcstat.h stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.c Mon Aug 9 14:30:45 2010 (r211099) +++ stable/8/usr.sbin/pmcstat/pmcstat.c Mon Aug 9 14:32:45 2010 (r211100) @@ -641,6 +641,7 @@ main(int argc, char **argv) else cpumask = pmcstat_get_cpumask(optarg); + args.pa_flags |= FLAGS_HAS_CPUMASK; args.pa_required |= FLAG_HAS_SYSTEM_PMCS; break; @@ -884,6 +885,13 @@ main(int argc, char **argv) args.pa_argc = (argc -= optind); args.pa_argv = (argv += optind); + /* If we read from logfile and no specified CPU mask use + * the maximum CPU count. + */ + if ((args.pa_flags & FLAG_READ_LOGFILE) && + (args.pa_flags & FLAGS_HAS_CPUMASK) == 0) + cpumask = 0xffffffff; + args.pa_cpumask = cpumask; /* For selecting CPUs using -R. */ if (argc) /* command line present */ Modified: stable/8/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.h Mon Aug 9 14:30:45 2010 (r211099) +++ stable/8/usr.sbin/pmcstat/pmcstat.h Mon Aug 9 14:32:45 2010 (r211100) @@ -51,6 +51,7 @@ #define FLAG_DO_ANNOTATE 0x00008000 /* -m */ #define FLAG_DO_TOP 0x00010000 /* -T */ #define FLAG_DO_ANALYSIS 0x00020000 /* -g or -G or -m or -T */ +#define FLAGS_HAS_CPUMASK 0x00040000 /* -c */ #define DEFAULT_SAMPLE_COUNT 65536 #define DEFAULT_WAIT_INTERVAL 5.0 Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Mon Aug 9 14:30:45 2010 (r211099) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Mon Aug 9 14:32:45 2010 (r211100) @@ -609,7 +609,7 @@ pmcstat_image_get_elf_params(struct pmcs GElf_Phdr ph; GElf_Shdr sh; enum pmcstat_image_type image_type; - char buffer[PATH_MAX], rtldpath[PATH_MAX]; + char buffer[PATH_MAX]; assert(image->pi_type == PMCSTAT_IMAGE_UNKNOWN); @@ -689,10 +689,9 @@ pmcstat_image_get_elf_params(struct pmcs buffer, elf_errmsg(-1)); goto done; } - snprintf(rtldpath, sizeof(rtldpath), "%s%s", - args.pa_fsroot, elfbase + ph.p_offset); image->pi_dynlinkerpath = - pmcstat_string_intern(rtldpath); + pmcstat_string_intern(elfbase + + ph.p_offset); break; case PT_LOAD: if (ph.p_offset == 0) From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 10 10:15:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CD351065674; Tue, 10 Aug 2010 10:15:35 +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 3C3E08FC19; Tue, 10 Aug 2010 10:15:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7AAFZEF085577; Tue, 10 Aug 2010 10:15:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7AAFZtu085575; Tue, 10 Aug 2010 10:15:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008101015.o7AAFZtu085575@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Aug 2010 10:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211138 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 10:15:35 -0000 Author: kib Date: Tue Aug 10 10:15:34 2010 New Revision: 211138 URL: http://svn.freebsd.org/changeset/base/211138 Log: MFC r210796: When compat32 recvmsg(2) does not need to copy out control messages, set msg_controllen to 0. PR: kern/149227 Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 10 09:24:19 2010 (r211137) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 10 10:15:34 2010 (r211138) @@ -1062,6 +1062,8 @@ freebsd32_recvmsg(td, uap) if (control != NULL) error = freebsd32_copy_msg_out(&msg, control); + else + msg.msg_controllen = 0; if (error == 0) error = freebsd32_copyoutmsghdr(&msg, uap->msg); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 10 10:17:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A101106567B; Tue, 10 Aug 2010 10:17:01 +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 899968FC15; Tue, 10 Aug 2010 10:17:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7AAH1vd085954; Tue, 10 Aug 2010 10:17:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7AAH1L2085952; Tue, 10 Aug 2010 10:17:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008101017.o7AAH1L2085952@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Aug 2010 10:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211139 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 10:17:01 -0000 Author: kib Date: Tue Aug 10 10:17:01 2010 New Revision: 211139 URL: http://svn.freebsd.org/changeset/base/211139 Log: MFC r210805: Properly set ifi_datalen for compat32 struct if_data32. PR: kern/149240 Modified: stable/8/sys/net/rtsock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/rtsock.c ============================================================================== --- stable/8/sys/net/rtsock.c Tue Aug 10 10:15:34 2010 (r211138) +++ stable/8/sys/net/rtsock.c Tue Aug 10 10:17:01 2010 (r211139) @@ -1439,7 +1439,7 @@ copy_ifdata32(struct if_data *src, struc CP(*src, *dst, ifi_addrlen); CP(*src, *dst, ifi_hdrlen); CP(*src, *dst, ifi_link_state); - CP(*src, *dst, ifi_datalen); + dst->ifi_datalen = sizeof(struct if_data32); CP(*src, *dst, ifi_mtu); CP(*src, *dst, ifi_metric); CP(*src, *dst, ifi_baudrate); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 10 11:02:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7859C1065673; Tue, 10 Aug 2010 11:02:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67CCC8FC16; Tue, 10 Aug 2010 11:02:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7AB2tmj099116; Tue, 10 Aug 2010 11:02:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7AB2tko099114; Tue, 10 Aug 2010 11:02:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201008101102.o7AB2tko099114@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 10 Aug 2010 11:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211140 - stable/8/sys/geom/sched X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 11:02:55 -0000 Author: ae Date: Tue Aug 10 11:02:55 2010 New Revision: 211140 URL: http://svn.freebsd.org/changeset/base/211140 Log: MFC r210795: Check that gsp is not NULL before access. It can be NULL for some cases. Approved by: kib (mentor) Modified: stable/8/sys/geom/sched/g_sched.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/sched/g_sched.c ============================================================================== --- stable/8/sys/geom/sched/g_sched.c Tue Aug 10 10:17:01 2010 (r211139) +++ stable/8/sys/geom/sched/g_sched.c Tue Aug 10 11:02:55 2010 (r211140) @@ -1887,7 +1887,7 @@ g_sched_dumpconf(struct sbuf *sb, const if (indent == NULL) { /* plaintext */ sbuf_printf(sb, " algo %s", gsp ? gsp->gs_name : "--"); } - if (gsp->gs_dumpconf) + if (gsp != NULL && gsp->gs_dumpconf) gsp->gs_dumpconf(sb, indent, gp, cp, pp); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 10 19:50:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F313106568A; Tue, 10 Aug 2010 19:50:51 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E0388FC15; Tue, 10 Aug 2010 19:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7AJopTx017831; Tue, 10 Aug 2010 19:50:51 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7AJopH6017829; Tue, 10 Aug 2010 19:50:51 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201008101950.o7AJopH6017829@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 10 Aug 2010 19:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211154 - stable/8/usr.sbin/sysinstall X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 19:50:51 -0000 Author: gabor Date: Tue Aug 10 19:50:51 2010 New Revision: 211154 URL: http://svn.freebsd.org/changeset/base/211154 Log: MFC r210255: - Add Latinamerican keymaps to sysinstall's Makefile so that it can find them [1] - While here, also add a missing Spanish entry PR: bin/67365 [1] Submitted by: Pedro F. Giffuni [1] Approved by: delphij (mentor) Modified: stable/8/usr.sbin/sysinstall/Makefile Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/Makefile ============================================================================== --- stable/8/usr.sbin/sysinstall/Makefile Tue Aug 10 19:13:11 2010 (r211153) +++ stable/8/usr.sbin/sysinstall/Makefile Tue Aug 10 19:50:51 2010 (r211154) @@ -108,8 +108,9 @@ KEYMAPS= be.iso bg.bds.ctrlcaps bg.phone ce.iso2 cs.latin2.qwertz danish.iso el.iso07 \ estonian.cp850 estonian.iso estonian.iso15 finnish.iso fr.iso \ german.iso gr.elot.acc gr.us101.acc hr.iso hu.iso2.101keys \ - it.iso icelandic.iso jp.106 norwegian.iso pl_PL.ISO8859-2 \ - pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso swedish.iso \ + it.iso icelandic.iso jp.106 latinamerican latinamerican.iso.acc \ + norwegian.iso pl_PL.ISO8859-2 \ + pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso spanish.iso.acc swedish.iso \ swissfrench.iso \ swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \ us.iso us.pc-ctrl us.unix From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 11 03:08:04 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 834541065674; Wed, 11 Aug 2010 03:08:04 +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 4A4838FC1F; Wed, 11 Aug 2010 03:08:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B384JJ015795; Wed, 11 Aug 2010 03:08:04 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B384gd015790; Wed, 11 Aug 2010 03:08:04 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201008110308.o7B384gd015790@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Aug 2010 03:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211160 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 03:08:04 -0000 Author: rmacklem Date: Wed Aug 11 03:08:03 2010 New Revision: 211160 URL: http://svn.freebsd.org/changeset/base/211160 Log: MFC: r210786 Modify the return value for nfscl_mustflush() from boolean_t, which I mistakenly thought was correct w.r.t. style(9), back to int and add the checks for != 0. This is just a stylistic modification. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsclient/nfs_clstate.c stable/8/sys/fs/nfsclient/nfs_clsubs.c stable/8/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Wed Aug 11 02:28:39 2010 (r211159) +++ stable/8/sys/fs/nfs/nfs_var.h Wed Aug 11 03:08:03 2010 (r211160) @@ -469,7 +469,7 @@ void nfscl_docb(struct nfsrv_descript *, void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *); int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t, u_int64_t, struct flock *, NFSPROC_T *); -boolean_t nfscl_mustflush(vnode_t); +int nfscl_mustflush(vnode_t); int nfscl_nodeleg(vnode_t, int); int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *); int nfscl_getref(struct nfsmount *); Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Wed Aug 11 02:28:39 2010 (r211159) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Wed Aug 11 03:08:03 2010 (r211160) @@ -3735,7 +3735,7 @@ nfscl_tryclose(struct nfsclopen *op, str * to the server. This might be a big performance win in some environments. * (Not useful until the client does caching on local stable storage.) */ -APPLESTATIC boolean_t +APPLESTATIC int nfscl_mustflush(vnode_t vp) { struct nfsclclient *clp; @@ -3746,12 +3746,12 @@ nfscl_mustflush(vnode_t vp) np = VTONFS(vp); nmp = VFSTONFS(vnode_mount(vp)); if (!NFSHASNFSV4(nmp)) - return (TRUE); + return (1); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { NFSUNLOCKCLSTATE(); - return (TRUE); + return (1); } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & (NFSCLDL_WRITE | NFSCLDL_RECALL)) @@ -3759,10 +3759,10 @@ nfscl_mustflush(vnode_t vp) (dp->nfsdl_sizelimit >= np->n_size || !NFSHASSTRICT3530(nmp))) { NFSUNLOCKCLSTATE(); - return (FALSE); + return (0); } NFSUNLOCKCLSTATE(); - return (TRUE); + return (1); } /* Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clsubs.c Wed Aug 11 02:28:39 2010 (r211159) +++ stable/8/sys/fs/nfsclient/nfs_clsubs.c Wed Aug 11 03:08:03 2010 (r211160) @@ -187,8 +187,7 @@ ncl_getattrcache(struct vnode *vp, struc struct nfsnode *np; struct vattr *vap; struct nfsmount *nmp; - int timeo; - boolean_t mustflush; + int timeo, mustflush; np = VTONFS(vp); vap = &np->n_vattr.na_vattr; @@ -230,7 +229,7 @@ ncl_getattrcache(struct vnode *vp, struc #endif if ((time_second - np->n_attrstamp) >= timeo && - (mustflush || np->n_attrstamp == 0)) { + (mustflush != 0 || np->n_attrstamp == 0)) { newnfsstats.attrcache_misses++; mtx_unlock(&np->n_mtx); #ifdef NFS_ACDEBUG Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Wed Aug 11 02:28:39 2010 (r211159) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Wed Aug 11 03:08:03 2010 (r211160) @@ -506,7 +506,8 @@ nfs_open(struct vop_open_args *ap) * Now, if this Open will be doing reading, re-validate/flush the * cache, so that Close/Open coherency is maintained. */ - if ((fmode & FREAD) && (!NFS_ISV4(vp) || nfscl_mustflush(vp))) { + if ((fmode & FREAD) != 0 && + (!NFS_ISV4(vp) || nfscl_mustflush(vp) != 0)) { mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { mtx_unlock(&np->n_mtx); @@ -678,7 +679,7 @@ nfs_close(struct vop_close_args *ap) error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0); /* np->n_flag &= ~NMODIFIED; */ } else if (NFS_ISV4(vp)) { - if (nfscl_mustflush(vp)) { + if (nfscl_mustflush(vp) != 0) { int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0); @@ -720,7 +721,7 @@ nfs_close(struct vop_close_args *ap) /* * Get attributes so "change" is up to date. */ - if (error == 0 && nfscl_mustflush(vp)) { + if (error == 0 && nfscl_mustflush(vp) != 0) { ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva, NULL); if (!ret) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 11 06:29:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F87106566B; Wed, 11 Aug 2010 06:29:40 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B33B58FC12; Wed, 11 Aug 2010 06:29:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B6TeRR064488; Wed, 11 Aug 2010 06:29:40 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B6TetE064486; Wed, 11 Aug 2010 06:29:40 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201008110629.o7B6TetE064486@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 11 Aug 2010 06:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211165 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 06:29:40 -0000 Author: bschmidt Date: Wed Aug 11 06:29:40 2010 New Revision: 211165 URL: http://svn.freebsd.org/changeset/base/211165 Log: MFC r211063: License ACK is not required for the wpifw module nor when building it into the kernel. PR: conf/148758 Submitted by: Joe Talbott Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F317B106566B; Wed, 11 Aug 2010 07:02:10 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E22F68FC15; Wed, 11 Aug 2010 07:02:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B72AD5072307; Wed, 11 Aug 2010 07:02:10 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B729WN072306; Wed, 11 Aug 2010 07:02:09 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201008110702.o7B729WN072306@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 11 Aug 2010 07:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211169 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 07:02:11 -0000 Author: bschmidt Date: Wed Aug 11 07:02:08 2010 New Revision: 211169 URL: http://svn.freebsd.org/changeset/base/211169 Log: MFC r210959: Obviously the option is known as COMPAT_LINUX32 on amd64. PR: docs/149182 Pointed out by: Fernando Modified: stable/8/share/man/man4/linux.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/linux.4 ============================================================================== --- stable/8/share/man/man4/linux.4 Wed Aug 11 06:49:29 2010 (r211168) +++ stable/8/share/man/man4/linux.4 Wed Aug 11 07:02:08 2010 (r211169) @@ -31,13 +31,18 @@ .Nm linux .Nd Linux ABI support .Sh SYNOPSIS -To compile support for this ABI into the kernel, +To compile support for this ABI into an i386 kernel place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_LINUX" .Ed .Pp +for an amd64 kernel use: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUX32" +.Ed +.Pp Alternatively, to load the ABI as a module at boot time, place the following line in .Xr loader.conf 5 : From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 11 07:11:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2DB106567F; Wed, 11 Aug 2010 07:11:20 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 541DD8FC1F; Wed, 11 Aug 2010 07:11:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B7BK8B074501; Wed, 11 Aug 2010 07:11:20 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B7BKOE074498; Wed, 11 Aug 2010 07:11:20 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201008110711.o7B7BKOE074498@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 11 Aug 2010 07:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211171 - in stable/8/sys: amd64/conf i386/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 07:11:20 -0000 Author: bschmidt Date: Wed Aug 11 07:11:20 2010 New Revision: 211171 URL: http://svn.freebsd.org/changeset/base/211171 Log: MFC r210947: Fix whitespace nits. PR: conf/148989 Submitted by: pluknet Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/i386/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Wed Aug 11 07:05:27 2010 (r211170) +++ stable/8/sys/amd64/conf/GENERIC Wed Aug 11 07:11:20 2010 (r211171) @@ -72,7 +72,7 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -options FLOWTABLE # per-cpu routing cache +options FLOWTABLE # per-cpu routing cache #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/i386/conf/GENERIC ============================================================================== --- stable/8/sys/i386/conf/GENERIC Wed Aug 11 07:05:27 2010 (r211170) +++ stable/8/sys/i386/conf/GENERIC Wed Aug 11 07:11:20 2010 (r211171) @@ -73,7 +73,7 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -options FLOWTABLE # per-cpu routing cache +options FLOWTABLE # per-cpu routing cache #options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 11 08:58:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17EED1065676; Wed, 11 Aug 2010 08:58:28 +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 05D608FC0C; Wed, 11 Aug 2010 08:58:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B8wRVO099283; Wed, 11 Aug 2010 08:58:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B8wRcf099282; Wed, 11 Aug 2010 08:58:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008110858.o7B8wRcf099282@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 11 Aug 2010 08:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211173 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 08:58:28 -0000 Author: kib Date: Wed Aug 11 08:58:27 2010 New Revision: 211173 URL: http://svn.freebsd.org/changeset/base/211173 Log: MFC r210847: Fix style. Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 11 08:26:15 2010 (r211172) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 11 08:58:27 2010 (r211173) @@ -1619,8 +1619,9 @@ freebsd32_sendfile(struct thread *td, st } static void -copy_stat( struct stat *in, struct stat32 *out) +copy_stat(struct stat *in, struct stat32 *out) { + CP(*in, *out, st_dev); CP(*in, *out, st_ino); CP(*in, *out, st_mode); From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 11 09:04:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55066106566B; Wed, 11 Aug 2010 09:04: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 4403F8FC15; Wed, 11 Aug 2010 09:04:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B94bNw000857; Wed, 11 Aug 2010 09:04:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B94b3F000856; Wed, 11 Aug 2010 09:04:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008110904.o7B94b3F000856@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 11 Aug 2010 09:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211174 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 09:04:38 -0000 Author: kib Date: Wed Aug 11 09:04:36 2010 New Revision: 211174 URL: http://svn.freebsd.org/changeset/base/211174 Log: MFC r210848: Copy inode birthtime to the struct stat32. Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 11 08:58:27 2010 (r211173) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 11 09:04:36 2010 (r211174) @@ -1637,6 +1637,7 @@ copy_stat(struct stat *in, struct stat32 CP(*in, *out, st_blksize); CP(*in, *out, st_flags); CP(*in, *out, st_gen); + TS_CP(*in, *out, st_birthtimespec); } int From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 12 05:59:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD4C6106567B; Thu, 12 Aug 2010 05:59:55 +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 BC5A38FC16; Thu, 12 Aug 2010 05:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7C5xtIk090365; Thu, 12 Aug 2010 05:59:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7C5xtDR090364; Thu, 12 Aug 2010 05:59:55 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201008120559.o7C5xtDR090364@svn.freebsd.org> From: Martin Matuska Date: Thu, 12 Aug 2010 05:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211205 - stable/8/sys/boot/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 05:59:55 -0000 Author: mm Date: Thu Aug 12 05:59:55 2010 New Revision: 211205 URL: http://svn.freebsd.org/changeset/base/211205 Log: MFC r211091: Return EIO if vdev->v_phys_read is NULL. This fixes booting from a ZFS mirror with a unavailable primary device. PR: kern/148655 Reviewed by: avg Approved by: delphij (mentor) Modified: stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Thu Aug 12 01:08:50 2010 (r211204) +++ stable/8/sys/boot/zfs/zfsimpl.c Thu Aug 12 05:59:55 2010 (r211205) @@ -328,6 +328,9 @@ vdev_read_phys(vdev_t *vdev, const blkpt size_t psize; int rc; + if (!vdev->v_phys_read) + return (EIO); + if (bp) { psize = BP_GET_PSIZE(bp); } else { From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 12 20:18:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F99D1065674; Thu, 12 Aug 2010 20:18:07 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8088FC15; Thu, 12 Aug 2010 20:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7CKI7b5083995; Thu, 12 Aug 2010 20:18:07 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7CKI6qK083986; Thu, 12 Aug 2010 20:18:06 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201008122018.o7CKI6qK083986@svn.freebsd.org> From: Jack F Vogel Date: Thu, 12 Aug 2010 20:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211241 - in stable/8/sys: conf dev/e1000 modules/em modules/igb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 20:18:07 -0000 Author: jfv Date: Thu Aug 12 20:18:06 2010 New Revision: 211241 URL: http://svn.freebsd.org/changeset/base/211241 Log: MFC of e1000 changes Many bug fixes, major new feature: the igb vf driver. Added: stable/8/sys/dev/e1000/e1000_mbx.c - copied unchanged from r209616, head/sys/dev/e1000/e1000_mbx.c stable/8/sys/dev/e1000/e1000_mbx.h - copied unchanged from r209616, head/sys/dev/e1000/e1000_mbx.h stable/8/sys/dev/e1000/e1000_vf.c - copied unchanged from r209616, head/sys/dev/e1000/e1000_vf.c stable/8/sys/dev/e1000/e1000_vf.h - copied unchanged from r209616, head/sys/dev/e1000/e1000_vf.h Modified: stable/8/sys/conf/files stable/8/sys/dev/e1000/e1000_82575.h stable/8/sys/dev/e1000/e1000_api.c stable/8/sys/dev/e1000/e1000_api.h stable/8/sys/dev/e1000/e1000_hw.h stable/8/sys/dev/e1000/e1000_osdep.h stable/8/sys/dev/e1000/e1000_regs.h stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/e1000/if_igb.c stable/8/sys/dev/e1000/if_igb.h stable/8/sys/dev/e1000/if_lem.c stable/8/sys/modules/em/Makefile stable/8/sys/modules/igb/Makefile Directory Properties: stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/conf/files Thu Aug 12 20:18:06 2010 (r211241) @@ -932,6 +932,10 @@ dev/e1000/e1000_nvm.c optional em | igb compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_phy.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_vf.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_mbx.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_osdep.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/et/if_et.c optional et Modified: stable/8/sys/dev/e1000/e1000_82575.h ============================================================================== --- stable/8/sys/dev/e1000/e1000_82575.h Thu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/dev/e1000/e1000_82575.h Thu Aug 12 20:18:06 2010 (r211241) @@ -459,5 +459,16 @@ struct e1000_adv_tx_context_desc { #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); +enum e1000_promisc_type { + e1000_promisc_disabled = 0, /* all promisc modes disabled */ + e1000_promisc_unicast = 1, /* unicast promiscuous enabled */ + e1000_promisc_multicast = 2, /* multicast promiscuous enabled */ + e1000_promisc_enabled = 3, /* both uni and multicast promisc */ + e1000_num_promisc_types +}; + +void e1000_vfta_set_vf(struct e1000_hw *, u16, bool); +void e1000_rlpml_set_vf(struct e1000_hw *, u16); +s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type); u16 e1000_rxpbs_adjust_82580(u32 data); #endif /* _E1000_82575_H_ */ Modified: stable/8/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_api.c Thu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/dev/e1000/e1000_api.c Thu Aug 12 20:18:06 2010 (r211241) @@ -112,6 +112,31 @@ out: return ret_val; } +/** + * e1000_init_mbx_params - Initialize mailbox function pointers + * @hw: pointer to the HW structure + * + * This function initializes the function pointers for the PHY + * set of functions. Called by drivers or by e1000_setup_init_funcs. + **/ +s32 e1000_init_mbx_params(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + + if (hw->mbx.ops.init_params) { + ret_val = hw->mbx.ops.init_params(hw); + if (ret_val) { + DEBUGOUT("Mailbox Initialization Error\n"); + goto out; + } + } else { + DEBUGOUT("mbx.init_mbx_params was NULL\n"); + ret_val = -E1000_ERR_CONFIG; + } + +out: + return ret_val; +} /** * e1000_set_mac_type - Sets MAC type @@ -281,6 +306,9 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_82580_COPPER_DUAL: mac->type = e1000_82580; break; + case E1000_DEV_ID_82576_VF: + mac->type = e1000_vfadapt; + break; default: /* Should never have loaded on this device */ ret_val = -E1000_ERR_MAC_INIT; @@ -326,6 +354,7 @@ s32 e1000_setup_init_funcs(struct e1000_ e1000_init_mac_ops_generic(hw); e1000_init_phy_ops_generic(hw); e1000_init_nvm_ops_generic(hw); + e1000_init_mbx_ops_generic(hw); /* * Set up the init function pointers. These are functions within the @@ -374,6 +403,9 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_82580: e1000_init_function_pointers_82575(hw); break; + case e1000_vfadapt: + e1000_init_function_pointers_vf(hw); + break; default: DEBUGOUT("Hardware not supported\n"); ret_val = -E1000_ERR_CONFIG; @@ -396,6 +428,10 @@ s32 e1000_setup_init_funcs(struct e1000_ ret_val = e1000_init_phy_params(hw); if (ret_val) goto out; + + ret_val = e1000_init_mbx_params(hw); + if (ret_val) + goto out; } out: Modified: stable/8/sys/dev/e1000/e1000_api.h ============================================================================== --- stable/8/sys/dev/e1000/e1000_api.h Thu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/dev/e1000/e1000_api.h Thu Aug 12 20:18:06 2010 (r211241) @@ -55,6 +55,7 @@ s32 e1000_setup_init_funcs(struct e1000 s32 e1000_init_mac_params(struct e1000_hw *hw); s32 e1000_init_nvm_params(struct e1000_hw *hw); s32 e1000_init_phy_params(struct e1000_hw *hw); +s32 e1000_init_mbx_params(struct e1000_hw *hw); s32 e1000_get_bus_info(struct e1000_hw *hw); void e1000_clear_vfta(struct e1000_hw *hw); void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value); Modified: stable/8/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/8/sys/dev/e1000/e1000_hw.h Thu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/dev/e1000/e1000_hw.h Thu Aug 12 20:18:06 2010 (r211241) @@ -134,6 +134,7 @@ struct e1000_hw; #define E1000_DEV_ID_82576_NS 0x150A #define E1000_DEV_ID_82576_NS_SERDES 0x1518 #define E1000_DEV_ID_82576_SERDES_QUAD 0x150D +#define E1000_DEV_ID_82576_VF 0x10CA #define E1000_DEV_ID_82575EB_COPPER 0x10A7 #define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9 #define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6 @@ -186,6 +187,7 @@ enum e1000_mac_type { e1000_82575, e1000_82576, e1000_82580, + e1000_vfadapt, e1000_num_macs /* List is 1-based, so subtract 1 for TRUE count. */ }; @@ -531,6 +533,37 @@ struct e1000_hw_stats { u64 doosync; }; +struct e1000_vf_stats { + u64 base_gprc; + u64 base_gptc; + u64 base_gorc; + u64 base_gotc; + u64 base_mprc; + u64 base_gotlbc; + u64 base_gptlbc; + u64 base_gorlbc; + u64 base_gprlbc; + + u32 last_gprc; + u32 last_gptc; + u32 last_gorc; + u32 last_gotc; + u32 last_mprc; + u32 last_gotlbc; + u32 last_gptlbc; + u32 last_gorlbc; + u32 last_gprlbc; + + u64 gprc; + u64 gptc; + u64 gorc; + u64 gotc; + u64 mprc; + u64 gotlbc; + u64 gptlbc; + u64 gorlbc; + u64 gprlbc; +}; struct e1000_phy_stats { u32 idle_errors; @@ -581,6 +614,7 @@ struct e1000_host_mng_command_info { #include "e1000_phy.h" #include "e1000_nvm.h" #include "e1000_manage.h" +#include "e1000_mbx.h" struct e1000_mac_operations { /* Function pointers for the MAC. */ @@ -758,6 +792,7 @@ struct e1000_fc_info { u32 high_water; /* Flow control high-water mark */ u32 low_water; /* Flow control low-water mark */ u16 pause_time; /* Flow control pause timer */ + u16 refresh_time; /* Flow control refresh timer */ bool send_xon; /* Flow control send XON */ bool strict_ieee; /* Strict IEEE mode */ enum e1000_fc_mode current_mode; /* FC mode in effect */ @@ -805,6 +840,33 @@ struct e1000_dev_spec_ich8lan { bool nvm_k1_enabled; }; +struct e1000_mbx_operations { + s32 (*init_params)(struct e1000_hw *hw); + s32 (*read)(struct e1000_hw *, u32 *, u16, u16); + s32 (*write)(struct e1000_hw *, u32 *, u16, u16); + s32 (*read_posted)(struct e1000_hw *, u32 *, u16, u16); + s32 (*write_posted)(struct e1000_hw *, u32 *, u16, u16); + s32 (*check_for_msg)(struct e1000_hw *, u16); + s32 (*check_for_ack)(struct e1000_hw *, u16); + s32 (*check_for_rst)(struct e1000_hw *, u16); +}; + +struct e1000_mbx_stats { + u32 msgs_tx; + u32 msgs_rx; + u32 acks; + u32 reqs; + u32 rsts; +}; + +struct e1000_mbx_info { + struct e1000_mbx_operations ops; + struct e1000_mbx_stats stats; + u32 timeout; + u32 usec_delay; + u16 size; +}; + struct e1000_dev_spec_82575 { bool sgmii_active; bool global_device_reset; @@ -828,6 +890,7 @@ struct e1000_hw { struct e1000_phy_info phy; struct e1000_nvm_info nvm; struct e1000_bus_info bus; + struct e1000_mbx_info mbx; struct e1000_host_mng_dhcp_cookie mng_cookie; union { Copied: stable/8/sys/dev/e1000/e1000_mbx.c (from r209616, head/sys/dev/e1000/e1000_mbx.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/e1000/e1000_mbx.c Thu Aug 12 20:18:06 2010 (r211241, copy of r209616, head/sys/dev/e1000/e1000_mbx.c) @@ -0,0 +1,762 @@ +/****************************************************************************** + + Copyright (c) 2001-2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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$*/ + +#include "e1000_mbx.h" + +/** + * e1000_null_mbx_check_for_flag - No-op function, return 0 + * @hw: pointer to the HW structure + **/ +static s32 e1000_null_mbx_check_for_flag(struct e1000_hw *hw, u16 mbx_id) +{ + DEBUGFUNC("e1000_null_mbx_check_flag"); + + return E1000_SUCCESS; +} + +/** + * e1000_null_mbx_transact - No-op function, return 0 + * @hw: pointer to the HW structure + **/ +static s32 e1000_null_mbx_transact(struct e1000_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + DEBUGFUNC("e1000_null_mbx_rw_msg"); + + return E1000_SUCCESS; +} + +/** + * e1000_read_mbx - Reads a message from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfuly read message from buffer + **/ +s32 e1000_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_read_mbx"); + + /* limit read to size of mailbox */ + if (size > mbx->size) + size = mbx->size; + + if (mbx->ops.read) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); + + return ret_val; +} + +/** + * e1000_write_mbx - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_write_mbx"); + + if (size > mbx->size) + ret_val = -E1000_ERR_MBX; + + else if (mbx->ops.write) + ret_val = mbx->ops.write(hw, msg, size, mbx_id); + + return ret_val; +} + +/** + * e1000_check_for_msg - checks to see if someone sent us mail + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 e1000_check_for_msg(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_msg"); + + if (mbx->ops.check_for_msg) + ret_val = mbx->ops.check_for_msg(hw, mbx_id); + + return ret_val; +} + +/** + * e1000_check_for_ack - checks to see if someone sent us ACK + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 e1000_check_for_ack(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_ack"); + + if (mbx->ops.check_for_ack) + ret_val = mbx->ops.check_for_ack(hw, mbx_id); + + return ret_val; +} + +/** + * e1000_check_for_rst - checks to see if other side has reset + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 e1000_check_for_rst(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_rst"); + + if (mbx->ops.check_for_rst) + ret_val = mbx->ops.check_for_rst(hw, mbx_id); + + return ret_val; +} + +/** + * e1000_poll_for_msg - Wait for message notification + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message notification + **/ +static s32 e1000_poll_for_msg(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; + + DEBUGFUNC("e1000_poll_for_msg"); + + if (!countdown || !mbx->ops.check_for_msg) + goto out; + + while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) { + countdown--; + if (!countdown) + break; + usec_delay(mbx->usec_delay); + } + + /* if we failed, all future posted messages fail until reset */ + if (!countdown) + mbx->timeout = 0; +out: + return countdown ? E1000_SUCCESS : -E1000_ERR_MBX; +} + +/** + * e1000_poll_for_ack - Wait for message acknowledgement + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message acknowledgement + **/ +static s32 e1000_poll_for_ack(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; + + DEBUGFUNC("e1000_poll_for_ack"); + + if (!countdown || !mbx->ops.check_for_ack) + goto out; + + while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) { + countdown--; + if (!countdown) + break; + usec_delay(mbx->usec_delay); + } + + /* if we failed, all future posted messages fail until reset */ + if (!countdown) + mbx->timeout = 0; +out: + return countdown ? E1000_SUCCESS : -E1000_ERR_MBX; +} + +/** + * e1000_read_posted_mbx - Wait for message notification and receive message + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message notification and + * copied it into the receive buffer. + **/ +s32 e1000_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_read_posted_mbx"); + + if (!mbx->ops.read) + goto out; + + ret_val = e1000_poll_for_msg(hw, mbx_id); + + /* if ack received read message, otherwise we timed out */ + if (!ret_val) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); +out: + return ret_val; +} + +/** + * e1000_write_posted_mbx - Write a message to the mailbox, wait for ack + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer and + * received an ack to that message within delay * timeout period + **/ +s32 e1000_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_write_posted_mbx"); + + /* exit if either we can't write or there isn't a defined timeout */ + if (!mbx->ops.write || !mbx->timeout) + goto out; + + /* send msg */ + ret_val = mbx->ops.write(hw, msg, size, mbx_id); + + /* if msg sent wait until we receive an ack */ + if (!ret_val) + ret_val = e1000_poll_for_ack(hw, mbx_id); +out: + return ret_val; +} + +/** + * e1000_init_mbx_ops_generic - Initialize mbx function pointers + * @hw: pointer to the HW structure + * + * Sets the function pointers to no-op functions + **/ +void e1000_init_mbx_ops_generic(struct e1000_hw *hw) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + mbx->ops.init_params = e1000_null_ops_generic; + mbx->ops.read = e1000_null_mbx_transact; + mbx->ops.write = e1000_null_mbx_transact; + mbx->ops.check_for_msg = e1000_null_mbx_check_for_flag; + mbx->ops.check_for_ack = e1000_null_mbx_check_for_flag; + mbx->ops.check_for_rst = e1000_null_mbx_check_for_flag; + mbx->ops.read_posted = e1000_read_posted_mbx; + mbx->ops.write_posted = e1000_write_posted_mbx; +} + +/** + * e1000_read_v2p_mailbox - read v2p mailbox + * @hw: pointer to the HW structure + * + * This function is used to read the v2p mailbox without losing the read to + * clear status bits. + **/ +static u32 e1000_read_v2p_mailbox(struct e1000_hw *hw) +{ + u32 v2p_mailbox = E1000_READ_REG(hw, E1000_V2PMAILBOX(0)); + + v2p_mailbox |= hw->dev_spec.vf.v2p_mailbox; + hw->dev_spec.vf.v2p_mailbox |= v2p_mailbox & E1000_V2PMAILBOX_R2C_BITS; + + return v2p_mailbox; +} + +/** + * e1000_check_for_bit_vf - Determine if a status bit was set + * @hw: pointer to the HW structure + * @mask: bitmask for bits to be tested and cleared + * + * This function is used to check for the read to clear bits within + * the V2P mailbox. + **/ +static s32 e1000_check_for_bit_vf(struct e1000_hw *hw, u32 mask) +{ + u32 v2p_mailbox = e1000_read_v2p_mailbox(hw); + s32 ret_val = -E1000_ERR_MBX; + + if (v2p_mailbox & mask) + ret_val = E1000_SUCCESS; + + hw->dev_spec.vf.v2p_mailbox &= ~mask; + + return ret_val; +} + +/** + * e1000_check_for_msg_vf - checks to see if the PF has sent mail + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the PF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_msg_vf(struct e1000_hw *hw, u16 mbx_id) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_msg_vf"); + + if (!e1000_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFSTS)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.reqs++; + } + + return ret_val; +} + +/** + * e1000_check_for_ack_vf - checks to see if the PF has ACK'd + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the PF has set the ACK bit or else ERR_MBX + **/ +static s32 e1000_check_for_ack_vf(struct e1000_hw *hw, u16 mbx_id) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_ack_vf"); + + if (!e1000_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFACK)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.acks++; + } + + return ret_val; +} + +/** + * e1000_check_for_rst_vf - checks to see if the PF has reset + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns TRUE if the PF has set the reset done bit or else FALSE + **/ +static s32 e1000_check_for_rst_vf(struct e1000_hw *hw, u16 mbx_id) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_rst_vf"); + + if (!e1000_check_for_bit_vf(hw, (E1000_V2PMAILBOX_RSTD | + E1000_V2PMAILBOX_RSTI))) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.rsts++; + } + + return ret_val; +} + +/** + * e1000_obtain_mbx_lock_vf - obtain mailbox lock + * @hw: pointer to the HW structure + * + * return SUCCESS if we obtained the mailbox lock + **/ +static s32 e1000_obtain_mbx_lock_vf(struct e1000_hw *hw) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_obtain_mbx_lock_vf"); + + /* Take ownership of the buffer */ + E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_VFU); + + /* reserve mailbox for vf use */ + if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU) + ret_val = E1000_SUCCESS; + + return ret_val; +} + +/** + * e1000_write_mbx_vf - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val; + u16 i; + + + DEBUGFUNC("e1000_write_mbx_vf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_vf(hw); + if (ret_val) + goto out_no_write; + + /* flush msg and acks as we are overwriting the message buffer */ + e1000_check_for_msg_vf(hw, 0); + e1000_check_for_ack_vf(hw, 0); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(0), i, msg[i]); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + + /* Drop VFU and interrupt the PF to tell it a message has been sent */ + E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_REQ); + +out_no_write: + return ret_val; +} + +/** + * e1000_read_mbx_vf - Reads a message from the inbox intended for vf + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfuly read message from buffer + **/ +static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val = E1000_SUCCESS; + u16 i; + + DEBUGFUNC("e1000_read_mbx_vf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_vf(hw); + if (ret_val) + goto out_no_read; + + /* copy the message from the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(0), i); + + /* Acknowledge receipt and release mailbox, then we're done */ + E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_ACK); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + +out_no_read: + return ret_val; +} + +/** + * e1000_init_mbx_params_vf - set initial values for vf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for vf mailbox + */ +s32 e1000_init_mbx_params_vf(struct e1000_hw *hw) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + + /* start mailbox as timed out and let the reset_hw call set the timeout + * value to begin communications */ + mbx->timeout = 0; + mbx->usec_delay = E1000_VF_MBX_INIT_DELAY; + + mbx->size = E1000_VFMAILBOX_SIZE; + + mbx->ops.read = e1000_read_mbx_vf; + mbx->ops.write = e1000_write_mbx_vf; + mbx->ops.read_posted = e1000_read_posted_mbx; + mbx->ops.write_posted = e1000_write_posted_mbx; + mbx->ops.check_for_msg = e1000_check_for_msg_vf; + mbx->ops.check_for_ack = e1000_check_for_ack_vf; + mbx->ops.check_for_rst = e1000_check_for_rst_vf; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; + + return E1000_SUCCESS; +} + +static s32 e1000_check_for_bit_pf(struct e1000_hw *hw, u32 mask) +{ + u32 mbvficr = E1000_READ_REG(hw, E1000_MBVFICR); + s32 ret_val = -E1000_ERR_MBX; + + if (mbvficr & mask) { + ret_val = E1000_SUCCESS; + E1000_WRITE_REG(hw, E1000_MBVFICR, mask); + } + + return ret_val; +} + +/** + * e1000_check_for_msg_pf - checks to see if the VF has sent mail + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * returns SUCCESS if the VF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_msg_pf(struct e1000_hw *hw, u16 vf_number) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_msg_pf"); + + if (!e1000_check_for_bit_pf(hw, E1000_MBVFICR_VFREQ_VF1 << vf_number)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.reqs++; + } + + return ret_val; +} + +/** + * e1000_check_for_ack_pf - checks to see if the VF has ACKed + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * returns SUCCESS if the VF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_ack_pf(struct e1000_hw *hw, u16 vf_number) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_ack_pf"); + + if (!e1000_check_for_bit_pf(hw, E1000_MBVFICR_VFACK_VF1 << vf_number)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.acks++; + } + + return ret_val; +} + +/** + * e1000_check_for_rst_pf - checks to see if the VF has reset + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * returns SUCCESS if the VF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_rst_pf(struct e1000_hw *hw, u16 vf_number) +{ + u32 vflre = E1000_READ_REG(hw, E1000_VFLRE); + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_rst_pf"); + + if (vflre & (1 << vf_number)) { + ret_val = E1000_SUCCESS; + E1000_WRITE_REG(hw, E1000_VFLRE, (1 << vf_number)); + hw->mbx.stats.rsts++; + } + + return ret_val; +} + +/** + * e1000_obtain_mbx_lock_pf - obtain mailbox lock + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * return SUCCESS if we obtained the mailbox lock + **/ +static s32 e1000_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number) +{ + s32 ret_val = -E1000_ERR_MBX; + u32 p2v_mailbox; + + DEBUGFUNC("e1000_obtain_mbx_lock_pf"); + + /* Take ownership of the buffer */ + E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU); + + /* reserve mailbox for vf use */ + p2v_mailbox = E1000_READ_REG(hw, E1000_P2VMAILBOX(vf_number)); + if (p2v_mailbox & E1000_P2VMAILBOX_PFU) + ret_val = E1000_SUCCESS; + + return ret_val; +} + +/** + * e1000_write_mbx_pf - Places a message in the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @vf_number: the VF index + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +static s32 e1000_write_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 vf_number) +{ + s32 ret_val; + u16 i; + + DEBUGFUNC("e1000_write_mbx_pf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_pf(hw, vf_number); + if (ret_val) + goto out_no_write; + + /* flush msg and acks as we are overwriting the message buffer */ + e1000_check_for_msg_pf(hw, vf_number); + e1000_check_for_ack_pf(hw, vf_number); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(vf_number), i, msg[i]); + + /* Interrupt VF to tell it a message has been sent and release buffer*/ + E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_STS); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + +out_no_write: + return ret_val; + +} + +/** + * e1000_read_mbx_pf - Read a message from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @vf_number: the VF index + * + * This function copies a message from the mailbox buffer to the caller's + * memory buffer. The presumption is that the caller knows that there was + * a message due to a VF request so no polling for message is needed. + **/ +static s32 e1000_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 vf_number) +{ + s32 ret_val; + u16 i; + + DEBUGFUNC("e1000_read_mbx_pf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_pf(hw, vf_number); + if (ret_val) + goto out_no_read; + + /* copy the message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(vf_number), i); + + /* Acknowledge the message and release buffer */ + E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_ACK); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + +out_no_read: + return ret_val; +} + +/** + * e1000_init_mbx_params_pf - set initial values for pf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for pf mailbox + */ +s32 e1000_init_mbx_params_pf(struct e1000_hw *hw) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + + if (hw->mac.type == e1000_82576) { + mbx->timeout = 0; + mbx->usec_delay = 0; + + mbx->size = E1000_VFMAILBOX_SIZE; + + mbx->ops.read = e1000_read_mbx_pf; + mbx->ops.write = e1000_write_mbx_pf; + mbx->ops.read_posted = e1000_read_posted_mbx; + mbx->ops.write_posted = e1000_write_posted_mbx; + mbx->ops.check_for_msg = e1000_check_for_msg_pf; + mbx->ops.check_for_ack = e1000_check_for_ack_pf; + mbx->ops.check_for_rst = e1000_check_for_rst_pf; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; + } + + return E1000_SUCCESS; +} + Copied: stable/8/sys/dev/e1000/e1000_mbx.h (from r209616, head/sys/dev/e1000/e1000_mbx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/e1000/e1000_mbx.h Thu Aug 12 20:18:06 2010 (r211241, copy of r209616, head/sys/dev/e1000/e1000_mbx.h) @@ -0,0 +1,106 @@ +/****************************************************************************** + + Copyright (c) 2001-2010, Intel Corporation *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 13 11:24:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BF221065696; Fri, 13 Aug 2010 11:24:03 +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 ED1208FC0A; Fri, 13 Aug 2010 11:24:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7DBO21U086585; Fri, 13 Aug 2010 11:24:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7DBO2cm086583; Fri, 13 Aug 2010 11:24:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008131124.o7DBO2cm086583@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Aug 2010 11:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211279 - stable/8/sys/dev/usb/quirk X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Aug 2010 11:24:03 -0000 Author: kib Date: Fri Aug 13 11:24:02 2010 New Revision: 211279 URL: http://svn.freebsd.org/changeset/base/211279 Log: MFC r210931: Disable sync cache for the Transcend Jetflash V90. Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Fri Aug 13 09:58:17 2010 (r211278) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Fri Aug 13 11:24:02 2010 (r211279) @@ -159,6 +159,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(ALCOR, AU6390, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ALCOR, TRANSCEND, 0x0142, 0x0142, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(APACER, HT202, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 14 00:50:26 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B8C1065670; Sat, 14 Aug 2010 00:50:26 +0000 (UTC) (envelope-from yar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9123A8FC08; Sat, 14 Aug 2010 00:50:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7E0oQfZ011841; Sat, 14 Aug 2010 00:50:26 GMT (envelope-from yar@svn.freebsd.org) Received: (from yar@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7E0oQX6011839; Sat, 14 Aug 2010 00:50:26 GMT (envelope-from yar@svn.freebsd.org) Message-Id: <201008140050.o7E0oQX6011839@svn.freebsd.org> From: Yar Tikhiy Date: Sat, 14 Aug 2010 00:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211294 - stable/8/usr.sbin/iostat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 00:50:26 -0000 Author: yar Date: Sat Aug 14 00:50:26 2010 New Revision: 211294 URL: http://svn.freebsd.org/changeset/base/211294 Log: MFC r211001: Move the sentences telling the defaults for -c and -w to where they belong. Previously they were misplaced, i.e., swapped. Modified: stable/8/usr.sbin/iostat/iostat.8 Directory Properties: stable/8/usr.sbin/iostat/ (props changed) Modified: stable/8/usr.sbin/iostat/iostat.8 ============================================================================== --- stable/8/usr.sbin/iostat/iostat.8 Fri Aug 13 22:39:11 2010 (r211293) +++ stable/8/usr.sbin/iostat/iostat.8 Sat Aug 14 00:50:26 2010 (r211294) @@ -100,9 +100,9 @@ The options are as follows: Repeat the display .Ar count times. -If no -.Ar wait -interval is specified, the default is 1 second. +If no repeat +.Ar count +is specified, the default is infinity. .It Fl C Display CPU statistics. This is on by default, unless @@ -236,9 +236,9 @@ is specified. Pause .Ar wait seconds between each display. -If no repeat -.Ar count -is specified, the default is infinity. +If no +.Ar wait +interval is specified, the default is 1 second. .It Fl x Show extended disk statistics. Each disk is displayed on a line of its own with all available statistics. From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 14 13:44:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D300106566B; Sat, 14 Aug 2010 13:44:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 122238FC08; Sat, 14 Aug 2010 13:44:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7EDiOrr028979; Sat, 14 Aug 2010 13:44:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7EDiOg7028977; Sat, 14 Aug 2010 13:44:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201008141344.o7EDiOg7028977@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 14 Aug 2010 13:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211296 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 13:44:25 -0000 Author: bz Date: Sat Aug 14 13:44:24 2010 New Revision: 211296 URL: http://svn.freebsd.org/changeset/base/211296 Log: MFC r210686: MFp4 @181628: Free the rtentry after we diconnected it from the FIB and are counting it as rttrash. There might still be a chance we leak it from a different code path but there is nothing we can do about this here. Modified: stable/8/sys/netinet/in_rmx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/in_rmx.c ============================================================================== --- stable/8/sys/netinet/in_rmx.c Sat Aug 14 09:29:42 2010 (r211295) +++ stable/8/sys/netinet/in_rmx.c Sat Aug 14 13:44:24 2010 (r211296) @@ -408,14 +408,28 @@ in_ifadownkill(struct radix_node *rn, vo if (rt->rt_ifa == ap->ifa && (ap->del || !(rt->rt_flags & RTF_STATIC))) { /* - * We need to disable the automatic prune that happens - * in this case in rtrequest() because it will blow - * away the pointers that rn_walktree() needs in order - * continue our descent. We will end up deleting all - * the routes that rtrequest() would have in any case, - * so that behavior is not needed there. + * Aquire a reference so that it can later be freed + * as the refcount would be 0 here in case of at least + * ap->del. + */ + RT_ADDREF(rt); + /* + * Disconnect it from the tree and permit protocols + * to cleanup. */ rtexpunge(rt); + /* + * At this point it is an rttrash node, and in case + * the above is the only reference we must free it. + * If we do not noone will have a pointer and the + * rtentry will be leaked forever. + * In case someone else holds a reference, we are + * fine as we only decrement the refcount. In that + * case if the other entity calls RT_REMREF, we + * will still be leaking but at least we tried. + */ + RTFREE_LOCKED(rt); + return (0); } RT_UNLOCK(rt); return 0; From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 14 14:09:14 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B2351065694; Sat, 14 Aug 2010 14:09:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3E68FC19; Sat, 14 Aug 2010 14:09:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7EE9EvC029596; Sat, 14 Aug 2010 14:09:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7EE9EZZ029594; Sat, 14 Aug 2010 14:09:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008141409.o7EE9EZZ029594@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 14 Aug 2010 14:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211300 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 14:09:14 -0000 Author: kib Date: Sat Aug 14 14:09:13 2010 New Revision: 211300 URL: http://svn.freebsd.org/changeset/base/211300 Log: MFC r211005: Add compat32 definition for (old) struct ostat. Modified: stable/8/sys/compat/freebsd32/freebsd32.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Sat Aug 14 14:01:12 2010 (r211299) +++ stable/8/sys/compat/freebsd32/freebsd32.h Sat Aug 14 14:09:13 2010 (r211300) @@ -157,6 +157,24 @@ struct stat32 { unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); }; +struct ostat32 { + __uint16_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + __uint16_t st_uid; + __uint16_t st_gid; + __uint16_t st_rdev; + __int32_t st_size; + struct timespec32 st_atim; + struct timespec32 st_mtim; + struct timespec32 st_ctim; + __int32_t st_blksize; + __int32_t st_blocks; + u_int32_t st_flags; + __uint32_t st_gen; +}; + struct jail32_v0 { u_int32_t version; uint32_t path; From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 14 14:14:00 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6810B10657C0; Sat, 14 Aug 2010 14:13:58 +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 565448FC13; Sat, 14 Aug 2010 14:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7EEDwul029788; Sat, 14 Aug 2010 14:13:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7EEDwtj029784; Sat, 14 Aug 2010 14:13:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008141413.o7EEDwtj029784@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 14 Aug 2010 14:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211302 - in stable/8/sys: amd64/ia32 compat/freebsd32 ia64/ia32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 14:14:00 -0000 Author: kib Date: Sat Aug 14 14:13:58 2010 New Revision: 211302 URL: http://svn.freebsd.org/changeset/base/211302 Log: MFC r211006: Prefer struct sysentvec sv_psstrings to hardcoding FREEBSD32_PS_STRINGS in the compat32 code. Use sv_usrstack instead of FREEBSD32_USRSTACK as well. Modified: stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/ia64/ia32/ia32_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Sat Aug 14 14:13:44 2010 (r211301) +++ stable/8/sys/amd64/ia32/ia32_signal.c Sat Aug 14 14:13:58 2010 (r211302) @@ -387,7 +387,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi } regs->tf_rsp = (uintptr_t)sfp; - regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode; + regs->tf_rip = p->p_sysent->sv_psstrings - sz_freebsd4_ia32_sigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -508,7 +508,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * } regs->tf_rsp = (uintptr_t)sfp; - regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_rip = p->p_sysent->sv_psstrings - *(p->p_sysent->sv_szsigcode); regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Aug 14 14:13:44 2010 (r211301) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Aug 14 14:13:58 2010 (r211302) @@ -2544,7 +2544,8 @@ freebsd32_copyout_strings(struct image_p execpath_len = strlen(imgp->execpath) + 1; else execpath_len = 0; - arginfo = (struct freebsd32_ps_strings *)FREEBSD32_PS_STRINGS; + arginfo = (struct freebsd32_ps_strings *)curproc->p_sysent-> + sv_psstrings; szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - roundup(execpath_len, sizeof(char *)) - Modified: stable/8/sys/ia64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/ia64/ia32/ia32_signal.c Sat Aug 14 14:13:44 2010 (r211301) +++ stable/8/sys/ia64/ia32/ia32_signal.c Sat Aug 14 14:13:58 2010 (r211302) @@ -128,7 +128,9 @@ ia32_setregs(struct thread *td, u_long e u_int64_t codeseg, dataseg, gdtseg, ldtseg; struct segment_descriptor desc; struct vmspace *vmspace = td->td_proc->p_vmspace; + struct sysentvec *sv; + sv = td->td_proc->p_sysent; exec_setregs(td, entry, stack, ps_strings); /* Non-syscall frames are cleared by exec_setregs() */ @@ -142,7 +144,7 @@ ia32_setregs(struct thread *td, u_long e tf->tf_special.sp = stack; /* Point the RSE backstore to something harmless. */ - tf->tf_special.bspstore = (FREEBSD32_PS_STRINGS - sz_ia32_sigcode - + tf->tf_special.bspstore = (sv->sv_psstrings - sz_ia32_sigcode - SPARE_USRSPACE + 15) & ~15; codesel = LSEL(LUCODE_SEL, SEL_UPL); @@ -157,7 +159,7 @@ ia32_setregs(struct thread *td, u_long e /* * Build the GDT and LDT. */ - gdt = FREEBSD32_USRSTACK; + gdt = sv->sv_usrstack; vm_map_find(&vmspace->vm_map, 0, 0, &gdt, IA32_PAGE_SIZE << 1, 0, VM_PROT_ALL, VM_PROT_ALL, 0); ldt = gdt + IA32_PAGE_SIZE; @@ -173,12 +175,12 @@ ia32_setregs(struct thread *td, u_long e desc.sd_hibase = ldt >> 24; copyout(&desc, (caddr_t) gdt + 8*GLDT_SEL, sizeof(desc)); - desc.sd_lolimit = ((FREEBSD32_USRSTACK >> 12) - 1) & 0xffff; + desc.sd_lolimit = ((sv->sv_usrstack >> 12) - 1) & 0xffff; desc.sd_lobase = 0; desc.sd_type = SDT_MEMERA; desc.sd_dpl = SEL_UPL; desc.sd_p = 1; - desc.sd_hilimit = ((FREEBSD32_USRSTACK >> 12) - 1) >> 16; + desc.sd_hilimit = ((sv->sv_usrstack >> 12) - 1) >> 16; desc.sd_def32 = 1; desc.sd_gran = 1; desc.sd_hibase = 0; @@ -187,14 +189,14 @@ ia32_setregs(struct thread *td, u_long e copyout(&desc, (caddr_t) ldt + 8*LUDATA_SEL, sizeof(desc)); codeseg = 0 /* base */ - + (((FREEBSD32_USRSTACK >> 12) - 1) << 32) /* limit */ + + (((sv->sv_usrstack >> 12) - 1) << 32) /* limit */ + ((long)SDT_MEMERA << 52) + ((long)SEL_UPL << 57) + (1L << 59) /* present */ + (1L << 62) /* 32 bits */ + (1L << 63); /* page granularity */ dataseg = 0 /* base */ - + (((FREEBSD32_USRSTACK >> 12) - 1) << 32) /* limit */ + + (((sv->sv_usrstack >> 12) - 1) << 32) /* limit */ + ((long)SDT_MEMRWA << 52) + ((long)SEL_UPL << 57) + (1L << 59) /* present */ @@ -231,7 +233,7 @@ ia32_setregs(struct thread *td, u_long e ia64_set_eflag(PSL_USER); /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */ - tf->tf_scratch.gr11 = FREEBSD32_PS_STRINGS; + tf->tf_scratch.gr11 = td->td_proc->p_sysent->sv_psstrings; /* * XXX - Linux emulator From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 14 18:40:06 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E8421065672; Sat, 14 Aug 2010 18:40:06 +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 E71768FC0C; Sat, 14 Aug 2010 18:40:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7EIe5g5035715; Sat, 14 Aug 2010 18:40:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7EIe5ju035714; Sat, 14 Aug 2010 18:40:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008141840.o7EIe5ju035714@svn.freebsd.org> From: Warner Losh Date: Sat, 14 Aug 2010 18:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211310 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 18:40:06 -0000 Author: imp Date: Sat Aug 14 18:40:05 2010 New Revision: 211310 URL: http://svn.freebsd.org/changeset/base/211310 Log: Map COMPAT_IA32 to COMPAT_FREEBSD32 Added: stable/8/sys/conf/options-compat (contents, props changed) Added: stable/8/sys/conf/options-compat ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/conf/options-compat Sat Aug 14 18:40:05 2010 (r211310) @@ -0,0 +1,2 @@ +# $FreeBSD$ +COMPAT_IA32 COMPAT_FREEBSD32 From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 14 19:36:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53BFB106564A; Sat, 14 Aug 2010 19:36:49 +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 423458FC16; Sat, 14 Aug 2010 19:36:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7EJanWD036877; Sat, 14 Aug 2010 19:36:49 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7EJanQS036875; Sat, 14 Aug 2010 19:36:49 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008141936.o7EJanQS036875@svn.freebsd.org> From: Andre Oppermann Date: Sat, 14 Aug 2010 19:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211312 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 19:36:49 -0000 Author: andre Date: Sat Aug 14 19:36:48 2010 New Revision: 211312 URL: http://svn.freebsd.org/changeset/base/211312 Log: MFC r210666: Fix a bug in syncache where the initial CWND for new incoming connections was limited to one segment under the faulty assumption of a retransmit. Due to this the opportunity to initialize the increased congestion window according to RFC3390 was missed. Modified: stable/8/sys/netinet/tcp_syncache.c Modified: stable/8/sys/netinet/tcp_syncache.c ============================================================================== --- stable/8/sys/netinet/tcp_syncache.c Sat Aug 14 18:58:05 2010 (r211311) +++ stable/8/sys/netinet/tcp_syncache.c Sat Aug 14 19:36:48 2010 (r211312) @@ -804,8 +804,9 @@ syncache_socket(struct syncache *sc, str /* * If the SYN,ACK was retransmitted, reset cwnd to 1 segment. + * NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits. */ - if (sc->sc_rxmits) + if (sc->sc_rxmits > 1) tp->snd_cwnd = tp->t_maxseg; tcp_timer_activate(tp, TT_KEEP, tcp_keepinit);